diff --git a/main.js b/main.js index 0531128..125427e 100644 --- a/main.js +++ b/main.js @@ -1,18 +1,18 @@ -var _u=Object.create;var Ko=Object.defineProperty;var $u=Object.getOwnPropertyDescriptor;var ed=Object.getOwnPropertyNames;var td=Object.getPrototypeOf,rd=Object.prototype.hasOwnProperty;var He=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nd=(e,t)=>{for(var r in t)Ko(e,r,{get:t[r],enumerable:!0})},ks=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ed(t))!rd.call(e,o)&&o!==r&&Ko(e,o,{get:()=>t[o],enumerable:!(n=$u(t,o))||n.enumerable});return e};var Xo=(e,t,r)=>(r=e!=null?_u(td(e)):{},ks(t||!e||!e.__esModule?Ko(r,"default",{value:e,enumerable:!0}):r,e)),od=e=>ks(Ko({},"__esModule",{value:!0}),e);var It=He(Ke=>{"use strict";var dd=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function hd(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Ke.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)hd(r,n)&&(e[n]=r[n])}}return e};Ke.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var pd={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),o);return}for(var i=0;i{"use strict";var md=It(),gd=4,$s=0,ef=1,yd=2;function Zr(e){for(var t=e.length;--t>=0;)e[t]=0}var bd=0,sf=1,xd=2,Fd=3,wd=258,na=29,Hn=256,In=Hn+1+na,Xr=30,oa=19,ff=2*In+1,br=15,Qi=16,Sd=7,ia=256,lf=16,cf=17,uf=18,ta=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ei=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Pd=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],df=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Dd=512,zt=new Array((In+2)*2);Zr(zt);var Mn=new Array(Xr*2);Zr(Mn);var zn=new Array(Dd);Zr(zn);var jn=new Array(wd-Fd+1);Zr(jn);var aa=new Array(na);Zr(aa);var ti=new Array(Xr);Zr(ti);function _i(e,t,r,n,o){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=e&&e.length}var hf,pf,vf;function $i(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function mf(e){return e<256?zn[e]:zn[256+(e>>>7)]}function Ln(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function _e(e,t,r){e.bi_valid>Qi-r?(e.bi_buf|=t<>Qi-e.bi_valid,e.bi_valid+=r-Qi):(e.bi_buf|=t<>>=1,r<<=1;while(--t>0);return r>>>1}function Cd(e){e.bi_valid===16?(Ln(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function kd(e,t){var r=t.dyn_tree,n=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,f,c,u,d,p,h,b=0;for(d=0;d<=br;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;fl&&(d=l,b++),r[c*2+1]=d,!(c>n)&&(e.bl_count[d]++,p=0,c>=s&&(p=a[c-s]),h=r[c*2],e.opt_len+=h*(d+p),i&&(e.static_len+=h*(o[c*2+1]+p)));if(b!==0){do{for(d=l-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,b-=2}while(b>0);for(d=l;d!==0;d--)for(c=e.bl_count[d];c!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function yf(e,t,r){var n=new Array(br+1),o=0,i,a;for(i=1;i<=br;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=gf(n[s]++,s))}}function Td(){var e,t,r,n,o,i=new Array(br+1);for(r=0,n=0;n>=7;n8?Ln(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Ed(e,t,r,n){xf(e),n&&(Ln(e,r),Ln(e,~r)),md.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function tf(e,t,r,n){var o=t*2,i=r*2;return e[o]>1;a>=1;a--)ea(e,r,a);f=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ea(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[f*2]=r[a*2]+r[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=f,e.heap[1]=f++,ea(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],kd(e,t),yf(r,l,e.bl_count)}function nf(e,t,r){var n,o=-1,i,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=t[(n+1)*2+1],!(++s=3&&e.bl_tree[df[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Rd(e,t,r,n){var o;for(_e(e,t-257,5),_e(e,r-1,5),_e(e,n-4,4),o=0;o>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return $s;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return ef;for(r=32;r0?(e.strm.data_type===yd&&(e.strm.data_type=Od(e)),ra(e,e.l_desc),ra(e,e.d_desc),a=Ad(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&t!==-1?Ff(e,t,r,n):e.strategy===gd||i===o?(_e(e,(sf<<1)+(n?1:0),3),rf(e,zt,Mn)):(_e(e,(xd<<1)+(n?1:0),3),Rd(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),rf(e,e.dyn_ltree,e.dyn_dtree)),bf(e),n&&xf(e)}function Id(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(jn[r]+Hn+1)*2]++,e.dyn_dtree[mf(t)*2]++),e.last_lit===e.lit_bufsize-1}Yr._tr_init=Bd;Yr._tr_stored_block=Ff;Yr._tr_flush_block=Md;Yr._tr_tally=Id;Yr._tr_align=Nd});var sa=He((qm,Sf)=>{"use strict";function zd(e,t,r,n){for(var o=e&65535|0,i=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do o=o+t[n++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0}Sf.exports=zd});var fa=He((Wm,Pf)=>{"use strict";function jd(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Ld=jd();function Hd(e,t,r,n){var o=Ld,i=n+r;e^=-1;for(var a=n;a>>8^o[(e^t[a])&255];return e^-1}Pf.exports=Hd});var ri=He((Gm,Df)=>{"use strict";Df.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Nf=He(kt=>{"use strict";var Xe=It(),st=wf(),Ef=sa(),Kt=fa(),Ud=ri(),Sr=0,Vd=1,qd=3,Qt=4,Cf=5,Ct=0,kf=1,ft=-2,Wd=-3,la=-5,Gd=-1,Kd=1,ni=2,Xd=3,Zd=4,Yd=0,Jd=2,si=8,Qd=9,_d=15,$d=8,eh=29,th=256,ua=th+1+eh,rh=30,nh=19,oh=2*ua+1,ih=15,de=3,Yt=258,gt=Yt+de+1,ah=32,fi=42,da=69,oi=73,ii=91,ai=103,xr=113,Vn=666,Be=1,qn=2,Fr=3,_r=4,sh=3;function Jt(e,t){return e.msg=Ud[t],t}function Tf(e){return(e<<1)-(e>4?9:0)}function Zt(e){for(var t=e.length;--t>=0;)e[t]=0}function Xt(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(Xe.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function ze(e,t){st._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Xt(e.strm)}function he(e,t){e.pending_buf[e.pending++]=t}function Un(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function fh(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),o===0?0:(e.avail_in-=o,Xe.arraySet(t,e.input,e.next_in,o,r),e.state.wrap===1?e.adler=Ef(e.adler,t,o,r):e.state.wrap===2&&(e.adler=Kt(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function Af(e,t){var r=e.max_chain_length,n=e.strstart,o,i,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-gt?e.strstart-(e.w_size-gt):0,f=e.window,c=e.w_mask,u=e.prev,d=e.strstart+Yt,p=f[n+a-1],h=f[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(f[o+a]!==h||f[o+a-1]!==p||f[o]!==f[n]||f[++o]!==f[n+1])){n+=2,o++;do;while(f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&na){if(e.match_start=t,a=i,i>=s)break;p=f[n+a-1],h=f[n+a]}}while((t=u[t&c])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function wr(e){var t=e.w_size,r,n,o,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-gt)){Xe.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do o=e.head[--r],e.head[r]=o>=t?o-t:0;while(--n);n=t,r=n;do o=e.prev[--r],e.prev[r]=o>=t?o-t:0;while(--n);i+=t}if(e.strm.avail_in===0)break;if(n=fh(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=n,e.lookahead+e.insert>=de)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(wr(e),e.lookahead===0&&t===Sr)return Be;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,ze(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-gt&&(ze(e,!1),e.strm.avail_out===0))return Be}return e.insert=0,t===Qt?(ze(e,!0),e.strm.avail_out===0?Fr:_r):(e.strstart>e.block_start&&(ze(e,!1),e.strm.avail_out===0),Be)}function ca(e,t){for(var r,n;;){if(e.lookahead=de&&(e.ins_h=(e.ins_h<=de)if(n=st._tr_tally(e,e.strstart-e.match_start,e.match_length-de),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=de){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=de&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=de-1)),e.prev_length>=de&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-de,n=st._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-de),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<=de&&e.strstart>0&&(o=e.strstart-1,n=a[o],n===a[++o]&&n===a[++o]&&n===a[++o])){i=e.strstart+Yt;do;while(n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&oe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=de?(r=st._tr_tally(e,1,e.match_length-de),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=st._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ze(e,!1),e.strm.avail_out===0))return Be}return e.insert=0,t===Qt?(ze(e,!0),e.strm.avail_out===0?Fr:_r):e.last_lit&&(ze(e,!1),e.strm.avail_out===0)?Be:qn}function uh(e,t){for(var r;;){if(e.lookahead===0&&(wr(e),e.lookahead===0)){if(t===Sr)return Be;break}if(e.match_length=0,r=st._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ze(e,!1),e.strm.avail_out===0))return Be}return e.insert=0,t===Qt?(ze(e,!0),e.strm.avail_out===0?Fr:_r):e.last_lit&&(ze(e,!1),e.strm.avail_out===0)?Be:qn}function Dt(e,t,r,n,o){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=o}var Qr;Qr=[new Dt(0,0,0,0,lh),new Dt(4,4,8,4,ca),new Dt(4,5,16,8,ca),new Dt(4,6,32,32,ca),new Dt(4,4,16,16,Jr),new Dt(8,16,32,32,Jr),new Dt(8,16,128,128,Jr),new Dt(8,32,128,256,Jr),new Dt(32,128,258,1024,Jr),new Dt(32,258,258,4096,Jr)];function dh(e){e.window_size=2*e.w_size,Zt(e.head),e.max_lazy_match=Qr[e.level].max_lazy,e.good_match=Qr[e.level].good_length,e.nice_match=Qr[e.level].nice_length,e.max_chain_length=Qr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=de-1,e.match_available=0,e.ins_h=0}function hh(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=si,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Xe.Buf16(oh*2),this.dyn_dtree=new Xe.Buf16((2*rh+1)*2),this.bl_tree=new Xe.Buf16((2*nh+1)*2),Zt(this.dyn_ltree),Zt(this.dyn_dtree),Zt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Xe.Buf16(ih+1),this.heap=new Xe.Buf16(2*ua+1),Zt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Xe.Buf16(2*ua+1),Zt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Rf(e){var t;return!e||!e.state?Jt(e,ft):(e.total_in=e.total_out=0,e.data_type=Jd,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?fi:xr,e.adler=t.wrap===2?0:1,t.last_flush=Sr,st._tr_init(t),Ct)}function Of(e){var t=Rf(e);return t===Ct&&dh(e.state),t}function ph(e,t){return!e||!e.state||e.state.wrap!==2?ft:(e.state.gzhead=t,Ct)}function Bf(e,t,r,n,o,i){if(!e)return ft;var a=1;if(t===Gd&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>Qd||r!==si||n<8||n>15||t<0||t>9||i<0||i>Zd)return Jt(e,ft);n===8&&(n=9);var s=new hh;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<Cf||t<0)return e?Jt(e,ft):ft;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Vn&&t!==Qt)return Jt(e,e.avail_out===0?la:ft);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===fi)if(n.wrap===2)e.adler=0,he(n,31),he(n,139),he(n,8),n.gzhead?(he(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),he(n,n.gzhead.time&255),he(n,n.gzhead.time>>8&255),he(n,n.gzhead.time>>16&255),he(n,n.gzhead.time>>24&255),he(n,n.level===9?2:n.strategy>=ni||n.level<2?4:0),he(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(he(n,n.gzhead.extra.length&255),he(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Kt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=da):(he(n,0),he(n,0),he(n,0),he(n,0),he(n,0),he(n,n.level===9?2:n.strategy>=ni||n.level<2?4:0),he(n,sh),n.status=xr);else{var a=si+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=ni||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=ah),a+=31-a%31,n.status=xr,Un(n,a),n.strstart!==0&&(Un(n,e.adler>>>16),Un(n,e.adler&65535)),e.adler=1}if(n.status===da)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Kt(e.adler,n.pending_buf,n.pending-o,o)),Xt(e),o=n.pending,n.pending===n.pending_buf_size));)he(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=Kt(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=oi)}else n.status=oi;if(n.status===oi)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Kt(e.adler,n.pending_buf,n.pending-o,o)),Xt(e),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindexo&&(e.adler=Kt(e.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.gzindex=0,n.status=ii)}else n.status=ii;if(n.status===ii)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Kt(e.adler,n.pending_buf,n.pending-o,o)),Xt(e),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindexo&&(e.adler=Kt(e.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.status=ai)}else n.status=ai;if(n.status===ai&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Xt(e),n.pending+2<=n.pending_buf_size&&(he(n,e.adler&255),he(n,e.adler>>8&255),e.adler=0,n.status=xr)):n.status=xr),n.pending!==0){if(Xt(e),e.avail_out===0)return n.last_flush=-1,Ct}else if(e.avail_in===0&&Tf(t)<=Tf(r)&&t!==Qt)return Jt(e,la);if(n.status===Vn&&e.avail_in!==0)return Jt(e,la);if(e.avail_in!==0||n.lookahead!==0||t!==Sr&&n.status!==Vn){var l=n.strategy===ni?uh(n,t):n.strategy===Xd?ch(n,t):Qr[n.level].func(n,t);if((l===Fr||l===_r)&&(n.status=Vn),l===Be||l===Fr)return e.avail_out===0&&(n.last_flush=-1),Ct;if(l===qn&&(t===Vd?st._tr_align(n):t!==Cf&&(st._tr_stored_block(n,0,0,!1),t===qd&&(Zt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Xt(e),e.avail_out===0))return n.last_flush=-1,Ct}return t!==Qt?Ct:n.wrap<=0?kf:(n.wrap===2?(he(n,e.adler&255),he(n,e.adler>>8&255),he(n,e.adler>>16&255),he(n,e.adler>>24&255),he(n,e.total_in&255),he(n,e.total_in>>8&255),he(n,e.total_in>>16&255),he(n,e.total_in>>24&255)):(Un(n,e.adler>>>16),Un(n,e.adler&65535)),Xt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ct:kf)}function gh(e){var t;return!e||!e.state?ft:(t=e.state.status,t!==fi&&t!==da&&t!==oi&&t!==ii&&t!==ai&&t!==xr&&t!==Vn?Jt(e,ft):(e.state=null,t===xr?Jt(e,Wd):Ct))}function yh(e,t){var r=t.length,n,o,i,a,s,l,f,c;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==fi||n.lookahead))return ft;for(a===1&&(e.adler=Ef(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Zt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new Xe.Buf8(n.w_size),Xe.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size),s=e.avail_in,l=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,wr(n);n.lookahead>=de;){o=n.strstart,i=n.lookahead-(de-1);do n.ins_h=(n.ins_h<{"use strict";var li=It(),Mf=!0,If=!0;try{String.fromCharCode.apply(null,[0])}catch{Mf=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{If=!1}var Wn=new li.Buf8(256);for(jt=0;jt<256;jt++)Wn[jt]=jt>=252?6:jt>=248?5:jt>=240?4:jt>=224?3:jt>=192?2:1;var jt;Wn[254]=Wn[254]=1;$r.string2buf=function(e){var t,r,n,o,i,a=e.length,s=0;for(o=0;o>>6,t[i++]=128|r&63):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|r&63):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|r&63);return t};function zf(e,t){if(t<65534&&(e.subarray&&If||!e.subarray&&Mf))return String.fromCharCode.apply(null,li.shrinkBuf(e,t));for(var r="",n=0;n4){s[n++]=65533,r+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&r1){s[n++]=65533;continue}o<65536?s[n++]=o:(o-=65536,s[n++]=55296|o>>10&1023,s[n++]=56320|o&1023)}return zf(s,n)};$r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Wn[e[r]]>t?r:t}});var pa=He((Zm,jf)=>{"use strict";function bh(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}jf.exports=bh});var Vf=He(Xn=>{"use strict";var Gn=Nf(),Kn=It(),ma=ha(),ga=ri(),xh=pa(),Uf=Object.prototype.toString,Fh=0,va=4,en=0,Lf=1,Hf=2,wh=-1,Sh=0,Ph=8;function Pr(e){if(!(this instanceof Pr))return new Pr(e);this.options=Kn.assign({level:wh,method:Ph,chunkSize:16384,windowBits:15,memLevel:8,strategy:Sh,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xh,this.strm.avail_out=0;var r=Gn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==en)throw new Error(ga[r]);if(t.header&&Gn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=ma.string2buf(t.dictionary):Uf.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=Gn.deflateSetDictionary(this.strm,n),r!==en)throw new Error(ga[r]);this._dict_set=!0}}Pr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o,i;if(this.ended)return!1;i=t===~~t?t:t===!0?va:Fh,typeof e=="string"?r.input=ma.string2buf(e):Uf.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Kn.Buf8(n),r.next_out=0,r.avail_out=n),o=Gn.deflate(r,i),o!==Lf&&o!==en)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(i===va||i===Hf))&&(this.options.to==="string"?this.onData(ma.buf2binstring(Kn.shrinkBuf(r.output,r.next_out))):this.onData(Kn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==Lf);return i===va?(o=Gn.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===en):(i===Hf&&(this.onEnd(en),r.avail_out=0),!0)};Pr.prototype.onData=function(e){this.chunks.push(e)};Pr.prototype.onEnd=function(e){e===en&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Kn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ya(e,t){var r=new Pr(t);if(r.push(e,!0),r.err)throw r.msg||ga[r.err];return r.result}function Dh(e,t){return t=t||{},t.raw=!0,ya(e,t)}function Ch(e,t){return t=t||{},t.gzip=!0,ya(e,t)}Xn.Deflate=Pr;Xn.deflate=ya;Xn.deflateRaw=Dh;Xn.gzip=Ch});var Wf=He((Jm,qf)=>{"use strict";var ci=30,kh=12;qf.exports=function(t,r){var n,o,i,a,s,l,f,c,u,d,p,h,b,F,g,m,x,w,S,D,k,C,E,I,A;n=t.state,o=t.next_in,I=t.input,i=o+(t.avail_in-5),a=t.next_out,A=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,p=n.window,h=n.hold,b=n.bits,F=n.lencode,g=n.distcode,m=(1<>>24,h>>>=S,b-=S,S=w>>>16&255,S===0)A[a++]=w&65535;else if(S&16){D=w&65535,S&=15,S&&(b>>=S,b-=S),b<15&&(h+=I[o++]<>>24,h>>>=S,b-=S,S=w>>>16&255,S&16){if(k=w&65535,S&=15,bf){t.msg="invalid distance too far back",n.mode=ci;break e}if(h>>>=S,b-=S,S=a-s,k>S){if(S=k-S,S>u&&n.sane){t.msg="invalid distance too far back",n.mode=ci;break e}if(C=0,E=p,d===0){if(C+=c-S,S2;)A[a++]=E[C++],A[a++]=E[C++],A[a++]=E[C++],D-=3;D&&(A[a++]=E[C++],D>1&&(A[a++]=E[C++]))}else{C=a-k;do A[a++]=A[C++],A[a++]=A[C++],A[a++]=A[C++],D-=3;while(D>2);D&&(A[a++]=A[C++],D>1&&(A[a++]=A[C++]))}}else if((S&64)===0){w=g[(w&65535)+(h&(1<>3,o-=D,b-=D<<3,h&=(1<{"use strict";var Gf=It(),tn=15,Kf=852,Xf=592,Zf=0,ba=1,Yf=2,Th=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Eh=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Ah=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Rh=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];Jf.exports=function(t,r,n,o,i,a,s,l){var f=l.bits,c=0,u=0,d=0,p=0,h=0,b=0,F=0,g=0,m=0,x=0,w,S,D,k,C,E=null,I=0,A,R=new Gf.Buf16(tn+1),z=new Gf.Buf16(tn+1),N=null,W=0,te,L,ue;for(c=0;c<=tn;c++)R[c]=0;for(u=0;u=1&&R[p]===0;p--);if(h>p&&(h=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d0&&(t===Zf||p!==1))return-1;for(z[1]=0,c=1;cKf||t===Yf&&m>Xf)return 1;for(;;){te=c-F,s[u]A?(L=N[W+s[u]],ue=E[I+s[u]]):(L=96,ue=0),w=1<>F)+S]=te<<24|L<<16|ue|0;while(S!==0);for(w=1<>=1;if(w!==0?(x&=w-1,x+=w):x=0,u++,--R[c]===0){if(c===p)break;c=r[n+s[u]]}if(c>h&&(x&k)!==D){for(F===0&&(F=h),C+=d,b=c-F,g=1<Kf||t===Yf&&m>Xf)return 1;D=x&k,i[D]=h<<24|b<<16|C-a|0}}return x!==0&&(i[C+x]=c-F<<24|64<<16|0),l.bits=h,0}});var Ol=He(yt=>{"use strict";var ot=It(),Da=sa(),Tt=fa(),Oh=Wf(),Zn=Qf(),Bh=0,Sl=1,Pl=2,_f=4,Nh=5,ui=6,Dr=0,Mh=1,Ih=2,lt=-2,Dl=-3,Ca=-4,zh=-5,$f=8,Cl=1,el=2,tl=3,rl=4,nl=5,ol=6,il=7,al=8,sl=9,fl=10,pi=11,Lt=12,xa=13,ll=14,Fa=15,cl=16,ul=17,dl=18,hl=19,di=20,hi=21,pl=22,vl=23,ml=24,gl=25,yl=26,wa=27,bl=28,xl=29,be=30,ka=31,jh=32,Lh=852,Hh=592,Uh=15,Vh=Uh;function Fl(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function qh(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ot.Buf16(320),this.work=new ot.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function kl(e){var t;return!e||!e.state?lt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Cl,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new ot.Buf32(Lh),t.distcode=t.distdyn=new ot.Buf32(Hh),t.sane=1,t.back=-1,Dr)}function Tl(e){var t;return!e||!e.state?lt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,kl(e))}function El(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?lt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Tl(e))}function Al(e,t){var r,n;return e?(n=new qh,e.state=n,n.window=null,r=El(e,t),r!==Dr&&(e.state=null),r):lt}function Wh(e){return Al(e,Vh)}var wl=!0,Sa,Pa;function Gh(e){if(wl){var t;for(Sa=new ot.Buf32(512),Pa=new ot.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Zn(Sl,e.lens,0,288,Sa,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Zn(Pl,e.lens,0,32,Pa,0,e.work,{bits:5}),wl=!1}e.lencode=Sa,e.lenbits=9,e.distcode=Pa,e.distbits=5}function Rl(e,t,r,n){var o,i=e.state;return i.window===null&&(i.wsize=1<=i.wsize?(ot.arraySet(i.window,t,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),ot.arraySet(i.window,t,r-n,o,i.wnext),n-=o,n?(ot.arraySet(i.window,t,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave>>8&255,r.check=Tt(r.check,E,2,0),f=0,c=0,r.mode=el;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=be;break}if((f&15)!==$f){e.msg="unknown compression method",r.mode=be;break}if(f>>>=4,c-=4,k=(f&15)+8,r.wbits===0)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=be;break}r.dmax=1<>8&1),r.flags&512&&(E[0]=f&255,E[1]=f>>>8&255,r.check=Tt(r.check,E,2,0)),f=0,c=0,r.mode=tl;case tl:for(;c<32;){if(s===0)break e;s--,f+=n[i++]<>>8&255,E[2]=f>>>16&255,E[3]=f>>>24&255,r.check=Tt(r.check,E,4,0)),f=0,c=0,r.mode=rl;case rl:for(;c<16;){if(s===0)break e;s--,f+=n[i++]<>8),r.flags&512&&(E[0]=f&255,E[1]=f>>>8&255,r.check=Tt(r.check,E,2,0)),f=0,c=0,r.mode=nl;case nl:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[i++]<>>8&255,r.check=Tt(r.check,E,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=ol;case ol:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),ot.arraySet(r.head.extra,n,i,p,k)),r.flags&512&&(r.check=Tt(r.check,n,p,i)),s-=p,i+=p,r.length-=p),r.length))break e;r.length=0,r.mode=il;case il:if(r.flags&2048){if(s===0)break e;p=0;do k=n[i+p++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&p>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Lt;break;case fl:for(;c<32;){if(s===0)break e;s--,f+=n[i++]<>>=c&7,c-=c&7,r.mode=wa;break}for(;c<3;){if(s===0)break e;s--,f+=n[i++]<>>=1,c-=1,f&3){case 0:r.mode=ll;break;case 1:if(Gh(r),r.mode=di,t===ui){f>>>=2,c-=2;break e}break;case 2:r.mode=ul;break;case 3:e.msg="invalid block type",r.mode=be}f>>>=2,c-=2;break;case ll:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[i++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=be;break}if(r.length=f&65535,f=0,c=0,r.mode=Fa,t===ui)break e;case Fa:r.mode=cl;case cl:if(p=r.length,p){if(p>s&&(p=s),p>l&&(p=l),p===0)break e;ot.arraySet(o,n,i,p,a),s-=p,i+=p,l-=p,a+=p,r.length-=p;break}r.mode=Lt;break;case ul:for(;c<14;){if(s===0)break e;s--,f+=n[i++]<>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=be;break}r.have=0,r.mode=dl;case dl:for(;r.have>>=3,c-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},C=Zn(Bh,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,C){e.msg="invalid code lengths set",r.mode=be;break}r.have=0,r.mode=hl;case hl:for(;r.have>>24,m=F>>>16&255,x=F&65535,!(g<=c);){if(s===0)break e;s--,f+=n[i++]<>>=g,c-=g,r.lens[r.have++]=x;else{if(x===16){for(A=g+2;c>>=g,c-=g,r.have===0){e.msg="invalid bit length repeat",r.mode=be;break}k=r.lens[r.have-1],p=3+(f&3),f>>>=2,c-=2}else if(x===17){for(A=g+3;c>>=g,c-=g,k=0,p=3+(f&7),f>>>=3,c-=3}else{for(A=g+7;c>>=g,c-=g,k=0,p=11+(f&127),f>>>=7,c-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=be;break}for(;p--;)r.lens[r.have++]=k}}if(r.mode===be)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=be;break}if(r.lenbits=9,I={bits:r.lenbits},C=Zn(Sl,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,C){e.msg="invalid literal/lengths set",r.mode=be;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},C=Zn(Pl,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,C){e.msg="invalid distances set",r.mode=be;break}if(r.mode=di,t===ui)break e;case di:r.mode=hi;case hi:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=f,r.bits=c,Oh(e,d),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===Lt&&(r.back=-1);break}for(r.back=0;F=r.lencode[f&(1<>>24,m=F>>>16&255,x=F&65535,!(g<=c);){if(s===0)break e;s--,f+=n[i++]<>w)],g=F>>>24,m=F>>>16&255,x=F&65535,!(w+g<=c);){if(s===0)break e;s--,f+=n[i++]<>>=w,c-=w,r.back+=w}if(f>>>=g,c-=g,r.back+=g,r.length=x,m===0){r.mode=yl;break}if(m&32){r.back=-1,r.mode=Lt;break}if(m&64){e.msg="invalid literal/length code",r.mode=be;break}r.extra=m&15,r.mode=pl;case pl:if(r.extra){for(A=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=vl;case vl:for(;F=r.distcode[f&(1<>>24,m=F>>>16&255,x=F&65535,!(g<=c);){if(s===0)break e;s--,f+=n[i++]<>w)],g=F>>>24,m=F>>>16&255,x=F&65535,!(w+g<=c);){if(s===0)break e;s--,f+=n[i++]<>>=w,c-=w,r.back+=w}if(f>>>=g,c-=g,r.back+=g,m&64){e.msg="invalid distance code",r.mode=be;break}r.offset=x,r.extra=m&15,r.mode=ml;case ml:if(r.extra){for(A=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=be;break}r.mode=gl;case gl:if(l===0)break e;if(p=d-l,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=be;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),b=r.window}else b=o,h=a-r.offset,p=r.length;p>l&&(p=l),l-=p,r.length-=p;do o[a++]=b[h++];while(--p);r.length===0&&(r.mode=hi);break;case yl:if(l===0)break e;o[a++]=r.length,l--,r.mode=hi;break;case wa:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[i++]<{"use strict";Bl.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Ml=He((eg,Nl)=>{"use strict";function Jh(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Nl.exports=Jh});var zl=He(Jn=>{"use strict";var rn=Ol(),Yn=It(),vi=ha(),ke=Ta(),Ea=ri(),Qh=pa(),_h=Ml(),Il=Object.prototype.toString;function Cr(e){if(!(this instanceof Cr))return new Cr(e);this.options=Yn.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qh,this.strm.avail_out=0;var r=rn.inflateInit2(this.strm,t.windowBits);if(r!==ke.Z_OK)throw new Error(Ea[r]);if(this.header=new _h,rn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=vi.string2buf(t.dictionary):Il.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=rn.inflateSetDictionary(this.strm,t.dictionary),r!==ke.Z_OK)))throw new Error(Ea[r])}Cr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,i,a,s,l,f,c=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?ke.Z_FINISH:ke.Z_NO_FLUSH,typeof e=="string"?r.input=vi.binstring2buf(e):Il.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Yn.Buf8(n),r.next_out=0,r.avail_out=n),i=rn.inflate(r,ke.Z_NO_FLUSH),i===ke.Z_NEED_DICT&&o&&(i=rn.inflateSetDictionary(this.strm,o)),i===ke.Z_BUF_ERROR&&c===!0&&(i=ke.Z_OK,c=!1),i!==ke.Z_STREAM_END&&i!==ke.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(r.avail_out===0||i===ke.Z_STREAM_END||r.avail_in===0&&(a===ke.Z_FINISH||a===ke.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=vi.utf8border(r.output,r.next_out),l=r.next_out-s,f=vi.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&Yn.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(Yn.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&i!==ke.Z_STREAM_END);return i===ke.Z_STREAM_END&&(a=ke.Z_FINISH),a===ke.Z_FINISH?(i=rn.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ke.Z_OK):(a===ke.Z_SYNC_FLUSH&&(this.onEnd(ke.Z_OK),r.avail_out=0),!0)};Cr.prototype.onData=function(e){this.chunks.push(e)};Cr.prototype.onEnd=function(e){e===ke.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Aa(e,t){var r=new Cr(t);if(r.push(e,!0),r.err)throw r.msg||Ea[r.err];return r.result}function $h(e,t){return t=t||{},t.raw=!0,Aa(e,t)}Jn.Inflate=Cr;Jn.inflate=Aa;Jn.inflateRaw=$h;Jn.ungzip=Aa});var Qn=He((rg,Ll)=>{"use strict";var ep=It().assign,tp=Vf(),rp=zl(),np=Ta(),jl={};ep(jl,tp,rp,np);Ll.exports=jl});var Tm={};nd(Tm,{default:()=>Wi});module.exports=od(Tm);var M=require("obsidian");var Ki=function(e,t){return Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},Ki(e,t)};function T(e,t){Ki(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Y=function(){return Y=Object.assign||function(t){for(var r,n=1,o=arguments.length;n0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]>2],t+=Wr[(e[n]&3)<<4|e[n+1]>>4],t+=Wr[(e[n+1]&15)<<2|e[n+2]>>6],t+=Wr[e[n+2]&63];return r%3===2?t=t.substring(0,t.length-1)+"=":r%3===1&&(t=t.substring(0,t.length-2)+"=="),t},Es=function(e){var t=e.length*.75,r=e.length,n,o=0,i,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var f=new Uint8Array(t);for(n=0;n>4,f[o++]=(a&15)<<4|s>>2,f[o++]=(s&3)<<6|l&63;return f},id=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,Rs=function(e){var t=e.trim(),r=t.substring(0,100),n=r.match(id);if(!n)return Es(t);var o=n[0],i=t.substring(o.length);return Es(i)};var Q=function(e){return e.charCodeAt(0)},Os=function(e){return e.codePointAt(0)},Mt=function(e,t){return nt(e.toString(16),t,"0").toUpperCase()},Wt=function(e){return Mt(e,2)},rt=function(e){return String.fromCharCode(e)},Bs=function(e){return rt(parseInt(e,16))},nt=function(e,t,r){for(var n="",o=0,i=t-e.length;o=55296&&r<=56319&&e.length>o&&(n=e.charCodeAt(o),n>=56320&&n<=57343&&(i=2)),[e.slice(t,t+i),i]},Ms=function(e){for(var t=[],r=0,n=e.length;rr&&f(),a+=d,s+=p}}return f(),l},ld=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,Yo=function(e){var t=e.match(ld);if(t){var r=t[1],n=t[2],o=n===void 0?"01":n,i=t[3],a=i===void 0?"01":i,s=t[4],l=s===void 0?"00":s,f=t[5],c=f===void 0?"00":f,u=t[6],d=u===void 0?"00":u,p=t[7],h=p===void 0?"Z":p,b=t[8],F=b===void 0?"00":b,g=t[9],m=g===void 0?"00":g,x=h==="Z"?"Z":""+h+F+":"+m,w=new Date(r+"-"+o+"-"+a+"T"+l+":"+c+":"+d+x);return w}},On=function(e,t){for(var r,n=0,o;n=0&&e<=65535},Ys=function(e){return e>=65536&&e<=1114111},Yi=function(e){return Math.floor((e-65536)/1024)+55296},Ji=function(e){return(e-65536)%1024+56320},Gt;(function(e){e.BigEndian="BigEndian",e.LittleEndian="LittleEndian"})(Gt||(Gt={}));var Bn="\uFFFD".codePointAt(0),_o=function(e,t){if(t===void 0&&(t=!0),e.length<=1)return String.fromCodePoint(Bn);for(var r=t?ud(e):Gt.BigEndian,n=t?2:0,o=[];e.length-n>=2;){var i=Ks(e[n++],e[n++],r);if(cd(i))if(e.length-n<2)o.push(Bn);else{var a=Ks(e[n++],e[n++],r);Gs(a)?o.push(i,a):o.push(Bn)}else Gs(i)?(n+=2,o.push(Bn)):o.push(i)}return n=55296&&e<=56319},Gs=function(e){return e>=56320&&e<=57343},Ks=function(e,t,r){if(r===Gt.LittleEndian)return t<<8|e;if(r===Gt.BigEndian)return e<<8|t;throw new Error("Invalid byteOrder: "+r)},ud=function(e){return Js(e)?Gt.BigEndian:Qs(e)?Gt.LittleEndian:Gt.BigEndian},Js=function(e){return e[0]===254&&e[1]===255},Qs=function(e){return e[0]===255&&e[1]===254},$o=function(e){return Js(e)||Qs(e)};var _s=function(e){var t=String(e);if(Math.abs(e)<1){var r=parseInt(e.toString().split("e-")[1]);if(r){var n=e<0;n&&(e*=-1),e*=Math.pow(10,r-1),t="0."+new Array(r).join("0")+e.toString().substring(2),n&&(t="-"+t)}}else{var r=parseInt(e.toString().split("+")[1]);r>20&&(r-=20,e/=Math.pow(10,r),t=e.toString()+new Array(r+1).join("0"))}return t},Nn=function(e){return Math.ceil(e.toString(2).length/8)},gr=function(e){for(var t=new Uint8Array(Nn(e)),r=1;r<=t.length;r++)t[r-1]=e>>(t.length-r)*8;return t};var yr=function(e){throw new Error(e)};var Ul=Xo(Qn()),Hl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$n=new Uint8Array(256);for(_n=0;_n>4,f[o++]=(a&15)<<4|s>>2,f[o++]=(s&3)<<6|l&63;return f},ip=function(e){for(var t="",r=0;rn)throw new Error(Ne(t)+" must be at least "+r+" and at most "+n+", but was actually "+e)},it=function(e,t,r,n){P(e,t,["number","undefined"]),typeof e=="number"&&Ue(e,t,r,n)},yi=function(e,t,r){if(P(e,t,["number"]),e%r!==0)throw new Error(Ne(t)+" must be a multiple of "+r+", but was actually "+e)},fc=function(e,t){if(!Number.isInteger(e))throw new Error(Ne(t)+" must be an integer, but was actually "+e)},_t=function(e,t){if(![1,0].includes(Math.sign(e)))throw new Error(Ne(t)+" must be a positive number or 0, but was actually "+e)};var $=new Uint16Array(256);for(no=0;no<256;no++)$[no]=no;var no;$[22]=Q("");$[24]=Q("\u02D8");$[25]=Q("\u02C7");$[26]=Q("\u02C6");$[27]=Q("\u02D9");$[28]=Q("\u02DD");$[29]=Q("\u02DB");$[30]=Q("\u02DA");$[31]=Q("\u02DC");$[127]=Q("\uFFFD");$[128]=Q("\u2022");$[129]=Q("\u2020");$[130]=Q("\u2021");$[131]=Q("\u2026");$[132]=Q("\u2014");$[133]=Q("\u2013");$[134]=Q("\u0192");$[135]=Q("\u2044");$[136]=Q("\u2039");$[137]=Q("\u203A");$[138]=Q("\u2212");$[139]=Q("\u2030");$[140]=Q("\u201E");$[141]=Q("\u201C");$[142]=Q("\u201D");$[143]=Q("\u2018");$[144]=Q("\u2019");$[145]=Q("\u201A");$[146]=Q("\u2122");$[147]=Q("\uFB01");$[148]=Q("\uFB02");$[149]=Q("\u0141");$[150]=Q("\u0152");$[151]=Q("\u0160");$[152]=Q("\u0178");$[153]=Q("\u017D");$[154]=Q("\u0131");$[155]=Q("\u0142");$[156]=Q("\u0153");$[157]=Q("\u0161");$[158]=Q("\u017E");$[159]=Q("\uFFFD");$[160]=Q("\u20AC");$[173]=Q("\uFFFD");var bi=function(e){for(var t=new Array(e.length),r=0,n=e.length;r=y.ExclamationPoint&&e<=y.Tilde&&!Fi[e]},Cc={},kc=new Map,zp=function(e){T(t,e);function t(r,n){var o=this;if(r!==Cc)throw new nn("PDFName");o=e.call(this)||this;for(var i="/",a=0,s=n.length;a=y.Zero&&f<=y.Nine||f>=y.a&&f<=y.f||f>=y.A&&f<=y.F?(n+=l,(n.length===2||!(c>="0"&&c<="9"||c>="a"&&c<="f"||c>="A"&&c<="F"))&&(i(parseInt(n,16)),n="")):i(f):f===y.Hash?o=!0:i(f)}return new Uint8Array(r)},t.prototype.decodeText=function(){var r=this.asBytes();return String.fromCharCode.apply(String,Array.from(r))},t.prototype.asString=function(){return this.encodedName},t.prototype.value=function(){return this.encodedName},t.prototype.clone=function(){return this},t.prototype.toString=function(){return this.encodedName},t.prototype.sizeInBytes=function(){return this.encodedName.length},t.prototype.copyBytesInto=function(r,n){return n+=me(this.encodedName,r,n),this.encodedName.length},t.of=function(r){var n=Mp(r),o=kc.get(n);return o||(o=new t(Cc,n),kc.set(n,o)),o},t.Length=t.of("Length"),t.FlateDecode=t.of("FlateDecode"),t.Resources=t.of("Resources"),t.Font=t.of("Font"),t.XObject=t.of("XObject"),t.ExtGState=t.of("ExtGState"),t.Contents=t.of("Contents"),t.Type=t.of("Type"),t.Parent=t.of("Parent"),t.MediaBox=t.of("MediaBox"),t.Page=t.of("Page"),t.Annots=t.of("Annots"),t.TrimBox=t.of("TrimBox"),t.ArtBox=t.of("ArtBox"),t.BleedBox=t.of("BleedBox"),t.CropBox=t.of("CropBox"),t.Rotate=t.of("Rotate"),t.Title=t.of("Title"),t.Author=t.of("Author"),t.Subject=t.of("Subject"),t.Creator=t.of("Creator"),t.Keywords=t.of("Keywords"),t.Producer=t.of("Producer"),t.CreationDate=t.of("CreationDate"),t.ModDate=t.of("ModDate"),t}(ve),v=zp;var jp=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.asNull=function(){return null},t.prototype.clone=function(){return this},t.prototype.toString=function(){return"null"},t.prototype.sizeInBytes=function(){return 4},t.prototype.copyBytesInto=function(r,n){return r[n++]=y.n,r[n++]=y.u,r[n++]=y.l,r[n++]=y.l,4},t}(ve),Te=new jp;var Lp=function(e){T(t,e);function t(r,n){var o=e.call(this)||this;return o.dict=r,o.context=n,o}return t.prototype.keys=function(){return Array.from(this.dict.keys())},t.prototype.values=function(){return Array.from(this.dict.values())},t.prototype.entries=function(){return Array.from(this.dict.entries())},t.prototype.set=function(r,n){this.dict.set(r,n)},t.prototype.get=function(r,n){n===void 0&&(n=!1);var o=this.dict.get(r);if(!(o===Te&&!n))return o},t.prototype.has=function(r){var n=this.dict.get(r);return n!==void 0&&n!==Te},t.prototype.lookupMaybe=function(r){for(var n,o=[],i=1;i()=>(e||t((e={exports:{}}).exports,e),e.exports),od=(t,e)=>{for(var r in e)Go(t,r,{get:e[r],enumerable:!0})},Cs=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of td(e))!nd.call(t,o)&&o!==r&&Go(t,o,{get:()=>e[o],enumerable:!(n=ed(e,o))||n.enumerable});return t};var Ko=(t,e,r)=>(r=t!=null?$u(rd(t)):{},Cs(e||!t||!t.__esModule?Go(r,"default",{value:t,enumerable:!0}):r,t)),id=t=>Cs(Go({},"__esModule",{value:!0}),t);var It=He(Ke=>{"use strict";var hd=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function pd(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Ke.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)pd(r,n)&&(t[n]=r[n])}}return t};Ke.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var vd={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var i=0;i{"use strict";var gd=It(),yd=4,_s=0,$s=1,bd=2;function Kr(t){for(var e=t.length;--e>=0;)t[e]=0}var xd=0,af=1,Fd=2,wd=3,Sd=258,na=29,Hn=256,In=Hn+1+na,Gr=30,oa=19,sf=2*In+1,yr=15,Qi=16,Pd=7,ia=256,ff=16,lf=17,cf=18,ta=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],$o=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Dd=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],uf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Cd=512,zt=new Array((In+2)*2);Kr(zt);var Mn=new Array(Gr*2);Kr(Mn);var zn=new Array(Cd);Kr(zn);var jn=new Array(Sd-wd+1);Kr(jn);var aa=new Array(na);Kr(aa);var ei=new Array(Gr);Kr(ei);function _i(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}var df,hf,pf;function $i(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function vf(t){return t<256?zn[t]:zn[256+(t>>>7)]}function Ln(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function _e(t,e,r){t.bi_valid>Qi-r?(t.bi_buf|=e<>Qi-t.bi_valid,t.bi_valid+=r-Qi):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function kd(t){t.bi_valid===16?(Ln(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function Td(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,l=e.stat_desc.max_length,f,c,u,d,p,h,b=0;for(d=0;d<=yr;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,f=t.heap_max+1;fl&&(d=l,b++),r[c*2+1]=d,!(c>n)&&(t.bl_count[d]++,p=0,c>=s&&(p=a[c-s]),h=r[c*2],t.opt_len+=h*(d+p),i&&(t.static_len+=h*(o[c*2+1]+p)));if(b!==0){do{for(d=l-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,b-=2}while(b>0);for(d=l;d!==0;d--)for(c=t.bl_count[d];c!==0;)u=t.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(t.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function gf(t,e,r){var n=new Array(yr+1),o=0,i,a;for(i=1;i<=yr;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=e;a++){var s=t[a*2+1];s!==0&&(t[a*2]=mf(n[s]++,s))}}function Ed(){var t,e,r,n,o,i=new Array(yr+1);for(r=0,n=0;n>=7;n8?Ln(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Ad(t,e,r,n){bf(t),n&&(Ln(t,r),Ln(t,~r)),gd.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function ef(t,e,r,n){var o=e*2,i=r*2;return t[o]>1;a>=1;a--)ea(t,r,a);f=i;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ea(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=s,r[f*2]=r[a*2]+r[s*2],t.depth[f]=(t.depth[a]>=t.depth[s]?t.depth[a]:t.depth[s])+1,r[a*2+1]=r[s*2+1]=f,t.heap[1]=f++,ea(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Td(t,e),gf(r,l,t.bl_count)}function rf(t,e,r){var n,o=-1,i,a=e[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=e[(n+1)*2+1],!(++s=3&&t.bl_tree[uf[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function Od(t,e,r,n){var o;for(_e(t,e-257,5),_e(t,r-1,5),_e(t,n-4,4),o=0;o>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return _s;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return $s;for(r=32;r0?(t.strm.data_type===bd&&(t.strm.data_type=Bd(t)),ra(t,t.l_desc),ra(t,t.d_desc),a=Rd(t),o=t.opt_len+3+7>>>3,i=t.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&e!==-1?xf(t,e,r,n):t.strategy===yd||i===o?(_e(t,(af<<1)+(n?1:0),3),tf(t,zt,Mn)):(_e(t,(Fd<<1)+(n?1:0),3),Od(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),tf(t,t.dyn_ltree,t.dyn_dtree)),yf(t),n&&bf(t)}function zd(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(jn[r]+Hn+1)*2]++,t.dyn_dtree[vf(e)*2]++),t.last_lit===t.lit_bufsize-1}Xr._tr_init=Nd;Xr._tr_stored_block=xf;Xr._tr_flush_block=Id;Xr._tr_tally=zd;Xr._tr_align=Md});var sa=He((Zm,wf)=>{"use strict";function jd(t,e,r,n){for(var o=t&65535|0,i=t>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do o=o+e[n++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0}wf.exports=jd});var fa=He((Ym,Sf)=>{"use strict";function Ld(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var Hd=Ld();function Ud(t,e,r,n){var o=Hd,i=n+r;t^=-1;for(var a=n;a>>8^o[(t^e[a])&255];return t^-1}Sf.exports=Ud});var ti=He((Jm,Pf)=>{"use strict";Pf.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Bf=He(kt=>{"use strict";var Xe=It(),at=Ff(),Tf=sa(),Kt=fa(),Vd=ti(),wr=0,qd=1,Wd=3,Qt=4,Df=5,Ct=0,Cf=1,st=-2,Gd=-3,la=-5,Kd=-1,Xd=1,ri=2,Zd=3,Yd=4,Jd=0,Qd=2,ai=8,_d=9,$d=15,eh=8,th=29,rh=256,ua=rh+1+th,nh=30,oh=19,ih=2*ua+1,ah=15,de=3,Yt=258,mt=Yt+de+1,sh=32,si=42,da=69,ni=73,oi=91,ii=103,br=113,Vn=666,Ne=1,qn=2,xr=3,Jr=4,fh=3;function Jt(t,e){return t.msg=Vd[e],e}function kf(t){return(t<<1)-(t>4?9:0)}function Zt(t){for(var e=t.length;--e>=0;)t[e]=0}function Xt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Xe.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function je(t,e){at._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Xt(t.strm)}function he(t,e){t.pending_buf[t.pending++]=e}function Un(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function lh(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,Xe.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=Tf(t.adler,e,o,r):t.state.wrap===2&&(t.adler=Kt(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function Ef(t,e){var r=t.max_chain_length,n=t.strstart,o,i,a=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-mt?t.strstart-(t.w_size-mt):0,f=t.window,c=t.w_mask,u=t.prev,d=t.strstart+Yt,p=f[n+a-1],h=f[n+a];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(o=e,!(f[o+a]!==h||f[o+a-1]!==p||f[o]!==f[n]||f[++o]!==f[n+1])){n+=2,o++;do;while(f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&na){if(t.match_start=e,a=i,i>=s)break;p=f[n+a-1],h=f[n+a]}}while((e=u[e&c])>l&&--r!==0);return a<=t.lookahead?a:t.lookahead}function Fr(t){var e=t.w_size,r,n,o,i,a;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-mt)){Xe.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do o=t.head[--r],t.head[r]=o>=e?o-e:0;while(--n);n=e,r=n;do o=t.prev[--r],t.prev[r]=o>=e?o-e:0;while(--n);i+=e}if(t.strm.avail_in===0)break;if(n=lh(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=de)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Fr(t),t.lookahead===0&&e===wr)return Ne;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,je(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-mt&&(je(t,!1),t.strm.avail_out===0))return Ne}return t.insert=0,e===Qt?(je(t,!0),t.strm.avail_out===0?xr:Jr):(t.strstart>t.block_start&&(je(t,!1),t.strm.avail_out===0),Ne)}function ca(t,e){for(var r,n;;){if(t.lookahead=de&&(t.ins_h=(t.ins_h<=de)if(n=at._tr_tally(t,t.strstart-t.match_start,t.match_length-de),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=de){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=de&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=de-1)),t.prev_length>=de&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-de,n=at._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-de),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(t.ins_h=(t.ins_h<=de&&t.strstart>0&&(o=t.strstart-1,n=a[o],n===a[++o]&&n===a[++o]&&n===a[++o])){i=t.strstart+Yt;do;while(n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&ot.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=de?(r=at._tr_tally(t,1,t.match_length-de),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=at._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(je(t,!1),t.strm.avail_out===0))return Ne}return t.insert=0,e===Qt?(je(t,!0),t.strm.avail_out===0?xr:Jr):t.last_lit&&(je(t,!1),t.strm.avail_out===0)?Ne:qn}function dh(t,e){for(var r;;){if(t.lookahead===0&&(Fr(t),t.lookahead===0)){if(e===wr)return Ne;break}if(t.match_length=0,r=at._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(je(t,!1),t.strm.avail_out===0))return Ne}return t.insert=0,e===Qt?(je(t,!0),t.strm.avail_out===0?xr:Jr):t.last_lit&&(je(t,!1),t.strm.avail_out===0)?Ne:qn}function Dt(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}var Yr;Yr=[new Dt(0,0,0,0,ch),new Dt(4,4,8,4,ca),new Dt(4,5,16,8,ca),new Dt(4,6,32,32,ca),new Dt(4,4,16,16,Zr),new Dt(8,16,32,32,Zr),new Dt(8,16,128,128,Zr),new Dt(8,32,128,256,Zr),new Dt(32,128,258,1024,Zr),new Dt(32,258,258,4096,Zr)];function hh(t){t.window_size=2*t.w_size,Zt(t.head),t.max_lazy_match=Yr[t.level].max_lazy,t.good_match=Yr[t.level].good_length,t.nice_match=Yr[t.level].nice_length,t.max_chain_length=Yr[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=de-1,t.match_available=0,t.ins_h=0}function ph(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ai,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Xe.Buf16(ih*2),this.dyn_dtree=new Xe.Buf16((2*nh+1)*2),this.bl_tree=new Xe.Buf16((2*oh+1)*2),Zt(this.dyn_ltree),Zt(this.dyn_dtree),Zt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Xe.Buf16(ah+1),this.heap=new Xe.Buf16(2*ua+1),Zt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Xe.Buf16(2*ua+1),Zt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Af(t){var e;return!t||!t.state?Jt(t,st):(t.total_in=t.total_out=0,t.data_type=Qd,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?si:br,t.adler=e.wrap===2?0:1,e.last_flush=wr,at._tr_init(e),Ct)}function Rf(t){var e=Af(t);return e===Ct&&hh(t.state),e}function vh(t,e){return!t||!t.state||t.state.wrap!==2?st:(t.state.gzhead=e,Ct)}function Of(t,e,r,n,o,i){if(!t)return st;var a=1;if(e===Kd&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>_d||r!==ai||n<8||n>15||e<0||e>9||i<0||i>Yd)return Jt(t,st);n===8&&(n=9);var s=new ph;return t.state=s,s.strm=t,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<Df||e<0)return t?Jt(t,st):st;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Vn&&e!==Qt)return Jt(t,t.avail_out===0?la:st);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===si)if(n.wrap===2)t.adler=0,he(n,31),he(n,139),he(n,8),n.gzhead?(he(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),he(n,n.gzhead.time&255),he(n,n.gzhead.time>>8&255),he(n,n.gzhead.time>>16&255),he(n,n.gzhead.time>>24&255),he(n,n.level===9?2:n.strategy>=ri||n.level<2?4:0),he(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(he(n,n.gzhead.extra.length&255),he(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Kt(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=da):(he(n,0),he(n,0),he(n,0),he(n,0),he(n,0),he(n,n.level===9?2:n.strategy>=ri||n.level<2?4:0),he(n,fh),n.status=br);else{var a=ai+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=ri||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=sh),a+=31-a%31,n.status=br,Un(n,a),n.strstart!==0&&(Un(n,t.adler>>>16),Un(n,t.adler&65535)),t.adler=1}if(n.status===da)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Kt(t.adler,n.pending_buf,n.pending-o,o)),Xt(t),o=n.pending,n.pending===n.pending_buf_size));)he(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=Kt(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=ni)}else n.status=ni;if(n.status===ni)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Kt(t.adler,n.pending_buf,n.pending-o,o)),Xt(t),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindexo&&(t.adler=Kt(t.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.gzindex=0,n.status=oi)}else n.status=oi;if(n.status===oi)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Kt(t.adler,n.pending_buf,n.pending-o,o)),Xt(t),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindexo&&(t.adler=Kt(t.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.status=ii)}else n.status=ii;if(n.status===ii&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Xt(t),n.pending+2<=n.pending_buf_size&&(he(n,t.adler&255),he(n,t.adler>>8&255),t.adler=0,n.status=br)):n.status=br),n.pending!==0){if(Xt(t),t.avail_out===0)return n.last_flush=-1,Ct}else if(t.avail_in===0&&kf(e)<=kf(r)&&e!==Qt)return Jt(t,la);if(n.status===Vn&&t.avail_in!==0)return Jt(t,la);if(t.avail_in!==0||n.lookahead!==0||e!==wr&&n.status!==Vn){var l=n.strategy===ri?dh(n,e):n.strategy===Zd?uh(n,e):Yr[n.level].func(n,e);if((l===xr||l===Jr)&&(n.status=Vn),l===Ne||l===xr)return t.avail_out===0&&(n.last_flush=-1),Ct;if(l===qn&&(e===qd?at._tr_align(n):e!==Df&&(at._tr_stored_block(n,0,0,!1),e===Wd&&(Zt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Xt(t),t.avail_out===0))return n.last_flush=-1,Ct}return e!==Qt?Ct:n.wrap<=0?Cf:(n.wrap===2?(he(n,t.adler&255),he(n,t.adler>>8&255),he(n,t.adler>>16&255),he(n,t.adler>>24&255),he(n,t.total_in&255),he(n,t.total_in>>8&255),he(n,t.total_in>>16&255),he(n,t.total_in>>24&255)):(Un(n,t.adler>>>16),Un(n,t.adler&65535)),Xt(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ct:Cf)}function yh(t){var e;return!t||!t.state?st:(e=t.state.status,e!==si&&e!==da&&e!==ni&&e!==oi&&e!==ii&&e!==br&&e!==Vn?Jt(t,st):(t.state=null,e===br?Jt(t,Gd):Ct))}function bh(t,e){var r=e.length,n,o,i,a,s,l,f,c;if(!t||!t.state||(n=t.state,a=n.wrap,a===2||a===1&&n.status!==si||n.lookahead))return st;for(a===1&&(t.adler=Tf(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Zt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new Xe.Buf8(n.w_size),Xe.arraySet(c,e,r-n.w_size,n.w_size,0),e=c,r=n.w_size),s=t.avail_in,l=t.next_in,f=t.input,t.avail_in=r,t.next_in=0,t.input=e,Fr(n);n.lookahead>=de;){o=n.strstart,i=n.lookahead-(de-1);do n.ins_h=(n.ins_h<{"use strict";var fi=It(),Nf=!0,Mf=!0;try{String.fromCharCode.apply(null,[0])}catch{Nf=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Mf=!1}var Wn=new fi.Buf8(256);for(jt=0;jt<256;jt++)Wn[jt]=jt>=252?6:jt>=248?5:jt>=240?4:jt>=224?3:jt>=192?2:1;var jt;Wn[254]=Wn[254]=1;Qr.string2buf=function(t){var e,r,n,o,i,a=t.length,s=0;for(o=0;o>>6,e[i++]=128|r&63):r<65536?(e[i++]=224|r>>>12,e[i++]=128|r>>>6&63,e[i++]=128|r&63):(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63,e[i++]=128|r>>>6&63,e[i++]=128|r&63);return e};function If(t,e){if(e<65534&&(t.subarray&&Mf||!t.subarray&&Nf))return String.fromCharCode.apply(null,fi.shrinkBuf(t,e));for(var r="",n=0;n4){s[n++]=65533,r+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&r1){s[n++]=65533;continue}o<65536?s[n++]=o:(o-=65536,s[n++]=55296|o>>10&1023,s[n++]=56320|o&1023)}return If(s,n)};Qr.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Wn[t[r]]>e?r:e}});var pa=He(($m,zf)=>{"use strict";function xh(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}zf.exports=xh});var Uf=He(Xn=>{"use strict";var Gn=Bf(),Kn=It(),ma=ha(),ga=ti(),Fh=pa(),Hf=Object.prototype.toString,wh=0,va=4,_r=0,jf=1,Lf=2,Sh=-1,Ph=0,Dh=8;function Sr(t){if(!(this instanceof Sr))return new Sr(t);this.options=Kn.assign({level:Sh,method:Dh,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ph,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Fh,this.strm.avail_out=0;var r=Gn.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==_r)throw new Error(ga[r]);if(e.header&&Gn.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=ma.string2buf(e.dictionary):Hf.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Gn.deflateSetDictionary(this.strm,n),r!==_r)throw new Error(ga[r]);this._dict_set=!0}}Sr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,i;if(this.ended)return!1;i=e===~~e?e:e===!0?va:wh,typeof t=="string"?r.input=ma.string2buf(t):Hf.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Kn.Buf8(n),r.next_out=0,r.avail_out=n),o=Gn.deflate(r,i),o!==jf&&o!==_r)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(i===va||i===Lf))&&(this.options.to==="string"?this.onData(ma.buf2binstring(Kn.shrinkBuf(r.output,r.next_out))):this.onData(Kn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==jf);return i===va?(o=Gn.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===_r):(i===Lf&&(this.onEnd(_r),r.avail_out=0),!0)};Sr.prototype.onData=function(t){this.chunks.push(t)};Sr.prototype.onEnd=function(t){t===_r&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Kn.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ya(t,e){var r=new Sr(e);if(r.push(t,!0),r.err)throw r.msg||ga[r.err];return r.result}function Ch(t,e){return e=e||{},e.raw=!0,ya(t,e)}function kh(t,e){return e=e||{},e.gzip=!0,ya(t,e)}Xn.Deflate=Sr;Xn.deflate=ya;Xn.deflateRaw=Ch;Xn.gzip=kh});var qf=He((tg,Vf)=>{"use strict";var li=30,Th=12;Vf.exports=function(e,r){var n,o,i,a,s,l,f,c,u,d,p,h,b,F,x,m,y,w,S,D,T,C,E,I,A;n=e.state,o=e.next_in,I=e.input,i=o+(e.avail_in-5),a=e.next_out,A=e.output,s=a-(r-e.avail_out),l=a+(e.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,p=n.window,h=n.hold,b=n.bits,F=n.lencode,x=n.distcode,m=(1<>>24,h>>>=S,b-=S,S=w>>>16&255,S===0)A[a++]=w&65535;else if(S&16){D=w&65535,S&=15,S&&(b>>=S,b-=S),b<15&&(h+=I[o++]<>>24,h>>>=S,b-=S,S=w>>>16&255,S&16){if(T=w&65535,S&=15,bf){e.msg="invalid distance too far back",n.mode=li;break e}if(h>>>=S,b-=S,S=a-s,T>S){if(S=T-S,S>u&&n.sane){e.msg="invalid distance too far back",n.mode=li;break e}if(C=0,E=p,d===0){if(C+=c-S,S2;)A[a++]=E[C++],A[a++]=E[C++],A[a++]=E[C++],D-=3;D&&(A[a++]=E[C++],D>1&&(A[a++]=E[C++]))}else{C=a-T;do A[a++]=A[C++],A[a++]=A[C++],A[a++]=A[C++],D-=3;while(D>2);D&&(A[a++]=A[C++],D>1&&(A[a++]=A[C++]))}}else if((S&64)===0){w=x[(w&65535)+(h&(1<>3,o-=D,b-=D<<3,h&=(1<{"use strict";var Wf=It(),$r=15,Gf=852,Kf=592,Xf=0,ba=1,Zf=2,Eh=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Ah=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Rh=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Oh=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];Yf.exports=function(e,r,n,o,i,a,s,l){var f=l.bits,c=0,u=0,d=0,p=0,h=0,b=0,F=0,x=0,m=0,y=0,w,S,D,T,C,E=null,I=0,A,R=new Wf.Buf16($r+1),z=new Wf.Buf16($r+1),M=null,X=0,te,L,ue;for(c=0;c<=$r;c++)R[c]=0;for(u=0;u=1&&R[p]===0;p--);if(h>p&&(h=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d0&&(e===Xf||p!==1))return-1;for(z[1]=0,c=1;c<$r;c++)z[c+1]=z[c]+R[c];for(u=0;uGf||e===Zf&&m>Kf)return 1;for(;;){te=c-F,s[u]A?(L=M[X+s[u]],ue=E[I+s[u]]):(L=96,ue=0),w=1<>F)+S]=te<<24|L<<16|ue|0;while(S!==0);for(w=1<>=1;if(w!==0?(y&=w-1,y+=w):y=0,u++,--R[c]===0){if(c===p)break;c=r[n+s[u]]}if(c>h&&(y&T)!==D){for(F===0&&(F=h),C+=d,b=c-F,x=1<Gf||e===Zf&&m>Kf)return 1;D=y&T,i[D]=h<<24|b<<16|C-a|0}}return y!==0&&(i[C+y]=c-F<<24|64<<16|0),l.bits=h,0}});var Rl=He(gt=>{"use strict";var nt=It(),Da=sa(),Tt=fa(),Bh=qf(),Zn=Jf(),Nh=0,wl=1,Sl=2,Qf=4,Mh=5,ci=6,Pr=0,Ih=1,zh=2,ft=-2,Pl=-3,Ca=-4,jh=-5,_f=8,Dl=1,$f=2,el=3,tl=4,rl=5,nl=6,ol=7,il=8,al=9,sl=10,hi=11,Lt=12,xa=13,fl=14,Fa=15,ll=16,cl=17,ul=18,dl=19,ui=20,di=21,hl=22,pl=23,vl=24,ml=25,gl=26,wa=27,yl=28,bl=29,be=30,ka=31,Lh=32,Hh=852,Uh=592,Vh=15,qh=Vh;function xl(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function Wh(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new nt.Buf16(320),this.work=new nt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Cl(t){var e;return!t||!t.state?ft:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Dl,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new nt.Buf32(Hh),e.distcode=e.distdyn=new nt.Buf32(Uh),e.sane=1,e.back=-1,Pr)}function kl(t){var e;return!t||!t.state?ft:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Cl(t))}function Tl(t,e){var r,n;return!t||!t.state||(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?ft:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,kl(t))}function El(t,e){var r,n;return t?(n=new Wh,t.state=n,n.window=null,r=Tl(t,e),r!==Pr&&(t.state=null),r):ft}function Gh(t){return El(t,qh)}var Fl=!0,Sa,Pa;function Kh(t){if(Fl){var e;for(Sa=new nt.Buf32(512),Pa=new nt.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Zn(wl,t.lens,0,288,Sa,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Zn(Sl,t.lens,0,32,Pa,0,t.work,{bits:5}),Fl=!1}t.lencode=Sa,t.lenbits=9,t.distcode=Pa,t.distbits=5}function Al(t,e,r,n){var o,i=t.state;return i.window===null&&(i.wsize=1<=i.wsize?(nt.arraySet(i.window,e,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),nt.arraySet(i.window,e,r-n,o,i.wnext),n-=o,n?(nt.arraySet(i.window,e,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave>>8&255,r.check=Tt(r.check,E,2,0),f=0,c=0,r.mode=$f;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){t.msg="incorrect header check",r.mode=be;break}if((f&15)!==_f){t.msg="unknown compression method",r.mode=be;break}if(f>>>=4,c-=4,T=(f&15)+8,r.wbits===0)r.wbits=T;else if(T>r.wbits){t.msg="invalid window size",r.mode=be;break}r.dmax=1<>8&1),r.flags&512&&(E[0]=f&255,E[1]=f>>>8&255,r.check=Tt(r.check,E,2,0)),f=0,c=0,r.mode=el;case el:for(;c<32;){if(s===0)break e;s--,f+=n[i++]<>>8&255,E[2]=f>>>16&255,E[3]=f>>>24&255,r.check=Tt(r.check,E,4,0)),f=0,c=0,r.mode=tl;case tl:for(;c<16;){if(s===0)break e;s--,f+=n[i++]<>8),r.flags&512&&(E[0]=f&255,E[1]=f>>>8&255,r.check=Tt(r.check,E,2,0)),f=0,c=0,r.mode=rl;case rl:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[i++]<>>8&255,r.check=Tt(r.check,E,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=nl;case nl:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(T=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),nt.arraySet(r.head.extra,n,i,p,T)),r.flags&512&&(r.check=Tt(r.check,n,p,i)),s-=p,i+=p,r.length-=p),r.length))break e;r.length=0,r.mode=ol;case ol:if(r.flags&2048){if(s===0)break e;p=0;do T=n[i+p++],r.head&&T&&r.length<65536&&(r.head.name+=String.fromCharCode(T));while(T&&p>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Lt;break;case sl:for(;c<32;){if(s===0)break e;s--,f+=n[i++]<>>=c&7,c-=c&7,r.mode=wa;break}for(;c<3;){if(s===0)break e;s--,f+=n[i++]<>>=1,c-=1,f&3){case 0:r.mode=fl;break;case 1:if(Kh(r),r.mode=ui,e===ci){f>>>=2,c-=2;break e}break;case 2:r.mode=cl;break;case 3:t.msg="invalid block type",r.mode=be}f>>>=2,c-=2;break;case fl:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[i++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=be;break}if(r.length=f&65535,f=0,c=0,r.mode=Fa,e===ci)break e;case Fa:r.mode=ll;case ll:if(p=r.length,p){if(p>s&&(p=s),p>l&&(p=l),p===0)break e;nt.arraySet(o,n,i,p,a),s-=p,i+=p,l-=p,a+=p,r.length-=p;break}r.mode=Lt;break;case cl:for(;c<14;){if(s===0)break e;s--,f+=n[i++]<>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=be;break}r.have=0,r.mode=ul;case ul:for(;r.have>>=3,c-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},C=Zn(Nh,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,C){t.msg="invalid code lengths set",r.mode=be;break}r.have=0,r.mode=dl;case dl:for(;r.have>>24,m=F>>>16&255,y=F&65535,!(x<=c);){if(s===0)break e;s--,f+=n[i++]<>>=x,c-=x,r.lens[r.have++]=y;else{if(y===16){for(A=x+2;c>>=x,c-=x,r.have===0){t.msg="invalid bit length repeat",r.mode=be;break}T=r.lens[r.have-1],p=3+(f&3),f>>>=2,c-=2}else if(y===17){for(A=x+3;c>>=x,c-=x,T=0,p=3+(f&7),f>>>=3,c-=3}else{for(A=x+7;c>>=x,c-=x,T=0,p=11+(f&127),f>>>=7,c-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=be;break}for(;p--;)r.lens[r.have++]=T}}if(r.mode===be)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=be;break}if(r.lenbits=9,I={bits:r.lenbits},C=Zn(wl,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,C){t.msg="invalid literal/lengths set",r.mode=be;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},C=Zn(Sl,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,C){t.msg="invalid distances set",r.mode=be;break}if(r.mode=ui,e===ci)break e;case ui:r.mode=di;case di:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=i,t.avail_in=s,r.hold=f,r.bits=c,Bh(t,d),a=t.next_out,o=t.output,l=t.avail_out,i=t.next_in,n=t.input,s=t.avail_in,f=r.hold,c=r.bits,r.mode===Lt&&(r.back=-1);break}for(r.back=0;F=r.lencode[f&(1<>>24,m=F>>>16&255,y=F&65535,!(x<=c);){if(s===0)break e;s--,f+=n[i++]<>w)],x=F>>>24,m=F>>>16&255,y=F&65535,!(w+x<=c);){if(s===0)break e;s--,f+=n[i++]<>>=w,c-=w,r.back+=w}if(f>>>=x,c-=x,r.back+=x,r.length=y,m===0){r.mode=gl;break}if(m&32){r.back=-1,r.mode=Lt;break}if(m&64){t.msg="invalid literal/length code",r.mode=be;break}r.extra=m&15,r.mode=hl;case hl:if(r.extra){for(A=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=pl;case pl:for(;F=r.distcode[f&(1<>>24,m=F>>>16&255,y=F&65535,!(x<=c);){if(s===0)break e;s--,f+=n[i++]<>w)],x=F>>>24,m=F>>>16&255,y=F&65535,!(w+x<=c);){if(s===0)break e;s--,f+=n[i++]<>>=w,c-=w,r.back+=w}if(f>>>=x,c-=x,r.back+=x,m&64){t.msg="invalid distance code",r.mode=be;break}r.offset=y,r.extra=m&15,r.mode=vl;case vl:if(r.extra){for(A=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=be;break}r.mode=ml;case ml:if(l===0)break e;if(p=d-l,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=be;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),b=r.window}else b=o,h=a-r.offset,p=r.length;p>l&&(p=l),l-=p,r.length-=p;do o[a++]=b[h++];while(--p);r.length===0&&(r.mode=di);break;case gl:if(l===0)break e;o[a++]=r.length,l--,r.mode=di;break;case wa:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[i++]<{"use strict";Ol.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Nl=He((ig,Bl)=>{"use strict";function Qh(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Bl.exports=Qh});var Il=He(Jn=>{"use strict";var en=Rl(),Yn=It(),pi=ha(),ke=Ta(),Ea=ti(),_h=pa(),$h=Nl(),Ml=Object.prototype.toString;function Dr(t){if(!(this instanceof Dr))return new Dr(t);this.options=Yn.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _h,this.strm.avail_out=0;var r=en.inflateInit2(this.strm,e.windowBits);if(r!==ke.Z_OK)throw new Error(Ea[r]);if(this.header=new $h,en.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=pi.string2buf(e.dictionary):Ml.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=en.inflateSetDictionary(this.strm,e.dictionary),r!==ke.Z_OK)))throw new Error(Ea[r])}Dr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,i,a,s,l,f,c=!1;if(this.ended)return!1;a=e===~~e?e:e===!0?ke.Z_FINISH:ke.Z_NO_FLUSH,typeof t=="string"?r.input=pi.binstring2buf(t):Ml.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Yn.Buf8(n),r.next_out=0,r.avail_out=n),i=en.inflate(r,ke.Z_NO_FLUSH),i===ke.Z_NEED_DICT&&o&&(i=en.inflateSetDictionary(this.strm,o)),i===ke.Z_BUF_ERROR&&c===!0&&(i=ke.Z_OK,c=!1),i!==ke.Z_STREAM_END&&i!==ke.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(r.avail_out===0||i===ke.Z_STREAM_END||r.avail_in===0&&(a===ke.Z_FINISH||a===ke.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=pi.utf8border(r.output,r.next_out),l=r.next_out-s,f=pi.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&Yn.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(Yn.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&i!==ke.Z_STREAM_END);return i===ke.Z_STREAM_END&&(a=ke.Z_FINISH),a===ke.Z_FINISH?(i=en.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ke.Z_OK):(a===ke.Z_SYNC_FLUSH&&(this.onEnd(ke.Z_OK),r.avail_out=0),!0)};Dr.prototype.onData=function(t){this.chunks.push(t)};Dr.prototype.onEnd=function(t){t===ke.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yn.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Aa(t,e){var r=new Dr(e);if(r.push(t,!0),r.err)throw r.msg||Ea[r.err];return r.result}function ep(t,e){return e=e||{},e.raw=!0,Aa(t,e)}Jn.Inflate=Dr;Jn.inflate=Aa;Jn.inflateRaw=ep;Jn.ungzip=Aa});var Qn=He((sg,jl)=>{"use strict";var tp=It().assign,rp=Uf(),np=Il(),op=Ta(),zl={};tp(zl,rp,np,op);jl.exports=zl});var Om={};od(Om,{default:()=>qi});module.exports=id(Om);var N=require("obsidian");var Ki=function(t,e){return Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},Ki(t,e)};function k(t,e){Ki(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Y=function(){return Y=Object.assign||function(e){for(var r,n=1,o=arguments.length;n0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]>2],e+=Vr[(t[n]&3)<<4|t[n+1]>>4],e+=Vr[(t[n+1]&15)<<2|t[n+2]>>6],e+=Vr[t[n+2]&63];return r%3===2?e=e.substring(0,e.length-1)+"=":r%3===1&&(e=e.substring(0,e.length-2)+"=="),e},Ts=function(t){var e=t.length*.75,r=t.length,n,o=0,i,a,s,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var f=new Uint8Array(e);for(n=0;n>4,f[o++]=(a&15)<<4|s>>2,f[o++]=(s&3)<<6|l&63;return f},ad=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,As=function(t){var e=t.trim(),r=e.substring(0,100),n=r.match(ad);if(!n)return Ts(e);var o=n[0],i=e.substring(o.length);return Ts(i)};var Q=function(t){return t.charCodeAt(0)},Rs=function(t){return t.codePointAt(0)},Mt=function(t,e){return rt(t.toString(16),e,"0").toUpperCase()},Wt=function(t){return Mt(t,2)},tt=function(t){return String.fromCharCode(t)},Os=function(t){return tt(parseInt(t,16))},rt=function(t,e,r){for(var n="",o=0,i=e-t.length;o=55296&&r<=56319&&t.length>o&&(n=t.charCodeAt(o),n>=56320&&n<=57343&&(i=2)),[t.slice(e,e+i),i]},Ns=function(t){for(var e=[],r=0,n=t.length;rr&&f(),a+=d,s+=p}}return f(),l},cd=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,Zo=function(t){var e=t.match(cd);if(e){var r=e[1],n=e[2],o=n===void 0?"01":n,i=e[3],a=i===void 0?"01":i,s=e[4],l=s===void 0?"00":s,f=e[5],c=f===void 0?"00":f,u=e[6],d=u===void 0?"00":u,p=e[7],h=p===void 0?"Z":p,b=e[8],F=b===void 0?"00":b,x=e[9],m=x===void 0?"00":x,y=h==="Z"?"Z":""+h+F+":"+m,w=new Date(r+"-"+o+"-"+a+"T"+l+":"+c+":"+d+y);return w}},On=function(t,e){for(var r,n=0,o;n=0&&t<=65535},Zs=function(t){return t>=65536&&t<=1114111},Yi=function(t){return Math.floor((t-65536)/1024)+55296},Ji=function(t){return(t-65536)%1024+56320},Gt;(function(t){t.BigEndian="BigEndian",t.LittleEndian="LittleEndian"})(Gt||(Gt={}));var Bn="\uFFFD".codePointAt(0),Qo=function(t,e){if(e===void 0&&(e=!0),t.length<=1)return String.fromCodePoint(Bn);for(var r=e?dd(t):Gt.BigEndian,n=e?2:0,o=[];t.length-n>=2;){var i=Gs(t[n++],t[n++],r);if(ud(i))if(t.length-n<2)o.push(Bn);else{var a=Gs(t[n++],t[n++],r);Ws(a)?o.push(i,a):o.push(Bn)}else Ws(i)?(n+=2,o.push(Bn)):o.push(i)}return n=55296&&t<=56319},Ws=function(t){return t>=56320&&t<=57343},Gs=function(t,e,r){if(r===Gt.LittleEndian)return e<<8|t;if(r===Gt.BigEndian)return t<<8|e;throw new Error("Invalid byteOrder: "+r)},dd=function(t){return Ys(t)?Gt.BigEndian:Js(t)?Gt.LittleEndian:Gt.BigEndian},Ys=function(t){return t[0]===254&&t[1]===255},Js=function(t){return t[0]===255&&t[1]===254},_o=function(t){return Ys(t)||Js(t)};var Qs=function(t){var e=String(t);if(Math.abs(t)<1){var r=parseInt(t.toString().split("e-")[1]);if(r){var n=t<0;n&&(t*=-1),t*=Math.pow(10,r-1),e="0."+new Array(r).join("0")+t.toString().substring(2),n&&(e="-"+e)}}else{var r=parseInt(t.toString().split("+")[1]);r>20&&(r-=20,t/=Math.pow(10,r),e=t.toString()+new Array(r+1).join("0"))}return e},Nn=function(t){return Math.ceil(t.toString(2).length/8)},mr=function(t){for(var e=new Uint8Array(Nn(t)),r=1;r<=e.length;r++)e[r-1]=t>>(e.length-r)*8;return e};var gr=function(t){throw new Error(t)};var Hl=Ko(Qn()),Ll="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$n=new Uint8Array(256);for(_n=0;_n>4,f[o++]=(a&15)<<4|s>>2,f[o++]=(s&3)<<6|l&63;return f},ap=function(t){for(var e="",r=0;rn)throw new Error(Me(e)+" must be at least "+r+" and at most "+n+", but was actually "+t)},ot=function(t,e,r,n){P(t,e,["number","undefined"]),typeof t=="number"&&Ue(t,e,r,n)},gi=function(t,e,r){if(P(t,e,["number"]),t%r!==0)throw new Error(Me(e)+" must be a multiple of "+r+", but was actually "+t)},sc=function(t,e){if(!Number.isInteger(t))throw new Error(Me(e)+" must be an integer, but was actually "+t)},_t=function(t,e){if(![1,0].includes(Math.sign(t)))throw new Error(Me(e)+" must be a positive number or 0, but was actually "+t)};var $=new Uint16Array(256);for(no=0;no<256;no++)$[no]=no;var no;$[22]=Q("");$[24]=Q("\u02D8");$[25]=Q("\u02C7");$[26]=Q("\u02C6");$[27]=Q("\u02D9");$[28]=Q("\u02DD");$[29]=Q("\u02DB");$[30]=Q("\u02DA");$[31]=Q("\u02DC");$[127]=Q("\uFFFD");$[128]=Q("\u2022");$[129]=Q("\u2020");$[130]=Q("\u2021");$[131]=Q("\u2026");$[132]=Q("\u2014");$[133]=Q("\u2013");$[134]=Q("\u0192");$[135]=Q("\u2044");$[136]=Q("\u2039");$[137]=Q("\u203A");$[138]=Q("\u2212");$[139]=Q("\u2030");$[140]=Q("\u201E");$[141]=Q("\u201C");$[142]=Q("\u201D");$[143]=Q("\u2018");$[144]=Q("\u2019");$[145]=Q("\u201A");$[146]=Q("\u2122");$[147]=Q("\uFB01");$[148]=Q("\uFB02");$[149]=Q("\u0141");$[150]=Q("\u0152");$[151]=Q("\u0160");$[152]=Q("\u0178");$[153]=Q("\u017D");$[154]=Q("\u0131");$[155]=Q("\u0142");$[156]=Q("\u0153");$[157]=Q("\u0161");$[158]=Q("\u017E");$[159]=Q("\uFFFD");$[160]=Q("\u20AC");$[173]=Q("\uFFFD");var yi=function(t){for(var e=new Array(t.length),r=0,n=t.length;r=g.ExclamationPoint&&t<=g.Tilde&&!xi[t]},Dc={},Cc=new Map,jp=function(t){k(e,t);function e(r,n){var o=this;if(r!==Dc)throw new tn("PDFName");o=t.call(this)||this;for(var i="/",a=0,s=n.length;a=g.Zero&&f<=g.Nine||f>=g.a&&f<=g.f||f>=g.A&&f<=g.F?(n+=l,(n.length===2||!(c>="0"&&c<="9"||c>="a"&&c<="f"||c>="A"&&c<="F"))&&(i(parseInt(n,16)),n="")):i(f):f===g.Hash?o=!0:i(f)}return new Uint8Array(r)},e.prototype.decodeText=function(){var r=this.asBytes();return String.fromCharCode.apply(String,Array.from(r))},e.prototype.asString=function(){return this.encodedName},e.prototype.value=function(){return this.encodedName},e.prototype.clone=function(){return this},e.prototype.toString=function(){return this.encodedName},e.prototype.sizeInBytes=function(){return this.encodedName.length},e.prototype.copyBytesInto=function(r,n){return n+=me(this.encodedName,r,n),this.encodedName.length},e.of=function(r){var n=Ip(r),o=Cc.get(n);return o||(o=new e(Dc,n),Cc.set(n,o)),o},e.Length=e.of("Length"),e.FlateDecode=e.of("FlateDecode"),e.Resources=e.of("Resources"),e.Font=e.of("Font"),e.XObject=e.of("XObject"),e.ExtGState=e.of("ExtGState"),e.Contents=e.of("Contents"),e.Type=e.of("Type"),e.Parent=e.of("Parent"),e.MediaBox=e.of("MediaBox"),e.Page=e.of("Page"),e.Annots=e.of("Annots"),e.TrimBox=e.of("TrimBox"),e.ArtBox=e.of("ArtBox"),e.BleedBox=e.of("BleedBox"),e.CropBox=e.of("CropBox"),e.Rotate=e.of("Rotate"),e.Title=e.of("Title"),e.Author=e.of("Author"),e.Subject=e.of("Subject"),e.Creator=e.of("Creator"),e.Keywords=e.of("Keywords"),e.Producer=e.of("Producer"),e.CreationDate=e.of("CreationDate"),e.ModDate=e.of("ModDate"),e}(ve),v=jp;var Lp=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.asNull=function(){return null},e.prototype.clone=function(){return this},e.prototype.toString=function(){return"null"},e.prototype.sizeInBytes=function(){return 4},e.prototype.copyBytesInto=function(r,n){return r[n++]=g.n,r[n++]=g.u,r[n++]=g.l,r[n++]=g.l,4},e}(ve),Te=new Lp;var Hp=function(t){k(e,t);function e(r,n){var o=t.call(this)||this;return o.dict=r,o.context=n,o}return e.prototype.keys=function(){return Array.from(this.dict.keys())},e.prototype.values=function(){return Array.from(this.dict.values())},e.prototype.entries=function(){return Array.from(this.dict.entries())},e.prototype.set=function(r,n){this.dict.set(r,n)},e.prototype.get=function(r,n){n===void 0&&(n=!1);var o=this.dict.get(r);if(!(o===Te&&!n))return o},e.prototype.has=function(r){var n=this.dict.get(r);return n!==void 0&&n!==Te},e.prototype.lookupMaybe=function(r){for(var n,o=[],i=1;ithis.largestObjectNumber&&(this.largestObjectNumber=t.objectNumber)},e.prototype.nextRef=function(){return this.largestObjectNumber+=1,J.of(this.largestObjectNumber)},e.prototype.register=function(t){var r=this.nextRef();return this.assign(r,t),r},e.prototype.delete=function(t){return this.indirectObjects.delete(t)},e.prototype.lookupMaybe=function(t){for(var r=[],n=1;n1?(this.subsections.push([t]),this.chunkIdx+=1,this.chunkLength=1):(r.push(t),this.chunkLength+=1)},e.create=function(){return new e({ref:J.of(0,65535),offset:0,deleted:!0})},e.createEmpty=function(){return new e},e}(),oo=Jp;var Qp=function(){function e(t){this.lastXRefOffset=String(t)}return e.prototype.toString=function(){return`startxref +endstream`,r},e.prototype.copyBytesInto=function(r,n){this.updateDict();var o=n;n+=this.dict.copyBytesInto(r,n),r[n++]=g.Newline,r[n++]=g.s,r[n++]=g.t,r[n++]=g.r,r[n++]=g.e,r[n++]=g.a,r[n++]=g.m,r[n++]=g.Newline;for(var i=this.getContents(),a=0,s=i.length;athis.largestObjectNumber&&(this.largestObjectNumber=e.objectNumber)},t.prototype.nextRef=function(){return this.largestObjectNumber+=1,J.of(this.largestObjectNumber)},t.prototype.register=function(e){var r=this.nextRef();return this.assign(r,e),r},t.prototype.delete=function(e){return this.indirectObjects.delete(e)},t.prototype.lookupMaybe=function(e){for(var r=[],n=1;n1?(this.subsections.push([e]),this.chunkIdx+=1,this.chunkLength=1):(r.push(e),this.chunkLength+=1)},t.create=function(){return new t({ref:J.of(0,65535),offset:0,deleted:!0})},t.createEmpty=function(){return new t},t}(),oo=Qp;var _p=function(){function t(e){this.lastXRefOffset=String(e)}return t.prototype.toString=function(){return`startxref `+this.lastXRefOffset+` -%%EOF`},e.prototype.sizeInBytes=function(){return 16+this.lastXRefOffset.length},e.prototype.copyBytesInto=function(t,r){var n=r;return t[r++]=y.s,t[r++]=y.t,t[r++]=y.a,t[r++]=y.r,t[r++]=y.t,t[r++]=y.x,t[r++]=y.r,t[r++]=y.e,t[r++]=y.f,t[r++]=y.Newline,r+=me(this.lastXRefOffset,t,r),t[r++]=y.Newline,t[r++]=y.Percent,t[r++]=y.Percent,t[r++]=y.E,t[r++]=y.O,t[r++]=y.F,r-n},e.forLastCrossRefSectionOffset=function(t){return new e(t)},e}(),Ar=Qp;var _p=function(){function e(t){this.dict=t}return e.prototype.toString=function(){return`trailer -`+this.dict.toString()},e.prototype.sizeInBytes=function(){return 8+this.dict.sizeInBytes()},e.prototype.copyBytesInto=function(t,r){var n=r;return t[r++]=y.t,t[r++]=y.r,t[r++]=y.a,t[r++]=y.i,t[r++]=y.l,t[r++]=y.e,t[r++]=y.r,t[r++]=y.Newline,r+=this.dict.copyBytesInto(t,r),r-n},e.of=function(t){return new e(t)},e}(),Ha=_p;var $p=function(e){T(t,e);function t(r,n,o){o===void 0&&(o=!0);var i=e.call(this,r.obj({}),o)||this;return i.objects=n,i.offsets=i.computeObjectOffsets(),i.offsetsString=i.computeOffsetsString(),i.dict.set(v.of("Type"),v.of("ObjStm")),i.dict.set(v.of("N"),j.of(i.objects.length)),i.dict.set(v.of("First"),j.of(i.offsetsString.length)),i}return t.prototype.getObjectsCount=function(){return this.objects.length},t.prototype.clone=function(r){return t.withContextAndObjects(r||this.dict.context,this.objects.slice(),this.encode)},t.prototype.getContentsString=function(){for(var r=this.offsetsString,n=0,o=this.objects.length;n1&&(a.push(s),a.push(c.ref.objectNumber),s=0),s+=1}return a.push(s),a},i.computeEntryTuples=function(){for(var a=new Array(i.entries.length),s=0,l=i.entries.length;ss[0]&&(s[0]=h),b>s[1]&&(s[1]=b),F>s[2]&&(s[2]=F)}return s},i.entries=n||[],i.entryTuplesCache=Ve.populatedBy(i.computeEntryTuples),i.maxByteWidthsCache=Ve.populatedBy(i.computeMaxEntryByteWidths),i.indexCache=Ve.populatedBy(i.computeIndex),r.set(v.of("Type"),v.of("XRef")),i}return t.prototype.addDeletedEntry=function(r,n){var o=er.Deleted;this.entries.push({type:o,ref:r,nextFreeObjectNumber:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addUncompressedEntry=function(r,n){var o=er.Uncompressed;this.entries.push({type:o,ref:r,offset:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addCompressedEntry=function(r,n,o){var i=er.Compressed;this.entries.push({type:i,ref:r,objectStreamRef:n,index:o}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.clone=function(r){var n=this,o=n.dict,i=n.entries,a=n.encode;return t.of(o.clone(r),i.slice(),a)},t.prototype.getContentsString=function(){for(var r=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),o="",i=0,a=r.length;i=0;h--)o+=(u[h]||0).toString(2);for(var h=n[1]-1;h>=0;h--)o+=(d[h]||0).toString(2);for(var h=n[2]-1;h>=0;h--)o+=(p[h]||0).toString(2)}return o},t.prototype.getUnencodedContents=function(){for(var r=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),o=new Uint8Array(this.getUnencodedContentsSize()),i=0,a=0,s=r.length;a=0;b--)o[i++]=d[b]||0;for(var b=n[1]-1;b>=0;b--)o[i++]=p[b]||0;for(var b=n[2]-1;b>=0;b--)o[i++]=h[b]||0}return o},t.prototype.getUnencodedContentsSize=function(){var r=this.maxByteWidthsCache.access(),n=Us(r);return n*this.entries.length},t.prototype.updateDict=function(){e.prototype.updateDict.call(this);var r=this.maxByteWidthsCache.access(),n=this.indexCache.access(),o=this.dict.context;this.dict.set(v.of("W"),o.obj(r)),this.dict.set(v.of("Index"),o.obj(n))},t.create=function(r,n){n===void 0&&(n=!0);var o=new t(r,[],n);return o.addDeletedEntry(J.of(0,65535),0),o},t.of=function(r,n,o){return o===void 0&&(o=!0),new t(r,n,o)},t}(Er),Ua=r0;var n0=function(e){T(t,e);function t(r,n,o,i){var a=e.call(this,r,n)||this;return a.encodeStreams=o,a.objectsPerStream=i,a}return t.prototype.computeBufferSize=function(){return V(this,void 0,void 0,function(){var r,n,o,i,a,s,l,f,h,b,c,g,u,d,F,p,h,b,F,g,m,x,w,S;return q(this,function(D){switch(D.label){case 0:r=this.context.largestObjectNumber+1,n=Ht.forVersion(1,7),o=n.sizeInBytes()+2,i=Ua.create(this.createTrailerDict(),this.encodeStreams),a=[],s=[],l=[],f=this.context.enumerateIndirectObjects(),h=0,b=f.length,D.label=1;case 1:return h"},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(r,n){return r[n++]=y.LessThan,n+=me(this.value,r,n),r[n++]=y.GreaterThan,this.value.length+2},t.of=function(r){return new t(r)},t.fromText=function(r){for(var n=Xs(r),o="",i=0,a=n.length;i1&&(a.push(s),a.push(c.ref.objectNumber),s=0),s+=1}return a.push(s),a},i.computeEntryTuples=function(){for(var a=new Array(i.entries.length),s=0,l=i.entries.length;ss[0]&&(s[0]=h),b>s[1]&&(s[1]=b),F>s[2]&&(s[2]=F)}return s},i.entries=n||[],i.entryTuplesCache=Ve.populatedBy(i.computeEntryTuples),i.maxByteWidthsCache=Ve.populatedBy(i.computeMaxEntryByteWidths),i.indexCache=Ve.populatedBy(i.computeIndex),r.set(v.of("Type"),v.of("XRef")),i}return e.prototype.addDeletedEntry=function(r,n){var o=er.Deleted;this.entries.push({type:o,ref:r,nextFreeObjectNumber:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},e.prototype.addUncompressedEntry=function(r,n){var o=er.Uncompressed;this.entries.push({type:o,ref:r,offset:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},e.prototype.addCompressedEntry=function(r,n,o){var i=er.Compressed;this.entries.push({type:i,ref:r,objectStreamRef:n,index:o}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},e.prototype.clone=function(r){var n=this,o=n.dict,i=n.entries,a=n.encode;return e.of(o.clone(r),i.slice(),a)},e.prototype.getContentsString=function(){for(var r=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),o="",i=0,a=r.length;i=0;h--)o+=(u[h]||0).toString(2);for(var h=n[1]-1;h>=0;h--)o+=(d[h]||0).toString(2);for(var h=n[2]-1;h>=0;h--)o+=(p[h]||0).toString(2)}return o},e.prototype.getUnencodedContents=function(){for(var r=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),o=new Uint8Array(this.getUnencodedContentsSize()),i=0,a=0,s=r.length;a=0;b--)o[i++]=d[b]||0;for(var b=n[1]-1;b>=0;b--)o[i++]=p[b]||0;for(var b=n[2]-1;b>=0;b--)o[i++]=h[b]||0}return o},e.prototype.getUnencodedContentsSize=function(){var r=this.maxByteWidthsCache.access(),n=Hs(r);return n*this.entries.length},e.prototype.updateDict=function(){t.prototype.updateDict.call(this);var r=this.maxByteWidthsCache.access(),n=this.indexCache.access(),o=this.dict.context;this.dict.set(v.of("W"),o.obj(r)),this.dict.set(v.of("Index"),o.obj(n))},e.create=function(r,n){n===void 0&&(n=!0);var o=new e(r,[],n);return o.addDeletedEntry(J.of(0,65535),0),o},e.of=function(r,n,o){return o===void 0&&(o=!0),new e(r,n,o)},e}(Tr),Ua=n0;var o0=function(t){k(e,t);function e(r,n,o,i){var a=t.call(this,r,n)||this;return a.encodeStreams=o,a.objectsPerStream=i,a}return e.prototype.computeBufferSize=function(){return V(this,void 0,void 0,function(){var r,n,o,i,a,s,l,f,h,b,c,x,u,d,F,p,h,b,F,x,m,y,w,S;return q(this,function(D){switch(D.label){case 0:r=this.context.largestObjectNumber+1,n=Ht.forVersion(1,7),o=n.sizeInBytes()+2,i=Ua.create(this.createTrailerDict(),this.encodeStreams),a=[],s=[],l=[],f=this.context.enumerateIndirectObjects(),h=0,b=f.length,D.label=1;case 1:return h"},e.prototype.sizeInBytes=function(){return this.value.length+2},e.prototype.copyBytesInto=function(r,n){return r[n++]=g.LessThan,n+=me(this.value,r,n),r[n++]=g.GreaterThan,this.value.length+2},e.of=function(r){return new e(r)},e.fromText=function(r){for(var n=Ks(r),o="",i=0,a=n.length;i endcodespacerange -`+e.length+` beginbfchar -`+e.map(function(t){var r=t[0],n=t[1];return r+" "+n}).join(` +`+t.length+` beginbfchar +`+t.map(function(e){var r=e[0],n=e[1];return r+" "+n}).join(` `)+` endbfchar endcmap CMapName currentdict /CMap defineresource pop end -end`},Bc=function(){for(var e=[],t=0;t"},Si=function(e){return Mt(e,4)},s0=function(e){if(Zs(e))return Si(e);if(Ys(e)){var t=Yi(e),r=Ji(e);return""+Si(t)+Si(r)}var n=Wt(e),o="0x"+n+" is not a valid UTF-8 or UTF-16 codepoint.";throw new Error(o)};var f0=function(e){var t=0,r=function(n){t|=1<=y.Zero&&f<=y.Seven?(n+=l,(n.length===3||!(c>="0"&&c<="7"))&&(i(parseInt(n,8)),n="")):i(f):f===y.BackSlash?o=!0:i(f)}return new Uint8Array(r)},t.prototype.decodeText=function(){var r=this.asBytes();return $o(r)?_o(r):bi(r)},t.prototype.decodeDate=function(){var r=this.decodeText(),n=Yo(r);if(!n)throw new xi(r);return n},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return"("+this.value+")"},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(r,n){return r[n++]=y.LeftParen,n+=me(this.value,r,n),r[n++]=y.RightParen,this.value.length+2},t.of=function(r){return new t(r)},t.fromDate=function(r){var n=nt(String(r.getUTCFullYear()),4,"0"),o=nt(String(r.getUTCMonth()+1),2,"0"),i=nt(String(r.getUTCDate()),2,"0"),a=nt(String(r.getUTCHours()),2,"0"),s=nt(String(r.getUTCMinutes()),2,"0"),l=nt(String(r.getUTCSeconds()),2,"0");return new t("D:"+n+o+i+a+s+l+"Z")},t}(ve),ne=l0;var c0=function(){function e(t,r,n,o){var i=this;this.allGlyphsInFontSortedById=function(){for(var a=new Array(i.font.characterSet.length),s=0,l=a.length;s>3)]>>7-((h&7)<<0)&1,R=3*A;s[w]=S[R],s[w+1]=S[R+1],s[w+2]=S[R+2],s[w+3]=A>2)]>>6-((h&3)<<1)&3,R=3*A;s[w]=S[R],s[w+1]=S[R+1],s[w+2]=S[R+2],s[w+3]=A>1)]>>4-((h&1)<<2)&15,R=3*A;s[w]=S[R],s[w+1]=S[R+1],s[w+2]=S[R+2],s[w+3]=A>>3)]>>>7-(L&7)&1),ue=N==g*255?0:255;l[te+L]=ue<<24|N<<16|N<<8|N}else if(c==2)for(var L=0;L>>2)]>>>6-((L&3)<<1)&3),ue=N==g*85?0:255;l[te+L]=ue<<24|N<<16|N<<8|N}else if(c==4)for(var L=0;L>>1)]>>>4-((L&1)<<2)&15),ue=N==g*17?0:255;l[te+L]=ue<<24|N<<16|N<<8|N}else if(c==8)for(var L=0;L>>2<<3));o==0;){if(o=F(t,d,1),i=F(t,d+1,2),d+=3,i==0){(d&7)!=0&&(d+=8-(d&7));var C=(d>>>3)+4,E=t[C-4]|t[C-3]<<8;k&&(r=e.H.W(r,u+E)),r.set(new n(t.buffer,t.byteOffset+C,E),u),d=C+E<<3,u+=E;continue}if(k&&(r=e.H.W(r,u+(1<<17))),i==1&&(p=D.J,h=D.h,f=511,c=31),i==2){a=g(t,d,5)+257,s=g(t,d+5,5)+1,l=g(t,d+10,4)+4,d+=14;for(var I=d,A=1,R=0;R<38;R+=2)D.Q[R]=0,D.Q[R+1]=0;for(var R=0;RA&&(A=z)}d+=3*l,x(D.Q,A),w(D.Q,A,D.u),p=D.w,h=D.d,d=m(D.u,(1<>>4;if(!(L>>>8))r[u++]=L;else{if(L==256)break;var ue=u+L-254;if(L>264){var ye=D.q[L-257];ue=u+(ye>>>3)+g(t,d,ye&7),d+=ye&7}var oe=h[S(t,d)&c];d+=oe&15;var Fe=oe>>>4,Ce=D.c[Fe],Le=(Ce>>>4)+F(t,d,Ce&15);for(d+=Ce&15;u>>4;if(u<=15)a[f]=u,f++;else{var d=0,p=0;u==16?(p=3+s(o,i,2),i+=2,d=a[f-1]):u==17?(p=3+s(o,i,3),i+=3):u==18&&(p=11+s(o,i,7),i+=7);for(var h=f+p;f>>1;ai&&(i=l),a++}for(;a>1,f=t[s+1],c=l<<4|f,u=r-f,d=t[s]<>>15-r;n[h]=c,d++}},e.H.l=function(t,r){for(var n=e.H.m.r,o=15-r,i=0;i>>o}},e.H.M=function(t,r,n){n=n<<(r&7);var o=r>>>3;t[o]|=n,t[o+1]|=n>>>8},e.H.I=function(t,r,n){n=n<<(r&7);var o=r>>>3;t[o]|=n,t[o+1]|=n>>>8,t[o+2]|=n>>>16},e.H.e=function(t,r,n){return(t[r>>>3]|t[(r>>>3)+1]<<8)>>>(r&7)&(1<>>3]|t[(r>>>3)+1]<<8|t[(r>>>3)+2]<<16)>>>(r&7)&(1<>>3]|t[(r>>>3)+1]<<8|t[(r>>>3)+2]<<16)>>>(r&7)},e.H.i=function(t,r){return(t[r>>>3]|t[(r>>>3)+1]<<8|t[(r>>>3)+2]<<16|t[(r>>>3)+3]<<24)>>>(r&7)},e.H.m=function(){var t=Uint16Array,r=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new r(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new r(286),Y:new r(30),a:new r(19),t:new r(15e3),k:new t(65536),g:new t(32768)}}(),function(){for(var t=e.H.m,r=32768,n=0;n>>1|(o&1431655765)<<1,o=(o&3435973836)>>>2|(o&858993459)<<2,o=(o&4042322160)>>>4|(o&252645135)<<4,o=(o&4278255360)>>>8|(o&16711935)<<8,t.r[n]=(o>>>16|o<<16)>>>17}function i(a,s,l){for(;s--!=0;)a.push(0,l)}for(var n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];i(t._,144,8),i(t._,112,9),i(t._,24,7),i(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),i(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),i(t.Q,19,0),i(t.C,286,0),i(t.D,30,0),i(t.v,320,0)}(),e.H.N}();B.decode._readInterlace=function(e,t){for(var r=t.width,n=t.height,o=B.decode._getBPP(t),i=o>>3,a=Math.ceil(r*o/8),s=new Uint8Array(n*a),l=0,f=[0,0,4,0,2,0,1],c=[0,4,0,2,0,1,0],u=[8,8,8,4,4,2,2],d=[8,8,4,4,2,2,1],p=0;p<7;){for(var h=u[p],b=d[p],F=0,g=0,m=f[p];m>3];E=E>>7-(C&7)&1,s[D*a+(k>>3)]|=E<<7-((k&7)<<0)}if(o==2){var E=e[C>>3];E=E>>6-(C&7)&3,s[D*a+(k>>2)]|=E<<6-((k&3)<<1)}if(o==4){var E=e[C>>3];E=E>>4-(C&7)&15,s[D*a+(k>>1)]|=E<<4-((k&1)<<2)}if(o>=8)for(var I=D*a+k*i,A=0;A>3)+A];C+=o,k+=b}S++,D+=h}F*g!=0&&(l+=g*(1+w)),p=p+1}return s};B.decode._getBPP=function(e){var t=[1,null,3,1,2,null,4][e.ctype];return t*e.depth};B.decode._filterZero=function(e,t,r,n,o){var i=B.decode._getBPP(t),a=Math.ceil(n*i/8),s=B.decode._paeth;i=Math.ceil(i/8);var l=0,f=1,c=e[r],u=0;if(c>1&&(e[r]=[0,0,1][c-2]),c==3)for(u=i;u>>1)&255;for(var d=0;d>>1);for(;u>>1)}else{for(;u>8&255,e[t+1]=r&255},readUint:function(e,t){return e[t]*(256*256*256)+(e[t+1]<<16|e[t+2]<<8|e[t+3])},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=r&255},readASCII:function(e,t,r){for(var n="",o=0;o=0&&s>=0?(u=p*t+h<<2,d=(s+p)*o+a+h<<2):(u=(-s+p)*t-a+h<<2,d=p*o+h<<2),l==0)n[d]=e[u],n[d+1]=e[u+1],n[d+2]=e[u+2],n[d+3]=e[u+3];else if(l==1){var b=e[u+3]*.00392156862745098,F=e[u]*b,g=e[u+1]*b,m=e[u+2]*b,x=n[d+3]*(1/255),w=n[d]*x,S=n[d+1]*x,D=n[d+2]*x,k=1-b,C=b+x*k,E=C==0?0:1/C;n[d+3]=255*C,n[d+0]=(F+w*k)*E,n[d+1]=(g+S*k)*E,n[d+2]=(m+D*k)*E}else if(l==2){var b=e[u+3],F=e[u],g=e[u+1],m=e[u+2],x=n[d+3],w=n[d],S=n[d+1],D=n[d+2];b==x&&F==w&&g==S&&m==D?(n[d]=0,n[d+1]=0,n[d+2]=0,n[d+3]=0):(n[d]=F,n[d+1]=g,n[d+2]=m,n[d+3]=b)}else if(l==3){var b=e[u+3],F=e[u],g=e[u+1],m=e[u+2],x=n[d+3],w=n[d],S=n[d+1],D=n[d+2];if(b==x&&F==w&&g==S&&m==D)continue;if(b<220&&x>20)return!1}return!0};B.encode=function(e,t,r,n,o,i,a){n==null&&(n=0),a==null&&(a=!1);var s=B.encode.compress(e,t,r,n,[!1,!1,!1,0,a]);return B.encode.compressPNG(s,-1),B.encode._main(s,t,r,o,i)};B.encodeLL=function(e,t,r,n,o,i,a,s){for(var l={ctype:0+(n==1?0:2)+(o==0?0:4),depth:i,frames:[]},f=Date.now(),c=(n+o)*i,u=c*t,d=0;d1,u=!1,d=33+(c?20:0);if(o.sRGB!=null&&(d+=13),o.pHYs!=null&&(d+=21),e.ctype==3){for(var p=e.plte.length,h=0;h>>24!=255&&(u=!0);d+=8+p*3+4+(u?8+p*1+4:0)}for(var b=0;b>>8&255,k=w>>>16&255;g[f+x+0]=S,g[f+x+1]=D,g[f+x+2]=k}if(f+=p*3,a(g,f,i(g,f-p*3-4,p*3+4)),f+=4,u){a(g,f,p),f+=4,l(g,f,"tRNS"),f+=4;for(var h=0;h>>24&255;f+=p,a(g,f,i(g,f-p-4,p+4)),f+=4}}for(var C=0,b=0;b>2,R>>2));for(var p=0;pW&&L==N[F-W])te[F]=te[F-W];else{var ue=x[L];if(ue==null&&(x[L]=ue=w.length,w.push(L),w.length>=300))break;te[F]=ue}}}var ye=w.length;ye<=256&&f==!1&&(ye<=2?u=1:ye<=4?u=2:ye<=16?u=4:u=8,u=Math.max(u,l));for(var p=0;p>1)]|=qo[Go+we]<<4-(we&1)*4;else if(u==2)for(var we=0;we>2)]|=qo[Go+we]<<6-(we&3)*2;else if(u==1)for(var we=0;we>3)]|=qo[Go+we]<<7-(we&7)*1}Le=tt,c=3,qr=1}else if(g==!1&&m.length==1){for(var tt=new Uint8Array(W*Ce*3),Qu=W*Ce,F=0;Fk&&(k=I),EC&&(C=E))}k==-1&&(S=D=k=C=0),o&&((S&1)==1&&S--,(D&1)==1&&D--);var R=(k-S+1)*(C-D+1);RF&&(F=w),Sg&&(g=S))}F==-1&&(h=b=F=g=0),a&&((h&1)==1&&h--,(b&1)==1&&b--),i={x:h,y:b,width:F-h+1,height:g-b+1};var C=n[o];C.rect=i,C.blend=1,C.img=new Uint8Array(i.width*i.height*4),n[o-1].dispose==0?(B._copyTile(f,t,r,C.img,i.width,i.height,-i.x,-i.y,0),B.encode._prepareDiff(d,t,r,C.img,i)):B._copyTile(d,t,r,C.img,i.width,i.height,-i.x,-i.y,0)};B.encode._prepareDiff=function(e,t,r,n,o){B._copyTile(e,t,r,n,o.width,o.height,-o.x,-o.y,2)};B.encode._filterZero=function(e,t,r,n,o,i,a){var s=[],l=[0,1,2,3,4];i!=-1?l=[i]:(t*n>5e5||r==1)&&(l=[0]);var f;a&&(f={level:0});for(var c=a&&UZIP!=null?UZIP:zc.default,u=0;u>1)+256&255;if(i==4)for(var f=o;f>1)&255;for(var f=o;f>1)&255}if(i==4){for(var f=0;f>>1:r=r>>>1;e[t]=r}return e}(),update:function(e,t,r,n){for(var o=0;o>>8;return e},crc:function(e,t,r){return B.crc.update(4294967295,e,t,r)^4294967295}};B.quantize=function(e,t){for(var r=new Uint8Array(e),n=r.slice(0),o=new Uint32Array(n.buffer),i=B.quantize.getKDtree(n,t),a=i[0],s=i[1],l=B.quantize.planeDst,f=r,c=o,u=f.length,d=new Uint8Array(r.length>>2),p=0;p>2]=m.ind,c[p>>2]=m.est.rgba}return{abuf:n.buffer,inds:d,plte:s}};B.quantize.getKDtree=function(e,t,r){r==null&&(r=1e-4);var n=new Uint32Array(e.buffer),o={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};o.bst=B.quantize.stats(e,o.i0,o.i1),o.est=B.quantize.estats(o.bst);for(var i=[o];i.lengtha&&(a=i[l].est.L,s=l);if(a=c||f.i1<=c;if(u){f.est.L=0;continue}var d={i0:f.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};d.bst=B.quantize.stats(e,d.i0,d.i1),d.est=B.quantize.estats(d.bst);var p={i0:c,i1:f.i1,bst:null,est:null,tdst:0,left:null,right:null};p.bst={R:[],m:[],N:f.bst.N-d.bst.N};for(var l=0;l<16;l++)p.bst.R[l]=f.bst.R[l]-d.bst.R[l];for(var l=0;l<4;l++)p.bst.m[l]=f.bst.m[l]-d.bst.m[l];p.est=B.quantize.estats(p.bst),f.left=d,f.right=p,i[s]=d,i.push(p)}i.sort(function(h,b){return b.bst.N-h.bst.N});for(var l=0;l0&&(a=e.right,s=e.left);var l=B.quantize.getNearest(a,t,r,n,o);if(l.tdst<=i*i)return l;var f=B.quantize.getNearest(s,t,r,n,o);return f.tdsti;)n-=4;if(r>=n)break;var l=t[r>>2];t[r>>2]=t[n>>2],t[n>>2]=l,r+=4,n-=4}for(;a(e,r,o)>i;)r-=4;return r+4};B.quantize.vecDot=function(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]+e[t+3]*r[3]};B.quantize.stats=function(e,t,r){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=[0,0,0,0],i=r-t>>2,a=t;a>>0}};B.M4={multVec:function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]]},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},sml:function(e,t){return[e*t[0],e*t[1],e*t[2],e*t[3]]}};B.encode.concatRGBA=function(e){for(var t=0,r=0;r1)throw new Error("Animated PNGs are not supported");var o=new Uint8Array(n[0]),i=m0(o),a=i.rgbChannel,s=i.alphaChannel;this.rgbChannel=a;var l=s.some(function(f){return f<255});l&&(this.alphaChannel=s),this.type=v0(r.ctype),this.width=r.width,this.height=r.height,this.bitsPerComponent=8}return e.load=function(t){return new e(t)},e}();var g0=function(){function e(t){this.image=t,this.bitsPerComponent=t.bitsPerComponent,this.width=t.width,this.height=t.height,this.colorSpace="DeviceRGB"}return e.for=function(t){return V(this,void 0,void 0,function(){var r;return q(this,function(n){return r=jc.load(t),[2,new e(r)]})})},e.prototype.embedIntoContext=function(t,r){return V(this,void 0,void 0,function(){var n,o;return q(this,function(i){return n=this.embedAlphaChannel(t),o=t.flateStream(this.image.rgbChannel,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),r?(t.assign(r,o),[2,r]):[2,t.register(o)]})})},e.prototype.embedAlphaChannel=function(t){if(this.image.alphaChannel){var r=t.flateStream(this.image.alphaChannel,{Type:"XObject",Subtype:"Image",Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:"DeviceGray",Decode:[0,1]});return t.register(r)}},e}(),co=g0;var y0=function(){function e(t,r,n){this.bytes=t,this.start=r||0,this.pos=this.start,this.end=r&&n?r+n:this.bytes.length}return Object.defineProperty(e.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},e.prototype.getUint16=function(){var t=this.getByte(),r=this.getByte();return t===-1||r===-1?-1:(t<<8)+r},e.prototype.getInt32=function(){var t=this.getByte(),r=this.getByte(),n=this.getByte(),o=this.getByte();return(t<<24)+(r<<16)+(n<<8)+o},e.prototype.getBytes=function(t,r){r===void 0&&(r=!1);var n=this.bytes,o=this.pos,i=this.end;if(t){var s=o+t;s>i&&(s=i),this.pos=s;var a=n.subarray(o,s);return r?new Uint8ClampedArray(a):a}else{var a=n.subarray(o,i);return r?new Uint8ClampedArray(a):a}},e.prototype.peekByte=function(){var t=this.getByte();return this.pos--,t},e.prototype.peekBytes=function(t,r){r===void 0&&(r=!1);var n=this.getBytes(t,r);return this.pos-=n.length,n},e.prototype.skip=function(t){t||(t=1),this.pos+=t},e.prototype.reset=function(){this.pos=this.start},e.prototype.moveStart=function(){this.start=this.pos},e.prototype.makeSubStream=function(t,r){return new e(this.bytes,t,r)},e.prototype.decode=function(){return this.bytes},e}(),Pi=y0;var b0=new Uint8Array(0),x0=function(){function e(t){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=b0,this.minBufferLength=512,t)for(;this.minBufferLengthi&&(n=i)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var a=this.buffer.subarray(o,n);return r&&!(a instanceof Uint8ClampedArray)?new Uint8ClampedArray(a):a},e.prototype.peekByte=function(){var t=this.getByte();return this.pos--,t},e.prototype.peekBytes=function(t,r){r===void 0&&(r=!1);var n=this.getBytes(t,r);return this.pos-=n.length,n},e.prototype.skip=function(t){t||(t=1),this.pos+=t},e.prototype.reset=function(){this.pos=0},e.prototype.makeSubStream=function(t,r){for(var n=t+r;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Pi(this.buffer,t,r)},e.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},e.prototype.readBlock=function(){throw new je(this.constructor.name,"readBlock")},e.prototype.ensureBuffer=function(t){var r=this.buffer;if(t<=r.byteLength)return r;for(var n=this.minBufferLength;n=0;--f)l[s+f]=u&255,u>>=8}},t}(At),Hc=F0;var w0=function(e){T(t,e);function t(r,n){var o=e.call(this,n)||this;return o.stream=r,o.firstDigit=-1,n&&(n=.5*n),o}return t.prototype.readBlock=function(){var r=8e3,n=this.stream.getBytes(r);if(!n.length){this.eof=!0;return}for(var o=n.length+1>>1,i=this.ensureBuffer(this.bufferLength+o),a=this.bufferLength,s=this.firstDigit,l=0,f=n.length;l=48&&c<=57)u=c&15;else if(c>=65&&c<=70||c>=97&&c<=102)u=(c&15)+9;else if(c===62){this.eof=!0;break}else continue;s<0?s=u:(i[a++]=s<<4|u,s=-1)}s>=0&&this.eof&&(i[a++]=s<<4,s=-1),this.firstDigit=s,this.bufferLength=a},t}(At),Uc=w0;var Vc=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),S0=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),P0=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),D0=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],C0=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],k0=function(e){T(t,e);function t(r,n){var o=e.call(this,n)||this;o.stream=r;var i=r.getByte(),a=r.getByte();if(i===-1||a===-1)throw new Error("Invalid header in flate stream: "+i+", "+a);if((i&15)!==8)throw new Error("Unknown compression method in flate stream: "+i+", "+a);if(((i<<8)+a)%31!==0)throw new Error("Bad FCHECK in flate stream: "+i+", "+a);if(a&32)throw new Error("FDICT bit set in flate stream: "+i+", "+a);return o.codeSize=0,o.codeBuf=0,o}return t.prototype.readBlock=function(){var r,n,o=this.stream,i=this.getBits(3);if(i&1&&(this.eof=!0),i>>=1,i===0){var a=void 0;if((a=o.getByte())===-1)throw new Error("Bad block header in flate stream");var s=a;if((a=o.getByte())===-1)throw new Error("Bad block header in flate stream");if(s|=a<<8,(a=o.getByte())===-1)throw new Error("Bad block header in flate stream");var l=a;if((a=o.getByte())===-1)throw new Error("Bad block header in flate stream");if(l|=a<<8,l!==(~s&65535)&&(s!==0||l!==0))throw new Error("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var f=this.bufferLength;r=this.ensureBuffer(f+s);var c=f+s;if(this.bufferLength=c,s===0)o.peekByte()===-1&&(this.eof=!0);else for(var u=f;u0;)S[m++]=C}d=this.generateHuffmanTable(S.subarray(0,h)),p=this.generateHuffmanTable(S.subarray(h,w))}else throw new Error("Unknown block type in flate stream");r=this.buffer;for(var A=r?r.length:0,R=this.bufferLength;;){var z=this.getCode(d);if(z<256){R+1>=A&&(r=this.ensureBuffer(R+1),A=r.length),r[R++]=z;continue}if(z===256){this.bufferLength=R;return}z-=257,z=S0[z];var N=z>>16;N>0&&(N=this.getBits(N)),n=(z&65535)+N,z=this.getCode(p),z=P0[z],N=z>>16,N>0&&(N=this.getBits(N));var W=(z&65535)+N;R+n>=A&&(r=this.ensureBuffer(R+n),A=r.length);for(var te=0;te>r,this.codeSize=o-=r,a},t.prototype.getCode=function(r){for(var n=this.stream,o=r[0],i=r[1],a=this.codeSize,s=this.codeBuf,l;a>16,u=f&65535;if(c<1||a>c,this.codeSize=a-c,u},t.prototype.generateHuffmanTable=function(r){var n=r.length,o=0,i;for(i=0;io&&(o=r[i]);for(var a=1<>=1;for(i=d;i0;if(!S||S<256)F[0]=S,g=1;else if(S>=258)if(S=0;a--)F[a]=u[s],s=p[s];else F[g++]=F[0];else if(S===256){h=9,c=258,g=0;continue}else{this.eof=!0,delete this.lzwState;break}if(D&&(p[c]=b,d[c]=d[b]+1,u[c]=F[0],c++,h=c+f&c+f-1?h:Math.min(Math.log(c+f)/.6931471805599453+1,12)|0),b=S,m+=g,n>>n&(1<0){var a=this.stream.getBytes(i);n.set(a,o),o+=i}}else{i=257-i;var s=r[1];n=this.ensureBuffer(o+i+1);for(var l=0;ln.size())throw new an(r,0,n.size());n.remove(r)}else{if(r!==0)throw new an(r,0,0);this.setKids([])}},t.prototype.normalizedEntries=function(){var r=this.Kids();return r||(r=this.dict.context.obj([this.ref]),this.dict.set(v.of("Kids"),r)),{Kids:r}},t.fromDict=function(r,n){return new t(r,n)},t}(vo),at=H0;var U0=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Opt=function(){return this.dict.lookupMaybe(v.of("Opt"),ne,H,Z)},t.prototype.setOpt=function(r){this.dict.set(v.of("Opt"),this.dict.context.obj(r))},t.prototype.getExportValues=function(){var r=this.Opt();if(r){if(r instanceof ne||r instanceof H)return[r];for(var n=[],o=0,i=r.size();on.size())throw new an(r,0,n.size());n.remove(r)}},t.prototype.normalizeExportValues=function(){for(var r,n,o,i,a=(r=this.getExportValues())!==null&&r!==void 0?r:[],s=[],l=this.getWidgets(),f=0,c=l.length;f1){if(!this.hasFlag(fe.MultiSelect))throw new pc;this.dict.set(v.of("V"),this.dict.context.obj(r))}this.updateSelectedIndices(r)},t.prototype.valuesAreValid=function(r){for(var n=this.getOptions(),o=function(l,f){var c=r[l].decodeText();if(!n.find(function(u){return c===(u.display||u.value).decodeText()}))return{value:!1}},i=0,a=r.length;i1){for(var n=new Array(r.length),o=this.getOptions(),i=function(l,f){var c=r[l].decodeText();n[l]=o.findIndex(function(u){return c===(u.display||u.value).decodeText()})},a=0,s=r.length;a0){var s=a.lookup(0,ne,H),l=a.lookupMaybe(1,ne,H);n.push({value:s,display:l||s})}}return n}return[]},t}(at),go=q0;var W0=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({FT:"Ch",Ff:fe.Combo,Kids:[]}),o=r.register(n);return new t(n,o)},t}(go),rr=W0;var G0=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.addField=function(r){var n=this.normalizedEntries().Kids;n?.push(r)},t.prototype.normalizedEntries=function(){var r=this.Kids();return r||(r=this.dict.context.obj([]),this.dict.set(v.of("Kids"),r)),{Kids:r}},t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({}),o=r.register(n);return new t(n,o)},t}(vo),nr=G0;var K0=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(r,n){return new t(r,n)},t}(at),Mr=K0;var X0=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.MaxLen=function(){var r=this.dict.lookup(v.of("MaxLen"));if(r instanceof j)return r},t.prototype.Q=function(){var r=this.dict.lookup(v.of("Q"));if(r instanceof j)return r},t.prototype.setMaxLength=function(r){this.dict.set(v.of("MaxLen"),j.of(r))},t.prototype.removeMaxLength=function(){this.dict.delete(v.of("MaxLen"))},t.prototype.getMaxLength=function(){var r;return(r=this.MaxLen())===null||r===void 0?void 0:r.asNumber()},t.prototype.setQuadding=function(r){this.dict.set(v.of("Q"),j.of(r))},t.prototype.getQuadding=function(){var r;return(r=this.Q())===null||r===void 0?void 0:r.asNumber()},t.prototype.setValue=function(r){this.dict.set(v.of("V"),r)},t.prototype.removeValue=function(){this.dict.delete(v.of("V"))},t.prototype.getValue=function(){var r=this.V();if(r instanceof ne||r instanceof H)return r},t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({FT:"Tx",Kids:[]}),o=r.register(n);return new t(n,o)},t}(at),or=X0;var Z0=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({FT:"Btn",Ff:qe.PushButton,Kids:[]}),o=r.register(n);return new t(n,o)},t}(Nr),ir=Z0;var Y0=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValue=function(r){var n=this.getOnValues();if(!n.includes(r)&&r!==v.of("Off"))throw new sn;this.dict.set(v.of("V"),r);for(var o=this.getWidgets(),i=0,a=o.length;ii)throw new Na(n,i);for(var a=n,s=0,l=o.size();sa)return c.insertLeafNode(r,a)||f;a-=c.Count().asNumber()}c instanceof Ze&&(a-=1)}if(a===0){this.insertLeafKid(o.size(),r);return}throw new Ma(n,"insertLeafNode")},t.prototype.removeLeafNode=function(r,n){n===void 0&&(n=!0);var o=this.Kids(),i=this.Count().asNumber();if(r>=i)throw new Na(r,i);for(var a=r,s=0,l=o.size();sa){c.removeLeafNode(a,n),n&&c.Kids().size()===0&&o.remove(s);return}else a-=c.Count().asNumber();if(c instanceof Ze)if(a===0){this.removeKid(s);return}else a-=1}throw new Ma(r,"removeLeafNode")},t.prototype.ascend=function(r){r(this);var n=this.Parent();n&&n.ascend(r)},t.prototype.traverse=function(r){for(var n=this.Kids(),o=0,i=n.size();oNumber.MAX_SAFE_INTEGER)if(this.capNumbers){var o="Parsed number that is too large for some PDF readers: "+t+", using Number.MAX_SAFE_INTEGER instead.";return console.warn(o),Number.MAX_SAFE_INTEGER}else{var o="Parsed number that is too large for some PDF readers: "+t+", not capping.";console.warn(o)}return n},e.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&ct[this.bytes.peek()];)this.bytes.next()},e.prototype.skipLine=function(){for(;!this.bytes.done();){var t=this.bytes.peek();if(t===Yc||t===Jc)return;this.bytes.next()}},e.prototype.skipComment=function(){if(this.bytes.peek()!==y.Percent)return!1;for(;!this.bytes.done();){var t=this.bytes.peek();if(t===Yc||t===Jc)return!0;this.bytes.next()}return!0},e.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},e.prototype.matchKeyword=function(t){for(var r=this.bytes.offset(),n=0,o=t.length;n=this.length},e.prototype.offset=function(){return this.idx},e.prototype.slice=function(t,r){return this.bytes.slice(t,r)},e.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},e.of=function(t){return new e(t)},e.fromPDFRawStream=function(t){return e.of(uo(t).decode())},e}(),fr=iv;var av=y.Space,wo=y.CarriageReturn,So=y.Newline,Po=[y.s,y.t,y.r,y.e,y.a,y.m],Ei=[y.e,y.n,y.d,y.s,y.t,y.r,y.e,y.a,y.m],pe={header:[y.Percent,y.P,y.D,y.F,y.Dash],eof:[y.Percent,y.Percent,y.E,y.O,y.F],obj:[y.o,y.b,y.j],endobj:[y.e,y.n,y.d,y.o,y.b,y.j],xref:[y.x,y.r,y.e,y.f],trailer:[y.t,y.r,y.a,y.i,y.l,y.e,y.r],startxref:[y.s,y.t,y.a,y.r,y.t,y.x,y.r,y.e,y.f],true:[y.t,y.r,y.u,y.e],false:[y.f,y.a,y.l,y.s,y.e],null:[y.n,y.u,y.l,y.l],stream:Po,streamEOF1:re(Po,[av,wo,So]),streamEOF2:re(Po,[wo,So]),streamEOF3:re(Po,[wo]),streamEOF4:re(Po,[So]),endstream:Ei,EOF1endstream:re([wo,So],Ei),EOF2endstream:re([wo],Ei),EOF3endstream:re([So],Ei)};var sv=function(e){T(t,e);function t(r,n,o){o===void 0&&(o=!1);var i=e.call(this,r,o)||this;return i.context=n,i}return t.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(pe.true))return Ut.True;if(this.matchKeyword(pe.false))return Ut.False;if(this.matchKeyword(pe.null))return Te;var r=this.bytes.peek();if(r===y.LessThan&&this.bytes.peekAhead(1)===y.LessThan)return this.parseDictOrStream();if(r===y.LessThan)return this.parseHexString();if(r===y.LeftParen)return this.parseString();if(r===y.ForwardSlash)return this.parseName();if(r===y.LeftSquareBracket)return this.parseArray();if(Fo[r])return this.parseNumberOrRef();throw new yc(this.bytes.position(),r)},t.prototype.parseNumberOrRef=function(){var r=this.parseRawNumber();this.skipWhitespaceAndComments();var n=this.bytes.offset();if(Me[this.bytes.peek()]){var o=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===y.R)return this.bytes.assertNext(y.R),J.of(r,o)}return this.bytes.moveTo(n),j.of(r)},t.prototype.parseHexString=function(){var r="";for(this.bytes.assertNext(y.LessThan);!this.bytes.done()&&this.bytes.peek()!==y.GreaterThan;)r+=rt(this.bytes.next());return this.bytes.assertNext(y.GreaterThan),H.of(r)},t.prototype.parseString=function(){for(var r=0,n=!1,o="";!this.bytes.done();){var i=this.bytes.next();if(o+=rt(i),n||(i===y.LeftParen&&(r+=1),i===y.RightParen&&(r-=1)),i===y.BackSlash?n=!n:n&&(n=!1),r===0)return ne.of(o.substring(1,o.length-1))}throw new Fc(this.bytes.position())},t.prototype.parseName=function(){this.bytes.assertNext(y.ForwardSlash);for(var r="";!this.bytes.done();){var n=this.bytes.peek();if(ct[n]||et[n])break;r+=rt(n),this.bytes.next()}return v.of(r)},t.prototype.parseArray=function(){this.bytes.assertNext(y.LeftSquareBracket),this.skipWhitespaceAndComments();for(var r=Z.withContext(this.context);this.bytes.peek()!==y.RightSquareBracket;){var n=this.parseObject();r.push(n),this.skipWhitespaceAndComments()}return this.bytes.assertNext(y.RightSquareBracket),r},t.prototype.parseDict=function(){this.bytes.assertNext(y.LessThan),this.bytes.assertNext(y.LessThan),this.skipWhitespaceAndComments();for(var r=new Map;!this.bytes.done()&&this.bytes.peek()!==y.GreaterThan&&this.bytes.peekAhead(1)!==y.GreaterThan;){var n=this.parseName(),o=this.parseObject();r.set(n,o),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(y.GreaterThan),this.bytes.assertNext(y.GreaterThan);var i=r.get(v.of("Type"));return i===v.of("Catalog")?bo.fromMapWithContext(r,this.context):i===v.of("Pages")?xo.fromMapWithContext(r,this.context):i===v.of("Page")?Ze.fromMapWithContext(r,this.context):U.fromMapWithContext(r,this.context)},t.prototype.parseDictOrStream=function(){var r=this.bytes.position(),n=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(pe.streamEOF1)&&!this.matchKeyword(pe.streamEOF2)&&!this.matchKeyword(pe.streamEOF3)&&!this.matchKeyword(pe.streamEOF4)&&!this.matchKeyword(pe.stream))return n;var o=this.bytes.offset(),i,a=n.get(v.of("Length"));a instanceof j?(i=o+a.asNumber(),this.bytes.moveTo(i),this.skipWhitespaceAndComments(),this.matchKeyword(pe.endstream)||(this.bytes.moveTo(o),i=this.findEndOfStreamFallback(r))):i=this.findEndOfStreamFallback(r);var s=this.bytes.slice(o,i);return Et.of(n,s)},t.prototype.findEndOfStreamFallback=function(r){for(var n=1,o=this.bytes.offset();!this.bytes.done()&&(o=this.bytes.offset(),this.matchKeyword(pe.stream)?n+=1:this.matchKeyword(pe.EOF1endstream)||this.matchKeyword(pe.EOF2endstream)||this.matchKeyword(pe.EOF3endstream)||this.matchKeyword(pe.endstream)?n-=1:this.bytes.next(),n!==0););if(n!==0)throw new xc(r);return o},t.forBytes=function(r,n,o){return new t(fr.of(r),n,o)},t.forByteStream=function(r,n,o){return o===void 0&&(o=!1),new t(r,n,o)},t}(Qc),Do=sv;var fv=function(e){T(t,e);function t(r,n){var o=e.call(this,fr.fromPDFRawStream(r),r.dict.context)||this,i=r.dict;return o.alreadyParsed=!1,o.shouldWaitForTick=n||function(){return!1},o.firstOffset=i.lookup(v.of("First"),j).asNumber(),o.objectCount=i.lookup(v.of("N"),j).asNumber(),o}return t.prototype.parseIntoContext=function(){return V(this,void 0,void 0,function(){var r,n,o,i,a,s,l,f;return q(this,function(c){switch(c.label){case 0:if(this.alreadyParsed)throw new on("PDFObjectStreamParser","parseIntoContext");this.alreadyParsed=!0,r=this.parseOffsetsAndObjectNumbers(),n=0,o=r.length,c.label=1;case 1:return n=y.Space&&n<=y.Tilde;if(o&&(this.matchKeyword(pe.xref)||this.matchKeyword(pe.trailer)||this.matchKeyword(pe.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(r);break}this.bytes.next()}},t.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var r=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(r)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},t.forBytesWithOptions=function(r,n,o,i){return new t(r,n,o,i)},t}(Do),_a=cv;var Rt=function(e){return 1<0&&(n[n.length]=+o),r[r.length]={cmd:t,args:n},n=[],o="",i=!1),t=f;else if([" ",","].includes(f)||f==="-"&&o.length>0&&o[o.length-1]!=="e"||f==="."&&i){if(o.length===0)continue;n.length===a?(r[r.length]={cmd:t,args:n},n=[+o],t==="M"&&(t="L"),t==="m"&&(t="l")):n[n.length]=+o,i=f===".",o=["-","."].includes(f)?f:""}else o+=f,f==="."&&(i=!0)}return o.length>0&&(n.length===a?(r[r.length]={cmd:t,args:n},n=[+o],t==="M"&&(t="L"),t==="m"&&(t="l")):n[n.length]=+o),r[r.length]={cmd:t,args:n},r},pv=function(e){K=X=le=ce=No=Mo=0;for(var t=[],r=0;r1&&(d=Math.sqrt(d),r*=d,n*=d);var p=u/r,h=c/r,b=-c/n,F=u/n,g=p*s+h*l,m=b*s+F*l,x=p*e+h*t,w=b*e+F*t,S=(x-g)*(x-g)+(w-m)*(w-m),D=1/S-.25;D<0&&(D=0);var k=Math.sqrt(D);i===o&&(k=-k);var C=.5*(g+x)-k*(w-m),E=.5*(m+w)+k*(x-g),I=Math.atan2(m-E,g-C),A=Math.atan2(w-E,x-C),R=A-I;R<0&&i===1?R+=2*Math.PI:R>0&&i===0&&(R-=2*Math.PI);for(var z=Math.ceil(Math.abs(R/(Math.PI*.5+.001))),N=[],W=0;We.length)return o-1;var F=t.heightAtSize(o),g=F+F*.2,m=g*i;if(m>Math.abs(r.height))return o-1;o+=1}return o},xv=function(e,t,r,n){for(var o=r.width/n,i=r.height,a=Au,s=Ms(e);ao*.75;if(u)return a-1}var d=t.heightAtSize(a,{descender:!1});if(d>i)return a-1;a+=1}return a},Fv=function(e){for(var t=e.length;t>0;t--)if(/\s/.test(e[t]))return t},wv=function(e,t,r,n){for(var o,i=e.length;i>0;){var a=e.substring(0,i),s=r.encodeText(a),l=r.widthOfTextAtSize(a,n);if(ld&&(d=k+S),h+s>p&&(p=h+s),f.push({text:x,encoded:w,width:S,height:s,x:k,y:h}),g=D?.trim()}return{fontSize:n,lineHeight:l,lines:f,bounds:{x:c,y:u,width:d-c,height:p-u}}},Bu=function(e,t){var r=t.fontSize,n=t.font,o=t.bounds,i=t.cellCount,a=Xi(vr(e));if(a.length>i)throw new ku(a.length,i);(r===void 0||r===0)&&(r=xv(a,n,o,i));for(var s=o.width/i,l=n.heightAtSize(r,{descender:!1}),f=o.y+(o.height/2-l/2),c=[],u=o.x,d=o.y,p=o.x+o.width,h=o.y+o.height,b=0,F=0;bp&&(p=k+S),f+l>h&&(h=f+l),c.push({text:a,encoded:w,width:S,height:l,x:k,y:f}),b+=1,F+=x}return{fontSize:r,cells:c,bounds:{x:u,y:d,width:p-u,height:h-d}}},jo=function(e,t){var r=t.alignment,n=t.fontSize,o=t.font,i=t.bounds,a=Xi(vr(e));(n===void 0||n===0)&&(n=Ou([a],o,i));var s=o.encodeText(a),l=o.widthOfTextAtSize(a,n),f=o.heightAtSize(n,{descender:!1}),c=r===De.Left?i.x:r===De.Center?i.x+i.width/2-l/2:r===De.Right?i.x+i.width-l:i.x,u=i.y+(i.height/2-f/2);return{fontSize:n,line:{text:a,encoded:s,width:l,height:f,x:c,y:u},bounds:{x:c,y:u,width:l,height:f}}};var vt=function(e){return"normal"in e?e:{normal:e}},Sv=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,dr=function(e){var t,r,n=(t=e.getDefaultAppearance())!==null&&t!==void 0?t:"",o=(r=On(n,Sv).match)!==null&&r!==void 0?r:[],i=Number(o[2]);return isFinite(i)?i:void 0},Pv=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,ht=function(e){var t,r=(t=e.getDefaultAppearance())!==null&&t!==void 0?t:"",n=On(r,Pv).match,o=n??[],i=o[1],a=o[2],s=o[3],l=o[4],f=o[5];if(f==="g"&&i)return fs(Number(i));if(f==="rg"&&i&&a&&s)return ae(Number(i),Number(a),Number(s));if(f==="k"&&i&&a&&s&&l)return ls(Number(i),Number(a),Number(s),Number(l))},pt=function(e,t,r,n){var o;n===void 0&&(n=0);var i=[Bt(t).toString(),Oo((o=r?.name)!==null&&o!==void 0?o:"dummy__noop",n).toString()].join(` -`);e.setDefaultAppearance(i)},Nu=function(e,t){var r,n,o,i=ht(t),a=ht(e.acroField),s=t.getRectangle(),l=t.getAppearanceCharacteristics(),f=t.getBorderStyle(),c=(r=f?.getWidth())!==null&&r!==void 0?r:0,u=xt(l?.getRotation()),d=qt(s,u),p=d.width,h=d.height,b=Ft(Y(Y({},s),{rotation:u})),F=ae(0,0,0),g=(n=We(l?.getBorderColor()))!==null&&n!==void 0?n:F,m=We(l?.getBackgroundColor()),x=We(l?.getBackgroundColor(),.8),w=(o=i??a)!==null&&o!==void 0?o:F;pt(i?t:e.acroField,w);var S={x:0+c/2,y:0+c/2,width:p-c,height:h-c,thickness:1.5,borderWidth:c,borderColor:g,markColor:w};return{normal:{on:re(b,Io(Y(Y({},S),{color:m,filled:!0}))),off:re(b,Io(Y(Y({},S),{color:m,filled:!1})))},down:{on:re(b,Io(Y(Y({},S),{color:x,filled:!0}))),off:re(b,Io(Y(Y({},S),{color:x,filled:!1})))}}},Mu=function(e,t){var r,n,o,i=ht(t),a=ht(e.acroField),s=t.getRectangle(),l=t.getAppearanceCharacteristics(),f=t.getBorderStyle(),c=(r=f?.getWidth())!==null&&r!==void 0?r:0,u=xt(l?.getRotation()),d=qt(s,u),p=d.width,h=d.height,b=Ft(Y(Y({},s),{rotation:u})),F=ae(0,0,0),g=(n=We(l?.getBorderColor()))!==null&&n!==void 0?n:F,m=We(l?.getBackgroundColor()),x=We(l?.getBackgroundColor(),.8),w=(o=i??a)!==null&&o!==void 0?o:F;pt(i?t:e.acroField,w);var S={x:p/2,y:h/2,width:p-c,height:h-c,borderWidth:c,borderColor:g,dotColor:w};return{normal:{on:re(b,zo(Y(Y({},S),{color:m,filled:!0}))),off:re(b,zo(Y(Y({},S),{color:m,filled:!1})))},down:{on:re(b,zo(Y(Y({},S),{color:x,filled:!0}))),off:re(b,zo(Y(Y({},S),{color:x,filled:!1})))}}},Iu=function(e,t,r){var n,o,i,a,s,l=ht(t),f=ht(e.acroField),c=dr(t),u=dr(e.acroField),d=t.getRectangle(),p=t.getAppearanceCharacteristics(),h=t.getBorderStyle(),b=p?.getCaptions(),F=(n=b?.normal)!==null&&n!==void 0?n:"",g=(i=(o=b?.down)!==null&&o!==void 0?o:F)!==null&&i!==void 0?i:"",m=(a=h?.getWidth())!==null&&a!==void 0?a:0,x=xt(p?.getRotation()),w=qt(d,x),S=w.width,D=w.height,k=Ft(Y(Y({},d),{rotation:x})),C=ae(0,0,0),E=We(p?.getBorderColor()),I=We(p?.getBackgroundColor()),A=We(p?.getBackgroundColor(),.8),R={x:m,y:m,width:S-m*2,height:D-m*2},z=jo(F,{alignment:De.Center,fontSize:c??u,font:r,bounds:R}),N=jo(g,{alignment:De.Center,fontSize:c??u,font:r,bounds:R}),W=Math.min(z.fontSize,N.fontSize),te=(s=l??f)!==null&&s!==void 0?s:C;pt(l||c!==void 0?t:e.acroField,te,r,W);var L={x:0+m/2,y:0+m/2,width:S-m,height:D-m,borderWidth:m,borderColor:E,textColor:te,font:r.name,fontSize:W};return{normal:re(k,ps(Y(Y({},L),{color:I,textLines:[z.line]}))),down:re(k,ps(Y(Y({},L),{color:A,textLines:[N.line]})))}},zu=function(e,t,r){var n,o,i,a,s=ht(t),l=ht(e.acroField),f=dr(t),c=dr(e.acroField),u=t.getRectangle(),d=t.getAppearanceCharacteristics(),p=t.getBorderStyle(),h=(n=e.getText())!==null&&n!==void 0?n:"",b=(o=p?.getWidth())!==null&&o!==void 0?o:0,F=xt(d?.getRotation()),g=qt(u,F),m=g.width,x=g.height,w=Ft(Y(Y({},u),{rotation:F})),S=ae(0,0,0),D=We(d?.getBorderColor()),k=We(d?.getBackgroundColor()),C,E,I=e.isCombed()?0:1,A={x:b+I,y:b+I,width:m-(b+I)*2,height:x-(b+I)*2};if(e.isMultiline()){var R=ys(h,{alignment:e.getAlignment(),fontSize:f??c,font:r,bounds:A});C=R.lines,E=R.fontSize}else if(e.isCombed()){var R=Bu(h,{fontSize:f??c,font:r,bounds:A,cellCount:(i=e.getMaxLength())!==null&&i!==void 0?i:0});C=R.cells,E=R.fontSize}else{var R=jo(h,{alignment:e.getAlignment(),fontSize:f??c,font:r,bounds:A});C=[R.line],E=R.fontSize}var z=(a=s??l)!==null&&a!==void 0?a:S;pt(s||f!==void 0?t:e.acroField,z,r,E);var N={x:0+b/2,y:0+b/2,width:m-b,height:x-b,borderWidth:b??0,borderColor:D,textColor:z,font:r.name,fontSize:E,color:k,textLines:C,padding:I};return re(w,ms(N))},ju=function(e,t,r){var n,o,i,a=ht(t),s=ht(e.acroField),l=dr(t),f=dr(e.acroField),c=t.getRectangle(),u=t.getAppearanceCharacteristics(),d=t.getBorderStyle(),p=(n=e.getSelected()[0])!==null&&n!==void 0?n:"",h=(o=d?.getWidth())!==null&&o!==void 0?o:0,b=xt(u?.getRotation()),F=qt(c,b),g=F.width,m=F.height,x=Ft(Y(Y({},c),{rotation:b})),w=ae(0,0,0),S=We(u?.getBorderColor()),D=We(u?.getBackgroundColor()),k=1,C={x:h+k,y:h+k,width:g-(h+k)*2,height:m-(h+k)*2},E=jo(p,{alignment:De.Left,fontSize:l??f,font:r,bounds:C}),I=E.line,A=E.fontSize,R=(i=a??s)!==null&&i!==void 0?i:w;pt(a||l!==void 0?t:e.acroField,R,r,A);var z={x:0+h/2,y:0+h/2,width:g-h,height:m-h,borderWidth:h??0,borderColor:S,textColor:R,font:r.name,fontSize:A,color:D,textLines:[I],padding:k};return re(x,ms(z))},Lu=function(e,t,r){var n,o,i=ht(t),a=ht(e.acroField),s=dr(t),l=dr(e.acroField),f=t.getRectangle(),c=t.getAppearanceCharacteristics(),u=t.getBorderStyle(),d=(n=u?.getWidth())!==null&&n!==void 0?n:0,p=xt(c?.getRotation()),h=qt(f,p),b=h.width,F=h.height,g=Ft(Y(Y({},f),{rotation:p})),m=ae(0,0,0),x=We(c?.getBorderColor()),w=We(c?.getBackgroundColor()),S=e.getOptions(),D=e.getSelected();e.isSorted()&&S.sort();for(var k="",C=0,E=S.length;C1||o.length===1&&n)&&this.enableMultiselect();for(var s=new Array(o.length),l=0,f=o.length;l1||o.length===1&&n)&&this.enableMultiselect();for(var a=new Array(o.length),s=0,l=o.length;sn)throw new Tu(r.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),r?this.acroField.setValue(H.fromText(r)):this.acroField.removeValue()},t.prototype.getAlignment=function(){var r=this.acroField.getQuadding();return r===0?De.Left:r===1?De.Center:r===2?De.Right:De.Left},t.prototype.setAlignment=function(r){bt(r,"alignment",De),this.markAsDirty(),this.acroField.setQuadding(r)},t.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},t.prototype.setMaxLength=function(r){if(it(r,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),r===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>r)throw new Eu(n.length,r,this.getName());this.acroField.setMaxLength(r)}},t.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},t.prototype.setImage=function(r){for(var n=this.getAlignment(),o=n===De.Center?wt.Center:n===De.Right?wt.Right:wt.Left,i=this.acroField.getWidgets(),a=0,s=i.length;ae/25.4*96;function qv(e){return e.pageSize==="Custom"?{w:Math.max(1,Math.round(En(e.customPageWidth))),h:Math.max(1,Math.round(En(e.customPageHeight)))}:qi[e.pageSize]??qi.A4}function Vi(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function Wu(e){return e.replace(/<\/style/gi,"<\\/style")}function Tn(e,t){let r=t.trim();if(!r)return"";if(/^(https?:|data:)/i.test(r))return r;let n=e.vault.getAbstractFileByPath(r);if(n instanceof M.TFile)return e.vault.getResourcePath(n);let o=e.metadataCache.getFirstLinkpathDest(r,"");return o instanceof M.TFile?e.vault.getResourcePath(o):r}var Wv=/[\u0590-\u08FF\uFB1D-\uFDFD\uFE70-\uFEFC]/g,Gv=/[A-Za-z\u0590-\u08FF\uFB1D-\uFDFD\uFE70-\uFEFC]/g;function Kv(e){let t=(e.match(Wv)??[]).length,r=(e.match(Gv)??[]).length;return r>0&&t/r>.1}function Xv(e){return e.replace(/\r\n/g,` -`)}function Zv(e){return e.replace(/^---[ \t]*\n[\s\S]*?\n---[ \t]*(\n|$)/,"")}function Yv(e){return e.split(/^\/\/\/\s*$/m).map(t=>t.trim()).filter(Boolean)}async function Jv(e,t,r,n){let o=activeDocument.createElement("div");o.setCssStyles({position:"fixed",top:"0",left:"-99999px",visibility:"hidden",pointerEvents:"none"}),activeDocument.body.appendChild(o);try{await M.MarkdownRenderer.render(e,t,o,r,n),await _v(o);let i=activeDocument.fonts;if(i?.ready)try{await i.ready}catch{}}finally{activeDocument.body.removeChild(o)}return Qv(o),o}function Gu(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-")}function Qv(e){let t=new Map;e.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(r=>{let n=r.textContent||"",o=Gu(n);if(!o)return;let i=t.get(o)??0;t.set(o,i+1),r.id=i===0?o:`${o}-${i}`}),e.querySelectorAll("a").forEach(r=>{r.classList.remove("external-link");let n=r.getAttribute("data-href")??r.getAttribute("href");n?.startsWith("#")&&r.setAttribute("href","#"+Gu(n.slice(1)))}),e.querySelectorAll(".copy-code-button").forEach(r=>r.remove()),e.querySelectorAll(".callout").forEach(r=>{r.removeAttribute("data-callout-fold"),r.classList.remove("is-collapsed"),r.querySelectorAll(".callout-fold").forEach(n=>n.remove())}),e.querySelectorAll("style, script").forEach(r=>{r.closest("svg")||r.remove()})}async function _v(e){let t=Array.from(e.querySelectorAll(".mermaid"));if(t.length===0)return;let r=5e3;await Promise.all(t.map(n=>new Promise(o=>{if(n.querySelector("svg")){o();return}let i=window.setTimeout(()=>{a.disconnect(),o()},r),a=new MutationObserver(()=>{n.querySelector("svg")&&(window.clearTimeout(i),a.disconnect(),o())});a.observe(n,{childList:!0,subtree:!0})})))}var $v={comment:["comment","prolog","doctype","cdata"],punctuation:["punctuation"],property:["property","tag","boolean","number","constant","symbol","deleted","attr-name"],selector:["selector","string","char","builtin","inserted","attr-value"],operator:["operator","entity","url"],keyword:["atrule","keyword","important"],function:["function","class-name"],regex:["regex","variable"]},Ss={none:{name:"None (plain)"},"github-light":{name:"GitHub Light",background:"#f6f8fa",text:"#24292e",tokens:{comment:"#6a737d",punctuation:"#24292e",property:"#005cc5",selector:"#032f62",operator:"#d73a49",keyword:"#d73a49",function:"#6f42c1",regex:"#032f62"}},"github-dark":{name:"GitHub Dark",background:"#0d1117",text:"#c9d1d9",tokens:{comment:"#8b949e",punctuation:"#c9d1d9",property:"#79c0ff",selector:"#a5d6ff",operator:"#ff7b72",keyword:"#ff7b72",function:"#d2a8ff",regex:"#a5d6ff"}},"atom-one-light":{name:"Atom One Light",background:"#fafafa",text:"#383a42",tokens:{comment:"#a0a1a7",punctuation:"#383a42",property:"#986801",selector:"#50a14f",operator:"#0184bc",keyword:"#a626a4",function:"#4078f2",regex:"#50a14f"}},"atom-one-dark":{name:"Atom One Dark",background:"#282c34",text:"#abb2bf",tokens:{comment:"#5c6370",punctuation:"#abb2bf",property:"#d19a66",selector:"#98c379",operator:"#56b6c2",keyword:"#c678dd",function:"#61afef",regex:"#98c379"}},monokai:{name:"Monokai",background:"#272822",text:"#f8f8f2",tokens:{comment:"#75715e",punctuation:"#f8f8f2",property:"#ae81ff",selector:"#e6db74",operator:"#f92672",keyword:"#f92672",function:"#a6e22e",regex:"#e6db74"}},dracula:{name:"Dracula",background:"#282a36",text:"#f8f8f2",tokens:{comment:"#6272a4",punctuation:"#f8f8f2",property:"#bd93f9",selector:"#f1fa8c",operator:"#ff79c6",keyword:"#ff79c6",function:"#50fa7b",regex:"#ff79c6"}},"tokyo-night":{name:"Tokyo Night",background:"#1a1b26",text:"#a9b1d6",tokens:{comment:"#565f89",punctuation:"#89ddff",property:"#ff9e64",selector:"#9ece6a",operator:"#89ddff",keyword:"#bb9af7",function:"#7aa2f7",regex:"#b4f9f8"}},"solarized-light":{name:"Solarized Light",background:"#fdf6e3",text:"#586e75",tokens:{comment:"#93a1a1",punctuation:"#586e75",property:"#cb4b16",selector:"#2aa198",operator:"#859900",keyword:"#859900",function:"#268bd2",regex:"#2aa198"}},"catppuccin-macchiato":{name:"Catppuccin Macchiato",background:"#24273a",text:"#cad3f5",tokens:{comment:"#939ab7",punctuation:"#b8c0e0",property:"#f5a97f",selector:"#a6da95",operator:"#91d7e3",keyword:"#c6a0f6",function:"#8aadf4",regex:"#f5bde6"}},"catppuccin-mocha":{name:"Catppuccin Mocha",background:"#1e1e2e",text:"#cdd6f4",tokens:{comment:"#9399b2",punctuation:"#bac2de",property:"#fab387",selector:"#a6e3a1",operator:"#89dceb",keyword:"#cba6f7",function:"#89b4fa",regex:"#f5c2e7"}}};function em(e){let t=Ss[e.codeTheme]??Ss.none,r=t.background??e.codeBackground,n=t.text??e.bodyColor,o=Object.entries(t.tokens??{}).map(([i,a])=>`${$v[i].map(f=>`.mpdf-doc pre code .token.${f}`).join(", ")} { color: ${a};${i==="comment"?" font-style: italic;":""} }`).join(` +end`},Oc=function(){for(var t=[],e=0;e"},wi=function(t){return Mt(t,4)},f0=function(t){if(Xs(t))return wi(t);if(Zs(t)){var e=Yi(t),r=Ji(t);return""+wi(e)+wi(r)}var n=Wt(t),o="0x"+n+" is not a valid UTF-8 or UTF-16 codepoint.";throw new Error(o)};var l0=function(t){var e=0,r=function(n){e|=1<=g.Zero&&f<=g.Seven?(n+=l,(n.length===3||!(c>="0"&&c<="7"))&&(i(parseInt(n,8)),n="")):i(f):f===g.BackSlash?o=!0:i(f)}return new Uint8Array(r)},e.prototype.decodeText=function(){var r=this.asBytes();return _o(r)?Qo(r):yi(r)},e.prototype.decodeDate=function(){var r=this.decodeText(),n=Zo(r);if(!n)throw new bi(r);return n},e.prototype.asString=function(){return this.value},e.prototype.clone=function(){return e.of(this.value)},e.prototype.toString=function(){return"("+this.value+")"},e.prototype.sizeInBytes=function(){return this.value.length+2},e.prototype.copyBytesInto=function(r,n){return r[n++]=g.LeftParen,n+=me(this.value,r,n),r[n++]=g.RightParen,this.value.length+2},e.of=function(r){return new e(r)},e.fromDate=function(r){var n=rt(String(r.getUTCFullYear()),4,"0"),o=rt(String(r.getUTCMonth()+1),2,"0"),i=rt(String(r.getUTCDate()),2,"0"),a=rt(String(r.getUTCHours()),2,"0"),s=rt(String(r.getUTCMinutes()),2,"0"),l=rt(String(r.getUTCSeconds()),2,"0");return new e("D:"+n+o+i+a+s+l+"Z")},e}(ve),ne=c0;var u0=function(){function t(e,r,n,o){var i=this;this.allGlyphsInFontSortedById=function(){for(var a=new Array(i.font.characterSet.length),s=0,l=a.length;s>3)]>>7-((h&7)<<0)&1,R=3*A;s[w]=S[R],s[w+1]=S[R+1],s[w+2]=S[R+2],s[w+3]=A>2)]>>6-((h&3)<<1)&3,R=3*A;s[w]=S[R],s[w+1]=S[R+1],s[w+2]=S[R+2],s[w+3]=A>1)]>>4-((h&1)<<2)&15,R=3*A;s[w]=S[R],s[w+1]=S[R+1],s[w+2]=S[R+2],s[w+3]=A>>3)]>>>7-(L&7)&1),ue=M==x*255?0:255;l[te+L]=ue<<24|M<<16|M<<8|M}else if(c==2)for(var L=0;L>>2)]>>>6-((L&3)<<1)&3),ue=M==x*85?0:255;l[te+L]=ue<<24|M<<16|M<<8|M}else if(c==4)for(var L=0;L>>1)]>>>4-((L&1)<<2)&15),ue=M==x*17?0:255;l[te+L]=ue<<24|M<<16|M<<8|M}else if(c==8)for(var L=0;L>>2<<3));o==0;){if(o=F(e,d,1),i=F(e,d+1,2),d+=3,i==0){(d&7)!=0&&(d+=8-(d&7));var C=(d>>>3)+4,E=e[C-4]|e[C-3]<<8;T&&(r=t.H.W(r,u+E)),r.set(new n(e.buffer,e.byteOffset+C,E),u),d=C+E<<3,u+=E;continue}if(T&&(r=t.H.W(r,u+(1<<17))),i==1&&(p=D.J,h=D.h,f=511,c=31),i==2){a=x(e,d,5)+257,s=x(e,d+5,5)+1,l=x(e,d+10,4)+4,d+=14;for(var I=d,A=1,R=0;R<38;R+=2)D.Q[R]=0,D.Q[R+1]=0;for(var R=0;RA&&(A=z)}d+=3*l,y(D.Q,A),w(D.Q,A,D.u),p=D.w,h=D.d,d=m(D.u,(1<>>4;if(!(L>>>8))r[u++]=L;else{if(L==256)break;var ue=u+L-254;if(L>264){var ye=D.q[L-257];ue=u+(ye>>>3)+x(e,d,ye&7),d+=ye&7}var oe=h[S(e,d)&c];d+=oe&15;var Fe=oe>>>4,Ce=D.c[Fe],Be=(Ce>>>4)+F(e,d,Ce&15);for(d+=Ce&15;u>>4;if(u<=15)a[f]=u,f++;else{var d=0,p=0;u==16?(p=3+s(o,i,2),i+=2,d=a[f-1]):u==17?(p=3+s(o,i,3),i+=3):u==18&&(p=11+s(o,i,7),i+=7);for(var h=f+p;f>>1;ai&&(i=l),a++}for(;a>1,f=e[s+1],c=l<<4|f,u=r-f,d=e[s]<>>15-r;n[h]=c,d++}},t.H.l=function(e,r){for(var n=t.H.m.r,o=15-r,i=0;i>>o}},t.H.M=function(e,r,n){n=n<<(r&7);var o=r>>>3;e[o]|=n,e[o+1]|=n>>>8},t.H.I=function(e,r,n){n=n<<(r&7);var o=r>>>3;e[o]|=n,e[o+1]|=n>>>8,e[o+2]|=n>>>16},t.H.e=function(e,r,n){return(e[r>>>3]|e[(r>>>3)+1]<<8)>>>(r&7)&(1<>>3]|e[(r>>>3)+1]<<8|e[(r>>>3)+2]<<16)>>>(r&7)&(1<>>3]|e[(r>>>3)+1]<<8|e[(r>>>3)+2]<<16)>>>(r&7)},t.H.i=function(e,r){return(e[r>>>3]|e[(r>>>3)+1]<<8|e[(r>>>3)+2]<<16|e[(r>>>3)+3]<<24)>>>(r&7)},t.H.m=function(){var e=Uint16Array,r=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new r(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new r(286),Y:new r(30),a:new r(19),t:new r(15e3),k:new e(65536),g:new e(32768)}}(),function(){for(var e=t.H.m,r=32768,n=0;n>>1|(o&1431655765)<<1,o=(o&3435973836)>>>2|(o&858993459)<<2,o=(o&4042322160)>>>4|(o&252645135)<<4,o=(o&4278255360)>>>8|(o&16711935)<<8,e.r[n]=(o>>>16|o<<16)>>>17}function i(a,s,l){for(;s--!=0;)a.push(0,l)}for(var n=0;n<32;n++)e.q[n]=e.S[n]<<3|e.T[n],e.c[n]=e.p[n]<<4|e.z[n];i(e._,144,8),i(e._,112,9),i(e._,24,7),i(e._,8,8),t.H.n(e._,9),t.H.A(e._,9,e.J),t.H.l(e._,9),i(e.$,32,5),t.H.n(e.$,5),t.H.A(e.$,5,e.h),t.H.l(e.$,5),i(e.Q,19,0),i(e.C,286,0),i(e.D,30,0),i(e.v,320,0)}(),t.H.N}();B.decode._readInterlace=function(t,e){for(var r=e.width,n=e.height,o=B.decode._getBPP(e),i=o>>3,a=Math.ceil(r*o/8),s=new Uint8Array(n*a),l=0,f=[0,0,4,0,2,0,1],c=[0,4,0,2,0,1,0],u=[8,8,8,4,4,2,2],d=[8,8,4,4,2,2,1],p=0;p<7;){for(var h=u[p],b=d[p],F=0,x=0,m=f[p];m>3];E=E>>7-(C&7)&1,s[D*a+(T>>3)]|=E<<7-((T&7)<<0)}if(o==2){var E=t[C>>3];E=E>>6-(C&7)&3,s[D*a+(T>>2)]|=E<<6-((T&3)<<1)}if(o==4){var E=t[C>>3];E=E>>4-(C&7)&15,s[D*a+(T>>1)]|=E<<4-((T&1)<<2)}if(o>=8)for(var I=D*a+T*i,A=0;A>3)+A];C+=o,T+=b}S++,D+=h}F*x!=0&&(l+=x*(1+w)),p=p+1}return s};B.decode._getBPP=function(t){var e=[1,null,3,1,2,null,4][t.ctype];return e*t.depth};B.decode._filterZero=function(t,e,r,n,o){var i=B.decode._getBPP(e),a=Math.ceil(n*i/8),s=B.decode._paeth;i=Math.ceil(i/8);var l=0,f=1,c=t[r],u=0;if(c>1&&(t[r]=[0,0,1][c-2]),c==3)for(u=i;u>>1)&255;for(var d=0;d>>1);for(;u>>1)}else{for(;u>8&255,t[e+1]=r&255},readUint:function(t,e){return t[e]*(256*256*256)+(t[e+1]<<16|t[e+2]<<8|t[e+3])},writeUint:function(t,e,r){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=r&255},readASCII:function(t,e,r){for(var n="",o=0;o=0&&s>=0?(u=p*e+h<<2,d=(s+p)*o+a+h<<2):(u=(-s+p)*e-a+h<<2,d=p*o+h<<2),l==0)n[d]=t[u],n[d+1]=t[u+1],n[d+2]=t[u+2],n[d+3]=t[u+3];else if(l==1){var b=t[u+3]*.00392156862745098,F=t[u]*b,x=t[u+1]*b,m=t[u+2]*b,y=n[d+3]*(1/255),w=n[d]*y,S=n[d+1]*y,D=n[d+2]*y,T=1-b,C=b+y*T,E=C==0?0:1/C;n[d+3]=255*C,n[d+0]=(F+w*T)*E,n[d+1]=(x+S*T)*E,n[d+2]=(m+D*T)*E}else if(l==2){var b=t[u+3],F=t[u],x=t[u+1],m=t[u+2],y=n[d+3],w=n[d],S=n[d+1],D=n[d+2];b==y&&F==w&&x==S&&m==D?(n[d]=0,n[d+1]=0,n[d+2]=0,n[d+3]=0):(n[d]=F,n[d+1]=x,n[d+2]=m,n[d+3]=b)}else if(l==3){var b=t[u+3],F=t[u],x=t[u+1],m=t[u+2],y=n[d+3],w=n[d],S=n[d+1],D=n[d+2];if(b==y&&F==w&&x==S&&m==D)continue;if(b<220&&y>20)return!1}return!0};B.encode=function(t,e,r,n,o,i,a){n==null&&(n=0),a==null&&(a=!1);var s=B.encode.compress(t,e,r,n,[!1,!1,!1,0,a]);return B.encode.compressPNG(s,-1),B.encode._main(s,e,r,o,i)};B.encodeLL=function(t,e,r,n,o,i,a,s){for(var l={ctype:0+(n==1?0:2)+(o==0?0:4),depth:i,frames:[]},f=Date.now(),c=(n+o)*i,u=c*e,d=0;d1,u=!1,d=33+(c?20:0);if(o.sRGB!=null&&(d+=13),o.pHYs!=null&&(d+=21),t.ctype==3){for(var p=t.plte.length,h=0;h>>24!=255&&(u=!0);d+=8+p*3+4+(u?8+p*1+4:0)}for(var b=0;b>>8&255,T=w>>>16&255;x[f+y+0]=S,x[f+y+1]=D,x[f+y+2]=T}if(f+=p*3,a(x,f,i(x,f-p*3-4,p*3+4)),f+=4,u){a(x,f,p),f+=4,l(x,f,"tRNS"),f+=4;for(var h=0;h>>24&255;f+=p,a(x,f,i(x,f-p-4,p+4)),f+=4}}for(var C=0,b=0;b>2,R>>2));for(var p=0;pX&&L==M[F-X])te[F]=te[F-X];else{var ue=y[L];if(ue==null&&(y[L]=ue=w.length,w.push(L),w.length>=300))break;te[F]=ue}}}var ye=w.length;ye<=256&&f==!1&&(ye<=2?u=1:ye<=4?u=2:ye<=16?u=4:u=8,u=Math.max(u,l));for(var p=0;p>1)]|=Vo[Wo+we]<<4-(we&1)*4;else if(u==2)for(var we=0;we>2)]|=Vo[Wo+we]<<6-(we&3)*2;else if(u==1)for(var we=0;we>3)]|=Vo[Wo+we]<<7-(we&7)*1}Be=wt,c=3,Wi=1}else if(x==!1&&m.length==1){for(var wt=new Uint8Array(X*Ce*3),_u=X*Ce,F=0;F<_u;F++){var A=F*3,Gi=F*4;wt[A]=Be[Gi],wt[A+1]=Be[Gi+1],wt[A+2]=Be[Gi+2]}Be=wt,c=2,Wi=3,En=3*X}z.img=Be,z.bpl=En,z.bpp=Wi}return{ctype:c,depth:u,plte:w,frames:m}};B.encode.framize=function(t,e,r,n,o,i){for(var a=[],s=0;sT&&(T=I),EC&&(C=E))}T==-1&&(S=D=T=C=0),o&&((S&1)==1&&S--,(D&1)==1&&D--);var R=(T-S+1)*(C-D+1);RF&&(F=w),Sx&&(x=S))}F==-1&&(h=b=F=x=0),a&&((h&1)==1&&h--,(b&1)==1&&b--),i={x:h,y:b,width:F-h+1,height:x-b+1};var C=n[o];C.rect=i,C.blend=1,C.img=new Uint8Array(i.width*i.height*4),n[o-1].dispose==0?(B._copyTile(f,e,r,C.img,i.width,i.height,-i.x,-i.y,0),B.encode._prepareDiff(d,e,r,C.img,i)):B._copyTile(d,e,r,C.img,i.width,i.height,-i.x,-i.y,0)};B.encode._prepareDiff=function(t,e,r,n,o){B._copyTile(t,e,r,n,o.width,o.height,-o.x,-o.y,2)};B.encode._filterZero=function(t,e,r,n,o,i,a){var s=[],l=[0,1,2,3,4];i!=-1?l=[i]:(e*n>5e5||r==1)&&(l=[0]);var f;a&&(f={level:0});for(var c=a&&UZIP!=null?UZIP:Ic.default,u=0;u>1)+256&255;if(i==4)for(var f=o;f>1)&255;for(var f=o;f>1)&255}if(i==4){for(var f=0;f>>1:r=r>>>1;t[e]=r}return t}(),update:function(t,e,r,n){for(var o=0;o>>8;return t},crc:function(t,e,r){return B.crc.update(4294967295,t,e,r)^4294967295}};B.quantize=function(t,e){for(var r=new Uint8Array(t),n=r.slice(0),o=new Uint32Array(n.buffer),i=B.quantize.getKDtree(n,e),a=i[0],s=i[1],l=B.quantize.planeDst,f=r,c=o,u=f.length,d=new Uint8Array(r.length>>2),p=0;p>2]=m.ind,c[p>>2]=m.est.rgba}return{abuf:n.buffer,inds:d,plte:s}};B.quantize.getKDtree=function(t,e,r){r==null&&(r=1e-4);var n=new Uint32Array(t.buffer),o={i0:0,i1:t.length,bst:null,est:null,tdst:0,left:null,right:null};o.bst=B.quantize.stats(t,o.i0,o.i1),o.est=B.quantize.estats(o.bst);for(var i=[o];i.lengtha&&(a=i[l].est.L,s=l);if(a=c||f.i1<=c;if(u){f.est.L=0;continue}var d={i0:f.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};d.bst=B.quantize.stats(t,d.i0,d.i1),d.est=B.quantize.estats(d.bst);var p={i0:c,i1:f.i1,bst:null,est:null,tdst:0,left:null,right:null};p.bst={R:[],m:[],N:f.bst.N-d.bst.N};for(var l=0;l<16;l++)p.bst.R[l]=f.bst.R[l]-d.bst.R[l];for(var l=0;l<4;l++)p.bst.m[l]=f.bst.m[l]-d.bst.m[l];p.est=B.quantize.estats(p.bst),f.left=d,f.right=p,i[s]=d,i.push(p)}i.sort(function(h,b){return b.bst.N-h.bst.N});for(var l=0;l0&&(a=t.right,s=t.left);var l=B.quantize.getNearest(a,e,r,n,o);if(l.tdst<=i*i)return l;var f=B.quantize.getNearest(s,e,r,n,o);return f.tdsti;)n-=4;if(r>=n)break;var l=e[r>>2];e[r>>2]=e[n>>2],e[n>>2]=l,r+=4,n-=4}for(;a(t,r,o)>i;)r-=4;return r+4};B.quantize.vecDot=function(t,e,r){return t[e]*r[0]+t[e+1]*r[1]+t[e+2]*r[2]+t[e+3]*r[3]};B.quantize.stats=function(t,e,r){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=[0,0,0,0],i=r-e>>2,a=e;a>>0}};B.M4={multVec:function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3],t[4]*e[0]+t[5]*e[1]+t[6]*e[2]+t[7]*e[3],t[8]*e[0]+t[9]*e[1]+t[10]*e[2]+t[11]*e[3],t[12]*e[0]+t[13]*e[1]+t[14]*e[2]+t[15]*e[3]]},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},sml:function(t,e){return[t*e[0],t*e[1],t*e[2],t*e[3]]}};B.encode.concatRGBA=function(t){for(var e=0,r=0;r1)throw new Error("Animated PNGs are not supported");var o=new Uint8Array(n[0]),i=g0(o),a=i.rgbChannel,s=i.alphaChannel;this.rgbChannel=a;var l=s.some(function(f){return f<255});l&&(this.alphaChannel=s),this.type=m0(r.ctype),this.width=r.width,this.height=r.height,this.bitsPerComponent=8}return t.load=function(e){return new t(e)},t}();var y0=function(){function t(e){this.image=e,this.bitsPerComponent=e.bitsPerComponent,this.width=e.width,this.height=e.height,this.colorSpace="DeviceRGB"}return t.for=function(e){return V(this,void 0,void 0,function(){var r;return q(this,function(n){return r=zc.load(e),[2,new t(r)]})})},t.prototype.embedIntoContext=function(e,r){return V(this,void 0,void 0,function(){var n,o;return q(this,function(i){return n=this.embedAlphaChannel(e),o=e.flateStream(this.image.rgbChannel,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),r?(e.assign(r,o),[2,r]):[2,e.register(o)]})})},t.prototype.embedAlphaChannel=function(e){if(this.image.alphaChannel){var r=e.flateStream(this.image.alphaChannel,{Type:"XObject",Subtype:"Image",Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:"DeviceGray",Decode:[0,1]});return e.register(r)}},t}(),co=y0;var b0=function(){function t(e,r,n){this.bytes=e,this.start=r||0,this.pos=this.start,this.end=r&&n?r+n:this.bytes.length}return Object.defineProperty(t.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),t.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},t.prototype.getUint16=function(){var e=this.getByte(),r=this.getByte();return e===-1||r===-1?-1:(e<<8)+r},t.prototype.getInt32=function(){var e=this.getByte(),r=this.getByte(),n=this.getByte(),o=this.getByte();return(e<<24)+(r<<16)+(n<<8)+o},t.prototype.getBytes=function(e,r){r===void 0&&(r=!1);var n=this.bytes,o=this.pos,i=this.end;if(e){var s=o+e;s>i&&(s=i),this.pos=s;var a=n.subarray(o,s);return r?new Uint8ClampedArray(a):a}else{var a=n.subarray(o,i);return r?new Uint8ClampedArray(a):a}},t.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},t.prototype.peekBytes=function(e,r){r===void 0&&(r=!1);var n=this.getBytes(e,r);return this.pos-=n.length,n},t.prototype.skip=function(e){e||(e=1),this.pos+=e},t.prototype.reset=function(){this.pos=this.start},t.prototype.moveStart=function(){this.start=this.pos},t.prototype.makeSubStream=function(e,r){return new t(this.bytes,e,r)},t.prototype.decode=function(){return this.bytes},t}(),Si=b0;var x0=new Uint8Array(0),F0=function(){function t(e){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=x0,this.minBufferLength=512,e)for(;this.minBufferLengthi&&(n=i)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var a=this.buffer.subarray(o,n);return r&&!(a instanceof Uint8ClampedArray)?new Uint8ClampedArray(a):a},t.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},t.prototype.peekBytes=function(e,r){r===void 0&&(r=!1);var n=this.getBytes(e,r);return this.pos-=n.length,n},t.prototype.skip=function(e){e||(e=1),this.pos+=e},t.prototype.reset=function(){this.pos=0},t.prototype.makeSubStream=function(e,r){for(var n=e+r;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Si(this.buffer,e,r)},t.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},t.prototype.readBlock=function(){throw new Le(this.constructor.name,"readBlock")},t.prototype.ensureBuffer=function(e){var r=this.buffer;if(e<=r.byteLength)return r;for(var n=this.minBufferLength;n=0;--f)l[s+f]=u&255,u>>=8}},e}(At),Lc=w0;var S0=function(t){k(e,t);function e(r,n){var o=t.call(this,n)||this;return o.stream=r,o.firstDigit=-1,n&&(n=.5*n),o}return e.prototype.readBlock=function(){var r=8e3,n=this.stream.getBytes(r);if(!n.length){this.eof=!0;return}for(var o=n.length+1>>1,i=this.ensureBuffer(this.bufferLength+o),a=this.bufferLength,s=this.firstDigit,l=0,f=n.length;l=48&&c<=57)u=c&15;else if(c>=65&&c<=70||c>=97&&c<=102)u=(c&15)+9;else if(c===62){this.eof=!0;break}else continue;s<0?s=u:(i[a++]=s<<4|u,s=-1)}s>=0&&this.eof&&(i[a++]=s<<4,s=-1),this.firstDigit=s,this.bufferLength=a},e}(At),Hc=S0;var Uc=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),P0=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),D0=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),C0=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],k0=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],T0=function(t){k(e,t);function e(r,n){var o=t.call(this,n)||this;o.stream=r;var i=r.getByte(),a=r.getByte();if(i===-1||a===-1)throw new Error("Invalid header in flate stream: "+i+", "+a);if((i&15)!==8)throw new Error("Unknown compression method in flate stream: "+i+", "+a);if(((i<<8)+a)%31!==0)throw new Error("Bad FCHECK in flate stream: "+i+", "+a);if(a&32)throw new Error("FDICT bit set in flate stream: "+i+", "+a);return o.codeSize=0,o.codeBuf=0,o}return e.prototype.readBlock=function(){var r,n,o=this.stream,i=this.getBits(3);if(i&1&&(this.eof=!0),i>>=1,i===0){var a=void 0;if((a=o.getByte())===-1)throw new Error("Bad block header in flate stream");var s=a;if((a=o.getByte())===-1)throw new Error("Bad block header in flate stream");if(s|=a<<8,(a=o.getByte())===-1)throw new Error("Bad block header in flate stream");var l=a;if((a=o.getByte())===-1)throw new Error("Bad block header in flate stream");if(l|=a<<8,l!==(~s&65535)&&(s!==0||l!==0))throw new Error("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var f=this.bufferLength;r=this.ensureBuffer(f+s);var c=f+s;if(this.bufferLength=c,s===0)o.peekByte()===-1&&(this.eof=!0);else for(var u=f;u0;)S[m++]=C}d=this.generateHuffmanTable(S.subarray(0,h)),p=this.generateHuffmanTable(S.subarray(h,w))}else throw new Error("Unknown block type in flate stream");r=this.buffer;for(var A=r?r.length:0,R=this.bufferLength;;){var z=this.getCode(d);if(z<256){R+1>=A&&(r=this.ensureBuffer(R+1),A=r.length),r[R++]=z;continue}if(z===256){this.bufferLength=R;return}z-=257,z=P0[z];var M=z>>16;M>0&&(M=this.getBits(M)),n=(z&65535)+M,z=this.getCode(p),z=D0[z],M=z>>16,M>0&&(M=this.getBits(M));var X=(z&65535)+M;R+n>=A&&(r=this.ensureBuffer(R+n),A=r.length);for(var te=0;te>r,this.codeSize=o-=r,a},e.prototype.getCode=function(r){for(var n=this.stream,o=r[0],i=r[1],a=this.codeSize,s=this.codeBuf,l;a>16,u=f&65535;if(c<1||a>c,this.codeSize=a-c,u},e.prototype.generateHuffmanTable=function(r){var n=r.length,o=0,i;for(i=0;io&&(o=r[i]);for(var a=1<>=1;for(i=d;i0;if(!S||S<256)F[0]=S,x=1;else if(S>=258)if(S=0;a--)F[a]=u[s],s=p[s];else F[x++]=F[0];else if(S===256){h=9,c=258,x=0;continue}else{this.eof=!0,delete this.lzwState;break}if(D&&(p[c]=b,d[c]=d[b]+1,u[c]=F[0],c++,h=c+f&c+f-1?h:Math.min(Math.log(c+f)/.6931471805599453+1,12)|0),b=S,m+=x,n>>n&(1<0){var a=this.stream.getBytes(i);n.set(a,o),o+=i}}else{i=257-i;var s=r[1];n=this.ensureBuffer(o+i+1);for(var l=0;ln.size())throw new nn(r,0,n.size());n.remove(r)}else{if(r!==0)throw new nn(r,0,0);this.setKids([])}},e.prototype.normalizedEntries=function(){var r=this.Kids();return r||(r=this.dict.context.obj([this.ref]),this.dict.set(v.of("Kids"),r)),{Kids:r}},e.fromDict=function(r,n){return new e(r,n)},e}(vo),it=U0;var V0=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.Opt=function(){return this.dict.lookupMaybe(v.of("Opt"),ne,H,Z)},e.prototype.setOpt=function(r){this.dict.set(v.of("Opt"),this.dict.context.obj(r))},e.prototype.getExportValues=function(){var r=this.Opt();if(r){if(r instanceof ne||r instanceof H)return[r];for(var n=[],o=0,i=r.size();on.size())throw new nn(r,0,n.size());n.remove(r)}},e.prototype.normalizeExportValues=function(){for(var r,n,o,i,a=(r=this.getExportValues())!==null&&r!==void 0?r:[],s=[],l=this.getWidgets(),f=0,c=l.length;f1){if(!this.hasFlag(fe.MultiSelect))throw new hc;this.dict.set(v.of("V"),this.dict.context.obj(r))}this.updateSelectedIndices(r)},e.prototype.valuesAreValid=function(r){for(var n=this.getOptions(),o=function(l,f){var c=r[l].decodeText();if(!n.find(function(u){return c===(u.display||u.value).decodeText()}))return{value:!1}},i=0,a=r.length;i1){for(var n=new Array(r.length),o=this.getOptions(),i=function(l,f){var c=r[l].decodeText();n[l]=o.findIndex(function(u){return c===(u.display||u.value).decodeText()})},a=0,s=r.length;a0){var s=a.lookup(0,ne,H),l=a.lookupMaybe(1,ne,H);n.push({value:s,display:l||s})}}return n}return[]},e}(it),go=W0;var G0=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.fromDict=function(r,n){return new e(r,n)},e.create=function(r){var n=r.obj({FT:"Ch",Ff:fe.Combo,Kids:[]}),o=r.register(n);return new e(n,o)},e}(go),rr=G0;var K0=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.addField=function(r){var n=this.normalizedEntries().Kids;n?.push(r)},e.prototype.normalizedEntries=function(){var r=this.Kids();return r||(r=this.dict.context.obj([]),this.dict.set(v.of("Kids"),r)),{Kids:r}},e.fromDict=function(r,n){return new e(r,n)},e.create=function(r){var n=r.obj({}),o=r.register(n);return new e(n,o)},e}(vo),nr=K0;var X0=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.fromDict=function(r,n){return new e(r,n)},e}(it),Nr=X0;var Z0=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.MaxLen=function(){var r=this.dict.lookup(v.of("MaxLen"));if(r instanceof j)return r},e.prototype.Q=function(){var r=this.dict.lookup(v.of("Q"));if(r instanceof j)return r},e.prototype.setMaxLength=function(r){this.dict.set(v.of("MaxLen"),j.of(r))},e.prototype.removeMaxLength=function(){this.dict.delete(v.of("MaxLen"))},e.prototype.getMaxLength=function(){var r;return(r=this.MaxLen())===null||r===void 0?void 0:r.asNumber()},e.prototype.setQuadding=function(r){this.dict.set(v.of("Q"),j.of(r))},e.prototype.getQuadding=function(){var r;return(r=this.Q())===null||r===void 0?void 0:r.asNumber()},e.prototype.setValue=function(r){this.dict.set(v.of("V"),r)},e.prototype.removeValue=function(){this.dict.delete(v.of("V"))},e.prototype.getValue=function(){var r=this.V();if(r instanceof ne||r instanceof H)return r},e.fromDict=function(r,n){return new e(r,n)},e.create=function(r){var n=r.obj({FT:"Tx",Kids:[]}),o=r.register(n);return new e(n,o)},e}(it),or=Z0;var Y0=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.fromDict=function(r,n){return new e(r,n)},e.create=function(r){var n=r.obj({FT:"Btn",Ff:qe.PushButton,Kids:[]}),o=r.register(n);return new e(n,o)},e}(Br),ir=Y0;var J0=function(t){k(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.setValue=function(r){var n=this.getOnValues();if(!n.includes(r)&&r!==v.of("Off"))throw new on;this.dict.set(v.of("V"),r);for(var o=this.getWidgets(),i=0,a=o.length;ii)throw new Na(n,i);for(var a=n,s=0,l=o.size();sa)return c.insertLeafNode(r,a)||f;a-=c.Count().asNumber()}c instanceof Ze&&(a-=1)}if(a===0){this.insertLeafKid(o.size(),r);return}throw new Ma(n,"insertLeafNode")},e.prototype.removeLeafNode=function(r,n){n===void 0&&(n=!0);var o=this.Kids(),i=this.Count().asNumber();if(r>=i)throw new Na(r,i);for(var a=r,s=0,l=o.size();sa){c.removeLeafNode(a,n),n&&c.Kids().size()===0&&o.remove(s);return}else a-=c.Count().asNumber();if(c instanceof Ze)if(a===0){this.removeKid(s);return}else a-=1}throw new Ma(r,"removeLeafNode")},e.prototype.ascend=function(r){r(this);var n=this.Parent();n&&n.ascend(r)},e.prototype.traverse=function(r){for(var n=this.Kids(),o=0,i=n.size();oNumber.MAX_SAFE_INTEGER)if(this.capNumbers){var o="Parsed number that is too large for some PDF readers: "+e+", using Number.MAX_SAFE_INTEGER instead.";return console.warn(o),Number.MAX_SAFE_INTEGER}else{var o="Parsed number that is too large for some PDF readers: "+e+", not capping.";console.warn(o)}return n},t.prototype.skipWhitespace=function(){for(;!this.bytes.done()&<[this.bytes.peek()];)this.bytes.next()},t.prototype.skipLine=function(){for(;!this.bytes.done();){var e=this.bytes.peek();if(e===Zc||e===Yc)return;this.bytes.next()}},t.prototype.skipComment=function(){if(this.bytes.peek()!==g.Percent)return!1;for(;!this.bytes.done();){var e=this.bytes.peek();if(e===Zc||e===Yc)return!0;this.bytes.next()}return!0},t.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},t.prototype.matchKeyword=function(e){for(var r=this.bytes.offset(),n=0,o=e.length;n=this.length},t.prototype.offset=function(){return this.idx},t.prototype.slice=function(e,r){return this.bytes.slice(e,r)},t.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},t.of=function(e){return new t(e)},t.fromPDFRawStream=function(e){return t.of(uo(e).decode())},t}(),fr=av;var sv=g.Space,wo=g.CarriageReturn,So=g.Newline,Po=[g.s,g.t,g.r,g.e,g.a,g.m],Ti=[g.e,g.n,g.d,g.s,g.t,g.r,g.e,g.a,g.m],pe={header:[g.Percent,g.P,g.D,g.F,g.Dash],eof:[g.Percent,g.Percent,g.E,g.O,g.F],obj:[g.o,g.b,g.j],endobj:[g.e,g.n,g.d,g.o,g.b,g.j],xref:[g.x,g.r,g.e,g.f],trailer:[g.t,g.r,g.a,g.i,g.l,g.e,g.r],startxref:[g.s,g.t,g.a,g.r,g.t,g.x,g.r,g.e,g.f],true:[g.t,g.r,g.u,g.e],false:[g.f,g.a,g.l,g.s,g.e],null:[g.n,g.u,g.l,g.l],stream:Po,streamEOF1:re(Po,[sv,wo,So]),streamEOF2:re(Po,[wo,So]),streamEOF3:re(Po,[wo]),streamEOF4:re(Po,[So]),endstream:Ti,EOF1endstream:re([wo,So],Ti),EOF2endstream:re([wo],Ti),EOF3endstream:re([So],Ti)};var fv=function(t){k(e,t);function e(r,n,o){o===void 0&&(o=!1);var i=t.call(this,r,o)||this;return i.context=n,i}return e.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(pe.true))return Ut.True;if(this.matchKeyword(pe.false))return Ut.False;if(this.matchKeyword(pe.null))return Te;var r=this.bytes.peek();if(r===g.LessThan&&this.bytes.peekAhead(1)===g.LessThan)return this.parseDictOrStream();if(r===g.LessThan)return this.parseHexString();if(r===g.LeftParen)return this.parseString();if(r===g.ForwardSlash)return this.parseName();if(r===g.LeftSquareBracket)return this.parseArray();if(Fo[r])return this.parseNumberOrRef();throw new gc(this.bytes.position(),r)},e.prototype.parseNumberOrRef=function(){var r=this.parseRawNumber();this.skipWhitespaceAndComments();var n=this.bytes.offset();if(Ie[this.bytes.peek()]){var o=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===g.R)return this.bytes.assertNext(g.R),J.of(r,o)}return this.bytes.moveTo(n),j.of(r)},e.prototype.parseHexString=function(){var r="";for(this.bytes.assertNext(g.LessThan);!this.bytes.done()&&this.bytes.peek()!==g.GreaterThan;)r+=tt(this.bytes.next());return this.bytes.assertNext(g.GreaterThan),H.of(r)},e.prototype.parseString=function(){for(var r=0,n=!1,o="";!this.bytes.done();){var i=this.bytes.next();if(o+=tt(i),n||(i===g.LeftParen&&(r+=1),i===g.RightParen&&(r-=1)),i===g.BackSlash?n=!n:n&&(n=!1),r===0)return ne.of(o.substring(1,o.length-1))}throw new xc(this.bytes.position())},e.prototype.parseName=function(){this.bytes.assertNext(g.ForwardSlash);for(var r="";!this.bytes.done();){var n=this.bytes.peek();if(lt[n]||et[n])break;r+=tt(n),this.bytes.next()}return v.of(r)},e.prototype.parseArray=function(){this.bytes.assertNext(g.LeftSquareBracket),this.skipWhitespaceAndComments();for(var r=Z.withContext(this.context);this.bytes.peek()!==g.RightSquareBracket;){var n=this.parseObject();r.push(n),this.skipWhitespaceAndComments()}return this.bytes.assertNext(g.RightSquareBracket),r},e.prototype.parseDict=function(){this.bytes.assertNext(g.LessThan),this.bytes.assertNext(g.LessThan),this.skipWhitespaceAndComments();for(var r=new Map;!this.bytes.done()&&this.bytes.peek()!==g.GreaterThan&&this.bytes.peekAhead(1)!==g.GreaterThan;){var n=this.parseName(),o=this.parseObject();r.set(n,o),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(g.GreaterThan),this.bytes.assertNext(g.GreaterThan);var i=r.get(v.of("Type"));return i===v.of("Catalog")?bo.fromMapWithContext(r,this.context):i===v.of("Pages")?xo.fromMapWithContext(r,this.context):i===v.of("Page")?Ze.fromMapWithContext(r,this.context):U.fromMapWithContext(r,this.context)},e.prototype.parseDictOrStream=function(){var r=this.bytes.position(),n=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(pe.streamEOF1)&&!this.matchKeyword(pe.streamEOF2)&&!this.matchKeyword(pe.streamEOF3)&&!this.matchKeyword(pe.streamEOF4)&&!this.matchKeyword(pe.stream))return n;var o=this.bytes.offset(),i,a=n.get(v.of("Length"));a instanceof j?(i=o+a.asNumber(),this.bytes.moveTo(i),this.skipWhitespaceAndComments(),this.matchKeyword(pe.endstream)||(this.bytes.moveTo(o),i=this.findEndOfStreamFallback(r))):i=this.findEndOfStreamFallback(r);var s=this.bytes.slice(o,i);return Et.of(n,s)},e.prototype.findEndOfStreamFallback=function(r){for(var n=1,o=this.bytes.offset();!this.bytes.done()&&(o=this.bytes.offset(),this.matchKeyword(pe.stream)?n+=1:this.matchKeyword(pe.EOF1endstream)||this.matchKeyword(pe.EOF2endstream)||this.matchKeyword(pe.EOF3endstream)||this.matchKeyword(pe.endstream)?n-=1:this.bytes.next(),n!==0););if(n!==0)throw new bc(r);return o},e.forBytes=function(r,n,o){return new e(fr.of(r),n,o)},e.forByteStream=function(r,n,o){return o===void 0&&(o=!1),new e(r,n,o)},e}(Jc),Do=fv;var lv=function(t){k(e,t);function e(r,n){var o=t.call(this,fr.fromPDFRawStream(r),r.dict.context)||this,i=r.dict;return o.alreadyParsed=!1,o.shouldWaitForTick=n||function(){return!1},o.firstOffset=i.lookup(v.of("First"),j).asNumber(),o.objectCount=i.lookup(v.of("N"),j).asNumber(),o}return e.prototype.parseIntoContext=function(){return V(this,void 0,void 0,function(){var r,n,o,i,a,s,l,f;return q(this,function(c){switch(c.label){case 0:if(this.alreadyParsed)throw new rn("PDFObjectStreamParser","parseIntoContext");this.alreadyParsed=!0,r=this.parseOffsetsAndObjectNumbers(),n=0,o=r.length,c.label=1;case 1:return n=g.Space&&n<=g.Tilde;if(o&&(this.matchKeyword(pe.xref)||this.matchKeyword(pe.trailer)||this.matchKeyword(pe.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(r);break}this.bytes.next()}},e.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var r=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(r)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},e.forBytesWithOptions=function(r,n,o,i){return new e(r,n,o,i)},e}(Do),_a=uv;var Rt=function(t){return 1<0&&(n[n.length]=+o),r[r.length]={cmd:e,args:n},n=[],o="",i=!1),e=f;else if([" ",","].includes(f)||f==="-"&&o.length>0&&o[o.length-1]!=="e"||f==="."&&i){if(o.length===0)continue;n.length===a?(r[r.length]={cmd:e,args:n},n=[+o],e==="M"&&(e="L"),e==="m"&&(e="l")):n[n.length]=+o,i=f===".",o=["-","."].includes(f)?f:""}else o+=f,f==="."&&(i=!0)}return o.length>0&&(n.length===a?(r[r.length]={cmd:e,args:n},n=[+o],e==="M"&&(e="L"),e==="m"&&(e="l")):n[n.length]=+o),r[r.length]={cmd:e,args:n},r},vv=function(t){G=K=le=ce=No=Mo=0;for(var e=[],r=0;r1&&(d=Math.sqrt(d),r*=d,n*=d);var p=u/r,h=c/r,b=-c/n,F=u/n,x=p*s+h*l,m=b*s+F*l,y=p*t+h*e,w=b*t+F*e,S=(y-x)*(y-x)+(w-m)*(w-m),D=1/S-.25;D<0&&(D=0);var T=Math.sqrt(D);i===o&&(T=-T);var C=.5*(x+y)-T*(w-m),E=.5*(m+w)+T*(y-x),I=Math.atan2(m-E,x-C),A=Math.atan2(w-E,y-C),R=A-I;R<0&&i===1?R+=2*Math.PI:R>0&&i===0&&(R-=2*Math.PI);for(var z=Math.ceil(Math.abs(R/(Math.PI*.5+.001))),M=[],X=0;Xt.length)return o-1;var F=e.heightAtSize(o),x=F+F*.2,m=x*i;if(m>Math.abs(r.height))return o-1;o+=1}return o},Fv=function(t,e,r,n){for(var o=r.width/n,i=r.height,a=Eu,s=Ns(t);ao*.75;if(u)return a-1}var d=e.heightAtSize(a,{descender:!1});if(d>i)return a-1;a+=1}return a},wv=function(t){for(var e=t.length;e>0;e--)if(/\s/.test(t[e]))return e},Sv=function(t,e,r,n){for(var o,i=t.length;i>0;){var a=t.substring(0,i),s=r.encodeText(a),l=r.widthOfTextAtSize(a,n);if(ld&&(d=T+S),h+s>p&&(p=h+s),f.push({text:y,encoded:w,width:S,height:s,x:T,y:h}),x=D?.trim()}return{fontSize:n,lineHeight:l,lines:f,bounds:{x:c,y:u,width:d-c,height:p-u}}},Ou=function(t,e){var r=e.fontSize,n=e.font,o=e.bounds,i=e.cellCount,a=Xi(pr(t));if(a.length>i)throw new Cu(a.length,i);(r===void 0||r===0)&&(r=Fv(a,n,o,i));for(var s=o.width/i,l=n.heightAtSize(r,{descender:!1}),f=o.y+(o.height/2-l/2),c=[],u=o.x,d=o.y,p=o.x+o.width,h=o.y+o.height,b=0,F=0;bp&&(p=T+S),f+l>h&&(h=f+l),c.push({text:a,encoded:w,width:S,height:l,x:T,y:f}),b+=1,F+=y}return{fontSize:r,cells:c,bounds:{x:u,y:d,width:p-u,height:h-d}}},jo=function(t,e){var r=e.alignment,n=e.fontSize,o=e.font,i=e.bounds,a=Xi(pr(t));(n===void 0||n===0)&&(n=Ru([a],o,i));var s=o.encodeText(a),l=o.widthOfTextAtSize(a,n),f=o.heightAtSize(n,{descender:!1}),c=r===De.Left?i.x:r===De.Center?i.x+i.width/2-l/2:r===De.Right?i.x+i.width-l:i.x,u=i.y+(i.height/2-f/2);return{fontSize:n,line:{text:a,encoded:s,width:l,height:f,x:c,y:u},bounds:{x:c,y:u,width:l,height:f}}};var pt=function(t){return"normal"in t?t:{normal:t}},Pv=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,dr=function(t){var e,r,n=(e=t.getDefaultAppearance())!==null&&e!==void 0?e:"",o=(r=On(n,Pv).match)!==null&&r!==void 0?r:[],i=Number(o[2]);return isFinite(i)?i:void 0},Dv=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,dt=function(t){var e,r=(e=t.getDefaultAppearance())!==null&&e!==void 0?e:"",n=On(r,Dv).match,o=n??[],i=o[1],a=o[2],s=o[3],l=o[4],f=o[5];if(f==="g"&&i)return fs(Number(i));if(f==="rg"&&i&&a&&s)return ae(Number(i),Number(a),Number(s));if(f==="k"&&i&&a&&s&&l)return ls(Number(i),Number(a),Number(s),Number(l))},ht=function(t,e,r,n){var o;n===void 0&&(n=0);var i=[Bt(e).toString(),Oo((o=r?.name)!==null&&o!==void 0?o:"dummy__noop",n).toString()].join(` +`);t.setDefaultAppearance(i)},Bu=function(t,e){var r,n,o,i=dt(e),a=dt(t.acroField),s=e.getRectangle(),l=e.getAppearanceCharacteristics(),f=e.getBorderStyle(),c=(r=f?.getWidth())!==null&&r!==void 0?r:0,u=bt(l?.getRotation()),d=qt(s,u),p=d.width,h=d.height,b=xt(Y(Y({},s),{rotation:u})),F=ae(0,0,0),x=(n=We(l?.getBorderColor()))!==null&&n!==void 0?n:F,m=We(l?.getBackgroundColor()),y=We(l?.getBackgroundColor(),.8),w=(o=i??a)!==null&&o!==void 0?o:F;ht(i?e:t.acroField,w);var S={x:0+c/2,y:0+c/2,width:p-c,height:h-c,thickness:1.5,borderWidth:c,borderColor:x,markColor:w};return{normal:{on:re(b,Io(Y(Y({},S),{color:m,filled:!0}))),off:re(b,Io(Y(Y({},S),{color:m,filled:!1})))},down:{on:re(b,Io(Y(Y({},S),{color:y,filled:!0}))),off:re(b,Io(Y(Y({},S),{color:y,filled:!1})))}}},Nu=function(t,e){var r,n,o,i=dt(e),a=dt(t.acroField),s=e.getRectangle(),l=e.getAppearanceCharacteristics(),f=e.getBorderStyle(),c=(r=f?.getWidth())!==null&&r!==void 0?r:0,u=bt(l?.getRotation()),d=qt(s,u),p=d.width,h=d.height,b=xt(Y(Y({},s),{rotation:u})),F=ae(0,0,0),x=(n=We(l?.getBorderColor()))!==null&&n!==void 0?n:F,m=We(l?.getBackgroundColor()),y=We(l?.getBackgroundColor(),.8),w=(o=i??a)!==null&&o!==void 0?o:F;ht(i?e:t.acroField,w);var S={x:p/2,y:h/2,width:p-c,height:h-c,borderWidth:c,borderColor:x,dotColor:w};return{normal:{on:re(b,zo(Y(Y({},S),{color:m,filled:!0}))),off:re(b,zo(Y(Y({},S),{color:m,filled:!1})))},down:{on:re(b,zo(Y(Y({},S),{color:y,filled:!0}))),off:re(b,zo(Y(Y({},S),{color:y,filled:!1})))}}},Mu=function(t,e,r){var n,o,i,a,s,l=dt(e),f=dt(t.acroField),c=dr(e),u=dr(t.acroField),d=e.getRectangle(),p=e.getAppearanceCharacteristics(),h=e.getBorderStyle(),b=p?.getCaptions(),F=(n=b?.normal)!==null&&n!==void 0?n:"",x=(i=(o=b?.down)!==null&&o!==void 0?o:F)!==null&&i!==void 0?i:"",m=(a=h?.getWidth())!==null&&a!==void 0?a:0,y=bt(p?.getRotation()),w=qt(d,y),S=w.width,D=w.height,T=xt(Y(Y({},d),{rotation:y})),C=ae(0,0,0),E=We(p?.getBorderColor()),I=We(p?.getBackgroundColor()),A=We(p?.getBackgroundColor(),.8),R={x:m,y:m,width:S-m*2,height:D-m*2},z=jo(F,{alignment:De.Center,fontSize:c??u,font:r,bounds:R}),M=jo(x,{alignment:De.Center,fontSize:c??u,font:r,bounds:R}),X=Math.min(z.fontSize,M.fontSize),te=(s=l??f)!==null&&s!==void 0?s:C;ht(l||c!==void 0?e:t.acroField,te,r,X);var L={x:0+m/2,y:0+m/2,width:S-m,height:D-m,borderWidth:m,borderColor:E,textColor:te,font:r.name,fontSize:X};return{normal:re(T,ps(Y(Y({},L),{color:I,textLines:[z.line]}))),down:re(T,ps(Y(Y({},L),{color:A,textLines:[M.line]})))}},Iu=function(t,e,r){var n,o,i,a,s=dt(e),l=dt(t.acroField),f=dr(e),c=dr(t.acroField),u=e.getRectangle(),d=e.getAppearanceCharacteristics(),p=e.getBorderStyle(),h=(n=t.getText())!==null&&n!==void 0?n:"",b=(o=p?.getWidth())!==null&&o!==void 0?o:0,F=bt(d?.getRotation()),x=qt(u,F),m=x.width,y=x.height,w=xt(Y(Y({},u),{rotation:F})),S=ae(0,0,0),D=We(d?.getBorderColor()),T=We(d?.getBackgroundColor()),C,E,I=t.isCombed()?0:1,A={x:b+I,y:b+I,width:m-(b+I)*2,height:y-(b+I)*2};if(t.isMultiline()){var R=ys(h,{alignment:t.getAlignment(),fontSize:f??c,font:r,bounds:A});C=R.lines,E=R.fontSize}else if(t.isCombed()){var R=Ou(h,{fontSize:f??c,font:r,bounds:A,cellCount:(i=t.getMaxLength())!==null&&i!==void 0?i:0});C=R.cells,E=R.fontSize}else{var R=jo(h,{alignment:t.getAlignment(),fontSize:f??c,font:r,bounds:A});C=[R.line],E=R.fontSize}var z=(a=s??l)!==null&&a!==void 0?a:S;ht(s||f!==void 0?e:t.acroField,z,r,E);var M={x:0+b/2,y:0+b/2,width:m-b,height:y-b,borderWidth:b??0,borderColor:D,textColor:z,font:r.name,fontSize:E,color:T,textLines:C,padding:I};return re(w,ms(M))},zu=function(t,e,r){var n,o,i,a=dt(e),s=dt(t.acroField),l=dr(e),f=dr(t.acroField),c=e.getRectangle(),u=e.getAppearanceCharacteristics(),d=e.getBorderStyle(),p=(n=t.getSelected()[0])!==null&&n!==void 0?n:"",h=(o=d?.getWidth())!==null&&o!==void 0?o:0,b=bt(u?.getRotation()),F=qt(c,b),x=F.width,m=F.height,y=xt(Y(Y({},c),{rotation:b})),w=ae(0,0,0),S=We(u?.getBorderColor()),D=We(u?.getBackgroundColor()),T=1,C={x:h+T,y:h+T,width:x-(h+T)*2,height:m-(h+T)*2},E=jo(p,{alignment:De.Left,fontSize:l??f,font:r,bounds:C}),I=E.line,A=E.fontSize,R=(i=a??s)!==null&&i!==void 0?i:w;ht(a||l!==void 0?e:t.acroField,R,r,A);var z={x:0+h/2,y:0+h/2,width:x-h,height:m-h,borderWidth:h??0,borderColor:S,textColor:R,font:r.name,fontSize:A,color:D,textLines:[I],padding:T};return re(y,ms(z))},ju=function(t,e,r){var n,o,i=dt(e),a=dt(t.acroField),s=dr(e),l=dr(t.acroField),f=e.getRectangle(),c=e.getAppearanceCharacteristics(),u=e.getBorderStyle(),d=(n=u?.getWidth())!==null&&n!==void 0?n:0,p=bt(c?.getRotation()),h=qt(f,p),b=h.width,F=h.height,x=xt(Y(Y({},f),{rotation:p})),m=ae(0,0,0),y=We(c?.getBorderColor()),w=We(c?.getBackgroundColor()),S=t.getOptions(),D=t.getSelected();t.isSorted()&&S.sort();for(var T="",C=0,E=S.length;C1||o.length===1&&n)&&this.enableMultiselect();for(var s=new Array(o.length),l=0,f=o.length;l1||o.length===1&&n)&&this.enableMultiselect();for(var a=new Array(o.length),s=0,l=o.length;sn)throw new ku(r.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),r?this.acroField.setValue(H.fromText(r)):this.acroField.removeValue()},e.prototype.getAlignment=function(){var r=this.acroField.getQuadding();return r===0?De.Left:r===1?De.Center:r===2?De.Right:De.Left},e.prototype.setAlignment=function(r){yt(r,"alignment",De),this.markAsDirty(),this.acroField.setQuadding(r)},e.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},e.prototype.setMaxLength=function(r){if(ot(r,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),r===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>r)throw new Tu(n.length,r,this.getName());this.acroField.setMaxLength(r)}},e.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},e.prototype.setImage=function(r){for(var n=this.getAlignment(),o=n===De.Center?Ft.Center:n===De.Right?Ft.Right:Ft.Left,i=this.acroField.getWidgets(),a=0,s=i.length;at/25.4*96;function Wv(t){return t.pageSize==="Custom"?{w:Math.max(1,Math.round(kn(t.customPageWidth))),h:Math.max(1,Math.round(kn(t.customPageHeight)))}:Vi[t.pageSize]??Vi.A4}function Ui(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function qu(t){return t.replace(/<\/style/gi,"<\\/style")}function Cn(t,e){let r=e.trim();if(!r)return"";if(/^(https?:|data:)/i.test(r))return r;let n=t.vault.getAbstractFileByPath(r);if(n instanceof N.TFile)return t.vault.getResourcePath(n);let o=t.metadataCache.getFirstLinkpathDest(r,"");return o instanceof N.TFile?t.vault.getResourcePath(o):(console.warn("[advanced-pdf-export] Could not resolve image path:",r),r)}function Wu(t){return{size:t==="fill"?"100% 100%":t==="tile"?"auto":t,repeat:t==="tile"?"repeat":"no-repeat"}}var Gv=/[\u0590-\u08FF\uFB1D-\uFDFD\uFE70-\uFEFC]/g,Kv=/[A-Za-z\u0590-\u08FF\uFB1D-\uFDFD\uFE70-\uFEFC]/g;function Xv(t){let e=(t.match(Gv)??[]).length,r=(t.match(Kv)??[]).length;return r>0&&e/r>.1}function Zv(t){return t.replace(/\r\n|\r/g,` +`)}function Yv(t){return t.replace(/^---[ \t]*\n[\s\S]*?\n---[ \t]*(\n|$)/,"")}function Jv(t){return t.split(/^\/\/\/\s*$/m).map(e=>e.trim()).filter(Boolean)}async function Qv(t,e,r,n){let o=activeDocument.createElement("div");o.setCssStyles({position:"fixed",top:"0",left:"-99999px",visibility:"hidden",pointerEvents:"none"}),activeDocument.body.appendChild(o);try{await N.MarkdownRenderer.render(t,e,o,r,n),await rm(o);let i=activeDocument.fonts;if(i?.ready)try{await i.ready}catch{}}finally{activeDocument.body.removeChild(o)}return tm(o),o}var _v=/[^\p{L}\p{N}\s-]/gu,$v=/\s+/g,em=/-+/g;function Gu(t){return t.toLowerCase().replace(_v,"").trim().replace($v,"-").replace(em,"-")}function tm(t){let e=new Map;t.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(r=>{let n=r.textContent||"",o=Gu(n);if(!o)return;let i=e.get(o)??0;e.set(o,i+1),r.id=i===0?o:`${o}-${i}`}),t.querySelectorAll("a").forEach(r=>{r.classList.remove("external-link");let n=r.getAttribute("data-href")??r.getAttribute("href");n?.startsWith("#")&&r.setAttribute("href","#"+Gu(n.slice(1)))}),t.querySelectorAll(".copy-code-button").forEach(r=>r.remove()),t.querySelectorAll(".callout").forEach(r=>{r.removeAttribute("data-callout-fold"),r.classList.remove("is-collapsed"),r.querySelectorAll(".callout-fold").forEach(n=>n.remove())}),t.querySelectorAll("style, script").forEach(r=>{r.closest("svg")||r.remove()})}async function rm(t){let e=Array.from(t.querySelectorAll(".mermaid"));if(e.length===0)return;let r=5e3;await Promise.all(e.map(n=>new Promise(o=>{if(n.querySelector("svg")){o();return}let i=window.setTimeout(()=>{a.disconnect(),o()},r),a=new MutationObserver(()=>{n.querySelector("svg")&&(window.clearTimeout(i),a.disconnect(),o())});a.observe(n,{childList:!0,subtree:!0})})))}var nm={comment:["comment","prolog","doctype","cdata"],punctuation:["punctuation"],property:["property","tag","boolean","number","constant","symbol","deleted","attr-name"],selector:["selector","string","char","builtin","inserted","attr-value"],operator:["operator","entity","url"],keyword:["atrule","keyword","important"],function:["function","class-name"],regex:["regex","variable"]},Ss={none:{name:"None (plain)"},"github-light":{name:"GitHub Light",background:"#f6f8fa",text:"#24292e",tokens:{comment:"#6a737d",punctuation:"#24292e",property:"#005cc5",selector:"#032f62",operator:"#d73a49",keyword:"#d73a49",function:"#6f42c1",regex:"#032f62"}},"github-dark":{name:"GitHub Dark",background:"#0d1117",text:"#c9d1d9",tokens:{comment:"#8b949e",punctuation:"#c9d1d9",property:"#79c0ff",selector:"#a5d6ff",operator:"#ff7b72",keyword:"#ff7b72",function:"#d2a8ff",regex:"#a5d6ff"}},"atom-one-light":{name:"Atom One Light",background:"#fafafa",text:"#383a42",tokens:{comment:"#a0a1a7",punctuation:"#383a42",property:"#986801",selector:"#50a14f",operator:"#0184bc",keyword:"#a626a4",function:"#4078f2",regex:"#50a14f"}},"atom-one-dark":{name:"Atom One Dark",background:"#282c34",text:"#abb2bf",tokens:{comment:"#5c6370",punctuation:"#abb2bf",property:"#d19a66",selector:"#98c379",operator:"#56b6c2",keyword:"#c678dd",function:"#61afef",regex:"#98c379"}},monokai:{name:"Monokai",background:"#272822",text:"#f8f8f2",tokens:{comment:"#75715e",punctuation:"#f8f8f2",property:"#ae81ff",selector:"#e6db74",operator:"#f92672",keyword:"#f92672",function:"#a6e22e",regex:"#e6db74"}},dracula:{name:"Dracula",background:"#282a36",text:"#f8f8f2",tokens:{comment:"#6272a4",punctuation:"#f8f8f2",property:"#bd93f9",selector:"#f1fa8c",operator:"#ff79c6",keyword:"#ff79c6",function:"#50fa7b",regex:"#ff79c6"}},"tokyo-night":{name:"Tokyo Night",background:"#1a1b26",text:"#a9b1d6",tokens:{comment:"#565f89",punctuation:"#89ddff",property:"#ff9e64",selector:"#9ece6a",operator:"#89ddff",keyword:"#bb9af7",function:"#7aa2f7",regex:"#b4f9f8"}},"solarized-light":{name:"Solarized Light",background:"#fdf6e3",text:"#586e75",tokens:{comment:"#93a1a1",punctuation:"#586e75",property:"#cb4b16",selector:"#2aa198",operator:"#859900",keyword:"#859900",function:"#268bd2",regex:"#2aa198"}},"catppuccin-macchiato":{name:"Catppuccin Macchiato",background:"#24273a",text:"#cad3f5",tokens:{comment:"#939ab7",punctuation:"#b8c0e0",property:"#f5a97f",selector:"#a6da95",operator:"#91d7e3",keyword:"#c6a0f6",function:"#8aadf4",regex:"#f5bde6"}},"catppuccin-mocha":{name:"Catppuccin Mocha",background:"#1e1e2e",text:"#cdd6f4",tokens:{comment:"#9399b2",punctuation:"#bac2de",property:"#fab387",selector:"#a6e3a1",operator:"#89dceb",keyword:"#cba6f7",function:"#89b4fa",regex:"#f5c2e7"}}};function om(t){let e=Ss[t.codeTheme]??Ss.none,r=e.background??t.codeBackground,n=e.text??t.bodyColor,o=Object.entries(e.tokens??{}).map(([i,a])=>`${nm[i].map(f=>`.mpdf-doc pre code .token.${f}`).join(", ")} { color: ${a};${i==="comment"?" font-style: italic;":""} }`).join(` `);return` .mpdf-doc pre { background: ${r}; border-radius: 4px; padding: 10px 12px; - margin: 0 0 ${e.paragraphSpacing}em; + margin: 0 0 ${t.paragraphSpacing}em; overflow: hidden; } .mpdf-doc pre code { font-family: 'Courier New', monospace; - font-size: ${e.codeFontSize}em; + font-size: ${t.codeFontSize}em; color: ${n}; white-space: pre-wrap; overflow-wrap: break-word; background: none; padding: 0; } - ${o}`}function tm(e){let t=e.replace(/^#([\da-f])([\da-f])([\da-f])$/i,(a,s,l,f)=>`#${s}${s}${l}${l}${f}${f}`);if(!/^#[\da-f]{6}$/i.test(t))return 1;let r=a=>a<=.04045?a/12.92:((a+.055)/1.055)**2.4,n=r(parseInt(t.slice(1,3),16)/255),o=r(parseInt(t.slice(3,5),16)/255),i=r(parseInt(t.slice(5,7),16)/255);return .2126*n+.7152*o+.0722*i}function Zu(e){return e.fontFamily==="__custom__"?e.customFontName.trim()||"inherit":e.fontFamily}function rm(e,t=!1){let r=e.headingScale,n=Zu(e),o=tm(e.tableHeaderBg)<.35?"#fff":e.headingColor;return` + ${o}`}function im(t){let e=t.replace(/^#([\da-f])([\da-f])([\da-f])$/i,(a,s,l,f)=>`#${s}${s}${l}${l}${f}${f}`);if(!/^#[\da-f]{6}$/i.test(e))return 1;let r=a=>a<=.04045?a/12.92:((a+.055)/1.055)**2.4,n=r(parseInt(e.slice(1,3),16)/255),o=r(parseInt(e.slice(3,5),16)/255),i=r(parseInt(e.slice(5,7),16)/255);return .2126*n+.7152*o+.0722*i}function Yu(t){return t.fontFamily==="__custom__"?t.customFontName.trim()||"inherit":t.fontFamily}function am(t,e=!1){let r=t.headingScale,n=Yu(t),o=im(t.tableHeaderBg)<.35?"#fff":t.headingColor;return` .mpdf-doc { font-family: ${n}; - font-size: ${e.fontSize}px; - line-height: ${e.lineHeight}; - color: ${e.bodyColor}; + font-size: ${t.fontSize}px; + line-height: ${t.lineHeight}; + color: ${t.bodyColor}; box-sizing: border-box; - ${t?"direction: rtl;":""} + ${e?"direction: rtl;":""} } .mpdf-doc *, .mpdf-doc *::before, .mpdf-doc *::after { box-sizing: border-box; } .mpdf-doc strong, .mpdf-doc b { font-weight: 700; font-style: normal; } @@ -71,86 +71,88 @@ end`},Bc=function(){for(var e=[],t=0;t