3 lines
No EOL
345 KiB
JavaScript
3 lines
No EOL
345 KiB
JavaScript
/*! For license information please see extension.js.LICENSE.txt */
|
||
(()=>{var e={7438:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CachedKeyDecoder=void 0;const r=n(1259);t.CachedKeyDecoder=class{constructor(e=16,t=16){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let e=0;e<this.maxKeyLength;e++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}get(e,t,n){const r=this.caches[n-1],i=r.length;e:for(let s=0;s<i;s++){const i=r[s],o=i.bytes;for(let r=0;r<n;r++)if(o[r]!==e[t+r])continue e;return i.value}return null}store(e,t){const n=this.caches[e.length-1],r={bytes:e,value:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(e,t,n){const i=this.get(e,t,n);if(null!=i)return i;const s=r.utf8DecodeJs(e,t,n),o=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(o,s),s}}},3518:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.DataViewIndexOutOfBoundsError=void 0;const r=n(8938),i=n(443),s=n(3305),o=n(1259),a=n(1340),l=n(7438),u=e=>{const t=typeof e;return"string"===t||"number"===t},c=new DataView(new ArrayBuffer(0)),h=new Uint8Array(c.buffer);t.DataViewIndexOutOfBoundsError=(()=>{try{c.getInt8(0)}catch(e){return e.constructor}throw new Error("never reached")})();const d=new t.DataViewIndexOutOfBoundsError("Insufficient data"),f=new l.CachedKeyDecoder;t.Decoder=class{constructor(e=i.ExtensionCodec.defaultCodec,t,n=4294967295,r=4294967295,s=4294967295,o=4294967295,a=4294967295,l=f){this.extensionCodec=e,this.context=t,this.maxStrLength=n,this.maxBinLength=r,this.maxArrayLength=s,this.maxMapLength=o,this.maxExtLength=a,this.cachedKeyDecoder=l,this.totalPos=0,this.pos=0,this.view=c,this.bytes=h,this.headByte=-1,this.stack=[]}setBuffer(e){this.bytes=a.ensureUint8Array(e),this.view=a.createDataView(this.bytes),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining()){const t=this.bytes.subarray(this.pos),n=a.ensureUint8Array(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)}hasRemaining(e=1){return this.view.byteLength-this.pos>=e}createNoExtraBytesError(e){const{view:t,pos:n}=this;return new RangeError(`Extra ${t.byteLength-n} byte(s) found at buffer[${e}]`)}decodeSingleSync(){const e=this.decodeSync();if(this.hasRemaining())throw this.createNoExtraBytesError(this.pos);return e}async decodeSingleAsync(e){let n,i=!1;for await(const r of e){if(i)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(r);try{n=this.decodeSync(),i=!0}catch(e){if(!(e instanceof t.DataViewIndexOutOfBoundsError))throw e}this.totalPos+=this.pos}if(i){if(this.hasRemaining())throw this.createNoExtraBytesError(this.totalPos);return n}const{headByte:s,pos:o,totalPos:a}=this;throw new RangeError(`Insufficient data in parcing ${r.prettyByte(s)} at ${a} (${o} in the current buffer)`)}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){let r=n,i=-1;for await(const s of e){if(n&&0===i)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(s),r&&(i=this.readArraySize(),r=!1,this.complete());try{for(;yield this.decodeSync(),0!=--i;);}catch(e){if(!(e instanceof t.DataViewIndexOutOfBoundsError))throw e}this.totalPos+=this.pos}}decodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const n=e-128;if(0!==n){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){const n=e-144;if(0!==n){this.pushArrayState(n),this.complete();continue e}t=[]}else{const n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e){const e=this.lookU8();t=this.decodeUtf8String(e,1)}else if(218===e){const e=this.lookU16();t=this.decodeUtf8String(e,2)}else if(219===e){const e=this.lookU32();t=this.decodeUtf8String(e,4)}else if(220===e){const e=this.readU16();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(221===e){const e=this.readU32();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(222===e){const e=this.readU16();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(223===e){const e=this.readU32();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(196===e){const e=this.lookU8();t=this.decodeBinary(e,1)}else if(197===e){const e=this.lookU16();t=this.decodeBinary(e,2)}else if(198===e){const e=this.lookU32();t=this.decodeBinary(e,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){const e=this.lookU8();t=this.decodeExtension(e,1)}else if(200===e){const e=this.lookU16();t=this.decodeExtension(e,2)}else{if(201!==e)throw new Error(`Unrecognized type byte: ${r.prettyByte(e)}`);{const e=this.lookU32();t=this.decodeExtension(e,4)}}this.complete();const n=this.stack;for(;n.length>0;){const e=n[n.length-1];if(0===e.type){if(e.array[e.position]=t,e.position++,e.position!==e.size)continue e;n.pop(),t=e.array}else{if(1===e.type){if(!u(t))throw new Error("The type of key must be string or number but "+typeof t);e.key=t,e.type=2;continue e}if(e.map[e.key]=t,e.readCount++,e.readCount!==e.size){e.key=null,e.type=1;continue e}n.pop(),t=e.map}}return t}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new Error(`Unrecognized array type byte: ${r.prettyByte(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new Error(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})}pushArrayState(e){if(e>this.maxArrayLength)throw new Error(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.push({type:0,size:e,array:new Array(e),position:0})}decodeUtf8String(e,t){var n;if(e>this.maxStrLength)throw new Error(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw d;const r=this.pos+t;let i;return i=this.stateIsMapKey()&&(null===(n=this.cachedKeyDecoder)||void 0===n?void 0:n.canBeCached(e))?this.cachedKeyDecoder.decode(this.bytes,r,e):o.TEXT_ENCODING_AVAILABLE&&e>o.TEXT_DECODER_THRESHOLD?o.utf8DecodeTD(this.bytes,r,e):o.utf8DecodeJs(this.bytes,r,e),this.pos+=t+e,i}stateIsMapKey(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type}decodeBinary(e,t){if(e>this.maxBinLength)throw new Error(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw d;const n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new Error(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=s.getUint64(this.view,this.pos);return this.pos+=8,e}readI64(){const e=s.getInt64(this.view,this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}},9247:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=t.DEFAULT_INITIAL_BUFFER_SIZE=t.DEFAULT_MAX_DEPTH=void 0;const r=n(1259),i=n(443),s=n(3305),o=n(1340);t.DEFAULT_MAX_DEPTH=100,t.DEFAULT_INITIAL_BUFFER_SIZE=2048,t.Encoder=class{constructor(e=i.ExtensionCodec.defaultCodec,n,r=t.DEFAULT_MAX_DEPTH,s=t.DEFAULT_INITIAL_BUFFER_SIZE,o=!1,a=!1,l=!1){this.extensionCodec=e,this.context=n,this.maxDepth=r,this.initialBufferSize=s,this.sortKeys=o,this.forceFloat32=a,this.ignoreUndefined=l,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}encode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)}getUint8Array(){return this.bytes.subarray(0,this.pos)}ensureBufferSizeToWrite(e){const t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)}resizeBuffer(e){const t=new ArrayBuffer(e),n=new Uint8Array(t),r=new DataView(t);n.set(this.bytes),this.view=r,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){!1===e?this.writeU8(194):this.writeU8(195)}encodeNumber(e){Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error(`Too long string: ${e} bytes in UTF-8`);this.writeU8(219),this.writeU32(e)}}encodeString(e){const t=e.length;if(r.TEXT_ENCODING_AVAILABLE&&t>r.TEXT_ENCODER_THRESHOLD){const t=r.utf8Count(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),r.utf8EncodeTE(e,this.bytes,this.pos),this.pos+=t}else{const t=r.utf8Count(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),r.utf8EncodeJs(e,this.bytes,this.pos),this.pos+=t}}encodeObject(e,t){const n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`);this.encodeMap(e,t)}}encodeBinary(e){const t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error(`Too large binary: ${t}`);this.writeU8(198),this.writeU32(t)}const n=o.ensureUint8Array(e);this.writeU8a(n)}encodeArray(e,t){const n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error(`Too large array: ${n}`);this.writeU8(221),this.writeU32(n)}for(const n of e)this.encode(n,t+1)}countWithoutUndefined(e,t){let n=0;for(const r of t)void 0!==e[r]&&n++;return n}encodeMap(e,t){const n=Object.keys(e);this.sortKeys&&n.sort();const r=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(r<16)this.writeU8(128+r);else if(r<65536)this.writeU8(222),this.writeU16(r);else{if(!(r<4294967296))throw new Error(`Too large map object: ${r}`);this.writeU8(223),this.writeU32(r)}for(const r of n){const n=e[r];this.ignoreUndefined&&void 0===n||(this.encodeString(r),this.encode(n,t+1))}}encodeExtension(e){const t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error(`Too large extension object: ${t}`);this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),s.setUint64(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),s.setInt64(this.view,this.pos,e),this.pos+=8}}},2103:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtData=void 0,t.ExtData=class{constructor(e,t){this.type=e,this.data=t}}},443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionCodec=void 0;const r=n(2103),i=n(5636);let s=(()=>{class e{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(i.timestampExtension)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{const r=1+e;this.builtInEncoders[r]=t,this.builtInDecoders[r]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){const i=this.builtInEncoders[n];if(null!=i){const s=i(e,t);if(null!=s){const e=-1-n;return new r.ExtData(e,s)}}}for(let n=0;n<this.encoders.length;n++){const i=this.encoders[n];if(null!=i){const s=i(e,t);if(null!=s){const e=n;return new r.ExtData(e,s)}}}return e instanceof r.ExtData?e:null}decode(e,t,n){const i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,n):new r.ExtData(t,e)}}return e.defaultCodec=new e,e})();t.ExtensionCodec=s},9679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.defaultDecodeOptions=void 0;const r=n(3518);t.defaultDecodeOptions={},t.decode=function(e,n=t.defaultDecodeOptions){const i=new r.Decoder(n.extensionCodec,n.context,n.maxStrLength,n.maxBinLength,n.maxArrayLength,n.maxMapLength,n.maxExtLength);return i.setBuffer(e),i.decodeSingleSync()}},6044:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeStream=t.decodeArrayStream=t.decodeAsync=void 0;const r=n(3518),i=n(9679),s=n(7587);t.decodeAsync=async function(e,t=i.defaultDecodeOptions){const n=s.ensureAsyncIterabe(e);return new r.Decoder(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeSingleAsync(n)},t.decodeArrayStream=function(e,t=i.defaultDecodeOptions){const n=s.ensureAsyncIterabe(e);return new r.Decoder(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeArrayStream(n)},t.decodeStream=function(e,t=i.defaultDecodeOptions){const n=s.ensureAsyncIterabe(e);return new r.Decoder(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeStream(n)}},3954:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encode=void 0;const r=n(9247),i={};t.encode=function(e,t=i){const n=new r.Encoder(t.extensionCodec,t.context,t.maxDepth,t.initialBufferSize,t.sortKeys,t.forceFloat32,t.ignoreUndefined);return n.encode(e,1),n.getUint8Array()}},3308:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3954);Object.defineProperty(t,"encode",{enumerable:!0,get:function(){return r.encode}});var i=n(9679);Object.defineProperty(t,"decode",{enumerable:!0,get:function(){return i.decode}});var s=n(6044);Object.defineProperty(t,"decodeAsync",{enumerable:!0,get:function(){return s.decodeAsync}}),Object.defineProperty(t,"decodeArrayStream",{enumerable:!0,get:function(){return s.decodeArrayStream}}),Object.defineProperty(t,"decodeStream",{enumerable:!0,get:function(){return s.decodeStream}});var o=n(3518);Object.defineProperty(t,"Decoder",{enumerable:!0,get:function(){return o.Decoder}});var a=n(9247);Object.defineProperty(t,"Encoder",{enumerable:!0,get:function(){return a.Encoder}});var l=n(443);Object.defineProperty(t,"ExtensionCodec",{enumerable:!0,get:function(){return l.ExtensionCodec}});var u=n(2103);Object.defineProperty(t,"ExtData",{enumerable:!0,get:function(){return u.ExtData}});var c=n(5636);Object.defineProperty(t,"EXT_TIMESTAMP",{enumerable:!0,get:function(){return c.EXT_TIMESTAMP}}),Object.defineProperty(t,"encodeDateToTimeSpec",{enumerable:!0,get:function(){return c.encodeDateToTimeSpec}}),Object.defineProperty(t,"encodeTimeSpecToTimestamp",{enumerable:!0,get:function(){return c.encodeTimeSpecToTimestamp}}),Object.defineProperty(t,"decodeTimestampToTimeSpec",{enumerable:!0,get:function(){return c.decodeTimestampToTimeSpec}}),Object.defineProperty(t,"encodeTimestampExtension",{enumerable:!0,get:function(){return c.encodeTimestampExtension}}),Object.defineProperty(t,"decodeTimestampExtension",{enumerable:!0,get:function(){return c.decodeTimestampExtension}})},5636:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestampExtension=t.decodeTimestampExtension=t.decodeTimestampToTimeSpec=t.encodeTimestampExtension=t.encodeDateToTimeSpec=t.encodeTimeSpecToTimestamp=t.EXT_TIMESTAMP=void 0;const r=n(3305);function i({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=17179869183){if(0===t&&e<=4294967295){const t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{const n=e/4294967296,r=4294967295&e,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,t<<2|3&n),s.setUint32(4,r),i}}{const n=new Uint8Array(12),i=new DataView(n.buffer);return i.setUint32(0,t),r.setInt64(i,4,e),n}}function s(e){const t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),i=Math.floor(r/1e9);return{sec:n+i,nsec:r-1e9*i}}function o(e){return e instanceof Date?i(s(e)):null}function a(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const e=t.getUint32(0);return{sec:4294967296*(3&e)+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:r.getInt64(t,4),nsec:t.getUint32(0)};default:throw new Error(`Unrecognized data size for timestamp: ${e.length}`)}}function l(e){const t=a(e);return new Date(1e3*t.sec+t.nsec/1e6)}t.EXT_TIMESTAMP=-1,t.encodeTimeSpecToTimestamp=i,t.encodeDateToTimeSpec=s,t.encodeTimestampExtension=o,t.decodeTimestampToTimeSpec=a,t.decodeTimestampExtension=l,t.timestampExtension={type:t.EXT_TIMESTAMP,encode:o,decode:l}},3305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUint64=t.getInt64=t.setInt64=t.setUint64=void 0,t.setUint64=function(e,t,n){const r=n/4294967296,i=n;e.setUint32(t,r),e.setUint32(t+4,i)},t.setInt64=function(e,t,n){const r=Math.floor(n/4294967296),i=n;e.setUint32(t,r),e.setUint32(t+4,i)},t.getInt64=function(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)},t.getUint64=function(e,t){return 4294967296*e.getUint32(t)+e.getUint32(t+4)}},8938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prettyByte=void 0,t.prettyByte=function(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}},7587:(e,t)=>{"use strict";function n(e){return null!=e[Symbol.asyncIterator]}function r(e){if(null==e)throw new Error("Assertion Failure: value must not be null nor undefined")}async function*i(e){const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)return;r(n),yield n}}finally{t.releaseLock()}}Object.defineProperty(t,"__esModule",{value:!0}),t.ensureAsyncIterabe=t.asyncIterableFromStream=t.isAsyncIterable=void 0,t.isAsyncIterable=n,t.asyncIterableFromStream=i,t.ensureAsyncIterabe=function(e){return n(e)?e:i(e)}},1340:(e,t)=>{"use strict";function n(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.ensureUint8Array=void 0,t.ensureUint8Array=n,t.createDataView=function(e){if(e instanceof ArrayBuffer)return new DataView(e);const t=n(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}},1259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utf8DecodeTD=t.TEXT_DECODER_THRESHOLD=t.utf8DecodeJs=t.utf8EncodeTE=t.TEXT_ENCODER_THRESHOLD=t.utf8EncodeJs=t.utf8Count=t.TEXT_ENCODING_AVAILABLE=void 0,t.TEXT_ENCODING_AVAILABLE="undefined"!=typeof process&&"never"!==process.env.TEXT_ENCODING&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder,t.utf8Count=function(e){const t=e.length;let n=0,r=0;for(;r<t;){let i=e.charCodeAt(r++);if(0!=(4294967168&i))if(0==(4294965248&i))n+=2;else{if(i>=55296&&i<=56319&&r<t){const t=e.charCodeAt(r);56320==(64512&t)&&(++r,i=((1023&i)<<10)+(1023&t)+65536)}n+=0==(4294901760&i)?3:4}else n++}return n},t.utf8EncodeJs=function(e,t,n){const r=e.length;let i=n,s=0;for(;s<r;){let n=e.charCodeAt(s++);if(0!=(4294967168&n)){if(0==(4294965248&n))t[i++]=n>>6&31|192;else{if(n>=55296&&n<=56319&&s<r){const t=e.charCodeAt(s);56320==(64512&t)&&(++s,n=((1023&n)<<10)+(1023&t)+65536)}0==(4294901760&n)?(t[i++]=n>>12&15|224,t[i++]=n>>6&63|128):(t[i++]=n>>18&7|240,t[i++]=n>>12&63|128,t[i++]=n>>6&63|128)}t[i++]=63&n|128}else t[i++]=n}};const n=t.TEXT_ENCODING_AVAILABLE?new TextEncoder:void 0;t.TEXT_ENCODER_THRESHOLD="undefined"!=typeof process&&"force"!==process.env.TEXT_ENCODING?200:0,t.utf8EncodeTE=(null==n?void 0:n.encodeInto)?function(e,t,r){n.encodeInto(e,t.subarray(r))}:function(e,t,r){t.set(n.encode(e),r)},t.utf8DecodeJs=function(e,t,n){let r=t;const i=r+n,s=[];let o="";for(;r<i;){const t=e[r++];if(0==(128&t))s.push(t);else if(192==(224&t)){const n=63&e[r++];s.push((31&t)<<6|n)}else if(224==(240&t)){const n=63&e[r++],i=63&e[r++];s.push((31&t)<<12|n<<6|i)}else if(240==(248&t)){let n=(7&t)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++];n>65535&&(n-=65536,s.push(n>>>10&1023|55296),n=56320|1023&n),s.push(n)}else s.push(t);s.length>=4096&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o};const r=t.TEXT_ENCODING_AVAILABLE?new TextDecoder:null;t.TEXT_DECODER_THRESHOLD="undefined"!=typeof process&&"force"!==process.env.TEXT_DECODER?200:0,t.utf8DecodeTD=function(e,t,n){const i=e.subarray(t,t+n);return r.decode(i)}},4409:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)((function(t,n){var i;try{i=e.apply(this,t)}catch(e){return n(e)}(0,r.default)(i)&&"function"==typeof i.then?i.then((function(e){a(n,null,e)}),(function(e){a(n,e.message?e:new Error(e))})):n(null,i)}))};var r=o(n(3218)),i=o(n(3519)),s=o(n(3111));function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){try{e(t,n)}catch(e){(0,s.default)(l,e)}}function l(e){throw e}e.exports=t.default},1846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){((0,r.default)(e)?d:f)(e,(0,c.default)(t),n)};var r=h(n(8612)),i=h(n(1605)),s=h(n(7388)),o=h(n(3875)),a=h(n(308)),l=h(n(6979)),u=h(n(3362)),c=h(n(8993));function h(e){return e&&e.__esModule?e:{default:e}}function d(e,t,n){n=(0,l.default)(n||a.default);var r=0,s=0,o=e.length;function c(e,t){e?n(e):++s!==o&&t!==i.default||n(null)}for(0===o&&n(null);r<o;r++)t(e[r],r,(0,u.default)(c))}var f=(0,o.default)(s.default,1/0);e.exports=t.default},7388:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,s){(0,r.default)(t)(e,(0,i.default)(n),s)};var r=s(n(6954)),i=s(n(8993));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},667:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(7388)),i=s(n(3875));function s(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.default)(r.default,1),e.exports=t.default},8058:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){(0,r.default)(e,(0,i.default)((0,s.default)(t)),n)};var r=o(n(1846)),i=o(n(6529)),s=o(n(8993));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},1605:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},3875:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return function(n,r,i){return e(n,t,r,i)}},e.exports=t.default},6954:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,n,l){if(l=(0,i.default)(l||r.default),e<=0||!t)return l(null);var u=(0,s.default)(t),c=!1,h=0,d=!1;function f(e,t){if(h-=1,e)c=!0,l(e);else{if(t===a.default||c&&h<=0)return c=!0,l(null);d||g()}}function g(){for(d=!0;h<e&&!c;){var t=u();if(null===t)return c=!0,void(h<=0&&l(null));h+=1,n(t.value,t.key,(0,o.default)(f))}d=!1}g()}};var r=l(n(308)),i=l(n(6979)),s=l(n(9733)),o=l(n(3362)),a=l(n(1605));function l(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},7818:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return n&&e[n]&&e[n]()};var n="function"==typeof Symbol&&Symbol.iterator;e.exports=t.default},3519:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){var t=(0,i.default)(arguments),n=t.pop();e.call(this,t,n)}};var r,i=(r=n(3033))&&r.__esModule?r:{default:r};e.exports=t.default},9733:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,r.default)(e))return function(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}(e);var t,n,o,a,l=(0,i.default)(e);return l?function(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}(l):(t=e,n=(0,s.default)(t),o=-1,a=n.length,function(){var e=n[++o];return o<a?{value:t[e],key:e}:null})};var r=o(n(8612)),i=o(n(7818)),s=o(n(3674));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},6979:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}},e.exports=t.default},3362:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,arguments)}},e.exports=t.default},3409:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){n=n||r.default;var a=(0,i.default)(t)?[]:{};e(t,(function(e,t,n){(0,o.default)(e)((function(e,r){arguments.length>2&&(r=(0,s.default)(arguments,1)),a[t]=r,n(e)}))}),(function(e){n(e,a)}))};var r=a(n(308)),i=a(n(8612)),s=a(n(3033)),o=a(n(8993));function a(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},3111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasNextTick=t.hasSetImmediate=void 0,t.fallback=l,t.wrap=u;var r,i,s=(r=n(3033))&&r.__esModule?r:{default:r},o=t.hasSetImmediate="function"==typeof setImmediate&&setImmediate,a=t.hasNextTick="object"==typeof process&&"function"==typeof process.nextTick;function l(e){setTimeout(e,0)}function u(e){return function(t){var n=(0,s.default)(arguments,1);e((function(){t.apply(null,n)}))}}i=o?setImmediate:a?process.nextTick:l,t.default=u(i)},3033:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){t|=0;for(var n=Math.max(e.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=e[t+i];return r},e.exports=t.default},6529:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,n,r){return e(t,r)}},e.exports=t.default},8993:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=void 0;var r,i=(r=n(4409))&&r.__esModule?r:{default:r},s="function"==typeof Symbol;function o(e){return s&&"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){return o(e)?(0,i.default)(e):e},t.isAsync=o},8415:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(i.default,e,t)};var r=s(n(3409)),i=s(n(667));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},8168:(e,t,n)=>{var r=n(9092),i={};for(var s in r)r.hasOwnProperty(s)&&(i[r[s]]=s);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o)if(o.hasOwnProperty(a)){if(!("channels"in o[a]))throw new Error("missing channels property: "+a);if(!("labels"in o[a]))throw new Error("missing channel labels property: "+a);if(o[a].labels.length!==o[a].channels)throw new Error("channel and label counts mismatch: "+a);var l=o[a].channels,u=o[a].labels;delete o[a].channels,delete o[a].labels,Object.defineProperty(o[a],"channels",{value:l}),Object.defineProperty(o[a],"labels",{value:u})}o.rgb.hsl=function(e){var t,n,r=e[0]/255,i=e[1]/255,s=e[2]/255,o=Math.min(r,i,s),a=Math.max(r,i,s),l=a-o;return a===o?t=0:r===a?t=(i-s)/l:i===a?t=2+(s-r)/l:s===a&&(t=4+(r-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+a)/2,[t,100*(a===o?0:n<=.5?l/(a+o):l/(2-a-o)),100*n]},o.rgb.hsv=function(e){var t,n,r,i,s,o=e[0]/255,a=e[1]/255,l=e[2]/255,u=Math.max(o,a,l),c=u-Math.min(o,a,l),h=function(e){return(u-e)/6/c+.5};return 0===c?i=s=0:(s=c/u,t=h(o),n=h(a),r=h(l),o===u?i=r-n:a===u?i=1/3+t-r:l===u&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*s,100*u]},o.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[o.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,r))*100,100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},o.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-i)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},o.rgb.keyword=function(e){var t=i[e];if(t)return t;var n,s,o,a=1/0;for(var l in r)if(r.hasOwnProperty(l)){var u=(s=e,o=r[l],Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)+Math.pow(s[2]-o[2],2));u<a&&(a=u,n=l)}return n},o.keyword.rgb=function(e){return r[e]},o.rgb.xyz=function(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},o.rgb.lab=function(e){var t=o.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},o.hsl.rgb=function(e){var t,n,r,i,s,o=e[0]/360,a=e[1]/100,l=e[2]/100;if(0===a)return[s=255*l,s,s];t=2*l-(n=l<.5?l*(1+a):l+a-l*a),i=[0,0,0];for(var u=0;u<3;u++)(r=o+1/3*-(u-1))<0&&r++,r>1&&r--,s=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[u]=255*s;return i},o.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=n,s=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=s<=1?s:2-s,[t,100*(0===r?2*i/(s+i):2*n/(r+n)),(r+n)/2*100]},o.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,l,o];case 1:return[a,r,o];case 2:return[o,r,l];case 3:return[o,a,r];case 4:return[l,o,r];case 5:return[r,o,a]}},o.hsv.hsl=function(e){var t,n,r,i=e[0],s=e[1]/100,o=e[2]/100,a=Math.max(o,.01);return r=(2-s)*o,n=s*a,[i,100*(n=(n/=(t=(2-s)*a)<=1?t:2-t)||0),100*(r/=2)]},o.hwb.rgb=function(e){var t,n,r,i,s,o,a,l=e[0]/360,u=e[1]/100,c=e[2]/100,h=u+c;switch(h>1&&(u/=h,c/=h),r=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(r=1-r),i=u+r*((n=1-c)-u),t){default:case 6:case 0:s=n,o=i,a=u;break;case 1:s=i,o=n,a=u;break;case 2:s=u,o=n,a=i;break;case 3:s=u,o=i,a=n;break;case 4:s=i,o=u,a=n;break;case 5:s=n,o=u,a=i}return[255*s,255*o,255*a]},o.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},o.xyz.rgb=function(e){var t,n,r,i=e[0]/100,s=e[1]/100,o=e[2]/100;return n=-.9689*i+1.8758*s+.0415*o,r=.0557*i+-.204*s+1.057*o,t=(t=3.2406*i+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},o.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},o.lab.xyz=function(e){var t,n,r,i=e[0];t=e[1]/500+(n=(i+16)/116),r=n-e[2]/200;var s=Math.pow(n,3),o=Math.pow(t,3),a=Math.pow(r,3);return n=s>.008856?s:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},o.lab.lch=function(e){var t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},o.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},o.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var s=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(s+=60),s},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},o.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},o.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},o.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},o.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255,s=Math.max(Math.max(n,r),i),o=Math.min(Math.min(n,r),i),a=s-o;return t=a<=0?0:s===n?(r-i)/a%6:s===r?2+(i-n)/a:4+(n-r)/a+4,t/=6,[360*(t%=1),100*a,100*(a<1?o/(1-a):0)]},o.hsl.hcg=function(e){var t,n=e[1]/100,r=e[2]/100,i=0;return(t=r<.5?2*n*r:2*n*(1-r))<1&&(i=(r-.5*t)/(1-t)),[e[0],100*t,100*i]},o.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i,s=[0,0,0],o=t%1*6,a=o%1,l=1-a;switch(Math.floor(o)){case 0:s[0]=1,s[1]=a,s[2]=0;break;case 1:s[0]=l,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=a;break;case 3:s[0]=0,s[1]=l,s[2]=1;break;case 4:s[0]=a,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=l}return i=(1-n)*r,[255*(n*s[0]+i),255*(n*s[1]+i),255*(n*s[2]+i)]},o.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},o.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},o.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},o.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},2085:(e,t,n)=>{var r=n(8168),i=n(4111),s={};Object.keys(r).forEach((function(e){s[e]={},Object.defineProperty(s[e],"channels",{value:r[e].channels}),Object.defineProperty(s[e],"labels",{value:r[e].labels});var t=i(e);Object.keys(t).forEach((function(n){var r=t[n];s[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var r=n.length,i=0;i<r;i++)n[i]=Math.round(n[i]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(r),s[e][n].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)}))})),e.exports=s},9092:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},4111:(e,t,n)=>{var r=n(8168);function i(e,t){return function(n){return t(e(n))}}function s(e,t){for(var n=[t[e].parent,e],s=r[t[e].parent][e],o=t[e].parent;t[o].parent;)n.unshift(t[o].parent),s=i(r[t[o].parent][o],s),o=t[o].parent;return s.conversion=n,s}e.exports=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,i=0;i<n;i++)e[t[i]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;)for(var i=n.pop(),s=Object.keys(r[i]),o=s.length,a=0;a<o;a++){var l=s[a],u=t[l];-1===u.distance&&(u.distance=t[i].distance+1,u.parent=i,n.unshift(l))}return t}(e),n={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var l=i[a];null!==t[l].parent&&(n[l]=s(l,t))}return n}},8874:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},9818:(e,t,n)=>{var r=n(8874),i=n(6851),s={};for(var o in r)r.hasOwnProperty(o)&&(s[r[o]]=o);var a=e.exports={to:{},get:{}};function l(e,t,n){return Math.min(Math.max(t,e),n)}function u(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}a.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=a.get.hsl(e),n="hsl";break;case"hwb":t=a.get.hwb(e),n="hwb";break;default:t=a.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},a.get.rgb=function(e){if(!e)return null;var t,n,i,s=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=t[2],t=t[1],n=0;n<3;n++){var o=2*n;s[n]=parseInt(t.slice(o,o+2),16)}i&&(s[3]=parseInt(i,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(i=(t=t[1])[3],n=0;n<3;n++)s[n]=parseInt(t[n]+t[n],16);i&&(s[3]=parseInt(i+i,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(n=0;n<3;n++)s[n]=parseInt(t[n+1],0);t[4]&&(s[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(t=e.match(/(\D+)/))?"transparent"===t[1]?[0,0,0,0]:(s=r[t[1]])?(s[3]=1,s):null:null;for(n=0;n<3;n++)s[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(s[3]=parseFloat(t[4]))}for(n=0;n<3;n++)s[n]=l(s[n],0,255);return s[3]=l(s[3],0,1),s},a.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])+360)%360,l(parseFloat(t[2]),0,100),l(parseFloat(t[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},a.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,l(parseFloat(t[2]),0,100),l(parseFloat(t[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},a.to.hex=function(){var e=i(arguments);return"#"+u(e[0])+u(e[1])+u(e[2])+(e[3]<1?u(Math.round(255*e[3])):"")},a.to.rgb=function(){var e=i(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},a.to.rgb.percent=function(){var e=i(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},a.to.hsl=function(){var e=i(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},a.to.hwb=function(){var e=i(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},a.to.keyword=function(e){return s[e.slice(0,3)]}},6767:(e,t,n)=>{"use strict";var r=n(9818),i=n(2085),s=[].slice,o=["keyword","gray","hex"],a={};Object.keys(i).forEach((function(e){a[s.call(i[e].labels).sort().join("")]=e}));var l={};function u(e,t){if(!(this instanceof u))return new u(e,t);if(t&&t in o&&(t=null),t&&!(t in i))throw new Error("Unknown model: "+t);var n,c;if(e)if(e instanceof u)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if("string"==typeof e){var h=r.get(e);if(null===h)throw new Error("Unable to parse color from string: "+e);this.model=h.model,c=i[this.model].channels,this.color=h.value.slice(0,c),this.valpha="number"==typeof h.value[c]?h.value[c]:1}else if(e.length){this.model=t||"rgb",c=i[this.model].channels;var d=s.call(e,0,c);this.color=f(d,c),this.valpha="number"==typeof e[c]?e[c]:1}else if("number"==typeof e)e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var g=Object.keys(e);"alpha"in e&&(g.splice(g.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var p=g.sort().join("");if(!(p in a))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=a[p];var m=i[this.model].labels,v=[];for(n=0;n<m.length;n++)v.push(e[m[n]]);this.color=f(v)}else this.model="rgb",this.color=[0,0,0],this.valpha=1;if(l[this.model])for(c=i[this.model].channels,n=0;n<c;n++){var b=l[this.model][n];b&&(this.color[n]=b(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function c(e,t,n){return(e=Array.isArray(e)?e:[e]).forEach((function(e){(l[e]||(l[e]=[]))[t]=n})),e=e[0],function(r){var i;return arguments.length?(n&&(r=n(r)),(i=this[e]()).color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function h(e){return function(t){return Math.max(0,Math.min(e,t))}}function d(e){return Array.isArray(e)?e:[e]}function f(e,t){for(var n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}u.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var t=this.model in r.to?this:this.rgb(),n=1===(t=t.round("number"==typeof e?e:1)).valpha?t.color:t.color.concat(this.valpha);return r.to[t.model](n)},percentString:function(e){var t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:t.color.concat(this.valpha);return r.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},t=i[this.model].channels,n=i[this.model].labels,r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new u(this.color.map(function(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new u(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:c("rgb",0,h(255)),green:c("rgb",1,h(255)),blue:c("rgb",2,h(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,(function(e){return(e%360+360)%360})),saturationl:c("hsl",1,h(100)),lightness:c("hsl",2,h(100)),saturationv:c("hsv",1,h(100)),value:c("hsv",2,h(100)),chroma:c("hcg",1,h(100)),gray:c("hcg",2,h(100)),white:c("hwb",1,h(100)),wblack:c("hwb",2,h(100)),cyan:c("cmyk",0,h(100)),magenta:c("cmyk",1,h(100)),yellow:c("cmyk",2,h(100)),black:c("cmyk",3,h(100)),x:c("xyz",0,h(100)),y:c("xyz",1,h(100)),z:c("xyz",2,h(100)),l:c("lab",0,h(100)),a:c("lab",1),b:c("lab",2),keyword:function(e){return arguments.length?new u(e):i[this.model].keyword(this.color)},hex:function(e){return arguments.length?new u(e):r.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity:function(){for(var e=this.rgb().color,t=[],n=0;n<e.length;n++){var r=e[n]/255;t[n]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return u.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),n=t.color[0];return n=(n=(n+e)%360)<0?360+n:n,t.color[0]=n,t},mix:function(e,t){var n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,s=2*i-1,o=n.alpha()-r.alpha(),a=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,l=1-a;return u.rgb(a*n.red()+l*r.red(),a*n.green()+l*r.green(),a*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}},Object.keys(i).forEach((function(e){if(-1===o.indexOf(e)){var t=i[e].channels;u.prototype[e]=function(){if(this.model===e)return new u(this);if(arguments.length)return new u(arguments,e);var n="number"==typeof arguments[t]?t:this.valpha;return new u(d(i[this.model][e].raw(this.color)).concat(n),e)},u[e]=function(n){return"number"==typeof n&&(n=f(s.call(arguments),t)),new u(n,e)}}})),e.exports=u},292:e=>{e.exports=[{value:"#B0171F",name:"indian red"},{value:"#DC143C",css:!0,name:"crimson"},{value:"#FFB6C1",css:!0,name:"lightpink"},{value:"#FFAEB9",name:"lightpink 1"},{value:"#EEA2AD",name:"lightpink 2"},{value:"#CD8C95",name:"lightpink 3"},{value:"#8B5F65",name:"lightpink 4"},{value:"#FFC0CB",css:!0,name:"pink"},{value:"#FFB5C5",name:"pink 1"},{value:"#EEA9B8",name:"pink 2"},{value:"#CD919E",name:"pink 3"},{value:"#8B636C",name:"pink 4"},{value:"#DB7093",css:!0,name:"palevioletred"},{value:"#FF82AB",name:"palevioletred 1"},{value:"#EE799F",name:"palevioletred 2"},{value:"#CD6889",name:"palevioletred 3"},{value:"#8B475D",name:"palevioletred 4"},{value:"#FFF0F5",name:"lavenderblush 1"},{value:"#FFF0F5",css:!0,name:"lavenderblush"},{value:"#EEE0E5",name:"lavenderblush 2"},{value:"#CDC1C5",name:"lavenderblush 3"},{value:"#8B8386",name:"lavenderblush 4"},{value:"#FF3E96",name:"violetred 1"},{value:"#EE3A8C",name:"violetred 2"},{value:"#CD3278",name:"violetred 3"},{value:"#8B2252",name:"violetred 4"},{value:"#FF69B4",css:!0,name:"hotpink"},{value:"#FF6EB4",name:"hotpink 1"},{value:"#EE6AA7",name:"hotpink 2"},{value:"#CD6090",name:"hotpink 3"},{value:"#8B3A62",name:"hotpink 4"},{value:"#872657",name:"raspberry"},{value:"#FF1493",name:"deeppink 1"},{value:"#FF1493",css:!0,name:"deeppink"},{value:"#EE1289",name:"deeppink 2"},{value:"#CD1076",name:"deeppink 3"},{value:"#8B0A50",name:"deeppink 4"},{value:"#FF34B3",name:"maroon 1"},{value:"#EE30A7",name:"maroon 2"},{value:"#CD2990",name:"maroon 3"},{value:"#8B1C62",name:"maroon 4"},{value:"#C71585",css:!0,name:"mediumvioletred"},{value:"#D02090",name:"violetred"},{value:"#DA70D6",css:!0,name:"orchid"},{value:"#FF83FA",name:"orchid 1"},{value:"#EE7AE9",name:"orchid 2"},{value:"#CD69C9",name:"orchid 3"},{value:"#8B4789",name:"orchid 4"},{value:"#D8BFD8",css:!0,name:"thistle"},{value:"#FFE1FF",name:"thistle 1"},{value:"#EED2EE",name:"thistle 2"},{value:"#CDB5CD",name:"thistle 3"},{value:"#8B7B8B",name:"thistle 4"},{value:"#FFBBFF",name:"plum 1"},{value:"#EEAEEE",name:"plum 2"},{value:"#CD96CD",name:"plum 3"},{value:"#8B668B",name:"plum 4"},{value:"#DDA0DD",css:!0,name:"plum"},{value:"#EE82EE",css:!0,name:"violet"},{value:"#FF00FF",vga:!0,name:"magenta"},{value:"#FF00FF",vga:!0,css:!0,name:"fuchsia"},{value:"#EE00EE",name:"magenta 2"},{value:"#CD00CD",name:"magenta 3"},{value:"#8B008B",name:"magenta 4"},{value:"#8B008B",css:!0,name:"darkmagenta"},{value:"#800080",vga:!0,css:!0,name:"purple"},{value:"#BA55D3",css:!0,name:"mediumorchid"},{value:"#E066FF",name:"mediumorchid 1"},{value:"#D15FEE",name:"mediumorchid 2"},{value:"#B452CD",name:"mediumorchid 3"},{value:"#7A378B",name:"mediumorchid 4"},{value:"#9400D3",css:!0,name:"darkviolet"},{value:"#9932CC",css:!0,name:"darkorchid"},{value:"#BF3EFF",name:"darkorchid 1"},{value:"#B23AEE",name:"darkorchid 2"},{value:"#9A32CD",name:"darkorchid 3"},{value:"#68228B",name:"darkorchid 4"},{value:"#4B0082",css:!0,name:"indigo"},{value:"#8A2BE2",css:!0,name:"blueviolet"},{value:"#9B30FF",name:"purple 1"},{value:"#912CEE",name:"purple 2"},{value:"#7D26CD",name:"purple 3"},{value:"#551A8B",name:"purple 4"},{value:"#9370DB",css:!0,name:"mediumpurple"},{value:"#AB82FF",name:"mediumpurple 1"},{value:"#9F79EE",name:"mediumpurple 2"},{value:"#8968CD",name:"mediumpurple 3"},{value:"#5D478B",name:"mediumpurple 4"},{value:"#483D8B",css:!0,name:"darkslateblue"},{value:"#8470FF",name:"lightslateblue"},{value:"#7B68EE",css:!0,name:"mediumslateblue"},{value:"#6A5ACD",css:!0,name:"slateblue"},{value:"#836FFF",name:"slateblue 1"},{value:"#7A67EE",name:"slateblue 2"},{value:"#6959CD",name:"slateblue 3"},{value:"#473C8B",name:"slateblue 4"},{value:"#F8F8FF",css:!0,name:"ghostwhite"},{value:"#E6E6FA",css:!0,name:"lavender"},{value:"#0000FF",vga:!0,css:!0,name:"blue"},{value:"#0000EE",name:"blue 2"},{value:"#0000CD",name:"blue 3"},{value:"#0000CD",css:!0,name:"mediumblue"},{value:"#00008B",name:"blue 4"},{value:"#00008B",css:!0,name:"darkblue"},{value:"#000080",vga:!0,css:!0,name:"navy"},{value:"#191970",css:!0,name:"midnightblue"},{value:"#3D59AB",name:"cobalt"},{value:"#4169E1",css:!0,name:"royalblue"},{value:"#4876FF",name:"royalblue 1"},{value:"#436EEE",name:"royalblue 2"},{value:"#3A5FCD",name:"royalblue 3"},{value:"#27408B",name:"royalblue 4"},{value:"#6495ED",css:!0,name:"cornflowerblue"},{value:"#B0C4DE",css:!0,name:"lightsteelblue"},{value:"#CAE1FF",name:"lightsteelblue 1"},{value:"#BCD2EE",name:"lightsteelblue 2"},{value:"#A2B5CD",name:"lightsteelblue 3"},{value:"#6E7B8B",name:"lightsteelblue 4"},{value:"#778899",css:!0,name:"lightslategray"},{value:"#708090",css:!0,name:"slategray"},{value:"#C6E2FF",name:"slategray 1"},{value:"#B9D3EE",name:"slategray 2"},{value:"#9FB6CD",name:"slategray 3"},{value:"#6C7B8B",name:"slategray 4"},{value:"#1E90FF",name:"dodgerblue 1"},{value:"#1E90FF",css:!0,name:"dodgerblue"},{value:"#1C86EE",name:"dodgerblue 2"},{value:"#1874CD",name:"dodgerblue 3"},{value:"#104E8B",name:"dodgerblue 4"},{value:"#F0F8FF",css:!0,name:"aliceblue"},{value:"#4682B4",css:!0,name:"steelblue"},{value:"#63B8FF",name:"steelblue 1"},{value:"#5CACEE",name:"steelblue 2"},{value:"#4F94CD",name:"steelblue 3"},{value:"#36648B",name:"steelblue 4"},{value:"#87CEFA",css:!0,name:"lightskyblue"},{value:"#B0E2FF",name:"lightskyblue 1"},{value:"#A4D3EE",name:"lightskyblue 2"},{value:"#8DB6CD",name:"lightskyblue 3"},{value:"#607B8B",name:"lightskyblue 4"},{value:"#87CEFF",name:"skyblue 1"},{value:"#7EC0EE",name:"skyblue 2"},{value:"#6CA6CD",name:"skyblue 3"},{value:"#4A708B",name:"skyblue 4"},{value:"#87CEEB",css:!0,name:"skyblue"},{value:"#00BFFF",name:"deepskyblue 1"},{value:"#00BFFF",css:!0,name:"deepskyblue"},{value:"#00B2EE",name:"deepskyblue 2"},{value:"#009ACD",name:"deepskyblue 3"},{value:"#00688B",name:"deepskyblue 4"},{value:"#33A1C9",name:"peacock"},{value:"#ADD8E6",css:!0,name:"lightblue"},{value:"#BFEFFF",name:"lightblue 1"},{value:"#B2DFEE",name:"lightblue 2"},{value:"#9AC0CD",name:"lightblue 3"},{value:"#68838B",name:"lightblue 4"},{value:"#B0E0E6",css:!0,name:"powderblue"},{value:"#98F5FF",name:"cadetblue 1"},{value:"#8EE5EE",name:"cadetblue 2"},{value:"#7AC5CD",name:"cadetblue 3"},{value:"#53868B",name:"cadetblue 4"},{value:"#00F5FF",name:"turquoise 1"},{value:"#00E5EE",name:"turquoise 2"},{value:"#00C5CD",name:"turquoise 3"},{value:"#00868B",name:"turquoise 4"},{value:"#5F9EA0",css:!0,name:"cadetblue"},{value:"#00CED1",css:!0,name:"darkturquoise"},{value:"#F0FFFF",name:"azure 1"},{value:"#F0FFFF",css:!0,name:"azure"},{value:"#E0EEEE",name:"azure 2"},{value:"#C1CDCD",name:"azure 3"},{value:"#838B8B",name:"azure 4"},{value:"#E0FFFF",name:"lightcyan 1"},{value:"#E0FFFF",css:!0,name:"lightcyan"},{value:"#D1EEEE",name:"lightcyan 2"},{value:"#B4CDCD",name:"lightcyan 3"},{value:"#7A8B8B",name:"lightcyan 4"},{value:"#BBFFFF",name:"paleturquoise 1"},{value:"#AEEEEE",name:"paleturquoise 2"},{value:"#AEEEEE",css:!0,name:"paleturquoise"},{value:"#96CDCD",name:"paleturquoise 3"},{value:"#668B8B",name:"paleturquoise 4"},{value:"#2F4F4F",css:!0,name:"darkslategray"},{value:"#97FFFF",name:"darkslategray 1"},{value:"#8DEEEE",name:"darkslategray 2"},{value:"#79CDCD",name:"darkslategray 3"},{value:"#528B8B",name:"darkslategray 4"},{value:"#00FFFF",name:"cyan"},{value:"#00FFFF",css:!0,name:"aqua"},{value:"#00EEEE",name:"cyan 2"},{value:"#00CDCD",name:"cyan 3"},{value:"#008B8B",name:"cyan 4"},{value:"#008B8B",css:!0,name:"darkcyan"},{value:"#008080",vga:!0,css:!0,name:"teal"},{value:"#48D1CC",css:!0,name:"mediumturquoise"},{value:"#20B2AA",css:!0,name:"lightseagreen"},{value:"#03A89E",name:"manganeseblue"},{value:"#40E0D0",css:!0,name:"turquoise"},{value:"#808A87",name:"coldgrey"},{value:"#00C78C",name:"turquoiseblue"},{value:"#7FFFD4",name:"aquamarine 1"},{value:"#7FFFD4",css:!0,name:"aquamarine"},{value:"#76EEC6",name:"aquamarine 2"},{value:"#66CDAA",name:"aquamarine 3"},{value:"#66CDAA",css:!0,name:"mediumaquamarine"},{value:"#458B74",name:"aquamarine 4"},{value:"#00FA9A",css:!0,name:"mediumspringgreen"},{value:"#F5FFFA",css:!0,name:"mintcream"},{value:"#00FF7F",css:!0,name:"springgreen"},{value:"#00EE76",name:"springgreen 1"},{value:"#00CD66",name:"springgreen 2"},{value:"#008B45",name:"springgreen 3"},{value:"#3CB371",css:!0,name:"mediumseagreen"},{value:"#54FF9F",name:"seagreen 1"},{value:"#4EEE94",name:"seagreen 2"},{value:"#43CD80",name:"seagreen 3"},{value:"#2E8B57",name:"seagreen 4"},{value:"#2E8B57",css:!0,name:"seagreen"},{value:"#00C957",name:"emeraldgreen"},{value:"#BDFCC9",name:"mint"},{value:"#3D9140",name:"cobaltgreen"},{value:"#F0FFF0",name:"honeydew 1"},{value:"#F0FFF0",css:!0,name:"honeydew"},{value:"#E0EEE0",name:"honeydew 2"},{value:"#C1CDC1",name:"honeydew 3"},{value:"#838B83",name:"honeydew 4"},{value:"#8FBC8F",css:!0,name:"darkseagreen"},{value:"#C1FFC1",name:"darkseagreen 1"},{value:"#B4EEB4",name:"darkseagreen 2"},{value:"#9BCD9B",name:"darkseagreen 3"},{value:"#698B69",name:"darkseagreen 4"},{value:"#98FB98",css:!0,name:"palegreen"},{value:"#9AFF9A",name:"palegreen 1"},{value:"#90EE90",name:"palegreen 2"},{value:"#90EE90",css:!0,name:"lightgreen"},{value:"#7CCD7C",name:"palegreen 3"},{value:"#548B54",name:"palegreen 4"},{value:"#32CD32",css:!0,name:"limegreen"},{value:"#228B22",css:!0,name:"forestgreen"},{value:"#00FF00",vga:!0,name:"green 1"},{value:"#00FF00",vga:!0,css:!0,name:"lime"},{value:"#00EE00",name:"green 2"},{value:"#00CD00",name:"green 3"},{value:"#008B00",name:"green 4"},{value:"#008000",vga:!0,css:!0,name:"green"},{value:"#006400",css:!0,name:"darkgreen"},{value:"#308014",name:"sapgreen"},{value:"#7CFC00",css:!0,name:"lawngreen"},{value:"#7FFF00",name:"chartreuse 1"},{value:"#7FFF00",css:!0,name:"chartreuse"},{value:"#76EE00",name:"chartreuse 2"},{value:"#66CD00",name:"chartreuse 3"},{value:"#458B00",name:"chartreuse 4"},{value:"#ADFF2F",css:!0,name:"greenyellow"},{value:"#CAFF70",name:"darkolivegreen 1"},{value:"#BCEE68",name:"darkolivegreen 2"},{value:"#A2CD5A",name:"darkolivegreen 3"},{value:"#6E8B3D",name:"darkolivegreen 4"},{value:"#556B2F",css:!0,name:"darkolivegreen"},{value:"#6B8E23",css:!0,name:"olivedrab"},{value:"#C0FF3E",name:"olivedrab 1"},{value:"#B3EE3A",name:"olivedrab 2"},{value:"#9ACD32",name:"olivedrab 3"},{value:"#9ACD32",css:!0,name:"yellowgreen"},{value:"#698B22",name:"olivedrab 4"},{value:"#FFFFF0",name:"ivory 1"},{value:"#FFFFF0",css:!0,name:"ivory"},{value:"#EEEEE0",name:"ivory 2"},{value:"#CDCDC1",name:"ivory 3"},{value:"#8B8B83",name:"ivory 4"},{value:"#F5F5DC",css:!0,name:"beige"},{value:"#FFFFE0",name:"lightyellow 1"},{value:"#FFFFE0",css:!0,name:"lightyellow"},{value:"#EEEED1",name:"lightyellow 2"},{value:"#CDCDB4",name:"lightyellow 3"},{value:"#8B8B7A",name:"lightyellow 4"},{value:"#FAFAD2",css:!0,name:"lightgoldenrodyellow"},{value:"#FFFF00",vga:!0,name:"yellow 1"},{value:"#FFFF00",vga:!0,css:!0,name:"yellow"},{value:"#EEEE00",name:"yellow 2"},{value:"#CDCD00",name:"yellow 3"},{value:"#8B8B00",name:"yellow 4"},{value:"#808069",name:"warmgrey"},{value:"#808000",vga:!0,css:!0,name:"olive"},{value:"#BDB76B",css:!0,name:"darkkhaki"},{value:"#FFF68F",name:"khaki 1"},{value:"#EEE685",name:"khaki 2"},{value:"#CDC673",name:"khaki 3"},{value:"#8B864E",name:"khaki 4"},{value:"#F0E68C",css:!0,name:"khaki"},{value:"#EEE8AA",css:!0,name:"palegoldenrod"},{value:"#FFFACD",name:"lemonchiffon 1"},{value:"#FFFACD",css:!0,name:"lemonchiffon"},{value:"#EEE9BF",name:"lemonchiffon 2"},{value:"#CDC9A5",name:"lemonchiffon 3"},{value:"#8B8970",name:"lemonchiffon 4"},{value:"#FFEC8B",name:"lightgoldenrod 1"},{value:"#EEDC82",name:"lightgoldenrod 2"},{value:"#CDBE70",name:"lightgoldenrod 3"},{value:"#8B814C",name:"lightgoldenrod 4"},{value:"#E3CF57",name:"banana"},{value:"#FFD700",name:"gold 1"},{value:"#FFD700",css:!0,name:"gold"},{value:"#EEC900",name:"gold 2"},{value:"#CDAD00",name:"gold 3"},{value:"#8B7500",name:"gold 4"},{value:"#FFF8DC",name:"cornsilk 1"},{value:"#FFF8DC",css:!0,name:"cornsilk"},{value:"#EEE8CD",name:"cornsilk 2"},{value:"#CDC8B1",name:"cornsilk 3"},{value:"#8B8878",name:"cornsilk 4"},{value:"#DAA520",css:!0,name:"goldenrod"},{value:"#FFC125",name:"goldenrod 1"},{value:"#EEB422",name:"goldenrod 2"},{value:"#CD9B1D",name:"goldenrod 3"},{value:"#8B6914",name:"goldenrod 4"},{value:"#B8860B",css:!0,name:"darkgoldenrod"},{value:"#FFB90F",name:"darkgoldenrod 1"},{value:"#EEAD0E",name:"darkgoldenrod 2"},{value:"#CD950C",name:"darkgoldenrod 3"},{value:"#8B6508",name:"darkgoldenrod 4"},{value:"#FFA500",name:"orange 1"},{value:"#FF8000",css:!0,name:"orange"},{value:"#EE9A00",name:"orange 2"},{value:"#CD8500",name:"orange 3"},{value:"#8B5A00",name:"orange 4"},{value:"#FFFAF0",css:!0,name:"floralwhite"},{value:"#FDF5E6",css:!0,name:"oldlace"},{value:"#F5DEB3",css:!0,name:"wheat"},{value:"#FFE7BA",name:"wheat 1"},{value:"#EED8AE",name:"wheat 2"},{value:"#CDBA96",name:"wheat 3"},{value:"#8B7E66",name:"wheat 4"},{value:"#FFE4B5",css:!0,name:"moccasin"},{value:"#FFEFD5",css:!0,name:"papayawhip"},{value:"#FFEBCD",css:!0,name:"blanchedalmond"},{value:"#FFDEAD",name:"navajowhite 1"},{value:"#FFDEAD",css:!0,name:"navajowhite"},{value:"#EECFA1",name:"navajowhite 2"},{value:"#CDB38B",name:"navajowhite 3"},{value:"#8B795E",name:"navajowhite 4"},{value:"#FCE6C9",name:"eggshell"},{value:"#D2B48C",css:!0,name:"tan"},{value:"#9C661F",name:"brick"},{value:"#FF9912",name:"cadmiumyellow"},{value:"#FAEBD7",css:!0,name:"antiquewhite"},{value:"#FFEFDB",name:"antiquewhite 1"},{value:"#EEDFCC",name:"antiquewhite 2"},{value:"#CDC0B0",name:"antiquewhite 3"},{value:"#8B8378",name:"antiquewhite 4"},{value:"#DEB887",css:!0,name:"burlywood"},{value:"#FFD39B",name:"burlywood 1"},{value:"#EEC591",name:"burlywood 2"},{value:"#CDAA7D",name:"burlywood 3"},{value:"#8B7355",name:"burlywood 4"},{value:"#FFE4C4",name:"bisque 1"},{value:"#FFE4C4",css:!0,name:"bisque"},{value:"#EED5B7",name:"bisque 2"},{value:"#CDB79E",name:"bisque 3"},{value:"#8B7D6B",name:"bisque 4"},{value:"#E3A869",name:"melon"},{value:"#ED9121",name:"carrot"},{value:"#FF8C00",css:!0,name:"darkorange"},{value:"#FF7F00",name:"darkorange 1"},{value:"#EE7600",name:"darkorange 2"},{value:"#CD6600",name:"darkorange 3"},{value:"#8B4500",name:"darkorange 4"},{value:"#FFA54F",name:"tan 1"},{value:"#EE9A49",name:"tan 2"},{value:"#CD853F",name:"tan 3"},{value:"#CD853F",css:!0,name:"peru"},{value:"#8B5A2B",name:"tan 4"},{value:"#FAF0E6",css:!0,name:"linen"},{value:"#FFDAB9",name:"peachpuff 1"},{value:"#FFDAB9",css:!0,name:"peachpuff"},{value:"#EECBAD",name:"peachpuff 2"},{value:"#CDAF95",name:"peachpuff 3"},{value:"#8B7765",name:"peachpuff 4"},{value:"#FFF5EE",name:"seashell 1"},{value:"#FFF5EE",css:!0,name:"seashell"},{value:"#EEE5DE",name:"seashell 2"},{value:"#CDC5BF",name:"seashell 3"},{value:"#8B8682",name:"seashell 4"},{value:"#F4A460",css:!0,name:"sandybrown"},{value:"#C76114",name:"rawsienna"},{value:"#D2691E",css:!0,name:"chocolate"},{value:"#FF7F24",name:"chocolate 1"},{value:"#EE7621",name:"chocolate 2"},{value:"#CD661D",name:"chocolate 3"},{value:"#8B4513",name:"chocolate 4"},{value:"#8B4513",css:!0,name:"saddlebrown"},{value:"#292421",name:"ivoryblack"},{value:"#FF7D40",name:"flesh"},{value:"#FF6103",name:"cadmiumorange"},{value:"#8A360F",name:"burntsienna"},{value:"#A0522D",css:!0,name:"sienna"},{value:"#FF8247",name:"sienna 1"},{value:"#EE7942",name:"sienna 2"},{value:"#CD6839",name:"sienna 3"},{value:"#8B4726",name:"sienna 4"},{value:"#FFA07A",name:"lightsalmon 1"},{value:"#FFA07A",css:!0,name:"lightsalmon"},{value:"#EE9572",name:"lightsalmon 2"},{value:"#CD8162",name:"lightsalmon 3"},{value:"#8B5742",name:"lightsalmon 4"},{value:"#FF7F50",css:!0,name:"coral"},{value:"#FF4500",name:"orangered 1"},{value:"#FF4500",css:!0,name:"orangered"},{value:"#EE4000",name:"orangered 2"},{value:"#CD3700",name:"orangered 3"},{value:"#8B2500",name:"orangered 4"},{value:"#5E2612",name:"sepia"},{value:"#E9967A",css:!0,name:"darksalmon"},{value:"#FF8C69",name:"salmon 1"},{value:"#EE8262",name:"salmon 2"},{value:"#CD7054",name:"salmon 3"},{value:"#8B4C39",name:"salmon 4"},{value:"#FF7256",name:"coral 1"},{value:"#EE6A50",name:"coral 2"},{value:"#CD5B45",name:"coral 3"},{value:"#8B3E2F",name:"coral 4"},{value:"#8A3324",name:"burntumber"},{value:"#FF6347",name:"tomato 1"},{value:"#FF6347",css:!0,name:"tomato"},{value:"#EE5C42",name:"tomato 2"},{value:"#CD4F39",name:"tomato 3"},{value:"#8B3626",name:"tomato 4"},{value:"#FA8072",css:!0,name:"salmon"},{value:"#FFE4E1",name:"mistyrose 1"},{value:"#FFE4E1",css:!0,name:"mistyrose"},{value:"#EED5D2",name:"mistyrose 2"},{value:"#CDB7B5",name:"mistyrose 3"},{value:"#8B7D7B",name:"mistyrose 4"},{value:"#FFFAFA",name:"snow 1"},{value:"#FFFAFA",css:!0,name:"snow"},{value:"#EEE9E9",name:"snow 2"},{value:"#CDC9C9",name:"snow 3"},{value:"#8B8989",name:"snow 4"},{value:"#BC8F8F",css:!0,name:"rosybrown"},{value:"#FFC1C1",name:"rosybrown 1"},{value:"#EEB4B4",name:"rosybrown 2"},{value:"#CD9B9B",name:"rosybrown 3"},{value:"#8B6969",name:"rosybrown 4"},{value:"#F08080",css:!0,name:"lightcoral"},{value:"#CD5C5C",css:!0,name:"indianred"},{value:"#FF6A6A",name:"indianred 1"},{value:"#EE6363",name:"indianred 2"},{value:"#8B3A3A",name:"indianred 4"},{value:"#CD5555",name:"indianred 3"},{value:"#A52A2A",css:!0,name:"brown"},{value:"#FF4040",name:"brown 1"},{value:"#EE3B3B",name:"brown 2"},{value:"#CD3333",name:"brown 3"},{value:"#8B2323",name:"brown 4"},{value:"#B22222",css:!0,name:"firebrick"},{value:"#FF3030",name:"firebrick 1"},{value:"#EE2C2C",name:"firebrick 2"},{value:"#CD2626",name:"firebrick 3"},{value:"#8B1A1A",name:"firebrick 4"},{value:"#FF0000",vga:!0,name:"red 1"},{value:"#FF0000",vga:!0,css:!0,name:"red"},{value:"#EE0000",name:"red 2"},{value:"#CD0000",name:"red 3"},{value:"#8B0000",name:"red 4"},{value:"#8B0000",css:!0,name:"darkred"},{value:"#800000",vga:!0,css:!0,name:"maroon"},{value:"#8E388E",name:"sgi beet"},{value:"#7171C6",name:"sgi slateblue"},{value:"#7D9EC0",name:"sgi lightblue"},{value:"#388E8E",name:"sgi teal"},{value:"#71C671",name:"sgi chartreuse"},{value:"#8E8E38",name:"sgi olivedrab"},{value:"#C5C1AA",name:"sgi brightgray"},{value:"#C67171",name:"sgi salmon"},{value:"#555555",name:"sgi darkgray"},{value:"#1E1E1E",name:"sgi gray 12"},{value:"#282828",name:"sgi gray 16"},{value:"#515151",name:"sgi gray 32"},{value:"#5B5B5B",name:"sgi gray 36"},{value:"#848484",name:"sgi gray 52"},{value:"#8E8E8E",name:"sgi gray 56"},{value:"#AAAAAA",name:"sgi lightgray"},{value:"#B7B7B7",name:"sgi gray 72"},{value:"#C1C1C1",name:"sgi gray 76"},{value:"#EAEAEA",name:"sgi gray 92"},{value:"#F4F4F4",name:"sgi gray 96"},{value:"#FFFFFF",vga:!0,css:!0,name:"white"},{value:"#F5F5F5",name:"white smoke"},{value:"#F5F5F5",name:"gray 96"},{value:"#DCDCDC",css:!0,name:"gainsboro"},{value:"#D3D3D3",css:!0,name:"lightgrey"},{value:"#C0C0C0",vga:!0,css:!0,name:"silver"},{value:"#A9A9A9",css:!0,name:"darkgray"},{value:"#808080",vga:!0,css:!0,name:"gray"},{value:"#696969",css:!0,name:"dimgray"},{value:"#696969",name:"gray 42"},{value:"#000000",vga:!0,css:!0,name:"black"},{value:"#FCFCFC",name:"gray 99"},{value:"#FAFAFA",name:"gray 98"},{value:"#F7F7F7",name:"gray 97"},{value:"#F2F2F2",name:"gray 95"},{value:"#F0F0F0",name:"gray 94"},{value:"#EDEDED",name:"gray 93"},{value:"#EBEBEB",name:"gray 92"},{value:"#E8E8E8",name:"gray 91"},{value:"#E5E5E5",name:"gray 90"},{value:"#E3E3E3",name:"gray 89"},{value:"#E0E0E0",name:"gray 88"},{value:"#DEDEDE",name:"gray 87"},{value:"#DBDBDB",name:"gray 86"},{value:"#D9D9D9",name:"gray 85"},{value:"#D6D6D6",name:"gray 84"},{value:"#D4D4D4",name:"gray 83"},{value:"#D1D1D1",name:"gray 82"},{value:"#CFCFCF",name:"gray 81"},{value:"#CCCCCC",name:"gray 80"},{value:"#C9C9C9",name:"gray 79"},{value:"#C7C7C7",name:"gray 78"},{value:"#C4C4C4",name:"gray 77"},{value:"#C2C2C2",name:"gray 76"},{value:"#BFBFBF",name:"gray 75"},{value:"#BDBDBD",name:"gray 74"},{value:"#BABABA",name:"gray 73"},{value:"#B8B8B8",name:"gray 72"},{value:"#B5B5B5",name:"gray 71"},{value:"#B3B3B3",name:"gray 70"},{value:"#B0B0B0",name:"gray 69"},{value:"#ADADAD",name:"gray 68"},{value:"#ABABAB",name:"gray 67"},{value:"#A8A8A8",name:"gray 66"},{value:"#A6A6A6",name:"gray 65"},{value:"#A3A3A3",name:"gray 64"},{value:"#A1A1A1",name:"gray 63"},{value:"#9E9E9E",name:"gray 62"},{value:"#9C9C9C",name:"gray 61"},{value:"#999999",name:"gray 60"},{value:"#969696",name:"gray 59"},{value:"#949494",name:"gray 58"},{value:"#919191",name:"gray 57"},{value:"#8F8F8F",name:"gray 56"},{value:"#8C8C8C",name:"gray 55"},{value:"#8A8A8A",name:"gray 54"},{value:"#878787",name:"gray 53"},{value:"#858585",name:"gray 52"},{value:"#828282",name:"gray 51"},{value:"#7F7F7F",name:"gray 50"},{value:"#7D7D7D",name:"gray 49"},{value:"#7A7A7A",name:"gray 48"},{value:"#787878",name:"gray 47"},{value:"#757575",name:"gray 46"},{value:"#737373",name:"gray 45"},{value:"#707070",name:"gray 44"},{value:"#6E6E6E",name:"gray 43"},{value:"#666666",name:"gray 40"},{value:"#636363",name:"gray 39"},{value:"#616161",name:"gray 38"},{value:"#5E5E5E",name:"gray 37"},{value:"#5C5C5C",name:"gray 36"},{value:"#595959",name:"gray 35"},{value:"#575757",name:"gray 34"},{value:"#545454",name:"gray 33"},{value:"#525252",name:"gray 32"},{value:"#4F4F4F",name:"gray 31"},{value:"#4D4D4D",name:"gray 30"},{value:"#4A4A4A",name:"gray 29"},{value:"#474747",name:"gray 28"},{value:"#454545",name:"gray 27"},{value:"#424242",name:"gray 26"},{value:"#404040",name:"gray 25"},{value:"#3D3D3D",name:"gray 24"},{value:"#3B3B3B",name:"gray 23"},{value:"#383838",name:"gray 22"},{value:"#363636",name:"gray 21"},{value:"#333333",name:"gray 20"},{value:"#303030",name:"gray 19"},{value:"#2E2E2E",name:"gray 18"},{value:"#2B2B2B",name:"gray 17"},{value:"#292929",name:"gray 16"},{value:"#262626",name:"gray 15"},{value:"#242424",name:"gray 14"},{value:"#212121",name:"gray 13"},{value:"#1F1F1F",name:"gray 12"},{value:"#1C1C1C",name:"gray 11"},{value:"#1A1A1A",name:"gray 10"},{value:"#171717",name:"gray 9"},{value:"#141414",name:"gray 8"},{value:"#121212",name:"gray 7"},{value:"#0F0F0F",name:"gray 6"},{value:"#0D0D0D",name:"gray 5"},{value:"#0A0A0A",name:"gray 4"},{value:"#080808",name:"gray 3"},{value:"#050505",name:"gray 2"},{value:"#030303",name:"gray 1"},{value:"#F5F5F5",css:!0,name:"whitesmoke"}]},4683:(e,t,n)=>{var r=n(292),i=r.filter((function(e){return!!e.css})),s=r.filter((function(e){return!!e.vga}));e.exports=function(t){var n=e.exports.get(t);return n&&n.value},e.exports.get=function(e){return e=(e=e||"").trim().toLowerCase(),r.filter((function(t){return t.name.toLowerCase()===e})).pop()},e.exports.all=e.exports.get.all=function(){return r},e.exports.get.css=function(e){return e?(e=(e=e||"").trim().toLowerCase(),i.filter((function(t){return t.name.toLowerCase()===e})).pop()):i},e.exports.get.vga=function(e){return e?(e=(e=e||"").trim().toLowerCase(),s.filter((function(t){return t.name.toLowerCase()===e})).pop()):s}},2517:(e,t,n)=>{var r={};e.exports=r,r.themes={};var i=n(1669),s=r.styles=n(5784),o=Object.defineProperties,a=new RegExp(/[\r\n]+/g);r.supportsColor=n(6561).supportsColor,void 0===r.enabled&&(r.enabled=!1!==r.supportsColor()),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")},r.stylize=function(e,t){if(!r.enabled)return e+"";var n=s[t];return!n&&t in r?r[t](e):n.open+e+n.close};var l=/[|\\{}()[\]^$+*?.]/g;function u(e){var t=function e(){return f.apply(e,arguments)};return t._styles=e,t.__proto__=d,t}var c,h=(c={},s.grey=s.gray,Object.keys(s).forEach((function(e){s[e].closeRe=new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(l,"\\$&")}(s[e].close),"g"),c[e]={get:function(){return u(this._styles.concat(e))}}})),c),d=o((function(){}),h);function f(){var e=Array.prototype.slice.call(arguments),t=e.map((function(e){return null!=e&&e.constructor===String?e:i.inspect(e)})).join(" ");if(!r.enabled||!t)return t;for(var n=-1!=t.indexOf("\n"),o=this._styles,l=o.length;l--;){var u=s[o[l]];t=u.open+t.replace(u.closeRe,u.open)+u.close,n&&(t=t.replace(a,(function(e){return u.close+e+u.open})))}return t}r.setTheme=function(e){if("string"!=typeof e)for(var t in e)!function(t){r[t]=function(n){if("object"==typeof e[t]){var i=n;for(var s in e[t])i=r[e[t][s]](i);return i}return r[e[t]](n)}}(t);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var g=function(e,t){var n=t.split("");return(n=n.map(e)).join("")};for(var p in r.trap=n(5117),r.zalgo=n(1492),r.maps={},r.maps.america=n(6260)(r),r.maps.zebra=n(3270)(r),r.maps.rainbow=n(5920)(r),r.maps.random=n(2449)(r),r.maps)!function(e){r[e]=function(t){return g(r.maps[e],t)}}(p);o(r,function(){var e={};return Object.keys(h).forEach((function(t){e[t]={get:function(){return u([t])}}})),e}())},5117:e=>{e.exports=function(e,t){var n="";e=(e=e||"Run the trap, drop the bass").split("");var r={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return e.forEach((function(e){e=e.toLowerCase();var t=r[e]||[" "],i=Math.floor(Math.random()*t.length);n+=void 0!==r[e]?r[e][i]:e})),n}},1492:e=>{e.exports=function(e,t){e=e||" he is here ";var n={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},r=[].concat(n.up,n.down,n.mid);function i(e){return Math.floor(Math.random()*e)}function s(e){var t=!1;return r.filter((function(n){t=n===e})),t}return function(e,t){var r,o,a="";for(o in(t=t||{}).up=void 0===t.up||t.up,t.mid=void 0===t.mid||t.mid,t.down=void 0===t.down||t.down,t.size=void 0!==t.size?t.size:"maxi",e=e.split(""))if(!s(o)){switch(a+=e[o],r={up:0,down:0,mid:0},t.size){case"mini":r.up=i(8),r.mid=i(2),r.down=i(8);break;case"maxi":r.up=i(16)+3,r.mid=i(4)+1,r.down=i(64)+3;break;default:r.up=i(8)+1,r.mid=i(6)/2,r.down=i(8)+1}var l=["up","mid","down"];for(var u in l)for(var c=l[u],h=0;h<=r[c];h++)t[c]&&(a+=n[c][i(n[c].length)])}return a}(e,t)}},6260:e=>{e.exports=function(e){return function(t,n,r){if(" "===t)return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}},5920:e=>{e.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(n,r,i){return" "===n?n:e[t[r++%t.length]](n)}}},2449:e=>{e.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(n,r,i){return" "===n?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}},3270:e=>{e.exports=function(e){return function(t,n,r){return n%2==0?t:e.inverse(t)}}},5784:e=>{var t={};e.exports=t;var n={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(n).forEach((function(e){var r=n[e],i=t[e]=[];i.open="["+r[0]+"m",i.close="["+r[1]+"m"}))},4340:e=>{"use strict";e.exports=function(e,t){var n=(t=t||process.argv).indexOf("--"),r=/^-{1,2}/.test(e)?"":"--",i=t.indexOf(r+e);return-1!==i&&(-1===n||i<n)}},6561:(e,t,n)=>{"use strict";var r=n(2087),i=n(4340),s=process.env,o=void 0;function a(e){return 0!==(t=function(e){if(!1===o)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!e.isTTY&&!0!==o)return 0;var t=o?1:0;if("win32"===process.platform){var n=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((function(e){return e in s}))||"codeship"===s.CI_NAME?1:t;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in s){var a=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:(s.TERM,t)}(e))&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3};var t}i("no-color")||i("no-colors")||i("color=false")?o=!1:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(o=!0),"FORCE_COLOR"in s&&(o=0===s.FORCE_COLOR.length||0!==parseInt(s.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},4431:(e,t,n)=>{var r=n(2517);e.exports=r},2514:(e,t,n)=>{"use strict";var r=n(6767),i=n(3951);e.exports=function(e,t){var n=e.split(t||":"),s=i(n[0]);if(!n.length)return s;for(var o=0,a=n.length-1;o<a;o++)s=r(s).mix(r(i(n[o+1]))).saturate(1).hex();return s}},6497:(e,t)=>{function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=Buffer.isBuffer},8713:(e,t,n)=>{"use strict";var r=n(2514),i=n(4495),s=n(9343),o=n(1669),a=n(3867).isatty(1),l=process.stdout;function u(e,t){return i(e)?((t=t||{}).colors="colors"in t?t.colors:a,t.ansi=t.colors?s(e,r(e)):e,t.stream=t.stream||l,Array.isArray(t.stream)||(t.stream=[t.stream]),function(e){e instanceof Error&&(e=e.stack||e.message||e),e=[t.ansi," ",e].join(""),e=o.format.apply(this,[e].concat(Array.prototype.slice.call(arguments,1)))+"\n",t.stream.forEach((function(t){t.write(e)}))}):function(){}}u.to=function(e){return l=e,u},e.exports=u},4495:(e,t,n)=>{"use strict";var r=n(4647);e.exports=function(e,t){var n,i=r(),s=0;for(t=t||["diagnostics","debug"];s<t.length&&!(n=i[t[s]]);s++);if(!n)return!1;for(t=n.split(/[\s,]+/),s=0;s<t.length;s++)if("-"!==(n=t[s].replace("*",".*?")).charAt(0)){if(new RegExp("^"+n+"$").test(e))return!0}else if(new RegExp("^"+n.substr(1)+"$").test(e))return!1;return!1}},4647:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function n(e){if(e=e||{},"object"==typeof process&&"object"==typeof process.env&&n.merge(e,process.env),"undefined"!=typeof window){"string"===window.name&&window.name.length&&n.merge(e,n.parse(window.name));try{window.localStorage&&n.merge(e,n.parse(window.localStorage.env||window.localStorage.debug))}catch(e){}"object"==typeof window.location&&"string"==typeof window.location.hash&&window.location.hash.length&&n.merge(e,n.parse("#"===window.location.hash.charAt(0)?window.location.hash.slice(1):window.location.hash))}var t,r;for(t in e)(r=t.toLowerCase())in e||(e[r]=e[t]);return e}n.merge=function(e,n){for(var r in n)t.call(n,r)&&(e[r]=n[r]);return e},n.parse=function(e){var t,n=/([^=?&]+)=([^&]*)/g,r={};if(!e)return r;for(;t=n.exec(e);r[decodeURIComponent(t[1])]=decodeURIComponent(t[2]));return r.env||r},e.exports=n},7529:e=>{var t=-1;function n(e,a,l,u){if(e===a)return e?[[0,e]]:[];if(null!=l){var c=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,s=e.length,o=t.length;if(0===r.length&&(null===i||0===i.length)){var a=r.index,l=e.slice(0,a),u=e.slice(a),c=i?i.index:null,d=a+o-s;if((null===c||c===d)&&!(d<0||d>o)){var f=t.slice(0,d);if((m=t.slice(d))===u){var g=Math.min(a,d);if((b=l.slice(0,g))===(w=f.slice(0,g)))return h(b,l.slice(g),f.slice(g),u)}}if(null===c||c===a){var p=a,m=(f=t.slice(0,p),t.slice(p));if(f===l){var v=Math.min(s-p,o-p);if((y=u.slice(u.length-v))===(E=m.slice(m.length-v)))return h(l,u.slice(0,u.length-v),m.slice(0,m.length-v),y)}}}if(r.length>0&&i&&0===i.length){var b=e.slice(0,r.index),y=e.slice(r.index+r.length);if(!(o<(g=b.length)+(v=y.length))){var w=t.slice(0,g),E=t.slice(o-v);if(b===w&&y===E)return h(b,e.slice(g,s-v),t.slice(g,o-v),y)}}return null}(e,a,l);if(c)return c}var d=i(e,a),f=e.substring(0,d);d=s(e=e.substring(d),a=a.substring(d));var g=e.substring(e.length-d),p=function(e,o){var a;if(!e)return[[1,o]];if(!o)return[[t,e]];var l=e.length>o.length?e:o,u=e.length>o.length?o:e,c=l.indexOf(u);if(-1!==c)return a=[[1,l.substring(0,c)],[0,u],[1,l.substring(c+u.length)]],e.length>o.length&&(a[0][0]=a[2][0]=t),a;if(1===u.length)return[[t,e],[1,o]];var h=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;function o(e,t,n){for(var r,o,a,l,u=e.substring(n,n+Math.floor(e.length/4)),c=-1,h="";-1!==(c=t.indexOf(u,c+1));){var d=i(e.substring(n),t.substring(c)),f=s(e.substring(0,n),t.substring(0,c));h.length<f+d&&(h=t.substring(c-f,c)+t.substring(c,c+d),r=e.substring(0,n-f),o=e.substring(n+d),a=t.substring(0,c-f),l=t.substring(c+d))}return 2*h.length>=e.length?[r,o,a,l,h]:null}var a,l,u,c,h,d=o(n,r,Math.ceil(n.length/4)),f=o(n,r,Math.ceil(n.length/2));return d||f?(a=f?d&&d[4].length>f[4].length?d:f:d,e.length>t.length?(l=a[0],u=a[1],c=a[2],h=a[3]):(c=a[0],h=a[1],l=a[2],u=a[3]),[l,u,c,h,a[4]]):null}(e,o);if(h){var d=h[0],f=h[1],g=h[2],p=h[3],m=h[4],v=n(d,g),b=n(f,p);return v.concat([[0,m]],b)}return function(e,n){for(var i=e.length,s=n.length,o=Math.ceil((i+s)/2),a=o,l=2*o,u=new Array(l),c=new Array(l),h=0;h<l;h++)u[h]=-1,c[h]=-1;u[a+1]=0,c[a+1]=0;for(var d=i-s,f=d%2!=0,g=0,p=0,m=0,v=0,b=0;b<o;b++){for(var y=-b+g;y<=b-p;y+=2){for(var w=a+y,E=(S=y===-b||y!==b&&u[w-1]<u[w+1]?u[w+1]:u[w-1]+1)-y;S<i&&E<s&&e.charAt(S)===n.charAt(E);)S++,E++;if(u[w]=S,S>i)p+=2;else if(E>s)g+=2;else if(f&&(C=a+d-y)>=0&&C<l&&-1!==c[C]&&S>=(x=i-c[C]))return r(e,n,S,E)}for(var _=-b+m;_<=b-v;_+=2){for(var x,C=a+_,M=(x=_===-b||_!==b&&c[C-1]<c[C+1]?c[C+1]:c[C-1]+1)-_;x<i&&M<s&&e.charAt(i-x-1)===n.charAt(s-M-1);)x++,M++;if(c[C]=x,x>i)v+=2;else if(M>s)m+=2;else if(!f){var S;if((w=a+d-_)>=0&&w<l&&-1!==u[w])if(E=a+(S=u[w])-w,S>=(x=i-x))return r(e,n,S,E)}}}return[[t,e],[1,n]]}(e,o)}(e=e.substring(0,e.length-d),a=a.substring(0,a.length-d));return f&&p.unshift([0,f]),g&&p.push([0,g]),o(p,u),p}function r(e,t,r,i){var s=e.substring(0,r),o=t.substring(0,i),a=e.substring(r),l=t.substring(i),u=n(s,o),c=n(a,l);return u.concat(c)}function i(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,s=0;n<i;)e.substring(s,i)==t.substring(s,i)?s=n=i:r=i,i=Math.floor((r-n)/2+n);return a(e.charCodeAt(i-1))&&i--,i}function s(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,s=0;n<i;)e.substring(e.length-i,e.length-s)==t.substring(t.length-i,t.length-s)?s=n=i:r=i,i=Math.floor((r-n)/2+n);return l(e.charCodeAt(e.length-i))&&i--,i}function o(e,n){e.push([0,""]);for(var r,a=0,l=0,h=0,d="",f="";a<e.length;)if(a<e.length-1&&!e[a][1])e.splice(a,1);else switch(e[a][0]){case 1:h++,f+=e[a][1],a++;break;case t:l++,d+=e[a][1],a++;break;case 0:var g=a-h-l-1;if(n){if(g>=0&&c(e[g][1])){var p=e[g][1].slice(-1);if(e[g][1]=e[g][1].slice(0,-1),d=p+d,f=p+f,!e[g][1]){e.splice(g,1),a--;var m=g-1;e[m]&&1===e[m][0]&&(h++,f=e[m][1]+f,m--),e[m]&&e[m][0]===t&&(l++,d=e[m][1]+d,m--),g=m}}u(e[a][1])&&(p=e[a][1].charAt(0),e[a][1]=e[a][1].slice(1),d+=p,f+=p)}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(d.length>0||f.length>0){d.length>0&&f.length>0&&(0!==(r=i(f,d))&&(g>=0?e[g][1]+=f.substring(0,r):(e.splice(0,0,[0,f.substring(0,r)]),a++),f=f.substring(r),d=d.substring(r)),0!==(r=s(f,d))&&(e[a][1]=f.substring(f.length-r)+e[a][1],f=f.substring(0,f.length-r),d=d.substring(0,d.length-r)));var v=h+l;0===d.length&&0===f.length?(e.splice(a-v,v),a-=v):0===d.length?(e.splice(a-v,v,[1,f]),a=a-v+1):0===f.length?(e.splice(a-v,v,[t,d]),a=a-v+1):(e.splice(a-v,v,[t,d],[1,f]),a=a-v+2)}0!==a&&0===e[a-1][0]?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,h=0,l=0,d="",f=""}""===e[e.length-1][1]&&e.pop();var b=!1;for(a=1;a<e.length-1;)0===e[a-1][0]&&0===e[a+1][0]&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),b=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),b=!0)),a++;b&&o(e,n)}function a(e){return e>=55296&&e<=56319}function l(e){return e>=56320&&e<=57343}function u(e){return l(e.charCodeAt(0))}function c(e){return a(e.charCodeAt(e.length-1))}function h(e,n,r,i){return c(e)||u(i)?null:function(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}([[0,e],[t,n],[1,r],[0,i]])}function d(e,t,r){return n(e,t,r,!0)}d.INSERT=1,d.DELETE=t,d.EQUAL=0,e.exports=d},4445:e=>{e.exports=r,r.default=r,r.stable=o,r.stableStringify=o;var t=[],n=[];function r(e,r,s){var o;for(i(e,"",[],void 0),o=0===n.length?JSON.stringify(e,r,s):JSON.stringify(e,l(r),s);0!==t.length;){var a=t.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}return o}function i(e,r,s,o){var a;if("object"==typeof e&&null!==e){for(a=0;a<s.length;a++)if(s[a]===e){var l=Object.getOwnPropertyDescriptor(o,r);return void(void 0!==l.get?l.configurable?(Object.defineProperty(o,r,{value:"[Circular]"}),t.push([o,r,e,l])):n.push([e,r]):(o[r]="[Circular]",t.push([o,r,e])))}if(s.push(e),Array.isArray(e))for(a=0;a<e.length;a++)i(e[a],a,s,e);else{var u=Object.keys(e);for(a=0;a<u.length;a++){var c=u[a];i(e[c],c,s,e)}}s.pop()}}function s(e,t){return e<t?-1:e>t?1:0}function o(e,r,i){var s,o=a(e,"",[],void 0)||e;for(s=0===n.length?JSON.stringify(o,r,i):JSON.stringify(o,l(r),i);0!==t.length;){var u=t.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}return s}function a(e,r,i,o){var l;if("object"==typeof e&&null!==e){for(l=0;l<i.length;l++)if(i[l]===e){var u=Object.getOwnPropertyDescriptor(o,r);return void(void 0!==u.get?u.configurable?(Object.defineProperty(o,r,{value:"[Circular]"}),t.push([o,r,e,u])):n.push([e,r]):(o[r]="[Circular]",t.push([o,r,e])))}if("function"==typeof e.toJSON)return;if(i.push(e),Array.isArray(e))for(l=0;l<e.length;l++)a(e[l],l,i,e);else{var c={},h=Object.keys(e).sort(s);for(l=0;l<h.length;l++){var d=h[l];a(e[d],d,i,e),c[d]=e[d]}if(void 0===o)return c;t.push([o,r,e]),o[r]=c}i.pop()}}function l(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var i=0;i<n.length;i++){var s=n[i];if(s[1]===t&&s[0]===r){r="[Circular]",n.splice(i,1);break}}return e.call(this,t,r)}}},9432:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>k,assign:()=>c,format:()=>T,parse:()=>A,defaultI18n:()=>g,setGlobalDateI18n:()=>m,setGlobalDateMasks:()=>D});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,i="[1-9]\\d?",s="\\d\\d",o="[^\\s]+",a=/\[([^]*?)\]/gm;function l(e,t){for(var n=[],r=0,i=e.length;r<i;r++)n.push(e[r].substr(0,t));return n}var u=function(e){return function(t,n){var r=n[e].map((function(e){return e.toLowerCase()})).indexOf(t.toLowerCase());return r>-1?r:null}};function c(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++){var s=i[r];for(var o in s)e[o]=s[o]}return e}var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"],f=l(d,3),g={dayNamesShort:l(h,3),dayNames:h,monthNamesShort:f,monthNames:d,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!=10?1:0)*e%10]}},p=c({},g),m=function(e){return p=c(p,e)},v=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},b=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length<t;)e="0"+e;return e},y={D:function(e){return String(e.getDate())},DD:function(e){return b(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return b(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return b(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return b(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return b(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return b(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return b(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return b(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return b(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return b(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return b(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+b(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+b(Math.floor(Math.abs(t)/60),2)+":"+b(Math.abs(t)%60,2)}},w=function(e){return+e-1},E=[null,i],_=[null,o],x=["isPm",o,function(e,t){var n=e.toLowerCase();return n===t.amPm[0]?0:n===t.amPm[1]?1:null}],C=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var n=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?n:-n}return 0}],M={D:["day",i],DD:["day",s],Do:["day","[1-9]\\d?[^\\s]+",function(e){return parseInt(e,10)}],M:["month",i,w],MM:["month",s,w],YY:["year",s,function(e){var t=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+e>68?t-1:t)+e)}],h:["hour",i,void 0,"isPm"],hh:["hour",s,void 0,"isPm"],H:["hour",i],HH:["hour",s],m:["minute",i],mm:["minute",s],s:["second",i],ss:["second",s],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(e){return 100*+e}],SS:["millisecond",s,function(e){return 10*+e}],SSS:["millisecond","\\d{3}"],d:E,dd:E,ddd:_,dddd:_,MMM:["month",o,u("monthNamesShort")],MMMM:["month",o,u("monthNames")],a:x,A:x,ZZ:C,Z:C},S={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},D=function(e){return c(S,e)},T=function(e,t,n){if(void 0===t&&(t=S.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var i=[];t=(t=S[t]||t).replace(a,(function(e,t){return i.push(t),"@@@"}));var s=c(c({},p),n);return(t=t.replace(r,(function(t){return y[t](e,s)}))).replace(/@@@/g,(function(){return i.shift()}))};function A(e,t,n){if(void 0===n&&(n={}),"string"!=typeof t)throw new Error("Invalid format in fecha parse");if(t=S[t]||t,e.length>1e3)return null;var i={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},s=[],o=[],l=t.replace(a,(function(e,t){return o.push(v(t)),"@@@"})),u={},h={};l=v(l).replace(r,(function(e){var t=M[e],n=t[0],r=t[1],i=t[3];if(u[n])throw new Error("Invalid format. "+n+" specified twice in format");return u[n]=!0,i&&(h[i]=!0),s.push(t),"("+r+")"})),Object.keys(h).forEach((function(e){if(!u[e])throw new Error("Invalid format. "+e+" is required in specified format")})),l=l.replace(/@@@/g,(function(){return o.shift()}));var d=e.match(new RegExp(l,"i"));if(!d)return null;for(var f=c(c({},p),n),g=1;g<d.length;g++){var m=s[g-1],b=m[0],y=m[2],w=y?y(d[g],f):+d[g];if(null==w)return null;i[b]=w}1===i.isPm&&null!=i.hour&&12!=+i.hour?i.hour=+i.hour+12:0===i.isPm&&12==+i.hour&&(i.hour=0);for(var E=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond),_=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],x=(g=0,_.length);g<x;g++)if(u[_[g][0]]&&i[_[g][0]]!==E[_[g][1]]())return null;return null==i.timezoneOffset?E:new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond))}const k={format:T,parse:A,defaultI18n:g,setGlobalDateI18n:m,setGlobalDateMasks:D}},4378:(e,t,n)=>{try{var r=n(1669);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(5717)}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},4970:e=>{"use strict";var t=e.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.writable=function(e){return t(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState},t.readable=function(e){return t(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState},t.duplex=function(e){return t.writable(e)&&t.readable(e)},t.transform=function(e){return t.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState}},5826:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9343:(e,t,n)=>{"use strict";var r=n(4683);function i(e,t){return t?new i(e).style(t):this instanceof i?void(this.text=e):new i(e)}i.prototype.prefix="[",i.prototype.suffix="m",i.prototype.hex=function(e){3===(e="#"===e[0]?e.substring(1):e).length&&((e=e.split(""))[5]=e[2],e[4]=e[2],e[3]=e[1],e[2]=e[1],e[1]=e[0],e=e.join(""));var t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6);return[parseInt(t,16),parseInt(n,16),parseInt(r,16)]},i.prototype.rgb=function(e,t,n){var r=e/255*5,i=t/255*5,s=n/255*5;return this.ansi(r,i,s)},i.prototype.ansi=function(e,t,n){return 16+36*Math.round(e)+6*Math.round(t)+Math.round(n)},i.prototype.reset=function(){return this.prefix+"39;49"+this.suffix},i.prototype.style=function(e){return/^#?(?:[0-9a-fA-F]{3}){1,2}$/.test(e)||(e=r(e)),this.prefix+"38;5;"+this.rgb.apply(this,this.hex(e))+this.suffix+this.text+this.reset()},e.exports=i},5402:e=>{var t=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var i=Object.prototype,s=i.hasOwnProperty,o=i.toString,a=i.propertyIsEnumerable,l=Math.max;function u(e,t,n,r){return void 0===e||f(e,i[n])&&!s.call(r,n)?t:e}function c(e,t,n){var r=e[t];s.call(e,t)&&f(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function h(e,t){return t=l(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=l(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=o,r(e,this,a)}}function d(e,r){return!!(r=null==r?t:r)&&("number"==typeof e||n.test(e))&&e>-1&&e%1==0&&e<r}function f(e,t){return e===t||e!=e&&t!=t}var g=Array.isArray;function p(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=m(e)?o.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var v,b=(v=function(e,t,n,r){!function(e,t,n,r){n||(n={});for(var i=-1,s=t.length;++i<s;){var o=t[i],a=r?r(n[o],e[o],o,n,e):void 0;c(n,o,void 0===a?e[o]:a)}}(t,function(e){return p(e)?function(e,t){var n=g(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&p(e)}(e)&&s.call(e,"callee")&&(!a.call(e,"callee")||"[object Arguments]"==o.call(e))}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var l in e)!t&&!s.call(e,l)||i&&("length"==l||d(l,r))||n.push(l);return n}(e,!0):function(e){if(!m(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t,n,r=(n=(t=e)&&t.constructor,t===("function"==typeof n&&n.prototype||i)),o=[];for(var a in e)("constructor"!=a||!r&&s.call(e,a))&&o.push(a);return o}(e)}(t),e,r)},h((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,s=r>2?t[2]:void 0;for(i=v.length>3&&"function"==typeof i?(r--,i):void 0,s&&function(e,t,n){if(!m(n))return!1;var r=typeof t;return!!("number"==r?p(n)&&d(t,n.length):"string"==r&&t in n)&&f(n[t],e)}(t[0],t[1],s)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var o=t[n];o&&v(e,o,0,i)}return e}))),y=h((function(e){return e.push(void 0,u),r(b,void 0,e)}));e.exports=y},6427:e=>{var t="__lodash_hash_undefined__",n=9007199254740991,r=/^\[object .+?Constructor\]$/,i=/^(?:0|[1-9]\d*)$/,s="object"==typeof global&&global&&global.Object===Object&&global,o="object"==typeof self&&self&&self.Object===Object&&self,a=s||o||Function("return this")();function l(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function u(e,t){return!(!e||!e.length)&&function(e,t,n){if(t!=t)return function(e,t,n,r){for(var i=e.length,s=-1;++s<i;)if(t(e[s],s,e))return s;return-1}(e,d);for(var r=-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t)>-1}function c(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function h(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function d(e){return e!=e}function f(e,t){return e.has(t)}function g(e,t){return function(n){return e(t(n))}}var p,m=Array.prototype,v=Function.prototype,b=Object.prototype,y=a["__core-js_shared__"],w=(p=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",E=v.toString,_=b.hasOwnProperty,x=b.toString,C=RegExp("^"+E.call(_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=a.Symbol,S=g(Object.getPrototypeOf,Object),D=b.propertyIsEnumerable,T=m.splice,A=M?M.isConcatSpreadable:void 0,k=Object.getOwnPropertySymbols,F=Math.max,O=q(a,"Map"),j=q(Object,"create");function B(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function I(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function P(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=e?e.length:0;for(this.__data__=new P;++t<n;)this.add(e[t])}function L(e,t){for(var n,r,i=e.length;i--;)if((n=e[i][0])===(r=t)||n!=n&&r!=r)return i;return-1}function R(e,t,n,r,i){var s=-1,o=e.length;for(n||(n=H),i||(i=[]);++s<o;){var a=e[s];t>0&&n(a)?t>1?R(a,t-1,n,r,i):h(i,a):r||(i[i.length]=a)}return i}function N(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!X(e)||(t=e,w&&w in t))&&(J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?C:r).test(function(e){if(null!=e){try{return E.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0}B.prototype.clear=function(){this.__data__=j?j(null):{}},B.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},B.prototype.get=function(e){var n=this.__data__;if(j){var r=n[e];return r===t?void 0:r}return _.call(n,e)?n[e]:void 0},B.prototype.has=function(e){var t=this.__data__;return j?void 0!==t[e]:_.call(t,e)},B.prototype.set=function(e,n){return this.__data__[e]=j&&void 0===n?t:n,this},I.prototype.clear=function(){this.__data__=[]},I.prototype.delete=function(e){var t=this.__data__,n=L(t,e);return!(n<0||(n==t.length-1?t.pop():T.call(t,n,1),0))},I.prototype.get=function(e){var t=this.__data__,n=L(t,e);return n<0?void 0:t[n][1]},I.prototype.has=function(e){return L(this.__data__,e)>-1},I.prototype.set=function(e,t){var n=this.__data__,r=L(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},P.prototype.clear=function(){this.__data__={hash:new B,map:new(O||I),string:new B}},P.prototype.delete=function(e){return N(this,e).delete(e)},P.prototype.get=function(e){return N(this,e).get(e)},P.prototype.has=function(e){return N(this,e).has(e)},P.prototype.set=function(e,t){return N(this,e).set(e,t),this},$.prototype.add=$.prototype.push=function(e){return this.__data__.set(e,t),this},$.prototype.has=function(e){return this.__data__.has(e)};var U=k?g(k,Object):re,W=k?function(e){for(var t=[];e;)h(t,U(e)),e=S(e);return t}:re;function H(e){return Y(e)||G(e)||!!(A&&e&&e[A])}function V(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&e<t}function z(e){if("string"==typeof e||function(e){return"symbol"==typeof e||Z(e)&&"[object Symbol]"==x.call(e)}(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function G(e){return function(e){return Z(e)&&K(e)}(e)&&_.call(e,"callee")&&(!D.call(e,"callee")||"[object Arguments]"==x.call(e))}var Y=Array.isArray;function K(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!J(e)}function J(e){var t=X(e)?x.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function Q(e){return K(e)?function(e,t){var n=Y(e)||G(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var s in e)!t&&!_.call(e,s)||i&&("length"==s||V(s,r))||n.push(s);return n}(e,!0):function(e){if(!X(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t,n,r=(n=(t=e)&&t.constructor,t===("function"==typeof n&&n.prototype||b)),i=[];for(var s in e)("constructor"!=s||!r&&_.call(e,s))&&i.push(s);return i}(e)}var ee,te,ne=(ee=function(e,t){return null==e?{}:(t=c(R(t,1),z),function(e,t){return function(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var o=t[r],a=e[o];n(0,o)&&(s[o]=a)}return s}(e=Object(e),t,(function(t,n){return n in e}))}(e,function(e,t,n,r){var i=-1,s=u,o=!0,a=e.length,l=[],c=t.length;if(!a)return l;t.length>=200&&(s=f,o=!1,t=new $(t));e:for(;++i<a;){var h=e[i],d=h;if(h=0!==h?h:0,o&&d==d){for(var g=c;g--;)if(t[g]===d)continue e;l.push(h)}else s(t,d,r)||l.push(h)}return l}(function(e){return function(e,t,n){var r=t(e);return Y(e)?r:h(r,n(e))}(e,Q,W)}(e),t)))},te=F(void 0===te?ee.length-1:te,0),function(){for(var e=arguments,t=-1,n=F(e.length-te,0),r=Array(n);++t<n;)r[t]=e[te+t];t=-1;for(var i=Array(te+1);++t<te;)i[t]=e[t];return i[te]=r,l(ee,this,i)});function re(){return[]}e.exports=ne},2705:(e,t,n)=>{var r=n(5639).Symbol;e.exports=r},4636:(e,t,n)=>{var r=n(2545),i=n(5694),s=n(1469),o=n(4144),a=n(5776),l=n(6719),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=s(e),c=!n&&i(e),h=!n&&!c&&o(e),d=!n&&!c&&!h&&l(e),f=n||c||h||d,g=f?r(e.length,String):[],p=g.length;for(var m in e)!t&&!u.call(e,m)||f&&("length"==m||h&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,p))||g.push(m);return g}},4239:(e,t,n)=>{var r=n(2705),i=n(9607),s=n(2333),o=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):s(e)}},9454:(e,t,n)=>{var r=n(4239),i=n(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},8749:(e,t,n)=>{var r=n(4239),i=n(1780),s=n(7005),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return s(e)&&i(e.length)&&!!o[r(e)]}},280:(e,t,n)=>{var r=n(5726),i=n(6916),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))s.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2545:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},7518:e=>{e.exports=function(e){return function(t){return e(t)}}},1957:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},9607:(e,t,n)=>{var r=n(2705),i=Object.prototype,s=i.hasOwnProperty,o=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=o.call(e);return r&&(t?e[a]=n:delete e[a]),i}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},5726:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},6916:(e,t,n)=>{var r=n(5569)(Object.keys,Object);e.exports=r},1167:(e,t,n)=>{e=n.nmd(e);var r=n(1957),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,o=s&&s.exports===i&&r.process,a=function(){try{return s&&s.require&&s.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},5639:(e,t,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,s=r||i||Function("return this")();e.exports=s},5694:(e,t,n)=>{var r=n(9454),i=n(7005),s=Object.prototype,o=s.hasOwnProperty,a=s.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&o.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,n)=>{var r=n(3560),i=n(1780);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},4144:(e,t,n)=>{e=n.nmd(e);var r=n(5639),i=n(5062),s=t&&!t.nodeType&&t,o=s&&e&&!e.nodeType&&e,a=o&&o.exports===s?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||i;e.exports=l},3560:(e,t,n)=>{var r=n(4239),i=n(3218);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},6719:(e,t,n)=>{var r=n(8749),i=n(7518),s=n(1167),o=s&&s.isTypedArray,a=o?i(o):r;e.exports=a},3674:(e,t,n)=>{var r=n(4636),i=n(280),s=n(8612);e.exports=function(e){return s(e)?r(e):i(e)}},308:e=>{e.exports=function(){}},5062:e=>{e.exports=function(){return!1}},6281:(e,t,n)=>{"use strict";const r=n(9235);e.exports=r((e=>(e.message=`\t${e.message}`,e)))},8650:(e,t,n)=>{"use strict";const r=t.format=n(9235);t.levels=n(7823),Object.defineProperty(r,"align",{value:n(6281)}),Object.defineProperty(r,"cli",{value:n(153)}),Object.defineProperty(r,"combine",{value:n(2390)}),Object.defineProperty(r,"colorize",{value:n(8580)}),Object.defineProperty(r,"json",{value:n(3922)}),Object.defineProperty(r,"label",{value:n(3084)}),Object.defineProperty(r,"logstash",{value:n(3388)}),Object.defineProperty(r,"metadata",{value:n(2523)}),Object.defineProperty(r,"padLevels",{value:n(6566)}),Object.defineProperty(r,"prettyPrint",{value:n(5894)}),Object.defineProperty(r,"printf",{value:n(8242)}),Object.defineProperty(r,"simple",{value:n(459)}),Object.defineProperty(r,"splat",{value:n(8102)}),Object.defineProperty(r,"timestamp",{value:n(6645)}),Object.defineProperty(r,"uncolorize",{value:n(9095)})},153:(e,t,n)=>{"use strict";const{Colorizer:r}=n(8580),{Padder:i}=n(6566),{configs:s,MESSAGE:o}=n(5396);class a{constructor(e={}){e.levels||(e.levels=s.npm.levels),this.colorizer=new r(e),this.padder=new i(e),this.options=e}transform(e,t){return this.colorizer.transform(this.padder.transform(e,t),t),e[o]=`${e.level}:${e.message}`,e}}e.exports=e=>new a(e),e.exports.Format=a},8580:(e,t,n)=>{"use strict";const r=n(4431),{LEVEL:i,MESSAGE:s}=n(5396);r.enabled=!0;const o=/\s+/;class a{constructor(e={}){e.colors&&this.addColors(e.colors),this.options=e}static addColors(e){const t=Object.keys(e).reduce(((t,n)=>(t[n]=o.test(e[n])?e[n].split(o):e[n],t)),{});return a.allColors=Object.assign({},a.allColors||{},t),a.allColors}addColors(e){return a.addColors(e)}colorize(e,t,n){if(void 0===n&&(n=t),!Array.isArray(a.allColors[e]))return r[a.allColors[e]](n);for(let t=0,i=a.allColors[e].length;t<i;t++)n=r[a.allColors[e][t]](n);return n}transform(e,t){return t.all&&"string"==typeof e[s]&&(e[s]=this.colorize(e[i],e.level,e[s])),(t.level||t.all||!t.message)&&(e.level=this.colorize(e[i],e.level)),(t.all||t.message)&&(e.message=this.colorize(e[i],e.level,e.message)),e}}e.exports=e=>new a(e),e.exports.Colorizer=e.exports.Format=a},2390:(e,t,n)=>{"use strict";const r=n(9235);function i(e){if(e.every(s))return t=>{let n=t;for(let t=0;t<e.length;t++)if(n=e[t].transform(n,e[t].options),!n)return!1;return n}}function s(e){if("function"!=typeof e.transform)throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join("\n"));return!0}e.exports=(...e)=>{const t=r(i(e)),n=t();return n.Format=t.Format,n},e.exports.cascade=i},6894:(e,t,n)=>{"use strict";var r=n(8287);e.exports=r((function(e){return e.message="\t".concat(e.message),e}))},6850:(e,t,n)=>{"use strict";var r=t.format=n(8287);t.levels=n(7371),Object.defineProperty(r,"align",{value:n(6894)}),Object.defineProperty(r,"cli",{value:n(9008)}),Object.defineProperty(r,"combine",{value:n(1145)}),Object.defineProperty(r,"colorize",{value:n(2046)}),Object.defineProperty(r,"json",{value:n(3048)}),Object.defineProperty(r,"label",{value:n(4403)}),Object.defineProperty(r,"logstash",{value:n(9660)}),Object.defineProperty(r,"metadata",{value:n(2883)}),Object.defineProperty(r,"padLevels",{value:n(2886)}),Object.defineProperty(r,"prettyPrint",{value:n(8703)}),Object.defineProperty(r,"printf",{value:n(2361)}),Object.defineProperty(r,"simple",{value:n(2167)}),Object.defineProperty(r,"splat",{value:n(7729)}),Object.defineProperty(r,"timestamp",{value:n(7271)}),Object.defineProperty(r,"uncolorize",{value:n(9729)})},9008:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=n(2046).Colorizer,o=n(2886).Padder,a=n(5396),l=a.configs,u=a.MESSAGE,c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),t.levels||(t.levels=l.npm.levels),this.colorizer=new s(t),this.padder=new o(t),this.options=t}var t,n;return t=e,(n=[{key:"transform",value:function(e,t){return this.colorizer.transform(this.padder.transform(e,t),t),e[u]="".concat(e.level,":").concat(e.message),e}}])&&i(t.prototype,n),e}();e.exports=function(e){return new c(e)},e.exports.Format=c},2046:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=n(4431),o=n(5396),a=o.LEVEL,l=o.MESSAGE;s.enabled=!0;var u=/\s+/,c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),t.colors&&this.addColors(t.colors),this.options=t}var t,n,o;return t=e,o=[{key:"addColors",value:function(t){var n=Object.keys(t).reduce((function(e,n){return e[n]=u.test(t[n])?t[n].split(u):t[n],e}),{});return e.allColors=Object.assign({},e.allColors||{},n),e.allColors}}],(n=[{key:"addColors",value:function(t){return e.addColors(t)}},{key:"colorize",value:function(t,n,r){if(void 0===r&&(r=n),!Array.isArray(e.allColors[t]))return s[e.allColors[t]](r);for(var i=0,o=e.allColors[t].length;i<o;i++)r=s[e.allColors[t][i]](r);return r}},{key:"transform",value:function(e,t){return t.all&&"string"==typeof e[l]&&(e[l]=this.colorize(e[a],e.level,e[l])),(t.level||t.all||!t.message)&&(e.level=this.colorize(e[a],e.level)),(t.all||t.message)&&(e.message=this.colorize(e[a],e.level,e.message)),e}}])&&i(t.prototype,n),o&&i(t,o),e}();e.exports=function(e){return new c(e)},e.exports.Colorizer=e.exports.Format=c},1145:(e,t,n)=>{"use strict";var r=n(8287);function i(e){if(e.every(s))return function(t){for(var n=t,r=0;r<e.length;r++)if(!(n=e[r].transform(n,e[r].options)))return!1;return n}}function s(e){if("function"!=typeof e.transform)throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join("\n"));return!0}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var s=r(i(t)),o=s();return o.Format=s.Format,o},e.exports.cascade=i},2657:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(8287),s=n(5396),o=s.LEVEL,a=s.MESSAGE;e.exports=i((function(e,t){var n=t.stack;if(e instanceof Error){var i,s=Object.assign({},e,(r(i={level:e.level},o,e[o]||e.level),r(i,"message",e.message),r(i,a,e[a]||e.message),i));return n&&(s.stack=e.stack),s}if(!(e.message instanceof Error))return e;Object.assign(e,e.message);var l=e.message;return e.message=l.message,e[a]=l.message,n&&(e.stack=l.stack),e}))},8287:e=>{"use strict";function t(e){return(t="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})(e)}function n(e,n){return!n||"object"!==t(n)&&"function"!=typeof n?r(e):n}function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,l(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a(r,e)})(e)}function s(e,t,n){return(s=o()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&a(i,n.prototype),i}).apply(null,arguments)}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(u,e);var t,i,s=(t=u,i=o(),function(){var e,r=l(t);if(i){var s=l(this).constructor;e=Reflect.construct(r,arguments,s)}else e=r.apply(this,arguments);return n(this,e)});function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),t=s.call(this,"Format functions must be synchronous taking a two arguments: (info, opts)\nFound: ".concat(e.toString().split("\n")[0],"\n")),Error.captureStackTrace(r(t),u),t}return u}(i(Error));e.exports=function(e){if(e.length>2)throw new u(e);function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e}function n(e){return new t(e)}return t.prototype.transform=e,n.Format=t,n}},6941:(e,t,n)=>{"use strict";var r=t.format=n(8287);function i(e,t){t=t||e,Object.defineProperty(r,e,{get:function(){return n(5378)("./".concat(t,".js"))},configurable:!0})}t.levels=n(7371),i("align"),i("errors"),i("cli"),i("combine"),i("colorize"),i("json"),i("label"),i("logstash"),i("metadata"),i("ms"),i("padLevels","pad-levels"),i("prettyPrint","pretty-print"),i("printf"),i("simple"),i("splat"),i("timestamp"),i("uncolorize")},3048:(e,t,n)=>{"use strict";var r=n(8287),i=n(5396).MESSAGE,s=n(4445);function o(e,t){return t instanceof Buffer?t.toString("base64"):"bigint"==typeof t?t.toString():t}e.exports=r((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e[i]=(t.stable?s.stableStringify:s)(e,t.replacer||o,t.space),e}))},4403:(e,t,n)=>{"use strict";var r=n(8287);e.exports=r((function(e,t){return t.message?(e.message="[".concat(t.label,"] ").concat(e.message),e):(e.label=t.label,e)}))},7371:(e,t,n)=>{"use strict";var r=n(2046).Colorizer;e.exports=function(e){return r.addColors(e.colors||e),e}},9660:(e,t,n)=>{"use strict";var r=n(8287),i=n(5396).MESSAGE,s=n(4445);e.exports=r((function(e){var t={};return e.message&&(t["@message"]=e.message,delete e.message),e.timestamp&&(t["@timestamp"]=e.timestamp,delete e.timestamp),t["@fields"]=e,e[i]=s(t),e}))},2883:(e,t,n)=>{"use strict";var r=n(8287);function i(e,t,n){var r,i,s,o=t.reduce((function(t,n){return t[n]=e[n],delete e[n],t}),{}),a=Object.keys(e).reduce((function(t,n){return t[n]=e[n],delete e[n],t}),{});return Object.assign(e,o,(s=a,(i=n)in(r={})?Object.defineProperty(r,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[i]=s,r)),e}function s(e,t,n){return e[n]=t.reduce((function(t,n){return t[n]=e[n],delete e[n],t}),{}),e}e.exports=r((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="metadata";t.key&&(n=t.key);var r=[];return t.fillExcept||t.fillWith||(r.push("level"),r.push("message")),t.fillExcept&&(r=t.fillExcept),r.length>0?i(e,r,n):t.fillWith?s(e,t.fillWith,n):e}))},3584:(e,t,n)=>{"use strict";var r=void 0,i=n(8287),s=n(7824);e.exports=i((function(e){var t=+new Date;return r.diff=t-(r.prevTime||t),r.prevTime=t,e.ms="+".concat(s(r.diff)),e}))},2886:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=n(5396),a=o.configs,l=o.LEVEL,u=o.MESSAGE,c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{levels:a.npm.levels};i(this,e),this.paddings=e.paddingForLevels(t.levels,t.filler),this.options=t}var t,n,o;return t=e,o=[{key:"getLongestLevel",value:function(e){var t,n=Object.keys(e).map((function(e){return e.length}));return Math.max.apply(Math,function(e){if(Array.isArray(e))return r(e)}(t=n)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}},{key:"paddingForLevel",value:function(e,t,n){var r=n+1-e.length,i=Math.floor(r/t.length);return"".concat(t).concat(t.repeat(i)).slice(0,r)}},{key:"paddingForLevels",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=e.getLongestLevel(t);return Object.keys(t).reduce((function(t,i){return t[i]=e.paddingForLevel(i,n,r),t}),{})}}],(n=[{key:"transform",value:function(e,t){return e.message="".concat(this.paddings[e[l]]).concat(e.message),e[u]&&(e[u]="".concat(this.paddings[e[l]]).concat(e[u])),e}}])&&s(t.prototype,n),o&&s(t,o),e}();e.exports=function(e){return new c(e)},e.exports.Padder=e.exports.Format=c},8703:(e,t,n)=>{"use strict";var r=n(1669).inspect,i=n(8287),s=n(5396),o=s.LEVEL,a=s.MESSAGE,l=s.SPLAT;e.exports=i((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},e);return delete n[o],delete n[a],delete n[l],e[a]=r(n,!1,t.depth||null,t.colorize),e}))},2361:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=n(5396).MESSAGE,s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.template=t}var t,n;return t=e,(n=[{key:"transform",value:function(e){return e[i]=this.template(e),e}}])&&r(t.prototype,n),e}();e.exports=function(e){return new s(e)},e.exports.Printf=e.exports.Format=s},2167:(e,t,n)=>{"use strict";var r=n(8287),i=n(5396).MESSAGE,s=n(4445);e.exports=r((function(e){var t=s(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),n=e.padding&&e.padding[e.level]||"";return e[i]="{}"!==t?"".concat(e.level,":").concat(n," ").concat(e.message," ").concat(t):"".concat(e.level,":").concat(n," ").concat(e.message),e}))},7729:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=n(1669),o=n(5396).SPLAT,a=/%[scdjifoO%]/g,l=/%%/g,u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t}var t,n;return t=e,(n=[{key:"_splat",value:function(e,t){var n,i=e.message,a=e[o]||e.splat||[],u=i.match(l),c=u&&u.length||0,h=t.length-c-a.length,d=h<0?a.splice(h,-1*h):[],f=d.length;if(f)for(var g=0;g<f;g++)Object.assign(e,d[g]);return e.message=s.format.apply(s,[i].concat(function(e){if(Array.isArray(e))return r(e)}(n=a)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),e}},{key:"transform",value:function(e){var t=e.message,n=e[o]||e.splat;if(!n||!n.length)return e;var r=t&&t.match&&t.match(a);if(!r&&(n||n.length)){var i=n.length>1?n.splice(0):n,s=i.length;if(s)for(var l=0;l<s;l++)Object.assign(e,i[l]);return e}return r?this._splat(e,r):e}}])&&i(t.prototype,n),e}();e.exports=function(e){return new u(e)}},7271:(e,t,n)=>{"use strict";var r=n(9432),i=n(8287);e.exports=i((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.format&&(e.timestamp="function"==typeof t.format?t.format():r.format(new Date,t.format)),e.timestamp||(e.timestamp=(new Date).toISOString()),t.alias&&(e[t.alias]=e.timestamp),e}))},9729:(e,t,n)=>{"use strict";var r=n(4431),i=n(8287),s=n(5396).MESSAGE;e.exports=i((function(e,t){return!1!==t.level&&(e.level=r.strip(e.level)),!1!==t.message&&(e.message=r.strip(e.message)),!1!==t.raw&&e[s]&&(e[s]=r.strip(e[s])),e}))},5378:(e,t,n)=>{var r={"./align.js":6894,"./browser.js":6850,"./cli.js":9008,"./colorize.js":2046,"./combine.js":1145,"./errors.js":2657,"./format.js":8287,"./index.js":6941,"./json.js":3048,"./label.js":4403,"./levels.js":7371,"./logstash.js":9660,"./metadata.js":2883,"./ms.js":3584,"./pad-levels.js":2886,"./pretty-print.js":8703,"./printf.js":2361,"./simple.js":2167,"./splat.js":7729,"./timestamp.js":7271,"./uncolorize.js":9729};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=5378},1648:(e,t,n)=>{"use strict";const r=n(9235),{LEVEL:i,MESSAGE:s}=n(5396);e.exports=r(((e,{stack:t})=>{if(e instanceof Error){const n=Object.assign({},e,{level:e.level,[i]:e[i]||e.level,message:e.message,[s]:e[s]||e.message});return t&&(n.stack=e.stack),n}if(!(e.message instanceof Error))return e;Object.assign(e,e.message);const n=e.message;return e.message=n.message,e[s]=n.message,t&&(e.stack=n.stack),e}))},1831:(e,t,n)=>{const{format:r}=n(562),{combine:i,timestamp:s,label:o}=r,a=i(o({label:"right meow!"}),s()).transform({level:"info",message:"What time is the testing at?"});console.dir(a)},6803:(e,t,n)=>{const{format:r}=n(562),{combine:i,timestamp:s,label:o}=r,a=r(((e,t)=>!e.private&&e))();console.dir(a.transform({level:"error",message:"Public error to share"})),console.dir(a.transform({level:"error",private:!0,message:"This is super secret - hide it."}));const l=r.combine(r((e=>!1))(),r((e=>{throw new Error("Never reached")}))());console.dir(l.transform({level:"info",message:"wow such testing"}))},1645:(e,t,n)=>{const{format:r}=n(562);r((function(e,t,n,r){return e}))},8010:(e,t,n)=>{const{format:r}=n(562),{combine:i,json:s,metadata:o,timestamp:a}=r,l=i(a(),o(),s()).transform({level:"info",message:"This should be a message.",application:"Microsoft Office",store:"Big Box Store",purchaseAmount:"9.99"});console.dir(l);const u=i(a(),o({fillExcept:["message","level","timestamp"]}),s()).transform({level:"info",message:"This should have attached metadata",category:"movies",subCategory:"action"});console.dir(u);const c=i(a(),o({fillWith:["publisher","author","book"],key:"bookInfo"}),s()).transform({level:"debug",message:"This message should be outside of the bookInfo object",publisher:"Lorem Press",author:"Albert Einstein",book:"4D Chess for Dummies",label:"myCustomLabel"});console.dir(c);const h=i(a(),o({fillWith:["publisher","author","book"],key:"bookInfo"}),o({fillWith:["purchasePrice","purchaseDate","transactionId"],key:"transactionInfo"}),o({fillExcept:["level","message","label","timestamp"]}),s()).transform({level:"debug",message:"This message should be outside of the bookInfo object",publisher:"Lorem Press",author:"Albert Einstein",book:"4D Chess for Dummies",label:"myCustomLabel",purchasePrice:"9.99",purchaseDate:"2.10.2018",transactionId:"123ABC"});console.dir(h)},7836:(e,t,n)=>{const{format:r}=n(562),{combine:i,padLevels:s,simple:o}=r,{MESSAGE:a}=n(5396),l=i(s({levels:{error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6}}),o()),u=l.transform({level:"info",message:"This is an info level message."}),c=l.transform({level:"error",message:"This is an error level message."}),h=l.transform({level:"verbose",message:"This is a verbose level message."});console.dir(u[a]),console.dir(c[a]),console.dir(h[a])},317:(e,t,n)=>{const{format:r}=n(562),i=r(((e,t)=>(t.yell?e.message=e.message.toUpperCase():t.whisper&&(e.message=e.message.toLowerCase()),e))),s=i({yell:!0});console.dir(s.transform({level:"info",message:"sorry for making you YELL in your head!"},s.options));const o=i({whisper:!0});console.dir(o.transform({level:"info",message:"WHY ARE THEY MAKING US YELL SO MUCH!"},o.options))},9235:e=>{"use strict";class t extends Error{constructor(e){super(`Format functions must be synchronous taking a two arguments: (info, opts)\nFound: ${e.toString().split("\n")[0]}\n`),Error.captureStackTrace(this,t)}}e.exports=e=>{if(e.length>2)throw new t(e);function n(e={}){this.options=e}function r(e){return new n(e)}return n.prototype.transform=e,r.Format=n,r}},562:(e,t,n)=>{"use strict";const r=t.format=n(9235);function i(e,t){t=t||e,Object.defineProperty(r,e,{get:()=>n(6835)(`./${t}.js`),configurable:!0})}t.levels=n(7823),i("align"),i("errors"),i("cli"),i("combine"),i("colorize"),i("json"),i("label"),i("logstash"),i("metadata"),i("ms"),i("padLevels","pad-levels"),i("prettyPrint","pretty-print"),i("printf"),i("simple"),i("splat"),i("timestamp"),i("uncolorize")},3922:(e,t,n)=>{"use strict";const r=n(9235),{MESSAGE:i}=n(5396),s=n(4445);function o(e,t){return t instanceof Buffer?t.toString("base64"):"bigint"==typeof t?t.toString():t}e.exports=r(((e,t={})=>(e[i]=(t.stable?s.stableStringify:s)(e,t.replacer||o,t.space),e)))},3084:(e,t,n)=>{"use strict";const r=n(9235);e.exports=r(((e,t)=>t.message?(e.message=`[${t.label}] ${e.message}`,e):(e.label=t.label,e)))},7823:(e,t,n)=>{"use strict";const{Colorizer:r}=n(8580);e.exports=e=>(r.addColors(e.colors||e),e)},3388:(e,t,n)=>{"use strict";const r=n(9235),{MESSAGE:i}=n(5396),s=n(4445);e.exports=r((e=>{const t={};return e.message&&(t["@message"]=e.message,delete e.message),e.timestamp&&(t["@timestamp"]=e.timestamp,delete e.timestamp),t["@fields"]=e,e[i]=s(t),e}))},2523:(e,t,n)=>{"use strict";const r=n(9235);e.exports=r(((e,t={})=>{let n="metadata";t.key&&(n=t.key);let r=[];return t.fillExcept||t.fillWith||(r.push("level"),r.push("message")),t.fillExcept&&(r=t.fillExcept),r.length>0?function(e,t,n){const r=t.reduce(((t,n)=>(t[n]=e[n],delete e[n],t)),{}),i=Object.keys(e).reduce(((t,n)=>(t[n]=e[n],delete e[n],t)),{});return Object.assign(e,r,{[n]:i}),e}(e,r,n):t.fillWith?function(e,t,n){return e[n]=t.reduce(((t,n)=>(t[n]=e[n],delete e[n],t)),{}),e}(e,t.fillWith,n):e}))},7560:function(e,t,n){"use strict";const r=n(9235),i=n(7824);e.exports=r((e=>{const t=+new Date;return this.diff=t-(this.prevTime||t),this.prevTime=t,e.ms=`+${i(this.diff)}`,e}))},6566:(e,t,n)=>{"use strict";const{configs:r,LEVEL:i,MESSAGE:s}=n(5396);class o{constructor(e={levels:r.npm.levels}){this.paddings=o.paddingForLevels(e.levels,e.filler),this.options=e}static getLongestLevel(e){const t=Object.keys(e).map((e=>e.length));return Math.max(...t)}static paddingForLevel(e,t,n){const r=n+1-e.length,i=Math.floor(r/t.length);return`${t}${t.repeat(i)}`.slice(0,r)}static paddingForLevels(e,t=" "){const n=o.getLongestLevel(e);return Object.keys(e).reduce(((e,r)=>(e[r]=o.paddingForLevel(r,t,n),e)),{})}transform(e,t){return e.message=`${this.paddings[e[i]]}${e.message}`,e[s]&&(e[s]=`${this.paddings[e[i]]}${e[s]}`),e}}e.exports=e=>new o(e),e.exports.Padder=e.exports.Format=o},5894:(e,t,n)=>{"use strict";const r=n(1669).inspect,i=n(9235),{LEVEL:s,MESSAGE:o,SPLAT:a}=n(5396);e.exports=i(((e,t={})=>{const n=Object.assign({},e);return delete n[s],delete n[o],delete n[a],e[o]=r(n,!1,t.depth||null,t.colorize),e}))},8242:(e,t,n)=>{"use strict";const{MESSAGE:r}=n(5396);class i{constructor(e){this.template=e}transform(e){return e[r]=this.template(e),e}}e.exports=e=>new i(e),e.exports.Printf=e.exports.Format=i},459:(e,t,n)=>{"use strict";const r=n(9235),{MESSAGE:i}=n(5396),s=n(4445);e.exports=r((e=>{const t=s(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),n=e.padding&&e.padding[e.level]||"";return e[i]="{}"!==t?`${e.level}:${n} ${e.message} ${t}`:`${e.level}:${n} ${e.message}`,e}))},8102:(e,t,n)=>{"use strict";const r=n(1669),{SPLAT:i}=n(5396),s=/%[scdjifoO%]/g,o=/%%/g;class a{constructor(e){this.options=e}_splat(e,t){const n=e.message,s=e[i]||e.splat||[],a=n.match(o),l=a&&a.length||0,u=t.length-l-s.length,c=u<0?s.splice(u,-1*u):[],h=c.length;if(h)for(let t=0;t<h;t++)Object.assign(e,c[t]);return e.message=r.format(n,...s),e}transform(e){const t=e.message,n=e[i]||e.splat;if(!n||!n.length)return e;const r=t&&t.match&&t.match(s);if(!r&&(n||n.length)){const t=n.length>1?n.splice(0):n,r=t.length;if(r)for(let n=0;n<r;n++)Object.assign(e,t[n]);return e}return r?this._splat(e,r):e}}e.exports=e=>new a(e)},6645:(e,t,n)=>{"use strict";const r=n(9432),i=n(9235);e.exports=i(((e,t={})=>(t.format&&(e.timestamp="function"==typeof t.format?t.format():r.format(new Date,t.format)),e.timestamp||(e.timestamp=(new Date).toISOString()),t.alias&&(e[t.alias]=e.timestamp),e)))},9095:(e,t,n)=>{"use strict";const r=n(4431),i=n(9235),{MESSAGE:s}=n(5396);e.exports=i(((e,t)=>(!1!==t.level&&(e.level=r.strip(e.level)),!1!==t.message&&(e.message=r.strip(e.message)),!1!==t.raw&&e[s]&&(e[s]=r.strip(e[s])),e)))},6835:(e,t,n)=>{var r={"./align.js":6281,"./browser.js":8650,"./cli.js":153,"./colorize.js":8580,"./combine.js":2390,"./dist/align.js":6894,"./dist/browser.js":6850,"./dist/cli.js":9008,"./dist/colorize.js":2046,"./dist/combine.js":1145,"./dist/errors.js":2657,"./dist/format.js":8287,"./dist/index.js":6941,"./dist/json.js":3048,"./dist/label.js":4403,"./dist/levels.js":7371,"./dist/logstash.js":9660,"./dist/metadata.js":2883,"./dist/ms.js":3584,"./dist/pad-levels.js":2886,"./dist/pretty-print.js":8703,"./dist/printf.js":2361,"./dist/simple.js":2167,"./dist/splat.js":7729,"./dist/timestamp.js":7271,"./dist/uncolorize.js":9729,"./errors.js":1648,"./examples/combine.js":1831,"./examples/filter.js":6803,"./examples/invalid.js":1645,"./examples/metadata.js":8010,"./examples/padLevels.js":7836,"./examples/volume.js":317,"./format.js":9235,"./index.js":562,"./json.js":3922,"./label.js":3084,"./levels.js":7823,"./logstash.js":3388,"./metadata.js":2523,"./ms.js":7560,"./pad-levels.js":6566,"./pretty-print.js":5894,"./printf.js":8242,"./simple.js":459,"./splat.js":8102,"./timestamp.js":6645,"./uncolorize.js":9095};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=6835},7824:e=>{var t=1e3,n=60*t,r=60*n,i=24*r;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,o){o=o||{};var a,l,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*r;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(e);if("number"===u&&isFinite(e))return o.long?(a=e,(l=Math.abs(a))>=i?s(a,l,i,"day"):l>=r?s(a,l,r,"hour"):l>=n?s(a,l,n,"minute"):l>=t?s(a,l,t,"second"):a+" ms"):function(e){var s=Math.abs(e);return s>=i?Math.round(e/i)+"d":s>=r?Math.round(e/r)+"h":s>=n?Math.round(e/n)+"m":s>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},3437:function(e,t,n){"use strict";var r,i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const s=n(8614),o=Symbol("DO_REQUEST");class a extends s.EventEmitter{constructor({transport:e,data:t,logger:i,metadata:s,client:o}){super(),this[r]=(e,t=[])=>new Promise(((n,r)=>{this.transport.request(e,t,((t,i)=>{this.logger.debug(`response -> neovim.api.${e}: ${i}`),t?r(new Error(`${e}: ${t[1]}`)):n(i)}))})),this.setTransport(e),this.data=t,this.logger=i||n(311).logger,this.client=o,s&&Object.defineProperty(this,"metadata",{value:s})}setTransport(e){this.transport=e}equals(e){try{return String(this.data)===String(e.data)}catch(e){return!1}}asyncRequest(e,t=[],n){return i(this,void 0,void 0,(function*(){return yield this._isReady,this.logger.debug(`request -> neovim.api.${e}`),this[o](e,t).catch((t=>{const r=new Error(t.message);throw r.stack=n,this.logger.error(`Error making request to ${e}`,r),r}))}))}request(e,t=[]){const n=new Error(`Error making request to ${e}`);return this.asyncRequest(e,t,n.stack)}_getArgsByPrefix(...e){const t=[];return"nvim_"!==this.prefix&&t.push(this),t.concat(e)}getVar(e){return i(this,void 0,void 0,(function*(){const t=this._getArgsByPrefix(e);return this.request(`${this.prefix}get_var`,t).then((e=>e),(e=>{if(e&&e.message&&e.message.includes("not found"))return null;throw e}))}))}setVar(e,t){const n=this._getArgsByPrefix(e,t);return this.request(`${this.prefix}set_var`,n)}deleteVar(e){const t=this._getArgsByPrefix(e);return this.request(`${this.prefix}del_var`,t)}getOption(e){const t=this._getArgsByPrefix(e);return this.request(`${this.prefix}get_option`,t)}setOption(e,t){const n=this._getArgsByPrefix(e,t);return this.request(`${this.prefix}set_option`,n)}notify(e,t){this.logger.debug(`notify -> neovim.api.${e}`),this.transport.notify(e,t)}}t.BaseApi=a,r=o},1810:function(e,t,n){"use strict";var r,i,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=n(3437),a=n(94);t.DETACH=Symbol("detachBuffer"),t.ATTACH=Symbol("attachBuffer");class l extends o.BaseApi{constructor(){super(...arguments),this.prefix=a.Metadata[a.ExtType.Buffer].prefix,this[r]=(e=!1,t={})=>s(this,void 0,void 0,(function*(){return!!this.client.isAttached(this)||this.request(`${this.prefix}attach`,[this,e,t])})),this[i]=()=>this.request(`${this.prefix}detach`,[this])}get isAttached(){return this.client.isAttached(this)}get id(){return this.data}get length(){return this.request(`${this.prefix}line_count`,[this])}get lines(){return this.getLines()}get changedtick(){return this.request(`${this.prefix}get_changedtick`,[this])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[this,e])}getLines({start:e,end:t,strictIndexing:n}={start:0,end:-1,strictIndexing:!0}){const r=void 0===n||n;return this.request(`${this.prefix}get_lines`,[this,e,t,r])}setLines(e,{start:t,end:n,strictIndexing:r}={strictIndexing:!0}){const i=void 0===r||r,s="string"==typeof e?[e]:e,o=void 0!==n?n:t+1;return this.request(`${this.prefix}set_lines`,[this,t,o,i,s])}insert(e,t){return this.setLines(e,{start:t,end:t,strictIndexing:!0})}replace(e,t){const n="string"==typeof e?[e]:e;return this.setLines(n,{start:t,end:t+n.length,strictIndexing:!1})}remove(e,t,n){return this.setLines([],{start:e,end:t,strictIndexing:n})}append(e){return this.setLines(e,{start:-1,end:-1,strictIndexing:!1})}get name(){return this.request(`${this.prefix}get_name`,[this])}set name(e){this.request(`${this.prefix}set_name`,[this,e])}get valid(){return this.request(`${this.prefix}is_valid`,[this])}mark(e){return this.request(`${this.prefix}get_mark`,[this,e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[this,e])}get loaded(){return this.request(`${this.prefix}is_loaded`,[this])}getOffset(e){return this.request(`${this.prefix}get_offset`,[this,e])}addHighlight({hlGroup:e,line:t,colStart:n,colEnd:r,srcId:i}){const s=void 0!==e?e:"",o=void 0!==r?r:-1,a=void 0!==n?n:-0,l=void 0!==i?i:-1;return this.request(`${this.prefix}add_highlight`,[this,l,s,t,a,o])}clearHighlight(e={}){console.warn("`clearHighlight` is deprecated, use ``clearNamespace()` instead");const{srcId:t,lineStart:n,lineEnd:r}=Object.assign(Object.assign({},{srcId:-1,lineStart:0,lineEnd:-1}),e);return this.request(`${this.prefix}clear_highlight`,[this,t,n,r])}clearNamespace(e){const{nsId:t,lineStart:n,lineEnd:r}=Object.assign(Object.assign({},{nsId:-1,lineStart:0,lineEnd:-1}),e);this.request(`${this.prefix}clear_namespace`,[this,t,n,r])}setVirtualText(e,t,n,r={}){return this.request(`${this.prefix}set_virtual_text`,[this,e,t,n,r])}listen(e,n){return this.isAttached||this[t.ATTACH]().then((t=>{t||this.unlisten(e,n)})),this.client.attachBuffer(this,e,n),()=>{this.unlisten(e,n)}}unlisten(e,n){this.isAttached&&this.client.detachBuffer(this,e,n)&&this[t.DETACH]()}}t.Buffer=l,r=t.ATTACH,i=t.DETACH},2203:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3437),i=n(2348),s=n(1810),o=n(4637),a=n(5720);class l extends r.BaseApi{constructor(){super(...arguments),this.prefix="nvim_",this.Buffer=s.Buffer,this.Window=a.Window,this.Tabpage=o.Tabpage}get apiInfo(){return this.request(`${this.prefix}get_api_info`)}get buffers(){return this.request(`${this.prefix}list_bufs`)}get buffer(){return i.createChainableApi.call(this,"Buffer",s.Buffer,(()=>this.request(`${this.prefix}get_current_buf`)))}set buffer(e){this.request(`${this.prefix}set_current_buf`,[e])}get chans(){return this.request(`${this.prefix}list_chans`)}getChanInfo(e){return this.request(`${this.prefix}get_chan_info`,[e])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[e])}get tabpages(){return this.request(`${this.prefix}list_tabpages`)}get tabpage(){return i.createChainableApi.call(this,"Tabpage",o.Tabpage,(()=>this.request(`${this.prefix}get_current_tabpage`)))}set tabpage(e){this.request(`${this.prefix}set_current_tabpage`,[e])}get windows(){return this.getWindows()}get window(){return this.getWindow()}set window(e){this.setWindow(e)}getWindows(){return this.request(`${this.prefix}list_wins`)}getWindow(){return i.createChainableApi.call(this,"Window",a.Window,(()=>this.request(`${this.prefix}get_current_win`)))}setWindow(e){return this.request(`${this.prefix}set_current_win`,[e])}get runtimePaths(){return this.request(`${this.prefix}list_runtime_paths`)}set dir(e){this.request(`${this.prefix}set_current_dir`,[e])}get line(){return this.getLine()}set line(e){"string"==typeof e&&this.setLine(e)}getLine(){return this.request(`${this.prefix}get_current_line`)}setLine(e){return this.request(`${this.prefix}set_current_line`,[e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[e])}get mode(){return this.request(`${this.prefix}get_mode`)}get colorMap(){return this.request(`${this.prefix}get_color_map`)}getColorByName(e){return this.request(`${this.prefix}get_color_by_name`,[e])}getHighlight(e,t=!0){const n="string"==typeof e?"by_name":"by_id";return this.request(`${this.prefix}get_hl_${n}`,[e,t])}getHighlightByName(e,t=!0){return this.request(`${this.prefix}get_hl_by_name`,[e,t])}getHighlightById(e,t=!0){return this.request(`${this.prefix}get_hl_by_id`,[e,t])}deleteCurrentLine(){return this.request(`${this.prefix}del_current_line`)}eval(e){return this.request(`${this.prefix}eval`,[e])}lua(e,t=[]){const n=Array.isArray(t)?t:[t];return this.request(`${this.prefix}execute_lua`,[e,n])}executeLua(e,t=[]){return this.lua(e,t)}callDictFunction(e,t,n=[]){const r=Array.isArray(n)?n:[n];return this.request(`${this.prefix}call_dict_function`,[e,t,r])}call(e,t=[]){const n=Array.isArray(t)?t:[t];return this.request(`${this.prefix}call_function`,[e,n])}callFunction(e,t=[]){return this.call(e,t)}callAtomic(e){return this.request(`${this.prefix}call_atomic`,[e])}command(e){return this.request(`${this.prefix}command`,[e])}commandOutput(e){return this.request(`${this.prefix}command_output`,[e])}getVvar(e){return this.request(`${this.prefix}get_vvar`,[e])}setVvar(e,t){return this.request(`${this.prefix}set_vvar`,[e,t])}feedKeys(e,t,n){return this.request(`${this.prefix}feedkeys`,[e,t,n])}input(e){return this.request(`${this.prefix}input`,[e])}inputMouse(e,t,n,r,i,s){return this.request(`${this.prefix}input_mouse`,[e,t,n,r,i,s])}parseExpression(e,t,n){return this.request(`${this.prefix}parse_expression`,[e,t,n])}getProc(e){return this.request(`${this.prefix}get_proc`,[e])}getProcChildren(e){return this.request(`${this.prefix}get_proc_children`,[e])}replaceTermcodes(e,t,n,r){return this.request(`${this.prefix}replace_termcodes`,[e,t,n,r])}strWidth(e){return this.request(`${this.prefix}strwidth`,[e])}outWrite(e){return this.request(`${this.prefix}out_write`,[e])}outWriteLine(e){return this.outWrite(`${e}\n`)}errWrite(e){return this.request(`${this.prefix}err_write`,[e])}errWriteLine(e){return this.request(`${this.prefix}err_writeln`,[e])}get uis(){return this.request(`${this.prefix}list_uis`)}uiAttach(e,t,n){return this.request(`${this.prefix}ui_attach`,[e,t,n])}uiDetach(){return this.request(`${this.prefix}ui_detach`,[])}uiTryResize(e,t){return this.request(`${this.prefix}ui_try_resize`,[e,t])}uiTryResizeGrid(e,t,n){return this.request(`${this.prefix}ui_try_resize_grid`,[e,t,n])}uiSetOption(e,t){return this.request(`${this.prefix}ui_set_option`,[e,t])}subscribe(e){return this.request(`${this.prefix}subscribe`,[e])}unsubscribe(e){return this.request(`${this.prefix}unsubscribe`,[e])}setClientInfo(e,t,n,r,i){this.request(`${this.prefix}set_client_info`,[e,t,n,r,i])}createNamespace(e=""){return this.request(`${this.prefix}create_namespace`,[e])}get namespaces(){return this.getNamespaces()}getNamespaces(){return this.request(`${this.prefix}get_namespaces`)}selectPopupmenuItem(e,t,n,r={}){return this.request(`${this.prefix}select_popupmenu_item`,[e,t,n,r])}createBuf(e,t){return this.request(`${this.prefix}create_buf`,[e,t])}createBuffer(e,t){return this.createBuf(e,t)}openWin(e,t,n){return this.request(`${this.prefix}open_win`,[e,t,n])}openWindow(e,t,n){return this.openWin(e,t,n)}winConfig(e,t={}){return e.config(t)}windowConfig(e,t={}){return this.winConfig(e,t)}winClose(e,t){return e.close(t)}windowClose(e,t){return this.winClose(e,t)}quit(){this.command("qa!")}}t.Neovim=l},4637:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3437),i=n(94),s=n(2348),o=n(5720);class a extends r.BaseApi{constructor(){super(...arguments),this.prefix=i.Metadata[i.ExtType.Tabpage].prefix}get windows(){return this.request(`${this.prefix}list_wins`,[this])}get window(){return s.createChainableApi.call(this,"Window",o.Window,(()=>this.request(`${this.prefix}get_win`,[this])))}get valid(){return this.request(`${this.prefix}is_valid`,[this])}get number(){return this.request(`${this.prefix}get_number`,[this])}getOption(){this.logger.error("Tabpage does not have `getOption`")}setOption(){this.logger.error("Tabpage does not have `setOption`")}}t.Tabpage=a},5720:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3437),i=n(94),s=n(2348),o=n(4637),a=n(1810);class l extends r.BaseApi{constructor(){super(...arguments),this.prefix=i.Metadata[i.ExtType.Window].prefix}get id(){return this.data}get buffer(){return s.createChainableApi.call(this,"Buffer",a.Buffer,(()=>this.request(`${this.prefix}get_buf`,[this])))}get tabpage(){return s.createChainableApi.call(this,"Tabpage",o.Tabpage,(()=>this.request(`${this.prefix}get_tabpage`,[this])))}get cursor(){return this.request(`${this.prefix}get_cursor`,[this])}set cursor(e){this.request(`${this.prefix}set_cursor`,[this,e])}get height(){return this.request(`${this.prefix}get_height`,[this])}set height(e){this.request(`${this.prefix}set_height`,[this,e])}get width(){return this.request(`${this.prefix}get_width`,[this])}set width(e){this.request(`${this.prefix}set_width`,[this,e])}get position(){return this.request(`${this.prefix}get_position`,[this])}get row(){return this.request(`${this.prefix}get_position`,[this]).then((e=>e[0]))}get col(){return this.request(`${this.prefix}get_position`,[this]).then((e=>e[1]))}get valid(){return this.request(`${this.prefix}is_valid`,[this])}get number(){return this.request(`${this.prefix}get_number`,[this])}close(e=!1){return this.request(`${this.prefix}close`,[this,e])}config(e={}){return this.request(`${this.prefix}set_config`,[this,e])}}t.Window=l},4606:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(138),s=n(2203);class o extends s.Neovim{constructor(e={}){super({logger:e.logger}),this.attachedBuffers=new Map;const t=e.transport||new i.Transport;this.setTransport(t),this.requestQueue=[],this.transportAttached=!1,this.handleRequest=this.handleRequest.bind(this),this.handleNotification=this.handleNotification.bind(this)}attach({reader:e,writer:t}){this.transport.attach(t,e,this),this.transportAttached=!0,this.setupTransport()}get isApiReady(){return this.transportAttached&&void 0!==this._channelId}get channelId(){return(()=>r(this,void 0,void 0,(function*(){return yield this._isReady,this._channelId})))()}isAttached(e){const t=`${e.data}`;return this.attachedBuffers.has(t)}handleRequest(e,t,n,...r){this.logger.info("handleRequest: ",e),this.isApiReady||"specs"===e?this.emit("request",e,t,n):this.requestQueue.push({type:"request",args:[e,t,n,...r]})}emitNotification(e,t){if(e.endsWith("_event")){if(!e.startsWith("nvim_buf_"))return void this.logger.error("Unhandled event: ",e);const n=e.replace(/nvim_buf_(.*)_event/,"$1"),[r]=t,i=`${r.data}`;if(!this.attachedBuffers.has(i))return;(this.attachedBuffers.get(i).get(n)||[]).forEach((e=>e(...t))),"detach"===n&&this.attachedBuffers.delete(i)}else this.emit("notification",e,t)}handleNotification(e,t,...n){this.logger.info("handleNotification: ",e),this.isApiReady?this.emitNotification(e,t):this.requestQueue.push({type:"notification",args:[e,t,...n]})}setupTransport(){if(!this.transportAttached)throw new Error("Not attached to input/output");this.transport.on("request",this.handleRequest),this.transport.on("notification",this.handleNotification),this.transport.on("detach",(()=>{this.emit("disconnect"),this.transport.removeAllListeners("request"),this.transport.removeAllListeners("notification"),this.transport.removeAllListeners("detach")})),this._isReady=this.generateApi()}requestApi(){return new Promise(((e,t)=>{this.transport.request("nvim_get_api_info",[],((n,r)=>{n?t(n):e(r)}))}))}generateApi(){return r(this,void 0,void 0,(function*(){let e;try{e=yield this.requestApi()}catch(e){this.logger.error("Could not get vim api results"),this.logger.error(e)}if(e)try{const[t]=e;return this._channelId=t,this.requestQueue.forEach((e=>{"notification"===e.type?this.emitNotification(e.args[0],e.args[1]):this.emit(e.type,...e.args)})),this.requestQueue=[],!0}catch(e){return this.logger.error(`Could not dynamically generate neovim API: ${e}`,{error:e}),this.logger.error(e.stack),null}return null}))}attachBuffer(e,t,n){const r=`${e.data}`;this.attachedBuffers.has(r)||this.attachedBuffers.set(r,new Map);const i=this.attachedBuffers.get(r);i.get(t)||i.set(t,[]);const s=i.get(t);return-1!==s.indexOf(n)||(s.push(n),i.set(t,s),this.attachedBuffers.set(r,i)),n}detachBuffer(e,t,n){const r=`${e.data}`,i=this.attachedBuffers.get(r);if(!i)return!1;const s=(i.get(t)||[]).filter((e=>e!==n));return s.length?i.set(t,s):i.delete(t),!i.size&&(this.attachedBuffers.delete(r),!0)}}t.NeovimClient=o},2348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3437),i=Object.getOwnPropertyNames(r.BaseApi.prototype);t.createChainableApi=function(e,t,n,s){if(this[`${e}Promise`]&&0===this[`${e}Promise`].status&&this[`${e}Proxy`])return this[`${e}Proxy`];this[`${e}Promise`]=n(),[...i,...Object.getOwnPropertyNames(t.prototype)].forEach((t=>{Object.defineProperty(this[`${e}Promise`],t,{enumerable:!0,writable:!0,configurable:!0})}));const o={get:(n,i)=>{const o=Object.prototype.hasOwnProperty.call(t.prototype,i)||Object.prototype.hasOwnProperty.call(r.BaseApi.prototype,i),a=Object.getOwnPropertyDescriptor(t.prototype,i)||Object.getOwnPropertyDescriptor(r.BaseApi.prototype,i),l=a&&(void 0!==a.get||void 0!==a.set);return t&&o?o&&!l&&(i in t.prototype&&"function"==typeof t.prototype[i]||i in r.BaseApi.prototype&&"function"==typeof r.BaseApi.prototype[i])?(...t)=>this[`${e}Promise`].then((e=>e[i].call(e,...t))):s&&s()||this[`${e}Promise`].then((e=>e[i])):i in n?"function"==typeof n[i]?n[i].bind(n):n[i]:null},set:(e,t,n,r)=>(r&&(r instanceof Promise||"then"in r)?r.then((e=>{t in e&&(e[t]=n)})):e[t]=n,!0)};return this[`${e}Proxy`]=new Proxy(this[`${e}Promise`],o),this[`${e}Proxy`]}},6017:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2203);t.Neovim=r.Neovim;var i=n(4606);t.NeovimClient=i.NeovimClient;var s=n(1810);t.Buffer=s.Buffer;var o=n(5720);t.Window=o.Window;var a=n(4637);t.Tabpage=a.Tabpage},94:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1810),i=n(5720),s=n(4637);var o;(o=t.ExtType||(t.ExtType={}))[o.Buffer=0]="Buffer",o[o.Window=1]="Window",o[o.Tabpage=2]="Tabpage",t.Metadata=[{constructor:r.Buffer,name:"Buffer",prefix:"nvim_buf_"},{constructor:i.Window,name:"Window",prefix:"nvim_win_"},{constructor:s.Tabpage,name:"Tabpage",prefix:"nvim_tabpage_"}]},3286:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1291);t.attach=r.attach},1291:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1631),i=n(4606);t.attach=function({reader:e,writer:t,proc:s,socket:o,options:a={}}){let l,u;if(o){const e=r.createConnection(o);l=e,u=e}else e&&t?(l=t,u=e):s&&(l=s.stdin,u=s.stdout);if(l&&u){const e=a.logger||n(311).logger,t=new i.NeovimClient({logger:e});return t.attach({writer:l,reader:u}),t}throw new Error("Invalid arguments, could not attach")}},3596:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(311);function s(e){if("function"==typeof e)return e;if(Array.isArray(e)&&2===e.length)return function(...t){return e[1].apply(e[0],t)};throw new Error}t.callable=s,t.NvimPlugin=class{constructor(e,t,n){this.filename=e,this.nvim=n,this.dev=!1,this.alwaysInit=!1,this.autocmds={},this.commands={},this.functions={};try{this.instance=new t(this)}catch(e){if(!(e instanceof TypeError))throw e;this.instance=t(this)}}setOptions(e){this.dev=void 0===e.dev?this.dev:e.dev,this.alwaysInit=e.alwaysInit}get shouldCacheModule(){return!this.dev}registerAutocmd(e,t,n){if(!n.pattern)return void i.logger.error(`registerAutocmd expected pattern option for ${e}`);const r={type:"autocmd",name:e,sync:n&&!!n.sync,opts:{}};["pattern","eval"].forEach((e=>{n&&void 0!==n[e]&&(r.opts[e]=n[e])}));try{this.autocmds[`${e} ${n.pattern}`]={fn:s(t),spec:r}}catch(t){i.logger.error(`registerAutocmd expected callable argument for ${e}`)}}registerCommand(e,t,n){const r={type:"command",name:e,sync:n&&!!n.sync,opts:{}};["range","nargs","complete"].forEach((e=>{n&&void 0!==n[e]&&(r.opts[e]=n[e])}));try{this.commands[e]={fn:s(t),spec:r}}catch(t){i.logger.error(`registerCommand expected callable argument for ${e}`)}}registerFunction(e,t,n){const r={type:"function",name:e,sync:n&&!!n.sync,opts:{}};["range","eval"].forEach((e=>{n&&void 0!==n[e]&&(r.opts[e]=n[e])}));try{this.functions[e]={fn:s(t),spec:r}}catch(t){i.logger.error(`registerFunction expected callable argument for ${e}`)}}get specs(){const e=Object.keys(this.autocmds).map((e=>this.autocmds[e].spec)),t=Object.keys(this.commands).map((e=>this.commands[e].spec)),n=Object.keys(this.functions).map((e=>this.functions[e].spec));return e.concat(t).concat(n)}handleRequest(e,t,n){return r(this,void 0,void 0,(function*(){let r;switch(t){case"autocmd":r=this.autocmds;break;case"command":r=this.commands;break;case"function":r=this.functions;break;default:const n=`No handler for unknown type ${t}: "${e}" in ${this.filename}`;throw i.logger.error(n),new Error(n)}if(!r.hasOwnProperty(e)){const n=`Missing handler for ${t}: "${e}" in ${this.filename}`;throw i.logger.error(n),new Error(n)}{const s=r[e];try{return s.spec.sync?s.fn(...n):yield s.fn(...n)}catch(n){const r=`Error in plugin for ${t}:${e}: ${n.message}`;throw i.logger.error(`${r} (file: ${this.filename}, stack: ${n.stack})`),new Error(n)}}}))}}},7570:function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(n(5622)),o=r(n(1669)),a=r(n(2184)),l=i(n(5402)),u=i(n(6427)),c=n(311),h=n(8929),d=n(3596),f=n(2282),g=["reallyExit","abort","chdir","umask","setuid","setgid","setgroups","_kill","EventEmitter","_maxListeners","_fatalException","exit","kill"];function p(){const e=e=>this.require(e);return e.resolve=e=>f._resolveFilename(e,this),e.main=process.mainModule,e.extensions=f._extensions,e.cache=f._cache,e}function m(e){return function(t,n){const r=p.call(this),i=s.dirname(n),o=t.replace(/^\#\!.*/,""),l=f.wrap(o),u=a.runInContext(l,e,{filename:n}),c=[this.exports,r,this,n,i];return u.apply(this.exports,c)}}t.loadPlugin=function(e,t,r={}){try{return function(e,t,r={}){try{const i=function(e){const t=new f(e);t.paths=f._nodeModulePaths(e);const n=a.createContext({module:t,console:{}});l.default(n,global),Object.keys(console).forEach((t=>{"log"===t?n.console.log=function(e){return(...t)=>{const n=s.basename(e),r=o.format.apply(null,[`[${n}]`].concat(t));c.logger.info(r)}}(e):t in c.logger&&(n.console[t]=c.logger[t])})),n.require=function(e){const t=f.prototype._compile;f.prototype._compile=m(n);const r=n.module.require(e);return f.prototype._compile=t,r},n.process=u.default(process,g),g.forEach((e=>{n.process[e]=function(e){return()=>{throw new Error(`process.${e}() is not allowed in Plugin sandbox`)}}(e)}));const r=new h.DevNull;return n.process.umask=e=>{if(void 0!==e)throw new Error("Cannot use process.umask() to change mask (read-only)");return process.umask()},n.process.stdin=r,n.process.stdout=r,n.process.stderr=r,n.Buffer=global.Buffer,n}(e);if(c.logger.debug(`createPlugin.${e}.clearCache: ${r&&!r.cache}`),r&&!r.cache)try{delete f._cache[n(9071).resolve(e)]}catch(e){}const p=i.require(e),v=p&&p.default||p;if("function"==typeof v)return new d.NvimPlugin(e,v,t)}catch(t){const n=s.basename(e);c.logger.error(`[${n}] ${t.stack}`),c.logger.error(`[${n}] Error loading child ChildPlugin ${e}`)}return null}(e,t,r)}catch(e){return null}}},9071:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=9071,e.exports=t},9562:(e,t,n)=>{"use strict";var r=n(3286);t.ub=r.attach;var i=n(6017);i.Neovim,i.NeovimClient,i.Buffer,i.Tabpage,i.Window;var s=n(1114);s.Plugin,s.Function,s.Autocmd,s.Command,n(3596).NvimPlugin,n(7570).loadPlugin},1114:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9111);t.Plugin=r.Plugin,t.Function=r.Function,t.Autocmd=r.Autocmd,t.Command=r.Command},9155:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5042);t.autocmd=function(e,t){return function(n,i){const s=t&&!!t.sync,o="string"==typeof i,a=o?n[i]:n,l={pattern:""};["pattern","eval"].forEach((e=>{t&&void 0!==t[e]&&(l[e]=t[e])}));const u=`${e}${t.pattern?`:${t.pattern}`:""}`;return Object.defineProperty(a,r.NVIM_METHOD_NAME,{value:`autocmd:${u}`}),Object.defineProperty(a,r.NVIM_SYNC,{value:!!s}),Object.defineProperty(a,r.NVIM_SPEC,{value:{type:"autocmd",name:e,sync:!!s,opts:l}}),o&&(n[i]=a),n}}},7856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5042);t.command=function(e,t){return function(n,i){const s=t&&!!t.sync,o="string"==typeof i,a=o?n[i]:n,l={};return["range","nargs","complete"].forEach((e=>{t&&void 0!==t[e]&&(l[e]=t[e])})),Object.defineProperty(a,r.NVIM_METHOD_NAME,{value:`command:${e}`}),Object.defineProperty(a,r.NVIM_SYNC,{value:!!s}),Object.defineProperty(a,r.NVIM_SPEC,{value:{type:"command",name:e,sync:!!s,opts:l}}),o&&(n[i]=a),n}}},3936:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5042);t.nvimFunction=function(e,t={}){return function(n,i){const s=t&&!!t.sync,o="string"==typeof i,a=o?n[i]:n,l={};return t&&t.range&&(l.range=t.range),t&&t.eval&&(l.eval=t.eval),Object.defineProperty(a,r.NVIM_METHOD_NAME,{value:`function:${e}`}),Object.defineProperty(a,r.NVIM_SYNC,{value:!!s}),Object.defineProperty(a,r.NVIM_SPEC,{value:{type:"function",name:e,sync:!!s,opts:l}}),o&&(n[i]=a),n}}},9111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8772);t.Plugin=r.plugin;var i=n(3936);t.Function=i.nvimFunction;var s=n(9155);t.Autocmd=s.autocmd;var o=n(7856);t.Command=o.command},8772:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(311),i=n(5042),s=n(2203);t.Neovim=s.Neovim;const o=n(3596);function a(e,t){return r.logger.info(`Decorating class ${e}`),class extends e{constructor(...n){const s=n[0];super(s.nvim,s),this.setApi(s.nvim),t&&s.setOptions(t),Object.getOwnPropertyNames(e.prototype).forEach((t=>{r.logger.info(`Method name ${t}`),r.logger.info(`${e.prototype[t]} ${typeof e.prototype[t]}`),r.logger.info(`${this} ${typeof this}`);const n=e.prototype[t];if(n&&n[i.NVIM_SPEC]){const e=n[i.NVIM_SPEC];switch(e.type){case"autocmd":const t={pattern:e.opts.pattern,sync:e.sync};void 0!==e.opts.eval&&(t.eval=e.opts.eval),s.registerAutocmd(e.name,[this,n],t);break;case"command":const r={sync:e.sync};void 0!==e.opts.range&&(r.range=e.opts.range),void 0!==e.opts.nargs&&(r.nargs=e.opts.nargs),void 0!==e.opts.complete&&(r.complete=e.opts.complete),s.registerCommand(e.name,[this,n],r);break;case"function":const i={sync:e.sync};void 0!==e.opts.range&&(i.range=e.opts.range),void 0!==e.opts.eval&&(i.eval=e.opts.eval),s.registerFunction(e.name,[this,n],i)}}}))}setApi(e){this.nvim=e}}}t.NvimPlugin=o.NvimPlugin,t.plugin=function(e){return"function"!=typeof e?t=>a(t,e):a(e)}},5042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NVIM_PLUGIN="_nvim_plugin",t.NVIM_DEV_MODE="_nvim_dev_mode",t.NVIM_SPEC="_nvim_rpc_spec",t.NVIM_SYNC="_nvim_rpc_sync",t.NVIM_METHOD_NAME="_nvim_rpc_method_name"},8929:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2413);class i extends r.Duplex{_read(){}_write(e,t,n){n()}}t.DevNull=i},311:function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1440)),s="error",o=i.createLogger({level:s});process.env.NVIM_NODE_LOG_FILE&&o.add(new i.transports.File({filename:process.env.NVIM_NODE_LOG_FILE,level:s})),o.add(new i.transports.Console({format:i.format.simple()})),t.logger=o},138:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8614),i=n(3308),s=n(94);class o{constructor(e,t){this.encoder=e,this.requestId=t}send(e,t){if(this.sent)throw new Error(`Response to id ${this.requestId} already sent`);const n=i.encode([1,this.requestId,t?e:null,t?null:e]);this.encoder.write(Buffer.from(n.buffer,n.byteOffset,n.byteLength)),this.sent=!0}}class a extends r.EventEmitter{constructor(){super(...arguments),this.pending=new Map,this.nextRequestId=1,this.extensionCodec=this.initializeExtensionCodec()}initializeExtensionCodec(){const e=new i.ExtensionCodec;return s.Metadata.forEach((({constructor:t},n)=>{e.register({type:n,encode:e=>e instanceof t?i.encode(e.data):null,decode:e=>new t({transport:this,client:this.client,data:i.decode(e)})})})),e}encodeToBuffer(e){const t=i.encode(e,{extensionCodec:this.extensionCodec});return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}attach(e,t,n){this.writer=e,this.reader=t,this.client=n,this.reader.on("end",(()=>{this.emit("detach")}));const r=i.decodeStream(this.reader,{extensionCodec:this.extensionCodec}),s=e=>{e.next().then((t=>t.done?Promise.resolve():(this.parseMessage(t.value),s(e))))};s(r)}request(e,t,n){this.nextRequestId=this.nextRequestId+1,this.writer.write(this.encodeToBuffer([0,this.nextRequestId,e,t])),this.pending.set(this.nextRequestId,n)}notify(e,t){this.writer.write(this.encodeToBuffer([2,e,t]))}parseMessage(e){const t=e[0];if(0===t)this.emit("request",e[2].toString(),e[3],new o(this.writer,e[1]));else if(1===t){const t=e[1],n=this.pending.get(t);this.pending.delete(t),n(e[2],e[3])}else 2===t?this.emit("notification",e[1].toString(),e[2]):this.writer.write(this.encodeToBuffer([1,0,"Invalid message type",null]))}}t.Transport=a},3138:e=>{"use strict";e.exports=function(e){var t,n=0;function r(){return n||(n=1,t=e.apply(this,arguments),e=null),t}return r.displayName=e.displayName||e.name||r.displayName||r.name,r}},8212:e=>{"use strict";"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,n,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,n)}));case 4:return process.nextTick((function(){e.call(null,t,n,r)}));default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return process.nextTick((function(){e.apply(null,i)}))}}}:e.exports=process},6753:(e,t,n)=>{"use strict";var r=n(8212),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=h;var s=Object.create(n(6497));s.inherits=n(4378);var o=n(9481),a=n(4229);s.inherits(h,o);for(var l=i(a.prototype),u=0;u<l.length;u++){var c=l[u];h.prototype[c]||(h.prototype[c]=a.prototype[c])}function h(e){if(!(this instanceof h))return new h(e);o.call(this,e),a.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",d)}function d(){this.allowHalfOpen||this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.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)}}),h.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},9481:(e,t,n)=>{"use strict";var r=n(8212);e.exports=b;var i,s=n(5826);b.ReadableState=v,n(8614).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=n(9740),l=n(9509).Buffer,u=global.Uint8Array||function(){},c=Object.create(n(6497));c.inherits=n(4378);var h=n(1669),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var f,g=n(5057),p=n(1195);c.inherits(b,a);var m=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(6753));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var s=e.highWaterMark,o=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=s||0===s?s:r&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=n(2553).s),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(6753),!(this instanceof b))return new b(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function y(e,t,n,r,i){var s,o=e._readableState;return null===t?(o.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,x(e)}}(e,o)):(i||(s=function(e,t){var n,r;return r=t,l.isBuffer(r)||r instanceof u||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?w(e,o,t,!1):M(e,o)):w(e,o,t,!1))):r||(o.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&x(e)),M(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=p.destroy,b.prototype._undestroy=p.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),y(this,e,t,!1,n)},b.prototype.unshift=function(e){return y(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return f||(f=n(2553).s),this._readableState.decoder=new f(e),this._readableState.encoding=e,this};var E=8388608;function _(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?r.nextTick(C,e):C(e))}function C(e){d("emit readable"),e.emit("readable"),A(e)}function M(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(S,e,t))}function S(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function D(e){d("readable nexttick read 0"),e.read(0)}function T(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function k(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var s=n.data,o=e>s.length?s.length:e;if(o===s.length?i+=s:i+=s.slice(0,e),0==(e-=o)){o===s.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var s=r.data,o=e>s.length?s.length:e;if(s.copy(n,n.length-e,0,o),0==(e-=o)){o===s.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(o));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function F(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,r.nextTick(O,t,e))}function O(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function j(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):x(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&F(this),null;var r,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=_(n,t))),null===(r=e>0?k(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&F(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?v:l;function l(){d("onend"),e.end()}i.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",(function t(r,s){d("onunpipe"),r===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,d("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",g),e.removeListener("unpipe",t),n.removeListener("end",l),n.removeListener("end",v),n.removeListener("data",f),c=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,A(e))}}(n);e.on("drain",u);var c=!1,h=!1;function f(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==j(i.pipes,e))&&!c&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function g(t){d("onerror",t),v(),e.removeListener("error",g),0===o(e,"error")&&e.emit("error",t)}function p(){e.removeListener("finish",m),v()}function m(){d("onfinish"),e.removeListener("close",p),v()}function v(){d("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events.error?s(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on(t,n)}(e,"error",g),e.once("close",p),e.once("finish",m),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,n);return this}var o=j(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},b.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&x(this):r.nextTick(D,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(T,e,t))}(this,e)),this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){d("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<m.length;s++)e.on(m[s],this.emit.bind(this,m[s]));return this._read=function(t){d("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=k},4229:(e,t,n)=>{"use strict";var r=n(8212);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=m;var s,o=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:r.nextTick;m.WritableState=p;var a=Object.create(n(6497));a.inherits=n(4378);var l,u={deprecate:n(1159)},c=n(9740),h=n(9509).Buffer,d=global.Uint8Array||function(){},f=n(1195);function g(){}function p(e,t){s=s||n(6753),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var l=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=l||0===l?l:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,s=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,s){--t.pendingcb,n?(r.nextTick(s,i),r.nextTick(_,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(s(i),e._writableState.errorEmitted=!0,e.emit("error",i),_(e,t))}(e,n,i,t,s);else{var a=w(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),i?o(b,e,n,a,s):b(e,n,a,s)}}(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 m(e){if(s=s||n(6753),!(l.call(m,this)||this instanceof s))return new m(e);this._writableState=new p(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function v(e,t,n,r,i,s,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function b(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),_(e,t)}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,s=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var a=0,l=!0;n;)s[a]=n,n.isBuf||(l=!1),n=n.next,a+=1;s.allBuffers=l,v(e,t,!0,t.length,s,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,h=n.callback;if(v(e,t,!1,t.objectMode?1:u.length,u,c,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),_(e,t)}))}function _(e,t){var n=w(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,r.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}a.inherits(m,c),p.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(p.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===m&&e&&e._writableState instanceof p}})):l=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,n){var i,s=this._writableState,o=!1,a=!s.objectMode&&(i=e,h.isBuffer(i)||i instanceof d);return a&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof n&&(n=g),s.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),r.nextTick(t,n)}(this,n):(a||function(e,t,n,i){var s=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),r.nextTick(i,o),s=!1),s}(this,s,e,n))&&(s.pendingcb++,o=function(e,t,n,r,i,s){if(!n){var o=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,n)),t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var a=t.objectMode?1:r.length;t.length+=a;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:s,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,a,r,i,s);return l}(this,s,a,e,t,n)),o},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},m.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,n){t.ending=!0,_(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,i,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=f.destroy,m.prototype._undestroy=f.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}},5057:(e,t,n)=>{"use strict";var r=n(9509).Buffer,i=n(1669);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=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 t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i=r.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=i,n=o,s.data.copy(t,n),o+=s.data.length,s=s.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},1195:(e,t,n)=>{"use strict";var r=n(8212);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(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)}}},9740:(e,t,n)=>{e.exports=n(2413)},9909:(e,t,n)=>{var r=n(2413),i=n(4229);"disable"===process.env.READABLE_STREAM?e.exports=r&&r.Writable||i:e.exports=i},9509:(e,t,n)=>{var r=n(4293),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=o),s(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},6851:(e,t,n)=>{"use strict";var r=n(9594),i=Array.prototype.concat,s=Array.prototype.slice,o=e.exports=function(e){for(var t=[],n=0,o=e.length;n<o;n++){var a=e[n];r(a)?t=i.call(t,s.call(a)):t.push(a)}return t};o.wrap=function(e){return function(){return e(o(arguments))}}},9594:e=>{e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},7911:(e,t)=>{function n(e){for(var t in e)this[t]=e[t]}t.get=function(e){var n=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},i=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t},Error.captureStackTrace(r,e||t.get);var s=r.stack;return Error.prepareStackTrace=i,Error.stackTraceLimit=n,s},t.parse=function(e){if(!e.stack)return[];var t=this;return e.stack.split("\n").slice(1).map((function(e){if(e.match(/^\s*[-]{4,}$/))return t._createParsedCallSite({fileName:e,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var n=e.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(n){var r=null,i=null,s=null,o=null,a=null,l="native"===n[5];if(n[1]){var u=(s=n[1]).lastIndexOf(".");if("."==s[u-1]&&u--,u>0){r=s.substr(0,u),i=s.substr(u+1);var c=r.indexOf(".Module");c>0&&(s=s.substr(c+1),r=r.substr(0,c))}o=null}i&&(o=r,a=i),"<anonymous>"===i&&(a=null,s=null);var h={fileName:n[2]||null,lineNumber:parseInt(n[3],10)||null,functionName:s,typeName:o,methodName:a,columnNumber:parseInt(n[4],10)||null,native:l};return t._createParsedCallSite(h)}})).filter((function(e){return!!e}))},["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"].forEach((function(e){n.prototype[e]=null,n.prototype["get"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}})),["topLevel","eval","native","constructor"].forEach((function(e){n.prototype[e]=!1,n.prototype["is"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}})),t._createParsedCallSite=function(e){return new n(e)}},2553:(e,t,n)=>{"use strict";var r=n(9509).Buffer,i=r.isEncoding||function(e){switch((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}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)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(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},s.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3951:e=>{"use strict";e.exports=function(e){for(var t=0,n=0;t<e.length;n=e.charCodeAt(t++)+((n<<5)-n));var r=Math.floor(Math.abs(1e4*Math.sin(n)%1*16777216)).toString(16);return"#"+Array(6-r.length+1).join("0")+r}},9273:(e,t)=>{"use strict";t.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9},t.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}},5243:(e,t,n)=>{"use strict";Object.defineProperty(t,"cli",{value:n(9273)}),Object.defineProperty(t,"npm",{value:n(2459)}),Object.defineProperty(t,"syslog",{value:n(1945)})},2459:(e,t)=>{"use strict";t.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6},t.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}},1945:(e,t)=>{"use strict";t.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7},t.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}},5396:(e,t,n)=>{"use strict";Object.defineProperty(t,"LEVEL",{value:Symbol.for("level")}),Object.defineProperty(t,"MESSAGE",{value:Symbol.for("message")}),Object.defineProperty(t,"SPLAT",{value:Symbol.for("splat")}),Object.defineProperty(t,"configs",{value:n(5243)})},1159:(e,t,n)=>{e.exports=n(1669).deprecate},1037:(e,t,n)=>{"use strict";const r=n(1669),i=n(9909),{LEVEL:s}=n(5396),o=e.exports=function(e={}){i.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once("pipe",(e=>{this.levels=e.levels,this.parent=e})),this.once("unpipe",(e=>{e===this.parent&&(this.parent=null,this.close&&this.close())}))};r.inherits(o,i),o.prototype._write=function(e,t,n){if(this.silent||!0===e.exception&&!this.handleExceptions)return n(null);const r=this.level||this.parent&&this.parent.level;if(!r||this.levels[r]>=this.levels[e[s]]){if(e&&!this.format)return this.log(e,n);let t,r;try{r=this.format.transform(Object.assign({},e),this.format.options)}catch(e){t=e}if(t||!r){if(n(),t)throw t;return}return this.log(r,n)}return n(null)},o.prototype._writev=function(e,t){if(this.logv){const n=e.filter(this._accept,this);return n.length?this.logv(n,t):t(null)}for(let n=0;n<e.length;n++){if(!this._accept(e[n]))continue;if(e[n].chunk&&!this.format){this.log(e[n].chunk,e[n].callback);continue}let r,i;try{i=this.format.transform(Object.assign({},e[n].chunk),this.format.options)}catch(e){r=e}if(r||!i){if(e[n].callback(),r)throw t(null),r}else this.log(i,e[n].callback)}return t(null)},o.prototype._accept=function(e){const t=e.chunk;if(this.silent)return!1;const n=this.level||this.parent&&this.parent.level;return!(!0!==t.exception&&n&&!(this.levels[n]>=this.levels[t[s]])||!this.handleExceptions&&!0===t.exception)},o.prototype._nop=function(){},e.exports.LegacyTransportStream=n(4201)},4201:(e,t,n)=>{"use strict";const r=n(1669),{LEVEL:i}=n(5396),s=n(1037),o=e.exports=function(e={}){if(s.call(this,e),!e.transport||"function"!=typeof e.transport.log)throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=function(e){this.emit("error",e,this.transport)}.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(o,s),o.prototype._write=function(e,t,n){if(this.silent||!0===e.exception&&!this.handleExceptions)return n(null);(!this.level||this.levels[this.level]>=this.levels[e[i]])&&this.transport.log(e[i],e.message,e,this._nop),n(null)},o.prototype._writev=function(e,t){for(let t=0;t<e.length;t++)this._accept(e[t])&&(this.transport.log(e[t].chunk[i],e[t].chunk.message,e[t].chunk,this._nop),e[t].callback());return t(null)},o.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join("\n"))},o.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},1440:(e,t,n)=>{"use strict";const r=n(562),{warn:i}=n(2850),s=t;s.version=n(6141).i8,s.transports=n(9840),s.config=n(448),s.addColors=r.levels,s.format=r.format,s.createLogger=n(5658),s.ExceptionHandler=n(5120),s.RejectionHandler=n(5724),s.Container=n(6099),s.Transport=n(1037),s.loggers=new s.Container;const o=s.createLogger();Object.keys(s.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure"]).forEach((e=>s[e]=(...t)=>o[e](...t))),Object.defineProperty(s,"level",{get:()=>o.level,set(e){o.level=e}}),Object.defineProperty(s,"exceptions",{get:()=>o.exceptions}),["exitOnError"].forEach((e=>{Object.defineProperty(s,e,{get:()=>o[e],set(t){o[e]=t}})})),Object.defineProperty(s,"default",{get:()=>({exceptionHandlers:o.exceptionHandlers,rejectionHandlers:o.rejectionHandlers,transports:o.transports})}),i.deprecated(s,"setLevels"),i.forFunctions(s,"useFormat",["cli"]),i.forProperties(s,"useFormat",["padLevels","stripColors"]),i.forFunctions(s,"deprecated",["addRewriter","addFilter","clone","extend"]),i.forProperties(s,"deprecated",["emitErrs","levelLength"]),i.moved(s,"createLogger","Logger")},2850:(e,t,n)=>{"use strict";const{format:r}=n(1669);t.warn={deprecated:e=>()=>{throw new Error(r("{ %s } was removed in winston@3.0.0.",e))},useFormat:e=>()=>{throw new Error([r("{ %s } was removed in winston@3.0.0.",e),"Use a custom winston.format = winston.format(function) instead."].join("\n"))},forFunctions(e,n,r){r.forEach((r=>{e[r]=t.warn[n](r)}))},moved(e,t,n){function i(){return()=>{throw new Error([r("winston.%s was moved in winston@3.0.0.",n),r("Use a winston.%s instead.",t)].join("\n"))}}Object.defineProperty(e,n,{get:i,set:i})},forProperties(e,n,r){r.forEach((r=>{const i=t.warn[n](r);Object.defineProperty(e,r,{get:i,set:i})}))}}},448:(e,t,n)=>{"use strict";const r=n(562),{configs:i}=n(5396);t.cli=r.levels(i.cli),t.npm=r.levels(i.npm),t.syslog=r.levels(i.syslog),t.addColors=r.levels},6099:(e,t,n)=>{"use strict";const r=n(5658);e.exports=class{constructor(e={}){this.loggers=new Map,this.options=e}add(e,t){if(!this.loggers.has(e)){const n=(t=Object.assign({},t||this.options)).transports||this.options.transports;t.transports=n?n.slice():[];const i=r(t);i.on("close",(()=>this._delete(e))),this.loggers.set(e,i)}return this.loggers.get(e)}get(e,t){return this.add(e,t)}has(e){return!!this.loggers.has(e)}close(e){if(e)return this._removeLogger(e);this.loggers.forEach(((e,t)=>this._removeLogger(t)))}_removeLogger(e){this.loggers.has(e)&&(this.loggers.get(e).close(),this._delete(e))}_delete(e){this.loggers.delete(e)}}},5658:(e,t,n)=>{"use strict";const{LEVEL:r}=n(5396),i=n(448),s=n(9848),o=n(8713)("winston:create-logger");e.exports=function(e={}){e.levels=e.levels||i.npm.levels;class t extends s{constructor(e){super(e)}}const n=new t(e);return Object.keys(e.levels).forEach((function(e){o('Define prototype method for "%s"',e),"log"!==e?(t.prototype[e]=function(...t){const i=this||n;if(1===t.length){const[s]=t,o=s&&s.message&&s||{message:s};return o.level=o[r]=e,i._addDefaultMeta(o),i.write(o),this||n}return 0===t.length?(i.log(e,""),i):i.log(e,...t)},t.prototype[function(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}(e)]=function(){return(this||n).isLevelEnabled(e)}):console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.')})),n}},5120:(e,t,n)=>{"use strict";const r=n(2087),i=n(8058),s=n(8713)("winston:exception"),o=n(3138),a=n(7911),l=n(5193);e.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle exceptions");this.logger=e,this.handlers=new Map}handle(...e){e.forEach((e=>{if(Array.isArray(e))return e.forEach((e=>this._addHandler(e)));this._addHandler(e)})),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on("uncaughtException",this.catcher))}unhandle(){this.catcher&&(process.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach((e=>this.logger.unpipe(e))))}getAllInfo(e){let{message:t}=e;return t||"string"!=typeof e||(t=e),{error:e,level:"error",message:[`uncaughtException: ${t||"(no error message)"}`,e.stack||" No stack trace"].join("\n"),stack:e.stack,exception:!0,date:(new Date).toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:r.loadavg(),uptime:r.uptime()}}getTrace(e){return(e?a.parse(e):a.get()).map((e=>({column:e.getColumnNumber(),file:e.getFileName(),function:e.getFunctionName(),line:e.getLineNumber(),method:e.getMethodName(),native:e.isNative()})))}_addHandler(e){if(!this.handlers.has(e)){e.handleExceptions=!0;const t=new l(e);this.handlers.set(e,t),this.logger.pipe(t)}}_uncaughtException(e){const t=this.getAllInfo(e),n=this._getExceptionHandlers();let r,a="function"==typeof this.logger.exitOnError?this.logger.exitOnError(e):this.logger.exitOnError;function l(){s("doExit",a),s("process._exiting",process._exiting),a&&!process._exiting&&(r&&clearTimeout(r),process.exit(1))}if(!n.length&&a&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),a=!1),!n||0===n.length)return process.nextTick(l);i(n,((e,t)=>{const n=o(t),r=e.transport||e;function i(e){return()=>{s(e),n()}}r._ending=!0,r.once("finish",i("finished")),r.once("error",i("error"))}),(()=>a&&l())),this.logger.log(t),a&&(r=setTimeout(l,3e3))}_getExceptionHandlers(){return this.logger.transports.filter((e=>(e.transport||e).handleExceptions))}}},5193:(e,t,n)=>{"use strict";const{Writable:r}=n(514);e.exports=class extends r{constructor(e){if(super({objectMode:!0}),!e)throw new Error("ExceptionStream requires a TransportStream instance.");this.handleExceptions=!0,this.transport=e}_write(e,t,n){return e.exception?this.transport.log(e,n):(n(),!0)}}},9848:(e,t,n)=>{"use strict";const{Stream:r,Transform:i}=n(514),s=n(8058),{LEVEL:o,SPLAT:a}=n(5396),l=n(4970),u=n(5120),c=n(5724),h=n(4201),d=n(46),{warn:f}=n(2850),g=n(448),p=/%[scdjifoO%]/g;class m extends i{constructor(e){super({objectMode:!0}),this.configure(e)}child(e){const t=this;return Object.create(t,{write:{value:function(n){const r=Object.assign({},e,n);n instanceof Error&&(r.stack=n.stack,r.message=n.message),t.write(r)}}})}configure({silent:e,format:t,defaultMeta:r,levels:i,level:s="info",exitOnError:o=!0,transports:a,colors:l,emitErrs:h,formatters:d,padLevels:f,rewriters:p,stripColors:m,exceptionHandlers:v,rejectionHandlers:b}={}){if(this.transports.length&&this.clear(),this.silent=e,this.format=t||this.format||n(3922)(),this.defaultMeta=r||null,this.levels=i||this.levels||g.npm.levels,this.level=s,this.exceptions=new u(this),this.rejections=new c(this),this.profilers={},this.exitOnError=o,a&&(a=Array.isArray(a)?a:[a]).forEach((e=>this.add(e))),l||h||d||f||p||m)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join("\n"));v&&this.exceptions.handle(v),b&&this.rejections.handle(b)}isLevelEnabled(e){const t=v(this.levels,e);if(null===t)return!1;const n=v(this.levels,this.level);return null!==n&&(this.transports&&0!==this.transports.length?-1!==this.transports.findIndex((e=>{let r=v(this.levels,e.level);return null===r&&(r=n),r>=t})):n>=t)}log(e,t,...n){if(1===arguments.length)return e[o]=e.level,this._addDefaultMeta(e),this.write(e),this;if(2===arguments.length)return t&&"object"==typeof t?(t[o]=t.level=e,this._addDefaultMeta(t),this.write(t),this):(this.write({[o]:e,level:e,message:t}),this);const[r]=n;if("object"==typeof r&&null!==r&&!(t&&t.match&&t.match(p))){const i=Object.assign({},this.defaultMeta,r,{[o]:e,[a]:n,level:e,message:t});return r.message&&(i.message+=`${r.message}`),r.stack&&(i.stack=r.stack),this.write(i),this}return this.write(Object.assign({},this.defaultMeta,{[o]:e,[a]:n,level:e,message:t})),this}_transform(e,t,n){if(this.silent)return n();e[o]||(e[o]=e.level),this.levels[e[o]]||0===this.levels[e[o]]||console.error("[winston] Unknown logger level: %s",e[o]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports %j",e);try{this.push(this.format.transform(e,this.format.options))}catch(e){throw e}finally{n()}}_final(e){const t=this.transports.slice();s(t,((e,t)=>{if(!e||e.finished)return setImmediate(t);e.once("finish",t),e.end()}),e)}add(e){const t=!l(e)||e.log.length>2?new h({transport:e}):e;if(!t._writableState||!t._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",t),this._onEvent("warn",t),this.pipe(t),e.handleExceptions&&this.exceptions.handle(),e.handleRejections&&this.rejections.handle(),this}remove(e){let t=e;return(!l(e)||e.log.length>2)&&(t=this.transports.filter((t=>t.transport===e))[0]),t&&this.unpipe(t),this}clear(){return this.unpipe(),this}close(){return this.clear(),this.emit("close"),this}setLevels(){f.deprecated("setLevels")}query(e,t){"function"==typeof e&&(t=e,e={}),e=e||{};const n={},r=Object.assign({},e.query||{});s(this.transports.filter((e=>!!e.query)),(function(t,i){!function(t,n){e.query&&"function"==typeof t.formatQuery&&(e.query=t.formatQuery(r)),t.query(e,((r,i)=>{if(r)return n(r);"function"==typeof t.formatResults&&(i=t.formatResults(i,e.format)),n(null,i)}))}(t,((e,r)=>{i&&((r=e||r)&&(n[t.name]=r),i()),i=null}))}),(()=>t(null,n)))}stream(e={}){const t=new r,n=[];return t._streams=n,t.destroy=()=>{let e=n.length;for(;e--;)n[e].destroy()},this.transports.filter((e=>!!e.stream)).forEach((r=>{const i=r.stream(e);i&&(n.push(i),i.on("log",(e=>{e.transport=e.transport||[],e.transport.push(r.name),t.emit("log",e)})),i.on("error",(e=>{e.transport=e.transport||[],e.transport.push(r.name),t.emit("error",e)})))})),t}startTimer(){return new d(this)}profile(e,...t){const n=Date.now();if(this.profilers[e]){const r=this.profilers[e];delete this.profilers[e],"function"==typeof t[t.length-2]&&(console.warn("Callback function no longer supported as of winston@3.0.0"),t.pop());const i="object"==typeof t[t.length-1]?t.pop():{};return i.level=i.level||"info",i.durationMs=n-r,i.message=i.message||e,this.write(i)}return this.profilers[e]=n,this}handleExceptions(...e){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...e)}unhandleExceptions(...e){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...e)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join("\n"))}_onEvent(e,t){t["__winston"+e]||(t["__winston"+e]=function(n){this.emit(e,n,t)}.bind(this),t.on(e,t["__winston"+e]))}_addDefaultMeta(e){this.defaultMeta&&Object.assign(e,this.defaultMeta)}}function v(e,t){const n=e[t];return n||0===n?n:null}Object.defineProperty(m.prototype,"transports",{configurable:!1,enumerable:!0,get(){const{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}}),e.exports=m},46:e=>{"use strict";e.exports=class{constructor(e){if(!e)throw new Error("Logger is required for profiling.");this.logger=e,this.start=Date.now()}done(...e){"function"==typeof e[e.length-1]&&(console.warn("Callback function no longer supported as of winston@3.0.0"),e.pop());const t="object"==typeof e[e.length-1]?e.pop():{};return t.level=t.level||"info",t.durationMs=Date.now()-this.start,this.logger.write(t)}}},5724:(e,t,n)=>{"use strict";const r=n(2087),i=n(8058),s=n(8713)("winston:rejection"),o=n(3138),a=n(7911),l=n(5193);e.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle rejections");this.logger=e,this.handlers=new Map}handle(...e){e.forEach((e=>{if(Array.isArray(e))return e.forEach((e=>this._addHandler(e)));this._addHandler(e)})),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach((e=>this.logger.unpipe(e))))}getAllInfo(e){let{message:t}=e;return t||"string"!=typeof e||(t=e),{error:e,level:"error",message:[`unhandledRejection: ${t||"(no error message)"}`,e.stack||" No stack trace"].join("\n"),stack:e.stack,exception:!0,date:(new Date).toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:r.loadavg(),uptime:r.uptime()}}getTrace(e){return(e?a.parse(e):a.get()).map((e=>({column:e.getColumnNumber(),file:e.getFileName(),function:e.getFunctionName(),line:e.getLineNumber(),method:e.getMethodName(),native:e.isNative()})))}_addHandler(e){if(!this.handlers.has(e)){e.handleExceptions=!0;const t=new l(e);this.handlers.set(e,t),this.logger.pipe(t)}}_unhandledRejection(e){const t=this.getAllInfo(e),n=this._getRejectionHandlers();let r,a="function"==typeof this.logger.exitOnError?this.logger.exitOnError(e):this.logger.exitOnError;function l(){s("doExit",a),s("process._exiting",process._exiting),a&&!process._exiting&&(r&&clearTimeout(r),process.exit(1))}if(!n.length&&a&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),a=!1),!n||0===n.length)return process.nextTick(l);i(n,((e,t)=>{const n=o(t),r=e.transport||e;function i(e){return()=>{s(e),n()}}r._ending=!0,r.once("finish",i("finished")),r.once("error",i("error"))}),(()=>a&&l())),this.logger.log(t),a&&(r=setTimeout(l,3e3))}_getRejectionHandlers(){return this.logger.transports.filter((e=>(e.transport||e).handleRejections))}}},4778:(e,t,n)=>{"use strict";const r=n(5747),{StringDecoder:i}=n(4304),{Stream:s}=n(514);function o(){}e.exports=(e,t)=>{const n=Buffer.alloc(65536),a=new i("utf8"),l=new s;let u="",c=0,h=0;return-1===e.start&&delete e.start,l.readable=!0,l.destroy=()=>{l.destroyed=!0,l.emit("end"),l.emit("close")},r.open(e.file,"a+","0644",((i,s)=>{if(i)return t?t(i):l.emit("error",i),void l.destroy();!function i(){if(!l.destroyed)return r.read(s,n,0,n.length,c,((r,s)=>{if(r)return t?t(r):l.emit("error",r),void l.destroy();if(!s)return u&&((null==e.start||h>e.start)&&(t?t(null,u):l.emit("line",u)),h++,u=""),setTimeout(i,1e3);let o=a.write(n.slice(0,s));t||l.emit("data",o),o=(u+o).split(/\n+/);const d=o.length-1;let f=0;for(;f<d;f++)(null==e.start||h>e.start)&&(t?t(null,o[f]):l.emit("line",o[f])),h++;return u=o[d],c+=s,i()}));r.close(s,o)}()})),t?l.destroy:l}},2158:(e,t,n)=>{"use strict";const r=n(2087),{LEVEL:i,MESSAGE:s}=n(5396),o=n(1037);e.exports=class extends o{constructor(e={}){super(e),this.name=e.name||"console",this.stderrLevels=this._stringArrayToSet(e.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(e.consoleWarnLevels),this.eol=e.eol||r.EOL,this.setMaxListeners(30)}log(e,t){return setImmediate((()=>this.emit("logged",e))),this.stderrLevels[e[i]]?(console._stderr?console._stderr.write(`${e[s]}${this.eol}`):console.error(e[s]),void(t&&t())):this.consoleWarnLevels[e[i]]?(console._stderr?console._stderr.write(`${e[s]}${this.eol}`):console.warn(e[s]),void(t&&t())):(console._stdout?console._stdout.write(`${e[s]}${this.eol}`):console.log(e[s]),void(t&&t()))}_stringArrayToSet(e,t){if(!e)return{};if(t=t||"Cannot make set from type other than Array of string elements",!Array.isArray(e))throw new Error(t);return e.reduce(((e,n)=>{if("string"!=typeof n)throw new Error(t);return e[n]=!0,e}),{})}}},9140:(e,t,n)=>{"use strict";const r=n(5747),i=n(5622),s=n(8415),o=n(8761),{MESSAGE:a}=n(5396),{Stream:l,PassThrough:u}=n(514),c=n(1037),h=n(8713)("winston:file"),d=n(2087),f=n(4778);e.exports=class extends c{constructor(e={}){function t(t,...n){n.slice(1).forEach((n=>{if(e[n])throw new Error(`Cannot set ${n} and ${t} together`)}))}if(super(e),this.name=e.name||"file",this._stream=new u,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),e.filename||e.dirname)t("filename or dirname","stream"),this._basename=this.filename=e.filename?i.basename(e.filename):"winston.log",this.dirname=e.dirname||i.dirname(e.filename),this.options=e.options||{flags:"a"};else{if(!e.stream)throw new Error("Cannot log to file without filename or stream.");console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),t("stream","filename","maxsize"),this._dest=this._stream.pipe(this._setupStream(e.stream)),this.dirname=i.dirname(this._dest.path)}this.maxsize=e.maxsize||null,this.rotationFormat=e.rotationFormat||!1,this.zippedArchive=e.zippedArchive||!1,this.maxFiles=e.maxFiles||null,this.eol=e.eol||d.EOL,this.tailable=e.tailable||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.open()}finishIfEnding(){this._ending&&(this._opening?this.once("open",(()=>{this._stream.once("finish",(()=>this.emit("finish"))),setImmediate((()=>this._stream.end()))})):(this._stream.once("finish",(()=>this.emit("finish"))),setImmediate((()=>this._stream.end()))))}log(e,t=(()=>{})){if(this.silent)return t(),!0;if(this._drain)return void this._stream.once("drain",(()=>{this._drain=!1,this.log(e,t)}));if(this._rotate)return void this._stream.once("rotate",(()=>{this._rotate=!1,this.log(e,t)}));const n=`${e[a]}${this.eol}`,r=Buffer.byteLength(n);this._pendingSize+=r,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);const i=this._stream.write(n,function(){this._size+=r,this._pendingSize-=r,h("logged %s %s",this._size,n),this.emit("logged",e),this._opening||this._needsNewFile()&&(this._rotate=!0,this._endStream((()=>this._rotateFile())))}.bind(this));return i?t():(this._drain=!0,this._stream.once("drain",(()=>{this._drain=!1,t()}))),h("written",i,this._drain),this.finishIfEnding(),i}query(e,t){"function"==typeof e&&(t=e,e={}),e=function(e){return(e=e||{}).rows=e.rows||e.limit||10,e.start=e.start||0,e.until=e.until||new Date,"object"!=typeof e.until&&(e.until=new Date(e.until)),e.from=e.from||e.until-864e5,"object"!=typeof e.from&&(e.from=new Date(e.from)),e.order=e.order||"desc",e.fields=e.fields,e}(e);const n=i.join(this.dirname,this.filename);let s="",o=[],a=0;const l=r.createReadStream(n,{encoding:"utf8"});function u(t,n){try{const n=JSON.parse(t);(function(t){if(!t)return;if("object"!=typeof t)return;const n=new Date(t.timestamp);return!(e.from&&n<e.from||e.until&&n>e.until||e.level&&e.level!==t.level)||void 0})(n)&&function(t){e.rows&&o.length>=e.rows&&"desc"!==e.order?l.readable&&l.destroy():(e.fields&&(t=e.fields.reduce(((e,n)=>(e[n]=t[n],e)),{})),"desc"===e.order&&o.length>=e.rows&&o.shift(),o.push(t))}(n)}catch(e){n||l.emit("error",e)}}l.on("error",(e=>{if(l.readable&&l.destroy(),t)return"ENOENT"!==e.code?t(e):t(null,o)})),l.on("data",(t=>{const n=(t=(s+t).split(/\n+/)).length-1;let r=0;for(;r<n;r++)(!e.start||a>=e.start)&&u(t[r]),a++;s=t[n]})),l.on("close",(()=>{s&&u(s,!0),"desc"===e.order&&(o=o.reverse()),t&&t(null,o)}))}stream(e={}){const t=i.join(this.dirname,this.filename),n=new l,r={file:t,start:e.start};return n.destroy=f(r,((e,t)=>{if(e)return n.emit("error",e);try{n.emit("data",t),t=JSON.parse(t),n.emit("log",t)}catch(e){n.emit("error",e)}})),n}open(){this.filename&&(this._opening||(this._opening=!0,this.stat(((e,t)=>{if(e)return this.emit("error",e);h("stat done: %s { size: %s }",this.filename,t),this._size=t,this._dest=this._createStream(this._stream),this._opening=!1,this.once("open",(()=>{this._stream.eventNames().includes("rotate")?this._stream.emit("rotate"):this._rotate=!1}))}))))}stat(e){const t=this._getFile(),n=i.join(this.dirname,t);r.stat(n,((r,i)=>r&&"ENOENT"===r.code?(h("ENOENT ok",n),this.filename=t,e(null,0)):r?(h(`err ${r.code} ${n}`),e(r)):!i||this._needsNewFile(i.size)?this._incFile((()=>this.stat(e))):(this.filename=t,void e(null,i.size))))}close(e){this._stream&&this._stream.end((()=>{e&&e(),this.emit("flush"),this.emit("closed")}))}_needsNewFile(e){return e=e||this._size,this.maxsize&&e>=this.maxsize}_onError(e){this.emit("error",e)}_setupStream(e){return e.on("error",this._onError),e}_cleanupStream(e){return e.removeListener("error",this._onError),e}_rotateFile(){this._incFile((()=>this.open()))}_endStream(e=(()=>{})){this._dest?(this._stream.unpipe(this._dest),this._dest.end((()=>{this._cleanupStream(this._dest),e()}))):e()}_createStream(e){const t=i.join(this.dirname,this.filename);h("create stream start",t,this.options);const n=r.createWriteStream(t,this.options).on("error",(e=>h(e))).on("close",(()=>h("close",n.path,n.bytesWritten))).on("open",(()=>{h("file open ok",t),this.emit("open",t),e.pipe(n),this.rotatedWhileOpening&&(this._stream=new u,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(n),e.end())}));if(h("create stream ok",t),this.zippedArchive){const e=o.createGzip();return e.pipe(n),e}return n}_incFile(e){h("_incFile",this.filename);const t=i.extname(this._basename),n=i.basename(this._basename,t);this.tailable?this._checkMaxFilesTailable(t,n,e):(this._created+=1,this._checkMaxFilesIncrementing(t,n,e))}_getFile(){const e=i.extname(this._basename),t=i.basename(this._basename,e),n=this.rotationFormat?this.rotationFormat():this._created,r=!this.tailable&&this._created?`${t}${n}${e}`:`${t}${e}`;return this.zippedArchive&&!this.tailable?`${r}.gz`:r}_checkMaxFilesIncrementing(e,t,n){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(n);const s=this._created-this.maxFiles,o=`${t}${0!==s?s:""}${e}${this.zippedArchive?".gz":""}`,a=i.join(this.dirname,o);r.unlink(a,n)}_checkMaxFilesTailable(e,t,n){const o=[];if(!this.maxFiles)return;const a=this.zippedArchive?".gz":"";for(let n=this.maxFiles-1;n>1;n--)o.push(function(n,s){let o=`${t}${n-1}${e}${a}`;const l=i.join(this.dirname,o);r.exists(l,(u=>{if(!u)return s(null);o=`${t}${n}${e}${a}`,r.rename(l,i.join(this.dirname,o),s)}))}.bind(this,n));s(o,(()=>{r.rename(i.join(this.dirname,`${t}${e}`),i.join(this.dirname,`${t}1${e}${a}`),n)}))}_createLogDirIfNotExist(e){r.existsSync(e)||r.mkdirSync(e,{recursive:!0})}}},1734:(e,t,n)=>{"use strict";const r=n(8605),i=n(7211),{Stream:s}=n(514),o=n(1037);e.exports=class extends o{constructor(e={}){super(e),this.name=e.name||"http",this.ssl=!!e.ssl,this.host=e.host||"localhost",this.port=e.port,this.auth=e.auth,this.path=e.path||"",this.agent=e.agent,this.headers=e.headers||{},this.headers["content-type"]="application/json",this.port||(this.port=this.ssl?443:80)}log(e,t){this._request(e,((t,n)=>{n&&200!==n.statusCode&&(t=new Error(`Invalid HTTP Status Code: ${n.statusCode}`)),t?this.emit("warn",t):this.emit("logged",e)})),t&&setImmediate(t)}query(e,t){"function"==typeof e&&(t=e,e={}),(e={method:"query",params:this.normalizeQuery(e)}).params.path&&(e.path=e.params.path,delete e.params.path),e.params.auth&&(e.auth=e.params.auth,delete e.params.auth),this._request(e,((e,n,r)=>{if(n&&200!==n.statusCode&&(e=new Error(`Invalid HTTP Status Code: ${n.statusCode}`)),e)return t(e);if("string"==typeof r)try{r=JSON.parse(r)}catch(e){return t(e)}t(null,r)}))}stream(e={}){const t=new s;(e={method:"stream",params:e}).params.path&&(e.path=e.params.path,delete e.params.path),e.params.auth&&(e.auth=e.params.auth,delete e.params.auth);let n="";const r=this._request(e);return t.destroy=()=>r.destroy(),r.on("data",(e=>{const r=(e=(n+e).split(/\n+/)).length-1;let i=0;for(;i<r;i++)try{t.emit("log",JSON.parse(e[i]))}catch(e){t.emit("error",e)}n=e[r]})),r.on("error",(e=>t.emit("error",e))),t}_request(e,t){const n=(e=e||{}).auth||this.auth,s=e.path||this.path||"";delete e.auth,delete e.path;const o=(this.ssl?i:r).request({method:"POST",host:this.host,port:this.port,path:`/${s.replace(/^\//,"")}`,headers:this.headers,auth:n?`${n.username}:${n.password}`:"",agent:this.agent});o.on("error",t),o.on("response",(e=>e.on("end",(()=>t(null,e))).resume())),o.end(Buffer.from(JSON.stringify(e),"utf8"))}}},9840:(e,t,n)=>{"use strict";Object.defineProperty(t,"Console",{configurable:!0,enumerable:!0,get:()=>n(2158)}),Object.defineProperty(t,"File",{configurable:!0,enumerable:!0,get:()=>n(9140)}),Object.defineProperty(t,"Http",{configurable:!0,enumerable:!0,get:()=>n(1734)}),Object.defineProperty(t,"Stream",{configurable:!0,enumerable:!0,get:()=>n(4635)})},4635:(e,t,n)=>{"use strict";const r=n(4970),{MESSAGE:i}=n(5396),s=n(2087),o=n(1037);e.exports=class extends o{constructor(e={}){if(super(e),!e.stream||!r(e.stream))throw new Error("options.stream is required.");this._stream=e.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=e.stream._writableState.objectMode,this.eol=e.eol||s.EOL}log(e,t){if(setImmediate((()=>this.emit("logged",e))),this.isObjectMode)return this._stream.write(e),void(t&&t());this._stream.write(`${e[i]}${this.eol}`),t&&t()}}},7897:e=>{"use strict";const t={};function n(e,n,r){r||(r=Error);class i extends r{constructor(e,t,r){super(function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(e,t,r))}}i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){const n=e.length;return e=e.map((e=>String(e))),n>2?`one of ${t} ${e.slice(0,n-1).join(", ")}, or `+e[n-1]:2===n?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){let i;var s;let o;var a,l;return"string"==typeof t&&(s="not ",t.substr(0,s.length)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",o=function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument")?`The ${e} ${i} ${r(t,"type")}`:`The "${e}" ${a=e,"number"!=typeof l&&(l=0),l+".".length>a.length||-1===a.indexOf(".",l)?"argument":"property"} ${i} ${r(t,"type")}`,o+=". Received type "+typeof n,o}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6068:(e,t,n)=>{"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var i=n(3680),s=n(3450);n(4378)(u,i);for(var o=r(s.prototype),a=0;a<o.length;a++){var l=o[a];u.prototype[l]||(u.prototype[l]=s.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);i.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",c)))}function c(){this._writableState.ended||process.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.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)}})},9812:(e,t,n)=>{"use strict";e.exports=i;var r=n(4791);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(4378)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},3680:(e,t,n)=>{"use strict";var r;e.exports=C,C.ReadableState=x,n(8614).EventEmitter;var i,s=function(e,t){return e.listeners(t).length},o=n(1160),a=n(4293).Buffer,l=global.Uint8Array||function(){},u=n(1669);i=u&&u.debuglog?u.debuglog("stream"):function(){};var c,h,d,f=n(9428),g=n(502),p=n(7727).getHighWaterMark,m=n(7897).q,v=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,y=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(4378)(C,o);var E=g.errorOrDestroy,_=["error","close","destroy","pause","resume"];function x(e,t,i){r=r||n(6068),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",i),this.buffer=new f,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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=n(1227).s),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function C(e){if(r=r||n(6068),!(this instanceof C))return new C(e);var t=this instanceof r;this._readableState=new x(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,n,r,s){i("readableAddChunk",t);var o,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,k(e)))}}(e,u);else if(s||(o=function(e,t){var n,r;return r=t,a.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new v("chunk",["string","Buffer","Uint8Array"],t)),n}(u,t)),o)E(e,o);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),r)u.endEmitted?E(e,new w):S(e,u,t,!0);else if(u.ended)E(e,new b);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?S(e,u,t,!1):F(e,u)):S(e,u,t,!1)}else r||(u.reading=!1,F(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function S(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&A(e)),F(e,t)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),C.prototype.destroy=g.destroy,C.prototype._undestroy=g.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=a.from(e,t),t=""),n=!0),M(this,e,t,!1,n)},C.prototype.unshift=function(e){return M(this,e,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(e){c||(c=n(1227).s);var t=new c(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var D=1073741824;function T(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=D?e=D:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(k,e))}function k(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,P(e)}function F(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function j(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){i("readable nexttick read 0"),e.read(0)}function I(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),P(e),t.flowing&&!t.reading&&e.read(0)}function P(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function $(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function L(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(R,t,e))}function R(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}C.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):A(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&L(this),null;var r,s=t.needReadable;return i("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",s=!0),t.ended||t.reading?i("reading or ended",s=!1):s&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=T(n,t))),null===(r=e>0?$(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&L(this)),null!==r&&this.emit("data",r),r},C.prototype._read=function(e){E(this,new y("_read()"))},C.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var o=t&&!1===t.end||e===process.stdout||e===process.stderr?g:a;function a(){i("onend"),e.end()}r.endEmitted?process.nextTick(o):n.once("end",o),e.on("unpipe",(function t(s,o){i("onunpipe"),s===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,i("cleanup"),e.removeListener("close",d),e.removeListener("finish",f),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",t),n.removeListener("end",a),n.removeListener("end",g),n.removeListener("data",c),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(n);e.on("drain",l);var u=!1;function c(t){i("ondata");var s=e.write(t);i("dest.write",s),!1===s&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==N(r.pipes,e))&&!u&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function h(t){i("onerror",t),g(),e.removeListener("error",h),0===s(e,"error")&&E(e,t)}function d(){e.removeListener("finish",f),g()}function f(){i("onfinish"),e.removeListener("close",d),g()}function g(){i("unpipe"),n.unpipe(e)}return n.on("data",c),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on(t,n)}(e,"error",h),e.once("close",d),e.once("finish",f),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=N(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},C.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?A(this):r.reading||process.nextTick(B,this))),n},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(j,this),n},C.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(j,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(I,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var s in e.on("end",(function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){i("wrapped data"),n.decoder&&(s=n.decoder.write(s)),n.objectMode&&null==s||(n.objectMode||s&&s.length)&&(t.push(s)||(r=!0,e.pause()))})),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var o=0;o<_.length;o++)e.on(_[o],this.emit.bind(this,_[o]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=n(5604)),h(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),C._fromList=$,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(C.from=function(e,t){return void 0===d&&(d=n(7285)),d(C,e,t)})},4791:(e,t,n)=>{"use strict";e.exports=c;var r=n(7897).q,i=r.ERR_METHOD_NOT_IMPLEMENTED,s=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,l=n(6068);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new s);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.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",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,n){d(e,t,n)}))}function d(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new a;if(e._transformState.transforming)throw new o;return e.push(null)}n(4378)(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,n){n(new i("_transform()"))},c.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,(function(e){t(e)}))}},3450:(e,t,n)=>{"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=C,C.WritableState=x;var s,o={deprecate:n(1159)},a=n(1160),l=n(4293).Buffer,u=global.Uint8Array||function(){},c=n(502),h=n(7727).getHighWaterMark,d=n(7897).q,f=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,p=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,v=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,y=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,E=c.errorOrDestroy;function _(){}function x(e,t,s){i=i||n(6068),e=e||{},"boolean"!=typeof s&&(s=t instanceof i),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(k,e,t),e._writableState.errorEmitted=!0,E(e,r)):(i(r),e._writableState.errorEmitted=!0,E(e,r),k(e,t))}(e,n,r,t,i);else{var s=T(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||D(e,n),r?process.nextTick(S,e,n,s,i):S(e,n,s,i)}}(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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function C(e){var t=this instanceof(i=i||n(6068));if(!t&&!s.call(C,this))return new C(e);this._writableState=new x(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function M(e,t,n,r,i,s,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function S(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),k(e,t)}function D(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,s=new Array(i),o=t.corkedRequestsFree;o.entry=n;for(var a=0,l=!0;n;)s[a]=n,n.isBuf||(l=!1),n=n.next,a+=1;s.allBuffers=l,M(e,t,!0,t.length,s,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,h=n.callback;if(M(e,t,!1,t.objectMode?1:u.length,u,c,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function T(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(n){t.pendingcb--,n&&E(e,n),t.prefinished=!0,e.emit("prefinish"),k(e,t)}))}function k(e,t){var n=T(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(A,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(4378)(C,a),x.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(x.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===C&&e&&e._writableState instanceof x}})):s=function(e){return e instanceof this},C.prototype.pipe=function(){E(this,new m)},C.prototype.write=function(e,t,n){var r,i=this._writableState,s=!1,o=!i.objectMode&&(r=e,l.isBuffer(r)||r instanceof u);return o&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=_),i.ending?function(e,t){var n=new y;E(e,n),process.nextTick(t,n)}(this,n):(o||function(e,t,n,r){var i;return null===n?i=new b:"string"==typeof n||t.objectMode||(i=new f("chunk",["string","Buffer"],n)),!i||(E(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,s=function(e,t,n,r,i,s){if(!n){var o=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,n)),t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:s,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else M(e,t,!1,a,r,i,s);return u}(this,i,o,e,t,n)),s},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||D(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,n){n(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,k(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=c.destroy,C.prototype._undestroy=c.undestroy,C.prototype._destroy=function(e,t){t(e)}},5604:(e,t,n)=>{"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(6706),o=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function g(e){var t=e[o];if(null!==t){var n=e[d].read();null!==n&&(e[c]=null,e[o]=null,e[a]=null,t(f(n,!1)))}}function p(e){process.nextTick(g,e)}var m=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){process.nextTick((function(){e[l]?n(e[l]):t(f(void 0,!0))}))}));var n,r=this[c];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[u]?n(f(void 0,!0)):t[h](n,r)}),r)}}(r,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(f(i,!1));n=new Promise(this[h])}return this[c]=n,n}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[d].destroy(null,(function(e){e?n(e):t(f(void 0,!0))}))}))})),r),m);e.exports=function(e){var t,n=Object.create(v,(i(t={},d,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,h,{value:function(e,t){var r=n[d].read();r?(n[c]=null,n[o]=null,n[a]=null,e(f(r,!1))):(n[o]=e,n[a]=t)},writable:!0}),t));return n[c]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[a];return null!==t&&(n[c]=null,n[o]=null,n[a]=null,t(e)),void(n[l]=e)}var r=n[o];null!==r&&(n[c]=null,n[o]=null,n[a]=null,r(f(void 0,!0))),n[u]=!0})),e.on("readable",p.bind(null,n)),n}},9428:(e,t,n)=>{"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=n(4293).Buffer,a=n(1669).inspect,l=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=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 t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,n,r,i=o.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,n=i,r=a,o.prototype.copy.call(t,n,r),a+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?r+=i:r+=i.slice(0,e),0==(e-=s)){s===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(s));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&s(t.prototype,n),e}()},502:e=>{"use strict";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?s._writableState?s._writableState.errorEmitted?process.nextTick(n,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,e)):process.nextTick(t,s,e):i?(process.nextTick(n,s),i(e)):process.nextTick(n,s)})),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,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},6706:(e,t,n)=>{"use strict";var r=n(7897).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,s){if("function"==typeof n)return e(t,null,n);n||(n={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(s||i);var o=n.readable||!1!==n.readable&&t.readable,a=n.writable||!1!==n.writable&&t.writable,l=function(){t.writable||c()},u=t._writableState&&t._writableState.finished,c=function(){a=!1,u=!0,o||s.call(t)},h=t._readableState&&t._readableState.endEmitted,d=function(){o=!1,h=!0,a||s.call(t)},f=function(e){s.call(t,e)},g=function(){var e;return o&&!h?(t._readableState&&t._readableState.ended||(e=new r),s.call(t,e)):a&&!u?(t._writableState&&t._writableState.ended||(e=new r),s.call(t,e)):void 0},p=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",g),t.req?p():t.on("request",p)):a&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",d),t.on("finish",c),!1!==n.error&&t.on("error",f),t.on("close",g),function(){t.removeListener("complete",c),t.removeListener("abort",g),t.removeListener("request",p),t.req&&t.req.removeListener("finish",c),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",c),t.removeListener("end",d),t.removeListener("error",f),t.removeListener("close",g)}}},7285:(e,t,n)=>{"use strict";function r(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,s){var o=e.apply(t,n);function a(e){r(o,i,s,a,l,"next",e)}function l(e){r(o,i,s,a,l,"throw",e)}a(void 0)}))}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(7897).q.ERR_INVALID_ARG_TYPE;e.exports=function(e,t,n){var r;if(t&&"function"==typeof t.next)r=t;else if(t&&t[Symbol.asyncIterator])r=t[Symbol.asyncIterator]();else{if(!t||!t[Symbol.iterator])throw new a("iterable",["Iterable"],t);r=t[Symbol.iterator]()}var l=new e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({objectMode:!0},n)),u=!1;function c(){return h.apply(this,arguments)}function h(){return(h=i((function*(){try{var e=yield r.next(),t=e.value;e.done?l.push(null):l.push(yield t)?c():u=!1}catch(e){l.destroy(e)}}))).apply(this,arguments)}return l._read=function(){u||(u=!0,c())},l}},3967:(e,t,n)=>{"use strict";var r,i=n(7897).q,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function l(e,t,i,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var a=!1;e.on("close",(function(){a=!0})),void 0===r&&(r=n(6706)),r(e,{readable:t,writable:i},(function(e){if(e)return s(e);a=!0,s()}));var l=!1;return function(t){if(!a&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new o("pipe"))}}function u(e){e()}function c(e,t){return e.pipe(t)}function h(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=h(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var o=t.map((function(e,n){var s=n<t.length-1;return l(e,s,n>0,(function(e){r||(r=e),e&&o.forEach(u),s||(o.forEach(u),i(r))}))}));return t.reduce(c)}},7727:(e,t,n)=>{"use strict";var r=n(7897).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var s=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(i?n:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},1160:(e,t,n)=>{e.exports=n(2413)},514:(e,t,n)=>{var r=n(2413);"disable"===process.env.READABLE_STREAM&&r?(e.exports=r.Readable,Object.assign(e.exports,r),e.exports.Stream=r):((t=e.exports=n(3680)).Stream=r||t,t.Readable=t,t.Writable=n(3450),t.Duplex=n(6068),t.Transform=n(4791),t.PassThrough=n(9812),t.finished=n(6706),t.pipeline=n(3967))},2091:(e,t,n)=>{var r=n(4293),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},1227:(e,t,n)=>{"use strict";var r=n(2091).Buffer,i=r.isEncoding||function(e){switch((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}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)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(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},s.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},6141:e=>{"use strict";e.exports={i8:"3.2.1"}},4293:e=>{"use strict";e.exports=require("buffer")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},8605:e=>{"use strict";e.exports=require("http")},7211:e=>{"use strict";e.exports=require("https")},2282:e=>{"use strict";e.exports=require("module")},1631:e=>{"use strict";e.exports=require("net")},2087:e=>{"use strict";e.exports=require("os")},5622:e=>{"use strict";e.exports=require("path")},2413:e=>{"use strict";e.exports=require("stream")},4304:e=>{"use strict";e.exports=require("string_decoder")},3867:e=>{"use strict";e.exports=require("tty")},1669:e=>{"use strict";e.exports=require("util")},2184:e=>{"use strict";e.exports=require("vm")},8761:e=>{"use strict";e.exports=require("zlib")}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";n.r(r),n.d(r,{activate:()=>Le,deactivate:()=>Re});const e=require("vscode");var t=n.n(e);const i=require("child_process");var s=n(5622),o=n.n(s),a=n(9562),l=n(1440),u=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class c{constructor(e,n){this.disposables=[],this.sendToVim=e=>{this.client.input(e)},this.ctrlAInsert=()=>u(this,void 0,void 0,(function*(){const e=t().window.activeTextEditor;if(!e)return;const n=yield this.client.callFunction("VSCodeGetLastInsertText");n.length&&(yield e.edit((t=>t.insert(e.selection.active,n.join("\n")))))})),this.scrollPage=(e,n)=>{t().commands.executeCommand("editorScroll",{to:n,by:e,revealCursor:!0})},this.scrollLine=e=>{t().commands.executeCommand("editorScroll",{to:e,by:"line",revealCursor:this.revealCursorScrollLine})},this.goToLine=e=>{const n=t().window.activeTextEditor;if(!n)return;const r=n.visibleRanges[0].start.line,i=n.visibleRanges[0].end.line,s="top"===e?r:"bottom"===e?i:Math.floor(r+(i-r)/2),o=n.document.lineAt(s);n.selections=[new(t().Selection)(s,o.firstNonWhitespaceCharacterIndex,s,o.firstNonWhitespaceCharacterIndex)]},this.revealLine=(e,n=!1)=>{const r=t().window.activeTextEditor;if(!r)return;const i=r.selection.active;if(t().commands.executeCommand("revealLine",{lineNumber:i.line,at:e}),n){const e=r.document.lineAt(i.line);r.selections=[new(t().Selection)(i.line,e.firstNonWhitespaceCharacterIndex,i.line,e.firstNonWhitespaceCharacterIndex)]}},this.client=e,this.revealCursorScrollLine=n,this.disposables.push(t().commands.registerCommand("vscode-neovim.ctrl-a-insert",this.ctrlAInsert)),this.disposables.push(t().commands.registerCommand("vscode-neovim.send",(e=>this.sendToVim(e)))),this.disposables.push(t().commands.registerCommand("vscode-neovim.paste-register",(e=>this.pasteFromRegister(e)))),this.disposables.push(t().commands.registerCommand("vscode-neovim.ctrl-f",(()=>this.scrollPage("page","down")))),this.disposables.push(t().commands.registerCommand("vscode-neovim.ctrl-b",(()=>this.scrollPage("page","up")))),this.disposables.push(t().commands.registerCommand("vscode-neovim.ctrl-d",(()=>this.scrollPage("halfPage","down")))),this.disposables.push(t().commands.registerCommand("vscode-neovim.ctrl-u",(()=>this.scrollPage("halfPage","up")))),this.disposables.push(t().commands.registerCommand("vscode-neovim.ctrl-e",(()=>this.scrollLine("down")))),this.disposables.push(t().commands.registerCommand("vscode-neovim.ctrl-y",(()=>this.scrollLine("up"))))}dispose(){for(const e of this.disposables)e.dispose()}handleExtensionRequest(e,n){return u(this,void 0,void 0,(function*(){switch(e){case"reveal":{const[e,t]=n;this.revealLine(e,!!t);break}case"move-cursor":{const[e]=n;this.goToLine(e);break}case"scroll":{const[e,t]=n;this.scrollPage(e,t);break}case"scroll-line":{const[e]=n;this.scrollLine(e);break}case"insert-line":{const[e]=n;yield this.client.command("startinsert"),yield t().commands.executeCommand("before"===e?"editor.action.insertLineBefore":"editor.action.insertLineAfter");break}}}))}pasteFromRegister(e){return u(this,void 0,void 0,(function*(){const n=t().window.activeTextEditor;if(!n)return;const r=yield this.client.callFunction("VSCodeGetRegister",[e]);""!==r&&(yield n.edit((e=>e.insert(n.selection.active,r))))}))}}var h=n(8614);const d=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],f={nul:0,control:0};function g(e,t){let n=f;if(t&&(n={...f,...t}),"string"!=typeof e)return p(e,n);let r=0;for(let t=0;t<e.length;t++){const i=p(e.charCodeAt(t),n);if(i<0)return-1;r+=i}return r}function p(e,t=f){return 0===e?t.nul:e<32||e>=127&&e<160?t.control:function(e){let t,n=0,r=d.length-1;if(e<d[0][0]||e>d[r][1])return!1;for(;r>=n;)if(t=Math.floor((n+r)/2),e>d[t][1])n=t+1;else{if(!(e<d[t][0]))return!0;r=t-1}return!1}(e)?0:1+Number(e>=4352&&(e<=4447||9001===e||9002===e||e>=11904&&e<=42191&&12351!==e||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))}const m="vscode-neovim",v=`asvetliakov.${m}`;function b(e,t){const n=[],r={};n[0]="";const i=(e,t)=>{let i="",s=0,o=-1,a=n.length;for(;o<e.length-1;){o=e.indexOf("\n",s),-1==o&&(o=e.length-1);let l=e.substring(s,o+1);(r.hasOwnProperty?r.hasOwnProperty(l):void 0!==r[l])?i+=String.fromCharCode(r[l]):(a==t&&(l=e.substring(s),o=e.length),i+=String.fromCharCode(a),r[l]=a,n[a++]=l),s=o+1}return i};return{chars1:i(e,4e4),chars2:i(t,65535),lineArray:n}}function y(e){const t=[];let n,r=0,i=0,s=0;for(let o=0;o<e.length;o++){const[a,l]=e[o];if(0===a)n&&("changed"===n.type?(r+=n.end-n.start+1,i+=n.newEnd-n.newStart+1):"added"===n.type?i+=Math.abs(s):"removed"===n.type&&(r+=Math.abs(s)),t.push(n),n=void 0,s=0),r+=l.length,i+=l.length;else if(n||(n={start:r,end:r,newStart:i,newEnd:i,type:"changed"},s=0),-1===a){if(1===l.length&&e[o+1]&&1===e[o+1][0]&&1===e[o+1][1].length){o++;continue}n.type="removed",n.end+=l.length-1,s=-l.length}else"removed"===n.type?n.type="changed":n.type="added",n.newEnd+=l.length-1,s+=l.length}return n&&t.push(n),t}function w(e){return null==e?0:e<=127?1:e<=2047?2:e>=55296&&e<=57343?4:e<65535?3:4}function E(e,t){let n=0,r=0;for(;n<t;){if(r>=e.length)return r+(t-n);n+=w(e.codePointAt(r)),r++}return r}function _(e,t,n=1,r=!1){if(0===t||!e)return 0;let i=0,s=0;for(;s<t;)if(s+="\t"===e[i]?n-s%n:r?w(e.codePointAt(i)):g(e[i]),i++,i>=e.length)return i;return i}function x(e,t){const n=t.text.length,r=t.rangeOffset,i=t.rangeOffset+n;return e.rangeOffset>=r&&e.rangeOffset<=i||e.rangeOffset<r&&e.rangeOffset+e.rangeLength>=r}function C(e,t,n){if(e.range.contains(t))return!0;if(e.range.isSingleLine&&e.text){const r=e.text.split(n),i=r.length,s=e.range.start.line+i-1,o=e.range.end.character+r.slice(-1)[0].length;if(s>=t.line&&o>=t.character)return!0}return!1}function M(t,n){const r=e.workspace.getConfiguration(m),i=r.get("useWSL"),s=process.platform;return n.environmentVariableName&&process.env[n.environmentVariableName]||r.get(n.vscodeSettingName)||(i&&"win32"===s?r.get(`${t}.linux`):r.get(`${t}.${s}`))}function S(e,t,n){return{rangeLength:e.rangeLength,rangeOffset:e.rangeOffset,text:e.text,startMode:n,eol:t}}function D(e,t){const n=Object.assign({},t),r=e.rangeOffset<=t.rangeOffset?e.rangeOffset-t.rangeOffset+e.rangeLength:e.rangeLength,i=e.rangeOffset<=t.rangeOffset?0:e.rangeOffset-t.rangeOffset,s=e.rangeOffset-t.rangeOffset+r;return n.text=t.text.slice(0,i)+e.text+t.text.slice(s),e.rangeOffset<t.rangeOffset&&(n.rangeOffset=e.rangeOffset,n.rangeLength+=e.rangeLength),n}function T(e,t){const n=function(e,t){if(0===t||!e)return 0;let n=0,r=0;for(;n<t;)if(r+=w(e.codePointAt(n)),n++,n>=e.length)return r;return r}(e.document.lineAt(t.line).text,t.character);return[t.line+1,n]}function A(e){try{return T(e,e.selection.active)}catch(e){return[1,0]}}function k(t){const n=t.eol===e.EndOfLine.CRLF?"\r\n":"\n";return t.getText().split(n)}function F(e,t=!0){let n=e.replace(/</g,"<LT>");return t&&(n=n.replace(/\n/g,"<CR>")),n}function O(e,t){for(let n=t.length-1;n>=0;n--){const[r]=t[n];if(r===e)return t[n]}}function j(e,t,n,r=""){return i=this,s=void 0,a=function*(){const i=yield e.callAtomic(t),s=[];i&&Array.isArray(i)&&Array.isArray(i[0])&&i[0].forEach(((e,n)=>{if(e){const r=t[n];"nvim_input"!==(null==r?void 0:r[0])&&s.push(`${(null==r?void 0:r[0])||"Unknown"}: ${e}`)}})),s.length&&n.error(`${r}:\n${s.join("\n")}`)},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,s||[])).next())}));var i,s,o,a}class B{constructor(t,n){this.logger=t,this.client=n,this.disposables=[],this.mode="",this.isRecording=!1,this.eventEmitter=new h.EventEmitter,this.onDidChangeActiveTextEditor=()=>{this.isNormalMode||e.commands.executeCommand("vscode-neovim.escape")},this.disposables.push(e.window.onDidChangeActiveTextEditor(this.onDidChangeActiveTextEditor))}dispose(){this.disposables.forEach((e=>e.dispose()))}get currentMode(){return this.mode}get isInsertMode(){return"insert"===this.mode}get isVisualMode(){return"visual"===this.mode}get isNormalMode(){return"normal"===this.mode}get isRecordingInInsertMode(){return this.isRecording}onModeChange(e){this.eventEmitter.on("neovimModeChanged",e)}handleRedrawBatch(t){const n=O("mode_change",t);if(n){const t=n[1];if(t&&t[0]&&t[0]!==this.mode){const n=t[0];this.logger.debug(`ModeManager: Changing mode to ${n}`),this.mode=n,!this.isInsertMode&&this.isRecording&&(this.isRecording=!1,e.commands.executeCommand("setContext","neovim.recording",!1)),e.commands.executeCommand("setContext","neovim.mode",this.mode),this.eventEmitter.emit("neovimModeChanged",n)}}}handleExtensionRequest(t){return n=this,r=void 0,s=function*(){"notify-recording"===t&&(this.logger.debug("ModeManager: setting recording flag"),this.isRecording=!0,e.commands.executeCommand("setContext","neovim.recording",!0))},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}l((s=s.apply(n,r||[])).next())}));var n,r,i,s}}const I=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},P="object"==typeof global&&global&&global.Object===Object&&global;var $="object"==typeof self&&self&&self.Object===Object&&self;const L=P||$||Function("return this")(),R=function(){return L.Date.now()};var N=/\s/;var q=/^\s+/;const U=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&N.test(e.charAt(t)););return t}(e)+1).replace(q,""):e},W=L.Symbol;var H=Object.prototype,V=H.hasOwnProperty,z=H.toString,G=W?W.toStringTag:void 0;var Y=Object.prototype.toString;var K=W?W.toStringTag:void 0;const J=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":K&&K in Object(e)?function(e){var t=V.call(e,G),n=e[G];try{e[G]=void 0;var r=!0}catch(e){}var i=z.call(e);return r&&(t?e[G]=n:delete e[G]),i}(e):function(e){return Y.call(e)}(e)};var X=/^[-+]0x[0-9a-f]+$/i,Z=/^0b[01]+$/i,Q=/^0o[0-7]+$/i,ee=parseInt;const te=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==J(e)}(e))return NaN;if(I(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=I(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=U(e);var n=Z.test(e);return n||Q.test(e)?ee(e.slice(2),n?2:8):X.test(e)?NaN:+e};var ne=Math.max,re=Math.min;const ie=function(e,t,n){var r,i,s,o,a,l,u=0,c=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,s=i;return r=i=void 0,u=t,o=e.apply(s,n)}function g(e){return u=e,a=setTimeout(m,t),c?f(e):o}function p(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=s}function m(){var e=R();if(p(e))return v(e);a=setTimeout(m,function(e){var n=t-(e-l);return h?re(n,s-(e-u)):n}(e))}function v(e){return a=void 0,d&&r?f(e):(r=i=void 0,o)}function b(){var e=R(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return g(l);if(h)return clearTimeout(a),a=setTimeout(m,t),f(l)}return void 0===a&&(a=setTimeout(m,t)),o}return t=te(t)||0,I(n)&&(c=!!n.leading,s=(h="maxWait"in n)?ne(te(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=i=a=void 0},b.flush=function(){return void 0===a?o:v(R())},b};var se=n(1810),oe=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const ae="BufferManager",le="__vscode_neovim__-";class ue{constructor(t,n,r){this.logger=t,this.client=n,this.settings=r,this.disposables=[],this.openedEditors=[],this.externalTextDocuments=new Set,this.textDocumentToBufferId=new Map,this.textEditorToWinId=new Map,this.winIdToEditor=new Map,this.grids=new Map,this.editorTabConfiguration=new WeakMap,this.onDidCloseTextDocument=e=>{this.openedEditors.find((t=>t.document===e))||this.textDocumentToBufferId.delete(e)},this.onDidChangeVisibleTextEditors=()=>{this.logger.debug("BufferManager: onDidChangeVisibleTextEditors"),this.changeLayoutPromise||(this.changeLayoutPromise=new Promise((e=>this.changeLayoutPromiseResolve=e))),this.syncLayoutDebounced()},this.onDidChangeActiveTextEditor=()=>{this.logger.debug("BufferManager: onDidChangeActiveTextEditor"),this.syncActiveEditorDebounced()},this.syncLayout=()=>oe(this,void 0,void 0,(function*(){this.logger.debug("BufferManager: syncing layout");const t=[...e.window.visibleTextEditors],n=this.openedEditors,r=[];this.logger.debug("BufferManager: new/changed editors/windows");for(const e of t){if(this.logger.debug(`BufferManager: Visible editor, viewColumn: ${e.viewColumn}, doc: ${e.document.uri.toString()}`),!this.textDocumentToBufferId.has(e.document)){this.logger.debug("BufferManager: Document not known, init in neovim");const t=yield this.client.createBuffer(!1,!0);if("number"==typeof t){this.logger.error(`BufferManager: Cannot create a buffer, code: ${t}`);continue}yield this.initBufferForDocument(e.document,t,e),this.logger.debug(`BufferManager: Document: ${e.document.uri.toString()}, BufId: ${t.id}`),this.textDocumentToBufferId.set(e.document,t.id)}const t=this.textDocumentToBufferId.get(e.document);let n;try{if(!this.textEditorToWinId.has(e)){this.logger.debug(`BufferManager: Creating new neovim window for ${e.viewColumn} column (undefined is OK here)`),n=yield this.createNeovimWindow(t),this.logger.debug(`BufferManager: Created new window: ${n}`),this.logger.debug(`BufferManager: ViewColumn: ${e.viewColumn} - WinId: ${n}`);const r=A(e);this.logger.debug(`BufferManager: Setting buffer: ${t} to win: ${n}, cursor: [${r[0]}, ${r[1]}]`),yield this.client.request("nvim_win_set_cursor",[n,r]),this.textEditorToWinId.set(e,n),this.winIdToEditor.set(n,e)}}catch(e){this.logger.error(`BufferManager: ${e.message}`);continue}}this.logger.debug("BufferManager: Closing non visible editors");for(const e of n){if(t.includes(e)){this.logger.debug(`BufferManager: Editor viewColumn: ${e.viewColumn}, visibility hasn't changed, skip`);continue}const n=e.document;if(!t.find((e=>e.document===n))&&n.isClosed){this.logger.debug(`BufferManager: Document ${n.uri.toString()} is not visible and closed, unloading buffer id: ${this.textDocumentToBufferId.get(n)}`);const e=this.textDocumentToBufferId.get(n);this.textDocumentToBufferId.delete(n),e&&r.push(["nvim_command",[`bdelete! ${e}`]])}const i=this.textEditorToWinId.get(e);i&&(this.logger.debug(`BufferManager: Editor viewColumn: ${e.viewColumn}, winId: ${i}, closing`),this.textEditorToWinId.delete(e),this.winIdToEditor.delete(i),r.push(["nvim_win_close",[i,!0]]))}yield j(this.client,r,this.logger,ae),this.openedEditors=t,this.changeLayoutPromiseResolve&&this.changeLayoutPromiseResolve(),this.changeLayoutPromise=void 0})),this.syncLayoutDebounced=ie(this.syncLayout,200,{leading:!1,trailing:!0}),this.syncActiveEditor=()=>oe(this,void 0,void 0,(function*(){this.logger.debug("BufferManager: syncing active editor"),yield this.waitForLayoutSync();const t=e.window.activeTextEditor;if(!t)return;const n=this.textEditorToWinId.get(t);n?(this.logger.debug(`BufferManager: Setting active editor - viewColumn: ${t.viewColumn}, winId: ${n}`),yield this.client.request("nvim_set_current_win",[n])):this.logger.warn(`BufferManager: Unable to determine neovim windows id for editor viewColumn: ${t.viewColumn}, docUri: ${t.document.uri.toString()}`)})),this.syncActiveEditorDebounced=ie(this.syncActiveEditor,100,{leading:!1,trailing:!0}),this.onDidChangeEditorOptions=e=>{this.logger.debug("BufferManager: Received onDidChangeEditorOptions");const t=this.textDocumentToBufferId.get(e.textEditor.document);if(!t)return void this.logger.warn("BufferManager: No buffer for onDidChangeEditorOptions, skipping");const n=this.editorTabConfiguration.get(e.textEditor);n&&n.insertSpaces===e.options.insertSpaces&&n.tabSize===e.options.tabSize||(this.logger.debug(`BufferManager: Updating tab options for bufferId: ${t}`),this.editorTabConfiguration.set(e.textEditor,{insertSpaces:e.options.insertSpaces,tabSize:e.options.tabSize}),this.resyncBufferTabOptions(e.textEditor,t))},this.receivedBufferEvent=(e,t,n,r,i,s)=>{this.onBufferEvent&&this.onBufferEvent(e.id,t,n,r,i,s)},this.disposables.push(e.window.onDidChangeVisibleTextEditors(this.onDidChangeVisibleTextEditors)),this.disposables.push(e.window.onDidChangeActiveTextEditor(this.onDidChangeActiveTextEditor)),this.disposables.push(e.workspace.onDidCloseTextDocument(this.onDidCloseTextDocument)),this.disposables.push(e.window.onDidChangeTextEditorOptions(this.onDidChangeEditorOptions))}dispose(){this.disposables.forEach((e=>e.dispose()))}forceResync(){return oe(this,void 0,void 0,(function*(){this.logger.debug("BufferManager: force resyncing layout"),yield this.syncLayout(),yield this.syncActiveEditor()}))}waitForLayoutSync(){return oe(this,void 0,void 0,(function*(){this.changeLayoutPromise&&(this.logger.debug("BufferManager: Waiting for completing layout resyncing"),yield this.changeLayoutPromise,this.logger.debug("BufferManager: Waiting done"))}))}getTextDocumentForBufferId(e){var t;const n=null===(t=[...this.textDocumentToBufferId].find((([,t])=>e===t)))||void 0===t?void 0:t[0];return n&&!n.isClosed?n:void 0}getBufferIdForTextDocument(e){return this.textDocumentToBufferId.get(e)}getGridIdForWinId(e){const t=[...this.grids].reverse().find((([,t])=>t.winId===e));return t?t[0]:void 0}getWinIdForGridId(e){var t;return null===(t=this.grids.get(e))||void 0===t?void 0:t.winId}getWinIdForTextEditor(e){return this.textEditorToWinId.get(e)}getEditorFromWinId(e){const t=[...this.textEditorToWinId].find((([,t])=>t===e));return t?t[0]:this.winIdToEditor.get(e)}getGridIdFromEditor(e){return this.getGridIdForWinId(this.getWinIdForTextEditor(e)||0)}getEditorFromGridId(e){const t=this.getWinIdForGridId(e);if(t)return this.getEditorFromWinId(t)}isExternalTextDocument(e){return"output"===e.uri.scheme||this.externalTextDocuments.has(e)}handleRedrawBatch(e){for(const[t,...n]of e)switch(t){case"win_external_pos":case"win_pos":for(const[e,t]of n)this.grids.set(e,{winId:t.id});break;case"win_close":for(const[e]of n)this.grids.delete(e)}}handleExtensionRequest(t,n){var r;return oe(this,void 0,void 0,(function*(){switch(t){case"open-file":{const[t,r]=n,i=e.window.activeTextEditor;let s,o;if(s="__vscode_new__"===t?yield e.workspace.openTextDocument():yield e.workspace.openTextDocument(t.trim()),!s)return;r&&"all"!==r&&i&&(o=i.viewColumn,yield e.commands.executeCommand("workbench.action.revertAndCloseActiveEditor")),yield e.window.showTextDocument(s,o),"all"===r&&(yield e.commands.executeCommand("workbench.action.closeOtherEditors"));break}case"external-buffer":{const[t,i,s,o]=n;if(t.startsWith("__vscode_neovim__-output:"))break;const a=parseInt(i,10);if(t&&this.isVscodeUriName(t)){if(t){const n=t.startsWith(le)?t.substr(18):t;this.logger.debug(`BufferManager: Buffer request for ${n}, bufId: ${i}`);try{let t=this.findDocFromUri(n);t||(this.logger.debug(`BufferManager: Opening a doc: ${n}`),t=yield e.workspace.openTextDocument(e.Uri.parse(n,!0)));let i=!1;if(!this.textDocumentToBufferId.has(t)){this.logger.debug("BufferManager: No doc -> buffer mapping exists, assigning mapping and init buffer options");const e=(yield this.client.buffers).find((e=>e.id===a));e&&(i=!0,yield this.initBufferForDocument(t,e)),this.textDocumentToBufferId.set(t,a)}if((null===(r=e.window.activeTextEditor)||void 0===r?void 0:r.document)!==t){const n=yield e.window.showTextDocument(t,{viewColumn:e.window.activeTextEditor?e.window.activeTextEditor.viewColumn:e.ViewColumn.Active,preserveFocus:!1,preview:!1});this.editorTabConfiguration.set(n,{insertSpaces:n.options.insertSpaces,tabSize:n.options.tabSize}),i&&(yield this.resyncBufferTabOptions(n,a))}}catch(e){}}}else{if(this.logger.debug(`BufferManager: Attaching new external buffer: ${t}, id: ${a}`),1===a)return void this.logger.debug(`BufferManager: ${a} is the first neovim buffer, skipping`);yield this.attachNeovimExternalBuffer(t,a,!!s,o)}break}}}))}initBufferForDocument(t,n,r){return oe(this,void 0,void 0,(function*(){const i=n.id;this.logger.debug(`BufferManager: Init buffer for ${i}, doc: ${t.uri.toString()}`);const{options:{insertSpaces:s,tabSize:o}}=r||{options:{insertSpaces:!0,tabSize:4}},a=t.eol===e.EndOfLine.LF?"\n":"\r\n",l=t.getText().split(a);r&&this.editorTabConfiguration.set(r,{tabSize:o,insertSpaces:s});const u=[["nvim_buf_set_option",[i,"expandtab",s]],["nvim_buf_set_option",[i,"tabstop",o]],["nvim_buf_set_option",[i,"shiftwidth",o]],["nvim_buf_set_lines",[i,0,-1,!1,l]],["nvim_buf_set_var",[i,"vscode_controlled",!0]],["nvim_buf_set_name",[i,le+t.uri.toString()]],["nvim_buf_set_option",[i,"modifiable",!this.isExternalTextDocument(t)]],["nvim_buf_set_option",[i,"buftype","nofile"]],["nvim_buf_set_option",[i,"buflisted",!0]]];yield j(this.client,u,this.logger,ae),this.isExternalTextDocument(t)||(yield this.client.callFunction("VSCodeClearUndo",i)),this.onBufferInit&&this.onBufferInit(i,t),n.listen("lines",this.receivedBufferEvent)}))}resyncBufferTabOptions(e,t){return oe(this,void 0,void 0,(function*(){const{options:{insertSpaces:n,tabSize:r}}=e,i=[["nvim_buf_set_option",[t,"expandtab",n]],["nvim_buf_set_option",[t,"tabstop",r]],["nvim_buf_set_option",[t,"shiftwidth",r]]];yield j(this.client,i,this.logger,ae)}))}createNeovimWindow(e){return oe(this,void 0,void 0,(function*(){yield this.client.setOption("eventignore","BufWinEnter,BufEnter,BufLeave");const t=yield this.client.openWindow(e,!1,{external:!0,width:this.settings.neovimViewportWidth,height:this.settings.neovimViewportHeight});if(yield this.client.setOption("eventignore",""),"number"==typeof t)throw new Error(`Unable to create a new neovim window, code: ${t}`);return t.id}))}unloadBuffer(e){return oe(this,void 0,void 0,(function*(){try{yield this.client.command(`bunload! ${e}`)}catch(t){this.logger.warn(`BufferManager: Can't unload the buffer: ${e}, err: ${null==t?void 0:t.message}`)}}))}isVscodeUriName(e){return!!(/:\/\//.test(e)||e.startsWith("output:")||e.startsWith("__vscode_neovim__-output:")||e.startsWith("/search-editor:")||e.startsWith("__vscode_neovim__-/search-editor:"))}findDocFromUri(t){return t.startsWith("/search-editor")&&(t=t.slice(1)),e.workspace.textDocuments.find((e=>e.uri.toString()===t))}attachNeovimExternalBuffer(t,n,r,i){return oe(this,void 0,void 0,(function*(){const t=(yield this.client.buffers).find((e=>e.id===n));if(!t)return;const s=yield t.lines;if(!s.length||1===s.length&&!s[0])return void this.logger.debug(`BufferManager: Skipping empty external buffer ${n}`);const o=yield e.workspace.openTextDocument({content:s.join("\n")});this.externalTextDocuments.add(o),this.textDocumentToBufferId.set(o,n),this.onBufferInit&&this.onBufferInit(n,o),t.listen("lines",this.receivedBufferEvent),yield t[se.ATTACH](!0);const a=yield this.client.windows;let l=0;for(const e of a)(yield e.buffer).id===n&&(this.logger.debug(`BufferManager: Found window assigned to external buffer ${n}, winId: ${e.id}, isKnownWindow: ${this.winIdToEditor.has(e.id)}`),this.winIdToEditor.has(e.id)||(l=e.id));const u=yield e.window.showTextDocument(o,{preserveFocus:!1,preview:!0,viewColumn:e.ViewColumn.Active});this.editorTabConfiguration.set(u,{tabSize:i,insertSpaces:r}),u.options.insertSpaces=r,u.options.tabSize=i,l&&(setTimeout((()=>oe(this,void 0,void 0,(function*(){const t=yield this.client.request("nvim_win_get_cursor",[l]);if(t){this.logger.debug(`BufferManager: Adjusting cursor pos for external buffer: ${n}, originalPos: [${t[0]}, ${t[1]}]`);const r=t[0]-1;let i=t[1];try{i=_(o.lineAt(r).text,t[1],1,!0),this.logger.debug(`BufferManager: Adjusted cursor: [${r}, ${i}]`)}catch(e){this.logger.warn(`BufferManager: Unable to get cursor pos for external buffer: ${n}`)}u.selections=[new e.Selection(r,i,r,i)]}}))),1e3),setTimeout((()=>{this.logger.debug(`BufferManager: Closing window ${l} for external buffer: ${n}`);try{this.client.request("nvim_win_close",[l,!0])}catch(e){this.logger.warn(`BufferManager: Closing the window: ${l} for external buffer failed: ${e.message}`)}}),5e3))}))}}var ce=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class he{constructor(t,n,r,i){this.logger=t,this.client=n,this.modeManager=r,this.changeManager=i,this.disposables=[],this.isExitingInsertMode=!1,this.isEnteringInsertMode=!1,this.pendingKeysAfterExit="",this.pendingKeysAfterEnter="",this.onModeChange=()=>{var t;if(this.modeManager.isInsertMode&&this.typeHandlerDisposable&&!this.modeManager.isRecordingInInsertMode){this.pendingKeysAfterEnter="";const n=e.window.activeTextEditor;n&&this.changeManager.hasDocumentChangeCompletionLock(n.document)?(this.isEnteringInsertMode=!0,this.logger.debug("TypingManager: Waiting for document completion operation before disposing type handler"),null===(t=this.changeManager.getDocumentChangeCompletionLock(n.document))||void 0===t||t.then((()=>{this.isEnteringInsertMode=!1,this.typeHandlerDisposable&&this.modeManager.isInsertMode&&(this.logger.debug("TypingManager: Waiting done, disposing type handler"),this.typeHandlerDisposable.dispose(),this.typeHandlerDisposable=void 0),this.pendingKeysAfterEnter&&(e.commands.executeCommand(this.modeManager.isInsertMode?"default:type":"type",{text:this.pendingKeysAfterEnter}),this.pendingKeysAfterEnter="")}))):(this.logger.debug("TypingManager: Disposing type handler"),this.typeHandlerDisposable.dispose(),this.typeHandlerDisposable=void 0)}else this.modeManager.isInsertMode||(this.isEnteringInsertMode=!1,this.isExitingInsertMode=!1,this.typeHandlerDisposable||(this.logger.debug("TypingManager: Enabling type handler"),this.typeHandlerDisposable=e.commands.registerTextEditorCommand("type",this.onVSCodeType)))},this.onVSCodeType=(t,n,r)=>{!this.modeManager.isInsertMode||this.modeManager.isRecordingInInsertMode||this.isEnteringInsertMode?this.isEnteringInsertMode?this.pendingKeysAfterEnter+=r.text:this.client.input(F(r.text,!this.modeManager.isRecordingInInsertMode)):this.isExitingInsertMode?this.pendingKeysAfterExit+=r.text:e.commands.executeCommand("default:type",{text:r.text})},this.onEscapeKeyCommand=()=>ce(this,void 0,void 0,(function*(){this.logger.debug("TypingManager: Escape key"),this.modeManager.isInsertMode&&(this.logger.debug("TypingManager: Syncing buffers with neovim"),this.isExitingInsertMode=!0,this.typeHandlerDisposable||(this.typeHandlerDisposable=e.commands.registerTextEditorCommand("type",this.onVSCodeType)),yield this.changeManager.syncDocumentsWithNeovim(),yield this.changeManager.syncDotRepatWithNeovim());const t=F(this.pendingKeysAfterExit);this.logger.debug(`TypingManager: Pending keys sent with <Esc>: ${t}`),this.pendingKeysAfterExit="",yield this.client.input(`<Esc>${t}`)})),this.onInsertCtrlOCommand=()=>ce(this,void 0,void 0,(function*(){this.logger.debug("TypingManager: Ctrl-O key"),this.modeManager.isInsertMode&&(this.logger.debug("TypingManager: Syncing buffers with neovim (Ctrl-O)"),this.isExitingInsertMode=!0,this.typeHandlerDisposable||(this.typeHandlerDisposable=e.commands.registerTextEditorCommand("type",this.onVSCodeType)),yield this.changeManager.syncDocumentsWithNeovim(),yield this.changeManager.syncDotRepatWithNeovim());const t=F(this.pendingKeysAfterExit);this.logger.debug(`TypingManager: Pending keys sent with <c-o>: ${t}`),this.pendingKeysAfterExit="",yield this.client.input(`<c-o>${t}`)})),this.handleCompositeEscapeFirstKey=t=>ce(this,void 0,void 0,(function*(){const n=(new Date).getTime();this.compositeEscapeFirstPressTimestamp&&n-this.compositeEscapeFirstPressTimestamp<=200?(this.compositeEscapeFirstPressTimestamp=void 0,yield e.commands.executeCommand("deleteLeft"),this.onEscapeKeyCommand()):(this.compositeEscapeFirstPressTimestamp=n,yield e.commands.executeCommand("default:type",{text:t}))})),this.handleCompositeEscapeSecondKey=t=>ce(this,void 0,void 0,(function*(){const n=(new Date).getTime();this.compositeEscapeFirstPressTimestamp&&n-this.compositeEscapeFirstPressTimestamp<=200?(this.compositeEscapeFirstPressTimestamp=void 0,yield e.commands.executeCommand("deleteLeft"),this.onEscapeKeyCommand()):yield e.commands.executeCommand("default:type",{text:t})})),this.typeHandlerDisposable=e.commands.registerTextEditorCommand("type",this.onVSCodeType),this.disposables.push(e.commands.registerCommand("vscode-neovim.ctrl-o-insert",this.onInsertCtrlOCommand)),this.disposables.push(e.commands.registerCommand("vscode-neovim.escape",this.onEscapeKeyCommand)),this.disposables.push(e.commands.registerCommand("vscode-neovim.compositeEscape1",(e=>this.handleCompositeEscapeFirstKey(e)))),this.disposables.push(e.commands.registerCommand("vscode-neovim.compositeEscape2",(e=>this.handleCompositeEscapeSecondKey(e)))),this.modeManager.onModeChange(this.onModeChange)}dispose(){var e;null===(e=this.typeHandlerDisposable)||void 0===e||e.dispose(),this.disposables.forEach((e=>e.dispose()))}}var de=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const fe="CursorManager";class ge{constructor(t,n,r,i,s,o){this.logger=t,this.client=n,this.modeManager=r,this.bufferManager=i,this.changeManager=s,this.settings=o,this.disposables=[],this.cursorModes=new Map,this.neovimCursorPosition=new WeakMap,this.ignoreSelectionEvents=!1,this.gridVisibleViewport=new Map,this.debouncedCursorUpdates=new WeakMap,this.onDidChangeVisibleTextEditors=()=>{this.updateCursorStyle(this.modeManager.currentMode)},this.onSelectionChanged=e=>de(this,void 0,void 0,(function*(){if(this.modeManager.isInsertMode)return;if(this.ignoreSelectionEvents)return;const{textEditor:t,kind:n}=e;this.logger.debug("CursorManager: SelectionChanged"),this.logger.debug("CursorManager: Waiting for possible layout completion operation"),yield this.bufferManager.waitForLayoutSync(),this.logger.debug("CursorManager: Waiting for possible document change completion operation"),yield this.changeManager.getDocumentChangeCompletionLock(t.document),this.logger.debug("CursorManager: Waiting done");const r=this.changeManager.eatDocumentCursorAfterChange(t.document),i=t.selection.active;r&&r.line===i.line&&r.character===i.character?this.logger.debug("CursorManager: Skipping onSelectionChanged event since it was selection produced by doc change"):this.applySelectionChanged(t,n)})),this.applySelectionChanged=ie(((t,n)=>de(this,void 0,void 0,(function*(){const r=this.bufferManager.getWinIdForTextEditor(t),i=t.selection.active,s=t.selections;if(this.logger.debug(`CursorManager: Applying changed selection, kind: ${n}, WinId: ${r}, cursor: [${i.line}, ${i.character}], isMultiSelection: ${t.selections.length>1}`),!r)return;const o=this.neovimCursorPosition.get(t);if(o&&o.col===i.character&&o.line===i.line)this.logger.debug("CursorManager: Skipping event since neovim has same cursor pos");else if(s.length>1||n===e.TextEditorSelectionChangeKind.Mouse&&!s[0].active.isEqual(s[0].anchor)||this.modeManager.isVisualMode){if(n!==e.TextEditorSelectionChangeKind.Mouse||!this.settings.mouseSelectionEnabled)return;{const e=this.bufferManager.getGridIdForWinId(r);this.logger.debug(`CursorManager: Processing multi-selection, gridId: ${e}`);const n=[];if(!this.modeManager.isVisualMode&&e){const r=s[0].anchor,i=T(t,r);this.logger.debug(`CursorManager: Starting visual mode from: [${i[0]}, ${i[1]}]`),n.push(["nvim_input_mouse",["left","press","",e,i[0]-1,i[1]]]),n.push(["nvim_input",["v"]])}const i=s.slice(-1)[0];if(!i)return;const o=T(t,i.active);this.logger.debug(`CursorManager: Updating cursor pos in neovim, winId: ${r}, pos: [${o[0]}, ${o[1]}]`),n.push(["nvim_win_set_cursor",[r,o]]),yield j(this.client,n,this.logger,fe)}}else{const e=A(t);this.logger.debug(`CursorManager: Updating cursor pos in neovim, winId: ${r}, pos: [${e[0]}, ${e[1]}]`);const n=[["nvim_win_set_cursor",[r,e]]];yield j(this.client,n,this.logger,fe)}}))),20,{leading:!1,trailing:!0}),this.updateCursorPosInEditor=(t,n,r)=>{if(this.ignoreSelectionEvents)return;const i=`${t.document.uri.toString()}, viewColumn: ${t.viewColumn}`;if(this.logger.debug(`CursorManager: Updating cursor in editor: ${i}, pos: [${n}, ${r}]`),t!==e.window.activeTextEditor){this.logger.debug(`CursorManager: Editor: ${i} is not active text editor, setting cursor directly`);const s=new e.Selection(n,r,n,r);return void(t.selection.isEqual(s)||(t.selections=[s]))}const s=t.selection.active,o=n-s.line;let a=r-s.character;if(Math.abs(o)<=1){if(this.logger.debug(`CursorManager: Editor: ${i} using cursorMove command`),Math.abs(o)>0&&(r!==s.character?(a=r,e.commands.executeCommand("cursorLineStart")):a=0,e.commands.executeCommand("cursorMove",{to:o>0?"down":"up",by:"line",value:Math.abs(o),select:!1})),Math.abs(a)>0)if(Math.abs(o)>0)this.logger.debug(`CursorManager: Editor: ${i} Moving cursor by char: ${a}`),e.commands.executeCommand("cursorMove",{to:a>0?"right":"left",by:"character",value:Math.abs(a),select:!1});else{this.logger.debug(`CursorManager: Editor: ${i} setting cursor directly since zero line delta`);const s=new e.Selection(n,r,n,r);t.selection.isEqual(s)||(t.selections=[s],t.revealRange(s,e.TextEditorRevealType.Default),e.commands.executeCommand("editor.action.wordHighlight.trigger"))}}else{this.logger.debug(`CursorManager: Editor: ${i} setting cursor directly`);const s=new e.Selection(n,r,n,r);if(!t.selection.isEqual(s)){t.selections=[s];const r=Math.min(...t.visibleRanges.map((e=>e.start.line))),i=Math.max(...t.visibleRanges.map((e=>e.end.line))),a=o>0?n>i+10?e.TextEditorRevealType.InCenterIfOutsideViewport:e.TextEditorRevealType.Default:o<0&&n<r-10?e.TextEditorRevealType.InCenterIfOutsideViewport:e.TextEditorRevealType.Default;t.revealRange(s,a),e.commands.executeCommand("editor.action.wordHighlight.trigger")}}},this.getDebouncedUpdateCursorPos=e=>{const t=this.debouncedCursorUpdates.get(e);if(t)return t;const n=ie(this.updateCursorPosInEditor,10,{leading:!1,trailing:!0,maxWait:100});return this.debouncedCursorUpdates.set(e,n),n},this.onModeChange=t=>{"normal"===t&&e.window.activeTextEditor&&e.window.activeTextEditor.selections.length>1&&(e.window.activeTextEditor.selections=[new e.Selection(e.window.activeTextEditor.selection.active,e.window.activeTextEditor.selection.active)])},this.disposables.push(e.window.onDidChangeTextEditorSelection(this.onSelectionChanged)),this.disposables.push(e.window.onDidChangeVisibleTextEditors(this.onDidChangeVisibleTextEditors)),this.modeManager.onModeChange(this.onModeChange)}dispose(){this.disposables.forEach((e=>e.dispose()))}handleExtensionRequest(e,t){return de(this,void 0,void 0,(function*(){switch(e){case"visual-edit":{const[e,n,r,i,s,o]=t;this.multipleCursorFromVisualMode(!!e,n,r-1,i-1,s,!!o);break}}}))}handleRedrawBatch(e){var t;const n=new Map,r=new Map;for(const[t,...n]of e)switch(t){case"win_viewport":for(const[e,t,i,s,o,a]of n)this.gridVisibleViewport.set(e,{top:i,bottom:s}),r.set(e,{line:o,col:a})}for(const[i,...s]of e){const e=s[0]||[];switch(i){case"grid_cursor_goto":for(const[e,i,o]of s){const s=r.get(e);if(s)n.set(e,{grid:e,line:s.line,col:s.col,isByteCol:!0});else{const r=(null===(t=this.gridVisibleViewport.get(e))||void 0===t?void 0:t.top)||0;n.set(e,{grid:e,line:r+i,col:o,isByteCol:!1})}}break;case"grid_scroll":for(const[e,t,i,o,a,l,u]of s){const t=r.get(e);t&&n.set(e,{grid:e,line:t.line,col:t.col,isByteCol:!0})}break;case"grid_destroy":for(const[e]of s)this.gridVisibleViewport.delete(e);break;case"mode_info_set":{const[,t]=e;for(const e of t)e.name&&e.cursor_shape&&this.cursorModes.set(e.name,{cursorShape:e.cursor_shape});break}case"mode_change":{const[t]=e;this.updateCursorStyle(t);break}}}for(const[e,t]of n){this.logger.debug(`CursorManager: Received cursor update from neovim, gridId: ${e}, pos: [${t.line}, ${t.col}]`);const n=this.bufferManager.getEditorFromGridId(e);if(!n){this.logger.warn(`CursorManager: No editor for gridId: ${e}`);continue}const r=this.changeManager.getDocumentChangeCompletionLock(n.document);if(r)this.logger.debug(`CursorManager: Waiting for document change completion before setting the cursor, gridId: ${e}`),r.then((()=>{try{this.logger.debug(`CursorManager: Waiting document change completion done, gridId: ${e}`);const r=_(n.document.lineAt(t.line).text,t.col,t.isByteCol?1:n.options.tabSize,t.isByteCol);this.neovimCursorPosition.set(n,{line:t.line,col:r}),this.getDebouncedUpdateCursorPos(n)(n,t.line,r)}catch(e){this.logger.warn(`CursorManager: ${e.message}`)}}));else{this.logger.debug(`CursorManager: No pending document changes, gridId: ${e}`);try{const e=_(n.document.lineAt(t.line).text,t.col,t.isByteCol?1:n.options.tabSize,t.isByteCol);this.neovimCursorPosition.set(n,{line:t.line,col:e}),this.updateCursorPosInEditor(n,t.line,e)}catch(e){this.logger.warn(`CursorManager: ${e.message}`)}}}n.clear()}handleVSCodeRangeCommand(t,n,r,i,s,o,a){return de(this,void 0,void 0,(function*(){const l=e.window.activeTextEditor;if(this.logger.debug(`CursorManager: Range command: ${t}, range: [${n}, ${i}] - [${r}, ${s}], leaveSelection: ${o}`),l){if(r>n)try{const e=l.document.lineAt(n-1);i>0&&i-1>=e.range.end.character&&(n++,i=0)}catch(e){}const u=[...l.selections];this.ignoreSelectionEvents=!0,l.selections=n>r?[new e.Selection(n-1,i>0?i-1:9999999,r-1,s>0?s-1:0)]:[new e.Selection(n-1,i>0?i-1:0,r-1,s>0?s-1:9999999)];const c=yield e.commands.executeCommand(t,...a);return this.logger.debug("CursorManager: Range command completed"),o||(l.selections=u),this.ignoreSelectionEvents=!1,c}}))}updateCursorStyle(t){const n=this.cursorModes.get(t);if(n)for(const t of e.window.visibleTextEditors)"block"===n.cursorShape?t.options.cursorStyle=e.TextEditorCursorStyle.Block:"horizontal"===n.cursorShape?t.options.cursorStyle=e.TextEditorCursorStyle.Underline:t.options.cursorStyle=e.TextEditorCursorStyle.Line}multipleCursorFromVisualMode(t,n,r,i,s,o){if(!e.window.activeTextEditor)return;this.logger.debug(`CursorManager: Spawning multiple cursors from lines: [${r}, ${i}], endCol: ${s} mode: ${n}, append: ${t}, skipEmpty: ${o}`);const a=e.window.activeTextEditor.selection.active.character,l=[],u=e.window.activeTextEditor.document;for(let c=r;c<=i;c++){const r=u.lineAt(c);if(""===r.text.trim()&&(o||"V"!==n))continue;let i=0;i="V"===n?t?r.range.end.character:r.firstNonWhitespaceCharacterIndex:t?s:a,this.logger.debug(`CursorManager: Multiple cursor at: [${c}, ${i}]`),l.push(new e.Selection(c,i,c,i))}e.window.activeTextEditor.selections=l}}var pe,me=n(5747),ve=n.n(me);!function(e){e[e.none=0]="none",e[e.error=1]="error",e[e.warn=2]="warn",e[e.debug=3]="debug"}(pe||(pe={}));class be{constructor(e,t,n=!1){if(this.logLevel=e,this.outputToConsole=n,this.disposables=[],this.fd=0,e!==pe.none)try{this.fd=ve().openSync(t,"w")}catch(e){}}dispose(){this.fd&&ve().closeSync(this.fd),this.disposables.forEach((e=>e.dispose()))}debug(e){e=`${this.getTimestamp()} ${e}`,this.logLevel>=pe.debug&&(this.fd&&ve().appendFileSync(this.fd,e+"\n"),this.outputToConsole&&console.log(e))}warn(e){e=`${this.getTimestamp()} ${e}`,this.logLevel>=pe.warn&&(this.fd&&ve().appendFileSync(this.fd,e+"\n"),this.outputToConsole&&console.log(e))}error(t){t=`${this.getTimestamp()} ${t}`,this.logLevel>=pe.error&&(this.fd&&ve().appendFileSync(this.fd,t+"\n"),this.outputToConsole&&console.log(t)),e.window.showErrorMessage(t)}getTimestamp(){return(new Date).toISOString()}}var ye=n(7529),we=n.n(ye),Ee=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const _e="DocumentChangeManager";class xe{constructor(t,n,r,i){this.logger=t,this.client=n,this.bufferManager=r,this.modeManager=i,this.disposables=[],this.pendingEvents=[],this.bufferSkipTicks=new Map,this.documentSkipVersionOnChange=new WeakMap,this.textDocumentChangePromise=new Map,this.cursorAfterTextDocumentChange=new WeakMap,this.documentContentInNeovim=new WeakMap,this.changedDocuments=new Set,this.applyingEdits=!1,this.onBufferInit=(e,t)=>{this.logger.debug(`DocumentChangeManager: Init buffer content for bufId: ${e}, uri: ${t.uri.toString()}`),this.documentContentInNeovim.set(t,t.getText())},this.onNeovimChangeEvent=(e,t,n,r,i,s)=>{this.logger.debug(`DocumentChangeManager: Received neovim buffer changed event for bufId: ${e}, tick: ${t}`);const o=this.bufferManager.getTextDocumentForBufferId(e);if(!o)return void this.logger.debug(`DocumentChangeManager: No text document for buffer: ${e}`);if((this.bufferSkipTicks.get(e)||0)>=t)return void this.logger.debug(`DocumentChangeManager: BufId: ${e} skipping tick: ${t}`);if(n===r&&0===i.length)return void this.logger.debug(`DocumentChangeManager: BufId: ${e} empty change, skipping`);this.textDocumentChangePromise.has(o)||this.textDocumentChangePromise.set(o,[]);const a=this.textDocumentChangePromise.get(o),l={};l.promise=new Promise(((e,t)=>{l.resolve=e,l.reject=t})),l.promise.catch((e=>{this.logger.error(e)})),a.push(l),this.pendingEvents.push([e,t,n,r,i,s]),this.applyingEdits||this.applyEdits()},this.applyEdits=()=>Ee(this,void 0,void 0,(function*(){var t,n;let r;this.applyingEdits=!0,this.logger.debug("DocumentChangeManager: Applying neovim edits");const i=setTimeout((()=>{e.window.withProgress({location:e.ProgressLocation.Notification,title:"Applying neovim edits"},(()=>new Promise((e=>r=e))))}),1e3);for(;this.pendingEvents.length;){const r=new Map;let i=this.pendingEvents.shift();for(;i;){const[e,t,n,s,o,a]=i,l=this.bufferManager.getTextDocumentForBufferId(e);if(!l){this.logger.warn(`DocumentChangeManager: No document for ${e}, skip`);continue}this.logger.debug(`DocumentChangeManager: Accumulating edits for ${l.uri.toString()}, bufId: ${e}`),r.get(l)||r.set(l,k(l));let u=r.get(l);if(n!==s&&s===n+1&&1===o.length&&""===o[0])for(let e=n;e<s;e++)u[e]="";else if(n!==s&&1===o.length&&""===o[0]){for(let e=1;e<s-n;e++)u.splice(n,1);u[n]=""}else if(n===s||o.length)n===s?(n>u.length&&o.unshift(""),0===n?u.unshift(...o):u=[...u.slice(0,n),...o,...u.slice(n)]):(n>=u.length&&o.unshift(""),u=[...u.slice(0,n),...o,...u.slice(s)]);else for(let e=0;e<s-n;e++)u.splice(n,1);r.set(l,u),i=this.pendingEvents.shift()}for(const[i,s]of r){const r=(null===(t=this.textDocumentChangePromise.get(i))||void 0===t?void 0:t.length)||0;try{if(this.logger.debug(`DocumentChangeManager: Applying edits for ${i.uri.toString()}`),i.isClosed){this.logger.debug("DocumentChangeManager: Document was closed, skippnig");continue}const t=e.window.visibleTextEditors.find((e=>e.document===i));if(!t){this.logger.debug("DocumentChangeManager: No visible text editor for document, skipping");continue}let o=i.getText();const a=i.eol===e.EndOfLine.CRLF?"\r\n":"\n";let l=s.join(a);o+=`${a}end${a}end`,l+=`${a}end${a}end`;const u=b(o,l),c=y(we()(u.chars1,u.chars2));if(!c.length)continue;this.documentSkipVersionOnChange.set(i,i.version+1);const h=yield t.edit((n=>{for(const r of c){const i=s.slice(r.newStart,r.newEnd+1);if("removed"===r.type)if(r.end>=t.document.lineCount-1&&r.start>0){const i=t.document.lineAt(r.start-1).range.end.character;n.delete(new e.Range(r.start-1,i,r.end,999999))}else n.delete(new e.Range(r.start,0,r.end+1,0));else if("changed"===r.type){const s=t.document.getText(new e.Range(r.start,0,r.end,99999)).replace("\r\n","\n"),o=i.join("\n");o.length>s.length&&o.startsWith(s)?n.insert(new e.Position(r.start,s.length),o.slice(s.length)):n.replace(new e.Range(r.start,0,r.end,999999),i.join("\n"))}else"added"===r.type&&(r.start>=t.document.lineCount?i.unshift(...new Array(r.start-(t.document.lineCount-1)).fill("")):i.push(""),n.insert(new e.Position(r.start,0),i.join("\n")))}}),{undoStopAfter:!1,undoStopBefore:!1}),d=(null===(n=this.textDocumentChangePromise.get(i))||void 0===n?void 0:n.splice(0,r))||[];h?(t.selection.anchor.isEqual(t.selection.active)||(t.selections=[new e.Selection(t.selection.active,t.selection.active)]),this.cursorAfterTextDocumentChange.set(t.document,{line:t.selection.active.line,character:t.selection.active.character}),d.forEach((e=>e.resolve&&e.resolve())),this.logger.debug(`DocumentChangeManager: Changes succesfully applied for ${i.uri.toString()}`),this.documentContentInNeovim.set(i,i.getText())):(d.forEach((e=>{var t;null===(t=e.promise)||void 0===t||t.catch((()=>this.logger.warn(`DocumentChangeManager: Edit was canceled for doc: ${i.uri.toString()}`))),e.reject&&e.reject()})),this.logger.warn(`DocumentChangeManager: Changes were not applied for ${i.uri.toString()}`))}catch(e){this.logger.error(`DocumentChangeManager: Error applying neovim edits, error: ${e.message}`)}}}const s=[...this.textDocumentChangePromise.values()].flatMap((e=>e));this.textDocumentChangePromise.clear(),s.forEach((e=>e.resolve&&e.resolve())),i&&clearTimeout(i),r&&r(),this.pendingEvents.length&&this.applyEdits(),this.applyingEdits=!1})),this.onChangeTextDocument=t=>{const{document:n,contentChanges:r}=t;if(this.logger.debug(`DocumentChangeManager: Change text document for uri: ${n.uri.toString()}`),this.documentSkipVersionOnChange.get(n)===n.version)return void this.logger.debug("DocumentChangeManager: Skipping a change since versions equals");const i=this.dotRepeatStartModeInsertHint,s=e.window.activeTextEditor;if(s&&s.document===n&&this.modeManager.isInsertMode){this.dotRepeatStartModeInsertHint=void 0;const t=n.eol===e.EndOfLine.LF?"\n":"\r\n",o=s.selection.active;for(const e of r)C(e,o,t)&&(this.dotRepeatChange&&x(e,this.dotRepeatChange)?this.dotRepeatChange=D(e,this.dotRepeatChange):this.dotRepeatChange=S(e,t,i))}this.changedDocuments.add(n),this.modeManager.isInsertMode||this.syncDocumentsWithNeovim()},this.bufferManager.onBufferEvent=this.onNeovimChangeEvent,this.bufferManager.onBufferInit=this.onBufferInit,this.disposables.push(e.workspace.onDidChangeTextDocument(this.onChangeTextDocument))}dispose(){this.disposables.forEach((e=>e.dispose()))}eatDocumentCursorAfterChange(e){const t=this.cursorAfterTextDocumentChange.get(e);return this.cursorAfterTextDocumentChange.delete(e),t}getDocumentChangeCompletionLock(e){const t=this.textDocumentChangePromise.get(e);if(t&&t.length)return Promise.all(t.map((e=>e.promise)).filter(Boolean))}hasDocumentChangeCompletionLock(e){var t;return((null===(t=this.textDocumentChangePromise.get(e))||void 0===t?void 0:t.length)||0)>0}handleExtensionRequest(e,t){return Ee(this,void 0,void 0,(function*(){if("insert-line"===e){const[e]=t;this.dotRepeatStartModeInsertHint="before"===e?"O":"o",this.logger.debug(`DocumentChangeManager: Setting start insert mode hint - ${this.dotRepeatStartModeInsertHint}`)}}))}syncDocumentsWithNeovim(){return Ee(this,void 0,void 0,(function*(){this.logger.debug("DocumentChangeManager: Syncing document changes with neovim");const t=[],n=[...this.changedDocuments];this.changedDocuments.clear();for(const r of n){if(this.logger.debug(`DocumentChangeManager: Processing document ${r.uri.toString()}`),r.isClosed){this.logger.warn(`DocumentChangeManager: Document ${r.uri.toString()} is closed, skipping`);continue}let n=this.documentContentInNeovim.get(r);if(null==n){this.logger.warn(`DocumentChangeManager: Can't get last known neovim content for ${r.uri.toString()}, skipping`);continue}const i=this.bufferManager.getBufferIdForTextDocument(r);if(!i){this.logger.warn(`DocumentChangeManager: No neovim buffer for ${r.uri.toString()}`);continue}let s=r.getText();this.documentContentInNeovim.set(r,s);const o=r.eol===e.EndOfLine.LF?"\n":"\r\n";n+=`${o}end${o}end`,s+=`${o}end${o}end`;const a=b(n,s),l=y(we()(a.chars1,a.chars2));if(!l.length){this.logger.debug(`DocumentChangeManager: No diff ranges for ${r.uri.toString()}, skipping`);continue}const u=[];let c=0;for(const t of l){let a=r.getText(new e.Range(t.newStart,0,t.newEnd,999999)).split(o);const l=t.start+c;let h=t.end+c;"removed"===t.type?(a=[],h++,c--):"changed"===t.type?("\n"!==s.slice(-1)&&"\r\n"!==s.slice(-1)||n.includes(o)||a.push(""),h++):"added"===t.type&&(0!==t.start||n||h++,c++),u.push(["nvim_buf_set_lines",[i,l,h,!1,a]]),c+=t.newEnd-t.newStart-(t.end-t.start)}const h=yield this.client.request("nvim_buf_get_changedtick",[i]);h?(this.logger.debug(`DocumentChangeManager: BufId: ${i}, lineChanges: ${u.length}, tick: ${h}, skipTick: ${h+u.length}`),this.bufferSkipTicks.set(i,h+u.length),t.push(...u)):this.logger.warn(`DocumentChangeManager: Can't get changed tick for bufId: ${i}, deleted?`)}e.window.activeTextEditor&&t.push(["nvim_win_set_cursor",[0,A(e.window.activeTextEditor)]]),t.length&&(yield j(this.client,t,this.logger,_e))}))}syncDotRepatWithNeovim(){return Ee(this,void 0,void 0,(function*(){if(!this.dotRepeatChange)return;this.logger.debug("DocumentChangeManager: Syncing dot repeat");const e=Object.assign({},this.dotRepeatChange);this.dotRepeatChange=void 0;const t=yield this.client.window,n=yield this.client.createBuffer(!1,!0);if("number"==typeof n)return;yield this.client.setOption("eventignore","BufWinEnter,BufEnter,BufLeave");const r=yield this.client.openWindow(n,!0,{external:!0,width:100,height:100});if(yield this.client.setOption("eventignore",""),"number"==typeof r)return;const i=[],s=e.rangeLength;if(s){const e=new Array(s).fill("x").join("");i.push(["nvim_buf_set_lines",[n.id,0,0,!1,[e]]],["nvim_win_set_cursor",[r.id,[1,s]]])}let o="";e.startMode&&(o+=`<Esc>${e.startMode}`,e.text.startsWith(e.eol)&&(e.text=e.text.slice(e.eol.length))),e.rangeLength&&(o+=[...new Array(e.rangeLength).keys()].map((()=>"<BS>")).join("")),o+=e.text.split(e.eol).join("\n").replace("<","<LT>"),i.push(["nvim_input",[o]]),yield j(this.client,i,this.logger,_e);const a=[];a.push(["nvim_set_current_win",[t.id]]),a.push(["nvim_win_close",[r.id,!0]]),yield j(this.client,a,this.logger,_e)}))}}var Ce=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class Me{constructor(t,n){this.isDisplayed=!1,this.disposables=[],this.completionAllowed=!1,this.completionItems=[],this.mode="",this.ignoreHideEvent=!1,this.onAccept=()=>{this.isDisplayed&&this.callbacks.onAccepted()},this.onChange=e=>{if(!this.isDisplayed)return;const t=this.mode;":"!==t||"?"!==e.charAt(0)&&"/"!==e.charAt(0)||!this.input.items.length||(this.input.items=[],this.completionItems=[]);const n=!(":"!==t||"?"===e.charAt(0)||"/"===e.charAt(0)||e.includes("s/")||e.includes("substitute/")||e.includes("g/")||e.includes("global/")||e.includes("v/")||e.includes("vglobal/"));n||this.cancelCompletions(),this.callbacks.onChanged(e,n)},this.onHide=()=>{this.isDisplayed&&(this.clean(),this.ignoreHideEvent?this.ignoreHideEvent=!1:this.callbacks.onCanceled())},this.processCompletionTimer=()=>{this.completionAllowed=!0,this.isDisplayed&&this.completionItems.length&&(this.input.items=this.completionItems),this.completionTimer=void 0},this.cancelCompletions=()=>{this.completionTimer&&(clearTimeout(this.completionTimer),this.completionTimer=void 0),this.input.items=[]},this.deleteAll=()=>{this.isDisplayed&&(this.input.value="",this.onChange(""))},this.deleteChar=()=>{this.isDisplayed&&(this.input.value=this.input.value.slice(0,-1),this.onChange(this.input.value))},this.deleteWord=()=>{this.isDisplayed&&(this.input.value=this.input.value.trimRight().split(" ").slice(0,-1).join(" "),this.onChange(this.input.value))},this.acceptSelection=()=>{if(!this.isDisplayed)return;const e=this.input.activeItems[0];e&&(this.input.value=this.input.value.split(" ").slice(0,-1).concat(e.label).join(" "),this.onChange(this.input.value))},this.onHistoryUp=()=>Ce(this,void 0,void 0,(function*(){yield this.neovimClient.input("<Up>");const e=yield this.neovimClient.callFunction("getcmdline",[]);e&&(this.input.value=e,this.input.show())})),this.onHistoryDown=()=>Ce(this,void 0,void 0,(function*(){yield this.neovimClient.input("<Down>");const e=yield this.neovimClient.callFunction("getcmdline",[]);e&&(this.input.value=e,this.input.show())})),this.neovimClient=t,this.callbacks=n,this.input=e.window.createQuickPick(),this.input.ignoreFocusOut=!0,this.disposables.push(this.input.onDidAccept(this.onAccept)),this.disposables.push(this.input.onDidChangeValue(this.onChange)),this.disposables.push(this.input.onDidHide(this.onHide)),this.disposables.push(e.commands.registerCommand("vscode-neovim.commit-cmdline",this.onAccept)),this.disposables.push(e.commands.registerCommand("vscode-neovim.delete-word-left-cmdline",this.deleteWord)),this.disposables.push(e.commands.registerCommand("vscode-neovim.delete-all-cmdline",this.deleteAll)),this.disposables.push(e.commands.registerCommand("vscode-neovim.delete-char-left-cmdline",this.deleteChar)),this.disposables.push(e.commands.registerCommand("vscode-neovim.history-up-cmdline",this.onHistoryUp)),this.disposables.push(e.commands.registerCommand("vscode-neovim.history-down-cmdline",this.onHistoryDown)),this.disposables.push(e.commands.registerCommand("vscode-neovim.complete-selection-cmdline",this.acceptSelection))}show(e="",t,n=""){if(this.isDisplayed){const r=n||this.getTitle(t);r!==this.input.title&&(this.input.title=r),"/"!==this.mode&&"?"!==this.mode||(this.input.value=e)}else this.input.value="",this.isDisplayed=!0,this.input.value="",this.mode=t,this.input.title=n||this.getTitle(t),this.input.show(),e&&(this.input.value=e),this.completionAllowed=!1,this.completionItems=[],this.input.items=[],this.completionTimer=setTimeout(this.processCompletionTimer,1500)}setCompletionItems(e){this.completionItems=e.map((e=>({label:e,alwaysShow:!0}))),this.completionAllowed&&(this.input.items=this.completionItems)}cancel(e=!1){this.ignoreHideEvent=e,this.input.hide()}dispose(){for(const e of this.disposables)e.dispose();this.input.dispose()}getTitle(e){switch(e){case"/":return"⟳ Forward Search:";case"?":return"⟲ Backward Search:";case":":return"⌘ VIM Command Line:";default:return e}}clean(){this.completionTimer&&clearTimeout(this.completionTimer),this.isDisplayed=!1,this.input.value="",this.input.title="",this.mode="",this.completionAllowed=!1,this.input.items=[],this.completionItems=[]}}var Se=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class De{constructor(e,t){this.logger=e,this.client=t,this.disposables=[],this.showCmdOnTimer=(e,t,n)=>{this.commandLine||(this.commandLine=new Me(this.client,{onAccepted:this.onCmdAccept,onCanceled:this.onCmdCancel,onChanged:this.onCmdChange})),this.commandLine.show(e,t,n),this.cmdlineTimer=void 0},this.onCmdChange=(e,t)=>Se(this,void 0,void 0,(function*(){let n="<C-u>"+F(e);t&&(n+="<C-e>"),yield this.client.input(n)})),this.onCmdCancel=()=>Se(this,void 0,void 0,(function*(){yield this.client.input("<Esc>")})),this.onCmdAccept=()=>{this.client.input("<CR>")}}dispose(){this.commandLine&&this.commandLine.dispose(),this.disposables.forEach((e=>e.dispose()))}handleRedrawBatch(e){for(const[t,...n]of e){const e=n[0]||[];switch(t){case"cmdline_show":{const[t,n,r,i,s,o]=e,a=t.map((([,e])=>e)).join("");this.cmdlineTimer?(clearTimeout(this.cmdlineTimer),this.cmdlineTimer=void 0,this.commandLine||(this.commandLine=new Me(this.client,{onAccepted:this.onCmdAccept,onCanceled:this.onCmdCancel,onChanged:this.onCmdChange})),this.commandLine.show(a,r,i)):""===a||"'<,'>"===a||this.commandLine?(this.commandLine||(this.commandLine=new Me(this.client,{onAccepted:this.onCmdAccept,onCanceled:this.onCmdCancel,onChanged:this.onCmdChange})),this.commandLine.show(a,r,i)):this.cmdlineTimer=setTimeout((()=>this.showCmdOnTimer(a,r,i)),200);break}case"wildmenu_show":{const[t]=e;this.commandLine&&this.commandLine.setCompletionItems(t);break}case"cmdline_hide":this.cmdlineTimer?(clearTimeout(this.cmdlineTimer),this.cmdlineTimer=void 0):this.commandLine&&(this.commandLine.cancel(!0),this.commandLine.dispose(),this.commandLine=void 0)}}}}class Te{constructor(){this.modeItem=e.window.createStatusBarItem(e.StatusBarAlignment.Left,10),this.commandItem=e.window.createStatusBarItem(e.StatusBarAlignment.Left,5),this.msgItem=e.window.createStatusBarItem(e.StatusBarAlignment.Left,1)}set modeString(e){e?(this.modeItem.text=e,this.modeItem.show()):this.modeItem.hide()}set statusString(e){e?(this.commandItem.text=e,this.commandItem.show()):this.commandItem.hide()}set msgString(e){e?(this.msgItem.text=e,this.msgItem.show()):this.msgItem.hide()}dispose(){this.commandItem.dispose(),this.modeItem.dispose(),this.msgItem.dispose()}}class Ae{constructor(e,t){this.logger=e,this.client=t,this.disposables=[],this.statusLine=new Te,this.disposables.push(this.statusLine)}dispose(){this.disposables.forEach((e=>e.dispose()))}handleRedrawBatch(e){let t=!1,n=!1;e.forEach((([r,...i],s)=>{const o=i[0]||[];switch(r){case"msg_showcmd":{const[e]=o;let t="";if(e)for(const n of e){const[,e]=n;e&&(t+=e)}this.statusLine.statusString=t;break}case"msg_show":{let r="";for(const[o,a]of i)if("return_prompt"===o&&(t=!0,n=!!e.slice(s).find((([e])=>"mouse_on"===e))),a)for(const e of a){const[,t]=e;t&&(r+=t)}this.statusLine.msgString=r;break}case"msg_showmode":{const[e]=o;let t="";if(e)for(const n of e){const[,e]=n;e&&(t+=e)}this.statusLine.modeString=t;break}case"msg_clear":this.statusLine.msgString=""}})),t&&!n&&this.client.input("<CR>")}}function ke(e){return"string"==typeof e&&e.startsWith("theme.")}function Fe(t){const n=Object.assign(Object.assign({},t),{after:t.after?Object.assign({},t.after):void 0,before:t.before?Object.assign({},t.before):void 0});return ke(n.backgroundColor)&&(n.backgroundColor=new e.ThemeColor(n.backgroundColor.slice(6))),ke(n.borderColor)&&(n.borderColor=new e.ThemeColor(n.borderColor.slice(6))),ke(n.color)&&(n.borderColor=new e.ThemeColor(n.color.slice(6))),ke(n.outlineColor)&&(n.outlineColor=new e.ThemeColor(n.outlineColor.slice(6))),ke(n.overviewRulerColor)&&(n.overviewRulerColor=new e.ThemeColor(n.overviewRulerColor.slice(6))),n.after&&(ke(n.after.backgroundColor)&&(n.after.backgroundColor=new e.ThemeColor(n.after.backgroundColor.slice(6))),ke(n.after.borderColor)&&(n.after.borderColor=new e.ThemeColor(n.after.borderColor.slice(6))),ke(n.after.color)&&(n.after.color=new e.ThemeColor(n.after.color.slice(6)))),n.before&&(ke(n.before.backgroundColor)&&(n.before.backgroundColor=new e.ThemeColor(n.before.backgroundColor.slice(6))),ke(n.before.borderColor)&&(n.before.borderColor=new e.ThemeColor(n.before.borderColor.slice(6))),ke(n.before.color)&&(n.before.color=new e.ThemeColor(n.before.color.slice(6)))),n}class Oe{constructor(e){this.highlights=new Map,this.prevGridHighlightsIds=new Map,this.highlightIdToGroupName=new Map,this.highlighGroupToDecorator=new Map,this.decoratorConfigurations=new Map,this.ignoredGroupIds=new Set,this.alwaysIgnoreGroups=["Normal","NormalNC","NormalFloat","NonText","SpecialKey","TermCursor","TermCursorNC","Cursor","lCursor","VisualNC","Conceal","CursorLine","CursorLineNr","ColorColumn","LineNr","StatusLine","StatusLineNC","VertSplit","Title","WildMenu","Whitespace"],this.configuration=e,"vim"!==this.configuration.unknownHighlight&&(this.configuration.unknownHighlight=Fe(this.configuration.unknownHighlight));for(const[e,t]of Object.entries(this.configuration.highlights))if("vim"!==t){const n=Fe(t);this.configuration.highlights[e]=n,this.createDecoratorForHighlightGroup(e,n)}}addHighlightGroup(t,n,r){if((this.configuration.ignoreHighlights.includes(n)||this.configuration.ignoreHighlights.find((e=>!(!e.startsWith("^")&&!e.endsWith("$"))&&new RegExp(e).test(n))))&&this.ignoredGroupIds.add(t),this.highlightIdToGroupName.set(t,n),!this.highlighGroupToDecorator.has(n)){const t=this.configuration.highlights[n]||this.configuration.unknownHighlight,i="vim"===t?function(t){const n={};t.background&&(n.backgroundColor="#"+t.background.toString(16)),t.foreground&&(n.color="#"+t.foreground.toString(16));const r=t.special?"#"+t.special.toString(16):"";return t.reverse&&(n.backgroundColor=new e.ThemeColor("editor.foreground"),n.color=new e.ThemeColor("editor.background")),t.italic&&(n.fontStyle="italic"),t.bold&&(n.fontWeight="bold"),t.strikethrough&&(n.textDecoration="line-through solid"),t.underline&&(n.textDecoration=`underline ${r} solid`),t.undercurl&&(n.textDecoration=`underline ${r} wavy`),n}(r):t;this.createDecoratorForHighlightGroup(n,i)}}getHighlightGroupName(e,t=!1){if(this.ignoredGroupIds.has(e)&&!t)return;const n=this.highlightIdToGroupName.get(e);return n&&this.alwaysIgnoreGroups.includes(n)?void 0:n}getDecoratorForHighlightGroup(e){let t=this.highlighGroupToDecorator.get(e);return!t&&e.endsWith("Default")&&(t=this.highlighGroupToDecorator.get(e.slice(0,-7))),t||(t=this.highlighGroupToDecorator.get(e+"Default")),t}getDecoratorOptions(e){return this.decoratorConfigurations.get(e)}cleanRow(e,t){const n=this.highlights.get(e);n&&delete n[t]}processHLCellsEvent(e,t,n,r,i){let s=0,o=n;this.highlights.has(e)||this.highlights.set(e,[]);const a=this.highlights.get(e);let l=!1;for(const[e,n,u]of i){if(""===e)continue;if("♥"===e)continue;null!=n&&(s=n);const i=this.getHighlightGroupName(s,r),c="\t"===e||"❥"===e?1:u||1;for(let e=0;e<c;e++)a[t]||(a[t]=[]),i?(l=!0,a[t][o]=s):a[t][o]&&(l=!0,delete a[t][o]),o++}return l}shiftGridHighlights(e,t,n){const r=this.highlights.get(e);if(r)if(t>0){for(let e=0;e<t;e++)delete r[n+e];const e=[];r.forEach(((t,n)=>{e.push(n)}));for(const i of e)i<=n||(r[i-t]=r[i],delete r[i])}else if(t<0){for(let e=0;e<Math.abs(t);e++)delete r[0!==n?n+e:r.length-1-e];const e=[];r.forEach(((t,n)=>{e.push(n)}));for(const i of e.reverse())i<=n||(r[i+Math.abs(t)]=r[i],delete r[i])}}getGridHighlights(t,n){const r=[],i=new Map,s=this.highlights.get(t);if(s){let e="",t=0,n=0,r=0,o=0;s.forEach(((s,a)=>{s.forEach(((s,l)=>{const u=this.highlightIdToGroupName.get(s);u&&e===u&&n===a&&o===l-1?o=l:(e&&(i.has(e)||i.set(e,[]),i.get(e).push({lineS:t,lineE:n,colS:r,colE:o}),e="",r=0,o=0,t=0,n=0),u&&(e=u,t=a,n=a,r=l,o=l))}))})),e&&(i.has(e)||i.set(e,[]),i.get(e).push({lineS:t,lineE:n,colS:r,colE:o}))}for(const[t,s]of i){const i=this.getDecoratorForHighlightGroup(t);if(!i)continue;const o=s.map((t=>new e.Range(n+t.lineS,t.colS,n+t.lineE,t.colE+1)));r.push([i,o])}const o=this.prevGridHighlightsIds.get(t);if(o)for(const e of o)if(!i.has(e)){const t=this.getDecoratorForHighlightGroup(e);if(!t)continue;r.push([t,[]])}return this.prevGridHighlightsIds.set(t,new Set(i.keys())),r}clearHighlights(e){const t=this.prevGridHighlightsIds.get(e);if(this.highlights.delete(e),this.prevGridHighlightsIds.delete(e),!t)return[];const n=[];for(const e of t){const t=this.getDecoratorForHighlightGroup(e);t&&n.push([t,[]])}return n}createDecoratorForHighlightGroup(t,n){const r=e.window.createTextEditorDecorationType(n);this.decoratorConfigurations.set(r,n),this.highlighGroupToDecorator.set(t,r)}}class je{constructor(e,t,n){this.logger=e,this.bufferManager=t,this.settings=n,this.disposables=[],this.gridLineInfo=new Map,this.commandsDisposables=[],this.textDecorationsAtTop=!1,this.applyHLGridUpdates=e=>{for(const t of e){const e=this.gridLineInfo.get(t),n=this.bufferManager.getEditorFromGridId(t);if(!n||!e)continue;const r=this.highlightProvider.getGridHighlights(t,e.topLine);for(const[e,t]of r)n.setDecorations(e,t)}},this.highlightProvider=new Oe(n.highlight),this.textDecorationsAtTop=n.textDecorationsAtTop}dispose(){this.disposables.forEach((e=>e.dispose())),this.commandsDisposables.forEach((e=>e.dispose()))}handleRedrawBatch(e){const t=new Set;for(const[n,...r]of e)switch(n){case"hl_attr_define":for(const[e,t,,n]of r)if(n&&n[0]&&n[0].hi_name){const r=n[0].hi_name;this.highlightProvider.addHighlightGroup(e,r,t)}break;case"win_viewport":for(const[e,t,n,i,s,o]of r)this.gridLineInfo.set(e,{topLine:n,bottomLine:i});break;case"grid_scroll":for(const[e,n,,,,i]of r)1!==e&&(this.highlightProvider.shiftGridHighlights(e,i,n),t.add(e));break;case"grid_line":{const e=r;for(let[n,r,i,s]of e){if(r>this.lastViewportRow)continue;const e=this.gridLineInfo.get(n);if(!e)continue;const o=this.bufferManager.getEditorFromGridId(n);if(!o)continue;const a=e.topLine+r;if(a>=o.document.lineCount||a<0){a>0&&(this.highlightProvider.cleanRow(n,r),t.add(n));continue}const l=_(o.document.lineAt(a).text,i,o.options.tabSize),u=this.bufferManager.isExternalTextDocument(o.document);this.highlightProvider.processHLCellsEvent(n,r,l,u,s)&&t.add(n)}break}}t.size&&this.applyHLGridUpdates(t)}handleExtensionRequest(e,t){return n=this,r=void 0,s=function*(){switch(e){case"text-decorations":{const[e,n]=t;this.applyTextDecorations(e,n);break}}},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}l((s=s.apply(n,r||[])).next())}));var n,r,i,s}get lastViewportRow(){return this.settings.viewportHeight-1}applyTextDecorations(t,n){const r=e.window.activeTextEditor;if(!r)return;const i=this.highlightProvider.getDecoratorForHighlightGroup(t);if(!i)return;const s=this.highlightProvider.getDecoratorOptions(i),o=[];for(const[t,i]of n)try{const n=parseInt(t,10)-1,a=r.document.lineAt(n).text,l=new Map;for(const[t,r]of i)if(this.textDecorationsAtTop){const i=r.length,u=E(a,t),c=[n,Math.min(u+r.length-1,a.length)].toString();if(l.has(c)){const e=l.get(c).renderOptions.after.contentText;l.get(c).renderOptions.after.contentText=(r[0]+e).substr(0,e.length)}else{const t={range:new e.Range(n,u+r.length-1,n,u+r.length-1),renderOptions:{after:Object.assign(Object.assign(Object.assign({margin:`0 0 0 -${Math.min(r.length-(u+r.length-1-a.length),r.length)}ch`},s),s.before),{width:`${i}ch; position:absoulute; z-index:99;`,contentText:r})}};l.set(c,t),o.push(t)}}else{const i=E(a,t-1),l={range:new e.Range(n,i,n,i),renderOptions:{before:Object.assign(Object.assign(Object.assign({},s),s.before),{contentText:r})}};o.push(l)}}catch(e){}r.setDecorations(i,o)}}class Be{constructor(e){this.logger=e,this.disposables=[]}dispose(){this.disposables.forEach((e=>e.dispose()))}handleVSCodeCommand(t,n){return r=this,i=void 0,o=function*(){return yield e.commands.executeCommand(t,...n)},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,a)}l((o=o.apply(r,i||[])).next())}));var r,i,s,o}}class Ie{constructor(t){this.logger=t,this.disposables=[],this.isDisplayed=!1,this.onDidChangeActiveTextEditor=e=>{e&&this.isEditorIsChannel(e)?this.isDisplayed=!0:(this.isDisplayed&&this.hideChannel(),this.isDisplayed=!1)},this.channel=e.window.createOutputChannel(`${m} Messages`),this.disposables.push(this.channel),this.disposables.push(e.window.onDidChangeActiveTextEditor(this.onDidChangeActiveTextEditor))}dispose(){this.disposables.forEach((e=>e.dispose()))}handleRedrawBatch(e){for(const[t,...n]of e)switch(t){case"msg_show":{let e="";for(const[t,r,i]of n){if("return_prompt"===t)continue;if(t)continue;i&&(this.channel.clear(),e="");let n="";for(const e of r)n+=e[1];e+=("\n"===n[0]?"":"\n")+n}e.split("\n").slice(1).length>1?(this.showChannel(),this.channel.append(e)):this.isDisplayed&&this.channel.append(e);break}case"msg_history_show":{let e="\n";for(const t of n)for(const n of t)for(const[t,r]of n){let n="";for(const e of r)n+=e[1];e+=`${t}: ${n}\n`}this.showChannel(),this.channel.append(e);break}}}showChannel(){this.isDisplayed||(this.isDisplayed=!0,this.channel.clear(),this.channel.appendLine("VSCode-Neovim:"),this.channel.show())}hideChannel(){this.channel.hide()}isEditorIsChannel(e){const t=e.document;return"output"===t.uri.scheme&&!!t.lineAt(0).text.startsWith("VSCode-Neovim:")}}var Pe=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class $e{constructor(e){if(this.NEOVIM_WIN_HEIGHT=201,this.NEOVIM_WIN_WIDTH=1e3,this.disposables=[],this.currentRedrawBatch=[],this.onNeovimNotification=(e,t)=>{const n=[this.modeManager,this.bufferManager,this.cursorManager,this.commandLineManager,this.statusLineManager,this.highlightManager,this.multilineMessagesManager],r=[this.modeManager,this.changeManager,this.commandsController,this.bufferManager,this.highlightManager,this.cursorManager],i=[this.customCommandsManager],s=[this.cursorManager];if("vscode-command"===e){const[e,n]=t;return void i.forEach((t=>Pe(this,void 0,void 0,(function*(){try{yield t.handleVSCodeCommand(e,Array.isArray(n)?n:[n])}catch(t){this.logger.error(`${e} failed, args: ${JSON.stringify(n)} error: ${t.message}`)}}))))}if("vscode-range-command"===e){const[e,n,r,i,o,a,l]=t;return void s.forEach((t=>{try{t.handleVSCodeRangeCommand(e,n,r,i,o,!!a,Array.isArray(l)?l:[l])}catch(t){this.logger.error(`${e} failed, range: [${n}, ${r}, ${i}, ${o}] args: ${JSON.stringify(l)} error: ${t.message}`)}}))}if("vscode-neovim"===e){const[e,n]=t;return void r.forEach((t=>{try{t.handleExtensionRequest(e,n)}catch(t){this.logger.error(`${e} failed, args: ${JSON.stringify(n)} error: ${t.message}`)}}))}if("redraw"!==e)return;const o=t;if(O("flush",t)){const e=[...this.currentRedrawBatch.splice(0),...o];n.forEach((t=>t.handleRedrawBatch(e)))}else this.currentRedrawBatch.push(...o)},this.handleCustomRequest=(e,t,n)=>Pe(this,void 0,void 0,(function*(){const r=[this.modeManager,this.changeManager,this.commandsController,this.bufferManager,this.highlightManager,this.cursorManager],i=[this.customCommandsManager],s=[this.cursorManager];try{let o;if("vscode-command"===e){const[e,n]=t;o=(yield Promise.all(i.map((t=>t.handleVSCodeCommand(e,Array.isArray(n)?n:[n]))))).find((e=>null!=e))}else if("vscode-range-command"===e){const[e,n,r,i,a,l,u]=t;o=(yield Promise.all(s.map((t=>t.handleVSCodeRangeCommand(e,n,r,i,a,!!l,Array.isArray(u)?u:[u]))))).find((e=>null!=e))}else if("vscode-neovim"===e){const[e,n]=t;o=(yield Promise.all(r.map((t=>t.handleExtensionRequest(e,n))))).find((e=>null!=e))}n.send(o||"",!1)}catch(e){n.send(e.message,!0)}})),this.settings=e,this.NEOVIM_WIN_HEIGHT=e.neovimViewportHeight,this.NEOVIM_WIN_WIDTH=e.neovimViewportWidth,!e.neovimPath)throw new Error("Neovim path is not defined");this.logger=new be(pe[e.logConf.level],e.logConf.logPath,e.logConf.outputToConsole),this.disposables.push(this.logger);let n=e.extensionPath;e.useWsl&&(n=(0,i.execSync)(`C:\\Windows\\system32\\wsl.exe wslpath '${n}'`).toString().trim());const r=o().posix.join(n,"vim","vscode-neovim.vim"),s=o().posix.join(n,"vim","vscode-options.vim"),u=t().workspace.workspaceFolders,c=["-N","--embed","-c",`source ${s}`,"--cmd",`source ${r}`,"-c",`cd ${u&&u.length?u[0].uri.fsPath:"~"}`];e.useWsl&&c.unshift(e.neovimPath),1===parseInt(process.env.NEOVIM_DEBUG||"",10)&&c.push("-u","NONE","--listen",`${process.env.NEOVIM_DEBUG_HOST||"127.0.0.1"}:${process.env.NEOVIM_DEBUG_PORT||4e3}`),e.customInitFile&&c.push("-u",e.customInitFile),this.logger.debug(`MainController: Spawning nvim, path: ${e.neovimPath}, useWsl: ${e.useWsl}, args: ${JSON.stringify(c)}`),this.nvimProc=(0,i.spawn)(e.useWsl?"C:\\Windows\\system32\\wsl.exe":e.neovimPath,c,{}),this.nvimProc.on("close",(e=>{this.logger.error(`MainController: Neovim exited with code: ${e}`)})),this.nvimProc.on("error",(e=>{this.logger.error(`MainController: Neovim spawn error: ${e.message}`)})),this.logger.debug("MainController: Attaching to neovim"),this.client=(0,a.ub)({proc:this.nvimProc,options:{logger:(0,l.createLogger)({transports:[new l.transports.Console],level:"error",exitOnError:!1})}})}init(){return Pe(this,void 0,void 0,(function*(){this.logger.debug("MainController: Init"),this.logger.debug("MainController: Attaching to neovim notifications"),this.client.on("disconnect",(()=>{this.logger.error("MainController: Neovim was disconnected")})),this.client.on("notification",this.onNeovimNotification),this.client.on("request",this.handleCustomRequest),yield this.client.setClientInfo("vscode-neovim",{major:0,minor:1,patch:0},"embedder",{},{}),yield this.checkNeovimVersion();const e=yield this.client.channelId;yield this.client.setVar("vscode_channel",e),this.commandsController=new c(this.client,this.settings.revealCursorScrollLine),this.disposables.push(this.commandsController),this.modeManager=new B(this.logger,this.client),this.disposables.push(this.modeManager),this.bufferManager=new ue(this.logger,this.client,{neovimViewportHeight:201,neovimViewportWidth:1e3}),this.disposables.push(this.bufferManager),this.highlightManager=new je(this.logger,this.bufferManager,{highlight:this.settings.highlightsConfiguration,viewportHeight:this.settings.neovimViewportHeight,textDecorationsAtTop:this.settings.textDecorationsAtTop}),this.disposables.push(this.highlightManager),this.changeManager=new xe(this.logger,this.client,this.bufferManager,this.modeManager),this.disposables.push(this.changeManager),this.cursorManager=new ge(this.logger,this.client,this.modeManager,this.bufferManager,this.changeManager,{mouseSelectionEnabled:!1}),this.disposables.push(this.cursorManager),this.typingManager=new he(this.logger,this.client,this.modeManager,this.changeManager),this.disposables.push(this.typingManager),this.commandLineManager=new De(this.logger,this.client),this.disposables.push(this.commandLineManager),this.statusLineManager=new Ae(this.logger,this.client),this.disposables.push(this.statusLineManager),this.customCommandsManager=new Be(this.logger),this.disposables.push(this.customCommandsManager),this.multilineMessagesManager=new Ie(this.logger),this.disposables.push(this.multilineMessagesManager),this.logger.debug("MainController: UIAttach"),yield this.client.uiAttach(this.NEOVIM_WIN_WIDTH,this.NEOVIM_WIN_HEIGHT,{rgb:!0,ext_cmdline:!0,ext_linegrid:!0,ext_hlstate:!0,ext_messages:!0,ext_multigrid:!0,ext_popupmenu:!0,ext_tabline:!0,ext_wildmenu:!0}),yield this.bufferManager.forceResync(),yield t().commands.executeCommand("setContext","neovim.init",!0),this.logger.debug("MainController: Init completed")}))}dispose(){for(const e of this.disposables)e.dispose();this.client.quit()}checkNeovimVersion(){return Pe(this,void 0,void 0,(function*(){const[,e]=yield this.client.apiInfo;(0===e.version.major&&e.version.minor<5||!e.ui_events.find((e=>"win_viewport"===e.name)))&&t().window.showErrorMessage("The extension requires neovim 0.5 nightly or greater")}))}}function Le(t){var n,r,i,s,o;return r=this,i=void 0,o=function*(){const r=e.extensions.getExtension(v),i=e.workspace.getConfiguration(m),s=M("neovimExecutablePaths",{vscodeSettingName:"neovimPath",environmentVariableName:"NEOVIM_PATH"});if(!s)return void e.window.showErrorMessage("Neovim: configure the path to neovim and restart the editor");const o="win32"==process.platform,a=i.get("highlightGroups.ignoreHighlights"),l=i.get("highlightGroups.highlights"),u=i.get("highlightGroups.unknownHighlight"),c=i.get("mouseSelectionStartVisualMode",!1),h=i.get("useCtrlKeysForNormalMode",!0),d=i.get("useCtrlKeysForInsertMode",!0),f=o&&i.get("useWSL",!1),g=i.get("revealCursorScrollLine",!1),p=i.get("neovimWidth",1e3),b=null!==(n=M("neovimInitVimPaths",{vscodeSettingName:"neovimInitPath"}))&&void 0!==n?n:"",y=i.get("logPath",""),w=i.get("logLevel","none"),E=i.get("logOutputToConsole",!1),_=i.get("textDecorationsAtTop",!1);e.commands.executeCommand("setContext","neovim.ctrlKeysNormal",h),e.commands.executeCommand("setContext","neovim.ctrlKeysInsert",d);try{const n=new $e({customInitFile:b,extensionPath:t.extensionPath.replace(/\\/g,"\\\\"),highlightsConfiguration:{highlights:l,ignoreHighlights:a,unknownHighlight:u},mouseSelection:c,neovimPath:s,neovimViewportHeight:201,useWsl:r.extensionKind!==e.ExtensionKind.Workspace&&f,neovimViewportWidth:p,textDecorationsAtTop:_,revealCursorScrollLine:g,logConf:{logPath:y,outputToConsole:E,level:w}});t.subscriptions.push(n),yield n.init()}catch(t){e.window.showErrorMessage(`Unable to init vscode-neovim: ${t.message}`)}},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,a)}l((o=o.apply(r,i||[])).next())}))}function Re(){}})(),module.exports=r})();
|
||
//# sourceMappingURL=extension.js.map
|