MCPcopy
hub / github.com/alias-rahil/handwritten.js / dash

Function dash

docs/handwritten.js:290–290  ·  view source on GitHub ↗
(a,t={})

Source from the content-addressed store, hash-verified

288`),e}}class Qe{static open(e,a,t,r){let i;if("string"==typeof a){if(He.isStandardFont(a))return new He(e,a,r);a=Y.readFileSync(a)}if(n.isBuffer(a)?i=L.create(a,t):a instanceof Uint8Array?i=L.create(new n(a),t):a instanceof ArrayBuffer&&(i=L.create(new n(new Uint8Array(a)),t)),null==i)throw new Error("Not a supported font format or standard PDF font.");return new Ze(e,i,r)}}class $e extends D.EventEmitter{constructor(e,a){super(),this.document=e,this.indent=a.indent||0,this.characterSpacing=a.characterSpacing||0,this.wordSpacing=0===a.wordSpacing,this.columns=a.columns||1,this.columnGap=null==a.columnGap?18:a.columnGap,this.lineWidth=(a.width-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=a.ellipsis,this.continuedX=0,this.features=a.features,null==a.height?this.maxY=this.document.page.maxY():(this.height=a.height,this.maxY=this.startY+a.height),this.on("firstLine",e=>{const a=this.continuedX||this.indent;return this.document.x+=a,this.lineWidth-=a,this.once("line",()=>{if(this.document.x-=a,this.lineWidth+=a,e.continued&&!this.continuedX&&(this.continuedX=this.indent),!e.continued)return this.continuedX=0})}),this.on("lastLine",e=>{const{align:a}=e;return"justify"===a&&(e.align="left"),this.lastLine=!0,this.once("line",()=>(this.document.y+=e.paragraphGap||0,e.align=a,this.lastLine=!1))})}wordWidth(e){return this.document.widthOfString(e,this)+this.characterSpacing+this.wordSpacing}eachWord(e,a){let t;const r=new M(e);let n=null;for(const s=Object.create(null);t=r.nextBreak();){var i;let r=e.slice((null==n?void 0:n.position)||0,t.position),l=null==s[r]?s[r]=this.wordWidth(r):s[r];if(l>this.lineWidth+this.continuedX){let e=n;for(const n={};r.length;){var o,c;l>this.spaceLeft?(o=K(this.spaceLeft/(l/r.length)),l=this.wordWidth(r.slice(0,o)),c=l<=this.spaceLeft&&o<r.length):o=r.length;for(let e=l>this.spaceLeft&&0<o;e||c;)e?(l=this.wordWidth(r.slice(0,--o)),e=l>this.spaceLeft&&0<o):(l=this.wordWidth(r.slice(0,++o)),e=l>this.spaceLeft&&0<o,c=l<=this.spaceLeft&&o<r.length);if(0===o&&this.spaceLeft===this.lineWidth&&(o=1),n.required=t.required||o<r.length,i=a(r.slice(0,o),l,n,e),e={required:!1},r=r.slice(o),l=this.wordWidth(r),!1===i)break}}else i=a(r,l,t,n);if(!1===i)break;n=t}}wrap(e,a){null!=a.indent&&(this.indent=a.indent),null!=a.characterSpacing&&(this.characterSpacing=a.characterSpacing),null!=a.wordSpacing&&(this.wordSpacing=a.wordSpacing),null!=a.ellipsis&&(this.ellipsis=a.ellipsis);const t=this.document.y+this.document.currentLineHeight(!0);(this.document.y>this.maxY||t>this.maxY)&&this.nextSection();let r="",n=0,i=0,o=0,{y:c}=this.document;const s=()=>(a.textWidth=n+this.wordSpacing*(i-1),a.wordCount=i,a.lineWidth=this.lineWidth,({y:c}=this.document),this.emit("line",r,a,this),o++);return this.emit("sectionStart",a,this),this.eachWord(e,(e,t,o,c)=>{if((null==c||c.required)&&(this.emit("firstLine",a,this),this.spaceLeft=this.lineWidth),t<=this.spaceLeft&&(r+=e,n+=t,i++),o.required||t>this.spaceLeft){const c=this.document.currentLineHeight(!0);if(null!=this.height&&this.ellipsis&&this.document.y+2*c>this.maxY&&this.column>=this.columns){for(!0===this.ellipsis&&(this.ellipsis="\u2026"),r=r.replace(/\s+$/,""),n=this.wordWidth(r+this.ellipsis);r&&n>this.lineWidth;)r=r.slice(0,-1).replace(/\s+$/,""),n=this.wordWidth(r+this.ellipsis);n<=this.lineWidth&&(r+=this.ellipsis),n=this.wordWidth(r)}if(o.required&&(t>this.spaceLeft&&(s(),r=e,n=t,i=1),this.emit("lastLine",a,this)),s(),this.document.y+c>this.maxY){const e=this.nextSection();if(!e)return i=0,r="",!1}return o.required?(this.spaceLeft=this.lineWidth,r="",n=0,i=0):(this.spaceLeft=this.lineWidth-t,r=e,n=t,i=1)}return this.spaceLeft-=t}),0<i&&(this.emit("lastLine",a,this),s()),this.emit("sectionEnd",a,this),!0===a.continued?(1<o&&(this.continuedX=0),this.continuedX+=a.textWidth||0,this.document.y=c):this.document.x=this.startX}nextSection(e){if(this.emit("sectionEnd",e,this),++this.column>this.columns){if(null!=this.height)return!1;this.document.addPage(),this.column=1,this.startY=this.document.page.margins.top,this.maxY=this.document.page.maxY(),this.document.x=this.startX,this.document._fillColor&&this.document.fillColor(...this.document._fillColor),this.emit("pageBreak",e,this)}else this.document.x+=this.lineWidth+this.columnGap,this.document.y=this.startY,this.emit("columnBreak",e,this);return this.emit("sectionStart",e,this),!0}}const{number:ea}=J;const aa=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],ta={1:"DeviceGray",3:"DeviceRGB",4:"DeviceCMYK"};class ra{constructor(e,a){let t;if(this.data=e,this.label=a,65496!==this.data.readUInt16BE(0))throw"SOI not found in JPEG";let r=2;for(;r<this.data.length&&(t=this.data.readUInt16BE(r),r+=2,!aa.includes(t));)r+=this.data.readUInt16BE(r);if(!aa.includes(t))throw"Invalid JPEG.";r+=2,this.bits=this.data[r++],this.height=this.data.readUInt16BE(r),r+=2,this.width=this.data.readUInt16BE(r),r+=2;const n=this.data[r++];this.colorSpace=ta[n],this.obj=null}embed(e){if(!this.obj)return this.obj=e.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}}class na{constructor(e,a){this.label=a,this.image=new F(e),this.width=this.image.width,this.height=this.image.height,this.imgData=this.image.imgData,this.obj=null}embed(e){let a=!1;if(this.document=e,this.obj)return;const t=this.image.hasAlphaChannel,r=1===this.image.interlaceMethod;if(this.obj=this.document.ref({Type:"XObject",Subtype:"Image",BitsPerComponent:t?8:this.image.bits,Width:this.width,Height:this.height,Filter:"FlateDecode"}),!t){const e=this.document.ref({Predictor:r?1:15,Colors:this.image.colors,BitsPerComponent:this.image.bits,Columns:this.width});this.obj.data.DecodeParms=e,e.end()}if(0===this.image.palette.length)this.obj.data.ColorSpace=this.image.colorSpace;else{const e=this.document.ref();e.end(new n(this.image.palette)),this.obj.data.ColorSpace=["Indexed","DeviceRGB",this.image.palette.length/3-1,e]}if(null!=this.image.transparency.grayscale){const e=this.image.transparency.grayscale;this.obj.data.Mask=[e,e]}else if(this.image.transparency.rgb){const{rgb:e}=this.image.transparency,a=[];for(let t of e)a.push(t,t);this.obj.data.Mask=a}else{if(this.image.transparency.indexed)return a=!0,this.loadIndexedAlphaChannel();if(t)return a=!0,this.splitAlphaChannel()}return r&&!a?this.decodeData():void this.finalize()}finalize(){if(this.alphaChannel){const e=this.document.ref({Type:"XObject",Subtype:"Image",Height:this.height,Width:this.width,BitsPerComponent:8,Filter:"FlateDecode",ColorSpace:"DeviceGray",Decode:[0,1]});e.end(this.alphaChannel),this.obj.data.SMask=e}return this.obj.end(this.imgData),this.image=null,this.imgData=null}splitAlphaChannel(){return this.image.decodePixels(e=>{let t,r;const o=this.image.colors,c=this.width*this.height,s=new n(c*o),l=new n(c);let u=r=t=0;const d=e.length,X=16===this.image.bits?1:0;for(;u<d;){for(let a=0;a<o;a++)s[r++]=e[u++],u+=X;l[t++]=e[u++],u+=X}return this.imgData=I.deflateSync(s),this.alphaChannel=I.deflateSync(l),this.finalize()})}loadIndexedAlphaChannel(){const e=this.image.transparency.indexed;return this.image.decodePixels(a=>{const t=new n(this.width*this.height);let r=0;for(let n=0,i=a.length;n<i;n++)t[r++]=e[a[n]];return this.alphaChannel=I.deflateSync(t),this.finalize()})}decodeData(){this.image.decodePixels(e=>{this.imgData=I.deflateSync(e),this.finalize()})}}class ia{static open(e,a){let t;if(n.isBuffer(e))t=e;else if(e instanceof ArrayBuffer)t=new n(new Uint8Array(e));else{let a;if(a=/^data:.+;base64,(.*)$/.exec(e))t=new n(a[1],"base64");else if(t=Y.readFileSync(e),!t)return}if(255===t[0]&&216===t[1])return new ra(t,a);if(137===t[0]&&"PNG"===t.toString("ascii",1,4))return new na(t,a);throw new Error("Unknown image format.")}}class oa{constructor(e,a,t,r,n={expanded:!1}){this.document=e,this.options=n,this.outlineData={},null!==r&&(this.outlineData.Dest=[r.dictionary,"Fit"]),null!==a&&(this.outlineData.Parent=a),null!==t&&(this.outlineData.Title=new String(t)),this.dictionary=this.document.ref(this.outlineData),this.children=[]}addItem(e,a={expanded:!1}){const t=new oa(this.document,this.dictionary,e,this.document.page,a);return this.children.push(t),t}endOutline(){if(0<this.children.length){this.options.expanded&&(this.outlineData.Count=this.children.length);const e=this.children[0],a=this.children[this.children.length-1];this.outlineData.First=e.dictionary,this.outlineData.Last=a.dictionary;for(let e=0,a=this.children.length;e<a;e++){const a=this.children[e];0<e&&(a.outlineData.Prev=this.children[e-1].dictionary),e<this.children.length-1&&(a.outlineData.Next=this.children[e+1].dictionary),a.endOutline()}}return this.dictionary.end()}}const ca={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},sa={left:0,center:1,right:2},la={value:"V",defaultValue:"DV"},ua={zip:"0",zipPlus4:"1",zip4:"1",phone:"2",ssn:"3"},da={number:{nDec:0,sepComma:!1,negStyle:"MinusBlack",currency:"",currencyPrepend:!0},percent:{nDec:0,sepComma:!1}};class Xa extends R.Readable{constructor(e={}){switch(super(e),this.options=e,e.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;const a=this.ref({Type:"Pages",Count:0,Kids:[]}),t=this.ref({Dests:new j});if(this._root=this.ref({Type:"Catalog",Pages:a,Names:t}),this.page=null,this.initColor(),this.initVector(),this.initFonts(e.font),this.initText(),this.initImages(),this.initOutline(),this.info={Producer:"PDFKit",Creator:"PDFKit",CreationDate:new Date},this.options.info)for(let e in this.options.info){const a=this.options.info[e];this.info[e]=a}this._id=fe.generateFileID(this.info),this._security=fe.create(this,e),this._write(`%PDF-${this.version}`),this._write("%\xFF\xFF\xFF\xFF"),!1!==this.options.autoFirstPage&&this.addPage()}addPage(e){null==e&&({options:e}=this),this.options.bufferPages||this.flushPages(),this.page=new ee(this,e),this._pageBuffer.push(this.page);const a=this._root.data.Pages.data;return a.Kids.push(this.page.dictionary),a.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("pageAdded"),this}bufferedPageRange(){return{start:this._pageBufferStart,count:this._pageBuffer.length}}switchToPage(e){let a;if(!(a=this._pageBuffer[e-this._pageBufferStart]))throw new Error(`switchToPage(${e}) out of bounds, current buffer covers pages ${this._pageBufferStart} to ${this._pageBufferStart+this._pageBuffer.length-1}`);return this.page=a}flushPages(){const e=this._pageBuffer;this._pageBuffer=[],this._pageBufferStart+=e.length;for(let a of e)a.end()}addNamedDestination(e,...a){0===a.length&&(a=["XYZ",null,null,null]),"XYZ"===a[0]&&null!==a[2]&&(a[2]=this.page.height-a[2]),a.unshift(this.page.dictionary),this._root.data.Names.data.Dests.add(e,a)}addNamedJavaScript(e,a){this._root.data.Names.data.JavaScript||(this._root.data.Names.data.JavaScript=new j);let t={JS:new String(a),S:"JavaScript"};this._root.data.Names.data.JavaScript.add(e,t)}ref(e){const a=new Z(this,this._offsets.length+1,e);return this._offsets.push(null),this._waiting++,a}_read(){}_write(e){return n.isBuffer(e)||(e=new n(e+"\n","binary")),this.push(e),this._offset+=e.length}addContent(e){return this.page.write(e),this}_refEnd(e){if(this._offsets[e.id-1]=e.offset,0==--this._waiting&&this._ended)return this._finalize(),this._ended=!1}write(e,a){const t=new Error(`\
289PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. \
290Please pipe the document into a Node stream.\
291`);return console.warn(t.stack),this.pipe(Y.createWriteStream(e)),this.end(),this.once("end",a)}end(){for(let e in this.flushPages(),this._info=this.ref(),this.info){let a=this.info[e];"string"==typeof a&&(a=new String(a));let t=this.ref(a);t.end(),this._info.data[e]=t}for(let e in this._info.end(),this._fontFamilies){const a=this._fontFamilies[e];a.finalize()}return this.endOutline(),this._root.end(),this._root.data.Pages.end(),this._root.data.Names.end(),this.endAcroForm(),this._security&&this._security.end(),0===this._waiting?this._finalize():this._ended=!0}_finalize(){const e=this._offset;this._write("xref"),this._write(`0 ${this._offsets.length+1}`),this._write("0000000000 65535 f ");for(let e of this._offsets)e=`0000000000${e}`.slice(-10),this._write(e+" 00000 n ");const a={Size:this._offsets.length+1,Root:this._root,Info:this._info,ID:[this._id,this._id]};return this._security&&(a.Encrypt=this._security.dictionary),this._write("trailer"),this._write(J.convert(a)),this._write("startxref"),this._write(`${e}`),this._write("%%EOF"),this.push(null)}toString(){return"[object PDFDocument]"}}const ma=e=>{Object.assign(Xa.prototype,e)};ma({initColor(){return this._opacityRegistry={},this._opacityCount=0,this._gradCount=0},_normalizeColor(e){if(e instanceof Ce)return e;if("string"==typeof e)if("#"===e.charAt(0)){4===e.length&&(e=e.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i,"#$1$1$2$2$3$3"));const a=parseInt(e.slice(1),16);e=[a>>16,255&a>>8,255&a]}else _e[e]&&(e=_e[e]);return Array.isArray(e)?(3===e.length?e=e.map(e=>e/255):4===e.length&&(e=e.map(e=>e/100)),e):null},_setColor(e,a){if(e=this._normalizeColor(e),!e)return!1;const t=a?"SCN":"scn";if(e instanceof Ce)this._setColorSpace("Pattern",a),e.apply(t);else{const r=4===e.length?"DeviceCMYK":"DeviceRGB";this._setColorSpace(r,a),e=e.join(" "),this.addContent(`${e} ${t}`)}return!0},_setColorSpace(e,a){const t=a?"CS":"cs";return this.addContent(`/${e} ${t}`)},fillColor(e,a){const t=this._setColor(e,!1);return t&&this.fillOpacity(a),this._fillColor=[e,a],this},strokeColor(e,a){const t=this._setColor(e,!0);return t&&this.strokeOpacity(a),this},opacity(e){return this._doOpacity(e,e),this},fillOpacity(e){return this._doOpacity(e,null),this},strokeOpacity(e){return this._doOpacity(null,e),this},_doOpacity(e,a){let t,r;if(null!=e||null!=a){null!=e&&(e=B(0,_(1,e))),null!=a&&(a=B(0,_(1,a)));const n=`${e}_${a}`;if(this._opacityRegistry[n])[t,r]=this._opacityRegistry[n];else{t={Type:"ExtGState"},null!=e&&(t.ca=e),null!=a&&(t.CA=a),t=this.ref(t),t.end();const i=++this._opacityCount;r=`Gs${i}`,this._opacityRegistry[n]=[t,r]}return this.page.ext_gstates[r]=t,this.addContent(`/${r} gs`)}},linearGradient(e,a,t,r){return new Be(this,e,a,t,r)},radialGradient(e,a,t,r,n,i){return new xe(this,e,a,t,r,n,i)}}),ma({initVector(){return this._ctm=[1,0,0,1,0,0],this._ctmStack=[]},save(){return this._ctmStack.push(this._ctm.slice()),this.addContent("q")},restore(){return this._ctm=this._ctmStack.pop()||[1,0,0,1,0,0],this.addContent("Q")},closePath(){return this.addContent("h")},lineWidth(e){return this.addContent(`${Me(e)} w`)},_CAP_STYLES:{BUTT:0,ROUND:1,SQUARE:2},lineCap(e){return"string"==typeof e&&(e=this._CAP_STYLES[e.toUpperCase()]),this.addContent(`${e} J`)},_JOIN_STYLES:{MITER:0,ROUND:1,BEVEL:2},lineJoin(e){return"string"==typeof e&&(e=this._JOIN_STYLES[e.toUpperCase()]),this.addContent(`${e} j`)},miterLimit(e){return this.addContent(`${Me(e)} M`)},dash(a,t={}){const r=a;Array.isArray(a)||(a=[a,t.space||a]);const n=a.every(a=>e(a)&&0<a);if(!n)throw new Error(`dash(${JSON.stringify(r)}, ${JSON.stringify(t)}) invalid, lengths must be numeric and greater than zero`);return a=a.map(Me).join(" "),this.addContent(`[${a}] ${Me(t.phase||0)} d`)},undash(){return this.addContent("[] 0 d")},moveTo(e,a){return this.addContent(`${Me(e)} ${Me(a)} m`)},lineTo(e,a){return this.addContent(`${Me(e)} ${Me(a)} l`)},bezierCurveTo(e,a,t,r,n,i){return this.addContent(`${Me(e)} ${Me(a)} ${Me(t)} ${Me(r)} ${Me(n)} ${Me(i)} c`)},quadraticCurveTo(e,a,t,r){return this.addContent(`${Me(e)} ${Me(a)} ${Me(t)} ${Me(r)} v`)},rect(e,a,t,r){return this.addContent(`${Me(e)} ${Me(a)} ${Me(t)} ${Me(r)} re`)},roundedRect(e,a,t,n,i){null==i&&(i=0),i=_(i,.5*t,.5*n);const o=i*(1-Fe);return this.moveTo(e+i,a),this.lineTo(e+t-i,a),this.bezierCurveTo(e+t-o,a,e+t,a+o,e+t,a+i),this.lineTo(e+t,a+n-i),this.bezierCurveTo(e+t,a+n-o,e+t-o,a+n,e+t-i,a+n),this.lineTo(e+i,a+n),this.bezierCurveTo(e+o,a+n,e,a+n-o,e,a+n-i),this.lineTo(e,a+i),this.bezierCurveTo(e,a+o,e+o,a,e+i,a),this.closePath()},ellipse(e,a,t,r){null==r&&(r=t),e-=t,a-=r;const n=t*Fe,i=r*Fe,o=e+2*t,c=a+2*r,s=e+t,l=a+r;return this.moveTo(e,l),this.bezierCurveTo(e,l-i,s-n,a,s,a),this.bezierCurveTo(s+n,a,o,l-i,o,l),this.bezierCurveTo(o,l+i,s+n,c,s,c),this.bezierCurveTo(s-n,c,e,l+i,e,l),this.closePath()},circle(e,a,t){return this.ellipse(e,a,t)},arc(e,a,t,r,n,i){null==i&&(i=!1);const o=2*p,c=.5*p;let s=n-r;if(X(s)>o)s=o;else if(0!==s&&i!==0>s){const e=i?-1:1;s=e*o+s}const l=K(X(s)/c),u=s/l,m=u/c*Fe*t;let P=r,f=-d(P)*m,h=g(P)*m,y=e+g(P)*t,b=a+d(P)*t;this.moveTo(y,b);for(let o=0;o<l;o++){const r=y+f,n=b+h;P+=u,y=e+g(P)*t,b=a+d(P)*t,f=-d(P)*m,h=g(P)*m;const i=y-f,o=b-h;this.bezierCurveTo(r,n,i,o,y,b)}return this},polygon(...e){this.moveTo(...(e.shift()||[]));for(let a of e)this.lineTo(...(a||[]));return this.closePath()},path(e){return De.apply(this,e),this},_windingRule(e){return /even-?odd/.test(e)?"*":""},fill(e,a){return /(even-?odd)|(non-?zero)/.test(e)&&(a=e,e=null),e&&this.fillColor(e),this.addContent(`f${this._windingRule(a)}`)},stroke(e){return e&&this.strokeColor(e),this.addContent("S")},fillAndStroke(e,a,t){null==a&&(a=e);const r=/(even-?odd)|(non-?zero)/;return r.test(e)&&(t=e,e=null),r.test(a)&&(t=a,a=e),e&&(this.fillColor(e),this.strokeColor(a)),this.addContent(`B${this._windingRule(t)}`)},clip(e){return this.addContent(`W${this._windingRule(e)} n`)},transform(e,a,t,r,n,i){const o=this._ctm,[c,s,l,u,d,X]=o;o[0]=c*e+l*a,o[1]=s*e+u*a,o[2]=c*t+l*r,o[3]=s*t+u*r,o[4]=c*n+l*i+d,o[5]=s*n+u*i+X;const m=[e,a,t,r,n,i].map(e=>Me(e)).join(" ");return this.addContent(`${m} cm`)},translate(e,a){return this.transform(1,0,0,1,e,a)},rotate(e,a={}){let t;const r=e*p/180,n=g(r),i=d(r);let o=t=0;if(null!=a.origin){[o,t]=a.origin;const e=o*n-t*i,r=o*i+t*n;o-=e,t-=r}return this.transform(n,i,-i,n,o,t)},scale(e,a,t={}){let r;null==a&&(a=e),"object"==typeof a&&(t=a,a=e);let n=r=0;return null!=t.origin&&([n,r]=t.origin,n-=e*n,r-=a*r),this.transform(e,0,0,a,n,r)}}),ma({initFonts(e="Helvetica"){this._fontFamilies={},this._fontCount=0,this._fontSize=12,this._font=null,this._registeredFonts={},e&&this.font(e)},font(e,a,t){let r,n;if("number"==typeof a&&(t=a,a=null),"string"==typeof e&&this._registeredFonts[e]?(r=e,({src:e,family:a}=this._registeredFonts[e])):(r=a||e,"string"!=typeof r&&(r=null)),null!=t&&this.fontSize(t),n=this._fontFamilies[r])return this._font=n,this;const i=`F${++this._fontCount}`;return(this._font=Qe.open(this,e,a,i),n=this._fontFamilies[this._font.name])?(this._font=n,this):(r&&(this._fontFamilies[r]=this._font),this._font.name&&(this._fontFamilies[this._font.name]=this._font),this)},fontSize(e){return this._fontSize=e,this},currentLineHeight(e){return null==e&&(e=!1),this._font.lineHeight(this._fontSize,e)},registerFont(e,a,t){return this._registeredFonts[e]={src:a,family:t},this}}),ma({initText(){return this._line=this._line.bind(this),this.x=0,this.y=0,this._lineGap=0},lineGap(e){return this._lineGap=e,this},moveDown(e){return null==e&&(e=1),this.y+=this.currentLineHeight(!0)*e+this._lineGap,this},moveUp(e){return null==e&&(e=1),this.y-=this.currentLineHeight(!0)*e+this._lineGap,this},_text(e,a,t,r,n){if(r=this._initOptions(a,t,r),e=null==e?"":`${e}`,r.wordSpacing&&(e=e.replace(/\s{2,}/g," ")),r.width){let a=this._wrapper;a||(a=new $e(this,r),a.on("line",n)),this._wrapper=r.continued?a:null,this._textOptions=r.continued?r:null,a.wrap(e,r)}else for(let a of e.split("\n"))n(a,r);return this},text(e,a,t,r){return this._text(e,a,t,r,this._line)},widthOfString(e,a={}){return this._font.widthOfString(e,this._fontSize,a.features)+(a.characterSpacing||0)*(e.length-1)},heightOfString(e,a){const{x:t,y:r}=this;a=this._initOptions(a),a.height=1/0;const n=a.lineGap||this._lineGap||0;this._text(e,this.x,this.y,a,()=>this.y+=this.currentLineHeight(!0)+n);const i=this.y-r;return this.x=t,this.y=r,i},list(e,a,t,n,o){n=this._initOptions(a,t,n);const c=n.listType||"bullet",s=C(this._font.ascender/1e3*this._fontSize),l=n.bulletRadius||s/3,r=n.textIndent||("bullet"===c?5*l:2*s),u=n.bulletIndent||("bullet"===c?8*l:2*s);let d=1;const X=[],P=[],K=[];var g=function(e){let a=1;for(let t=0;t<e.length;t++){const r=e[t];Array.isArray(r)?(d++,g(r),d--):(X.push(r),P.push(d),"bullet"!==c&&K.push(a++))}};g(e);const p=function(e){switch(c){case"numbered":return`${e}.`;case"lettered":var a=m((e-1)%26+65),t=A((e-1)/26+1),r=Array(t+1).join(a);return`${r}.`;}};o=new $e(this,n),o.on("line",this._line),d=1;let f=0;return o.on("firstLine",()=>{let e;if((e=P[f++])!==d){const a=u*(e-d);this.x+=a,o.lineWidth-=a,d=e}switch(c){case"bullet":return this.circle(this.x-r+l,this.y+s/2,l),this.fill();case"numbered":case"lettered":var a=p(K[f-1]);return this._fragment(a,this.x-r,this.y,n);}}),o.on("sectionStart",()=>{const e=r+u*(d-1);return this.x+=e,o.lineWidth-=e}),o.on("sectionEnd",()=>{const e=r+u*(d-1);return this.x-=e,o.lineWidth+=e}),o.wrap(X.join("\n"),n),this},_initOptions(e={},a,t={}){"object"==typeof e&&(t=e,e=null);const r=Object.assign({},t);if(this._textOptions)for(let e in this._textOptions){const a=this._textOptions[e];"continued"!=e&&void 0===r[e]&&(r[e]=a)}return null!=e&&(this.x=e),null!=a&&(this.y=a),!1!==r.lineBreak&&(null==r.width&&(r.width=this.page.width-this.x-this.page.margins.right),r.width=B(r.width,0)),r.columns||(r.columns=0),null==r.columnGap&&(r.columnGap=18),r},_line(e,a={},t){this._fragment(e,this.x,this.y,a);const r=a.lineGap||this._lineGap||0;return t?this.y+=this.currentLineHeight(!0)+r:this.x+=this.widthOfString(e)},_fragment(e,a,t,r){var n=Math.tan;let o,c,s,l,u,d;if(e=`${e}`.replace(/\n/g,""),0===e.length)return;const X=r.align||"left";let m=r.wordSpacing||0;const P=r.characterSpacing||0;if(r.width)switch(X){case"right":u=this.widthOfString(e.replace(/\s+$/,""),r),a+=r.lineWidth-u;break;case"center":a+=r.lineWidth/2-r.textWidth/2;break;case"justify":d=e.trim().split(/\s+/),u=this.widthOfString(e.replace(/\s+/g,""),r);var K=this.widthOfString(" ")+P;m=B(0,(r.lineWidth-u)/B(1,d.length-1)-K);}if("number"==typeof r.baseline)o=-r.baseline;else{switch(r.baseline){case"svg-middle":o=.5*this._font.xHeight;break;case"middle":case"svg-central":o=.5*(this._font.descender+this._font.ascender);break;case"bottom":case"ideographic":o=this._font.descender;break;case"alphabetic":o=0;break;case"mathematical":o=.5*this._font.ascender;break;case"hanging":o=.8*this._font.ascender;break;case"top":o=this._font.ascender;break;default:o=this._font.ascender;}o=o/1e3*this._fontSize}const g=r.textWidth+m*(r.wordCount-1)+P*(e.length-1);if(null!=r.link&&this.link(a,t,g,this.currentLineHeight(),r.link),null!=r.goTo&&this.goTo(a,t,g,this.currentLineHeight(),r.goTo),null!=r.destination&&this.addNamedDestination(r.destination,"XYZ",a,t,null),r.underline||r.strike){this.save(),r.stroke||this.strokeColor(...(this._fillColor||[]));const e=10>this._fontSize?.5:A(this._fontSize/10);this.lineWidth(e);const n=r.underline?1:2;let i=t+this.currentLineHeight()/n;r.underline&&(i-=e),this.moveTo(a,i),this.lineTo(a+g,i),this.stroke(),this.restore()}if(this.save(),r.oblique){let e;e="number"==typeof r.oblique?-n(r.oblique*p/180):-.25,this.transform(1,0,0,1,a,t),this.transform(1,0,e,1,-e*o,0),this.transform(1,0,0,1,-a,-t)}this.transform(1,0,0,-1,0,this.page.height),t=this.page.height-t-o,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 ${ea(a)} ${ea(t)} Tm`),this.addContent(`/${this._font.id} ${ea(this._fontSize)} Tf`);const f=r.fill&&r.stroke?2:r.stroke?1:0;if(f&&this.addContent(`${f} Tr`),P&&this.addContent(`${ea(P)} Tc`),m){d=e.trim().split(/\s+/),m+=this.widthOfString(" ")+P,m*=1e3/this._fontSize,c=[],l=[];for(let e of d){const[a,t]=this._font.encode(e,r.features);c=c.concat(a),l=l.concat(t);const n={},i=l[l.length-1];for(let e in i){const a=i[e];n[e]=a}n.xAdvance+=m,l[l.length-1]=n}}else[c,l]=this._font.encode(e,r.features);const h=this._fontSize/1e3,b=[];let v=0,C=!1;const _=e=>{if(v<e){const a=c.slice(v,e).join(""),t=l[e-1].xAdvance-l[e-1].advanceWidth;b.push(`<${a}> ${ea(-t)}`)}return v=e},W=e=>{if(_(e),0<b.length)return this.addContent(`[${b.join(" ")}] TJ`),b.length=0};for(s=0;s<l.length;s++){const e=l[s];e.xOffset||e.yOffset?(W(s),this.addContent(`1 0 0 1 ${ea(a+e.xOffset*h)} ${ea(t+e.yOffset*h)} Tm`),W(s+1),C=!0):(C&&(this.addContent(`1 0 0 1 ${ea(a)} ${ea(t)} Tm`),C=!1),0!=e.xAdvance-e.advanceWidth&&_(s+1)),a+=e.xAdvance*h}return W(s),this.addContent("ET"),this.restore()}}),ma({initImages(){return this._imageRegistry={},this._imageCount=0},image(e,a,t,r={}){let n,i,o,c,s,l,u;"object"==typeof a&&(r=a,a=null),a=null==(l=null==a?r.x:a)?this.x:l,t=null==(u=null==t?r.y:t)?this.y:u,"string"==typeof e&&(c=this._imageRegistry[e]),c||(e.width&&e.height?c=e:c=this.openImage(e)),c.obj||c.embed(this),null==this.page.xobjects[c.label]&&(this.page.xobjects[c.label]=c.obj);let d=r.width||c.width,X=r.height||c.height;if(r.width&&!r.height){const e=d/c.width;d=c.width*e,X=c.height*e}else if(r.height&&!r.width){const e=X/c.height;d=c.width*e,X=c.height*e}else r.scale?(d=c.width*r.scale,X=c.height*r.scale):r.fit?([o,n]=r.fit,i=o/n,s=c.width/c.height,s>i?(d=o,X=o/s):(X=n,d=n*s)):r.cover&&([o,n]=r.cover,i=o/n,s=c.width/c.height,s>i?(X=n,d=n*s):(d=o,X=o/s));return(r.fit||r.cover)&&("center"===r.align?a=a+o/2-d/2:"right"===r.align&&(a=a+o-d),"center"===r.valign?t=t+n/2-X/2:"bottom"===r.valign&&(t=t+n-X)),null!=r.link&&this.link(a,t,d,X,r.link),null!=r.goTo&&this.goTo(a,t,d,X,r.goTo),null!=r.destination&&this.addNamedDestination(r.destination,"XYZ",a,t,null),this.y===t&&(this.y+=X),this.save(),this.transform(d,0,0,-X,a,t+X),this.addContent(`/${c.label} Do`),this.restore(),this},openImage(e){let a;return"string"==typeof e&&(a=this._imageRegistry[e]),a||(a=ia.open(e,`I${++this._imageCount}`),"string"==typeof e&&(this._imageRegistry[e]=a)),a}}),ma({annotate(e,a,t,r,n){for(let i in n.Type="Annot",n.Rect=this._convertRect(e,a,t,r),n.Border=[0,0,0],"Link"===n.Subtype&&"undefined"==typeof n.F&&(n.F=4),"Link"!==n.Subtype&&null==n.C&&(n.C=this._normalizeColor(n.color||[0,0,0])),delete n.color,"string"==typeof n.Dest&&(n.Dest=new String(n.Dest)),n){const e=n[i];n[i[0].toUpperCase()+i.slice(1)]=e}const i=this.ref(n);return this.page.annotations.push(i),i.end(),this},note(e,a,t,r,n,i={}){return i.Subtype="Text",i.Contents=new String(n),i.Name="Comment",null==i.color&&(i.color=[243,223,92]),this.annotate(e,a,t,r,i)},goTo(e,a,t,r,n,i={}){return i.Subtype="Link",i.A=this.ref({S:"GoTo",D:new String(n)}),i.A.end(),this.annotate(e,a,t,r,i)},link(e,a,t,r,n,i={}){if(i.Subtype="Link","number"==typeof n){const e=this._root.data.Pages.data;if(0<=n&&n<e.Kids.length)i.A=this.ref({S:"GoTo",D:[e.Kids[n],"XYZ",null,null,null]}),i.A.end();else throw new Error(`The document has no page ${n}`)}else i.A=this.ref({S:"URI",URI:new String(n)}),i.A.end();return this.annotate(e,a,t,r,i)},_markup(e,a,t,r,n={}){const[i,o,c,s]=this._convertRect(e,a,t,r);return n.QuadPoints=[i,s,c,s,i,o,c,o],n.Contents=new String,this.annotate(e,a,t,r,n)},highlight(e,a,t,r,n={}){return n.Subtype="Highlight",null==n.color&&(n.color=[241,238,148]),this._markup(e,a,t,r,n)},underline(e,a,t,r,n={}){return n.Subtype="Underline",this._markup(e,a,t,r,n)},strike(e,a,t,r,n={}){return n.Subtype="StrikeOut",this._markup(e,a,t,r,n)},lineAnnotation(e,a,t,r,n={}){return n.Subtype="Line",n.Contents=new String,n.L=[e,this.page.height-a,t,this.page.height-r],this.annotate(e,a,t,r,n)},rectAnnotation(e,a,t,r,n={}){return n.Subtype="Square",n.Contents=new String,this.annotate(e,a,t,r,n)},ellipseAnnotation(e,a,t,r,n={}){return n.Subtype="Circle",n.Contents=new String,this.annotate(e,a,t,r,n)},textAnnotation(e,a,t,r,n,i={}){return i.Subtype="FreeText",i.Contents=new String(n),i.DA=new String,this.annotate(e,a,t,r,i)},_convertRect(e,a,t,r){let n=a;a+=r;let i=e+t;const[o,c,s,l,u,d]=this._ctm;return e=o*e+s*a+u,a=c*e+l*a+d,i=o*i+s*n+u,n=c*i+l*n+d,[e,a,i,n]}}),ma({initOutline(){return this.outline=new oa(this,null,null,null)},endOutline(){if(this.outline.endOutline(),0<this.outline.children.length)return this._root.data.Outlines=this.outline.dictionary,this._root.data.PageMode="UseOutlines"}}),ma({initForm(){if(!this._font)throw new 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 e={Fields:[],NeedAppearances:!0,DA:new String(`/${this._font.id} 0 Tf 0 g`),DR:{Font:{}}};e.DR.Font[this._font.id]=this._font.ref();const a=this.ref(e);return this._root.data.AcroForm=a,this},endAcroForm(){if(this._root.data.AcroForm){if(!Object.keys(this._acroform.fonts).length&&!this._acroform.defaultFont)throw new Error("No fonts specified for PDF form");let e=this._root.data.AcroForm.data.DR.Font;Object.keys(this._acroform.fonts).forEach(a=>{e[a]=this._acroform.fonts[a]}),this._root.data.AcroForm.data.Fields.forEach(e=>{this._endChild(e)}),this._root.data.AcroForm.end()}return this},_endChild(e){return Array.isArray(e.data.Kids)&&(e.data.Kids.forEach(e=>{this._endChild(e)}),e.end()),this},formField(e,a={}){let t=this._fieldDict(e,null,a),r=this.ref(t);return this._addToParent(r),r},formAnnotation(e,a,t,r,n,i,o={}){let c=this._fieldDict(e,a,o);c.Subtype="Widget",c.F===void 0&&(c.F=4),this.annotate(t,r,n,i,c);let s=this.page.annotations[this.page.annotations.length-1];return this._addToParent(s)},formText(e,a,t,r,n,i={}){return this.formAnnotation(e,"text",a,t,r,n,i)},formPushButton(e,a,t,r,n,i={}){return this.formAnnotation(e,"pushButton",a,t,r,n,i)},formCombo(e,a,t,r,n,i={}){return this.formAnnotation(e,"combo",a,t,r,n,i)},formList(e,a,t,r,n,i={}){return this.formAnnotation(e,"list",a,t,r,n,i)},formRadioButton(e,a,t,r,n,i={}){return this.formAnnotation(e,"radioButton",a,t,r,n,i)},formCheckbox(e,a,t,r,n,i={}){return this.formAnnotation(e,"checkbox",a,t,r,n,i)},_addToParent(e){let a=e.data.Parent;return a?(!a.data.Kids&&(a.data.Kids=[]),a.data.Kids.push(e)):this._root.data.AcroForm.data.Fields.push(e),this},_fieldDict(e,a,t={}){if(!this._acroform)throw new Error("Call document.initForms() method before adding form elements to document");let r=Object.assign({},t);return null!==a&&(r=this._resolveType(a,t)),r=this._resolveFlags(r),r=this._resolveJustify(r),r=this._resolveFont(r),r=this._resolveStrings(r),r=this._resolveColors(r),r=this._resolveFormat(r),r.T=new String(e),r.parent&&(r.Parent=r.parent,delete r.parent),r},_resolveType(e,a){if("text"===e)a.FT="Tx";else if("pushButton"===e)a.FT="Btn",a.pushButton=!0;else if("radioButton"===e)a.FT="Btn",a.radioButton=!0;else if("checkbox"===e)a.FT="Btn";else if("combo"===e)a.FT="Ch",a.combo=!0;else if("list"===e)a.FT="Ch";else throw new Error(`Invalid form annotation type '${e}'`);return a},_resolveFormat(e){const a=e.format;if(a&&a.type){let t="",r,n;if(void 0!==ua[a.type])r=`AFSpecial_Keystroke`,n=`AFSpecial_Format`,t=ua[a.type];else{let e=a.type.charAt(0).toUpperCase()+a.type.slice(1);if(r=`AF${e}_Keystroke`,n=`AF${e}_Format`,"date"===a.type)r+="Ex",t=a.param+"";else if("time"===a.type)t=a.param+"";else if("number"===a.type){let e=Object.assign({},da.number,a);t=[e.nDec+"",e.sepComma?"0":"1","\""+e.negStyle+"\"","null","\""+e.currency+"\"",e.currencyPrepend+""].join(",")+""}else if("percent"===a.type){let e=Object.assign({},da.percent,a);t=[e.nDec+"",e.sepComma?"0":"1"].join(",")+""}}e.AA=e.AA?e.AA:{},e.AA.K={S:"JavaScript",JS:new String(`${r}(${t});`)},e.AA.F={S:"JavaScript",JS:new String(`${n}(${t});`)}}return delete e.format,e},_resolveColors(e){let a=this._normalizeColor(e.backgroundColor);return a&&(!e.MK&&(e.MK={}),e.MK.BG=a),a=this._normalizeColor(e.borderColor),a&&(!e.MK&&(e.MK={}),e.MK.BC=a),delete e.backgroundColor,delete e.borderColor,e},_resolveFlags(e){let a=0;return Object.keys(e).forEach(t=>{ca[t]&&(a|=ca[t],delete e[t])}),0!==a&&(e.Ff=e.Ff?e.Ff:0,e.Ff|=a),e},_resolveJustify(e){let a=0;return void 0!==e.align&&("number"==typeof sa[e.align]&&(a=sa[e.align]),delete e.align),0!==a&&(e.Q=a),e},_resolveFont(e){return null===this._acroform.fonts[this._font.id]&&(this._acroform.fonts[this._font.id]=this._font.ref()),this._acroform.defaultFont!==this._font.name&&(e.DR={Font:{}},e.DR.Font[this._font.id]=this._font.ref(),e.DA=new String(`/${this._font.id} 0 Tf 0 g`)),e},_resolveStrings(e){function a(e){if(Array.isArray(e))for(let a=0;a<e.length;a++)"string"==typeof e[a]?t.push(new String(e[a])):t.push(e[a])}let t=[];if(a(e.Opt),e.select&&(a(e.select),delete e.select),t.length&&(e.Opt=t),e.value||e.defaultValue);return Object.keys(la).forEach(a=>{void 0!==e[a]&&(e[la[a]]=e[a],delete e[a])}),["V","DV"].forEach(a=>{"string"==typeof e[a]&&(e[a]=new String(e[a]))}),e.MK&&e.MK.CA&&(e.MK.CA=new String(e.MK.CA)),e.label&&(e.MK=e.MK?e.MK:{},e.MK.CA=new String(e.label),delete e.label),e}}),r.exports=Xa}).call(this,t("buffer").Buffer)},{buffer:119,"crypto-js":264,events:295,fontkit:306,fs:114,linebreak:336,"png-js":375,stream:438,zlib:113}],373:[function(e,a){(function(t){'use strict';var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=e("http"),i=e("https"),o=e("url"),c=e("querystring"),s=e("zlib"),l=e("util"),u=function(e,a){if("string"!=typeof e&&!e.hasOwnProperty("url"))throw new Error("Missing url option from options for request method.");var l="object"===("undefined"==typeof e?"undefined":r(e))?o.parse(e.url):o.parse(e),u={hostname:l.hostname,port:l.port||("http:"===l.protocol.toLowerCase()?80:443),path:l.path,method:"GET",headers:{},auth:l.auth||null,parse:"none",stream:!1};if("object"===("undefined"==typeof e?"undefined":r(e))&&(u=Object.assign(u,e)),u.port=+u.port,u.hasOwnProperty("timeout")&&delete u.timeout,!0===u.compressed&&(u.headers["accept-encoding"]="gzip, deflate"),e.hasOwnProperty("form")){if("object"!==r(e.form))throw new Error("phin 'form' option must be of type Object if present.");var d=c.stringify(e.form);u.headers["Content-Type"]="application/x-www-form-urlencoded",u.headers["Content-Length"]=t.byteLength(d),e.data=d}var X=void 0,m=function(e){var r=e;!0===u.compressed&&("gzip"===e.headers["content-encoding"]?r=e.pipe(s.createGunzip()):"deflate"===e.headers["content-encoding"]&&(r=e.pipe(s.createInflate()))),!0===u.stream?(e.stream=r,a&&a(null,e)):(e.body=new t([]),r.on("data",function(a){e.body=t.concat([e.body,a])}),r.on("end",function(){if(a){if("json"===u.parse)try{e.body=JSON.parse(e.body.toString())}catch(t){return void a("Invalid JSON received.",e)}a(null,e)}}))};switch(l.protocol.toLowerCase()){case"http:":X=n.request(u,m);break;case"https:":X=i.request(u,m);break;default:return void(a&&a(new Error("Invalid / unknown URL protocol. Expected HTTP or HTTPS."),null));}if("number"==typeof e.timeout&&X.setTimeout(e.timeout,function(){X.abort(),a&&a(new Error("Timeout has been reached."),null),a=null}),X.on("error",function(e){a&&a(e,null)}),e.hasOwnProperty("data")){var P=e.data;if(!(e.data instanceof t)&&"object"===r(e.data)){var K=u.headers["content-type"]||u.headers["Content-Type"];if("application/x-www-form-urlencoded"===K)P=c.stringify(e.data);else try{P=JSON.stringify(e.data)}catch(e){a&&a(new Error("Couldn't stringify object. (Likely due to a circular reference.)"),null)}}X.write(P)}X.end()};u.promisified=function(e,a){return new Promise(function(t,r){u(e,function(e,a){e?r(e):t(a)},a)})},l.promisify&&(u[l.promisify.custom]=u.promisified),a.exports=u}).call(this,e("buffer").Buffer)},{buffer:119,http:439,https:318,querystring:401,url:471,util:477,zlib:113}],374:[function(e,a){'use strict';function t(e,a,n,i,o,c){for(var s=B(a-1,0),l=B(n-1,0),u=_(a+1,i-1),d=_(n+1,o-1),X=0,m=0,P=0,K=0,g=0,p=s,f,h,b,A;p<=u;p++)for(var v=l;v<=d;v++)if(p!==a||v!==n){var C=r(e,e,4*(n*i+a),4*(v*i+p),!0);if(0===C?X++:0>C?P++:0<C&&m++,2<X)return!1;c&&(C<K&&(K=C,f=p,h=v),C>g&&(g=C,b=p,A=v))}return!c||0!==P&&0!==m&&(!t(e,f,h,i,o)&&!t(c,f,h,i,o)||!t(e,b,A,i,o)&&!t(c,b,A,i,o))}function r(e,a,t,r,l){var u=e[t+3]/255,d=a[r+3]/255,X=s(e[t+0],u),m=s(e[t+1],u),P=s(e[t+2],u),K=s(a[r+0],d),g=s(a[r+1],d),p=s(a[r+2],d),f=n(X,m,P)-n(K,g,p);if(l)return f;var h=o(X,m,P)-o(K,g,p),i=c(X,m,P)-c(K,g,p);return .5053*f*f+.299*h*h+.1957*i*i}function n(e,a,t){return .29889531*e+.58662247*a+.11448223*t}function o(e,a,t){return .59597799*e-.2741761*a-.32180189*t}function c(e,a,t){return .21147017*e-.52261711*a+.31114694*t}function s(e,t){return 255+(e-255)*t}function l(e,a,t,r,n){e[a+0]=t,e[a+1]=r,e[a+2]=n,e[a+3]=255}function u(e,t){var i=e[t+3]/255,a=s(e[t+0],i),r=s(e[t+1],i),o=s(e[t+2],i);return n(a,r,o)}a.exports=function(e,a,n,i,o,c){c||(c={});for(var d=c.threshold===void 0?.1:c.threshold,X=0,m=0;m<o;m++)for(var P=0;P<i;P++){var K=4*(m*i+P),g=r(e,a,K,K);if(g>35215*d*d)!c.includeAA&&(t(e,P,m,i,o,a)||t(a,P,m,i,o,e))?n&&l(n,K,255,255,0):(n&&l(n,K,255,0,0),X++);else if(n){var p=s(u(e,K),.1);l(n,K,p,p,p)}}return X}},{}],375:[function(e,a){(function(t){const r=e("fs"),n=e("zlib");a.exports=class e{static decode(a,t){return r.readFile(a,function(a,r){const n=new e(r);return n.decode(e=>t(e))})}static load(a){const t=r.readFileSync(a);return new e(t)}constructor(e){let a;for(this.data=e,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.text={};;){const e=this.readUInt32();let i="";for(a=0;4>a;a++)i+=m(this.data[this.pos++]);switch(i){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"PLTE":this.palette=this.read(e);break;case"IDAT":for(a=0;a<e;a++)this.imgData.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:this.transparency.indexed=this.read(e);var r=255-this.transparency.indexed.length;if(0<r)for(a=0;a<r;a++)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e);}break;case"tEXt":var n=this.read(e),o=n.indexOf(0),c=m.apply(String,n.slice(0,o));this.text[c]=m.apply(String,n.slice(o+1));break;case"IEND":switch(this.colorType){case 0:case 3:case 4:this.colors=1;break;case 2:case 6:this.colors=3;}this.hasAlphaChannel=[4,6].includes(this.colorType);var s=this.colors+(this.hasAlphaChannel?1:0);switch(this.pixelBitlength=this.bits*s,this.colors){case 1:this.colorSpace="DeviceGray";break;case 3:this.colorSpace="DeviceRGB";}return void(this.imgData=new t(this.imgData));break;default:this.pos+=e;}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}read(e){const a=Array(e);for(let t=0;t<e;t++)a[t]=this.data[this.pos++];return a}readUInt32(){const e=this.data[this.pos++]<<24,a=this.data[this.pos++]<<16,t=this.data[this.pos++]<<8,r=this.data[this.pos++];return e|a|t|r}readUInt16(){const e=this.data[this.pos++]<<8,a=this.data[this.pos++];return e|a}decodePixels(e){return n.inflate(this.imgData,(a,r)=>{function n(e,a,n,P,g=!1){const p=K((o-e)/n),f=K((s-a)/P),h=l*p,y=g?u:new t(h*f);let b=0,v=0;for(;b<f&&m<d;){var C,B,x,_,W;switch(r[m++]){case 0:for(x=0;x<h;x++)y[v++]=r[m++];break;case 1:for(x=0;x<h;x++)C=r[m++],_=x<l?0:y[v-l],y[v++]=(C+_)%256;break;case 2:for(x=0;x<h;x++)C=r[m++],B=(x-x%l)/l,W=b&&y[(b-1)*h+B*l+x%l],y[v++]=(W+C)%256;break;case 3:for(x=0;x<h;x++)C=r[m++],B=(x-x%l)/l,_=x<l?0:y[v-l],W=b&&y[(b-1)*h+B*l+x%l],y[v++]=(C+A((_+W)/2))%256;break;case 4:for(x=0;x<h;x++){var N,O;C=r[m++],B=(x-x%l)/l,_=x<l?0:y[v-l],0===b?W=O=0:(W=y[(b-1)*h+B*l+x%l],O=B&&y[(b-1)*h+(B-1)*l+x%l]);const e=_+W-O,a=X(e-_),t=X(e-W),n=X(e-O);N=a<=t&&a<=n?_:t<=n?W:O,y[v++]=(C+N)%256}break;default:throw new Error(`Invalid filter algorithm: ${r[m-1]}`);}if(!g){let t=((a+b*P)*o+e)*l,r=b*h;for(x=0;x<p;x++){for(let e=0;e<l;e++)u[t++]=y[r++];t+=(n-1)*l}}b++}}if(a)throw a;const{width:o,height:s}=this,l=this.pixelBitlength/8,u=new t(o*s*l),{length:d}=r;let m=0;return 1===this.interlaceMethod?(n(0,0,8,8),n(4,0,8,8),n(0,4,4,8),n(2,0,4,4),n(0,2,2,4),n(1,0,2,2),n(0,1,1,2)):n(0,0,1,1,!0),e(u)})}decodePalette(){const{palette:e}=this,{length:a}=e,r=this.transparency.indexed||[],n=new t(r.length+a);let o=0,s=0;for(let t=0;t<a;t+=3){var l;n[o++]=e[t],n[o++]=e[t+1],n[o++]=e[t+2],n[o++]=null==(l=r[s++])?255:l}return n}copyToImageData(e,a){let{colors:t}=this,r=null,n=this.hasAlphaChannel,o,c;this.palette.length&&(r=this._decodedPalette||(this._decodedPalette=this.decodePalette()),t=4,n=!0);const s=e.data||e,{length:l}=s,u=r||a;let d=o=0;if(1===t)for(;d<l;){c=r?4*a[d/4]:o;const e=u[c++];s[d++]=e,s[d++]=e,s[d++]=e,s[d++]=n?u[c++]:255,o=c}else for(;d<l;)c=r?4*a[d/4]:o,s[d++]=u[c++],s[d++]=u[c++],s[d++]=u[c++],s[d++]=n?u[c++]:255,o=c}decode(e){const a=new t(4*(this.width*this.height));return this.decodePixels(t=>(this.copyToImageData(a,t),e(a)))}}}).call(this,e("buffer").Buffer)},{buffer:119,fs:114,zlib:113}],376:[function(e,a,t){(function(a){'use strict';function r(e,a){function t(){if(n===e.length)throw new Error("Ran out of data");var t=e[n];n++;var i,o,c,s,l,u,d,X;switch(a){default:throw new Error("unrecognised depth");case 16:d=e[n],n++,r.push((t<<8)+d);break;case 4:d=15&t,X=t>>4,r.push(X,d);break;case 2:l=3&t,u=3&t>>2,d=3&t>>4,X=3&t>>6,r.push(X,d,u,l);break;case 1:i=1&t,o=1&t>>1,c=1&t>>2,s=1&t>>3,l=1&t>>4,u=1&t>>5,d=1&t>>6,X=1&t>>7,r.push(X,d,u,l,s,c,o,i);}}var r=[],n=0;return{get:function(e){for(;r.length<e;)t();var a=r.slice(0,e);return r=r.slice(e),a},resetAfterLine:function(){r.length=0},end:function(){if(n!==e.length)throw new Error("extra data found")}}}function n(e,a,t,r,n,i){for(var o=e.width,s=e.height,l=e.index,u=0;u<s;u++)for(var d=0,X;d<o;d++)X=t(d,u,l),c[r](a,n,X,i),i+=r;return i}function i(e,a,t,r,n,i){for(var o=e.width,c=e.height,l=e.index,u=0;u<c;u++){for(var d=0;d<o;d++){var X=n.get(r),m=t(d,u,l);s[r](a,X,m,i)}n.resetAfterLine()}}var o=e("./interlace"),c=[function(){},function(e,a,t,r){if(r===a.length)throw new Error("Ran out of data");var n=a[r];e[t]=n,e[t+1]=n,e[t+2]=n,e[t+3]=255},function(e,a,t,r){if(r+1>=a.length)throw new Error("Ran out of data");var n=a[r];e[t]=n,e[t+1]=n,e[t+2]=n,e[t+3]=a[r+1]},function(e,a,t,r){if(r+2>=a.length)throw new Error("Ran out of data");e[t]=a[r],e[t+1]=a[r+1],e[t+2]=a[r+2],e[t+3]=255},function(e,a,t,r){if(r+3>=a.length)throw new Error("Ran out of data");e[t]=a[r],e[t+1]=a[r+1],e[t+2]=a[r+2],e[t+3]=a[r+3]}],s=[function(){},function(e,a,t,r){var n=a[0];e[t]=n,e[t+1]=n,e[t+2]=n,e[t+3]=r},function(e,a,t){var r=a[0];e[t]=r,e[t+1]=r,e[t+2]=r,e[t+3]=a[1]},function(e,a,t,r){e[t]=a[0],e[t+1]=a[1],e[t+2]=a[2],e[t+3]=r},function(e,a,t){e[t]=a[0],e[t+1]=a[1],e[t+2]=a[2],e[t+3]=a[3]}];t.dataToBitMap=function(e,t){var c=t.width,s=t.height,l=t.depth,u=t.bpp,d=t.interlace;if(8!==l)var X=r(e,l);var m=8>=l?new a(4*(c*s)):new Uint16Array(4*(c*s));var P=v(2,l)-1,K=0,g,p;if(d)g=o.getImagePasses(c,s),p=o.getInterlaceIterator(c,s);else{var f=0;p=function(){var e=f;return f+=4,e},g=[{width:c,height:s}]}for(var h=0;h<g.length;h++)8===l?K=n(g[h],m,p,u,e,K):i(g[h],m,p,u,X,P);if(!(8===l))X.end();else if(K!==e.length)throw new Error("extra data found");return m}}).call(this,e("buffer").Buffer)},{"./interlace":386,buffer:119}],377:[function(e,a){(function(t){'use strict';var r=e("./constants");a.exports=function(e,a,n,i){function o(){var e=u,a,t,n;switch(i.inputColorType){case r.COLORTYPE_COLOR_ALPHA:e=l[P+3],a=l[P],t=l[P+1],n=l[P+2];break;case r.COLORTYPE_COLOR:a=l[P],t=l[P+1],n=l[P+2];break;case r.COLORTYPE_ALPHA:e=l[P+1],a=l[P],t=a,n=a;break;case r.COLORTYPE_GRAYSCALE:a=l[P],t=a,n=a;break;default:throw new Error("input color type:"+i.inputColorType+" is not supported at present");}return i.inputHasAlpha&&!c&&(e/=u,a=_(B(C((1-e)*g.red+e*a),0),u),t=_(B(C((1-e)*g.green+e*t),0),u),n=_(B(C((1-e)*g.blue+e*n),0),u)),{red:a,green:t,blue:n,alpha:e}}var c=-1!==[r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(i.colorType);if(i.colorType===i.inputColorType){var s=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256!==new Int16Array(e)[0]}();if(8===i.bitDepth||16===i.bitDepth&&s)return e}var l=16===i.bitDepth?new Uint16Array(e.buffer):e,u=255,d=r.COLORTYPE_TO_BPP_MAP[i.inputColorType];4!==d||i.inputHasAlpha||(d=3);var X=r.COLORTYPE_TO_BPP_MAP[i.colorType];16===i.bitDepth&&(u=65535,X*=2);var m=new t(a*n*X),P=0,K=0,g=i.bgColor||{};g.red===void 0&&(g.red=u),g.green===void 0&&(g.green=u),g.blue===void 0&&(g.blue=u);for(var p=0;p<n;p++)for(var f=0,h;f<a;f++){switch(h=o(l,P),i.colorType){case r.COLORTYPE_COLOR_ALPHA:case r.COLORTYPE_COLOR:8===i.bitDepth?(m[K]=h.red,m[K+1]=h.green,m[K+2]=h.blue,c&&(m[K+3]=h.alpha)):(m.writeUInt16BE(h.red,K),m.writeUInt16BE(h.green,K+2),m.writeUInt16BE(h.blue,K+4),c&&m.writeUInt16BE(h.alpha,K+6));break;case r.COLORTYPE_ALPHA:case r.COLORTYPE_GRAYSCALE:var b=(h.red+h.green+h.blue)/3;8===i.bitDepth?(m[K]=b,c&&(m[K+1]=h.alpha)):(m.writeUInt16BE(b,K),c&&m.writeUInt16BE(h.alpha,K+2));break;default:throw new Error("unrecognised color Type "+i.colorType);}P+=d,K+=X}return m}}).call(this,e("buffer").Buffer)},{"./constants":379,buffer:119}],378:[function(e,a){(function(t,r){'use strict';var n=e("util"),i=e("stream"),o=a.exports=function(){i.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};n.inherits(o,i),o.prototype.read=function(e,a){this._reads.push({length:X(e),allowLess:0>e,func:a}),t.nextTick(function(){this._process(),this._paused&&0<this._reads.length&&(this._paused=!1,this.emit("drain"))}.bind(this))},o.prototype.write=function(e,a){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;var t;return t=r.isBuffer(e)?e:new r(e,a||this._encoding),this._buffers.push(t),this._buffered+=t.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},o.prototype.end=function(e,a){e&&this.write(e,a),this.writable=!1;this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},o.prototype.destroySoon=o.prototype.end,o.prototype._end=function(){0<this._reads.length&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},o.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},o.prototype._processReadAllowingLess=function(e){this._reads.shift();var a=this._buffers[0];a.length>e.length?(this._buffered-=e.length,this._buffers[0]=a.slice(e.length),e.func.call(this,a.slice(0,e.length))):(this._buffered-=a.length,this._buffers.shift(),e.func.call(this,a))},o.prototype._processRead=function(e){this._reads.shift();for(var a=0,t=0,n=new r(e.length);a<e.length;){var i=this._buffers[t++],o=_(i.length,e.length-a);i.copy(n,a,0,o),a+=o,o!==i.length&&(this._buffers[--t]=i.slice(o))}0<t&&this._buffers.splice(0,t),this._buffered-=e.length,e.func.call(this,n)},o.prototype._process=function(){try{for(;0<this._buffered&&this._reads&&0<this._reads.length;){var e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else if(this._buffered>=e.length)this._processRead(e);else break}this._buffers&&!this.writable&&this._end()}catch(e){this.emit("error",e)}}}).call(this,e("_process"),e("buffer").Buffer)},{_process:116,buffer:119,stream:438,util:477}],379:[function(e,a){'use strict';a.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],380:[function(e,a){'use strict';var t=[];(function(){for(var e=0,a;256>e;e++){a=e;for(var r=0;8>r;r++)1&a?a=3988292384^a>>>1:a>>>=1;t[e]=a}})();var r=a.exports=function(){this._crc=-1};r.prototype.write=function(e){for(var a=0;a<e.length;a++)this._crc=t[255&(this._crc^e[a])]^this._crc>>>8;return!0},r.prototype.crc32=function(){return-1^this._crc},r.crc32=function(e){for(var a=-1,r=0;r<e.length;r++)a=t[255&(a^e[r])]^a>>>8;return-1^a}},{}],381:[function(e,a){(function(t){'use strict';var r=e("./paeth-predictor"),n={0:function(e,a,t,r,n){for(var i=0;i<t;i++)r[n+i]=e[a+i]},1:function(e,a,t,r,n,i){for(var o=0;o<t;o++){var c=o>=i?e[a+o-i]:0,s=e[a+o]-c;r[n+o]=s}},2:function(e,a,t,r,n){for(var i=0;i<t;i++){var o=0<a?e[a+i-t]:0,c=e[a+i]-o;r[n+i]=c}},3:function(e,a,t,r,n,i){for(var o=0;o<t;o++){var c=o>=i?e[a+o-i]:0,s=0<a?e[a+o-t]:0,l=e[a+o]-(c+s>>1);r[n+o]=l}},4:function(e,a,t,n,i,o){for(var c=0;c<t;c++){var s=c>=o?e[a+c-o]:0,l=0<a?e[a+c-t]:0,u=0<a&&c>=o?e[a+c-(t+o)]:0,d=e[a+c]-r(s,l,u);n[i+c]=d}}},o={0:function(e,a,t){for(var r=0,n=a;n<a+t;n++)r+=X(e[n]);return r},1:function(e,a,t,r){for(var n=0,i=0;i<t;i++){var o=i>=r?e[a+i-r]:0,c=e[a+i]-o;n+=X(c)}return n},2:function(e,a,t){for(var r=0,n=a;n<a+t;n++){var i=0<a?e[n-t]:0,o=e[n]-i;r+=X(o)}return r},3:function(e,a,t,r){for(var n=0,i=0;i<t;i++){var o=i>=r?e[a+i-r]:0,c=0<a?e[a+i-t]:0,s=e[a+i]-(o+c>>1);n+=X(s)}return n},4:function(e,a,t,n){for(var i=0,o=0;o<t;o++){var c=o>=n?e[a+o-n]:0,s=0<a?e[a+o-t]:0,l=0<a&&o>=n?e[a+o-(t+n)]:0,u=e[a+o]-r(c,s,l);i+=X(u)}return i}};a.exports=function(e,a,r,c,s){var l;if(!("filterType"in c)||-1===c.filterType)l=[0,1,2,3,4];else if("number"==typeof c.filterType)l=[c.filterType];else throw new Error("unrecognised filter types");16===c.bitDepth&&(s*=2);for(var u=a*s,d=0,X=0,m=new t((u+1)*r),P=l[0],K=0;K<r;K++){if(1<l.length)for(var g=1/0,p=0,f;p<l.length;p++)f=o[l[p]](e,X,u,s),f<g&&(P=l[p],g=f);m[d]=P,d++,n[P](e,X,u,m,d,s),d+=u,X+=u}return m}}).call(this,e("buffer").Buffer)},{"./paeth-predictor":390,buffer:119}],382:[function(e,a){(function(t){'use strict';var r=e("util"),n=e("./chunkstream"),i=e("./filter-parse"),o=a.exports=function(e){n.call(this);var a=[],r=this;this._filter=new i(e,{read:this.read.bind(this),write:function(e){a.push(e)},complete:function(){r.emit("complete",t.concat(a))}}),this._filter.start()};r.inherits(o,n)}).call(this,e("buffer").Buffer)},{"./chunkstream":378,"./filter-parse":384,buffer:119,util:477}],383:[function(e,a,t){(function(a){'use strict';var r=e("./sync-reader"),n=e("./filter-parse");t.process=function(e,t){var i=[],o=new r(e),c=new n(t,{read:o.read.bind(o),write:function(e){i.push(e)},complete:function(){}});return c.start(),o.process(),a.concat(i)}}).call(this,e("buffer").Buffer)},{"./filter-parse":384,"./sync-reader":397,buffer:119}],384:[function(e,a){(function(t){'use strict';function r(e,a,t){var r=e*a;return 8!==t&&(r=K(r/(8/t))),r}var n=e("./interlace"),i=e("./paeth-predictor"),o=a.exports=function(e,a){var t=e.width,o=e.height,c=e.interlace,s=e.bpp,l=e.depth;if(this.read=a.read,this.write=a.write,this.complete=a.complete,this._imageIndex=0,this._images=[],c)for(var u=n.getImagePasses(t,o),d=0;d<u.length;d++)this._images.push({byteWidth:r(u[d].width,s,l),height:u[d].height,lineIndex:0});else this._images.push({byteWidth:r(t,s,l),height:o,lineIndex:0});this._xComparison=8===l?s:16===l?2*s:1};o.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},o.prototype._unFilterType1=function(e,a,t){for(var r=this._xComparison,n=0;n<t;n++){var i=e[1+n],o=n>r-1?a[n-r]:0;a[n]=i+o}},o.prototype._unFilterType2=function(e,a,t){for(var r=this._lastLine,n=0;n<t;n++){var i=e[1+n],o=r?r[n]:0;a[n]=i+o}},o.prototype._unFilterType3=function(e,a,t){for(var r=this._xComparison,n=this._lastLine,i=0;i<t;i++){var o=e[1+i],c=n?n[i]:0,s=i>r-1?a[i-r]:0,l=A((s+c)/2);a[i]=o+l}},o.prototype._unFilterType4=function(e,a,t){for(var r=this._xComparison,n=r-1,o=this._lastLine,c=0;c<t;c++){var s=e[1+c],l=o?o[c]:0,u=c>n?a[c-r]:0,d=c>n&&o?o[c-r]:0,X=i(u,l,d);a[c]=s+X}},o.prototype._reverseFilterLine=function(e){var a=e[0],r=this._images[this._imageIndex],n=r.byteWidth,i;if(0===a)i=e.slice(1,n+1);else switch(i=new t(n),a){case 1:this._unFilterType1(e,i,n);break;case 2:this._unFilterType2(e,i,n);break;case 3:this._unFilterType3(e,i,n);break;case 4:this._unFilterType4(e,i,n);break;default:throw new Error("Unrecognised filter type - "+a);}this.write(i),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=i,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this,e("buffer").Buffer)},{"./interlace":386,"./paeth-predictor":390,buffer:119}],385:[function(e,a){(function(e){'use strict';function t(e,a,t,r,n){for(var o=0,c=0;c<r;c++)for(var s=0,l;s<t;s++){if(l=n[e[o]],!l)throw new Error("index "+e[o]+" not in palette");for(var u=0;4>u;u++)a[o+u]=l[u];o+=4}}function r(e,a,t,r,n){for(var o=0,c=0;c<r;c++)for(var s=0,l;s<t;s++){if(l=!1,1===n.length?n[0]===e[o]&&(l=!0):n[0]===e[o]&&n[1]===e[o+1]&&n[2]===e[o+2]&&(l=!0),l)for(var u=0;4>u;u++)a[o+u]=0;o+=4}}function n(e,a,t,r,n){for(var o=v(2,n)-1,c=0,s=0;s<r;s++)for(var l=0;l<t;l++){for(var u=0;4>u;u++)a[c+u]=A(e[c+u]*255/o+.5);c+=4}}a.exports=function(a,i){var o=i.depth,c=i.width,s=i.height,l=i.colorType,u=i.transColor,d=i.palette,X=a;return 3===l?t(a,X,c,s,d):(u&&r(a,X,c,s,u),8!==o&&(16===o&&(X=new e(4*(c*s))),n(a,X,c,s,o))),X}}).call(this,e("buffer").Buffer)},{buffer:119}],386:[function(e,a,t){'use strict';var r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];t.getImagePasses=function(e,a){for(var t=[],n=e%8,o=a%8,c=0;c<r.length;c++){for(var s=r[c],l=(e-n)/8*s.x.length,u=(a-o)/8*s.y.length,d=0;d<s.x.length&&s.x[d]<n;d++)l++;for(d=0;d<s.y.length&&s.y[d]<o;d++)u++;0<l&&0<u&&t.push({width:l,height:u,index:c})}return t},t.getInterlaceIterator=function(e){return function(a,t,n){var i=a%r[n].x.length,o=8*((a-i)/r[n].x.length)+r[n].x[i],c=t%r[n].y.length,s=8*((t-c)/r[n].y.length)+r[n].y[c];return 4*o+4*(s*e)}}},{}],387:[function(e,a){(function(t){'use strict';var r=e("util"),n=e("stream"),i=e("./constants"),o=e("./packer"),c=a.exports=function(e){n.call(this);this._packer=new o(e||{}),this._deflate=this._packer.createDeflate(),this.readable=!0};r.inherits(c,n),c.prototype.pack=function(e,a,r,n){this.emit("data",new t(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(a,r)),n&&this.emit("data",this._packer.packGAMA(n));var o=this._packer.filterData(e,a,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(e){this.emit("data",this._packer.packIDAT(e))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}}).call(this,e("buffer").Buffer)},{"./constants":379,"./packer":389,buffer:119,stream:438,util:477}],388:[function(e,a){(function(t){'use strict';var r=!0,n=e("zlib");n.deflateSync||(r=!1);var i=e("./constants"),o=e("./packer");a.exports=function(e,a){if(!r)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");var c=new o(a||{}),s=[];s.push(new t(i.PNG_SIGNATURE)),s.push(c.packIHDR(e.width,e.height)),e.gamma&&s.push(c.packGAMA(e.gamma));var l=c.filterData(e.data,e.width,e.height),u=n.deflateSync(l,c.getDeflateOptions());if(l=null,!u||!u.length)throw new Error("bad png - invalid compressed data response");return s.push(c.packIDAT(u)),s.push(c.packIEND()),t.concat(s)}}).call(this,e("buffer").Buffer)},{"./constants":379,"./packer":389,buffer:119,zlib:113}],389:[function(e,a){(function(t){'use strict';var r=e("./constants"),n=e("./crc"),i=e("./bitpacker"),o=e("./filter-pack"),c=e("zlib"),s=a.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=null==e.deflateLevel?9:e.deflateLevel,e.deflateStrategy=null==e.deflateStrategy?3:e.deflateStrategy,e.inputHasAlpha=null==e.inputHasAlpha||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||c.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType="number"==typeof e.colorType?e.colorType:r.COLORTYPE_COLOR_ALPHA,e.inputColorType="number"==typeof e.inputColorType?e.inputColorType:r.COLORTYPE_COLOR_ALPHA,-1===[r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(e.colorType))throw new Error("option color type:"+e.colorType+" is not supported at present");if(-1===[r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(e.inputColorType))throw new Error("option input color type:"+e.inputColorType+" is not supported at present");if(8!==e.bitDepth&&16!==e.bitDepth)throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")};s.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},s.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},s.prototype.filterData=function(e,a,t){var n=i(e,a,t,this._options),c=r.COLORTYPE_TO_BPP_MAP[this._options.colorType],s=o(n,a,t,this._options,c);return s},s.prototype._packChunk=function(e,a){var r=a?a.length:0,i=new t(r+12);return i.writeUInt32BE(r,0),i.writeUInt32BE(e,4),a&&a.copy(i,8),i.writeInt32BE(n.crc32(i.slice(4,i.length-4)),i.length-4),i},s.prototype.packGAMA=function(e){var a=new t(4);return a.writeUInt32BE(A(e*r.GAMMA_DIVISION),0),this._packChunk(r.TYPE_gAMA,a)},s.prototype.packIHDR=function(e,a){var n=new t(13);return n.writeUInt32BE(e,0),n.writeUInt32BE(a,4),n[8]=this._options.bitDepth,n[9]=this._options.colorType,n[10]=0,n[11]=0,n[12]=0,this._packChunk(r.TYPE_IHDR,n)},s.prototype.packIDAT=function(e){return this._packChunk(r.TYPE_IDAT,e)},s.prototype.packIEND=function(){return this._packChunk(r.TYPE_IEND,null)}}).call(this,e("buffer").Buffer)},{"./bitpacker":377,"./constants":379,"./crc":380,"./filter-pack":381,buffer:119,zlib:113}],390:[function(e,a){'use strict';a.exports=function(e,a,t){var r=e+a-t,n=X(r-e),i=X(r-a),o=X(r-t);return n<=i&&n<=o?e:i<=o?a:t}},{}],391:[function(e,a){'use strict';var t=e("util"),r=e("zlib"),n=e("./chunkstream"),i=e("./filter-parse-async"),o=e("./parser"),c=e("./bitmapper"),s=e("./format-normaliser"),l=a.exports=function(e){n.call(this),this._parser=new o(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};t.inherits(l,n),l.prototype._handleError=function(e){this.emit("error",e),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0},l.prototype._inflateData=function(e){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=r.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{var a=(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1,t=a*this._bitmapInfo.height,n=B(t,r.Z_MIN_CHUNK);this._inflate=r.createInflate({chunkSize:n});var i=t,o=this.emit.bind(this,"error");this._inflate.on("error",function(e){i&&o(e)}),this._filter.on("complete",this._complete.bind(this));var c=this._filter.write.bind(this._filter);this._inflate.on("data",function(e){i&&(e.length>i&&(e=e.slice(0,i)),i-=e.length,c(e))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(e)},l.prototype._handleMetaData=function(e){this._metaData=e,this._bitmapInfo=Object.create(e),this._filter=new i(this._bitmapInfo)},l.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e},l.prototype._handlePalette=function(e){this._bitmapInfo.palette=e},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},l.prototype._complete=function(e){if(!this.errord){try{var a=c.dataToBitMap(e,this._bitmapInfo),t=s(a,this._bitmapInfo);a=null}catch(e){return void this._handleError(e)}this.emit("parsed",t)}}},{"./bitmapper":376,"./chunkstream":378,"./filter-parse-async":382,"./format-normaliser":385,"./parser":393,util:477,zlib:113}],392:[function(e,a){(function(t){'use strict';var r=!0,n=e("zlib"),i=e("./sync-inflate");n.deflateSync||(r=!1);var o=e("./sync-reader"),c=e("./filter-parse-sync"),s=e("./parser"),l=e("./bitmapper"),u=e("./format-normaliser");a.exports=function(e,a){function d(e){h.transColor=e}function X(e){h.palette=e}function m(){h.alpha=!0}function P(e){K.push(e)}if(!r)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");var K=[],g=new o(e),p=new s(a,{read:g.read.bind(g),error:function(e){f=e},metadata:function(e){h=e},gamma:function(e){y=e},palette:X,transColor:d,inflateData:P,simpleTransparency:m}),f,h,y;if(p.start(),g.process(),f)throw f;var b=t.concat(K);K.length=0;var A;if(h.interlace)A=n.inflateSync(b);else{var v=(h.width*h.bpp*h.depth+7>>3)+1,C=v*h.height;A=i(b,{chunkSize:C,maxLength:C})}if(b=null,!A||!A.length)throw new Error("bad png - invalid inflate data response");var B=c.process(A,h);b=null;var x=l.dataToBitMap(B,h);B=null;var _=u(x,h);return h.data=_,h.gamma=y||0,h}}).call(this,e("buffer").Buffer)},{"./bitmapper":376,"./filter-parse-sync":383,"./format-normaliser":385,"./parser":393,"./sync-inflate":396,"./sync-reader":397,buffer:119,zlib:113}],393:[function(e,a){(function(t){'use strict';var r=e("./constants"),n=e("./crc"),i=a.exports=function(e,a){this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[r.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[r.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[r.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[r.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[r.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[r.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=a.read,this.error=a.error,this.metadata=a.metadata,this.gamma=a.gamma,this.transColor=a.transColor,this.palette=a.palette,this.parsed=a.parsed,this.inflateData=a.inflateData,this.finished=a.finished,this.simpleTransparency=a.simpleTransparency,this.headersFinished=a.headersFinished||function(){}};i.prototype.start=function(){this.read(r.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(e){for(var a=r.PNG_SIGNATURE,t=0;t<a.length;t++)if(e[t]!==a[t])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(e){for(var a=e.readUInt32BE(0),o=e.readUInt32BE(4),c="",s=4;8>s;s++)c+=m(e[s]);var l=!!(32&e[4]);return this._hasIHDR||o===r.TYPE_IHDR?(this._crc=new n,this._crc.write(new t(c)),this._chunks[o]?this._chunks[o](a):l?void this.read(a+4,this._skipChunk.bind(this)):void this.error(new Error("Unsupported critical chunk type "+c))):void this.error(new Error("Expected IHDR on beggining"))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(e){var a=e.readInt32BE(0),t=this._crc.crc32();return this._options.checkCRC&&t!==a?void this.error(new Error("Crc error - "+a+" - "+t)):void(!this._hasIEND&&this.read(8,this._parseChunkBegin.bind(this)))},i.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(e){this._crc.write(e);var a=e.readUInt32BE(0),t=e.readUInt32BE(4),n=e[8],i=e[9],o=e[10],c=e[11],s=e[12];if(8!==n&&4!==n&&2!==n&&1!==n&&16!==n)return void this.error(new Error("Unsupported bit depth "+n));if(!(i in r.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==o)return void this.error(new Error("Unsupported compression method"));if(0!==c)return void this.error(new Error("Unsupported filter method"));if(0!==s&&1!==s)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;var l=r.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:a,height:t,depth:n,interlace:!!s,palette:!!(i&r.COLORTYPE_PALETTE),color:!!(i&r.COLORTYPE_COLOR),alpha:!!(i&r.COLORTYPE_ALPHA),bpp:l,colorType:i}),this._handleChunkEnd()},i.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(e){this._crc.write(e);for(var a=A(e.length/3),t=0;t<a;t++)this._palette.push([e[3*t],e[3*t+1],e[3*t+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(e){this.simpleTransparency(),this.read(e,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===r.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(e.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var a=0;a<e.length;a++)this._palette[a][3]=e[a];this.palette(this._palette)}this._colorType===r.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===r.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/r.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(e){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-e,this._parseIDAT.bind(this,e))},i.prototype._parseIDAT=function(e,a){if(this._crc.write(a),this._colorType===r.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(a);var t=e-a.length;0<t?this._handleIDAT(t):this._handleChunkEnd()},i.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},i.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this,e("buffer").Buffer)},{"./constants":379,"./crc":380,buffer:119}],394:[function(e,a,t){'use strict';var r=e("./parser-sync"),n=e("./packer-sync");t.read=function(e,a){return r(e,a||{})},t.write=function(e,a){return n(e,a)}},{"./packer-sync":388,"./parser-sync":392}],395:[function(e,a,t){(function(a,r){'use strict';var n=e("util"),i=e("stream"),o=e("./parser-async"),c=e("./packer-async"),s=e("./png-sync"),l=t.PNG=function(e){i.call(this),e=e||{},this.width=0|e.width,this.height=0|e.height,this.data=0<this.width&&0<this.height?new r(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new o(e),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new c(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};n.inherits(l,i),l.sync=s,l.prototype.pack=function(){return this.data&&this.data.length?(a.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},l.prototype.parse=function(e,a){if(a){var t,r;t=function(e){this.removeListener("error",r),this.data=e,a(null,this)}.bind(this),r=function(e){this.removeListener("parsed",t),a(e,null)}.bind(this),this.once("parsed",t),this.once("error",r)}return this.end(e),this},l.prototype.write=function(e){return this._parser.write(e),!0},l.prototype.end=function(e){this._parser.end(e)},l.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)},l.prototype._gamma=function(e){this.gamma=e},l.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},l.bitblt=function(e,a,t,r,n,i,o,c){if(t|=0,r|=0,n|=0,i|=0,o|=0,c|=0,t>e.width||r>e.height||t+n>e.width||r+i>e.height)throw new Error("bitblt reading outside image");if(o>a.width||c>a.height||o+n>a.width||c+i>a.height)throw new Error("bitblt writing outside image");for(var s=0;s<i;s++)e.data.copy(a.data,(c+s)*a.width+o<<2,(r+s)*e.width+t<<2,(r+s)*e.width+t+n<<2)},l.prototype.bitblt=function(e,a,t,r,n,i,o){return l.bitblt(this,e,a,t,r,n,i,o),this},l.adjustGamma=function(e){if(e.gamma){for(var a=0;a<e.height;a++)for(var t=0,r;t<e.width;t++){r=e.width*a+t<<2;for(var n=0,o;3>n;n++)o=e.data[r+n]/255,o=v(o,1/2.2/e.gamma),e.data[r+n]=C(255*o)}e.gamma=0}},l.prototype.adjustGamma=function(){l.adjustGamma(this)}}).call(this,e("_process"),e("buffer").Buffer)},{"./packer-async":387,"./parser-async":391,"./png-sync":394,_process:116,buffer:119,stream:438,util:477}],396:[function(e,a,t){(function(r,n){'use strict';function i(e){return this instanceof i?void(e&&e.chunkSize<u.Z_MIN_CHUNK&&(e.chunkSize=u.Z_MIN_CHUNK),u.Inflate.call(this,e),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,e&&null!=e.maxLength&&(this._maxLength=e.maxLength)):new i(e)}function o(e,a){a&&r.nextTick(a);e._handle&&(e._handle.close(),e._handle=null)}function c(e,a){if("string"==typeof a&&(a=n.from(a)),!(a instanceof n))throw new TypeError("Not a string or buffer");var t=e._finishFlushFlag;return null==t&&(t=u.Z_FINISH),e._processChunk(a,t)}function s(e,a){return c(new i(a),e)}var l=e("assert").ok,u=e("zlib"),d=e("util"),X=e("buffer").kMaxLength;i.prototype._processChunk=function(e,a,t){function r(e,a){if(!i._hadError){var t=s-a;if(l(0<=t,"have should not go down"),0<t){var r=i._buffer.slice(i._offset,i._offset+t);if(i._offset+=t,r.length>d&&(r=r.slice(0,d)),P.push(r),K+=r.length,d-=r.length,0===d)return!1}return(0===a||i._offset>=i._chunkSize)&&(s=i._chunkSize,i._offset=0,i._buffer=n.allocUnsafe(i._chunkSize)),0===a&&(m+=c-e,c=e,!0)}}if("function"==typeof t)return u.Inflate._processChunk.call(this,e,a,t);var i=this,c=e&&e.length,s=this._chunkSize-this._offset,d=this._maxLength,m=0,P=[],K=0,g;this.on("error",function(e){g=e}),l(this._handle,"zlib binding closed");do{var p=this._handle.writeSync(a,e,m,c,this._buffer,this._offset,s);p=p||this._writeState}while(!this._hadError&&r(p[0],p[1]));if(this._hadError)throw g;if(K>=X)throw o(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+X.toString(16)+" bytes");var f=n.concat(P,K);return o(this),f},d.inherits(i,u.Inflate),a.exports=t=s,t.Inflate=i,t.createInflate=function(e){return new i(e)},t.inflateSync=s}).call(this,e("_process"),e("buffer").Buffer)},{_process:116,assert:71,buffer:119,util:477,zlib:113}],397:[function(e,a){'use strict';var t=a.exports=function(e){this._buffer=e,this._reads=[]};t.prototype.read=function(e,a){this._reads.push({length:X(e),allowLess:0>e,func:a})},t.prototype.process=function(){for(;0<this._reads.length&&this._buffer.length;){var e=this._reads[0];if(this._buffer.length&&(this._buffer.length>=e.length||e.allowLess)){this._reads.shift();var a=this._buffer;this._buffer=a.slice(e.length),e.func.call(this,a.slice(0,e.length))}else break}return 0<this._reads.length?new Error("There are some read requests waitng on finished stream"):0<this._buffer.length?new Error("unrecognised content at end of stream"):void 0}},{}],398:[function(e,a){(function(e){'use strict';a.exports="undefined"!=typeof e&&e.version&&0!==e.version.indexOf("v0.")&&(0!==e.version.indexOf("v1.")||0===e.version.indexOf("v1.8."))?e:{nextTick:function(a,t,r,n){if("function"!=typeof a)throw new TypeError("\"callback\" argument must be a function");var o=arguments.length,c,s;switch(o){case 0:case 1:return e.nextTick(a);case 2:return e.nextTick(function(){a.call(null,t)});case 3:return e.nextTick(function(){a.call(null,t,r)});case 4:return e.nextTick(function(){a.call(null,t,r,n)});default:for(c=Array(o-1),s=0;s<c.length;)c[s++]=arguments[s];return e.nextTick(function(){a.apply(null,c)});}}}}).call(this,e("_process"))},{_process:116}],399:[function(e,a){'use strict';function t(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.exports=function(e,a,n,o){a=a||"&",n=n||"=";var c={};if("string"!=typeof e||0===e.length)return c;e=e.split(a);var s=1e3;o&&"number"==typeof o.maxKeys&&(s=o.maxKeys);var l=e.length;0<s&&l>s&&(l=s);for(var u=0;u<l;++u){var d=e[u].replace(/\+/g,"%20"),X=d.indexOf(n),m,P,K,g;0<=X?(m=d.substr(0,X),P=d.substr(X+1)):(m=d,P=""),K=decodeURIComponent(m),g=decodeURIComponent(P),t(c,K)?r(c[K])?c[K].push(g):c[K]=[c[K],g]:c[K]=g}return c};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],400:[function(e,a){'use strict';function t(e,a){if(e.map)return e.map(a);for(var t=[],r=0;r<e.length;r++)t.push(a(e[r],r));return t}var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return"";}};a.exports=function(e,a,o,c){return a=a||"&",o=o||"=",null===e&&(e=void 0),"object"==typeof e?t(i(e),function(i){var c=encodeURIComponent(r(i))+o;return n(e[i])?t(e[i],function(e){return c+encodeURIComponent(r(e))}).join(a):c+encodeURIComponent(r(e[i]))}).join(a):c?encodeURIComponent(r(c))+o+encodeURIComponent(r(e)):""};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=Object.keys||function(e){var a=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.push(t);return a}},{}],401:[function(e,a,t){'use strict';t.decode=t.parse=e("./decode"),t.encode=t.stringify=e("./encode")},{"./decode":399,"./encode":400}],402:[function(e,a){a.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":403}],403:[function(e,a){'use strict';function t(e){return this instanceof t?void(s.call(this,e),l.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",r)):new t(e)}function r(){this.allowHalfOpen||this._writableState.ended||i.nextTick(n,this)}function n(e){e.end()}var i=e("process-nextick-args"),o=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};a.exports=t;var c=Object.create(e("core-util-is"));c.inherits=e("inherits");var s=e("./_stream_readable"),l=e("./_stream_writable");c.inherits(t,s);for(var u=o(l.prototype),d=0,X;d<u.length;d++)X=u[d],t.prototype[X]||(t.prototype[X]=l.prototype[X]);Object.defineProperty(t.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),t.prototype._destroy=function(e,a){this.push(null),this.end(),i.nextTick(a,e)}},{"./_stream_readable":405,"./_stream_writable":407,"core-util-is":255,inherits:321,"process-nextick-args":398}],404:[function(e,a){'use strict';function t(e){return this instanceof t?void r.call(this,e):new t(e)}a.exports=t;var r=e("./_stream_transform"),n=Object.create(e("core-util-is"));n.inherits=e("inherits"),n.inherits(t,r),t.prototype._transform=function(e,a,t){t(null,e)}},{"./_stream_transform":406,"core-util-is":255,inherits:321}],405:[function(e,a){(function(t,r){'use strict';function n(e){return E.from(e)}function i(e){return E.isBuffer(e)||e instanceof L}function o(e,a,t){return"function"==typeof e.prependListener?e.prependListener(a,t):void(e._events&&e._events[a]?S(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t))}function c(a,t){U=U||e("./_stream_duplex"),a=a||{};var r=t instanceof U;this.objectMode=!!a.objectMode,r&&(this.objectMode=this.objectMode||!!a.readableObjectMode);var n=a.highWaterMark,i=a.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(i||0===i)?i:o,this.highWaterMark=A(this.highWaterMark),this.buffer=new z,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=a.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,a.encoding&&(!V&&(V=e("string_decoder/").StringDecoder),this.decoder=new V(a.encoding),this.encoding=a.encoding)}function s(a){return U=U||e("./_stream_duplex"),this instanceof s?void(this._readableState=new c(a,this),this.readable=!0,a&&("function"==typeof a.read&&(this._read=a.read),"function"==typeof a.destroy&&(this._destroy=a.destroy)),I.call(this)):new s(a)}function l(e,a,t,r,i){var o=e._readableState;if(null===a)o.reading=!1,K(e,o);else{var c;i||(c=d(o,a)),c?e.emit("error",c):o.objectMode||a&&0<a.length?("string"!=typeof a&&!o.objectMode&&Object.getPrototypeOf(a)!==E.prototype&&(a=n(a)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):u(e,o,a,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!t?(a=o.decoder.write(a),o.objectMode||0!==a.length?u(e,o,a,!1):f(e,o)):u(e,o,a,!1))):!r&&(o.reading=!1)}return X(o)}function u(e,a,t,r){a.flowing&&0===a.length&&!a.sync?(e.emit("data",t),e.read(0)):(a.length+=a.objectMode?1:t.length,r?a.buffer.unshift(t):a.buffer.push(t),a.needReadable&&g(e)),f(e,a)}function d(e,a){var t;return i(a)||"string"==typeof a||void 0===a||e.objectMode||(t=new TypeError("Invalid non-string/buffer chunk")),t}function X(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function m(e){return 8388608<=e?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function P(e,a){return 0>=e||0===a.length&&a.ended?0:a.objectMode?1:e===e?(e>a.highWaterMark&&(a.highWaterMark=m(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0)):a.flowing&&a.length?a.buffer.head.data.length:a.length}function K(e,a){if(!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,g(e)}}function g(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(F("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?w.nextTick(p,e):p(e))}function p(e){F("emit readable"),e.emit("readable"),B(e)}function f(e,a){a.readingMore||(a.readingMore=!0,w.nextTick(h,e,a))}function h(e,a){for(var t=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length<a.highWaterMark&&(F("maybeReadMore read 0"),e.read(0),t!==a.length);)t=a.length;a.readingMore=!1}function y(e){return function(){var a=e._readableState;F("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&Y(e,"data")&&(a.flowing=!0,B(e))}}function b(e){F("readable nexttick read 0"),e.read(0)}function v(e,a){a.resumeScheduled||(a.resumeScheduled=!0,w.nextTick(C,e,a))}function C(e,a){a.reading||(F("resume read 0"),e.read(0)),a.resumeScheduled=!1,a.awaitDrain=0,e.emit("resume"),B(e),a.flowing&&!a.reading&&e.read(0)}function B(e){var a=e._readableState;for(F("flow",a.flowing);a.flowing&&null!==e.read(););}function x(e,a){if(0===a.length)return null;var t;return a.objectMode?t=a.buffer.shift():!e||e>=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):t=_(e,a.buffer,a.decoder),t}function _(e,a,t){var r;return e<a.head.data.length?(r=a.head.data.slice(0,e),a.head.data=a.head.data.slice(e)):e===a.head.data.length?r=a.shift():r=t?W(e,a):N(e,a),r}function W(e,a){var t=a.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var o=t.data,s=e>o.length?o.length:e;if(i+=s===o.length?o:o.slice(0,e),e-=s,0===e){s===o.length?(++r,a.head=t.next?t.next:a.tail=null):(a.head=t,t.data=o.slice(s));break}++r}return a.length-=r,i}function N(e,a){var t=E.allocUnsafe(e),r=a.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,s),e-=s,0===e){s===o.length?(++i,a.head=r.next?r.next:a.tail=null):(a.head=r,r.data=o.slice(s));break}++i}return a.length-=i,t}function O(e){var a=e._readableState;if(0<a.length)throw new Error("\"endReadable()\" called on non-empty stream");a.endEmitted||(a.ended=!0,w.nextTick(k,a,e))}function k(e,a){e.endEmitted||0!==e.length||(e.endEmitted=!0,a.readable=!1,a.emit("end"))}function T(e,a){for(var t=0,r=e.length;t<r;t++)if(e[t]===a)return t;return-1}var w=e("process-nextick-args");a.exports=s;var S=e("isarray"),U;s.ReadableState=c;var R=e("events").EventEmitter,Y=function(e,a){return e.listeners(a).length},I=e("./internal/streams/stream"),E=e("safe-buffer").Buffer,L=r.Uint8Array||function(){},D=Object.create(e("core-util-is"));D.inherits=e("inherits");var M=e("util"),F=void 0;F=M&&M.debuglog?M.debuglog("stream"):function(){};var z=e("./internal/streams/BufferList"),j=e("./internal/streams/destroy"),V;D.inherits(s,I);var q=["error","close","destroy","pause","resume"];Object.defineProperty(s.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),s.prototype.destroy=j.destroy,s.prototype._undestroy=j.undestroy,s.prototype._destroy=function(e,a){this.push(null),a(e)},s.prototype.push=function(e,a){var t=this._readableState,r;return t.objectMode?r=!0:"string"==typeof e&&(a=a||t.defaultEncoding,a!==t.encoding&&(e=E.from(e,a),a=""),r=!0),l(this,e,a,!1,r)},s.prototype.unshift=function(e){return l(this,e,null,!0,!1)},s.prototype.isPaused=function(){return!1===this._readableState.flowing},s.prototype.setEncoding=function(a){return V||(V=e("string_decoder/").StringDecoder),this._readableState.decoder=new V(a),this._readableState.encoding=a,this};s.prototype.read=function(e){F("read",e),e=parseInt(e,10);var a=this._readableState,t=e;if(0!==e&&(a.emittedReadable=!1),0===e&&a.needReadable&&(a.length>=a.highWaterMark||a.ended))return F("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?O(this):g(this),null;if(e=P(e,a),0===e&&a.ended)return 0===a.length&&O(this),null;var r=a.needReadable;F("need readable",r),(0===a.length||a.length-e<a.highWaterMark)&&(r=!0,F("length less than watermark",r)),a.ended||a.reading?(r=!1,F("reading or ended",r)):r&&(F("do read"),a.reading=!0,a.sync=!0,0===a.length&&(a.needReadable=!0),this._read(a.highWaterMark),a.sync=!1,!a.reading&&(e=P(t,a)));var i;return i=0<e?x(e,a):null,null===i?(a.needReadable=!0,e=0):a.length-=e,0===a.length&&(!a.ended&&(a.needReadable=!0),t!==e&&a.ended&&O(this)),null!==i&&this.emit("data",i),i},s.prototype._read=function(){this.emit("error",new Error("_read() is not implemented"))},s.prototype.pipe=function(e,a){function r(e,a){F("onunpipe"),e===X&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i())}function n(){F("onend"),e.end()}function i(){F("cleanup"),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("drain",g),e.removeListener("error",s),e.removeListener("unpipe",r),X.removeListener("end",n),X.removeListener("end",d),X.removeListener("data",c),p=!0,m.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&g()}function c(a){F("ondata"),f=!1;var t=e.write(a);!1!==t||f||((1===m.pipesCount&&m.pipes===e||1<m.pipesCount&&-1!==T(m.pipes,e))&&!p&&(F("false write response, pause",X._readableState.awaitDrain),X._readableState.awaitDrain++,f=!0),X.pause())}function s(a){F("onerror",a),d(),e.removeListener("error",s),0===Y(e,"error")&&e.emit("error",a)}function l(){e.removeListener("finish",u),d()}function u(){F("onfinish"),e.removeListener("close",l),d()}function d(){F("unpipe"),X.unpipe(e)}var X=this,m=this._readableState;switch(m.pipesCount){case 0:m.pipes=e;break;case 1:m.pipes=[m.pipes,e];break;default:m.pipes.push(e);}m.pipesCount+=1,F("pipe count=%d opts=%j",m.pipesCount,a);var P=(!a||!1!==a.end)&&e!==t.stdout&&e!==t.stderr,K=P?n:d;m.endEmitted?w.nextTick(K):X.once("end",K),e.on("unpipe",r);var g=y(X);e.on("drain",g);var p=!1,f=!1;return X.on("data",c),o(e,"error",s),e.once("close",l),e.once("finish",u),e.emit("pipe",X),m.flowing||(F("pipe resume"),X.resume()),e},s.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes?this:(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t),this);if(!e){var r=a.pipes,n=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,t);return this}var c=T(a.pipes,e);return-1===c?this:(a.pipes.splice(c,1),a.pipesCount-=1,1===a.pipesCount&&(a.pipes=a.pipes[0]),e.emit("unpipe",this,t),this)},s.prototype.on=function(e,a){var t=I.prototype.on.call(this,e,a);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&g(this):w.nextTick(b,this))}return t},s.prototype.addListener=s.prototype.on,s.prototype.resume=function(){var e=this._readableState;return e.flowing||(F("resume"),e.flowing=!0,v(this,e)),this},s.prototype.pause=function(){return F("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(F("pause"),this._readableState.flowing=!1,this.emit("pause")),this},s.prototype.wrap=function(e){var a=this,t=this._readableState,r=!1;for(var o in e.on("end",function(){if(F("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&a.push(e)}a.push(null)}),e.on("data",function(n){if((F("wrapped data"),t.decoder&&(n=t.decoder.write(n)),!(t.objectMode&&(null===n||void 0===n)))&&(t.objectMode||n&&n.length)){var i=a.push(n);i||(r=!0,e.pause())}}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(a){return function(){return e[a].apply(e,arguments)}}(o));for(var i=0;i<q.length;i++)e.on(q[i],this.emit.bind(this,q[i]));return this._read=function(a){F("wrapped _read",a),r&&(r=!1,e.resume())},this},Object.defineProperty(s.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),s._fromList=x}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./_stream_duplex":403,"./internal/streams/BufferList":408,"./internal/streams/destroy":409,"./internal/streams/stream":410,_process:116,"core-util-is":255,events:295,inherits:321,isarray:327,"process-nextick-args":398,"safe-buffer":411,"string_decoder/":458,util:115}],406:[function(e,a){'use strict';function t(e,a){var t=this._transformState;t.transforming=!1;var r=t.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));t.writechunk=null,t.writecb=null,null!=a&&this.push(a),r(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function r(e){return this instanceof r?void(o.call(this,e),this._transformState={afterTransform:t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",n)):new r(e)}function n(){var e=this;"function"==typeof this._flush?this._flush(function(a,t){i(e,a,t)}):i(this,null,null)}function i(e,a,t){if(a)return e.emit("error",a);if(null!=t&&e.push(t),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}a.exports=r;var o=e("./_stream_duplex"),c=Object.create(e("core-util-is"));c.inherits=e("inherits"),c.inherits(r,o),r.prototype.push=function(e,a){return this._transformState.needTransform=!1,o.prototype.push.call(this,e,a)},r.prototype._transform=function(){throw new Error("_transform() is not implemented")},r.prototype._write=function(e,a,t){var r=this._transformState;if(r.writecb=t,r.writechunk=e,r.writeencoding=a,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},r.prototype._read=function(){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},r.prototype._destroy=function(e,a){var t=this;o.prototype._destroy.call(this,e,function(e){a(e),t.emit("close")})}},{"./_stream_duplex":403,"core-util-is":255,inherits:321}],407:[function(e,a){(function(t,r,n){'use strict';function i(e){var a=this;this.next=null,this.entry=null,this.finish=function(){W(a,e)}}function o(e){return U.from(e)}function c(e){return U.isBuffer(e)||e instanceof R}function s(){}function l(a,t){k=k||e("./_stream_duplex"),a=a||{};var r=t instanceof k;this.objectMode=!!a.objectMode,r&&(this.objectMode=this.objectMode||!!a.writableObjectMode);var n=a.highWaterMark,o=a.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(o||0===o)?o:c,this.highWaterMark=A(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===a.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){f(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function u(a){return k=k||e("./_stream_duplex"),I.call(u,this)||this instanceof k?void(this._writableState=new l(a,this),this.writable=!0,a&&("function"==typeof a.write&&(this._write=a.write),"function"==typeof a.writev&&(this._writev=a.writev),"function"==typeof a.destroy&&(this._destroy=a.destroy),"function"==typeof a.final&&(this._final=a.final)),S.call(this)):new u(a)}function d(e,a){var t=new Error("write after end");e.emit("error",t),N.nextTick(a,t)}function X(e,a,t,r){var n=!0,i=!1;return null===t?i=new TypeError("May not write null values to stream"):"string"!=typeof t&&void 0!==t&&!a.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i&&(e.emit("error",i),N.nextTick(r,i),n=!1),n}function m(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=U.from(a,t)),a}function P(e,a,t,r,n,i){if(!t){var o=m(a,r,n);r!==o&&(t=!0,n="buffer",r=o)}var c=a.objectMode?1:r.length;a.length+=c;var s=a.length<a.highWaterMark;if(s||(a.needDrain=!0),a.writing||a.corked){var l=a.lastBufferedRequest;a.lastBufferedRequest={chunk:r,encoding:n,isBuf:t,callback:i,next:null},l?l.next=a.lastBufferedRequest:a.bufferedRequest=a.lastBufferedRequest,a.bufferedRequestCount+=1}else K(e,a,!1,c,r,n,i);return s}function K(e,a,t,r,n,i,o){a.writelen=r,a.writecb=o,a.writing=!0,a.sync=!0,t?e._writev(n,a.onwrite):e._write(n,i,a.onwrite),a.sync=!1}function g(e,a,t,r,n){--a.pendingcb,t?(N.nextTick(n,r),N.nextTick(x,e,a),e._writableState.errorEmitted=!0,e.emit("error",r)):(n(r),e._writableState.errorEmitted=!0,e.emit("error",r),x(e,a))}function p(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function f(e,a){var t=e._writableState,r=t.sync,n=t.writecb;if(p(t),a)g(e,t,r,a,n);else{var i=v(t);i||t.corked||t.bufferProcessing||!t.bufferedRequest||b(e,t),r?O(h,e,t,i,n):h(e,t,i,n)}}function h(e,a,t,r){t||y(e,a),a.pendingcb--,r(),x(e,a)}function y(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}function b(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var r=a.bufferedRequestCount,n=Array(r),o=a.corkedRequestsFree;o.entry=t;for(var c=0,s=!0;t;)n[c]=t,t.isBuf||(s=!1),t=t.next,c+=1;n.allBuffers=s,K(e,a,!0,a.length,n,"",o.finish),a.pendingcb++,a.lastBufferedRequest=null,o.next?(a.corkedRequestsFree=o.next,o.next=null):a.corkedRequestsFree=new i(a),a.bufferedRequestCount=0}else{for(;t;){var l=t.chunk,u=t.encoding,d=t.callback,X=a.objectMode?1:l.length;if(K(e,a,!1,X,l,u,d),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,a){e._final(function(t){a.pendingcb--,t&&e.emit("error",t),a.prefinished=!0,e.emit("prefinish"),x(e,a)})}function B(e,a){a.prefinished||a.finalCalled||("function"==typeof e._final?(a.pendingcb++,a.finalCalled=!0,N.nextTick(C,e,a)):(a.prefinished=!0,e.emit("prefinish")))}function x(e,a){var t=v(a);return t&&(B(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"))),t}function _(e,a,t){a.ending=!0,x(e,a),t&&(a.finished?N.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}function W(e,a,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;a.pendingcb--,n(t),r=r.next}a.corkedRequestsFree?a.corkedRequestsFree.next=e:a.corkedRequestsFree=e}var N=e("process-nextick-args");a.exports=u;var O=!t.browser&&-1<["v0.10","v0.9."].indexOf(t.version.slice(0,5))?n:N.nextTick,k;u.WritableState=l;var T=Object.create(e("core-util-is"));T.inherits=e("inherits");var w={deprecate:e("util-deprecate")},S=e("./internal/streams/stream"),U=e("safe-buffer").Buffer,R=r.Uint8Array||function(){},Y=e("./internal/streams/destroy");T.inherits(u,S),l.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(l.prototype,"buffer",{get:w.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var I;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(u,Symbol.hasInstance,{value:function(e){return!!I.call(this,e)||!(this!==u)&&e&&e._writableState instanceof l}})):I=function(e){return e instanceof this},u.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},u.prototype.write=function(e,a,t){var r=this._writableState,n=!1,i=!r.objectMode&&c(e);return i&&!U.isBuffer(e)&&(e=o(e)),"function"==typeof a&&(t=a,a=null),i?a="buffer":!a&&(a=r.defaultEncoding),"function"!=typeof t&&(t=s),r.ended?d(this,t):(i||X(this,r,e,t))&&(r.pendingcb++,n=P(this,r,i,e,a,t)),n},u.prototype.cork=function(){var e=this._writableState;e.corked++},u.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&b(this,e))},u.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),u.prototype._write=function(e,a,t){t(new Error("_write() is not implemented"))},u.prototype._writev=null,u.prototype.end=function(e,a,t){var r=this._writableState;"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!==e&&e!==void 0&&this.write(e,a),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||_(this,r,t)},Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),u.prototype.destroy=Y.destroy,u.prototype._undestroy=Y.undestroy,u.prototype._destroy=function(e,a){this.end(),a(e)}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("timers").setImmediate)},{"./_stream_duplex":403,"./internal/streams/destroy":409,"./internal/streams/stream":410,_process:116,"core-util-is":255,inherits:321,"process-nextick-args":398,"safe-buffer":411,timers:460,"util-deprecate":474}],408:[function(e,a){'use strict';function t(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function r(e,a,t){e.copy(a,t)}var o=e("safe-buffer").Buffer,c=e("util");a.exports=function(){function e(){t(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var a={data:e,next:null};0<this.length?this.tail.next=a:this.head=a,this.tail=a,++this.length},e.prototype.unshift=function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t},e.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var a=o.allocUnsafe(e>>>0),t=this.head,n=0;t;)r(t.data,a,n),n+=t.data.length,t=t.next;return a},e}(),c&&c.inspect&&c.inspect.custom&&(a.exports.prototype[c.inspect.custom]=function(){var e=c.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":411,util:115}],409:[function(e,a){'use strict';function t(e,a){e.emit("error",a)}var r=e("process-nextick-args");a.exports={destroy:function(e,a){var n=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(a?a(e):e&&(!this._writableState||!this._writableState.errorEmitted)&&r.nextTick(t,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!a&&e?(r.nextTick(t,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):a&&a(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":398}],410:[function(e,a){a.exports=e("events").EventEmitter},{events:295}],411:[function(e,a,t){function r(e,a){for(var t in e)a[t]=e[t]}function n(e,a,t){return o(e,a,t)}var i=e("buffer"),o=i.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?a.exports=i:(r(i,t),t.Buffer=n),r(o,n),n.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,a,t)},n.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0===a?r.fill(0):"string"==typeof t?r.fill(a,t):r.fill(a),r},n.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:119}],412:[function(e,a){a.exports=e("./readable").PassThrough},{"./readable":413}],413:[function(e,a,t){t=a.exports=e("./lib/_stream_readable.js"),t.Stream=t,t.Readable=t,t.Writable=e("./lib/_stream_writable.js"),t.Duplex=e("./lib/_stream_duplex.js"),t.Transform=e("./lib/_stream_transform.js"),t.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":403,"./lib/_stream_passthrough.js":404,"./lib/_stream_readable.js":405,"./lib/_stream_transform.js":406,"./lib/_stream_writable.js":407}],414:[function(e,a){a.exports=e("./readable").Transform},{"./readable":413}],415:[function(e,a){a.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":407}],416:[function(e,a){var t=function(e){"use strict";function a(e,a,t){return Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[a]}function t(e,a,t,r){var i=a&&a.prototype instanceof n?a:n,o=Object.create(i.prototype),c=new m(r||[]);return o._invoke=l(e,t,c),o}function r(e,a,t){try{return{type:"normal",arg:e.call(a,t)}}catch(e){return{type:"throw",arg:e}}}function n(){}function i(){}function o(){}function c(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function s(e,a){function t(n,i,o,c){var s=r(e[n],e,i);if("throw"===s.type)c(s.arg);else{var l=s.arg,u=l.value;return u&&"object"==typeof u&&p.call(u,"__await")?a.resolve(u.__await).then(function(e){t("next",e,o,c)},function(e){t("throw",e,o,c)}):a.resolve(u).then(function(e){l.value=e,o(l)},function(e){return t("throw",e,o,c)})}}function n(e,r){function n(){return new a(function(a,n){t(e,r,a,n)})}return i=i?i.then(n,n):n()}var i;this._invoke=n}function l(e,a,t){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return K()}for(t.method=i,t.arg=o;;){var c=t.delegate;if(c){var s=u(c,t);if(s){if(s===A)continue;return s}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===n)throw n="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n="executing";var l=r(e,a,t);if("normal"===l.type){if(n=t.done?"completed":"suspendedYield",l.arg===A)continue;return{value:l.arg,done:t.done}}"throw"===l.type&&(n="completed",t.method="throw",t.arg=l.arg)}}}function u(e,a){var t=e.iterator[a.method];if(void 0===t){if(a.delegate=null,"throw"===a.method){if(e.iterator["return"]&&(a.method="return",a.arg=void 0,u(e,a),"throw"===a.method))return A;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var n=r(t,e.iterator,a.arg);if("throw"===n.type)return a.method="throw",a.arg=n.arg,a.delegate=null,A;var i=n.arg;if(!i)return a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,A;if(i.done)a[e.resultName]=i.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=void 0);else return i;return a.delegate=null,A}function d(e){var a={tryLoc:e[0]};1 in e&&(a.catchLoc=e[1]),2 in e&&(a.finallyLoc=e[2],a.afterLoc=e[3]),this.tryEntries.push(a)}function X(e){var a=e.completion||{};a.type="normal",delete a.arg,e.completion=a}function m(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(d,this),this.reset(!0)}function P(e){if(e){var a=e[h];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var t=-1,r=function a(){for(;++t<e.length;)if(p.call(e,t))return a.value=e[t],a.done=!1,a;return a.value=void 0,a.done=!0,a};return r.next=r}}return{next:K}}function K(){return{value:void 0,done:!0}}var g=Object.prototype,p=g.hasOwnProperty,f="function"==typeof Symbol?Symbol:{},h=f.iterator||"@@iterator",y=f.asyncIterator||"@@asyncIterator",b=f.toStringTag||"@@toStringTag";try{a({},"")}catch(e){a=function(e,a,t){return e[a]=t}}e.wrap=t;var A={},v={};v[h]=function(){return this};var C=Object.getPrototypeOf,B=C&&C(C(P([])));B&&B!==g&&p.call(B,h)&&(v=B);var x=o.prototype=n.prototype=Object.create(v);return i.prototype=x.constructor=o,o.constructor=i,i.displayName=a(o,b,"GeneratorFunction"),e.isGeneratorFunction=function(e){var a="function"==typeof e&&e.constructor;return!!a&&(a===i||"GeneratorFunction"===(a.displayName||a.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,a(e,b,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},c(s.prototype),s.prototype[y]=function(){return this},e.AsyncIterator=s,e.async=function(a,r,n,i,o){void 0===o&&(o=Promise);var c=new s(t(a,r,n,i),o);return e.isGeneratorFunction(r)?c:c.next().then(function(e){return e.done?e.value:c.next()})},c(x),a(x,b,"Generator"),x[h]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var a=[];for(var t in e)a.push(t);return a.reverse(),function t(){for(;a.length;){var r=a.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=P,m.prototype={constructor:m,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(X),!e)for(var a in this)"t"===a.charAt(0)&&p.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0],a=e.completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function(e){function a(a,r){return o.type="throw",o.arg=e,t.next=a,r&&(t.method="next",t.arg=void 0),!!r}if(this.done)throw e;for(var t=this,r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r],o=n.completion;if("root"===n.tryLoc)return a("end");if(n.tryLoc<=this.prev){var c=p.call(n,"catchLoc"),s=p.call(n,"finallyLoc");if(c&&s){if(this.prev<n.catchLoc)return a(n.catchLoc,!0);if(this.prev<n.finallyLoc)return a(n.finallyLoc)}else if(c){if(this.prev<n.catchLoc)return a(n.catchLoc,!0);}else if(!s)throw new Error("try statement without catch or finally");else if(this.prev<n.finallyLoc)return a(n.finallyLoc)}}},abrupt:function(e,a){for(var t=this.tryEntries.length-1,r;0<=t;--t)if(r=this.tryEntries[t],r.tryLoc<=this.prev&&p.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var n=r;break}n&&("break"===e||"continue"===e)&&n.tryLoc<=a&&a<=n.finallyLoc&&(n=null);var o=n?n.completion:{};return o.type=e,o.arg=a,n?(this.method="next",this.next=n.finallyLoc,A):this.complete(o)},complete:function(e,a){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&a&&(this.next=a),A},finish:function(e){for(var a=this.tryEntries.length-1,t;0<=a;--a)if(t=this.tryEntries[a],t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),X(t),A},catch:function(e){for(var a=this.tryEntries.length-1,t;0<=a;--a)if(t=this.tryEntries[a],t.tryLoc===e){var r=t.completion;if("throw"===r.type){var n=r.arg;X(t)}return n}throw new Error("illegal catch attempt")},delegateYield:function(e,a,t){return this.delegate={iterator:P(e),resultName:a,nextLoc:t},"next"===this.method&&(this.arg=void 0),A}},e}("object"==typeof a?a.exports:{});try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},{}],417:[function(e,a){'use strict';var t=Object,r=TypeError;a.exports=function(){if(null!=this&&this!==t(this))throw new r("RegExp.prototype.flags getter called on non-object");var e="";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e}},{}],418:[function(e,a){'use strict';var t=e("define-properties"),r=e("es-abstract/helpers/callBind"),n=e("./implementation"),i=e("./polyfill"),o=e("./shim"),c=r(n);t(c,{getPolyfill:i,implementation:n,shim:o}),a.exports=c},{"./implementation":417,"./polyfill":419,"./shim":420,"define-properties":291,"es-abstract/helpers/callBind":294}],419:[function(e,a){'use strict';var t=e("./implementation"),r=e("define-properties").supportsDescriptors,n=Object.getOwnPropertyDescriptor,i=TypeError;a.exports=function(){if(!r)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/mig.flags){var e=n(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof /a/.dotAll)return e.get}return t}},{"./implementation":417,"define-properties":291}],420:[function(e,a){'use strict';var t=e("define-properties").supportsDescriptors,r=e("./polyfill"),n=Object.getOwnPropertyDescriptor,i=Object.defineProperty,o=TypeError,c=Object.getPrototypeOf;a.exports=function(){if(!t||!c)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=r(),a=c(/a/),s=n(a,"flags");return s&&s.get===e||i(a,"flags",{configurable:!0,enumerable:!1,get:e}),e}},{"./polyfill":419,"define-properties":291}],421:[function(e,a,t){(function(){var a,r,n,i;for(a in t.EncodeStream=e("./src/EncodeStream"),t.DecodeStream=e("./src/DecodeStream"),t.Array=e("./src/Array"),t.LazyArray=e("./src/LazyArray"),t.Bitfield=e("./src/Bitfield"),t.Boolean=e("./src/Boolean"),t.Buffer=e("./src/Buffer"),t.Enum=e("./src/Enum"),t.Optional=e("./src/Optional"),t.Reserved=e("./src/Reserved"),t.String=e("./src/String"),t.Struct=e("./src/Struct"),t.VersionedStruct=e("./src/VersionedStruct"),n=e("./src/Number"),n)r=n[a],t[a]=r;for(a in i=e("./src/Pointer"),i)r=i[a],t[a]=r}).call(this)},{"./src/Array":422,"./src/Bitfield":423,"./src/Boolean":424,"./src/Buffer":425,"./src/DecodeStream":426,"./src/EncodeStream":427,"./src/Enum":428,"./src/LazyArray":429,"./src/Number":430,"./src/Optional":431,"./src/Pointer":432,"./src/Reserved":433,"./src/String":434,"./src/Struct":435,"./src/VersionedStruct":436}],422:[function(e,a){(function(){var t,r,n;r=e("./Number").Number,n=e("./utils"),t=function(){function e(e,a,t){this.type=e,this.length=a,this.lengthType=null==t?"count":t}return e.prototype.decode=function(e,a){var t,o,c,s,l,u,d;if(s=e.pos,l=[],t=a,null!=this.length&&(c=n.resolveLength(this.length,e,a)),this.length instanceof r&&(Object.defineProperties(l,{parent:{value:a},_startOffset:{value:s},_currentOffset:{value:0,writable:!0},_length:{value:c}}),t=l),null==c||"bytes"===this.lengthType)for(u=null==c?(null==a?void 0:a._length)?a._startOffset+a._length:e.length:e.pos+c;e.pos<u;)l.push(this.type.decode(e,t));else for(o=d=0;d<c;o=d+=1)l.push(this.type.decode(e,t));return l},e.prototype.size=function(e,a){var t,i,o,c;if(!e)return this.type.size(null,a)*n.resolveLength(this.length,null,a);for(i=0,this.length instanceof r&&(i+=this.length.size(),a={parent:a}),(o=0,c=e.length);o<c;o++)t=e[o],i+=this.type.size(t,a);return i},e.prototype.encode=function(e,a,t){var n,o,c,s,l,u;for(n=t,this.length instanceof r&&(n={pointers:[],startOffset:e.pos,parent:t},n.pointerOffset=e.pos+this.size(a,n),this.length.encode(e,a.length)),(l=0,u=a.length);l<u;l++)c=a[l],this.type.encode(e,c,n);if(this.length instanceof r)for(o=0;o<n.pointers.length;)s=n.pointers[o++],s.type.encode(e,s.val)},e}(),a.exports=t}).call(this)},{"./Number":430,"./utils":437}],423:[function(e,a){(function(){var e;e=function(){function e(e,a){this.type=e,this.flags=null==a?[]:a}return e.prototype.decode=function(e){var a,t,r,n,o,c,s;for(n=this.type.decode(e),r={},s=this.flags,(t=o=0,c=s.length);o<c;t=++o)a=s[t],null!=a&&(r[a]=!!(n&1<<t));return r},e.prototype.size=function(){return this.type.size()},e.prototype.encode=function(e,a){var t,r,n,o,c,s;for(n=0,s=this.flags,(r=o=0,c=s.length);o<c;r=++o)t=s[r],null!=t&&a[t]&&(n|=1<<r);return this.type.encode(e,n)},e}(),a.exports=e}).call(this)},{}],424:[function(e,a){(function(){var e;e=function(){function e(e){this.type=e}return e.prototype.decode=function(e,a){return!!this.type.decode(e,a)},e.prototype.size=function(e,a){return this.type.size(e,a)},e.prototype.encode=function(e,a,t){return this.type.encode(e,+a,t)},e}(),a.exports=e}).call(this)},{}],425:[function(e,a){(function(){var t,r,n;n=e("./utils"),r=e("./Number").Number,t=function(){function e(e){this.length=e}return e.prototype.decode=function(e,a){var t;return t=n.resolveLength(this.length,e,a),e.readBuffer(t)},e.prototype.size=function(e,a){return e?e.length:n.resolveLength(this.length,null,a)},e.prototype.encode=function(e,a){return this.length instanceof r&&this.length.encode(e,a.length),e.writeBuffer(a)},e}(),a.exports=t}).call(this)},{"./Number":430,"./utils":437}],426:[function(e,a){(function(e){(function(){var t,r;try{r=function(){throw new Error("Cannot find module 'iconv-lite' from 'E:\\Projects\\handwritten.js\\node_modules\\restructure\\src'")}()}catch(e){}t=function(){function a(e){this.buffer=e,this.pos=0,this.length=this.buffer.length}for(var t in a.TYPES={UInt8:1,UInt16:2,UInt24:3,UInt32:4,Int8:1,Int16:2,Int24:3,Int32:4,Float:4,Double:8},e.prototype)"read"===t.slice(0,4)&&function(e){var t;return t=a.TYPES[e.replace(/read|[BL]E/g,"")],a.prototype[e]=function(){var a;return a=this.buffer[e](this.pos),this.pos+=t,a}}(t);return a.prototype.readString=function(a,t){var n,o,c,s,l;switch(null==t&&(t="ascii"),t){case"utf16le":case"ucs2":case"utf8":case"ascii":return this.buffer.toString(t,this.pos,this.pos+=a);case"utf16be":for(n=new e(this.readBuffer(a)),c=s=0,l=n.length-1;s<l;c=s+=2)o=n[c],n[c]=n[c+1],n[c+1]=o;return n.toString("utf16le");default:if(n=this.readBuffer(a),r)try{return r.decode(n,t)}catch(e){}return n;}},a.prototype.readBuffer=function(e){return this.buffer.slice(this.pos,this.pos+=e)},a.prototype.readUInt24BE=function(){return(this.readUInt16BE()<<8)+this.readUInt8()},a.prototype.readUInt24LE=function(){return this.readUInt16LE()+(this.readUInt8()<<16)},a.prototype.readInt24BE=function(){return(this.readInt16BE()<<8)+this.readUInt8()},a.prototype.readInt24LE=function(){return this.readUInt16LE()+(this.readInt8()<<16)},a}(),a.exports=t}).call(this)}).call(this,e("buffer").Buffer)},{buffer:119}],427:[function(e,a){(function(t){(function(){var r={}.hasOwnProperty,n=function(e,a){function t(){this.constructor=e}for(var n in a)r.call(a,n)&&(e[n]=a[n]);return t.prototype=a.prototype,e.prototype=new t,e.__super__=a.prototype,e},i,o,c,s;s=e("stream"),i=e("./DecodeStream");try{c=function(){throw new Error("Cannot find module 'iconv-lite' from 'E:\\Projects\\handwritten.js\\node_modules\\restructure\\src'")}()}catch(e){}o=function(e){function a(e){null==e&&(e=65536),a.__super__.constructor.apply(this,arguments),this.buffer=new t(e),this.bufferOffset=0,this.pos=0}for(var r in n(a,e),t.prototype)"write"===r.slice(0,5)&&function(e){var t;return t=+i.TYPES[e.replace(/write|[BL]E/g,"")],a.prototype[e]=function(a){return this.ensure(t),this.buffer[e](a,this.bufferOffset),this.bufferOffset+=t,this.pos+=t}}(r);return a.prototype._read=function(){},a.prototype.ensure=function(e){if(this.bufferOffset+e>this.buffer.length)return this.flush()},a.prototype.flush=function(){if(0<this.bufferOffset)return this.push(new t(this.buffer.slice(0,this.bufferOffset))),this.bufferOffset=0},a.prototype.writeBuffer=function(e){return this.flush(),this.push(e),this.pos+=e.length},a.prototype.writeString=function(e,a){var r,n,o,s,l;switch(null==a&&(a="ascii"),a){case"utf16le":case"ucs2":case"utf8":case"ascii":return this.writeBuffer(new t(e,a));case"utf16be":for(r=new t(e,"utf16le"),o=s=0,l=r.length-1;s<l;o=s+=2)n=r[o],r[o]=r[o+1],r[o+1]=n;return this.writeBuffer(r);default:if(c)return this.writeBuffer(c.encode(e,a));throw new Error("Install iconv-lite to enable additional string encodings.");}},a.prototype.writeUInt24BE=function(e){return this.ensure(3),this.buffer[this.bufferOffset++]=255&e>>>16,this.buffer[this.bufferOffset++]=255&e>>>8,this.buffer[this.bufferOffset++]=255&e,this.pos+=3},a.prototype.writeUInt24LE=function(e){return this.ensure(3),this.buffer[this.bufferOffset++]=255&e,this.buffer[this.bufferOffset++]=255&e>>>8,this.buffer[this.bufferOffset++]=255&e>>>16,this.pos+=3},a.prototype.writeInt24BE=function(e){return 0<=e?this.writeUInt24BE(e):this.writeUInt24BE(e+16777215+1)},a.prototype.writeInt24LE=function(e){return 0<=e?this.writeUInt24LE(e):this.writeUInt24LE(e+16777215+1)},a.prototype.fill=function(e,a){var r;return a<this.buffer.length?(this.ensure(a),this.buffer.fill(e,this.bufferOffset,this.bufferOffset+a),this.bufferOffset+=a,this.pos+=a):(r=new t(a),r.fill(e),this.writeBuffer(r))},a.prototype.end=function(){return this.flush(),this.push(null)},a}(s.Readable),a.exports=o}).call(this)}).call(this,e("buffer").Buffer)},{"./DecodeStream":426,buffer:119,stream:438}],428:[function(e,a){(function(){var e;e=function(){function e(e,a){this.type=e,this.options=null==a?[]:a}return e.prototype.decode=function(e){var a;return a=this.type.decode(e),this.options[a]||a},e.prototype.size=function(){return this.type.size()},e.prototype.encode=function(e,a){var t;if(t=this.options.indexOf(a),-1===t)throw new Error("Unknown option in enum: "+a);return this.type.encode(e,t)},e}(),a.exports=e}).call(this)},{}],429:[function(e,a){(function(){var t={}.hasOwnProperty,r=function(e,a){function r(){this.constructor=e}for(var n in a)t.call(a,n)&&(e[n]=a[n]);return r.prototype=a.prototype,e.prototype=new r,e.__super__=a.prototype,e},n,i,o,c,s,l;n=e("./Array"),c=e("./Number").Number,l=e("./utils"),s=e("util").inspect,o=function(e){function a(){return a.__super__.constructor.apply(this,arguments)}return r(a,e),a.prototype.decode=function(e,a){var t,r,n;return r=e.pos,t=l.resolveLength(this.length,e,a),this.length instanceof c&&(a={parent:a,_startOffset:r,_currentOffset:0,_length:t}),n=new i(this.type,t,e,a),e.pos+=t*this.type.size(null,a),n},a.prototype.size=function(e,t){return e instanceof i&&(e=e.toArray()),a.__super__.size.call(this,e,t)},a.prototype.encode=function(e,t,r){return t instanceof i&&(t=t.toArray()),a.__super__.encode.call(this,e,t,r)},a}(n),i=function(){function e(e,a,t,r){this.type=e,this.length=a,this.stream=t,this.ctx=r,this.base=this.stream.pos,this.items=[]}return e.prototype.get=function(e){var a;if(!(0>e||e>=this.length))return null==this.items[e]&&(a=this.stream.pos,this.stream.pos=this.base+this.type.size(null,this.ctx)*e,this.items[e]=this.type.decode(this.stream,this.ctx),this.stream.pos=a),this.items[e]},e.prototype.toArray=function(){var e,a,t,r;for(r=[],e=a=0,t=this.length;a<t;e=a+=1)r.push(this.get(e));return r},e.prototype.inspect=function(){return s(this.toArray())},e}(),a.exports=o}).call(this)},{"./Array":422,"./Number":430,"./utils":437,util:477}],430:[function(e,a,t){(function(){var a={}.hasOwnProperty,r=function(e,t){function r(){this.constructor=e}for(var n in t)a.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},n,i,o;n=e("./DecodeStream"),o=function(){function e(e,a){this.type=e,this.endian=null==a?"BE":a,this.fn=this.type,"8"!==this.type[this.type.length-1]&&(this.fn+=this.endian)}return e.prototype.size=function(){return n.TYPES[this.type]},e.prototype.decode=function(e){return e["read"+this.fn]()},e.prototype.encode=function(e,a){return e["write"+this.fn](a)},e}(),t.Number=o,t.uint8=new o("UInt8"),t.uint16be=t.uint16=new o("UInt16","BE"),t.uint16le=new o("UInt16","LE"),t.uint24be=t.uint24=new o("UInt24","BE"),t.uint24le=new o("UInt24","LE"),t.uint32be=t.uint32=new o("UInt32","BE"),t.uint32le=new o("UInt32","LE"),t.int8=new o("Int8"),t.int16be=t.int16=new o("Int16","BE"),t.int16le=new o("Int16","LE"),t.int24be=t.int24=new o("Int24","BE"),t.int24le=new o("Int24","LE"),t.int32be=t.int32=new o("Int32","BE"),t.int32le=new o("Int32","LE"),t.floatbe=t.float=new o("Float","BE"),t.floatle=new o("Float","LE"),t.doublebe=t.double=new o("Double","BE"),t.doublele=new o("Double","LE"),i=function(e){function a(e,t,r){null==r&&(r=e>>1),a.__super__.constructor.call(this,"Int"+e,t),this._point=1<<r}return r(a,e),a.prototype.decode=function(e){return a.__super__.decode.call(this,e)/this._point},a.prototype.encode=function(e,t){return a.__super__.encode.call(this,e,0|t*this._point)},a}(o),t.Fixed=i,t.fixed16be=t.fixed16=new i(16,"BE"),t.fixed16le=new i(16,"LE"),t.fixed32be=t.fixed32=new i(32,"BE"),t.fixed32le=new i(32,"LE")}).call(this)},{"./DecodeStream":426}],431:[function(e,a){(function(){var e;e=function(){function e(e,a){this.type=e,this.condition=null==a||a}return e.prototype.decode=function(e,a){var t;if(t=this.condition,"function"==typeof t&&(t=t.call(a,a)),t)return this.type.decode(e,a)},e.prototype.size=function(e,a){var t;return t=this.condition,"function"==typeof t&&(t=t.call(a,a)),t?this.type.size(e,a):0},e.prototype.encode=function(e,a,t){var r;if(r=this.condition,"function"==typeof r&&(r=r.call(t,t)),r)return this.type.encode(e,a,t)},e}(),a.exports=e}).call(this)},{}],432:[function(e,a,t){(function(){var a,r,n;n=e("./utils"),a=function(){function e(e,a,t){var r,n,i,o;this.offsetType=e,this.type=a,this.options=null==t?{}:t,"void"===this.type&&(this.type=null),null==(r=this.options).type&&(r.type="local"),null==(n=this.options).allowNull&&(n.allowNull=!0),null==(i=this.options).nullValue&&(i.nullValue=0),null==(o=this.options).lazy&&(o.lazy=!1),this.options.relativeTo&&(this.relativeToGetter=new Function("ctx","return ctx."+this.options.relativeTo))}return e.prototype.decode=function(e,a){var t,r,i,o,s,l;return(i=this.offsetType.decode(e,a),i===this.options.nullValue&&this.options.allowNull)?null:(s=function(){switch(this.options.type){case"local":return a._startOffset;case"immediate":return e.pos-this.offsetType.size();case"parent":return a.parent._startOffset;default:for(t=a;t.parent;)t=t.parent;return t._startOffset||0;}}.call(this),this.options.relativeTo&&(s+=this.relativeToGetter(a)),o=i+s,null==this.type?o:(l=null,r=function(t){return function(){var r;return null==l?(r=e.pos,e.pos=o,l=t.type.decode(e,a),e.pos=r,l):l}}(this),this.options.lazy?new n.PropertyDescriptor({get:r}):r()))},e.prototype.size=function(e,a){var t,n;switch(t=a,this.options.type){case"local":case"immediate":break;case"parent":a=a.parent;break;default:for(;a.parent;)a=a.parent;}if(n=this.type,null==n){if(!(e instanceof r))throw new Error("Must be a VoidPointer");n=e.type,e=e.value}return e&&a&&(a.pointerSize+=n.size(e,t)),this.offsetType.size()},e.prototype.encode=function(e,a,t){var n,i,o;if(n=t,null==a)return void this.offsetType.encode(e,this.options.nullValue);switch(this.options.type){case"local":i=t.startOffset;break;case"immediate":i=e.pos+this.offsetType.size(a,n);break;case"parent":t=t.parent,i=t.startOffset;break;default:for(i=0;t.parent;)t=t.parent;}if(this.options.relativeTo&&(i+=this.relativeToGetter(n.val)),this.offsetType.encode(e,t.pointerOffset-i),o=this.type,null==o){if(!(a instanceof r))throw new Error("Must be a VoidPointer");o=a.type,a=a.value}return t.pointers.push({type:o,val:a,parent:n}),t.pointerOffset+=o.size(a,n)},e}(),r=function(){return function(e,a){this.type=e,this.value=a}}(),t.Pointer=a,t.VoidPointer=r}).call(this)},{"./utils":437}],433:[function(e,a){(function(){var t,r;r=e("./utils"),t=function(){function e(e,a){this.type=e,this.count=null==a?1:a}return e.prototype.decode=function(e,a){e.pos+=this.size(null,a)},e.prototype.size=function(e,a){var t;return t=r.resolveLength(this.count,null,a),this.type.size()*t},e.prototype.encode=function(e,a,t){return e.fill(0,this.size(a,t))},e}(),a.exports=t}).call(this)},{"./utils":437}],434:[function(e,a){(function(t){(function(){var r,n,i;r=e("./Number").Number,i=e("./utils"),n=function(){function e(e,a){this.length=e,this.encoding=null==a?"ascii":a}return e.prototype.decode=function(e,a){var t,r,n,o,c;return n=function(){if(null!=this.length)return i.resolveLength(this.length,e,a);for(t=e.buffer,n=e.length,o=e.pos;o<n&&0!==t[o];)++o;return o-e.pos}.call(this),r=this.encoding,"function"==typeof r&&(r=r.call(a,a)||"ascii"),c=e.readString(n,r),null==this.length&&e.pos<e.length&&e.pos++,c},e.prototype.size=function(e,a){var n,o;return e?(n=this.encoding,"function"==typeof n&&(n=n.call(null==a?void 0:a.val,null==a?void 0:a.val)||"ascii"),"utf16be"===n&&(n="utf16le"),o=t.byteLength(e,n),this.length instanceof r&&(o+=this.length.size()),null==this.length&&o++,o):i.resolveLength(this.length,null,a)},e.prototype.encode=function(e,a,n){var i;if(i=this.encoding,"function"==typeof i&&(i=i.call(null==n?void 0:n.val,null==n?void 0:n.val)||"ascii"),this.length instanceof r&&this.length.encode(e,t.byteLength(a,i)),e.writeString(a,i),null==this.length)return e.writeUInt8(0)},e}(),a.exports=n}).call(this)}).call(this,e("buffer").Buffer)},{"./Number":430,"./utils":437,buffer:119}],435:[function(e,a){(function(){var t,r;r=e("./utils"),t=function(){function e(e){this.fields=null==e?{}:e}return e.prototype.decode=function(e,a,t){var r,n;return null==t&&(t=0),r=this._setup(e,a,t),this._parseFields(e,r,this.fields),null!=(n=this.process)&&n.call(r,e),r},e.prototype._setup=function(e,a,t){var r;return r={},Object.defineProperties(r,{parent:{value:a},_startOffset:{value:e.pos},_currentOffset:{value:0,writable:!0},_length:{value:t}}),r},e.prototype._parseFields=function(e,a,t){var n,i,o;for(n in t)i=t[n],o="function"==typeof i?i.call(a,a):i.decode(e,a),void 0!==o&&(o instanceof r.PropertyDescriptor?Object.defineProperty(a,n,o):a[n]=o),a._currentOffset=e.pos-a._startOffset},e.prototype.size=function(e,a,t){var r,n,i,o,c;for(n in null==e&&(e={}),null==t&&(t=!0),r={parent:a,val:e,pointerSize:0},i=0,c=this.fields,c)o=c[n],null!=o.size&&(i+=o.size(e[n],r));return t&&(i+=r.pointerSize),i},e.prototype.encode=function(e,a,t){var r,n,o,c,s,l,u;for(o in null!=(l=this.preEncode)&&l.call(a,e),r={pointers:[],startOffset:e.pos,parent:t,val:a,pointerSize:0},r.pointerOffset=e.pos+this.size(a,r,!1),u=this.fields,u)s=u[o],null!=s.encode&&s.encode(e,a[o],r);for(n=0;n<r.pointers.length;)c=r.pointers[n++],c.type.encode(e,c.val,c.parent)},e}(),a.exports=t}).call(this)},{"./utils":437}],436:[function(e,a){(function(){var t={}.hasOwnProperty,r=function(e,a){function r(){this.constructor=e}for(var n in a)t.call(a,n)&&(e[n]=a[n]);return r.prototype=a.prototype,e.prototype=new r,e.__super__=a.prototype,e},n,i;n=e("./Struct"),i=function(e){function a(e,a){this.type=e,this.versions=null==a?{}:a,"string"==typeof this.type&&(this.versionGetter=new Function("parent","return parent."+this.type),this.versionSetter=new Function("parent","version","return parent."+this.type+" = version"))}return r(a,e),a.prototype.decode=function(e,t,r){var n,i,o;if(null==r&&(r=0),i=this._setup(e,t,r),i.version="string"==typeof this.type?this.versionGetter(t):this.type.decode(e),this.versions.header&&this._parseFields(e,i,this.versions.header),n=this.versions[i.version],null==n)throw new Error("Unknown version "+i.version);return n instanceof a?n.decode(e,t):(this._parseFields(e,i,n),null!=(o=this.process)&&o.call(i,e),i)},a.prototype.size=function(e,a,t){var r,n,i,o,c,s;if(null==t&&(t=!0),!e)throw new Error("Not a fixed size");if(r={parent:a,val:e,pointerSize:0},o=0,"string"!=typeof this.type&&(o+=this.type.size(e.version,r)),this.versions.header)for(i in s=this.versions.header,s)c=s[i],null!=c.size&&(o+=c.size(e[i],r));if(n=this.versions[e.version],null==n)throw new Error("Unknown version "+e.version);for(i in n)c=n[i],null!=c.size&&(o+=c.size(e[i],r));return t&&(o+=r.pointerSize),o},a.prototype.encode=function(e,a,t){var r,n,o,c,s,l,u,d;if(null!=(u=this.preEncode)&&u.call(a,e),r={pointers:[],startOffset:e.pos,parent:t,val:a,pointerSize:0},r.pointerOffset=e.pos+this.size(a,r,!1),"string"!=typeof this.type&&this.type.encode(e,a.version),this.versions.header)for(c in d=this.versions.header,d)l=d[c],null!=l.encode&&l.encode(e,a[c],r);for(c in n=this.versions[a.version],n)l=n[c],null!=l.encode&&l.encode(e,a[c],r);for(o=0;o<r.pointers.length;)s=r.pointers[o++],s.type.encode(e,s.val,s.parent)},a}(n),a.exports=i}).call(this)},{"./Struct":435}],437:[function(e,a,t){(function(){var a,r;a=e("./Number").Number,t.resolveLength=function(e,t,r){var n;if("number"==typeof e?n=e:"function"==typeof e?n=e.call(r,r):r&&"string"==typeof e?n=r[e]:t&&e instanceof a&&(n=e.decode(t)),isNaN(n))throw new Error("Not a fixed size");return n},r=function(){return function(e){var a,t;for(a in null==e&&(e={}),this.enumerable=!0,this.configurable=!0,e)t=e[a],this[a]=t}}(),t.PropertyDescriptor=r}).call(this)},{"./Number":430}],438:[function(e,a){function t(){r.call(this)}a.exports=t;var r=e("events").EventEmitter,n=e("inherits");n(t,r),t.Readable=e("readable-stream/readable.js"),t.Writable=e("readable-stream/writable.js"),t.Duplex=e("readable-stream/duplex.js"),t.Transform=e("readable-stream/transform.js"),t.PassThrough=e("readable-stream/passthrough.js"),t.Stream=t,t.prototype.pipe=function(e,a){function t(a){e.writable&&!1===e.write(a)&&l.pause&&l.pause()}function n(){l.readable&&l.resume&&l.resume()}function i(){u||(u=!0,e.end())}function o(){u||(u=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(s(),0===r.listenerCount(this,"error"))throw e}function s(){l.removeListener("data",t),e.removeListener("drain",n),l.removeListener("end",i),l.removeListener("close",o),l.removeListener("error",c),e.removeListener("error",c),l.removeListener("end",s),l.removeListener("close",s),e.removeListener("close",s)}var l=this;l.on("data",t),e.on("drain",n),e._isStdio||a&&!1===a.end||(l.on("end",i),l.on("close",o));var u=!1;return l.on("error",c),e.on("error",c),l.on("end",s),l.on("close",s),e.on("close",s),e.emit("pipe",l),e}},{events:295,inherits:321,"readable-stream/duplex.js":402,"readable-stream/passthrough.js":412,"readable-stream/readable.js":413,"readable-stream/transform.js":414,"readable-stream/writable.js":415}],439:[function(e,a,t){(function(a){var r=e("./lib/request"),n=e("./lib/response"),i=e("xtend"),o=e("builtin-status-codes"),c=e("url"),s=t;s.request=function(e,t){e="string"==typeof e?c.parse(e):i(e);var n=-1===a.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||n,s=e.hostname||e.host,l=e.port,u=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?o+"//"+s:"")+(l?":"+l:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var d=new r(e);return t&&d.on("response",t),d},s.get=function(e,a){var t=s.request(e,a);return t.end(),t},s.ClientRequest=r,s.IncomingMessage=n.IncomingMessage,s.Agent=function(){},s.Agent.defaultMaxSockets=4,s.globalAgent=new s.Agent,s.STATUS_CODES=o,s.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./lib/request":441,"./lib/response":442,"builtin-status-codes":120,url:471,xtend:480}],440:[function(e,a,t){(function(e){function a(){if(i!==void 0)return i;if(e.XMLHttpRequest){i=new e.XMLHttpRequest;try{i.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(a){i=null}}else i=null;return i}function r(e){var t=a();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(a){}return!1}function n(e){return"function"==typeof e}t.fetch=n(e.fetch)&&n(e.ReadableStream),t.writableStream=n(e.WritableStream),t.abortController=n(e.AbortController);var i;t.arraybuffer=t.fetch||r("arraybuffer"),t.msstream=!t.fetch&&r("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&r("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!a()&&n(a().overrideMimeType),i=null}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],441:[function(e,a){(function(t,r,n){function i(e,a){return c.fetch&&a?"fetch":c.mozchunkedarraybuffer?"moz-chunked-arraybuffer":c.msstream?"ms-stream":c.arraybuffer&&e?"arraybuffer":"text"}function o(e){try{var a=e.status;return null!==a&&0!==a}catch(a){return!1}}var c=e("./capability"),s=e("inherits"),l=e("./response"),u=e("readable-stream"),d=l.IncomingMessage,X=l.readyStates,m=a.exports=function(e){var a=this;u.Writable.call(a),a._opts=e,a._body=[],a._headers={},e.auth&&a.setHeader("Authorization","Basic "+n.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){a.setHeader(t,e.headers[t])});var t=!0,r;if("disable-fetch"===e.mode||"requestTimeout"in e&&!c.abortController)t=!1,r=!0;else if("prefer-streaming"===e.mode)r=!1;else if("allow-wrong-content-type"===e.mode)r=!c.overrideMimeType;else if(!e.mode||"default"===e.mode||"prefer-fast"===e.mode)r=!0;else throw new Error("Invalid value for opts.mode");a._mode=i(r,t),a._fetchTimer=null,a.on("finish",function(){a._onFinish()})};s(m,u.Writable),m.prototype.setHeader=function(e,a){var t=this,r=e.toLowerCase();-1!==P.indexOf(r)||(t._headers[r]={name:e,value:a})},m.prototype.getHeader=function(e){var a=this._headers[e.toLowerCase()];return a?a.value:null},m.prototype.removeHeader=function(e){var a=this;delete a._headers[e.toLowerCase()]},m.prototype._onFinish=function(){var e=this;if(!e._destroyed){var a=e._opts,n=e._headers,i=null;"GET"!==a.method&&"HEAD"!==a.method&&(i=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var o=[];if(Object.keys(n).forEach(function(e){var a=n[e].name,t=n[e].value;Array.isArray(t)?t.forEach(function(e){o.push([a,e])}):o.push([a,t])}),"fetch"===e._mode){var s=null;if(c.abortController){var l=new AbortController;s=l.signal,e._fetchAbortController=l,"requestTimeout"in a&&0!==a.requestTimeout&&(e._fetchTimer=r.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},a.requestTimeout))}r.fetch(e._opts.url,{method:e._opts.method,headers:o,body:i||void 0,mode:"cors",credentials:a.withCredentials?"include":"same-origin",signal:s}).then(function(a){e._fetchResponse=a,e._connect()},function(a){r.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",a)})}else{var u=e._xhr=new r.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(a){return void t.nextTick(function(){e.emit("error",a)})}"responseType"in u&&(u.responseType=e._mode),"withCredentials"in u&&(u.withCredentials=!!a.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in a&&(u.timeout=a.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),o.forEach(function(e){u.setRequestHeader(e[0],e[1])}),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case X.LOADING:case X.DONE:e._onXHRProgress();}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{u.send(i)}catch(a){return void t.nextTick(function(){e.emit("error",a)})}}}},m.prototype._onXHRProgress=function(){var e=this;!o(e._xhr)||e._destroyed||(!e._response&&e._connect(),e._response._onXHRProgress())},m.prototype._connect=function(){var e=this;e._destroyed||(e._response=new d(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(a){e.emit("error",a)}),e.emit("response",e._response))},m.prototype._write=function(e,a,t){var r=this;r._body.push(e),t()},m.prototype.abort=m.prototype.destroy=function(){var e=this;e._destroyed=!0,r.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},m.prototype.end=function(e,a,t){var r=this;"function"==typeof e&&(t=e,e=void 0),u.Writable.prototype.end.call(r,e,a,t)},m.prototype.flushHeaders=function(){},m.prototype.setTimeout=function(){},m.prototype.setNoDelay=function(){},m.prototype.setSocketKeepAlive=function(){};var P=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("buffer").Buffer)},{"./capability":440,"./response":442,_process:116,buffer:119,inherits:321,"readable-stream":457}],442:[function(e,a,t){(function(a,r,n){var i=e("./capability"),o=e("inherits"),c=e("readable-stream"),s=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=t.IncomingMessage=function(e,t,o,s){var l=this;if(c.Readable.call(l),l._mode=o,l.headers={},l.rawHeaders=[],l.trailers={},l.rawTrailers=[],l.on("end",function(){a.nextTick(function(){l.emit("close")})}),"fetch"===o){function e(){d.read().then(function(a){return l._destroyed?void 0:a.done?(r.clearTimeout(s),void l.push(null)):void(l.push(n.from(a.value)),e())}).catch(function(e){r.clearTimeout(s),l._destroyed||l.emit("error",e)})}if(l._fetchResponse=t,l.url=t.url,l.statusCode=t.status,l.statusMessage=t.statusText,t.headers.forEach(function(e,a){l.headers[a.toLowerCase()]=e,l.rawHeaders.push(a,e)}),i.writableStream){var u=new WritableStream({write:function(e){return new Promise(function(a,t){l._destroyed?t():l.push(n.from(e))?a():l._resumeFetch=a})},close:function(){r.clearTimeout(s),l._destroyed||l.push(null)},abort:function(e){l._destroyed||l.emit("error",e)}});try{return void t.body.pipeTo(u).catch(function(e){r.clearTimeout(s),l._destroyed||l.emit("error",e)})}catch(a){}}var d=t.body.getReader();e()}else{l._xhr=e,l._pos=0,l.url=e.responseURL,l.statusCode=e.status,l.statusMessage=e.statusText;var X=e.getAllResponseHeaders().split(/\r?\n/);if(X.forEach(function(e){var a=e.match(/^([^:]+):\s*(.*)/);if(a){var t=a[1].toLowerCase();"set-cookie"===t?(void 0===l.headers[t]&&(l.headers[t]=[]),l.headers[t].push(a[2])):void 0===l.headers[t]?l.headers[t]=a[2]:l.headers[t]+=", "+a[2],l.rawHeaders.push(a[1],a[2])}}),l._charset="x-user-defined",!i.overrideMimeType){var m=l.rawHeaders["mime-type"];if(m){var P=m.match(/;\s*charset=([^;])(;|$)/);P&&(l._charset=P[1].toLowerCase())}l._charset||(l._charset="utf-8")}}};o(l,c.Readable),l.prototype._read=function(){var e=this,a=e._resumeFetch;a&&(e._resumeFetch=null,a())},l.prototype._onXHRProgress=function(){var e=this,a=e._xhr,t=null;switch(e._mode){case"text":if(t=a.responseText,t.length>e._pos){var o=t.substr(e._pos);if("x-user-defined"===e._charset){for(var c=n.alloc(o.length),l=0;l<o.length;l++)c[l]=255&o.charCodeAt(l);e.push(c)}else e.push(o,e._charset);e._pos=t.length}break;case"arraybuffer":if(a.readyState!==s.DONE||!a.response)break;t=a.response,e.push(n.from(new Uint8Array(t)));break;case"moz-chunked-arraybuffer":if(t=a.response,a.readyState!==s.LOADING||!t)break;e.push(n.from(new Uint8Array(t)));break;case"ms-stream":if(t=a.response,a.readyState!==s.LOADING)break;var u=new r.MSStreamReader;u.onprogress=function(){u.result.byteLength>e._pos&&(e.push(n.from(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(t);}e._xhr.readyState===s.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("buffer").Buffer)},{"./capability":440,_process:116,buffer:119,inherits:321,"readable-stream":457}],443:[function(e,a){'use strict';function t(e,a){e.prototype=Object.create(a.prototype),e.prototype.constructor=e,e.__proto__=a}function r(e,a,r){function n(e,t,r){return"string"==typeof a?a:a(e,t,r)}r||(r=Error);var i=function(e){function a(a,t,r){return e.call(this,n(a,t,r))||this}return t(a,e),a}(r);i.prototype.name=r.name,i.prototype.code=e,s[e]=i}function n(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map(function(e){return e+""}),2<t?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(e+"")}function i(e,a,t){return e.substr(!t||0>t?0:+t,a.length)===a}function o(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-a.length,t)===a}function c(e,a,t){return"number"!=typeof t&&(t=0),!(t+a.length>e.length)&&-1!==e.indexOf(a,t)}var s={};r("ERR_INVALID_OPT_VALUE",function(e,a){return"The value \""+a+"\" is invalid for option \""+e+"\""},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,a,t){var r;"string"==typeof a&&i(a,"not ")?(r="must not be",a=a.replace(/^not /,"")):r="must be";var s;if(o(e," argument"))s="The ".concat(e," ").concat(r," ").concat(n(a,"type"));else{var l=c(e,".")?"property":"argument";s="The \"".concat(e,"\" ").concat(l," ").concat(r," ").concat(n(a,"type"))}return s+=". Received type ".concat(typeof t),s},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),a.exports.codes=s},{}],444:[function(e,a){(function(t){'use strict';function r(e){return this instanceof r?void(c.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",n)))):new r(e)}function n(){this._writableState.ended||t.nextTick(i,this)}function i(e){e.end()}var o=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};a.exports=r;var c=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(r,c);for(var l=o(s.prototype),u=0,d;u<l.length;u++)d=l[u],r.prototype[d]||(r.prototype[d]=s.prototype[d]);Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(r.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(r.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,e("_process"))},{"./_stream_readable":446,"./_stream_writable":448,_process:116,inherits:321}],445:[function(e,a){'use strict';function t(e){return this instanceof t?void r.call(this,e):new t(e)}a.exports=t;var r=e("./_stream_transform");e("inherits")(t,r),t.prototype._transform=function(e,a,t){t(null,e)}},{"./_stream_transform":447,inherits:321}],446:[function(e,a){(function(t,r){'use strict';function n(e){return w.from(e)}function i(e){return w.isBuffer(e)||e instanceof S}function o(e,a,t){return"function"==typeof e.prependListener?e.prependListener(a,t):void(e._events&&e._events[a]?Array.isArray(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t))}function c(a,t,r){N=N||e("./_stream_duplex"),a=a||{},"boolean"!=typeof r&&(r=t instanceof N),this.objectMode=!!a.objectMode,r&&(this.objectMode=this.objectMode||!!a.readableObjectMode),this.highWaterMark=L(this,a,"readableHighWaterMark",r),this.buffer=new Y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==a.emitClose,this.autoDestroy=!!a.autoDestroy,this.destroyed=!1,this.defaultEncoding=a.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,a.encoding&&(!V&&(V=e("string_decoder/").StringDecoder),this.decoder=new V(a.encoding),this.encoding=a.encoding)}function s(a){if(N=N||e("./_stream_duplex"),!(this instanceof s))return new s(a);var t=this instanceof N;this._readableState=new c(a,this,t),this.readable=!0,a&&("function"==typeof a.read&&(this._read=a.read),"function"==typeof a.destroy&&(this._destroy=a.destroy)),T.call(this)}function l(e,a,t,r,i){R("readableAddChunk",a);var o=e._readableState;if(null===a)o.reading=!1,P(e,o);else{var c;if(i||(c=d(o,a)),c)H(e,c);else if(!(o.objectMode||a&&0<a.length))r||(o.reading=!1,p(e,o));else if("string"==typeof a||o.objectMode||Object.getPrototypeOf(a)===w.prototype||(a=n(a)),r)o.endEmitted?H(e,new j):u(e,o,a,!0);else if(o.ended)H(e,new F);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!t?(a=o.decoder.write(a),o.objectMode||0!==a.length?u(e,o,a,!1):p(e,o)):u(e,o,a,!1)}}return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function u(e,a,t,r){a.flowing&&0===a.length&&!a.sync?(a.awaitDrain=0,e.emit("data",t)):(a.length+=a.objectMode?1:t.length,r?a.buffer.unshift(t):a.buffer.push(t),a.needReadable&&K(e)),p(e,a)}function d(e,a){var t;return i(a)||"string"==typeof a||void 0===a||e.objectMode||(t=new M("chunk",["string","Buffer","Uint8Array"],a)),t}function X(e){return 1073741824<=e?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function m(e,a){return 0>=e||0===a.length&&a.ended?0:a.objectMode?1:e===e?(e>a.highWaterMark&&(a.highWaterMark=X(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0)):a.flowing&&a.length?a.buffer.head.data.length:a.length}function P(e,a){if(R("onEofChunk"),!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,a.sync?K(e):(a.needReadable=!1,!a.emittedReadable&&(a.emittedReadable=!0,g(e)))}}function K(e){var a=e._readableState;R("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(R("emitReadable",a.flowing),a.emittedReadable=!0,t.nextTick(g,e))}function g(e){var a=e._readableState;R("emitReadable_",a.destroyed,a.length,a.ended),!a.destroyed&&(a.length||a.ended)&&(e.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,C(e)}function p(e,a){a.readingMore||(a.readingMore=!0,t.nextTick(f,e,a))}function f(e,a){for(;!a.reading&&!a.ended&&(a.length<a.highWaterMark||a.flowing&&0===a.length);){var t=a.length;if(R("maybeReadMore read 0"),e.read(0),t===a.length)break}a.readingMore=!1}function h(e){return function(){var a=e._readableState;R("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&k(e,"data")&&(a.flowing=!0,C(e))}}function y(e){var a=e._readableState;a.readableListening=0<e.listenerCount("readable"),a.resumeScheduled&&!a.paused?a.flowing=!0:0<e.listenerCount("data")&&e.resume()}function b(e){R("readable nexttick read 0"),e.read(0)}function A(e,a){a.resumeScheduled||(a.resumeScheduled=!0,t.nextTick(v,e,a))}function v(e,a){R("resume",a.reading),a.reading||e.read(0),a.resumeScheduled=!1,e.emit("resume"),C(e),a.flowing&&!a.reading&&e.read(0)}function C(e){var a=e._readableState;for(R("flow",a.flowing);a.flowing&&null!==e.read(););}function B(e,a){if(0===a.length)return null;var t;return a.objectMode?t=a.buffer.shift():!e||e>=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.first():a.buffer.concat(a.length),a.buffer.clear()):t=a.buffer.consume(e,a.decoder),t}function x(e){var a=e._readableState;R("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,t.nextTick(_,a,e))}function _(e,a){if(R("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,a.readable=!1,a.emit("end"),e.autoDestroy)){var t=a._writableState;(!t||t.autoDestroy&&t.finished)&&a.destroy()}}function W(e,a){for(var t=0,r=e.length;t<r;t++)if(e[t]===a)return t;return-1}a.exports=s;var N;s.ReadableState=c;var O=e("events").EventEmitter,k=function(e,a){return e.listeners(a).length},T=e("./internal/streams/stream"),w=e("buffer").Buffer,S=r.Uint8Array||function(){},U=e("util"),R;R=U&&U.debuglog?U.debuglog("stream"):function(){};var Y=e("./internal/streams/buffer_list"),I=e("./internal/streams/destroy"),E=e("./internal/streams/state"),L=E.getHighWaterMark,D=e("../errors").codes,M=D.ERR_INVALID_ARG_TYPE,F=D.ERR_STREAM_PUSH_AFTER_EOF,z=D.ERR_METHOD_NOT_IMPLEMENTED,j=D.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,V,q,G;e("inherits")(s,T);var H=I.errorOrDestroy,J=["error","close","destroy","pause","resume"];Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),s.prototype.destroy=I.destroy,s.prototype._undestroy=I.undestroy,s.prototype._destroy=function(e,a){a(e)},s.prototype.push=function(e,a){var t=this._readableState,r;return t.objectMode?r=!0:"string"==typeof e&&(a=a||t.defaultEncoding,a!==t.encoding&&(e=w.from(e,a),a=""),r=!0),l(this,e,a,!1,r)},s.prototype.unshift=function(e){return l(this,e,null,!0,!1)},s.prototype.isPaused=function(){return!1===this._readableState.flowing},s.prototype.setEncoding=function(a){V||(V=e("string_decoder/").StringDecoder);var t=new V(a);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};s.prototype.read=function(e){R("read",e),e=parseInt(e,10);var a=this._readableState,t=e;if(0!==e&&(a.emittedReadable=!1),0===e&&a.needReadable&&((0===a.highWaterMark?0<a.length:a.length>=a.highWaterMark)||a.ended))return R("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?x(this):K(this),null;if(e=m(e,a),0===e&&a.ended)return 0===a.length&&x(this),null;var r=a.needReadable;R("need readable",r),(0===a.length||a.length-e<a.highWaterMark)&&(r=!0,R("length less than watermark",r)),a.ended||a.reading?(r=!1,R("reading or ended",r)):r&&(R("do read"),a.reading=!0,a.sync=!0,0===a.length&&(a.needReadable=!0),this._read(a.highWaterMark),a.sync=!1,!a.reading&&(e=m(t,a)));var i;return i=0<e?B(e,a):null,null===i?(a.needReadable=a.length<=a.highWaterMark,e=0):(a.length-=e,a.awaitDrain=0),0===a.length&&(!a.ended&&(a.needReadable=!0),t!==e&&a.ended&&x(this)),null!==i&&this.emit("data",i),i},s.prototype._read=function(){H(this,new z("_read()"))},s.prototype.pipe=function(e,a){function r(e,a){R("onunpipe"),e===X&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i())}function n(){R("onend"),e.end()}function i(){R("cleanup"),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("drain",g),e.removeListener("error",s),e.removeListener("unpipe",r),X.removeListener("end",n),X.removeListener("end",d),X.removeListener("data",c),p=!0,m.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&g()}function c(a){R("ondata");var t=e.write(a);R("dest.write",t),!1===t&&((1===m.pipesCount&&m.pipes===e||1<m.pipesCount&&-1!==W(m.pipes,e))&&!p&&(R("false write response, pause",m.awaitDrain),m.awaitDrain++),X.pause())}function s(a){R("onerror",a),d(),e.removeListener("error",s),0===k(e,"error")&&H(e,a)}function l(){e.removeListener("finish",u),d()}function u(){R("onfinish"),e.removeListener("close",l),d()}function d(){R("unpipe"),X.unpipe(e)}var X=this,m=this._readableState;switch(m.pipesCount){case 0:m.pipes=e;break;case 1:m.pipes=[m.pipes,e];break;default:m.pipes.push(e);}m.pipesCount+=1,R("pipe count=%d opts=%j",m.pipesCount,a);var P=(!a||!1!==a.end)&&e!==t.stdout&&e!==t.stderr,K=P?n:d;m.endEmitted?t.nextTick(K):X.once("end",K),e.on("unpipe",r);var g=h(X);e.on("drain",g);var p=!1;return X.on("data",c),o(e,"error",s),e.once("close",l),e.once("finish",u),e.emit("pipe",X),m.flowing||(R("pipe resume"),X.resume()),e},s.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes?this:(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t),this);if(!e){var r=a.pipes,n=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var c=W(a.pipes,e);return-1===c?this:(a.pipes.splice(c,1),a.pipesCount-=1,1===a.pipesCount&&(a.pipes=a.pipes[0]),e.emit("unpipe",this,t),this)},s.prototype.on=function(e,a){var r=T.prototype.on.call(this,e,a),n=this._readableState;return"data"===e?(n.readableListening=0<this.listenerCount("readable"),!1!==n.flowing&&this.resume()):"readable"==e&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,R("on readable",n.length,n.reading),n.length?K(this):!n.reading&&t.nextTick(b,this)),r},s.prototype.addListener=s.prototype.on,s.prototype.removeListener=function(e,a){var r=T.prototype.removeListener.call(this,e,a);return"readable"===e&&t.nextTick(y,this),r},s.prototype.removeAllListeners=function(e){var a=T.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&t.nextTick(y,this),a},s.prototype.resume=function(){var e=this._readableState;return e.flowing||(R("resume"),e.flowing=!e.readableListening,A(this,e)),e.paused=!1,this},s.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},s.prototype.wrap=function(e){var a=this,t=this._readableState,r=!1;for(var o in e.on("end",function(){if(R("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&a.push(e)}a.push(null)}),e.on("data",function(n){if((R("wrapped data"),t.decoder&&(n=t.decoder.write(n)),!(t.objectMode&&(null===n||void 0===n)))&&(t.objectMode||n&&n.length)){var i=a.push(n);i||(r=!0,e.pause())}}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(a){return function(){return e[a].apply(e,arguments)}}(o));for(var i=0;i<J.length;i++)e.on(J[i],this.emit.bind(this,J[i]));return this._read=function(a){R("wrapped _read",a),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(s.prototype[Symbol.asyncIterator]=function(){return void 0===q&&(q=e("./internal/streams/async_iterator")),q(this)}),Object.defineProperty(s.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(s.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(s.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),s._fromList=B,Object.defineProperty(s.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(s.from=function(a,t){return void 0===G&&(G=e("./internal/streams/from")),G(s,a,t)})}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"../errors":443,"./_stream_duplex":444,"./internal/streams/async_iterator":449,"./internal/streams/buffer_list":450,"./internal/streams/destroy":451,"./internal/streams/from":453,"./internal/streams/state":455,"./internal/streams/stream":456,_process:116,buffer:119,events:295,inherits:321,"string_decoder/":458,util:115}],447:[function(e,a){'use strict';function t(e,a){var t=this._transformState;t.transforming=!1;var r=t.writecb;if(null===r)return this.emit("error",new s);t.writechunk=null,t.writecb=null,null!=a&&this.push(a),r(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function r(e){return this instanceof r?void(d.call(this,e),this._transformState={afterTransform:t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",n)):new r(e)}function n(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?i(this,null,null):this._flush(function(a,t){i(e,a,t)})}function i(e,a,t){if(a)return e.emit("error",a);if(null!=t&&e.push(t),e._writableState.length)throw new u;if(e._transformState.transforming)throw new l;return e.push(null)}a.exports=r;var o=e("../errors").codes,c=o.ERR_METHOD_NOT_IMPLEMENTED,s=o.ERR_MULTIPLE_CALLBACK,l=o.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=o.ERR_TRANSFORM_WITH_LENGTH_0,d=e("./_stream_duplex");e("inherits")(r,d),r.prototype.push=function(e,a){return this._transformState.needTransform=!1,d.prototype.push.call(this,e,a)},r.prototype._transform=function(e,a,t){t(new c("_transform()"))},r.prototype._write=function(e,a,t){var r=this._transformState;if(r.writecb=t,r.writechunk=e,r.writeencoding=a,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},r.prototype._read=function(){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},r.prototype._destroy=function(e,a){d.prototype._destroy.call(this,e,function(e){a(e)})}},{"../errors":443,"./_stream_duplex":444,inherits:321}],448:[function(e,a){(function(t,r){'use strict';function n(e){var a=this;this.next=null,this.entry=null,this.finish=function(){x(a,e)}}function i(e){return O.from(e)}function o(e){return O.isBuffer(e)||e instanceof k}function c(){}function s(a,t,r){_=_||e("./_stream_duplex"),a=a||{},"boolean"!=typeof r&&(r=t instanceof _),this.objectMode=!!a.objectMode,r&&(this.objectMode=this.objectMode||!!a.writableObjectMode),this.highWaterMark=S(this,a,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===a.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){p(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==a.emitClose,this.autoDestroy=!!a.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function l(a){_=_||e("./_stream_duplex");var t=this instanceof _;return t||j.call(l,this)?void(this._writableState=new s(a,this,t),this.writable=!0,a&&("function"==typeof a.write&&(this._write=a.write),"function"==typeof a.writev&&(this._writev=a.writev),"function"==typeof a.destroy&&(this._destroy=a.destroy),"function"==typeof a.final&&(this._final=a.final)),N.call(this)):new l(a)}function u(e,a){var r=new M;z(e,r),t.nextTick(a,r)}function d(e,a,r,n){var i;return null===r?i=new D:"string"!=typeof r&&!a.objectMode&&(i=new R("chunk",["string","Buffer"],r)),!i||(z(e,i),t.nextTick(n,i),!1)}function X(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=O.from(a,t)),a}function m(e,a,t,r,n,i){if(!t){var o=X(a,r,n);r!==o&&(t=!0,n="buffer",r=o)}var c=a.objectMode?1:r.length;a.length+=c;var s=a.length<a.highWaterMark;if(s||(a.needDrain=!0),a.writing||a.corked){var l=a.lastBufferedRequest;a.lastBufferedRequest={chunk:r,encoding:n,isBuf:t,callback:i,next:null},l?l.next=a.lastBufferedRequest:a.bufferedRequest=a.lastBufferedRequest,a.bufferedRequestCount+=1}else P(e,a,!1,c,r,n,i);return s}function P(e,a,t,r,n,i,o){a.writelen=r,a.writecb=o,a.writing=!0,a.sync=!0,a.destroyed?a.onwrite(new L("write")):t?e._writev(n,a.onwrite):e._write(n,i,a.onwrite),a.sync=!1}function K(e,a,r,n,i){--a.pendingcb,r?(t.nextTick(i,n),t.nextTick(C,e,a),e._writableState.errorEmitted=!0,z(e,n)):(i(n),e._writableState.errorEmitted=!0,z(e,n),C(e,a))}function g(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function p(e,a){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new I;if(g(r),a)K(e,r,n,a,i);else{var o=b(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||y(e,r),n?t.nextTick(f,e,r,o,i):f(e,r,o,i)}}function f(e,a,t,r){t||h(e,a),a.pendingcb--,r(),C(e,a)}function h(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}function y(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var r=a.bufferedRequestCount,i=Array(r),o=a.corkedRequestsFree;o.entry=t;for(var c=0,s=!0;t;)i[c]=t,t.isBuf||(s=!1),t=t.next,c+=1;i.allBuffers=s,P(e,a,!0,a.length,i,"",o.finish),a.pendingcb++,a.lastBufferedRequest=null,o.next?(a.corkedRequestsFree=o.next,o.next=null):a.corkedRequestsFree=new n(a),a.bufferedRequestCount=0}else{for(;t;){var l=t.chunk,u=t.encoding,d=t.callback,X=a.objectMode?1:l.length;if(P(e,a,!1,X,l,u,d),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,a){e._final(function(t){a.pendingcb--,t&&z(e,t),a.prefinished=!0,e.emit("prefinish"),C(e,a)})}function v(e,a){a.prefinished||a.finalCalled||("function"!=typeof e._final||a.destroyed?(a.prefinished=!0,e.emit("prefinish")):(a.pendingcb++,a.finalCalled=!0,t.nextTick(A,e,a)))}function C(e,a){var t=b(a);if(t&&(v(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"),a.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return t}function B(e,a,r){a.ending=!0,C(e,a),r&&(a.finished?t.nextTick(r):e.once("finish",r)),a.ended=!0,e.writable=!1}function x(e,a,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;a.pendingcb--,n(t),r=r.next}a.corkedRequestsFree.next=e}a.exports=l;var _;l.WritableState=s;var W={deprecate:e("util-deprecate")},N=e("./internal/streams/stream"),O=e("buffer").Buffer,k=r.Uint8Array||function(){},T=e("./internal/streams/destroy"),w=e("./internal/streams/state"),S=w.getHighWaterMark,U=e("../errors").codes,R=U.ERR_INVALID_ARG_TYPE,Y=U.ERR_METHOD_NOT_IMPLEMENTED,I=U.ERR_MULTIPLE_CALLBACK,E=U.ERR_STREAM_CANNOT_PIPE,L=U.ERR_STREAM_DESTROYED,D=U.ERR_STREAM_NULL_VALUES,M=U.ERR_STREAM_WRITE_AFTER_END,F=U.ERR_UNKNOWN_ENCODING,z=T.errorOrDestroy;e("inherits")(l,N),s.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(s.prototype,"buffer",{get:W.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var j;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(j=Function.prototype[Symbol.hasInstance],Object.defineProperty(l,Symbol.hasInstance,{value:function(e){return!!j.call(this,e)||!(this!==l)&&e&&e._writableState instanceof s}})):j=function(e){return e instanceof this},l.prototype.pipe=function(){z(this,new E)},l.prototype.write=function(e,a,t){var r=this._writableState,n=!1,s=!r.objectMode&&o(e);return s&&!O.isBuffer(e)&&(e=i(e)),"function"==typeof a&&(t=a,a=null),s?a="buffer":!a&&(a=r.defaultEncoding),"function"!=typeof t&&(t=c),r.ending?u(this,t):(s||d(this,r,e,t))&&(r.pendingcb++,n=m(this,r,s,e,a,t)),n},l.prototype.cork=function(){this._writableState.corked++},l.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&y(this,e))},l.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new F(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),l.prototype._write=function(e,a,t){t(new Y("_write()"))},l.prototype._writev=null,l.prototype.end=function(e,a,t){var r=this._writableState;return"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!==e&&void 0!==e&&this.write(e,a),r.corked&&(r.corked=1,this.uncork()),r.ending||B(this,r,t),this},Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),l.prototype.destroy=T.destroy,l.prototype._undestroy=T.undestroy,l.prototype._destroy=function(e,a){a(e)}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"../errors":443,"./_stream_duplex":444,"./internal/streams/destroy":451,"./internal/streams/state":455,"./internal/streams/stream":456,_process:116,buffer:119,inherits:321,"util-deprecate":474}],449:[function(e,a){(function(t){'use strict';function r(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function n(e,a){return{value:e,done:a}}function i(e){var a=e[l];if(null!==a){var t=e[K].read();null!==t&&(e[m]=null,e[l]=null,e[u]=null,a(n(t,!1)))}}function o(e){t.nextTick(i,e)}function c(e,a){return function(t,r){e.then(function(){return a[X]?void t(n(void 0,!0)):void a[P](t,r)},r)}}var s=e("./end-of-stream"),l=Symbol("lastResolve"),u=Symbol("lastReject"),d=Symbol("error"),X=Symbol("ended"),m=Symbol("lastPromise"),P=Symbol("handlePromise"),K=Symbol("stream"),g=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((f={get stream(){return this[K]},next:function(){var e=this,a=this[d];if(null!==a)return Promise.reject(a);if(this[X])return Promise.resolve(n(void 0,!0));if(this[K].destroyed)return new Promise(function(a,r){t.nextTick(function(){e[d]?r(e[d]):a(n(void 0,!0))})});var r=this[m],i;if(r)i=new Promise(c(r,this));else{var o=this[K].read();if(null!==o)return Promise.resolve(n(o,!1));i=new Promise(this[P])}return this[m]=i,i}},r(f,Symbol.asyncIterator,function(){return this}),r(f,"return",function(){var e=this;return new Promise(function(a,t){e[K].destroy(null,function(e){return e?void t(e):void a(n(void 0,!0))})})}),f),g),f;a.exports=function(e){var a=Object.create(p,(t={},r(t,K,{value:e,writable:!0}),r(t,l,{value:null,writable:!0}),r(t,u,{value:null,writable:!0}),r(t,d,{value:null,writable:!0}),r(t,X,{value:e._readableState.endEmitted,writable:!0}),r(t,P,{value:function(e,t){var r=a[K].read();r?(a[m]=null,a[l]=null,a[u]=null,e(n(r,!1))):(a[l]=e,a[u]=t)},writable:!0}),t)),t;return a[m]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=a[u];return null!==t&&(a[m]=null,a[l]=null,a[u]=null,t(e)),void(a[d]=e)}var r=a[l];null!==r&&(a[m]=null,a[l]=null,a[u]=null,r(n(void 0,!0))),a[X]=!0}),e.on("readable",o.bind(null,a)),a}}).call(this,e("_process"))},{"./end-of-stream":452,_process:116}],450:[function(e,a){'use strict';function t(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,r)}return t}function r(e){for(var a=1,r;a<arguments.length;a++)r=null==arguments[a]?{}:arguments[a],a%2?t(Object(r),!0).forEach(function(a){n(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))});return e}function n(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function i(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function o(e,a){for(var t=0,r;t<a.length;t++)r=a[t],r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}function c(e,a,t){return a&&o(e.prototype,a),t&&o(e,t),e}function s(e,a,t){u.prototype.copy.call(e,a,t)}var l=e("buffer"),u=l.Buffer,d=e("util"),X=d.inspect,m=X&&X.custom||"inspect";a.exports=function(){function e(){i(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:"push",value:function(e){var a={data:e,next:null};0<this.length?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var a=u.allocUnsafe(e>>>0),t=this.head,r=0;t;)s(t.data,a,r),r+=t.data.length,t=t.next;return a}},{key:"consume",value:function(e,a){var t;return e<this.head.data.length?(t=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):e===this.head.data.length?t=this.shift():t=a?this._getString(e):this._getBuffer(e),t}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var a=this.head,t=1,r=a.data;for(e-=r.length;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(r+=o===i.length?i:i.slice(0,e),e-=o,0===e){o===i.length?(++t,this.head=a.next?a.next:this.tail=null):(this.head=a,a.data=i.slice(o));break}++t}return this.length-=t,r}},{key:"_getBuffer",value:function(e){var a=u.allocUnsafe(e),t=this.head,r=1;for(t.data.copy(a),e-=t.data.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(i.copy(a,a.length-e,0,o),e-=o,0===e){o===i.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,a}},{key:m,value:function(e,a){return X(this,r({},a,{depth:0,customInspect:!1}))}}]),e}()},{buffer:119,util:115}],451:[function(e,a){(function(e){'use strict';function t(e,a){n(e,a),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,a){e.emit("error",a)}a.exports={destroy:function(a,i){var o=this,c=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return c||s?(i?i(a):a&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e.nextTick(n,this,a)):e.nextTick(n,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(a){!i&&a?o._writableState?o._writableState.errorEmitted?e.nextTick(r,o):(o._writableState.errorEmitted=!0,e.nextTick(t,o,a)):e.nextTick(t,o,a):i?(e.nextTick(r,o),i(a)):e.nextTick(r,o)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,a){var t=e._readableState,r=e._writableState;t&&t.autoDestroy||r&&r.autoDestroy?e.destroy(a):e.emit("error",a)}}}).call(this,e("_process"))},{_process:116}],452:[function(e,a){'use strict';function t(e){var a=!1;return function(){if(!a){a=!0;for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];e.apply(this,r)}}}function r(){}function n(e){return e.setHeader&&"function"==typeof e.abort}function i(e,a,c){if("function"==typeof a)return i(e,null,a);a||(a={}),c=t(c||r);var s=a.readable||!1!==a.readable&&e.readable,l=a.writable||!1!==a.writable&&e.writable,u=function(){e.writable||X()},d=e._writableState&&e._writableState.finished,X=function(){l=!1,d=!0,s||c.call(e)},m=e._readableState&&e._readableState.endEmitted,P=function(){s=!1,m=!0,l||c.call(e)},K=function(a){c.call(e,a)},g=function(){var a;return s&&!m?(e._readableState&&e._readableState.ended||(a=new o),c.call(e,a)):l&&!d?(e._writableState&&e._writableState.ended||(a=new o),c.call(e,a)):void 0},p=function(){e.req.on("finish",X)};return n(e)?(e.on("complete",X),e.on("abort",g),e.req?p():e.on("request",p)):l&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",P),e.on("finish",X),!1!==a.error&&e.on("error",K),e.on("close",g),function(){e.removeListener("complete",X),e.removeListener("abort",g),e.removeListener("request",p),e.req&&e.req.removeListener("finish",X),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",X),e.removeListener("end",P),e.removeListener("error",K),e.removeListener("close",g)}}var o=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;a.exports=i},{"../../../errors":443}],453:[function(e,a){a.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],454:[function(e,a){'use strict';function t(e){var a=!1;return function(){a||(a=!0,e.apply(void 0,arguments))}}function r(e){if(e)throw e}function n(e){return e.setHeader&&"function"==typeof e.abort}function o(a,r,i,o){o=t(o);var c=!1;a.on("close",function(){c=!0}),m===void 0&&(m=e("./end-of-stream")),m(a,{readable:r,writable:i},function(e){return e?o(e):void(c=!0,o())});var s=!1;return function(e){if(!c)return s?void 0:(s=!0,n(a)?a.abort():"function"==typeof a.destroy?a.destroy():void o(e||new X("pipe")))}}function c(e){e()}function s(e,a){return e.pipe(a)}function l(e){return e.length?"function"==typeof e[e.length-1]?e.pop():r:r}var u=e("../../../errors").codes,d=u.ERR_MISSING_ARGS,X=u.ERR_STREAM_DESTROYED,m;a.exports=function(){for(var e=arguments.length,a=Array(e),t=0;t<e;t++)a[t]=arguments[t];var r=l(a);if(Array.isArray(a[0])&&(a=a[0]),2>a.length)throw new d("streams");var n=a.map(function(e,t){var s=t<a.length-1;return o(e,s,0<t,function(e){i||(i=e),e&&n.forEach(c),s||(n.forEach(c),r(i))})}),i;return a.reduce(s)}},{"../../../errors":443,"./end-of-stream":452}],455:[function(e,a){'use strict';function t(e,a,t){return null==e.highWaterMark?a?e[t]:null:e.highWaterMark}var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;a.exports={getHighWaterMark:function(e,a,n,i){var o=t(a,i,n);if(null!=o){if(!(isFinite(o)&&A(o)===o)||0>o){var c=i?n:"highWaterMark";throw new r(c,o)}return A(o)}return e.objectMode?16:16384}}},{"../../../errors":443}],456:[function(e,a,t){arguments[4][410][0].apply(t,arguments)},{dup:410,events:295}],457:[function(e,a,t){t=a.exports=e("./lib/_stream_readable.js"),t.Stream=t,t.Readable=t,t.Writable=e("./lib/_stream_writable.js"),t.Duplex=e("./lib/_stream_duplex.js"),t.Transform=e("./lib/_stream_transform.js"),t.PassThrough=e("./lib/_stream_passthrough.js"),t.finished=e("./lib/internal/streams/end-of-stream.js"),t.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":444,"./lib/_stream_passthrough.js":445,"./lib/_stream_readable.js":446,"./lib/_stream_transform.js":447,"./lib/_stream_writable.js":448,"./lib/internal/streams/end-of-stream.js":452,"./lib/internal/streams/pipeline.js":454}],458:[function(e,a,t){'use strict';function r(e){if(!e)return"utf8";for(var a;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(a)return;e=(""+e).toLowerCase(),a=!0;}}function n(e){var a=r(e);if("string"!=typeof a&&(g.isEncoding===p||!p(e)))throw new Error("Unknown encoding: "+e);return a||e}function i(e){this.encoding=n(e);var a;switch(this.encoding){case"utf16le":this.text=u,this.end=d,a=4;break;case"utf8":this.fillLast=l,a=4;break;case"base64":this.text=X,this.end=m,a=3;break;default:return this.write=P,void(this.end=K);}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(a)}function o(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function c(e,a,t){var r=a.length-1;if(r<t)return 0;var n=o(a[r]);return 0<=n?(0<n&&(e.lastNeed=n-1),n):--r<t||-2===n?0:(n=o(a[r]),0<=n)?(0<n&&(e.lastNeed=n-2),n):--r<t||-2===n?0:(n=o(a[r]),0<=n?(0<n&&(2===n?n=0:e.lastNeed=n-3),n):0)}function s(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"\uFFFD";if(1<e.lastNeed&&1<a.length){if(128!=(192&a[1]))return e.lastNeed=1,"\uFFFD";if(2<e.lastNeed&&2<a.length&&128!=(192&a[2]))return e.lastNeed=2,"\uFFFD"}}function l(e){var a=this.lastTotal-this.lastNeed,t=s(this,e,a);return void 0===t?this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,a,0,e.length),this.lastNeed-=e.length):t}function u(e,a){if(0==(e.length-a)%2){var t=e.toString("utf16le",a);if(t){var r=t.charCodeAt(t.length-1);if(55296<=r&&56319>=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function d(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function X(e,a){var t=(e.length-a)%3;return 0==t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1==t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function m(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function P(e){return e.toString(this.encoding)}function K(e){return e&&e.length?this.write(e):""}var g=e("safe-buffer").Buffer,p=g.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1;}};t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(a=this.fillLast(e),void 0===a)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?a?a+this.text(e,t):this.text(e,t):a||""},i.prototype.end=function(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+"\uFFFD":a},i.prototype.text=function(e,a){var t=c(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var r=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",a,r)},i.prototype.fillLast=function(e){return this.lastNeed<=e.length?(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length)}},{"safe-buffer":459}],459:[function(e,a,t){arguments[4][411][0].apply(t,arguments)},{buffer:119,dup:411}],460:[function(e,a,t){(function(a,r){function n(e,a){this._id=e,this._clearFn=a}var i=e("process/browser.js").nextTick,o=Function.prototype.apply,c=Array.prototype.slice,s={},l=0;t.setTimeout=function(){return new n(o.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new n(o.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,a){clearTimeout(e._idleTimeoutId),e._idleTimeout=a},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var a=e._idleTimeout;0<=a&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},a))},t.setImmediate="function"==typeof a?a:function(e){var a=l++,r=!(2>arguments.length)&&c.call(arguments,1);return s[a]=!0,i(function(){s[a]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(a))}),a},t.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":461,timers:460}],461:[function(e,a,t){arguments[4][116][0].apply(t,arguments)},{dup:116}],462:[function(e,a,t){(function(e){"use strict";function a(e){throw new Error(e)}function r(e){const a=Object.keys(e);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a}function n(e){if(Array.isArray(e))return e.slice();const a=e,t=r(a),n={};for(let r=0;r<t.length;r++){const e=t[r];n[e]=a[e]}return n}function i(e){return null!=e&&"object"==typeof e}function o(e,a){return Array.isArray(a)?e.concat(a):e.concat([a])}function c(e,a){return Array.isArray(a)?a.concat(e):[a].concat(e)}function s(e){return e.length?e.slice(0,e.length-1):e}function l(e){return e.length?e.slice(1):e}function u(e,a,t){return e.slice(0,a).concat(Array.isArray(t)?t:[t]).concat(e.slice(a))}function d(e,a){return a>=e.length||0>a?e:e.slice(0,a).concat(e.slice(a+1))}function X(e,a,t){if(e[a]===t)return e;const r=e.length,n=Array(r);for(let o=0;o<r;o++)n[o]=e[o];return n[a]=t,n}function m(e,t){if(Array.isArray(t)||a(x?"A path array should be provided when calling getIn()":B),null==e)return;let r=e;for(let a=0;a<t.length;a++){const e=t[a];if(r=null==r?void 0:r[e],void 0===r)return r}return r}function P(e,a,t){let r=e;if(null==r&&(r="number"==typeof a?[]:{}),r[a]===t)return r;const i=n(r);return i[a]=t,i}function K(e,a,t){return a.length?g(e,a,t,0):t}function g(e,a,t,r){let n;const o=a[r];if(r===a.length-1)n=t;else{const c=i(e)&&i(e[o])?e[o]:"number"==typeof a[r+1]?[]:{};n=g(c,a,t,r+1)}return P(e,o,n)}function p(e,a,t){const r=null==e?void 0:e[a],n=t(r);return P(e,a,n)}function f(e,a,t){const r=m(e,a),n=t(r);return K(e,a,n)}function h(t,a,r,n,i,e,...o){return o.length?C.call(null,!1,!1,t,a,r,n,i,e,...o):C(!1,!1,t,a,r,n,i,e)}function y(t,a,r,n,i,e,...o){return o.length?C.call(null,!1,!0,t,a,r,n,i,e,...o):C(!1,!0,t,a,r,n,i,e)}function b(t,a,r,n,i,o,e,...c){let s=m(t,a);null==s&&(s={});let l;return l=c.length?C.call(null,!1,!1,s,r,n,i,o,e,...c):C(!1,!1,s,r,n,i,o,e),K(t,a,l)}function A(e,a){const t=Array.isArray(a)?a:[a];let n=!1;for(let r=0;r<t.length;r++)if(_.call(e,t[r])){n=!0;break}if(!n)return e;const o={},c=r(e);for(let r=0;r<c.length;r++){const a=c[r];0<=t.indexOf(a)||(o[a]=e[a])}return o}function v(t,a,r,n,i,e,...o){return o.length?C.call(null,!0,!1,t,a,r,n,i,e,...o):C(!0,!1,t,a,r,n,i,e)}function C(e,t,o,...c){let s=o;null!=s||a(x?"At least one object should be provided to merge()":B);let l=!1;for(let a=0;a<c.length;a++){const o=c[a];if(null==o)continue;const u=r(o);if(u.length)for(let a=0;a<=u.length;a++){const r=u[a];if(e&&void 0!==s[r])continue;let c=o[r];t&&i(s[r])&&i(c)&&(c=C(e,t,s[r],c)),void 0===c||c===s[r]||(!l&&(l=!0,s=n(s)),s[r]=c)}}return s}Object.defineProperty(t,"__esModule",{value:!0}),t.clone=n,t.addLast=o,t.addFirst=c,t.removeLast=s,t.removeFirst=l,t.insert=u,t.removeAt=d,t.replaceAt=X,t.getIn=m,t.set=P,t.setIn=K,t.update=p,t.updateIn=f,t.merge=h,t.mergeDeep=y,t.mergeIn=b,t.omit=A,t.addDefaults=v,t.default=void 0;/*!
292 * Timm
293 *

Callers

nothing calls this directly

Calls 2

addContentMethod · 0.80
eFunction · 0.70

Tested by

no test coverage detected