PageSourceSearch

https://www.glowday.com/_next/static/chunks/42d149cc-6ada3d2beb0d65f0.js

js glowday.com collected 2026-10-03 21:29:29 UTC 138,211 bytes, 146 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7384],{51324:function(t,e,i){let n,r,s,o,a,h,l;i.d(e,{Rq:function(){return registerStdFonts},ZP:function(){return PDFDocument}});var d=i(53465),c=i(93778),u=i(58872),f=i(4201),p=i(18097),g=i(37054);let EventEmitter=class EventEmitter{constructor(){this._listeners=Object.create(null)}on(t,e){return(this._listeners[t]||(this._listeners[t]=[])).push(e),this}once(t,e){let wrapper=(...i)=>{this.off(t,wrapper),e(...i)};return this.on(t,wrapper)}off(t,e){let i=this._listeners[t];if(i){let t=i.indexOf(e);-1!==t&&i.splice(t,1)}return this}emit(t,...e){let i=this._listeners[t];if(!i)return!1;for(let t of i.slice())t(...e);return i.length>0}};let Readable=class Readable extends EventEmitter{constructor(){super(),this._buffer=[],this._flowing=!1,this._scheduled=!1,this._finished=!1,this._endEmitted=!1}on(t,e){return super.on(t,e),"data"===t&&this.resume(),this}push(t){return null===t?this._finished=!0:this._buffer.push(t),this._schedule(),!0}resume(){return this._flowing=!0,this._schedule(),this}pause(){return this._flowing=!1,this}pipe(t){return this.on("data",e=>{!1===t.write(e)&&(this.pause(),t.once("drain",()=>this.resume()))}),this.on("end",()=>t.end()),t}_schedule(){!this._scheduled&&this._flowing&&(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1,this._drain()}))}_drain(){for(;this._flowing&&this._buffer.length>0;)this.emit("data",this._buffer.shift());this._flowing&&this._finished&&!this._endEmitted&&(this._endEmitted=!0,this.emit("end"))}async *[Symbol.asyncIterator](){let t=[],e=!1,i=null,wake=()=>{let t=i;i=null,t&&t()};for(this.on("data",e=>{t.push(e),wake()}),this.on("end",()=>{e=!0,wake()});;){for(;t.length>0;)yield t.shift();if(e)return;await new Promise(t=>{i=t})}}};let PDFAbstractReference=class PDFAbstractReference{toString(){throw Error("Must be implemented by subclasses")}};let PDFTree=class PDFTree{constructor(t={}){this._items={},this.limits="boolean"!=typeof t.limits||t.limits}add(t,e){return this._items[t]=e}get(t){return this._items[t]}toString(t=null){let e=Object.keys(this._items).sort((t,e)=>this._compareKeys(t,e)),i=["<<"];if(this.limits&&e.length>1){let n=e[0],r=e[e.length-1];i.push(`  /Limits ${PDFObject.convert([this._dataForKey(n),this._dataForKey(r)],t)}`)}for(let n of(i.push(`  /${this._keysName()} [`),e))i.push(`    ${PDFObject.convert(this._dataForKey(n),t)} ${PDFObject.convert(this._items[n],t)}`);return i.push("]"),i.push(">>"),i.join("\n")}_compareKeys(){throw Error("Must be implemented by subclasses")}_keysName(){throw Error("Must be implemented by subclasses")}_dataForKey(){throw Error("Must be implemented by subclasses")}};let SpotColor=class SpotColor{constructor(t,e,i,n,r,s){this.id="CS"+Object.keys(t.spotColors).length,this.name=e,this.values=[i,n,r,s],this.ref=t.ref(["Separation",escapeName(this.name),"DeviceCMYK",{Range:[0,1,0,1,0,1,0,1],C0:[0,0,0,0],C1:this.values.map(t=>t/100),FunctionType:2,Domain:[0,1],N:1}]),this.ref.end()}toString(){return`${this.ref.id} 0 R`}};let toBinaryString=t=>{let e="";for(let i=0;i<t.length;i+=32768){let n=Math.min(i+32768,t.length);e+=String.fromCharCode.apply(null,t.subarray(i,n))}return e},fromBinaryString=t=>{let e=new Uint8Array(t.length);for(let i=0;i<t.length;i++)e[i]=255&t.charCodeAt(i);return e},fromBase64=t=>{let e=atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return i},concat=t=>{let e=0;for(let i of t)e+=i.length;let i=new Uint8Array(e),n=0;for(let e of t)i.set(e,n),n+=e.length;return i},toUTF16BE=t=>{let e=new Uint8Array((t.length+1)*2);e[0]=254,e[1]=255;for(let i=0;i<t.length;i++){let n=t.charCodeAt(i);e[2*i+2]=n>>8,e[2*i+3]=255&n}return e},readUInt16BE=(t,e=0)=>(t[e]<<8|t[e+1])>>>0,readUInt16LE=(t,e=0)=>(t[e+1]<<8|t[e])>>>0,readUInt32BE=(t,e=0)=>16777216*t[e]+(t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0,readUInt32LE=(t,e=0)=>(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]>>>0,pad=(t,e)=>(Array(e+1).join("0")+t).slice(-e),isSafeCharCode=t=>t>127||t>32&&127!==t&&35!==t&&37!==t&&40!==t&&41!==t&&47!==t&&60!==t&&62!==t&&91!==t&&93!==t&&123!==t&&125!==t,A=/[\n\r\t\b\f()\\]/g,m={"\n":"\\n","\r":"\\r","	":"\\t","\b":"\\b","\f":"\\f","\\":"\\\\","(":"\\(",")":"\\)"},escapeName=function(t){let e="";for(let i of t){let t=i.charCodeAt(0);isSafeCharCode(t)?e+=i:e+=`#${t.toString(16).toUpperCase().padStart(2,"0")}`}return e};let PDFObject=class PDFObject{static convert(t,e=null){if("string"==typeof t)return`/${t}`;if(t instanceof String){let i,n=t,r=!1;for(let t=0,e=n.length;t<e;t++)if(n.charCodeAt(t)>127){r=!0;break}return i=r?toUTF16BE(n.valueOf()):fromBinaryString(n.valueOf()),e&&(i=e(i)),n=(n=toBinaryString(i)).replace(A,t
1=>m[t]),`(${n})`}if(t instanceof Uint8Array)return`<${(0,d.ci)(t)}>`;if(t instanceof PDFTree)return t.toString(e);if(t instanceof PDFAbstractReference||t instanceof SpotColor)return t.toString();if(t instanceof Date){let i=`D:${pad(t.getUTCFullYear(),4)}`+pad(t.getUTCMonth()+1,2)+pad(t.getUTCDate(),2)+pad(t.getUTCHours(),2)+pad(t.getUTCMinutes(),2)+pad(t.getUTCSeconds(),2)+"Z";return e&&(i=(i=toBinaryString(e(fromBinaryString(i)))).replace(A,t=>m[t])),`(${i})`}if(Array.isArray(t)){let i=[];for(let n=0;n<t.length;n++){let r=t[n];i.push(PDFObject.convert(void 0===r?null:r,e))}return`[${i.join(" ")}]`}else if("[object Object]"===({}).toString.call(t)){let i=["<<"];for(let n in t){let r=t[n];void 0!==r&&i.push(`/${n} ${PDFObject.convert(r,e)}`)}return i.push(">>"),i.join("\n")}else if("number"==typeof t)return PDFObject.number(t);else return`${t}`}static number(t){if(t>-1e21&&t<1e21)return Math.round(1e6*t)/1e6;throw Error(`unsupported number: ${t}`)}};var y={deflateSync:t=>(0,c.iZ)(t)};let PDFReference=class PDFReference extends PDFAbstractReference{constructor(t,e,i={}){super(),this.document=t,this.id=e,this.data=i,this.gen=0,this.compress=this.document.compress&&!this.data.Filter,this.uncompressedLength=0,this.buffer=[]}write(t){t instanceof Uint8Array||(t=fromBinaryString(t+"\n")),this.uncompressedLength+=t.length,null==this.data.Length&&(this.data.Length=0),this.buffer.push(t),this.data.Length+=t.length,this.compress&&(this.data.Filter="FlateDecode")}end(t){t&&this.write(t),this.finalize()}finalize(){this.offset=this.document._offset;let t=this.document._security?this.document._security.getEncryptFn(this.id,this.gen):null;this.buffer.length&&(this.buffer=concat(this.buffer),this.compress&&(this.buffer=y.deflateSync(this.buffer)),t&&(this.buffer=t(this.buffer)),this.data.Length=this.buffer.length),this.document._write(`${this.id} ${this.gen} obj`),this.document._write(PDFObject.convert(this.data,t)),this.buffer.length&&(this.document._write("stream"),this.document._write(this.buffer),this.buffer=[],this.document._write("\nendstream")),this.document._write("endobj"),this.document._refEnd(this)}toString(){return`${this.id} ${this.gen} R`}};let b=new Float32Array(1),S=new Uint32Array(b.buffer);function PDFNumber(t){let e=Math.fround(t);return e<=t?e:(b[0]=t,t<=0?S[0]+=1:S[0]-=1,b[0])}function normalizeSides(t,e,i=t=>t){return(null==t||"object"==typeof t&&0===Object.keys(t).length)&&(t=e),null==t||"object"!=typeof t?t={top:t,right:t,bottom:t,left:t}:Array.isArray(t)&&(t=2===t.length?{vertical:t[0],horizontal:t[1]}:{top:t[0],right:t[1],bottom:t[2],left:t[3]}),("vertical"in t||"horizontal"in t)&&(t={top:t.vertical,right:t.horizontal,bottom:t.vertical,left:t.horizontal}),{top:i(t.top),right:i(t.right),bottom:i(t.bottom),left:i(t.left)}}let w=1/2.54,_=1/96;function cosine(t){return 0===t?1:90===t?0:180===t?-1:270===t?0:Math.cos(t*Math.PI/180)}function sine(t){return 0===t?0:90===t?1:180===t?0:270===t?-1:Math.sin(t*Math.PI/180)}let C={top:72,left:72,bottom:72,right:72},x={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]};let PDFPage=class PDFPage{constructor(t,e){this.document=t,this._options=e,this.size=e.size||"letter",this.layout=e.layout||"portrait",this.userUnit=e.userUnit||1;let i=Array.isArray(this.size)?this.size:x[this.size.toUpperCase()];this.width=i["portrait"===this.layout?0:1],this.height=i["portrait"===this.layout?1:0],this.content=this.document.ref(),this.margins=normalizeSides(e.margin??e.margins,C,e=>t.sizeToPoint(e,0,this)),this.resources=this.document.ref({ProcSet:["PDF","Text","ImageB","ImageC","ImageI"]}),this.dictionary=this.document.ref({Type:"Page",Parent:this.document._root.data.Pages,MediaBox:[0,0,this.width,this.height],Contents:this.content,Resources:this.resources,UserUnit:this.userUnit}),this.markings=[]}get fonts(){let t=this.resources.data;return null!=t.Font?t.Font:t.Font={}}get xobjects(){let t=this.resources.data;return null!=t.XObject?t.XObject:t.XObject={}}get ext_gstates(){let t=this.resources.data;return null!=t.ExtGState?t.ExtGState:t.ExtGState={}}get patterns(){let t=this.resources.data;return null!=t.Pattern?t.Pattern:t.Pattern={}}get colorSpaces(){let t=this.resources.data;
1return t.ColorSpace||(t.ColorSpace={})}get annotations(){let t=this.dictionary.data;return null!=t.Annots?t.Annots:t.Annots=[]}get structParentTreeKey(){let t=this.dictionary.data;return null!=t.StructParents?t.StructParents:t.StructParents=this.document.createStructParentTreeNextKey()}get contentWidth(){return this.width-this.margins.left-this.margins.right}get contentHeight(){return this.height-this.margins.top-this.margins.bottom}maxY(){return this.height-this.margins.bottom}write(t){return this.content.write(t)}_setTabOrder(){!this.dictionary.Tabs&&this.document.hasMarkInfoDictionary()&&(this.dictionary.data.Tabs="S")}end(){for(let t of(this._setTabOrder(),this.dictionary.end(),this.resources.data.ColorSpace=this.resources.data.ColorSpace||{},Object.values(this.document.spotColors)))this.resources.data.ColorSpace[t.id]=t;return this.resources.end(),this.content.end()}};let PDFNameTree=class PDFNameTree extends PDFTree{_compareKeys(t,e){return t.localeCompare(e)}_keysName(){return"Names"}_dataForKey(t){return new String(t)}};function abytes(t,...e){if(!(t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error("Uint8Array expected of length "+e+", got length="+t.length)}function aexists(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function clean(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function createView(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function rotr(t,e){return t<<32-e|t>>>e}function rotl(t,e){return t<<e|t>>>32-e>>>0}function toBytes(t){return"string"==typeof t&&(t=function(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}(t)),abytes(t),t}new Uint8Array(new Uint32Array([287454020]).buffer)[0],"function"==typeof Uint8Array.from([]).toHex&&Uint8Array.fromHex,Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));let Hash=class Hash{};function createHasher(t){let hashC=e=>t().update(toBytes(e)).digest(),e=t();return hashC.outputLen=e.outputLen,hashC.blockLen=e.blockLen,hashC.create=()=>t(),hashC}let HashMD=class HashMD extends Hash{constructor(t,e,i,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=createView(this.buffer)}update(t){aexists(this),abytes(t=toBytes(t));let{view:e,buffer:i,blockLen:n}=this,r=t.length;for(let s=0;s<r;){let o=Math.min(n-this.pos,r-s);if(o===n){let e=createView(t);for(;n<=r-s;s+=n)this.process(e,s);continue}i.set(t.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){aexists(this),function(t,e){abytes(t);let i=e.outputLen;if(t.length<i)throw Error("digestInto() expects output buffer of length at least "+i)}(t,this),this.finished=!0;let{buffer:e,view:i,blockLen:n,isLE:r}=this,{pos:s}=this;e[s++]=128,clean(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(i,0),s=0);for(let t=s;t<n;t++)e[t]=0;!function(t,e,i,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,i,n);let r=BigInt(32),s=BigInt(4294967295),o=Number(i>>r&s),a=Number(i&s),h=n?4:0,l=n?0:4;t.setUint32(e+h,o,n),t.setUint32(e+l,a,n)}(i,n-8,BigInt(8*this.length),r),this.process(i,0);let o=createView(t),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let h=a/4,l=this.get();if(h>l.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<h;t++)o.setUint32(4*t,l[t],r)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let i=t.slice(0,e);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:i,length:n,finished:r,destroyed:s,pos:o}=this;return t.destroyed=s,t.finished=r,t.length=n,t.pos=o,n%e&&t.buffer.set(i),t}clone(){return this._cloneInto()}};let P=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),F=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),D=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),T=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),k=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),E=new Uint32Array(80);let SHA1=class SHA1 extends HashMD{constructor(){super(64,20,8,!1),this.A=0|k[0],this.B=0|k[1],this.C=0|k[2],this.D=0|k[3],this.E=0|k[4]}get(){let{A:t,B:e,C:i,D:n,E:r}=this;return[t,e,i,n,r]}set(t,e,i,n,r){this.A=0|t,this.B=0|e,this.C=0|i,this.D=0|n,this.E=0|r}process(t,e){for(let i=0;i<16;i++,e+=4)E[i]=t.getUint32(e,!1);for(let t=16;t<80;t++)E[t]=rotl(E[t-3]^E[t-8]^E[t-14]^E[t-16],1);let{A:i,B:n,C:r,D:s,E:o}=this;for(let t=0;t<80;t++){var a,h,l,d;let e,c;t<20?(e=(a=n)&r^~a&s,c=1518500249):t<40?(e=n^r^s,c=1859775393):t<60?(e=(h=n)&(l=r)^h&(d=s)^l&d,c=2400959708):(e=n^r^s,c=3395469782);let u=rotl(i,5)+e+o+c+E[t]|0;o=s,s=r,r=rotl(n,30),n=i,i=u}i=i+this.A|0,n=n+this.B|0,r=r+this.C|0,s=s+this.D|0,o=o+this.E|0,this.set(i,n,r,s,o)}roundClean(){clean(E)}destroy(){this.set(0,0,0,0,0),clean(this.buffer)}};createHasher(()=>new SHA1);let M=Array.from({length:64},(t,e)=>
1Math.floor(4294967296*Math.abs(Math.sin(e+1)))),B=k.slice(0,4),v=new Uint32Array(16);let MD5=class MD5 extends HashMD{constructor(){super(64,16,8,!0),this.A=0|B[0],this.B=0|B[1],this.C=0|B[2],this.D=0|B[3]}get(){let{A:t,B:e,C:i,D:n}=this;return[t,e,i,n]}set(t,e,i,n){this.A=0|t,this.B=0|e,this.C=0|i,this.D=0|n}process(t,e){for(let i=0;i<16;i++,e+=4)v[i]=t.getUint32(e,!0);let{A:i,B:n,C:r,D:s}=this;for(let t=0;t<64;t++){var o,a;let e,h,l;t<16?(e=(o=n)&r^~o&s,h=t,l=[7,12,17,22]):t<32?(e=(a=s)&n^~a&r,h=(5*t+1)%16,l=[5,9,14,20]):t<48?(e=n^r^s,h=(3*t+5)%16,l=[4,11,16,23]):(e=r^(n|~s),h=7*t%16,l=[6,10,15,21]),e=e+i+M[t]+v[h],i=s,s=r,r=n,n+=rotl(e,l[t%4])}i=i+this.A|0,n=n+this.B|0,r=r+this.C|0,s=s+this.D|0,this.set(i,n,r,s)}roundClean(){clean(v)}destroy(){this.set(0,0,0,0),clean(this.buffer)}};let R=createHasher(()=>new MD5),I=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),O=Uint8Array.from(Array(16).fill(0).map((t,e)=>e)),U=O.map(t=>(9*t+5)%16),H=(()=>{let t=[[O],[U]];for(let e=0;e<4;e++)for(let i of t)i.push(i[e].map(t=>I[t]));return t})(),L=H[0],z=H[1],W=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),j=L.map((t,e)=>t.map(t=>W[e][t])),$=z.map((t,e)=>t.map(t=>W[e][t])),N=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),G=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function ripemd_f(t,e,i,n){return 0===t?e^i^n:1===t?e&i|~e&n:2===t?(e|~i)^n:3===t?e&n|i&~n:e^(i|~n)}let K=new Uint32Array(16);let RIPEMD160=class RIPEMD160 extends HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:i,h3:n,h4:r}=this;return[t,e,i,n,r]}set(t,e,i,n,r){this.h0=0|t,this.h1=0|e,this.h2=0|i,this.h3=0|n,this.h4=0|r}process(t,e){for(let i=0;i<16;i++,e+=4)K[i]=t.getUint32(e,!0);let i=0|this.h0,n=i,r=0|this.h1,s=r,o=0|this.h2,a=o,h=0|this.h3,l=h,d=0|this.h4,c=d;for(let t=0;t<5;t++){let e=4-t,u=N[t],f=G[t],p=L[t],g=z[t],A=j[t],m=$[t];for(let e=0;e<16;e++){let n=rotl(i+ripemd_f(t,r,o,h)+K[p[e]]+u,A[e])+d|0;i=d,d=h,h=0|rotl(o,10),o=r,r=n}for(let t=0;t<16;t++){let i=rotl(n+ripemd_f(e,s,a,l)+K[g[t]]+f,m[t])+c|0;n=c,c=l,l=0|rotl(a,10),a=s,s=i}}this.set(this.h1+o+l|0,this.h2+h+c|0,this.h3+d+n|0,this.h4+i+s|0,this.h0+r+a|0)}roundClean(){clean(K)}destroy(){this.destroyed=!0,clean(this.buffer),this.set(0,0,0,0,0)}};function md5Hash(t){return R.create().update(t).digest()}createHasher(()=>new RIPEMD160);let Y=BigInt(4294967296-1),q=BigInt(32),shrSH=(t,e,i)=>t>>>i,shrSL=(t,e,i)=>t<<32-i|e>>>i,rotrSH=(t,e,i)=>t>>>i|e<<32-i,rotrSL=(t,e,i)=>t<<32-i|e>>>i,rotrBH=(t,e,i)=>t<<64-i|e>>>i-32,rotrBL=(t,e,i)=>t>>>i-32|e<<64-i;function add(t,e,i,n){let r=(e>>>0)+(n>>>0);return{h:t+i+(r/4294967296|0)|0,l:0|r}}let add3L=(t,e,i)=>(t>>>0)+(e>>>0)+(i>>>0),add3H=(t,e,i,n)=>e+i+n+(t/4294967296|0)|0,add4L=(t,e,i,n)=>(t>>>0)+(e>>>0)+(i>>>0)+(n>>>0),add4H=(t,e,i,n,r)=>e+i+n+r+(t/4294967296|0)|0,add5L=(t,e,i,n,r)=>(t>>>0)+(e>>>0)+(i>>>0)+(n>>>0)+(r>>>0),add5H=(t,e,i,n,r,s)=>e+i+n+r+s+(t/4294967296|0)|0,V=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Q=new Uint32Array(64);let SHA256=class SHA256 extends HashMD{constructor(t=32){super(64,t,8,!1),this.A=0|P[0],this.B=0|P[1],this.C=0|P[2],this.D=0|P[3],this.E=0|P[4],this.F=0|P[5],this.G=0|P[6],this.H=0|P[7]}get(){let{A:t,B:e,C:i,D:n,E:r,F:s,G:o,H:a}=this;return[t,e,i,n,r,s,o,a]}set(t,e,i,n,r,s,o,a){this.A=0|t,this.B=0|e,this.C=0|i,this.D=0|n,this.E=0|r,this.F=0|s,this.G=0|o,this.H=0|a}process(t,e){for(let i=0;i<16;i++,e+=4)Q[i]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=Q[t-15],i=Q[t-2],n=rotr(e,7)^rotr(e,18)^e>>>
13,r=rotr(i,17)^rotr(i,19)^i>>>10;Q[t]=r+Q[t-7]+n+Q[t-16]|0}let{A:i,B:n,C:r,D:s,E:o,F:a,G:h,H:l}=this;for(let t=0;t<64;t++){var d,c,u,f;let e=rotr(o,6)^rotr(o,11)^rotr(o,25),p=l+e+((d=o)&a^~d&h)+V[t]+Q[t]|0,g=rotr(i,2)^rotr(i,13)^rotr(i,22),A=g+((c=i)&(u=n)^c&(f=r)^u&f)|0;l=h,h=a,a=o,o=s+p|0,s=r,r=n,n=i,i=p+A|0}i=i+this.A|0,n=n+this.B|0,r=r+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,h=h+this.G|0,l=l+this.H|0,this.set(i,n,r,s,o,a,h,l)}roundClean(){clean(Q)}destroy(){this.set(0,0,0,0,0,0,0,0),clean(this.buffer)}};let SHA224=class SHA224 extends SHA256{constructor(){super(28),this.A=0|F[0],this.B=0|F[1],this.C=0|F[2],this.D=0|F[3],this.E=0|F[4],this.F=0|F[5],this.G=0|F[6],this.H=0|F[7]}};let X=function(t,e=!1){let i=t.length,n=new Uint32Array(i),r=new Uint32Array(i);for(let s=0;s<i;s++){let{h:i,l:o}=function(t,e=!1){return e?{h:Number(t&Y),l:Number(t>>q&Y)}:{h:0|Number(t>>q&Y),l:0|Number(t&Y)}}(t[s],e);[n[s],r[s]]=[i,o]}return[n,r]}(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
15771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Z=X[0],J=X[1],tt=new Uint32Array(80),te=new Uint32Array(80);let SHA512=class SHA512 extends HashMD{constructor(t=64){super(128,t,16,!1),this.Ah=0|T[0],this.Al=0|T[1],this.Bh=0|T[2],this.Bl=0|T[3],this.Ch=0|T[4],this.Cl=0|T[5],this.Dh=0|T[6],this.Dl=0|T[7],this.Eh=0|T[8],this.El=0|T[9],this.Fh=0|T[10],this.Fl=0|T[11],this.Gh=0|T[12],this.Gl=0|T[13],this.Hh=0|T[14],this.Hl=0|T[15]}get(){let{Ah:t,Al:e,Bh:i,Bl:n,Ch:r,Cl:s,Dh:o,Dl:a,Eh:h,El:l,Fh:d,Fl:c,Gh:u,Gl:f,Hh:p,Hl:g}=this;return[t,e,i,n,r,s,o,a,h,l,d,c,u,f,p,g]}set(t,e,i,n,r,s,o,a,h,l,d,c,u,f,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|i,this.Bl=0|n,this.Ch=0|r,this.Cl=0|s,this.Dh=0|o,this.Dl=0|a,this.Eh=0|h,this.El=0|l,this.Fh=0|d,this.Fl=0|c,this.Gh=0|u,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(t,e){for(let i=0;i<16;i++,e+=4)tt[i]=t.getUint32(e),te[i]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|tt[t-15],i=0|te[t-15],n=rotrSH(e,i,1)^rotrSH(e,i,8)^shrSH(e,i,7),r=rotrSL(e,i,1)^rotrSL(e,i,8)^shrSL(e,i,7),s=0|tt[t-2],o=0|te[t-2],a=rotrSH(s,o,19)^rotrBH(s,o,61)^shrSH(s,o,6),h=rotrSL(s,o,19)^rotrBL(s,o,61)^shrSL(s,o,6),l=add4L(r,h,te[t-7],te[t-16]),d=add4H(l,n,a,tt[t-7],tt[t-16]);tt[t]=0|d,te[t]=0|l}let{Ah:i,Al:n,Bh:r,Bl:s,Ch:o,Cl:a,Dh:h,Dl:l,Eh:d,El:c,Fh:u,Fl:f,Gh:p,Gl:g,Hh:A,Hl:m}=this;for(let t=0;t<80;t++){let e=rotrSH(d,c,14)^rotrSH(d,c,18)^rotrBH(d,c,41),y=rotrSL(d,c,14)^rotrSL(d,c,18)^rotrBL(d,c,41),b=d&u^~d&p,S=c&f^~c&g,w=add5L(m,y,S,J[t],te[t]),_=add5H(w,A,e,b,Z[t],tt[t]),C=0|w,x=rotrSH(i,n,28)^rotrBH(i,n,34)^rotrBH(i,n,39),P=rotrSL(i,n,28)^rotrBL(i,n,34)^rotrBL(i,n,39),F=i&r^i&o^r&o,D=n&s^n&a^s&a;A=0|p,m=0|g,p=0|u,g=0|f,u=0|d,f=0|c,({h:d,l:c}=add(0|h,0|l,0|_,0|C)),h=0|o,l=0|a,o=0|r,a=0|s,r=0|i,s=0|n;let T=add3L(C,P,D);i=add3H(T,_,x,F),n=0|T}({h:i,l:n}=add(0|this.Ah,0|this.Al,0|i,0|n)),({h:r,l:s}=add(0|this.Bh,0|this.Bl,0|r,0|s)),({h:o,l:a}=add(0|this.Ch,0|this.Cl,0|o,0|a)),({h:h,l:l}=add(0|this.Dh,0|this.Dl,0|h,0|l)),({h:d,l:c}=add(0|this.Eh,0|this.El,0|d,0|c)),({h:u,l:f}=add(0|this.Fh,0|this.Fl,0|u,0|f)),({h:p,l:g}=add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:A,l:m}=add(0|this.Hh,0|this.Hl,0|A,0|m)),this.set(i,n,r,s,o,a,h,l,d,c,u,f,p,g,A,m)}roundClean(){clean(tt,te)}destroy(){clean(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};let SHA384=class SHA384 extends SHA512{constructor(){super(48),this.Ah=0|D[0],this.Al=0|D[1],this.Bh=0|D[2],this.Bl=0|D[3],this.Ch=0|D[4],this.Cl=0|D[5],this.Dh=0|D[6],this.Dl=0|D[7],this.Eh=0|D[8],this.El=0|D[9],this.Fh=0|D[10],this.Fl=0|D[11],this.Gh=0|D[12],this.Gl=0|D[13],this.Hh=0|D[14],this.Hl=0|D[15]}};let ti=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),tn=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);let SHA512_224=class SHA512_224 extends SHA512{constructor(){super(28),this.Ah=0|ti[0],this.Al=0|ti[1],this.Bh=0|ti[2],this.Bl=0|ti[3],this.Ch=0|ti[4],this.Cl=0|ti[5],this.Dh=0|ti[6],this.Dl=0|ti[7],this.Eh=0|ti[8],this.El=0|ti[9],this.Fh=0|ti[10],this.Fl=0|ti[11],this.Gh=0|ti[12],this.Gl=0|ti[13],this.Hh=0|ti[14],this.Hl=0|ti[15]}};let SHA512_256=class SHA512_256 extends SHA512{constructor(){super(32),this.Ah=0|tn[0],this.Al=0|tn[1],this.Bh=0|tn[2],this.Bl=0|tn[3],this.Ch=0|tn[4],this.Cl=0|tn[5],this.Dh=0|tn[6],this.Dl=0|tn[7
1],this.Eh=0|tn[8],this.El=0|tn[9],this.Fh=0|tn[10],this.Fl=0|tn[11],this.Gh=0|tn[12],this.Gl=0|tn[13],this.Hh=0|tn[14],this.Hl=0|tn[15]}};let tr=createHasher(()=>new SHA256);function aesCbcEncrypt(t,e,i,n=!0){return(0,u.$z)(e,i,{disablePadding:!n}).encrypt(t)}function rc4(t,e){let i=new Uint8Array(256);for(let t=0;t<256;t++)i[t]=t;let n=0;for(let t=0;t<256;t++)n=n+i[t]+e[t%e.length]&255,[i[t],i[n]]=[i[n],i[t]];let r=new Uint8Array(t.length);for(let e=0,n=0,s=0;s<t.length;s++)n=n+i[e=e+1&255]&255,[i[e],i[n]]=[i[n],i[e]],r[s]=t[s]^i[i[e]+i[n]&255];return r}function inRange(t,e){if(t<e[0])return!1;let i=0,n=e.length/2;for(;i<=n;){let r=Math.floor((i+n)/2),s=2*r;if(t>=e[s]&&t<=e[s+1])return!0;t>e[s+1]?i=r+1:n=r-1}return!1}createHasher(()=>new SHA224),createHasher(()=>new SHA512),createHasher(()=>new SHA384),createHasher(()=>new SHA512_256),createHasher(()=>new SHA512_224);let ts=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,12
10137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037],isUnassignedCodePoint=t=>inRange(t,ts),to=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279],ta=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288],th=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],tl=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],td=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109],isProhibitedCharacter=t=>inRange(t,ta)||inRange(t,td)||inRange(t,th)||inRange(t,tl),tc=[1470,1470,
11472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276],isBidirectionalRAL=t=>inRange(t,tc),tu=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109],isBidirectionalL=t=>inRange(t,tu),mapping2space=t=>inRange(t,ta),mapping2nothing=t=>inRange(t,to),getCodePoint=t=>t.codePointAt(0),first=t=>t[0],last=t=>t[t.length-1];function toCodePoints(t){let e=[],i=t.length;for(let n=0;n<i;n+=1){let r=t.charCodeAt(n);if(r>=55296&&r<=56319&&i>n+1){let i=t.charCodeAt(n+1);if(i>=56320&&i<=57343){e.push((r-55296)*1024+i-56320+65536),n+=1;continue}}e.push(r)}return e}let PDFSecurity=class PDFSecurity{static generateFileID(t={}){let e=`${t.CreationDate.getTime()}
2`;for(let i in t)t.hasOwnProperty(i)&&(e+=`${i}: ${t[i].valueOf()}
3`);return md5Hash(e)}static generateRandomWordArray(t){return function(t){let e=new Uint8Array(t);return globalThis.crypto.getRandomValues(e),e}(t)}static create(t,e={}){return e.ownerPassword||e.userPassword?new PDFSecurity(t,e):null}constructor(t,e={}){if(!e.ownerPassword&&!e.userPassword)throw Error("None of owner password and user password is defined.");this.document=t,this._setupEncryption(e)}_setupEncryption(t){switch(t.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}let e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,t);break;case 5:this._setupEncryptionV5(e,t)}this.dictionary=this.document.ref(e)}_setupEncryptionV1V2V4(t,e,i){var n;let r,s,o;switch(t){case 1:r=2,this.keyBits=40,s=function(t={}){let e=-64;return t.printing&&(e|=4),t.modifying&&(e|=8),t.copying&&(e|=16),t.annotating&&(e|=32),e}(i.permissions);break;case 2:r=3,this.keyBits=128,s=getPermissionsR3(i.permissions);break;case 4:r=4,this.keyBits=128,s=getPermissionsR3(i.permissions)}let a=processPasswordR2R3R4(i.userPassword),h=i.ownerPassword?processPasswordR2R3R4(i.ownerPassword):a,l=function(t,e,
3i,n){let r=n,s=t>=3?51:1;for(let t=0;t<s;t++)r=md5Hash(r);let o=e/8,a=r.slice(0,o),h=i;s=t>=3?20:1;for(let t=0;t<s;t++){let e=new Uint8Array(o);for(let i=0;i<o;i++)e[i]=a[i]^t;h=rc4(h,e)}return h}(r,this.keyBits,a,h);this.encryptionKey=function(t,e,i,n,r,s){let o=new Uint8Array([255&s,s>>8&255,s>>16&255,s>>24&255]),a=(0,d.eV)(n,r,o,new Uint8Array(i)),h=t>=3?51:1,l=e/8;for(let t=0;t<h;t++)a=(a=md5Hash(a)).slice(0,l);return a}(r,this.keyBits,this.document._id,a,l,s),o=2===r?(n=this.encryptionKey,rc4(processPasswordR2R3R4(),n)):function(t,e){let i=e.slice(),n=md5Hash((0,d.eV)(processPasswordR2R3R4(),new Uint8Array(t)));for(let t=0;t<20;t++){let r=new Uint8Array(i.length);for(let n=0;n<i.length;n++)r[n]=e[n]^t;n=rc4(n,r)}let r=new Uint8Array(32);return r.set(n),r}(this.document._id,this.encryptionKey),e.V=t,t>=2&&(e.Length=this.keyBits),4===t&&(e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}},e.StmF="StdCF",e.StrF="StdCF"),e.R=r,e.O=l,e.U=o,e.P=s}_setupEncryptionV5(t,e){this.keyBits=256;let i=getPermissionsR3(e.permissions),n=processPasswordR5(e.userPassword),r=e.ownerPassword?processPasswordR5(e.ownerPassword):n;this.encryptionKey=(0,PDFSecurity.generateRandomWordArray)(32);let s=function(t,e){let i=e(8),n=e(8),r=tr((0,d.eV)(t,i));return(0,d.eV)(r,i,n)}(n,PDFSecurity.generateRandomWordArray),o=s.slice(40,48),a=function(t,e,i){let n=tr((0,d.eV)(t,e)),r=new Uint8Array(16);return aesCbcEncrypt(i,n,r,!1)}(n,o,this.encryptionKey),h=function(t,e,i){let n=i(8),r=i(8),s=tr((0,d.eV)(t,n,e));return(0,d.eV)(s,n,r)}(r,s,PDFSecurity.generateRandomWordArray),l=h.slice(40,48),c=function(t,e,i,n){let r=tr((0,d.eV)(t,e,i)),s=new Uint8Array(16);return aesCbcEncrypt(n,r,s,!1)}(r,l,s,this.encryptionKey),f=function(t,e,i){let n=new Uint8Array(16);n[0]=255&t,n[1]=t>>8&255,n[2]=t>>16&255,n[3]=t>>24&255,n[4]=255,n[5]=255,n[6]=255,n[7]=255,n[8]=84,n[9]=97,n[10]=100,n[11]=98;let r=i(4);return n.set(r,12),(0,u.tU)(e,{disablePadding:!0}).encrypt(n)}(i,this.encryptionKey,PDFSecurity.generateRandomWordArray);t.V=5,t.Length=this.keyBits,t.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}},t.StmF="StdCF",t.StrF="StdCF",t.R=5,t.O=h,t.OE=c,t.U=s,t.UE=a,t.P=i,t.Perms=f}getEncryptFn(t,e){let i,n;if(this.version<5){let n=new Uint8Array([255&t,t>>8&255,t>>16&255,255&e,e>>8&255]);i=(0,d.eV)(this.encryptionKey,n)}if(1===this.version||2===this.version){let t=md5Hash(i),e=Math.min(16,this.keyBits/8+5);return t=t.slice(0,e),e=>rc4(e,t)}if(4===this.version){let t=new Uint8Array([115,65,108,84]);n=md5Hash((0,d.eV)(i,t))}else n=this.encryptionKey;let r=PDFSecurity.generateRandomWordArray(16);return t=>{let e=aesCbcEncrypt(t,n,r,!0);return(0,d.eV)(r,e)}}end(){this.dictionary.end()}};function getPermissionsR3(t={}){let e=-3904;return"lowResolution"===t.printing&&(e|=4),"highResolution"===t.printing&&(e|=2052),t.modifying&&(e|=8),t.copying&&(e|=16),t.annotating&&(e|=32),t.fillingForms&&(e|=256),t.contentAccessibility&&(e|=512),t.documentAssembly&&(e|=1024),e}function processPasswordR2R3R4(t=""){let e=new Uint8Array(32),i=t.length,n=0;for(;n<i&&n<32;){let i=t.charCodeAt(n);if(i>255)throw Error("Password contains one or more invalid characters.");e[n]=i,n++}for(;n<32;)e[n]=tf[n-i],n++;return e}function processPasswordR5(t=""){t=unescape(encodeURIComponent(function(t,e={}){if("string"!=typeof t)throw TypeError("Expected string.");if(0===t.length)return"";let i=toCodePoints(t).map(t=>mapping2space(t)?32:t).filter(t=>!mapping2nothing(t)),n=String.fromCodePoint.apply(null,i).normalize("NFKC"),r=toCodePoints(n),s=r.some(isProhibitedCharacter);if(s)throw Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned){let t=r.some(isUnassignedCodePoint);if(t)throw Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}let o=r.some(isBidirectionalRAL),a=r.some(isBidirectionalL);if(o&&a)throw Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");let h=isBidirectionalRAL(getCodePoint(first(n))),l=isBidirectionalRAL(getCodePoint(last(n)));if(o&&!(h&&l))throw Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}(t)));let e=Math.min(127,t.length),i=new Uint8Array(e);for(let n=0;n<e;n++)i[n]=t.charCodeAt(n);return i}let tf=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122],{number:tp}=PDFObject,tg=class{constructor(t){this.doc=t,this.stops=[],this.embedded=!1,this.transform=[1,0,0,1,0,0]}stop(t,e,i){if(null==i&&(i=1),e=this.doc._normalizeColor(e),0===this.stops.length){if(3===e.length)this._colorSpace
3="DeviceRGB";else if(4===e.length)this._colorSpace="DeviceCMYK";else if(1===e.length)this._colorSpace="DeviceGray";else throw Error("Unknown color space")}else if("DeviceRGB"===this._colorSpace&&3!==e.length||"DeviceCMYK"===this._colorSpace&&4!==e.length||"DeviceGray"===this._colorSpace&&1!==e.length)throw Error("All gradient stops must use the same color space");return i=Math.max(0,Math.min(1,i)),this.stops.push([t,e,i]),this}setTransform(t,e,i,n,r,s){return this.transform=[t,e,i,n,r,s],this}embed(t){let e;let i=this.stops.length;if(0===i)return;this.embedded=!0,this.matrix=t;let n=this.stops[i-1];n[0]<1&&this.stops.push([1,n[1],n[2]]);let r=[],s=[],o=[];for(let t=0;t<i-1;t++)s.push(0,1),t+2!==i&&r.push(this.stops[t+1][0]),e=this.doc.ref({FunctionType:2,Domain:[0,1],C0:this.stops[t+0][1],C1:this.stops[t+1][1],N:1}),o.push(e),e.end();1===i?e=o[0]:(e=this.doc.ref({FunctionType:3,Domain:[0,1],Functions:o,Bounds:r,Encode:s})).end(),this.id=`Sh${++this.doc._gradCount}`;let a=this.shader(e);a.end();let h=this.doc.ref({Type:"Pattern",PatternType:2,Shading:a,Matrix:this.matrix.map(tp)});if(h.end(),this.stops.some(t=>t[2]<1)){let t=this.opacityGradient();for(let e of(t._colorSpace="DeviceGray",this.stops))t.stop(e[0],[e[2]]);t=t.embed(this.matrix);let e=[0,0,this.doc.page.width,this.doc.page.height],i=this.doc.ref({Type:"XObject",Subtype:"Form",FormType:1,BBox:e,Group:{Type:"Group",S:"Transparency",CS:"DeviceGray"},Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],Pattern:{Sh1:t}}});i.write("/Pattern cs /Sh1 scn"),i.end(`${e.join(" ")} re f`);let n=this.doc.ref({Type:"ExtGState",SMask:{Type:"Mask",S:"Luminosity",G:i}});n.end();let r=this.doc.ref({Type:"Pattern",PatternType:1,PaintType:1,TilingType:2,BBox:e,XStep:e[2],YStep:e[3],Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],Pattern:{Sh1:h},ExtGState:{Gs1:n}}});r.write("/Gs1 gs /Pattern cs /Sh1 scn"),r.end(`${e.join(" ")} re f`),this.doc.page.patterns[this.id]=r}else this.doc.page.patterns[this.id]=h;return h}apply(t){let[e,i,n,r,s,o]=this.doc._ctm,[a,h,l,d,c,u]=this.transform,f=[e*a+n*h,i*a+r*h,e*l+n*d,i*l+r*d,e*c+n*u+s,i*c+r*u+o];this.embedded&&f.join(" ")===this.matrix.join(" ")||this.embed(f),this.doc._setColorSpace("Pattern",t);let p=t?"SCN":"scn";return this.doc.addContent(`/${this.id} ${p}`)}},tA=class PDFLinearGradient extends tg{constructor(t,e,i,n,r){super(t),this.x1=e,this.y1=i,this.x2=n,this.y2=r}shader(t){return this.doc.ref({ShadingType:2,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.x2,this.y2],Function:t,Extend:[!0,!0]})}opacityGradient(){return new PDFLinearGradient(this.doc,this.x1,this.y1,this.x2,this.y2)}},tm=class PDFRadialGradient extends tg{constructor(t,e,i,n,r,s,o){super(t),this.doc=t,this.x1=e,this.y1=i,this.r1=n,this.x2=r,this.y2=s,this.r2=o}shader(t){return this.doc.ref({ShadingType:3,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.r1,this.x2,this.y2,this.r2],Function:t,Extend:[!0,!0]})}opacityGradient(){return new PDFRadialGradient(this.doc,this.x1,this.y1,this.r1,this.x2,this.y2,this.r2)}},ty=["DeviceCMYK","DeviceRGB"],tb=class{constructor(t,e,i,n,r){this.doc=t,this.bBox=e,this.xStep=i,this.yStep=n,this.stream=r}createPattern(){let t=this.doc.ref();t.end();let[e,i,n,r,s,o]=this.doc._ctm,[a,h,l,d,c,u]=[1,0,0,1,0,0],f=this.doc.ref({Type:"Pattern",PatternType:1,PaintType:2,TilingType:2,BBox:this.bBox,XStep:this.xStep,YStep:this.yStep,Matrix:[e*a+n*h,i*a+r*h,e*l+n*d,i*l+r*d,e*c+n*u+s,i*c+r*u+o].map(t=>+t.toFixed(5)),Resources:t});return f.end(this.stream),f}embedPatternColorSpaces(){ty.forEach(t=>{let e=this.getPatternColorSpaceId(t);if(this.doc.page.colorSpaces[e])return;let i=this.doc.ref(["Pattern",t]);i.end(),this.doc.page.colorSpaces[e]=i})}getPatternColorSpaceId(t){return`CsP${t}`}embed(){this.id||(this.doc._patternCount=this.doc._patternCount+1,this.id="P"+this.doc._patternCount,this.pattern=this.createPattern()),this.doc.page.patterns[this.id]||(this.doc.page.patterns[this.id]=this.pattern)}apply(t,e){this.embedPatternColorSpaces(),this.embed();let i=this.doc._normalizeColor(e);if(!i)throw Error(`invalid pattern color. (value: ${e})`);let n=this.getPatternColorSpaceId(this.doc._getColorSpace(i));this.doc._setColorSpace(n,t);let r=t?"SCN":"scn";return this.doc.addContent(`${i.join(" ")} /${this.id} ${r}`)}},{PDFGradient:tS,PDFLinearGradient:tw,PDFRadialGradient:t_}={PDFGradient:tg,PDFLinearGradient:tA,PDFRadialGradient:tm},{PDFTilingPattern:tC}={PDFTilingPattern:tb};var tx={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
3ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};n=r=s=o=a=h=0;let tP={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},isWsp=function(t){let e=t.codePointAt(0);return 32===e||9===e||13===e||10===e},isDigit=function(t){let e=t.codePointAt(0);return null!=e&&48<=e&&e<=57},readNumber=function(t,e){let i=e,n="",r="none";for(;i<t.length;i+=1){let e=t[i];if("+"===e||"-"===e){if("none"===r){r="sign",n+=e;continue}if("e"===r){r="exponent_sign",n+=e;continue}}if(isDigit(e)){if("none"===r||"sign"===r||"whole"===r){r="whole",n+=e;continue}if("decimal_point"===r||"decimal"===r){r="decimal",n+=e;continue}if("e"===r||"exponent_sign"===r||"exponent"===r){r="exponent",n+=e;continue}}if("."===e&&("none"===r||"sign"===r||"whole"===r)){r="decimal_point",n+=e;continue}if(("E"===e||"e"===e)&&("whole"===r||"decimal_point"===r||"decimal"===r)){r="e",n+=e;continue}break}let s=Number.parseFloat(n);return Number.isNaN(s)?[e,null]:[i-1,s]},parse=function(t){let e=[],i=null,n=[],r=0,s=!1,o=!1;for(let a=0;a<t.length;a+=1){let h=t.charAt(a);if(isWsp(h))continue;if(s&&","===h){if(o)break;o=!0;continue}if(h in tP){if(o)return e;if(null==i){if("M"!==h&&"m"!==h)return e}else if(0!==n.length)return e;n=[],r=tP[i=h],s=!1,0===r&&e.push({command:i,args:n});continue}if(null==i)break;let l=a,d=null;if("A"===i||"a"===i){let e=n.length;(0===e||1===e)&&"+"!==h&&"-"!==h&&([l,d]=readNumber(t,a)),(2===e||5===e||6===e)&&([l,d]=readNumber(t,a)),(3===e||4===e)&&("0"===h&&(d=0),"1"===h&&(d=1))}else[l,d]=readNumber(t,a);if(null==d)break;n.push(d),s=!0,o=!1,a=l,n.length===r&&(e.push({command:i,args:n}),"M"===i&&(i="L"),"m"===i&&(i="l"),n=[])}return e},apply=function(t,e){n=r=s=o=a=h=0;for(let i=0;i<t.length;i++){let n=t[i];"function"==typeof tF[n.command]&&tF[n.command](e,n.args)}},tF={M:(t,e)=>(n=e[0],r=e[1],s=o=null,a=n,h=r,t.moveTo(n,r)),m:(t,e)=>(n+=e[0],r+=e[1],s=o=null,a=n,h=r,t.moveTo(n,r)),C:(t,e)=>(n=e[4],r=e[5],s=e[2],o=e[3],t.bezierCurveTo(...e)),c:(t,e)=>(t.bezierCurveTo(e[0]+n,e[1]+r,e[2]+n,e[3]+r,e[4]+n,e[5]+r),s=n+e[2],o=r+e[3],n+=e[4],r+=e[5]),S:(t,e)=>(null===s&&(s=n,o=r),t.bezierCurveTo(n-(s-n),r-(o-r),e[0],e[1],e[2],e[3]),s=e[0],o=e[1],n=e[2],r=e[3]),s:(t,e)=>(null===s&&(s=n,o=r),t.bezierCurveTo(n-(s-n),r-(o-r),n+e[0],r+e[1],n+e[2],r+e[3]),s=n+e[0],o=r+e[1],n+=e[2],r+=e[3]),Q:(t,e)=>(s=e[0],o=e[1],n=e[2],r=e[3],t.quadraticCurveTo(e[0],e[1],n,r)),q:(t,e)=>(t.quadraticCurveTo(e[0]+n,e[1]+r,e[2]+n,e[3]+r),s=n+e[0],o=r+e[1],n+=e[2],r+=e[3]),T:(t,e)=>(null===s?(s=n,o=r):(s=n-(s-n),o=r-(o-r)),t.quadraticCurveTo(s,o,e[0],e[1]),s=n-(s-n),o=r-(o-r),n=e[0],r=e[1]),t:(t,e)=>(null===s?(s=n,o=r):(s=n-(s-n),o=r-(o-r)),t.quadraticCurveTo(s,o,n+e[0],r+e[1]),n+=e[0],r+=e[1]),A:(t,e)=>
3(solveArc(t,n,r,e),n=e[5],r=e[6]),a:(t,e)=>(e[5]+=n,e[6]+=r,solveArc(t,n,r,e),n=e[5],r=e[6]),L:(t,e)=>(n=e[0],r=e[1],s=o=null,t.lineTo(n,r)),l:(t,e)=>(n+=e[0],r+=e[1],s=o=null,t.lineTo(n,r)),H:(t,e)=>(n=e[0],s=o=null,t.lineTo(n,r)),h:(t,e)=>(n+=e[0],s=o=null,t.lineTo(n,r)),V:(t,e)=>(r=e[0],s=o=null,t.lineTo(n,r)),v:(t,e)=>(r+=e[0],s=o=null,t.lineTo(n,r)),Z:t=>(t.closePath(),n=a,r=h),z:t=>(t.closePath(),n=a,r=h)},solveArc=function(t,e,i,n){let[r,s,o,a,h,l,d]=n,c=arcToSegments(l,d,r,s,a,h,o,e,i);for(let e of c){let i=segmentToBezier(...e);t.bezierCurveTo(...i)}},arcToSegments=function(t,e,i,n,r,a,h,l,d){let c=h*(Math.PI/180),u=Math.sin(c),f=Math.cos(c);i=Math.abs(i),n=Math.abs(n);let p=(s=f*(l-t)*.5+u*(d-e)*.5)*s/(i*i)+(o=f*(d-e)*.5-u*(l-t)*.5)*o/(n*n);p>1&&(i*=p=Math.sqrt(p),n*=p);let g=f/i,A=u/i,m=-u/n,y=f/n,b=g*l+A*d,S=m*l+y*d,w=g*t+A*e,_=m*t+y*e,C=1/((w-b)*(w-b)+(_-S)*(_-S))-.25;C<0&&(C=0);let x=Math.sqrt(C);a===r&&(x=-x);let P=.5*(b+w)-x*(_-S),F=.5*(S+_)+x*(w-b),D=Math.atan2(S-F,b-P),T=Math.atan2(_-F,w-P),k=T-D;k<0&&1===a?k+=2*Math.PI:k>0&&0===a&&(k-=2*Math.PI);let E=Math.ceil(Math.abs(k/(.5*Math.PI+.001))),M=[];for(let t=0;t<E;t++){let e=D+t*k/E,r=D+(t+1)*k/E;M[t]=[P,F,e,r,i,n,u,f]}return M},segmentToBezier=function(t,e,i,n,r,s,o,a){let h=a*r,l=-o*s,d=o*r,c=a*s,u=.5*(n-i),f=8/3*Math.sin(.5*u)*Math.sin(.5*u)/Math.sin(u),p=t+Math.cos(i)-f*Math.sin(i),g=e+Math.sin(i)+f*Math.cos(i),A=t+Math.cos(n),m=e+Math.sin(n),y=A+f*Math.sin(n),b=m-f*Math.cos(n);return[h*p+l*g,d*p+c*g,h*y+l*b,d*y+c*b,h*A+l*m,d*A+c*m]};let SVGPath=class SVGPath{static apply(t,e){let i=parse(e);apply(i,t)}};let{number:tD}=PDFObject,tT=4*((Math.sqrt(2)-1)/3),unsupported=t=>{throw Error(`Cannot read '${t}': file paths are not supported outside of Node. Pass a Uint8Array, ArrayBuffer or a data URL instead.`)},tk=new Map,getTimestamp=(t,e,i)=>{if(void 0===t)return i;if(!(t instanceof Date)||Number.isNaN(t.getTime()))throw TypeError(`Expected options.${e} to be a valid Date`);return t.getTime()};var tE={readFileSync:t=>tk.has(t)?tk.get(t).data:unsupported(t),statSync(t){if(tk.has(t)){let{birthtime:e,ctime:i}=tk.get(t);return{birthtime:new Date(e),ctime:new Date(i)}}return unsupported(t)}};let tM={402:131,8211:150,8212:151,8216:145,8217:146,8218:130,8220:147,8221:148,8222:132,8224:134,8225:135,8226:149,8230:133,8364:128,8240:137,8249:139,8250:155,710:136,8482:153,338:140,339:156,732:152,352:138,353:154,376:159,381:142,382:158},tB=`\
4.notdef       .notdef        .notdef        .notdef
5.notdef       .notdef        .notdef        .notdef
6.notdef       .notdef        .notdef        .notdef
7.notdef       .notdef        .notdef        .notdef
8.notdef       .notdef        .notdef        .notdef
9.notdef       .notdef        .notdef        .notdef
10.notdef       .notdef        .notdef        .notdef
11.notdef       .notdef        .notdef        .notdef
12  
13space         exclam         quotedbl       numbersign
14dollar        percent        ampersand      quotesingle
15parenleft     parenright     asterisk       plus
16comma         hyphen         period         slash
17zero          one            two            three
18four          five           six            seven
19eight         nine           colon          semicolon
20less          equal          greater        question
21  
22at            A              B              C
23D             E              F              G
24H             I              J              K
25L             M              N              O
26P             Q              R              S
27T             U              V              W
28X             Y              Z              bracketleft
29backslash     bracketright   asciicircum    underscore
30  
31grave         a              b              c
32d             e              f              g
33h             i              j              k
34l             m              n              o
35p             q              r              s
36t             u              v              w
37x             y              z              braceleft
38bar           braceright     asciitilde     .notdef
39  
40Euro          .notdef        quotesinglbase florin
41quotedblbase  ellipsis       dagger         daggerdbl
42circumflex    perthousand    Scaron         guilsinglleft
43OE            .notdef        Zcaron         .notdef
44.notdef       quoteleft      quoteright     quotedblleft
45quotedblright bullet         endash         emdash
46tilde         trademark      scaron         guilsinglright
47oe            .notdef        zcaron         ydieresis
48  
49space         exclamdown     cent           sterling
50currency      yen            brokenbar      section
51dieresis      copyright      ordfeminine    guillemotleft
52logicalnot    hyphen         registered     macron
53degree        plusminus      twosuperior    threesuperior
54acute         mu             paragraph      periodcentered
55cedilla       onesuperior    ordmasculine   guillemotright
56onequarter    onehalf        threequarters  questiondown
57  
58Agrave        Aacute         Acircumflex    Atilde
59Adieresis     Aring          AE             Ccedilla
60Egrave        Eacute         Ecircumflex    Edieresis
61Igrave        Iacute         Icircumflex    Idieresis
62Eth           Ntilde         Ograve         Oacute
63Ocircumflex   Otilde         Odieresis      multiply
64Oslash        Ugrave         Uacute         Ucircumflex
65Udieresis     Yacute         Thorn          germandbls
66  
67agrave        aacute         acircumflex    atilde
68adieresis     aring          ae             ccedilla
69egrave        eacute         ecircumflex    edieresis
70igrave        iacute         icircumflex    idieresis
71eth           ntilde         ograve         oacute
72ocircumflex   otilde         odieresis      divide
73oslash        ugrave         uacute         ucircumflex
74udieresis     yacute         thorn          ydieresis\
75`.split(/\s+/);let AFMFont=class AFMFont{constructor(t){this.name=t.name,this.bbox=t.bbox.slice(),this.ascender=t.ascender,this.descender=t.descender,this.xHeight=t.xHeight,this.capHeight=t.capHeight,this.lineGap=this.bbox[3]-this.bbox[1]-(this.ascender-this.descender);let e=t.glyphNames.split(" ");this.glyphWidths=Object.fromEntries(e.map((e,i)=>[e,t.glyphWidths[i]])),this.kernPairs={};for(let i=0;i<t.kernPairs.length;i+=2){let n=t.kernPairs[i],r=0;for(let s of t.kernPairs[i+1]){r+=s;let t=Math.floor(r/e.length),i=r%e.length;this.kernPairs[`${e[t]}\0${e[i]}`]=n}}}encodeText(t){let e=[];for(let i=0,n=t.length;i<n;i++){let n=t.charCodeAt(i);n=tM[n]||n,e.push(n.toString(16))}return e}glyphsForString(t){let e=[];for(let i=0,n=t.length;i<n;i++){let n=t.charCodeAt(i);e.push(this.characterToGlyph(n))}return e}characterToGlyph(t){return tB[tM[t]||t]||".notdef"}widthOfGlyph(t){return this.glyphWidths[t]||0}getKernPair(t,e){return this.kernPairs[t+"\x00"+e]||0}advancesForGlyphs(t){let e=[];for(let i=0;i<t.length;i++){let n=t[i],r=t[i+1];e.push(this.widthOfGlyph(n)+this.getKernPair(n,r))}return e}};let PDFFont=class PDFFont{constructor(){}encode(){throw Error("Must be implemented by subclasses")}widthOfString(){throw Error("Must be implemented by subclasses")}ref(){return null!=this.dictionary?this.dictionary:this.dictionary=this.document.ref()}finalize(){this.embedded||null==this.dictionary||(this.embed(),this.embedded=!0)}embed(){throw Error("Must be implemented by subclasses")}lineHeight(t,e=!1){let i=e?this.lineGap:0;return(this.ascender+i-this.descender)/1e3*t}};let StandardFont=class StandardFont extends PDFFont{constructor(t,e,i){super(),this.document=t,this.name=e.name,this.id=i,this.font=new AFMFont(e),{ascender:this.ascender,descender:this.descender,bbox:this.bbox,lineGap:this.lineGap,xHeight:this.xHeight,capHeight:this.capHeight}=this.font}embed(){return this.dictionary.data={Type:"Font",BaseFont:this.name,Subtype:"Type1",Encoding:"WinAnsiEncoding"},this.dictionary.end()}encode(t){let e=this.font.encodeText(t),i=this.font.glyphsForString(`${t}`),n=this.font.advancesForGlyphs(i),r=[];for(let t=0;t<i.length;t++){let e=i[t];r.push({xAdvance:n[t],yAdvance:0,xOffset:0,yOffset:0,advanceWidth:this.font.widthOfGlyph(e)})}return[e,r]}widthOfString(t,e){let i=this.font.glyphsForString(`${t}`),n=this.font.advancesForGlyphs(i),r=0;for(let t of n)r+=t;return r*(e/1e3)}};let toHex=function(t){return`0000${t.toString(16)}`.slice(-4)};let EmbeddedFont=class EmbeddedFont extends PDFFont{constructor(t,e,i){super(),this.document=t,this.font=e,this.id=i,this.subset=this.font.createSubset(),this.unicode=[[0]],this.widths=[this.font.getGlyph(0).advanceWidth],this.name=this.font.postscriptName,this.scale=1e3/this.font.unitsPerEm,this.ascender=this.font.ascent*this.scale,this.descender=this.font.descent*this.scale,this.xHeight=this.font.xHeight*this.scale,this.capHeight=this.font.capHeight*this.scale,this.lineGap=this.font.lineGap*this.scale,this.bbox=this.font.bbox,!1!==t.options.fontLayoutCache&&(this.layoutCache=Object.create(null))}layoutRun(t,e){let i=this.font.layout(t,e);for(let t=0;t<i.positions.length;t++){let e=i.positions[t];for(let t in e)e[t]*=this.scale;e.advanceWidth=i.glyphs[t].advanceWidth*this.scale}return i}
75layoutCached(t){let e;if(!this.layoutCache)return this.layoutRun(t);if(e=this.layoutCache[t])return e;let i=this.layoutRun(t);return this.layoutCache[t]=i,i}layout(t,e,i){if(e)return this.layoutRun(t,e);let n=i?null:[],r=i?null:[],s=0,o=0,a=0;for(;a<=t.length;)if(a===t.length&&o<a||[" ","	"].includes(t.charAt(a))){let e=this.layoutCached(t.slice(o,++a));i||(n=n.concat(e.glyphs),r=r.concat(e.positions)),s+=e.advanceWidth,o=a}else a++;return{glyphs:n,positions:r,advanceWidth:s}}encode(t,e){let{glyphs:i,positions:n}=this.layout(t,e),r=[];for(let t=0;t<i.length;t++){let e=i[t],n=this.subset.includeGlyph(e.id);r.push(`0000${n.toString(16)}`.slice(-4)),null==this.widths[n]&&(this.widths[n]=e.advanceWidth*this.scale),null==this.unicode[n]&&(this.unicode[n]=e.codePoints)}return[r,n]}widthOfString(t,e,i){let n=this.layout(t,i,!0).advanceWidth;return n*(e/1e3)}embed(){let t=null!=this.subset.cff,e=this.document.ref();t&&(e.data.Subtype="CIDFontType0C"),e.end(this.subset.encode());let i=((null!=this.font["OS/2"]?this.font["OS/2"].sFamilyClass:void 0)||0)>>8,n=0;this.font.post.isFixedPitch&&(n|=1),1<=i&&i<=7&&(n|=2),n|=4,10===i&&(n|=8),this.font.head.macStyle.italic&&(n|=64);let r=[1,2,3,4,5,6].map(t=>String.fromCharCode((this.id.charCodeAt(t)||73)+17)).join(""),s=r+"+"+this.font.postscriptName?.replaceAll(" ","_"),{bbox:o}=this.font,a=this.document.ref({Type:"FontDescriptor",FontName:s,Flags:n,FontBBox:[o.minX*this.scale,o.minY*this.scale,o.maxX*this.scale,o.maxY*this.scale],ItalicAngle:this.font.italicAngle,Ascent:this.ascender,Descent:this.descender,CapHeight:(this.font.capHeight||this.font.ascent)*this.scale,XHeight:(this.font.xHeight||0)*this.scale,StemV:0});if(t?a.data.FontFile3=e:a.data.FontFile2=e,this.document.subset&&1===this.document.subset){let t=this.widths.length-1,e=new Uint8Array(Math.ceil((t+1)/8));for(let i=0;i<=t;i++)null!=this.widths[i]&&(e[Math.floor(i/8)]|=128>>i%8);let i=this.document.ref();i.write(e),i.end(),a.data.CIDSet=i}a.end();let h={Type:"Font",Subtype:"CIDFontType0",BaseFont:s,CIDSystemInfo:{Registry:new String("Adobe"),Ordering:new String("Identity"),Supplement:0},FontDescriptor:a,W:[0,this.widths]};t||(h.Subtype="CIDFontType2",h.CIDToGIDMap="Identity");let l=this.document.ref(h);return l.end(),this.dictionary.data={Type:"Font",Subtype:"Type0",BaseFont:s,Encoding:"Identity-H",DescendantFonts:[l],ToUnicode:this.toUnicodeCmap()},this.dictionary.end()}toUnicodeCmap(){let t=this.document.ref(),e=[];for(let t of this.unicode){let i=[];for(let e of t)e>65535&&(e-=65536,i.push(toHex(e>>>10&1023|55296)),e=56320|1023&e),i.push(toHex(e));e.push(`<${i.join(" ")}>`)}let i=Math.ceil(e.length/256),n=[];for(let t=0;t<i;t++){let i=256*t,r=Math.min((t+1)*256,e.length);n.push(`<${toHex(i)}> <${toHex(r-1)}> [${e.slice(i,r).join(" ")}]`)}return t.end(`\
76/CIDInit /ProcSet findresource begin
7712 dict begin
78begincmap
79/CIDSystemInfo <<
80  /Registry (Adobe)
81  /Ordering (UCS)
82  /Supplement 0
83>> def
84/CMapName /Adobe-Identity-UCS def
85/CMapType 2 def
861 begincodespacerange
87<0000><ffff>
88endcodespacerange
89${n.length} beginbfrange
90${n.join("\n")}
91endbfrange
92endcmap
93CMapName currentdict /CMap defineresource pop
94end
95end\
96`),t}};let tv=new Set(["Courier","Courier-Bold","Courier-BoldOblique","Courier-Oblique","Helvetica","Helvetica-Bold","Helvetica-BoldOblique","Helvetica-Oblique","Symbol","Times-Bold","Times-BoldItalic","Times-Italic","Times-Roman","ZapfDingbats"]),validateFontData=(t,e)=>{if(null==t||"object"!=typeof t||!tv.has(t.name)||null!=e&&t.name!==e)throw TypeError("Invalid standard font data.")},tR=new Map,isStandardFont=t=>tv.has(t),registerStdFonts=(...t)=>{for(let e of t)validateFontData(e),tR.set(e.name,e)},getStandardFont=t=>{if(!tv.has(t))return null;let e=tR.get(t);if(null==e)throw Error(`Standard font "${t}" is not registered. Call registerStdFonts() before using it.`);if("function"!=typeof e)return e;let i=e();return validateFontData(i,t),tR.set(t,i),i};let PDFFontFactory=class PDFFontFactory{static open(t,e,i,n){let r;if("string"==typeof e){if(isStandardFont(e))return new StandardFont(t,getStandardFont(e),n);e=tE.readFileSync(e)}if(e instanceof Uint8Array?r=(0,f.Ue)(e,i):e instanceof ArrayBuffer?r=(0,f.Ue)(new Uint8Array(e),i):"function"==typeof e?.layout&&(r=e),null==r)throw Error("Not a supported font format or standard PDF font.");return new EmbeddedFont(t,r,n)}};let isEqualFont=(t,e)=>t.font._tables?.head?.checkSumAdjustment===e.font._tables?.head?.checkSumAdjustment&&JSON.stringify(t.font._tables?.name?.records)===JSON.stringify(e.font._tables?.name?.records);
96let LineWrapper=class LineWrapper extends EventEmitter{constructor(t,e){super(),this.document=t,this.horizontalScaling=e.horizontalScaling||100,this.indent=(e.indent||0)*this.horizontalScaling/100,this.indentAllLines=e.indentAllLines||!1,this.characterSpacing=(e.characterSpacing||0)*this.horizontalScaling/100,this.wordSpacing=(0===e.wordSpacing)*this.horizontalScaling/100,this.columns=e.columns||1,this.columnGap=(null!=e.columnGap?e.columnGap:18)*this.horizontalScaling/100,this.lineWidth=(e.width*this.horizontalScaling/100-this.columnGap*(this.columns-1))/this.columns,this.spaceLeft=this.lineWidth,this.startX=this.document.x,this.startY=this.document.y,this.column=1,this.ellipsis=e.ellipsis,this.continuedX=0,this.indentApplied=!1,this.features=e.features,null!=e.height?(this.height=e.height,this.maxY=PDFNumber(this.startY+e.height)):this.maxY=PDFNumber(this.document.page.maxY()),this.on("firstLine",t=>{let e=this.continuedX,i=e||this.indent;if((e||!this.indentApplied)&&(this.document.x+=i,this.lineWidth-=i,this.indentApplied=!0),t.indentAllLines){e&&this.once("line",()=>{this.document.x-=e,this.lineWidth+=e});return}this.once("line",()=>{this.document.x-=i,this.lineWidth+=i,this.indentApplied=!1,t.continued&&!this.continuedX&&(this.continuedX=this.indent),t.continued||(this.continuedX=0)})}),this.on("lastLine",t=>{let{align:e}=t;"justify"===e&&(t.align="left"),this.lastLine=!0,this.once("line",()=>(this.document.y+=t.paragraphGap||0,t.align=e,this.lastLine=!1))})}wordWidth(t){return PDFNumber(this.document.widthOfString(t,this)+this.characterSpacing+this.wordSpacing)}canFit(t,e){return"\xad"!=t[t.length-1]?e<=this.spaceLeft:e+this.wordWidth("-")<=this.spaceLeft}eachWord(t,e){let i;let n=new p.Z(t),r=null,s=Object.create(null);for(;i=n.nextBreak();){var o,a,h;let n=t.slice((null!=r?r.position:void 0)||0,i.position),l=null!=s[n]?s[n]:s[n]=this.wordWidth(n);if(l>this.lineWidth+this.continuedX){let t=r,s={};for(;n.length;){l>this.spaceLeft?(a=Math.ceil(this.spaceLeft/(l/n.length)),h=(l=this.wordWidth(n.slice(0,a)))<=this.spaceLeft&&a<n.length):a=n.length;let r=l>this.spaceLeft&&a>0;for(;r||h;)r?r=(l=this.wordWidth(n.slice(0,--a)))>this.spaceLeft&&a>0:(r=(l=this.wordWidth(n.slice(0,++a)))>this.spaceLeft&&a>0,h=l<=this.spaceLeft&&a<n.length);if(0===a&&this.spaceLeft===this.lineWidth&&(a=1),s.required=i.required||a<n.length,o=e(n.slice(0,a),l,s,t),t={required:!1},n=n.slice(a),l=this.wordWidth(n),!1===o)break}}else o=e(n,l,i,r);if(!1===o)break;r=i}}wrap(t,e){let{document:i}=this;this.horizontalScaling=e.horizontalScaling||100,null!=e.indent&&(this.indent=e.indent*this.horizontalScaling/100),null!=e.characterSpacing&&(this.characterSpacing=e.characterSpacing*this.horizontalScaling/100),null!=e.wordSpacing&&(this.wordSpacing=e.wordSpacing*this.horizontalScaling/100),null!=e.ellipsis&&(this.ellipsis=e.ellipsis);let n=i.y+i.currentLineHeight(!0);(i.y>this.maxY||n>this.maxY)&&this.nextSection();let r="",s=0,o=0,a=0,h=i.y,emitLine=()=>(e.textWidth=s+this.wordSpacing*(o-1),e.wordCount=o,e.lineWidth=this.lineWidth,h=i.y,this.emit("line",r,e,this),a++);this.emit("sectionStart",e,this),this.eachWord(t,(t,n,a,h)=>{if((null==h||h.required)&&(this.emit("firstLine",e,this),this.spaceLeft=this.lineWidth),this.canFit(t,n)&&(r+=t,s+=n,o++),!a.required&&this.canFit(t,n))return this.spaceLeft-=n;{let h=i.currentLineHeight(!0);if(null!=this.height&&this.ellipsis&&PDFNumber(i.y+2*h)>this.maxY&&this.column>=this.columns){for(!0===this.ellipsis&&(this.ellipsis="…"),r=r.replace(/\s+$/,""),s=this.wordWidth(r+this.ellipsis);r&&s>this.lineWidth;)r=r.slice(0,-1).replace(/\s+$/,""),s=this.wordWidth(r+this.ellipsis);s<=this.lineWidth&&(r+=this.ellipsis),s=this.wordWidth(r)}if(a.required&&(n>this.spaceLeft&&(emitLine(),r=t,s=n,o=1),this.emit("lastLine",e,this)),"\xad"==r[r.length-1]&&(r=r.slice(0,-1)+"-",this.spaceLeft-=this.wordWidth("-")),emitLine(),PDFNumber(i.y+h)>this.maxY){this.emit("sectionEnd",e,this);let t=this.nextSection();if(!t)return o=0,r="",!1;this.emit("sectionStart",e,this)}return a.required?(this.spaceLeft=this.lineWidth,r="",s=0,o=0):(this.spaceLeft=this.lineWidth-n,r=t,s=n,o=1)}}),o>
960&&(this.emit("lastLine",e,this),emitLine()),this.emit("sectionEnd",e,this),!0===e.continued?(a>1&&(this.continuedX=0),this.continuedX+=e.textWidth||0,i.y=h):i.x=this.startX}nextSection(t){if(++this.column>this.columns){if(null!=this.height)return!1;this.document.continueOnNewPage(),this.column=1,this.startY=this.document.page.margins.top,this.maxY=this.document.page.maxY(),this.indentAllLines?this.indentApplied&&(this.document.x+=this.continuedX||this.indent):this.document.x=this.startX,this.document._fillColor&&this.document.fillColor(...this.document._fillColor),this.emit("pageBreak",t,this)}else this.document.x+=this.lineWidth+this.columnGap,this.document.y=this.startY,this.emit("columnBreak",t,this);return!0}};let{number:tI}=PDFObject,parseExifOrientation=t=>{if(!t||t.length<20)return null;let e=2;for(;e<t.length-4;){for(;e<t.length&&255!==t[e];)e++;if(e>=t.length-4)break;let i=readUInt16BE(t,e);if(e+=2,65498===i)break;if(i>=65488&&i<=65497||65281===i)continue;if(e+2>t.length)break;let n=readUInt16BE(t,e);if(65505===i&&e+8<=t.length){let i=toBinaryString(t.subarray(e+2,e+8));if("Exif\x00\x00"===i){let i=e+8;if(i+8>t.length)return null;let n=toBinaryString(t.subarray(i,i+2)),r="II"===n;if(!r&&"MM"!==n)return null;let s=r?e=>readUInt16LE(t,e):e=>readUInt16BE(t,e),o=r?e=>readUInt32LE(t,e):e=>readUInt32BE(t,e);if(42!==s(i+2))return null;let a=i+o(i+4);if(a+2>t.length)return null;let h=s(a);for(let e=0;e<h;e++){let i=a+2+12*e;if(i+12>t.length)break;if(274===s(i)){let t=s(i+8);return t>=1&&t<=8?t:null}}break}}e+=n}return null},tO=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],tU={1:"DeviceGray",3:"DeviceRGB",4:"DeviceCMYK"};let JPEG=class JPEG{constructor(t,e){let i;if(this.data=t,this.label=e,65496!==readUInt16BE(this.data,0))throw"SOI not found in JPEG";this.orientation=parseExifOrientation(this.data)||1;let n=2;for(;n<this.data.length;){for(;n<this.data.length&&255!==this.data[n];)n++;if(n>=this.data.length||(i=readUInt16BE(this.data,n),n+=2,tO.includes(i)))break;n+=readUInt16BE(this.data,n)}if(!tO.includes(i))throw"Invalid JPEG.";n+=2,this.bits=this.data[n++],this.height=readUInt16BE(this.data,n),n+=2,this.width=readUInt16BE(this.data,n),n+=2;let r=this.data[n];this.colorSpace=tU[r],this.obj=null}embed(t){if(!this.obj)return this.obj=t.ref({Type:"XObject",Subtype:"Image",BitsPerComponent:this.bits,Width:this.width,Height:this.height,ColorSpace:this.colorSpace,Filter:"DCTDecode"}),"DeviceCMYK"===this.colorSpace&&(this.obj.data.Decode=[1,0,1,0,1,0,1,0]),this.obj.end(this.data),this.data=null}};let PNGImage=class PNGImage{constructor(t,e){this.label=e,this.image=new g.Z(t),this.width=this.image.width,this.height=this.image.height,this.imgData=this.image.imgData,this.obj=null}embed(t){if(this.document=t,this.obj)return;let{image:e,height:i,width:n}=this,r=e.hasAlphaChannel,s=1===e.interlaceMethod,o=this.obj=t.ref({Type:"XObject",Subtype:"Image",BitsPerComponent:r?8:e.bits,Width:n,Height:i,Filter:"FlateDecode"});if(!r){let i=t.ref({Predictor:s?1:15,Colors:e.colors,BitsPerComponent:e.bits,Columns:n});o.data.DecodeParms=i,i.end()}
96if(0===e.palette.length)o.data.ColorSpace=e.colorSpace;else{let i=t.ref();i.end(new Uint8Array(e.palette)),o.data.ColorSpace=["Indexed","DeviceRGB",e.palette.length/3-1,i]}if(null!=e.transparency.grayscale){let t=e.transparency.grayscale;o.data.Mask=[t,t]}else if(e.transparency.rgb){let{rgb:t}=e.transparency,i=[];for(let e of t)i.push(e,e);o.data.Mask=i}else if(e.transparency.indexed)return this.loadIndexedAlphaChannel();else if(r)return this.splitAlphaChannel();if(s)return this.decodeData();this.finalize()}finalize(){if(this.alphaChannel){let t=this.document.ref({Type:"XObject",Subtype:"Image",Height:this.height,Width:this.width,BitsPerComponent:8,Filter:"FlateDecode",ColorSpace:"DeviceGray",Decode:[0,1]});t.end(this.alphaChannel),this.obj.data.SMask=t}return this.obj.end(this.imgData),this.image=null,this.imgData=null}splitAlphaChannel(){return this.image.decodePixels(t=>{let e,i;let n=this.image.colors,r=this.width*this.height,s=new Uint8Array(r*n),o=new Uint8Array(r),a=i=e=0,h=t.length,l=16===this.image.bits?1:0;for(;a<h;){for(let e=0;e<n;e++)s[i++]=t[a++],a+=l;o[e++]=t[a++],a+=l}return this.imgData=y.deflateSync(s),this.alphaChannel=y.deflateSync(o),this.finalize()})}loadIndexedAlphaChannel(){let t=this.image.transparency.indexed,e=1===this.image.interlaceMethod;return this.image.decodePixels(i=>{let n=new Uint8Array(this.width*this.height),r=0;for(let e=0,s=i.length;e<s;e++)n[r++]=t[i[e]];return e&&(this.imgData=y.deflateSync(i)),this.alphaChannel=y.deflateSync(n),this.finalize()})}decodeData(){this.image.decodePixels(t=>{this.imgData=y.deflateSync(t),this.finalize()})}};let PDFImage=class PDFImage{static open(t,e){let i;if(t instanceof Uint8Array)i=t;else if(t instanceof ArrayBuffer)i=new Uint8Array(t);else{let e=/^data:.+?;base64,(.*)$/.exec(t);if(e)i=fromBase64(e[1]);else if(!(i=tE.readFileSync(t)))return}if(255===i[0]&&216===i[1])return new JPEG(i,e);if(137===i[0]&&80===i[1]&&78===i[2]&&71===i[3])return new PNGImage(i,e);throw Error("Unknown image format.")}};let PDFAnnotationReference=class PDFAnnotationReference{constructor(t){this.annotationRef=t}};let tH={top:0,left:0,zoom:0,fit:!0,pageNumber:null,expanded:!1};let PDFOutline=class PDFOutline{constructor(t,e,i,n,r=tH){if(this.document=t,this.options=r,this.outlineData={},null!==n){let t=n.data.MediaBox[2],e=n.data.MediaBox[3],i=e-(r.top||0),s=t-(r.left||0),o=r.zoom||0;this.outlineData.Dest=r.fit?[n,"Fit"]:[n,"XYZ",s,i,o]}null!==e&&(this.outlineData.Parent=e),null!==i&&(this.outlineData.Title=new String(i)),this.dictionary=this.document.ref(this.outlineData),this.children=[]}addItem(t,e=tH){let i=this.document._root.data.Pages.data.Kids,n=null!=e.pageNumber?i[e.pageNumber]:this.document.page.dictionary,r=new PDFOutline(this.document,this.dictionary,t,n,e);return this.children.push(r),r}endOutline(){if(this.children.length>0){this.options.expanded&&(this.outlineData.Count=this.children.length);let t=this.children[0],e=this.children[this.children.length-1];this.outlineData.First=t.dictionary,this.outlineData.Last=e.dictionary;for(let t=0,e=this.children.length;t<e;t++){let e=this.children[t];t>0&&(e.outlineData.Prev=this.children[t-1].dictionary),t<this.children.length-1&&(e.outlineData.Next=this.children[t+1].dictionary),e.endOutline()}}return this.dictionary.end()}};let PDFStructureContent=class PDFStructureContent{constructor(t,e){this.refs=[{pageRef:t,mcid:e}]}push(t){t.refs.forEach(t=>this.refs.push(t))}};let PDFStructureElement=class PDFStructureElement{constructor(t,e,i={},n=null){this.document=t,this._attached=!1,this._ended=!1,this._flushed=!1,this.dictionary=t.ref({S:e});let r=this.dictionary.data;(Array.isArray(i)||this._isValidChild(i))&&(n=i,i={}),i.title&&(r.T=new String(i.title)),i.lang&&(r.Lang=new String(i.lang)),i.alt&&(r.Alt=new String(i.alt)),i.expanded&&(r.E=new String(i.expanded)),i.actual&&(r.ActualText=new String(i.actual));let s=Array.isArray(i.bbox)&&4===i.bbox.length,o="string"==typeof i.placement;if(s||o){let e={O:"Layout"};if(e.Placement=o?i.placement:"Block",s){let n=t.page.height;e.BBox=[i.bbox[0],n-i.bbox[3],i.bbox[2],n-i.bbox[1]]}r.A=e}i.scope&&(r.A={...r.A||{},O:"Table",Scope:i.scope}
96),this._children=[],n&&(Array.isArray(n)||(n=[n]),n.forEach(t=>this.add(t)),this.end())}add(t){if(this._ended)throw Error("Cannot add child to already-ended structure element");if(!this._isValidChild(t))throw Error("Invalid structure element child");return t instanceof PDFStructureElement&&(t.setParent(this.dictionary),this._attached&&t.setAttached()),t instanceof PDFStructureContent&&this._addContentToParentTree(t),t instanceof PDFAnnotationReference&&this._addAnnotationToParentTree(t.annotationRef),"function"==typeof t&&this._attached&&(t=this._contentForClosure(t)),this._children.push(t),this}_addContentToParentTree(t){t.refs.forEach(({pageRef:t,mcid:e})=>{let i=this.document.getStructParentTree().get(t.data.StructParents);i[e]=this.dictionary})}_addAnnotationToParentTree(t){let e=this.document.createStructParentTreeNextKey();t.data.StructParent=e;let i=this.document.getStructParentTree();i.add(e,this.dictionary)}setParent(t){if(this.dictionary.data.P)throw Error("Structure element added to more than one parent");this.dictionary.data.P=t,this._flush()}setAttached(){this._attached||(this._children.forEach((t,e)=>{t instanceof PDFStructureElement&&t.setAttached(),"function"==typeof t&&(this._children[e]=this._contentForClosure(t))}),this._attached=!0,this._flush())}end(){this._ended||(this._children.filter(t=>t instanceof PDFStructureElement).forEach(t=>t.end()),this._ended=!0,this._flush())}_isValidChild(t){return t instanceof PDFStructureElement||t instanceof PDFStructureContent||t instanceof PDFAnnotationReference||"function"==typeof t}_contentForClosure(t){let e=this.document.markStructureContent(this.dictionary.data.S),i=this.document._currentStructureElement;this.document._currentStructureElement=this;let n=this._ended;return this._ended=!1,t(),this._ended=n,this.document._currentStructureElement=i,this.document.endMarkedContent(),this._addContentToParentTree(e),e}_isFlushable(){return!!this.dictionary.data.P&&!!this._ended&&this._children.every(t=>"function"!=typeof t&&(!(t instanceof PDFStructureElement)||t._isFlushable()))}_flush(){!this._flushed&&this._isFlushable()&&(this.dictionary.data.K=[],this._children.forEach(t=>this._flushChild(t)),this.dictionary.end(),this._children=[],this.dictionary.data.K=null,this._flushed=!0)}_flushChild(t){if(t instanceof PDFStructureElement&&this.dictionary.data.K.push(t.dictionary),t instanceof PDFStructureContent&&t.refs.forEach(({pageRef:t,mcid:e})=>{this.dictionary.data.Pg||(this.dictionary.data.Pg=t),this.dictionary.data.Pg===t?this.dictionary.data.K.push(e):this.dictionary.data.K.push({Type:"MCR",Pg:t,MCID:e})}),t instanceof PDFAnnotationReference){let e=this.document.page.dictionary,i={Type:"OBJR",Obj:t.annotationRef,Pg:e};this.dictionary.data.K.push(i)}}};let PDFNumberTree=class PDFNumberTree extends PDFTree{_compareKeys(t,e){return parseInt(t)-parseInt(e)}_keysName(){return"Nums"}_dataForKey(t){return parseInt(t)}};let tL={readOnly:1,required:2,noExport:4,multiline:4096,password:8192,toggleToOffButton:16384,radioButton:32768,pushButton:65536,combo:131072,edit:262144,sort:524288,multiSelect:2097152,noSpell:4194304},tz={left:0,center:1,right:2},tW={value:"V",defaultValue:"DV"},tj={zip:"0",zipPlus4:"1",zip4:"1",phone:"2",ssn:"3"},t$={number:{nDec:0,sepComma:!1,negStyle:"MinusBlack",currency:"",currencyPrepend:!0},percent:{nDec:0,sepComma:!1}},tN=new i.U(i(26965)).href;var tG={initPDFA(t){"-"===t.charAt(t.length-3)?(this.subset_conformance=t.charAt(t.length-1).toUpperCase(),this.subset=parseInt(t.charAt(t.length-2))):(this.subset_conformance="B",this.subset=parseInt(t.charAt(t.length-1)))},endSubset(){this._addPdfaMetadata(),this._addColorOutputIntent()},_addColorOutputIntent(){l||(l=tE.readFileSync(tN));let t=this.ref({Length:l.length,N:3});t.write(l),t.end();let e=this.ref({Type:"OutputIntent",S:"GTS_PDFA1",Info:new String("sRGB IEC61966-2.1"),OutputConditionIdentifier:new String("sRGB IEC61966-2.1"),DestOutputProfile:t});e.end(),this._root.data.OutputIntents=[e]},_getPdfaid(){return`
97        <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" rdf:about="">
98            <pdfaid:part>${this.subset}</pdfaid:part>
99            <pdfaid:conformance>${this.subset_conformance}</pdfaid:conformance>
100        </rdf:Description>
101        `},_addPdfaMetadata(){this.appendXML(this._getPdfaid())}},tK={initPDFUA(){this.subset=1},endSubset(){this._addPdfuaMetadata()},_addPdfuaMetadata(){this.appendXML(this._getPdfuaid())},_getPdfuaid(){return`
102        <rdf:Description xmlns:pdfuaid="http://www.aiim.org/pdfua/ns/id/" rdf:about="">
103            <pdfuaid:part>${this.subset}</pdfuaid:part>
104        </rdf:Description>
105        `}};let tY=["height","minHeight","maxHeight"],tq=["width","minWidth","maxWidth"];function memoize(t,e){let i=new Map;return function(...n){let r=n[0];return!i.has(r)&&(i.set(r,t(...n)),i.size>e&&i.delete(i.keys().next())),i.get(r)}}function isObject(t){return t&&"object"==typeof t&&!Array.isArray(t)}function deepMerge(t,...e){if(!isObject(t))return t;for(let i of(t=deepClone(t),e))if(isObject(i))for(let e in i)isObject(i[e])?(e in t||(t[e]={}),t[e]=deepMerge(t[e],i[e])):void 0!==i[e]&&(t[e]=deepClone(i[e]));return t}function deepClone(t){let e=t;if(t&&"object"==typeof t)for(let i in e=Array.isArray(t)?[]:{},t)e[i]=deepClone(t[i]);return e}function normalizedRowStyle(t,e,i){let n=e(i);(null==n||"object"!=typeof n)&&(n={height:n}),n.padding=normalizeSides(n.padding),n.border=normalizeSides(n.border),n.borderColor=normalizeSides(n.borderColor),n.align=normalizeAlignment(n.align),n=deepMerge(t,n);let r=this.document,s=r.page,o=s.contentHeight;return null==n.height||"auto"===n.height?n.height="auto":n.height=r.sizeToPoint(n.height,0,s,o),n.minHeight=r.sizeToPoint(n.minHeight,0,s,o),n.maxHeight=r.sizeToPoint(n.maxHeight,0,s,o),n}function normalizedColumnStyle(t,e,i){let n=e(i);return(null==n||"object"!=typeof n)&&(n={width:n}),n.padding=normalizeSides(n.padding),n.border=normalizeSides(n.border),n.borderColor=normalizeSides(n.borderColor),n.align=normalizeAlignment(n.align),null==(n=deepMerge(t,n)).width||"*"===n.width?n.width="*":n.width=this.document.sizeToPoint(n.width,0,this.document.page,this._maxWidth),n.minWidth=this.document.sizeToPoint(n.minWidth,0,this.document.page,this._maxWidth),n.maxWidth=this.document.sizeToPoint(n.maxWidth,0,this.document.page,this._maxWidth),n}function normalizeAlignment(t){return null==t||"string"==typeof t?{x:t,y:t}:t}function normalizeTable(){let t,e;let i=this.document,n=this.opts,r=i._tableIndex++;this._id=new String(n.id??`table-${r}`),this._position={x:i.sizeToPoint(n.position?.x,i.x),y:i.sizeToPoint(n.position?.y,i.y)},this._maxWidth=i.sizeToPoint(n.maxWidth,i.page.width-i.page.margins.right-this._position.x);let{defaultStyle:s,defaultColStyle:o,defaultRowStyle:a}=function(t){let e=t;"object"!=typeof e&&(e={text:e});let i=Object.fromEntries(Object.entries(e).filter(([t])=>tY.includes(t))),n=Object.fromEntries(Object.entries(e).filter(([t])=>tq.includes(t)));return e.padding=normalizeSides(e.padding),e.border=normalizeSides(e.border),e.borderColor=normalizeSides(e.borderColor),e.align=normalizeAlignment(e.align),{defaultStyle:e,defaultRowStyle:i,defaultColStyle:n}}(n.defaultStyle);
105this._defaultStyle=s,n.columnStyles&&(Array.isArray(n.columnStyles)?t=t=>n.columnStyles[t]:"function"==typeof n.columnStyles?t=memoize(t=>n.columnStyles(t),1/0):"object"==typeof n.columnStyles&&(t=()=>n.columnStyles)),t||(t=()=>({})),this._colStyle=normalizedColumnStyle.bind(this,o,t),n.rowStyles&&(Array.isArray(n.rowStyles)?e=t=>n.rowStyles[t]:"function"==typeof n.rowStyles?e=memoize(t=>n.rowStyles(t),10):"object"==typeof n.rowStyles&&(e=()=>n.rowStyles)),e||(e=()=>({})),this._rowStyle=normalizedRowStyle.bind(this,a,e)}function normalizeCell(t,e,i){var n;let r=this._colStyle(i),s=this._rowStyle(e),o={};for(let e of[r.font,s.font,t.font])null!=e&&(null!=e.src?(o.src=e.src,o.family=e.family):null!=e.family&&(o.family=e.family),null!=e.size&&(o.size=e.size));let a=Object.values(o).filter(t=>null!=t).length>0,h=this.document,l=h._fontSource,d=h._fontSize,c=h._fontFamily;a&&(o.src&&h.font(o.src,o.family),o.size&&h.fontSize(o.size),s=this._rowStyle(e)),t.padding=normalizeSides(t.padding),t.border=normalizeSides(t.border),t.borderColor=normalizeSides(t.borderColor);let u=deepMerge(this._defaultStyle,r,s,t);return u.rowIndex=e,u.colIndex=i,u.font=o??{},u.customFont=a,u.text=(null!=(n=u.text)&&(n=`${n}`),n),u.rowSpan=u.rowSpan??1,u.colSpan=u.colSpan??1,u.padding=normalizeSides(u.padding,"0.25em",t=>h.sizeToPoint(t,"0.25em")),u.border=normalizeSides(u.border,1,t=>h.sizeToPoint(t,1)),u.borderColor=normalizeSides(u.borderColor,"black",t=>t??"black"),u.align=normalizeAlignment(u.align),u.align.x=u.align.x??"left",u.align.y=u.align.y??"top",u.textStroke=h.sizeToPoint(u.textStroke,0),u.textStrokeColor=u.textStrokeColor??"black",u.textColor=u.textColor??"black",u.textOptions=u.textOptions??{},u.id=new String(u.id??`${this._id}-${e}-${i}`),u.type=u.type?.toUpperCase()==="TH"?"TH":"TD",u.scope&&(u.scope=u.scope.toLowerCase(),"row"===u.scope?u.scope="Row":"both"===u.scope?u.scope="Both":"column"===u.scope&&(u.scope="Column")),"boolean"==typeof this.opts.debug&&(u.debug=this.opts.debug),a&&h.font(l,c,d),u}function normalizeRow(t,e){this._cellClaim||(this._cellClaim=new Set);let i=0;return t.map(t=>{for((null==t||"object"!=typeof t)&&(t={text:t});this._cellClaim.has(`${e},${i}`);)i++;t=normalizeCell.call(this,t,e,i);for(let n=0;n<t.rowSpan;n++)for(let r=0;r<t.colSpan;r++)this._cellClaim.add(`${e+n},${i+r}`);return i+=t.colSpan,t})}function ensure(t){this._columnWidths=[],ensureColumnWidths.call(this,t.reduce((t,e)=>t+e.colSpan,0)),this._rowHeights=[],this._rowYPos=[this._position.y],this._rowBuffer=new Set}function ensureColumnWidths(t){let e=[],i=0,n=this._maxWidth;for(let r=0;r<t;r++){let t=this._colStyle(r);"*"===t.width?(e[r]=t,i+=t.minWidth):(n-=t.width,this._columnWidths[r]=t.width)}let r=e.reduce(t=>t+1,0);i>=n?e.forEach((t,e)=>{this._columnWidths[e]=t.minWidth}):r>0&&e.forEach((t,e)=>{let i=n/r;this._columnWidths[e]=Math.max(i,t.minWidth),t.maxWidth>0&&(this._columnWidths[e]=Math.min(this._columnWidths[e],t.maxWidth)),n-=this._columnWidths[e],r--});let s=this._position.x;this._columnXPos=Array.from(this._columnWidths,t=>{let e=s;return s+=t,e})}function measure(t,e){t.forEach(t=>this._rowBuffer.add(t)),e>0&&(this._rowYPos[e]=this._rowYPos[e-1]+this._rowHeights[e-1]);let i=this._rowStyle(e),n=[];this._rowBuffer.forEach(t=>{t.rowIndex+t.rowSpan-1===e&&(n.push(measureCell.call(this,t,i.height)),this._rowBuffer.delete(t))});let r=i.height;"auto"===r&&(r=n.reduce((t,e)=>{let i=e.textBounds.height+e.padding.top+e.padding.bottom;for(let t=0;t<e.rowSpan-1;t++)i-=this._rowHeights[e.rowIndex+t];return Math.max(t,i)},0)),r=Math.max(r,i.minHeight),i.maxHeight>0&&(r=Math.min(r,i.maxHeight)),this._rowHeights[e]=r;let s=!1;return r>this.document.page.contentHeight?(console.warn(Error(`Row ${e} requested more than the safe page height, row has been clamped`).stack.slice(7)),this._rowHeights[e]=this.document.page.maxY()-this._rowYPos[e]):this._rowYPos[e]+r>=this.document.page.maxY()&&(this._rowYPos[e]=this.document.page.margins.top,s=!0),{newPage:s,toRender:n.map(t=>measureCell.call(this,t,r))}}function measureCell(t,e){let i=0;for(let e=0;e<t.colSpan;e++)i+=this._columnWidths[t.colIndex+e];let n=e;if("auto"===n)n=this.document.page.contentHeight;else for(let e=0;e<t.rowSpan-1;e++)n+=this._rowHeights[t.rowIndex+e];let r=i-t.padding.left-t.padding.right,s=n-t.padding.top-t.padding.bottom,o=t.textOptions.rotation??0,{width:a,height:h}
105=function(t,e,i){let n,r;let s=cosine(t),o=sine(t);0===t||180===t?(n=e,r=i):90===t||270===t?(n=i,r=e):t<90||t>180&&t<270?(n=e/(2*s),r=e/(2*o)):(r=e/(2*s),n=e/(2*o));let a=o*n,h=s*r;if(a+h>i){let a=s*s-o*o;0===t||180===t?(n=e,r=i):90===t||270===t?(n=i,r=e):t<90||t>180&&t<270?(n=(e*s-i*o)/a,r=(i*s-e*o)/a):(r=(e*s-i*o)/a,n=(i*s-e*o)/a)}return{width:Math.abs(n),height:Math.abs(r)}}(o,r,s),l={align:t.align.x,ellipsis:!0,stroke:t.textStroke>0,fill:!0,width:a,height:h,rotation:o,...t.textOptions},d={x:0,y:0,width:0,height:0};if(t.text){let e=this.document._fontSource,i=this.document._fontSize,n=this.document._fontFamily;t.font?.src&&this.document.font(t.font.src,t.font?.family),t.font?.size&&this.document.fontSize(t.font.size);let r=this.document.boundsOfString(t.text,0,0,{...l,rotation:0});l.width=r.width,l.height=r.height,d=this.document.boundsOfString(t.text,0,0,l),this.document.font(e,n,i)}return{...t,textOptions:l,x:this._columnXPos[t.colIndex],y:this._rowYPos[t.rowIndex],textX:this._columnXPos[t.colIndex]+t.padding.left,textY:this._rowYPos[t.rowIndex]+t.padding.top,width:i,height:n,textAllocatedHeight:s,textAllocatedWidth:r,textBounds:d}}function accommodateTable(){let t=this.opts.structParent;t&&(this._tableStruct=this.document.struct("Table"),this._tableStruct.dictionary.data.ID=this._id,t instanceof PDFStructureElement?t.add(this._tableStruct):t instanceof PDFDocument&&t.addStructure(this._tableStruct),this._headerRowLookup={},this._headerColumnLookup={})}function accommodateCleanup(){this._tableStruct&&this._tableStruct.end()}function accessibleRow(t,e,i){let n=this.document.struct("TR");n.dictionary.data.ID=new String(`${this._id}-${e}`),this._tableStruct.add(n),t.forEach(t=>i(t,n)),n.end()}function accessibleCell(t,e,i){let n=this.document,r=n.struct(t.type,{title:t.title});r.dictionary.data.ID=t.id,e.add(r);let s=t.padding,o=t.border,a={O:"Table",Width:t.width,Height:t.height,Padding:[s.top,s.bottom,s.left,s.right],RowSpan:t.rowSpan>1?t.rowSpan:void 0,ColSpan:t.colSpan>1?t.colSpan:void 0,BorderThickness:[o.top,o.bottom,o.left,o.right]};if("TH"===t.type){if("Row"===t.scope||"Both"===t.scope){for(let e=0;e<t.rowSpan;e++)this._headerRowLookup[t.rowIndex+e]||(this._headerRowLookup[t.rowIndex+e]=[]),this._headerRowLookup[t.rowIndex+e].push(t.id);a.Scope=t.scope}if("Column"===t.scope||"Both"===t.scope){for(let e=0;e<t.colSpan;e++)this._headerColumnLookup[t.colIndex+e]||(this._headerColumnLookup[t.colIndex+e]=[]),this._headerColumnLookup[t.colIndex+e].push(t.id);a.Scope=t.scope}}let h=new Set([...Array.from({length:t.colSpan},(e,i)=>this._headerColumnLookup[t.colIndex+i]).flat(),...Array.from({length:t.rowSpan},(e,i)=>this._headerRowLookup[t.rowIndex+i]).flat()].filter(Boolean));h.size&&(a.Headers=Array.from(h));let l=n._normalizeColor;null!=t.backgroundColor&&(a.BackgroundColor=l(t.backgroundColor));let d=[o.top,o.bottom,o.left,o.right];if(d.some(t=>t)){let e=t.borderColor;a.BorderColor=[d[0]?l(e.top):null,d[1]?l(e.bottom):null,d[2]?l(e.left):null,d[3]?l(e.right):null]}Object.keys(a).forEach(t=>void 0===a[t]&&delete a[t]),r.dictionary.data.A=n.ref(a),r.add(i),r.end(),r.dictionary.data.A.end()}function renderRow(t,e){return this._tableStruct?accessibleRow.call(this,t,e,renderCell.bind(this)):t.forEach(t=>renderCell.call(this,t)),this._rowYPos[e]+this._rowHeights[e]}function renderCell(t,e){let cellRenderer=()=>{null!=t.backgroundColor&&this.document.save().fillColor(t.backgroundColor).rect(t.x,t.y,t.width,t.height).fill().restore(),renderBorder.call(this,t.border,t.borderColor,t.x,t.y,t.width,t.height),t.debug&&(this.document.save(),this.document.dash(1,{space:1}).lineWidth(1).strokeOpacity(.3),this.document.rect(t.x,t.y,t.width,t.height).stroke("green"),this.document.restore()),t.text&&renderCellText.call(this,t)};e?accessibleCell.call(this,t,e,cellRenderer):cellRenderer()}function renderCellText(t){let e=this.document,i=e._fontSource,n=e._fontSize,r=e._fontFamily;t.customFont&&(t.font.src&&e.font(t.font.src,t.font.family),t.font.size&&e.fontSize(t.font.size));let s=t.textX,o=t.textY,a=t.textAllocatedHeight,h=t.textAllocatedWidth,l=t.textBounds.width,d=t.textBounds.height,c=-t.textBounds.x,u=-t.textBounds.y,f="right"===t.align.x?1:"center"===t.align.x?.5:0,p=(h-l)*f,g="bottom"===t.align.y?1:"center"===t.align.y?.5:0,A=(a-d)*g,m=p+c,y=A+u;t.debug&&(e.save(),e.dash(1,{space:1}).lineWidth(1).strokeOpacity(.3),t.text&&e.moveTo(s+p,o).lineTo(s+p,o+a).moveTo(s+p+l,o).lineTo(s+p+l,o+a).stroke("blue").moveTo(s,o+A).lineTo(s+h,o+A).moveTo(s,o+A+d).lineTo(s+h,o+A+d).stroke("green"),e.rect(s,o,h,a).stroke("orange"),e.restore(
105)),e.save().rect(s,o,h,a).clip(),e.fillColor(t.textColor).strokeColor(t.textStrokeColor),t.textStroke>0&&e.lineWidth(t.textStroke),e.text(t.text,s+m,o+y,t.textOptions),e.restore(),t.font&&e.font(i,r,n)}function renderBorder(t,e,i,n,r,s,o){t=Object.fromEntries(Object.entries(t).map(([t,e])=>[t,o&&!o[t]?0:e]));let a=this.document;[t.right,t.bottom,t.left].every(e=>e===t.top)?t.top>0&&a.save().lineWidth(t.top).strokeColor(e.top).rect(i,n,r,s).stroke().restore():(t.top>0&&a.save().lineWidth(t.top).moveTo(i,n).strokeColor(e.top).lineTo(i+r,n).stroke().restore(),t.right>0&&a.save().lineWidth(t.right).moveTo(i+r,n).strokeColor(e.right).lineTo(i+r,n+s).stroke().restore(),t.bottom>0&&a.save().lineWidth(t.bottom).moveTo(i+r,n+s).strokeColor(e.bottom).lineTo(i,n+s).stroke().restore(),t.left>0&&a.save().lineWidth(t.left).moveTo(i,n+s).strokeColor(e.left).lineTo(i,n).stroke().restore())}let PDFTable=class PDFTable{constructor(t,e={}){if(this.document=t,this.opts=Object.freeze(e),normalizeTable.call(this),accommodateTable.call(this),this._currRowIndex=0,this._ended=!1,e.data){for(let t of e.data)this.row(t);return this.end()}}row(t,e=!1){if(this._ended)throw Error(`Table was marked as ended on row ${this._currRowIndex}`);t=Array.from(t),t=normalizeRow.call(this,t,this._currRowIndex),0===this._currRowIndex&&ensure.call(this,t);let{newPage:i,toRender:n}=measure.call(this,t,this._currRowIndex);i&&this.document.continueOnNewPage();let r=renderRow.call(this,n,this._currRowIndex);return(this.document.x=this._position.x,this.document.y=r,e)?this.end():(this._currRowIndex++,this)}end(){for(;this._rowBuffer?.size;)this.row([]);return this._ended=!0,accommodateCleanup.call(this),this.document}};let PDFMetadata=class PDFMetadata{constructor(){this._metadata=`
106        <?xpacket begin="\ufeff" id="W5M0MpCehiHzreSzNTczkc9d"?>
107            <x:xmpmeta xmlns:x="adobe:ns:meta/">
108                <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
109        `}_closeTags(){this._metadata=this._metadata.concat(`
110                </rdf:RDF>
111            </x:xmpmeta>
112        <?xpacket end="w"?>
113        `)}append(t,e=!0){this._metadata=this._metadata.concat(t),e&&(this._metadata=this._metadata.concat("\n"))}getXML(){return this._metadata}getLength(){return this._metadata.length}end(){this._closeTags(),this._metadata=this._metadata.trim()}};let PDFDocument=class PDFDocument extends Readable{constructor(t={}){switch(super(t),this.options=t,t.pdfVersion){case"1.4":this.version=1.4;break;case"1.5":this.version=1.5;break;case"1.6":this.version=1.6;break;case"1.7":case"1.7ext3":this.version=1.7;break;default:this.version=1.3}this.compress=null==this.options.compress||this.options.compress,this._pageBuffer=[],this._pageBufferStart=0,this._offsets=[],this._waiting=0,this._ended=!1,this._offset=0;let e=this.ref({Type:"Pages",Count:0,Kids:[]}),i=this.ref({Dests:new PDFNameTree});if(this._root=this.ref({Type:"Catalog",Pages:e,Names:i}),this.options.lang&&(this._root.data.Lang=new String(this.options.lang)),this.options.pageLayout){let t=this.options.pageLayout;this._root.data.PageLayout=t.charAt(0).toUpperCase()+t.slice(1)}if(this.page=null,this.initMetadata(),this.initColor(),this.initVector(),this.initFonts(t.font),this.initText(),this.initImages(),this.initOutline(),this.initMarkings(t),this.initTables(),this.initSubset(t),this.info={Producer:"PDFKit",Creator:"PDFKit",CreationDate:new Date},this.options.info)for(let t in this.options.info){let e=this.options.info[t];this.info[t]=e}this.options.displayTitle&&(this._root.data.ViewerPreferences=this.ref({DisplayDocTitle:!0})),this._id=PDFSecurity.generateFileID(this.info),this._security=PDFSecurity.create(this,t),this._write(`%PDF-${this.version}`),this._write("%\xff\xff\xff\xff"),!1!==this.options.autoFirstPage&&this.addPage()}addPage(t){let e=this.options;e.bufferPages||this.flushPages();let i=t?.font;i&&this.font(i,t.fontFamily);let n=t?.fontSize;n&&this.fontSize(n),this.page=new PDFPage(this,t||e),this._pageBuffer.push(this.page);let r=this._root.data.Pages.data;return r.Kids.push(this.page.dictionary),r.Count++,this.x=this.page.margins.left,this.y=this.page.margins.top,this._ctm=[1,0,0,1,0,0],this.transform(1,0,0,-1,0,this.page.height),this.emit
113("pageAdded"),this}continueOnNewPage(t){let e=this.endPageMarkings(this.page);return this.addPage(t??this.page._options),this.initPageMarkings(e),this}bufferedPageRange(){return{start:this._pageBufferStart,count:this._pageBuffer.length}}switchToPage(t){let e;if(!(e=this._pageBuffer[t-this._pageBufferStart]))throw Error(`switchToPage(${t}) out of bounds, current buffer covers pages ${this._pageBufferStart} to ${this._pageBufferStart+this._pageBuffer.length-1}`);return this.page=e}flushPages(){let t=this._pageBuffer;for(let e of(this._pageBuffer=[],this._pageBufferStart+=t.length,t))this.endPageMarkings(e),e.end()}addNamedDestination(t,...e){0===e.length&&(e=["XYZ",null,null,null]),"XYZ"===e[0]&&null!==e[2]&&(e[2]=this.page.height-e[2]),e.unshift(this.page.dictionary),this._root.data.Names.data.Dests.add(t,e)}addNamedEmbeddedFile(t,e){if(!e)throw Error(`No ref specified for embedded file ${t}`);this._root.data.Names.data.EmbeddedFiles||(this._root.data.Names.data.EmbeddedFiles=new PDFNameTree({limits:!1})),this._root.data.Names.data.EmbeddedFiles.add(t,e)}addNamedJavaScript(t,e){this._root.data.Names.data.JavaScript||(this._root.data.Names.data.JavaScript=new PDFNameTree);let i={JS:new String(e),S:"JavaScript"};this._root.data.Names.data.JavaScript.add(t,i)}ref(t){let e=new PDFReference(this,this._offsets.length+1,t);return this._offsets.push(null),this._waiting++,e}_read(){}_write(t){t instanceof Uint8Array||(t=fromBinaryString(t+"\n")),this.push(t),this._offset+=t.length}addContent(t){return this.page.write(t),this}_refEnd(t){this._offsets[t.id-1]=t.offset,0==--this._waiting&&this._ended&&(this._finalize(),this._ended=!1)}end(){for(let t in this.flushPages(),this._info=this.ref(),this.info){let e=this.info[t];"string"==typeof e&&(e=new String(e));let i=this.ref(e);i.end(),this._info.data[t]=i}for(let t in this._info.end(),this._fontFamilies){let e=this._fontFamilies[t];e.finalize()}this.endOutline(),this.endMarkings(),this.subset&&this.endSubset(),this.endMetadata(),this._root.end(),this._root.data.Pages.end(),this._root.data.Names.end(),this.endAcroForm(),this._root.data.ViewerPreferences&&this._root.data.ViewerPreferences.end(),this._security&&this._security.end(),0===this._waiting?this._finalize():this._ended=!0}_finalize(){let t=this._offset;for(let t of(this._write("xref"),this._write(`0 ${this._offsets.length+1}`),this._write("0000000000 65535 f "),this._offsets))t=`0000000000${t}`.slice(-10),this._write(t+" 00000 n ");let e={Size:this._offsets.length+1,Root:this._root,Info:this._info,ID:[this._id,this._id]};this._security&&(e.Encrypt=this._security.dictionary),this._write("trailer"),this._write(PDFObject.convert(e)),this._write("startxref"),this._write(`${t}`),this._write("%%EOF"),this.push(null)}toString(){return"[object PDFDocument]"}};let mixin=t=>{Object.assign(PDFDocument.prototype,t)};mixin({initMetadata(){this.metadata=new PDFMetadata},appendXML(t,e=!0){this.metadata.append(t,e)},_addInfo(){this.appendXML(`
114        <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
115            <xmp:CreateDate>${this.info.CreationDate.toISOString().split(".")[0]+"Z"}</xmp:CreateDate>
116            <xmp:CreatorTool>${this.info.Creator}</xmp:CreatorTool>
117        </rdf:Description>
118        `),(this.info.Title||this.info.Author||this.info.Subject)&&(this.appendXML(`
119            <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
120            `),this.info.Title&&this.appendXML(`
121                <dc:title>
122                    <rdf:Alt>
123                        <rdf:li xml:lang="x-default">${this.info.Title}</rdf:li>
124                    </rdf:Alt>
125                </dc:title>
126                `),this.info.Author&&this.appendXML(`
127                <dc:creator>
128                    <rdf:Seq>
129                        <rdf:li>${this.info.Author}</rdf:li>
130                    </rdf:Seq>
131                </dc:creator>
132                `),this.info.Subject&&this.appendXML(`
133                <dc:description>
134                    <rdf:Alt>
135                        <rdf:li xml:lang="x-default">${this.info.Subject}</rdf:li>
136                    </rdf:Alt>
137                </dc:description>
138                `),this.appendXML(`
139            </rdf:Description>
140            `)),this.appendXML(`
141        <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
142            <pdf:Producer>${this.info.Producer}</pdf:Producer>`,!1),this.info.Keywords&&this.appendXML(`
143            <pdf:Keywords>${this.info.Keywords}</pdf:Keywords>`,!1),this.appendXML(`
144        </rdf:Description>
145        `)},endMetadata(){this._addInfo(),this.metadata.end(),1.3!=this.version&&(this.metadataRef=this.ref({length:this.metadata.getLength(),Type:"Metadata",Subtype:"XML"}),this.metadataRef.compress=!1,this.metadataRef.write(new TextEncoder().encode(this.metadata.getXML())),this.metadataRef.end(),this._root.data.Metadata=this.metadataRef)}}),mixin({initColor(){this.spotColors={},this._opacityRegistry={},this._opacityCount=0,this._patternCount=0,this._gradCount=0},_normalizeColor(t){if("string"==typeof t){if("#"===t.charAt(0)){4===t.length&&(t=t.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i,"#$1$1$2$2$3$3"));let e=parseInt(t.slice(1),16);t=[e>>16,e>>8&255,255&e]}else if(tx[t])t=tx[t];else if(this.spotColors[t])return this.spotColors[t]}return Array.isArray(t)?(3===t.length?t=t.map(t=>t/255):4===t.length&&(t=t.map(t=>t/100)),t):null},_setColor(t,e){return t instanceof tS?(t.apply(e),!0):Array.isArray(t)&&t[0]instanceof tC?(t[0].apply(e,t[1]),!0):this._setColorCore(t,e)},_setColorCore(t,e){if(!(t=this._normalizeColor(t)))return!1;let i=e?"SCN":"scn",n=this._getColorSpace(t);return this._setColorSpace(n,e),t instanceof SpotColor?(this.page.colorSpaces[t.id]=t.ref,this.addContent(`1 ${i}`)):this.addContent(`${t.join(" ")} ${i}`),!0},_setColorSpace(t,e){return this.addContent(`/${t} ${e?"CS":"cs"}`)},_getColorSpace:t=>t instanceof SpotColor?t.id:4===t.length?"DeviceCMYK":"DeviceRGB",fillColor(t,e){let i=this._setColor(t,!1);return i&&this.fillOpacity(e),this._fillColor=[t,e],this},strokeColor(t,e){let i=this._setColor(t,!0);return i&&this.strokeOpacity(e),this},opacity(t){return this._doOpacity(t,t),this},fillOpacity(t){return this._doOpacity(t,null),this},strokeOpacity(t){return this._doOpacity(null,t),this},_doOpacity(t,e){let i,n;if(null==t&&null==e)return;null!=t&&(t=Math.max(0,Math.min(1,t))),null!=e&&(e=Math.max(0,Math.min(1,e)));let r=`${t}_${e}`;if(this._opacityRegistry[r])[i,n]=this._opacityRegistry[r];else{i={Type:"ExtGState"},null!=t&&(i.ca=t),null!=e&&(i.CA=e),(i=this.ref(i)).end();let s=++this._opacityCount;n=`Gs${s}`,this._opacityRegistry[r]=[i,n]}return this.page.ext_gstates[n]=i,this.addContent(`/${n} gs`)},linearGradient(t,e,i,n){return new tw(this,t,e,i,n)},radialGradient(t,e,i,n,r,s){return new t_(this,t,e,i,n,r,s)},pattern(t,e,i,n){return new tC(this,t,e,i,n)},addSpotColor(t,e,i,n,r){let s=new SpotColor(this,t,e,i,n,r);return this.spotColors[t]=s,this}}),mixin({initVector(){this._ctm=[1,0,0,1,0,0],this._ctmStack=[]},save(){return this._ctmStack.push(this._ctm.slice()),this.addContent("q")}
145,restore(){return this._ctm=this._ctmStack.pop()||[1,0,0,1,0,0],this.addContent("Q")},closePath(){return this.addContent("h")},lineWidth(t){return this.addContent(`${tD(t)} w`)},_CAP_STYLES:{BUTT:0,ROUND:1,SQUARE:2},lineCap(t){return"string"==typeof t&&(t=this._CAP_STYLES[t.toUpperCase()]),this.addContent(`${t} J`)},_JOIN_STYLES:{MITER:0,ROUND:1,BEVEL:2},lineJoin(t){return"string"==typeof t&&(t=this._JOIN_STYLES[t.toUpperCase()]),this.addContent(`${t} j`)},miterLimit(t){return this.addContent(`${tD(t)} M`)},dash(t,e={}){let i=t;Array.isArray(t)||(t=[t,e.space||t]);let n=t.every(t=>Number.isFinite(t)&&t>0);if(!n)throw Error(`dash(${JSON.stringify(i)}, ${JSON.stringify(e)}) invalid, lengths must be numeric and greater than zero`);return t=t.map(tD).join(" "),this.addContent(`[${t}] ${tD(e.phase||0)} d`)},undash(){return this.addContent("[] 0 d")},moveTo(t,e){return this.addContent(`${tD(t)} ${tD(e)} m`)},lineTo(t,e){return this.addContent(`${tD(t)} ${tD(e)} l`)},bezierCurveTo(t,e,i,n,r,s){return this.addContent(`${tD(t)} ${tD(e)} ${tD(i)} ${tD(n)} ${tD(r)} ${tD(s)} c`)},quadraticCurveTo(t,e,i,n){return this.addContent(`${tD(t)} ${tD(e)} ${tD(i)} ${tD(n)} v`)},rect(t,e,i,n){return this.addContent(`${tD(t)} ${tD(e)} ${tD(i)} ${tD(n)} re`)},roundedRect(t,e,i,n,r){let s;null==r&&(r=0),s=Array.isArray(r)?r.slice(0,4):[r,r,r,r];let o=Math.min(.5*i,.5*n),a=Math.max(0,Math.min(s[0]||0,o)),h=Math.max(0,Math.min(s[1]||0,o)),l=Math.max(0,Math.min(s[2]||0,o)),d=Math.max(0,Math.min(s[3]||0,o)),c=h*(1-tT),u=l*(1-tT),f=d*(1-tT),p=a*(1-tT);return this.moveTo(t+a,e),this.lineTo(t+i-h,e),h>0&&this.bezierCurveTo(t+i-c,e,t+i,e+c,t+i,e+h),this.lineTo(t+i,e+n-l),l>0&&this.bezierCurveTo(t+i,e+n-u,t+i-u,e+n,t+i-l,e+n),this.lineTo(t+d,e+n),d>0&&this.bezierCurveTo(t+f,e+n,t,e+n-f,t,e+n-d),this.lineTo(t,e+a),a>0&&this.bezierCurveTo(t,e+p,t+p,e,t+a,e),this.closePath()},ellipse(t,e,i,n){null==n&&(n=i),t-=i,e-=n;let r=i*tT,s=n*tT,o=t+2*i,a=e+2*n,h=t+i,l=e+n;return this.moveTo(t,l),this.bezierCurveTo(t,l-s,h-r,e,h,e),this.bezierCurveTo(h+r,e,o,l-s,o,l),this.bezierCurveTo(o,l+s,h+r,a,h,a),this.bezierCurveTo(h-r,a,t,l+s,t,l),this.closePath()},circle(t,e,i){return this.ellipse(t,e,i)},arc(t,e,i,n,r,s){null==s&&(s=!1);let o=2*Math.PI,a=.5*Math.PI,h=r-n;if(Math.abs(h)>o)h=o;else if(0!==h&&s!==h<0){let t=s?-1:1;h=t*o+h}let l=Math.ceil(Math.abs(h)/a),d=h/l,c=d/a*tT*i,u=n,f=-Math.sin(u)*c,p=Math.cos(u)*c,g=t+Math.cos(u)*i,A=e+Math.sin(u)*i;this.moveTo(g,A);for(let n=0;n<l;n++){let n=g+f,r=A+p;u+=d,g=t+Math.cos(u)*i,A=e+Math.sin(u)*i,f=-Math.sin(u)*c,p=Math.cos(u)*c;let s=g-f,o=A-p;this.bezierCurveTo(n,r,s,o,g,A)}return this},polygon(...t){for(let e of(this.moveTo(...t.shift()||[]),t))this.lineTo(...e||[]);return this.closePath()},path(t){return SVGPath.apply(this,t),this},_windingRule:t=>/even-?odd/.test(t)?"*":"",fill(t,e){return/(even-?odd)|(non-?zero)/.test(t)&&(e=t,t=null),t&&this.fillColor(t),this.addContent(`f${this._windingRule(e)}`)},stroke(t){return t&&this.strokeColor(t),this.addContent("S")},fillAndStroke(t,e,i){null==e&&(e=t);let n=/(even-?odd)|(non-?zero)/;return n.test(t)&&(i=t,t=null),n.test(e)&&(i=e,e=t),t&&(this.fillColor(t),this.strokeColor(e)),this.addContent(`B${this._windingRule(i)}`)},clip(t){return this.addContent(`W${this._windingRule(t)} n`)},transform(t,e,i,n,r,s){if(1===t&&0===e&&0===i&&1===n&&0===r&&0===s)return this;let o=this._ctm,[a,h,l,d,c,u]=o;o[0]=a*t+l*e,o[1]=h*t+d*e,o[2]=a*i+l*n,o[3]=h*i+d*n,o[4]=a*r+l*s+c,o[5]=h*r+d*s+u;let f=[t,e,i,n,r,s].map(t=>tD(t)).join(" ");return this.addContent(`${f} cm`)},translate(t,e){return this.transform(1,0,0,1,t,e)},rotate(t,e={}){let i;let n=t*Math.PI/180,r=Math.cos(n),s=Math.sin(n),o=i=0;if(null!=e.origin){[o,i]=e.origin;let t=o*r-i*s,n=o*s+i*r;o-=t,i-=n}return this.transform(r,s,-s,r,o,i)},scale(t,e,i={}){let n;null==e&&(e=t),"object"==typeof e&&(i=e,e=t);let r=n=0;return null!=i.origin&&([r,n]=i.origin,r-=t*r,n-=e*n),this.transform(t,0,0,e,r,n)}}),mixin({initFonts(t="Helvetica",e=null,i=12){this._fontFamilies={},this._fontCount=0,this._fontSource=t,this._fontFamily=e,this._fontSize=i,this._font=null,this._remSize=i,this._registeredFonts={},t&&this.font(t,e)},font(t,e,i){let n,r;if("number"==typeof e&&(i=e,e=null),"string"==typeof t&&this._registeredFonts[t]?(n=t,{src:t,family:e}=this._registeredFonts[t]):"string"!=typeof(n=e||t)&&(n=null),this._fontSource=t,this._fontFamily=e,null!=i&&this.fontSize(i),r=this._fontFamilies[n])return this._font=r,this;let s=`F${++this._fontCount}`;return(this._font=PDFFontFactory.open(this,t,e,s),(r=this._fontFamilies[this._font.name])&&isEqualFont(this._font,r))?this._font=r:(n&&(this._fontFamilies[n]=this._font),this._font.name&&!this._fontFamilies[this._font.name]&&(this._fontFamilies[this._font.name]=this._font),n||this._font.name&&this._fontFamilies[this._font.name]===this._font||(this._fontFamilies[this._font.id]=this._font)),this},fontSize(t){return this._fontSize=this.sizeToPoint(t),this},currentLineHeight(t){return this._font.lineHeight(this._fontSize,t)},registerFont(t,e,i){return this._registeredFonts[t]={src:e,family:i},this},sizeToPoint(t,e=0,i=this.page,n){let r;if(n||(n=this._fontSize),"number"!=typeof e&&(e=this.sizeToPoint(e)),void 0===t)return e;if("number"==typeof t)return t;if("boolean"==typeof t)return Number(t);let s=String(t).match(/((\d+)?(\.\d+)?)(em|in|px|cm|mm|pc|ex|ch|rem|vw|vh|vmin|vmax|%|pt)?/);if(!s)throw Error(`Unsupported size '${t}'`);switch(s[4]){case"em":r=this._fontSize;break;case"in":r=72;break;case"px":r=72*_;break;case"cm":r=72*w;break;case"mm":r=.1*w*72;break;case"pc":r=12;break;case"ex":r=this.currentLineHeight();break;case"ch":r=this.widthOfString("0");break;case"rem":r=this._remSize;break;case"vw":r=i.width/100;break;case"vh":r=i.height/100;break;case"vmin":r=Math.min(i.width,i.height)/100;break;case"vmax":r=Math.max(i.width,i.height)/100;break;case"%":r=n/100;break;default:r=1}return r*Number(s[1])}}),mixin({initText(){this._line=this._line.bind(this),this.x=0,this.y=0,this._lineGap=0},lineGap(t){return this._lineGap=t,this},moveDown(t){return null==t&&(t=1),this.y+=this.currentLineHeight(!0)*t+this._lineGap,this},moveUp(t){return null==t&&(t=1),this.y-=this.currentLineHeight(!0)*t+this._lineGap,this},_text(t,e,i,n,r){n=this._initOptions(e,i,n),t=null==t?"":`${t}`,n.wordSpacing&&(t=t.replace(/\s{2,}/g," "));let addStructure=()=>{n.structParent&&n.structParent.add(this.struct(n.structType||"P",[this.markStructureContent(n.structType||"P")]))};if(0!==n.rotation&&(this.save(),this.rotate(-n.rotation,{origin:[this.x,this.y]})),n.width){let e=this._wrapper;e||((e=new LineWrapper(this,n)).on("line",r),e.on("firstLine",addStructure)),this._wrapper=n.continued?e:null,this._textOptions=n.continued?n:null,e.wrap(t,n)}else for(let e of t.split("\n"))addStructure(),r(e,n);
145return 0!==n.rotation&&this.restore(),this},text(t,e,i,n){return this._text(t,e,i,n,this._line)},widthOfString(t,e={}){let i=e.horizontalScaling||100;return(this._font.widthOfString(t,this._fontSize,e.features)+(e.characterSpacing||0)*(t.length-1))*i/100},boundsOfString(t,e,i,n){n=this._initOptions(e,i,n),{x:e,y:i}=this;let r=n.lineGap??this._lineGap??0,s=this.currentLineHeight(!0)+r,o=0;if(t=String(t??""),n.wordSpacing&&(t=t.replace(/\s{2,}/g," ")),n.width){let e=new LineWrapper(this,n);e.on("line",(t,e)=>{if(this.y+=s,(t=t.replace(/\n/g,"")).length){let i=e.wordSpacing??0,n=e.characterSpacing??0;if(e.width&&"justify"===e.align){let r=t.trim().split(/\s+/),s=this.widthOfString(t.replace(/\s+/g,""),e),o=this.widthOfString(" ")+n;i=Math.max(0,(e.lineWidth-s)/Math.max(1,r.length-1)-o)}o=Math.max(o,e.textWidth+i*(e.wordCount-1)+n*(t.length-1))}}),e.wrap(t,n)}else for(let e of t.split("\n")){let t=this.widthOfString(e,n);this.y+=s,o=Math.max(o,t)}let a=this.y-i;if(n.height&&(a=Math.min(a,n.height)),this.x=e,this.y=i,0===n.rotation)return{x:e,y:i,width:o,height:a};if(90===n.rotation)return{x:e,y:i-o,width:a,height:o};if(180===n.rotation)return{x:e-o,y:i-a,width:o,height:a};if(270===n.rotation)return{x:e-a,y:i,width:a,height:o};let h=cosine(n.rotation),l=sine(n.rotation),d=e,c=i,u=e+o*h,f=i-o*l,p=e+o*h+a*l,g=i-o*l+a*h,A=e+a*l,m=i+a*h,y=Math.min(d,u,p,A),b=Math.max(d,u,p,A),S=Math.min(c,f,g,m),w=Math.max(c,f,g,m);return{x:y,y:S,width:b-y,height:w-S}},heightOfString(t,e){let{x:i,y:n}=this;(e=this._initOptions(e)).height=1/0;let r=e.lineGap||this._lineGap||0;this._text(t,this.x,this.y,e,()=>{this.y+=this.currentLineHeight(!0)+r});let s=this.y-n;return this.x=i,this.y=n,s},list(t,e,i,n){n=this._initOptions(e,i,n);let r=n.listType||"bullet",s=Math.round(this._font.ascender/1e3*this._fontSize),o=s/2,a=n.bulletRadius||s/3,h=n.textIndent||("bullet"===r?5*a:2*s),l=n.bulletIndent||("bullet"===r?8*a:2*s),d=1,c=[],u=[],f=[];var flatten=function(t){let e=1;for(let i=0;i<t.length;i++){let n=t[i];Array.isArray(n)?(d++,flatten(n),d--):(c.push(n),u.push(d),"bullet"!==r&&f.push(e++))}};flatten(t);let drawListItem=function(t,e){let i=new LineWrapper(this,n);i.on("line",this._line),d=1,i.once("firstLine",()=>{let t,s,c,p,g;if(n.structParent&&(n.structTypes?[s,c,p]=n.structTypes:[s,c,p]=["LI","Lbl","LBody"]),s?(t=this.struct(s),n.structParent.add(t)):n.structParent&&(t=n.structParent),(g=u[e++])!==d){let t=l*(g-d);this.x+=t,i.lineWidth-=t,d=g}switch(t&&(c||p)&&t.add(this.struct(c||p,[this.markStructureContent(c||p)])),r){case"bullet":this.circle(this.x-h+a,this.y+o,a),this.fill();break;case"numbered":case"lettered":var A=function(t,e){if("numbered"===e)return`${t}.`;var i=String.fromCharCode((t-1)%26+65),n=Array(Math.floor((t-1)/26+1)+1).join(i);return`${n}.`}(f[e-1],r);this._fragment(A,this.x-h,this.y,n)}t&&c&&p&&t.add(this.struct(p,[this.markStructureContent(p)])),t&&t!==n.structParent&&t.end()}),i.on("sectionStart",()=>{let t=h+l*(d-1);this.x+=t,i.lineWidth-=t}),i.on("sectionEnd",()=>{let t=h+l*(d-1);this.x-=t,i.lineWidth+=t}),i.wrap(t,n)};for(let t=0;t<c.length;t++)drawListItem.call(this,c[t],t);return this},_initOptions(t={},e,i={}){t&&"object"==typeof t&&(i=t,t=null);let n=Object.assign({},i);if(this._textOptions)for(let t in this._textOptions){let e=this._textOptions[t];"continued"!==t&&void 0===n[t]&&(n[t]=e)}return null!=t&&(this.x=t),null!=e&&(this.y=e),!1!==n.lineBreak&&(null==n.width&&(n.width=this.page.width-this.x-this.page.margins.right),n.width=Math.max(n.width,0)),n.columns||(n.columns=0),null==n.columnGap&&(n.columnGap=18),n.rotation=Number(n.rotation??0)%360,n.rotation<0&&(n.rotation+=360),n},_line(t,e={},i){if(this._fragment(t,this.x,this.y,e),i){let t=e.lineGap||this._lineGap||0;this.y+=this.currentLineHeight(!0)+t}else this.x+=this.widthOfString(t,e)},_fragment(t,e,i,n){let r,s,o,a,h,l;if(0===(t=`${t}`.replace(/\n/g,"")).length)return;let d=n.align||"left",c=n.wordSpacing||0,u=n.characterSpacing||0,f=n.horizontalScaling||100;if(n.width)switch(d){case"right":h=this.widthOfString(t.replace(/\s+$/,""),n),e+=n.lineWidth-h;break;case"center":e+=n.lineWidth/2-n.textWidth/2;break;case"justify":l=t.trim().split(/\s+/),h=this.widthOfString(t.replace(/\s+/g,""),n);var p=this.widthOfString(" ")+u;c=Math.max(0,(n.lineWidth-h)/Math.max(1,l.length-1)-p)}if("number"==typeof n.baseline)r=-n.baseline;else{switch(n.baseline){case"svg-middle":r=.5*this._font.xHeight;break;case"middle":case"svg-central":r=.5*(this._font.descender+this._font.ascender);break;case"bottom":case"ideographic":r=this._font.descender;break;case"alphabetic":r=0;break;case"mathematical":r=.5*this._font.ascender;break;case"hanging":r=.8*this._font.ascender;break;default:r=this._font.ascender}r=r/1e3*this._fontSize}let g=n.textWidth+c*(n.wordCount-1)+u*(t.length-1);if(null!=n.link){let t={};this._currentStructureElement&&"Link"===this._currentStructureElement.dictionary.data.S&&(t.structParent=this._currentStructureElement),this.link(e,i,g,this.currentLineHeight(),n.link,t)}if(null!=n.goTo&&this.goTo(e,i,g,this.currentLineHeight(),n.goTo),null!=n.destination&&this.addNamedDestination(n.destination,"XYZ",e,i,null),n.underline){this.save(),n.stroke||this.strokeColor(...this._fillColor||[]);let t=this._fontSize<10?.5:Math.floor(this._fontSize/10);this.lineWidth(t);let r=i+this.currentLineHeight()-t;
145this.moveTo(e,r),this.lineTo(e+g,r),this.stroke(),this.restore()}if(n.strike){this.save(),n.stroke||this.strokeColor(...this._fillColor||[]);let t=this._fontSize<10?.5:Math.floor(this._fontSize/10);this.lineWidth(t);let r=i+this.currentLineHeight()/2;this.moveTo(e,r),this.lineTo(e+g,r),this.stroke(),this.restore()}if(this.save(),n.oblique){let t;t="number"==typeof n.oblique?-Math.tan(n.oblique*Math.PI/180):-.25,this.transform(1,0,0,1,e,i),this.transform(1,0,t,1,-t*r,0),this.transform(1,0,0,1,-e,-i)}this.transform(1,0,0,-1,0,this.page.height),i=this.page.height-i-r,null==this.page.fonts[this._font.id]&&(this.page.fonts[this._font.id]=this._font.ref()),this.addContent("BT"),this.addContent(`1 0 0 1 ${tI(e)} ${tI(i)} Tm`),this.addContent(`/${this._font.id} ${tI(this._fontSize)} Tf`);let A=n.fill&&n.stroke?2:n.stroke?1:0;if(A&&this.addContent(`${A} Tr`),u&&this.addContent(`${tI(u)} Tc`),100!==f&&this.addContent(`${f} Tz`),c)for(let e of(l=t.trim().split(/\s+/),c+=this.widthOfString(" ")+u,c*=1e3/this._fontSize,s=[],a=[],l)){let[t,i]=this._font.encode(e,n.features);s=s.concat(t),a=a.concat(i);let r={},o=a[a.length-1];for(let t in o){let e=o[t];r[t]=e}r.xAdvance+=c,a[a.length-1]=r}else[s,a]=this._font.encode(t,n.features);let m=this._fontSize/1e3,y=[],b=0,S=!1,addSegment=t=>{if(b<t){let e=s.slice(b,t).join(""),i=a[t-1].xAdvance-a[t-1].advanceWidth;y.push(`<${e}> ${tI(-i)}`)}b=t},flush=t=>{addSegment(t),y.length>0&&(this.addContent(`[${y.join(" ")}] TJ`),y.length=0)};for(o=0;o<a.length;o++){let t=a[o];t.xOffset||t.yOffset?(flush(o),this.addContent(`1 0 0 1 ${tI(e+t.xOffset*m)} ${tI(i+t.yOffset*m)} Tm`),flush(o+1),S=!0):(S&&(this.addContent(`1 0 0 1 ${tI(e)} ${tI(i)} Tm`),S=!1),t.xAdvance-t.advanceWidth!=0&&addSegment(o+1)),e+=t.xAdvance*m}flush(o),this.addContent("ET"),this.restore()}}),mixin({initImages(){this._imageRegistry={},this._imageCount=0},image(t,e,i,n={}){let r,s,o,a,h,l,d,c,u;"object"==typeof e&&(n=e,e=null);let f=n.ignoreOrientation||!1!==n.ignoreOrientation&&this.options.ignoreOrientation,p="number"!=typeof i;e=null!=(l=null!=e?e:n.x)?l:this.x,i=null!=(d=null!=i?i:n.y)?d:this.y,"string"==typeof t&&(a=this._imageRegistry[t]),a||(a=t.width&&t.height?t:this.openImage(t)),a.obj||a.embed(this),null==this.page.xobjects[a.label]&&(this.page.xobjects[a.label]=a.obj);let{width:g,height:A}=a;!f&&a.orientation>4&&([g,A]=[A,g]);let m=n.width||g,y=n.height||A;if(n.width&&!n.height){let t=m/g;m=g*t,y=A*t}else if(n.height&&!n.width){let t=y/A;m=g*t,y=A*t}else n.scale?(m=g*n.scale,y=A*n.scale):n.fit?([o,r]=n.fit,s=o/r,(h=g/A)>s?(m=o,y=o/h):(y=r,m=r*h)):n.cover&&([o,r]=n.cover,s=o/r,(h=g/A)>s?(y=r,m=r*h):(m=o,y=o/h));(n.fit||n.cover)&&("center"===n.align?e=e+o/2-m/2:"right"===n.align&&(e=e+o-m),"center"===n.valign?i=i+r/2-y/2:"bottom"===n.valign&&(i=i+r-y));let b=0,S=e,w=i,_=y,C=m;if(f)_=-y,w+=y;else switch(a.orientation){default:case 1:_=-y,w+=y;break;case 2:C=-m,_=-y,S+=m,w+=y;break;case 3:c=e,u=i,_=-y,S-=m,b=180;break;case 4:break;case 5:c=e,u=i,C=y,w-=_=m,b=90;break;case 6:c=e,u=i,C=y,_=-m,b=90;break;case 7:c=e,u=i,_=-m,C=-y,S+=y,b=90;break;case 8:c=e,u=i,C=y,_=-m,S-=y,w+=m,b=-90}return null!=n.link&&this.link(e,i,m,y,n.link),null!=n.goTo&&this.goTo(e,i,m,y,n.goTo),null!=n.destination&&this.addNamedDestination(n.destination,"XYZ",e,i,null),p&&(this.y+=y),this.save(),null!=n.opacity&&this._doOpacity(n.opacity,null),b&&this.rotate(b,{origin:[c,u]}),this.transform(C,0,0,_,S,w),this.addContent(`/${a.label} Do`),this.restore(),this},openImage(t){let e;return"string"==typeof t&&(e=this._imageRegistry[t]),e||(e=PDFImage.open(t,`I${++this._imageCount}`),"string"!=typeof t||(this._imageRegistry[t]=e)),e}}),mixin({annotate(t,e,i,n,r){let{structParent:s,color:o,...a}=r;a.Type="Annot",a.Rect=this._convertRect(t,e,i,n),a.Border=[0,0,0],"Link"===a.Subtype&&void 0===a.F&&(a.F=4),"Link"!==a.Subtype&&null==a.C&&(a.C=this._normalizeColor(o||[0,0,0])),"string"==typeof a.Dest&&(a.Dest=new String(a.Dest));let h=this.ref(a);if(this.page.annotations.push(h),"function"==typeof s?.add){let t=new PDFAnnotationReference(h);s.add(t)}return h.end(),this},note(t,e,i,n,r,s){let o={...s,Subtype:"Text",Contents:new String(r)};return null==o.Name&&(o.Name="Comment"),null==o.color&&(o.color=[243,223,92]),this.annotate(t,e,i,n,o)},goTo(t,e,i,n,r,s){let o={...s,Subtype:"Link",A:this.ref({S:"GoTo",D:new String(r)})};return o.A.end(),this.annotate(t,e,i,n,o)},link(t,e,i,n,r,s){let o={...s,Subtype:"Link"};if("number"==typeof r){let t=this._root.data.Pages.data;if(r>=0&&r<t.Kids.length)o.A=this.ref({S:"GoTo",D:[t.Kids[r],"XYZ",null,null,null]}),o.A.end();else throw Error(`The document has no page ${r}`)}else o.A=this.ref({S:"URI",URI:new String(r)}),o.A.end();return o.structParent&&!o.Contents&&(o.Contents=new String("")),this.annotate(t,e,i,n,o)},_markup(t,e,i,n,r){let[s,o,a,h]=this._convertRect(t,e,i,n);return this.annotate(t,e,i,n,{...r,QuadPoints:[s,h,a,h,s,o,a,o],Contents:new String})},highlight(t,e,i,n,r){let s={...r,Subtype:"Highlight"};return null==s.color&&(s.color=[241,238,148]),this._markup(t,e,i,n,s)},underline(t,e,i,n,r){let s={...r,Subtype:"Underline"};return this._markup(t,e,i,n,s)},strike(t,e,i,n,r){let s={...r,Subtype:"StrikeOut"};return this._markup(t,e,i,n,s)}
145,lineAnnotation(t,e,i,n,r){let s={...r,Subtype:"Line",Contents:new String,L:[t,this.page.height-e,i,this.page.height-n]};return this.annotate(t,e,i,n,s)},rectAnnotation(t,e,i,n,r){let s={...r,Subtype:"Square",Contents:new String};return this.annotate(t,e,i,n,s)},ellipseAnnotation(t,e,i,n,r){let s={...r,Subtype:"Circle",Contents:new String};return this.annotate(t,e,i,n,s)},textAnnotation(t,e,i,n,r,s){let o={...s,Subtype:"FreeText",Contents:new String(r),DA:new String};return this.annotate(t,e,i,n,o)},fileAnnotation(t,e,i,n,r={},s){let o=this.file(r.src,Object.assign({hidden:!0},r)),a={...s,Subtype:"FileAttachment",FS:o};return a.Contents?a.Contents=new String(a.Contents):o.data.Desc&&(a.Contents=new String(o.data.Desc)),this.annotate(t,e,i,n,a)},_convertRect(t,e,i,n){let r=e;e+=n;let s=t+i,[o,a,h,l,d,c]=this._ctm;return e=a*(t=o*t+h*e+d)+l*e+c,r=a*(s=o*s+h*r+d)+l*r+c,[t,e,s,r]}}),mixin({initOutline(){this.outline=new PDFOutline(this,null,null,null)},endOutline(){if(this.outline.endOutline(),this.outline.children.length>0)return this._root.data.Outlines=this.outline.dictionary,this._root.data.PageMode=this._root.data.PageMode||"UseOutlines"}}),mixin({initMarkings(t){this.structChildren=[],t.tagged&&(this.getMarkInfoDictionary().data.Marked=!0,this.getStructTreeRoot())},markContent(t,e=null){if("Artifact"===t||e&&e.mcid){let t=0;
145for(this.page.markings.forEach(e=>{(t||e.structContent||"Artifact"===e.tag)&&t++});t--;)this.endMarkedContent()}if(!e)return this.page.markings.push({tag:t}),this.addContent(`/${t} BMC`),this;this.page.markings.push({tag:t,options:e});let i={};return void 0!==e.mcid&&(i.MCID=e.mcid),"Artifact"===t&&("string"==typeof e.type&&(i.Type=e.type),Array.isArray(e.bbox)&&(i.BBox=[e.bbox[0],this.page.height-e.bbox[3],e.bbox[2],this.page.height-e.bbox[1]]),Array.isArray(e.attached)&&e.attached.every(t=>"string"==typeof t)&&(i.Attached=e.attached)),"Span"===t&&(e.lang&&(i.Lang=new String(e.lang)),e.alt&&(i.Alt=new String(e.alt)),e.expanded&&(i.E=new String(e.expanded)),e.actual&&(i.ActualText=new String(e.actual))),this.addContent(`/${t} ${PDFObject.convert(i)} BDC`),this},markStructureContent(t,e={}){let i=this.getStructParentTree().get(this.page.structParentTreeKey),n=i.length;i.push(null),this.markContent(t,{...e,mcid:n});let r=new PDFStructureContent(this.page.dictionary,n);return this.page.markings.slice(-1)[0].structContent=r,r},endMarkedContent(){return this.page.markings.pop(),this.addContent("EMC"),this._textOptions&&(delete this._textOptions.link,delete this._textOptions.goTo,delete this._textOptions.destination,delete this._textOptions.underline,delete this._textOptions.strike),this},struct(t,e={},i=null){return new PDFStructureElement(this,t,e,i)},addStructure(t){let e=this.getStructTreeRoot();return t.setParent(e),t.setAttached(),this.structChildren.push(t),e.data.K||(e.data.K=[]),e.data.K.push(t.dictionary),this},initPageMarkings(t){t.forEach(t=>{if(t.structContent){let e=t.structContent,i=this.markStructureContent(t.tag,t.options);e.push(i),this.page.markings.slice(-1)[0].structContent=e}else this.markContent(t.tag,t.options)})},endPageMarkings(t){let e=t.markings;return e.forEach(()=>t.write("EMC")),t.markings=[],e},getMarkInfoDictionary(){return this._root.data.MarkInfo||(this._root.data.MarkInfo=this.ref({})),this._root.data.MarkInfo},hasMarkInfoDictionary(){return!!this._root.data.MarkInfo},getStructTreeRoot(){return this._root.data.StructTreeRoot||(this._root.data.StructTreeRoot=this.ref({Type:"StructTreeRoot",ParentTree:new PDFNumberTree,ParentTreeNextKey:0})),this._root.data.StructTreeRoot},getStructParentTree(){return this.getStructTreeRoot().data.ParentTree},createStructParentTreeNextKey(){this.getMarkInfoDictionary();let t=this.getStructTreeRoot(),e=t.data.ParentTreeNextKey++;return t.data.ParentTree.add(e,[]),e},endMarkings(){let t=this._root.data.StructTreeRoot;t&&(t.end(),this.structChildren.forEach(t=>t.end())),this._root.data.MarkInfo&&this._root.data.MarkInfo.end()}}),mixin({initForm(){if(!this._font)throw Error("Must set a font before calling initForm method");this._acroform={fonts:{},defaultFont:this._font.name},this._acroform.fonts[this._font.id]=this._font.ref();let t={Fields:[],NeedAppearances:!0,DA:new String(`/${this._font.id} 0 Tf 0 g`),DR:{Font:{}}};t.DR.Font[this._font.id]=this._font.ref();let e=this.ref(t);return this._root.data.AcroForm=e,this},endAcroForm(){if(this._root.data.AcroForm){if(!Object.keys(this._acroform.fonts).length&&!this._acroform.defaultFont)throw Error("No fonts specified for PDF form");let t=this._root.data.AcroForm.data.DR.Font;Object.keys(this._acroform.fonts).forEach(e=>{t[e]=this._acroform.fonts[e]}),this._root.data.AcroForm.data.Fields.forEach(t=>{this._endChild(t)}),this._root.data.AcroForm.end()}return this},_endChild(t){return Array.isArray(t.data.Kids)&&(t.data.Kids.forEach(t=>{this._endChild(t)}),t.end()),this},formField(t,e={}){let i=this._fieldDict(t,null,e),n=this.ref(i);return this._addToParent(n),n},formAnnotation(t,e,i,n,r,s,o={}){let a=this._fieldDict(t,e,o);a.Subtype="Widget",void 0===a.F&&(a.F=4),this.annotate(i,n,r,s,a);let h=this.page.annotations[this.page.annotations.length-1];return this._addToParent(h)},formText(t,e,i,n,r,s={}){return this.formAnnotation(t,"text",e,i,n,r,s)},formPushButton(t,e,i,n,r,s={}){return this.formAnnotation(t,"pushButton",e,i,n,r,s)},formCombo(t,e,i,n,r,s={}){return this.formAnnotation(t,"combo",e,i,n,r,s)},formList(t,e,i,n,r,s={}){return this.formAnnotation(t,"list",e,i,n,r,s)},formRadioButton(t,e,i,n,r,s={}){return this.formAnnotation(t,"radioButton",e,i,n,r,s)},formCheckbox(t,e,i,n,r,s={}){return this.formAnnotation(t,"checkbox",e,i,n,r,s)},_addToParent(t){let e=t.data.Parent;return e?(e.data.Kids||(e.data.Kids=[]),e.data.Kids.push(t)):this._root.data.AcroForm.data.Fields.push(t),this},_fieldDict(t,e,i={}){if(!this._acroform)throw Error("Call document.initForm() method before adding form elements to document");let n={};
145return function(t,e,i){let n=e.Ff??0;if("text"===t)i.FT="Tx";else if("pushButton"===t)i.FT="Btn",n|=tL.pushButton;else if("radioButton"===t)i.FT="Btn",n|=tL.radioButton;else if("checkbox"===t)i.FT="Btn";else if("combo"===t)i.FT="Ch",n|=tL.combo;else if("list"===t)i.FT="Ch";else if(t)throw Error(`Invalid form annotation type '${t}'`);Object.keys(e).forEach(t=>{tL[t]&&e[t]&&(n|=tL[t])}),0!==n&&(i.Ff=n)}(e,i,n),function(t,e){let i=tz[t.align];"number"==typeof i&&0!==i&&(e.Q=i)}(i,n),this._mapFont(i,n),Array.isArray(i.select)&&i.select.length&&(n.Opt=i.select.map(t=>"string"==typeof t?new String(t):t)),Object.keys(tW).forEach(t=>{if(t in i){let e=i[t]??"";n[tW[t]]="string"==typeof e?new String(e):e}}),i.MK?.CA&&(n.MK={CA:new String(i.MK.CA)}),i.label&&(n.MK=i.MK??{},n.MK.CA=new String(i.label)),this._mapColors(i,n),function(t,e){let i=t.format;if(i?.type){let n,r;let s="";if(void 0!==tj[i.type])n="AFSpecial_Keystroke",r="AFSpecial_Format",s=tj[i.type];else{let t=i.type.charAt(0).toUpperCase()+i.type.slice(1);if(n=`AF${t}_Keystroke`,r=`AF${t}_Format`,"date"===i.type)n+="Ex",r+="Ex",s='"'+String(i.param)+'"';else if("time"===i.type)s=String(i.param);else if("number"===i.type){let t=Object.assign({},t$.number,i);s=String([String(t.nDec),t.sepComma?"0":"1",'"'+t.negStyle+'"',"null",'"'+t.currency+'"',String(t.currencyPrepend)].join(","))}else if("percent"===i.type){let t=Object.assign({},t$.percent,i);s=String([String(t.nDec),t.sepComma?"0":"1"].join(","))}}e.AA=t.AA??{},e.AA.K={S:"JavaScript",JS:new String(`${n}(${s});`)},e.AA.F={S:"JavaScript",JS:new String(`${r}(${s});`)}}}(i,n),n.T=new String(t),i.parent&&(n.Parent=i.parent),n},_mapColors(t,e){let i=this._normalizeColor(t.backgroundColor);i&&(e.MK=e.MK?e.MK:{},e.MK.BG=i),(i=this._normalizeColor(t.borderColor))&&(e.MK||(e.MK={}),e.MK.BC=i)},_mapFont(t,e){let{_acroform:i,_font:n}=this;if(null==i.fonts[n.id]&&(i.fonts[n.id]=n.ref()),i.defaultFont!==n.name){e.DR={Font:{}};let i=t.fontSize||0;e.DR.Font[n.id]=n.ref(),e.DA=new String(`/${n.id} ${i} Tf 0 g`)}}}),mixin({file(t,e={}){var i;let n,r;e.name=e.name||t,e.relationship=e.relationship||"Unspecified";let s={Type:"EmbeddedFile",Params:{}};if(!t)throw Error("No src specified");if(t instanceof Uint8Array)n=t;else if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{let e=/^data:(.*?);base64,(.*)$/.exec(t);if(e)e[1]&&(s.Subtype=escapeName(e[1])),n=fromBase64(e[2]);else{if(!(n=tE.readFileSync(t)))throw Error(`Could not read contents of file at filepath ${t}`);let{birthtime:e,ctime:i}=tE.statSync(t);s.Params.CreationDate=e,s.Params.ModDate=i}}
145e.creationDate instanceof Date&&(s.Params.CreationDate=e.creationDate),e.modifiedDate instanceof Date&&(s.Params.ModDate=e.modifiedDate),e.type&&(s.Subtype=escapeName(e.type));let o=(i=new Uint8Array(n),(0,d.ci)(md5Hash(i)));s.Params.CheckSum=new String(o),s.Params.Size=n.byteLength,this._fileRegistry||(this._fileRegistry={});let a=this._fileRegistry[e.name];a&&s.Subtype===a.Subtype&&s.Params.CheckSum.toString()===a.Params.CheckSum.toString()&&s.Params.Size===a.Params.Size&&s.Params.CreationDate.getTime()===a.Params.CreationDate.getTime()&&(void 0===s.Params.ModDate&&void 0===a.Params.ModDate||s.Params.ModDate.getTime()===a.Params.ModDate.getTime())?r=a.ref:((r=this.ref(s)).end(n),this._fileRegistry[e.name]={...s,ref:r});let h={Type:"Filespec",AFRelationship:e.relationship,F:new String(e.name),EF:{F:r},UF:new String(e.name)};e.description&&(h.Desc=new String(e.description));let l=this.ref(h);return l.end(),e.hidden||this.addNamedEmbeddedFile(e.name,l),this._root.data.AF?this._root.data.AF.push(l):this._root.data.AF=[l],l}}),mixin({_importSubset(t){Object.assign(this,t)},initSubset(t){switch(t.subset){case"PDF/A-1":case"PDF/A-1a":case"PDF/A-1b":case"PDF/A-2":case"PDF/A-2a":case"PDF/A-2b":case"PDF/A-3":case"PDF/A-3a":case"PDF/A-3b":this._importSubset(tG),this.initPDFA(t.subset);break;case"PDF/UA":this._importSubset(tK),this.initPDFUA()}}}),mixin({initTables(){this._tableIndex=0},table(t){return new PDFTable(this,t)}}),function(t,e,i={}){if("string"!=typeof t)throw TypeError(`Expected a string for path, got ${typeof t}`);if(void 0===e){tk.delete(t);return}if(!(e instanceof Uint8Array))throw TypeError(`Expected a Uint8Array or undefined for data, got ${typeof e}`);if(null===i||"object"!=typeof i)throw TypeError("Expected options to be an object");let n=Date.now();tk.set(t,{data:e,birthtime:getTimestamp(i.birthtime,"birthtime",n),ctime:getTimestamp(i.ctime,"ctime",n)})}(tN,fromBase64("AAAL0AAAAAACAAAAbW50clJHQiBYWVogB98AAgAPAAAAAAAAYWNzcAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAPbWAAEAAAAA0y0AAAAAPQ6y3q6Tl76bZybOjApDzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQZGVzYwAAAUQAAABjYlhZWgAAAagAAAAUYlRSQwAAAbwAAAgMZ1RSQwAAAbwAAAgMclRSQwAAAbwAAAgMZG
1451kZAAACcgAAACIZ1hZWgAAClAAAAAUbHVtaQAACmQAAAAUbWVhcwAACngAAAAkYmtwdAAACpwAAAAUclhZWgAACrAAAAAUdGVjaAAACsQAAAAMdnVlZAAACtAAAACHd3RwdAAAC1gAAAAUY3BydAAAC2wAAAA3Y2hhZAAAC6QAAAAsZGVzYwAAAAAAAAAJc1JHQjIwMTQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAAAkoAAAD4QAALbPY3VydgAAAAAAAAQAAAAABQAKAA8AFAAZAB4AIwAoAC0AMgA3ADsAQABFAEoATwBUAFkAXgBjAGgAbQByAHcAfACBAIYAiwCQAJUAmgCfAKQAqQCuALIAtwC8AMEAxgDLANAA1QDbAOAA5QDrAPAA9gD7AQEBBwENARMBGQEfASUBKwEyATgBPgFFAUwBUgFZAWABZwFuAXUBfAGDAYsBkgGaAaEBqQGxAbkBwQHJAdEB2QHhAekB8gH6AgMCDAIUAh0CJgIvAjgCQQJLAlQCXQJnAnECegKEAo4CmAKiAqwCtgLBAssC1QLgAusC9QMAAwsDFgMhAy0DOANDA08DWgNmA3IDfgOKA5YDogOuA7oDxwPTA+AD7AP5BAYEEwQgBC0EOwRIBFUEYwRxBH4EjASaBKgEtgTEBNME4QTwBP4FDQUcBSsFOgVJBVgFZwV3BYYFlgWmBbUFxQXVBeUF9gYGBhYGJwY3BkgGWQZqBnsGjAadBq8GwAbRBuMG9QcHBxkHKwc9B08HYQd0B4YHmQesB78H0gflB/gICwgfCDIIRghaCG4IggiWCKoIvgjSCOcI+wkQCSUJOglPCWQJeQmPCaQJugnPCeUJ+woRCicKPQpUCmoKgQqYCq4KxQrcCvMLCwsiCzkLUQtpC4ALmAuwC8gL4Qv5DBIMKgxDDFwMdQyODKcMwAzZDPMNDQ0mDUANWg10DY4NqQ3DDd4N+A4TDi4OSQ5kDn8Omw62DtIO7g8JDyUPQQ9eD3oPlg+zD88P7BAJECYQQxBhEH4QmxC5ENcQ9RETETERTxFtEYwRqhHJEegSBxImEkUSZBKEEqMSwxLjEwMTIxNDE2MTgxOkE8UT5RQGFCcUSRRqFIsUrRTOFPAVEhU0FVYVeBWbFb0V4BYDFiYWSRZsFo8WshbWFvoXHRdBF2UXiReuF9IX9xgbGEAYZRiKGK8Y1Rj6GSAZRRlrGZEZtxndGgQaKhpRGncanhrFGuwbFBs7G2MbihuyG9ocAhwqHFIcexyjHMwc9R0eHUcdcB2ZHcMd7B4WHkAeah6UHr4e6R8THz4faR+UH78f6iAVIEEgbCCYIMQg8CEcIUghdSGhIc4h+yInIlUigiKvIt0jCiM4I2YjlCPCI/AkHyRNJHwkqyTaJQklOCVoJZclxyX3JicmVyaHJrcm6CcYJ0kneierJ9woDSg/KHEooijUKQYpOClrKZ0p0CoCKjUqaCqbKs8rAis2K2krnSvRLAUsOSxuLKIs1y0MLUEtdi2rLeEuFi5MLoIuty7uLyQvWi+RL8cv/jA1MGwwpDDbMRIxSjGCMbox8jIqMmMymzLUMw0zRjN/M7gz8TQrNGU0njTYNRM1TTWHNcI1/TY3NnI2rjbpNyQ3YDecN9c4FDhQOIw4yDkFOUI5fzm8Ofk6Njp0OrI67zstO2s7qjvoPCc8ZTykPOM9Ij1hPaE94D4gPmA+oD7gPyE/YT+iP+JAI0BkQKZA50EpQWpBrEHuQjBCckK1QvdDOkN9Q8BEA0RHRIpEzkUSRVVFmkXeRiJGZ0arRvBHNUd7R8BIBUhLSJFI10kdSWNJqUnwSjdKfUrESwxLU0uaS+JMKkxyTLpNAk1KTZNN3E4lTm5Ot08AT0lPk0/dUCdQcVC7UQZRUFGbUeZSMVJ8UsdTE1NfU6pT9lRCVI9U21UoVXVVwlYPVlxWqVb3V0RXklfgWC9YfVjLWRpZaVm4WgdaVlqmWvVbRVuVW+VcNVyGXNZdJ114XcleGl5sXr1fD19hX7NgBWBXYKpg/GFPYaJh9WJJYpxi8GNDY5dj62RAZJRk6WU9ZZJl52Y9ZpJm6Gc9Z5Nn6Wg/aJZo7GlDaZpp8WpIap9q92tPa6dr/2xXbK9tCG1gbbluEm5rbsRvHm94b9FwK3CGcOBxOnGVcfByS3KmcwFzXXO4dBR0cHTMdSh1hXXhdj52m3b4d1Z3s3gReG54zHkqeYl553pGeqV7BHtje8J8IXyBfOF9QX2hfgF+Yn7CfyN/hH/lgEeAqIEKgWuBzYIwgpKC9INXg7qEHYSAhOOFR4Wrhg6GcobXhzuHn4gEiGmIzokziZmJ/opkisqLMIuWi/yMY4zKjTGNmI3/jmaOzo82j56QBpBukNaRP5GokhGSepLjk02TtpQglIqU9JVflcmWNJaflwqXdZfgmEyYuJkkmZCZ/JpomtWbQpuvnByciZz3nWSd0p5Anq6fHZ+Ln/qgaaDYoUehtqImopajBqN2o+akVqTHpTilqaYapoum/adup+CoUqjEqTepqaocqo+rAqt1q+msXKzQrUStuK4trqGvFq+LsACwdbDqsWCx1rJLssKzOLOutCW0nLUTtYq2AbZ5tvC3aLfguFm40blKucK6O7q1uy67p7whvJu9Fb2Pvgq+hL7/v3q/9cBwwOzBZ8Hjwl/C28NYw9TEUcTOxUvFyMZGxsPHQce/yD3IvMk6ybnKOMq3yzbLtsw1zLXNNc21zjbOts83z7jQOdC60TzRvtI/0sHTRNPG1EnUy9VO1dHWVdbY11zX4Nhk2OjZbNnx2nba+9uA3AXcit0Q3ZbeHN6i3ynfr+A24L3hROHM4lPi2+Nj4+vkc+T85YTmDeaW5x/nqegy6LzpRunQ6lvq5etw6/vshu0R7ZzuKO6070DvzPBY8OXxcvH/8ozzGfOn9DT0wvVQ9d72bfb794r4Gfio+Tj5x/pX+uf7d/wH/Jj9Kf26/kv+3P9t//9kZXNjAAAAAAAAAC5JRUMgNjE5NjYtMi0xIERlZmF1bHQgUkdCIENvbG91ciBTcGFjZSAtIHNSR0IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAAAAAUAAAAAAAAG1lYXMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlhZWiAAAAAAAAAAngAAAKQAAACHWFlaIAAAAAAAAG+iAAA49QAAA5BzaWcgAAAAAENSVCBkZXNjAAAAAAAAAC1SZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDIDYxOTY2LTItMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAPbWAAEAAAAA0y10ZXh0AAAAAENvcHlyaWdodCBJbnRlcm5hdGlvbmFsIENvbG9yIENvbnNvcnRpdW0sIDIwMTUAAHNmMzIAAAAAAAEMRAAABd////MmAAAHlAAA/Y////uh///9ogAAA9sAAMB1"))}}]);
146//# sourceMappingURL=42d149cc-6ada3d2beb0d65f0.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.