/*! For license information please see Serialise.js.LICENSE.txt */ (()=>{var e={94148(e,t,r){"use strict";var n=r(65606);function i(e){return i="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},i(e)}function o(e,t){for(var r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ie.length)&&(r=e.length),e.substring(r-t.length,r)===t}var v="",w="",_="",E="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function S(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function A(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var B=function(e,t){!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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(B,e);var r,i,a,l,f=(r=B,i=h(),function(){var e,t=d(r);if(i){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function B(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,B),"object"!==y(e)||null===e)throw new m("options","Object",e);var r=e.message,i=e.operator,o=e.stackStartFn,s=e.actual,a=e.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="",w="",E="",_=""):(v="",w="",E="",_="")),"object"===y(s)&&null!==s&&"object"===y(a)&&null!==a&&"stack"in s&&s instanceof Error&&"stack"in a&&a instanceof Error&&(s=S(s),a=S(a)),"deepStrictEqual"===i||"strictEqual"===i)t=f.call(this,function(e,t,r){var i="",o="",s=0,a="",u=!1,c=A(e),l=c.split("\n"),f=A(t).split("\n"),h=0,p="";if("strictEqual"===r&&"object"===y(e)&&"object"===y(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===f.length&&l[0]!==f[0]){var d=l[0].length+f[0].length;if(d<=10){if(!("object"===y(e)&&null!==e||"object"===y(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(l[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&d<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][h]===f[0][h];)h++;h>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var g=l[l.length-1],m=f[f.length-1];g===m&&(h++<2?a="\n ".concat(g).concat(a):i=g,l.pop(),f.pop(),0!==l.length&&0!==f.length);)g=l[l.length-1],m=f[f.length-1];var S=Math.max(l.length,f.length);if(0===S){var B=c.split("\n");if(B.length>30)for(B[26]="".concat(v,"...").concat(E);B.length>27;)B.pop();return"".concat(x.notIdentical,"\n\n").concat(B.join("\n"),"\n")}h>3&&(a="\n".concat(v,"...").concat(E).concat(a),u=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var T=0,O=x[r]+"\n".concat(w,"+ actual").concat(E," ").concat(_,"- expected").concat(E),k=" ".concat(v,"...").concat(E," Lines skipped");for(h=0;h1&&h>2&&(I>4?(o+="\n".concat(v,"...").concat(E),u=!0):I>3&&(o+="\n ".concat(f[h-2]),T++),o+="\n ".concat(f[h-1]),T++),s=h,i+="\n".concat(_,"-").concat(E," ").concat(f[h]),T++;else if(f.length1&&h>2&&(I>4?(o+="\n".concat(v,"...").concat(E),u=!0):I>3&&(o+="\n ".concat(l[h-2]),T++),o+="\n ".concat(l[h-1]),T++),s=h,o+="\n".concat(w,"+").concat(E," ").concat(l[h]),T++;else{var N=f[h],F=l[h],R=F!==N&&(!b(F,",")||F.slice(0,-1)!==N);R&&b(N,",")&&N.slice(0,-1)===F&&(R=!1,F+=","),R?(I>1&&h>2&&(I>4?(o+="\n".concat(v,"...").concat(E),u=!0):I>3&&(o+="\n ".concat(l[h-2]),T++),o+="\n ".concat(l[h-1]),T++),s=h,o+="\n".concat(w,"+").concat(E," ").concat(F),i+="\n".concat(_,"-").concat(E," ").concat(N),T+=2):(o+=i,i="",1!==I&&0!==h||(o+="\n ".concat(F),T++))}if(T>20&&h30)for(p[26]="".concat(v,"...").concat(E);p.length>27;)p.pop();t=1===p.length?f.call(this,"".concat(h," ").concat(p[0])):f.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var d=A(s),g="",T=x[i];"notDeepEqual"===i||"notEqual"===i?(d="".concat(x[i],"\n\n").concat(d)).length>1024&&(d="".concat(d.slice(0,1021),"...")):(g="".concat(A(a)),d.length>512&&(d="".concat(d.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===i||"equal"===i?d="".concat(T,"\n\n").concat(d,"\n\nshould equal\n\n"):g=" ".concat(i," ").concat(g)),t=f.call(this,"".concat(d).concat(g))}return Error.stackTraceLimit=l,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=s,t.expected=a,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(t),o),t.stack,t.name="AssertionError",u(t)}return a=B,(l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,o(o({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,l),Object.defineProperty(a,"prototype",{writable:!1}),B}(l(Error),g.custom);e.exports=B},69597(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var s,a,u={};function c(e,t,r){r||(r=Error);var s=function(r){!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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(l,r);var s,a,u,c=(a=l,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=o(a);if(u){var r=o(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function l(r,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),o=c.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i)),o.code=e,o}return s=l,Object.defineProperty(s,"prototype",{writable:!1}),s}(r);u[e]=s}function l(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(e,t,i){var o,a,u,c,f;if(void 0===s&&(s=r(94148)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,4)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))u="The ".concat(e," ").concat(o," ").concat(l(t,"type"));else{var h=("number"!=typeof f&&(f=0),f+1>(c=e).length||-1===c.indexOf(".",f)?"argument":"property");u='The "'.concat(e,'" ').concat(h," ").concat(o," ").concat(l(t,"type"))}return u+". Received type ".concat(n(i))},TypeError),c("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(40537));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=u},82299(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(F).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function L(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i=this._blob.size)this.push(null);else{this._pos+=this._batchSize;var t=this._blob.slice(e,this._pos,this._blob.type),r=new FileReader,n=this;r.addEventListener("loadend",function e(t){r.removeEventListener("loadend",e,!1),t.error?n.emit("error",t.error):n.push(o.bufferFrom(r.result))},!1),r.readAsArrayBuffer(t)}},a.inherits(c,s.Transform),c.prototype._transform=function(e,t,r){this._bufs.push(e),r()},c.prototype._flush=function(e){this.push(new Blob(this._bufs,{type:"application/octet-binary"})),e()},e.exports={createBlobDecoder:function(e,t){return new u(e).pipe(new i.streams.BlockDecoder(t))},createBlobEncoder:function(e,t){var r=new i.streams.BlockEncoder(e,t),n=new c;return r.pipe(n),new s.Duplex({objectMode:!0,read:function(){var e=n.read();e?r(e):n.once("readable",r);var t=this;function r(e){t.push(e||n.read()),t.push(null)}},write:function(e,t,n){return r.write(e,t,n)}}).on("finish",function(){r.end()})},streams:i.streams},o.copyOwnProperties(n,e.exports)},78505(e,t,r){"use strict";var n=r(48287).Buffer;function i(){this.data=void 0}function o(e,t){var r=e[0],n=e[1],i=e[2],o=e[3];r=a(r,n,i,o,t[0],7,-680876936),o=a(o,r,n,i,t[1],12,-389564586),i=a(i,o,r,n,t[2],17,606105819),n=a(n,i,o,r,t[3],22,-1044525330),r=a(r,n,i,o,t[4],7,-176418897),o=a(o,r,n,i,t[5],12,1200080426),i=a(i,o,r,n,t[6],17,-1473231341),n=a(n,i,o,r,t[7],22,-45705983),r=a(r,n,i,o,t[8],7,1770035416),o=a(o,r,n,i,t[9],12,-1958414417),i=a(i,o,r,n,t[10],17,-42063),n=a(n,i,o,r,t[11],22,-1990404162),r=a(r,n,i,o,t[12],7,1804603682),o=a(o,r,n,i,t[13],12,-40341101),i=a(i,o,r,n,t[14],17,-1502002290),r=u(r,n=a(n,i,o,r,t[15],22,1236535329),i,o,t[1],5,-165796510),o=u(o,r,n,i,t[6],9,-1069501632),i=u(i,o,r,n,t[11],14,643717713),n=u(n,i,o,r,t[0],20,-373897302),r=u(r,n,i,o,t[5],5,-701558691),o=u(o,r,n,i,t[10],9,38016083),i=u(i,o,r,n,t[15],14,-660478335),n=u(n,i,o,r,t[4],20,-405537848),r=u(r,n,i,o,t[9],5,568446438),o=u(o,r,n,i,t[14],9,-1019803690),i=u(i,o,r,n,t[3],14,-187363961),n=u(n,i,o,r,t[8],20,1163531501),r=u(r,n,i,o,t[13],5,-1444681467),o=u(o,r,n,i,t[2],9,-51403784),i=u(i,o,r,n,t[7],14,1735328473),r=c(r,n=u(n,i,o,r,t[12],20,-1926607734),i,o,t[5],4,-378558),o=c(o,r,n,i,t[8],11,-2022574463),i=c(i,o,r,n,t[11],16,1839030562),n=c(n,i,o,r,t[14],23,-35309556),r=c(r,n,i,o,t[1],4,-1530992060),o=c(o,r,n,i,t[4],11,1272893353),i=c(i,o,r,n,t[7],16,-155497632),n=c(n,i,o,r,t[10],23,-1094730640),r=c(r,n,i,o,t[13],4,681279174),o=c(o,r,n,i,t[0],11,-358537222),i=c(i,o,r,n,t[3],16,-722521979),n=c(n,i,o,r,t[6],23,76029189),r=c(r,n,i,o,t[9],4,-640364487),o=c(o,r,n,i,t[12],11,-421815835),i=c(i,o,r,n,t[15],16,530742520),r=l(r,n=c(n,i,o,r,t[2],23,-995338651),i,o,t[0],6,-198630844),o=l(o,r,n,i,t[7],10,1126891415),i=l(i,o,r,n,t[14],15,-1416354905),n=l(n,i,o,r,t[5],21,-57434055),r=l(r,n,i,o,t[12],6,1700485571),o=l(o,r,n,i,t[3],10,-1894986606),i=l(i,o,r,n,t[10],15,-1051523),n=l(n,i,o,r,t[1],21,-2054922799),r=l(r,n,i,o,t[8],6,1873313359),o=l(o,r,n,i,t[15],10,-30611744),i=l(i,o,r,n,t[6],15,-1560198380),n=l(n,i,o,r,t[13],21,1309151649),r=l(r,n,i,o,t[4],6,-145523070),o=l(o,r,n,i,t[11],10,-1120210379),i=l(i,o,r,n,t[2],15,718787259),n=l(n,i,o,r,t[9],21,-343485551),e[0]=h(r,e[0]),e[1]=h(n,e[1]),e[2]=h(i,e[2]),e[3]=h(o,e[3])}function s(e,t,r,n,i,o){return t=h(h(t,e),h(n,o)),h(t<>>32-i,r)}function a(e,t,r,n,i,o,a){return s(t&r|~t&n,e,t,i,o,a)}function u(e,t,r,n,i,o,a){return s(t&n|r&~n,e,t,i,o,a)}function c(e,t,r,n,i,o,a){return s(t^r^n,e,t,i,o,a)}function l(e,t,r,n,i,o,a){return s(r^(t|~n),e,t,i,o,a)}function f(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function h(e,t){return e+t&4294967295}i.prototype.end=function(e){this.data=e},i.prototype.read=function(){return function(e){var t,r=function(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)o(n,f(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(o(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,o(n,i),n}(e),i=n.alloc?n.alloc(16):new n(16);for(t=0;t<4;t++)i.writeIntLE(r[t],4*t,4);return i}(this.data)},e.exports={createHash:function(e){if("md5"!==e)throw new Error("only md5 is supported in the browser");return new i}}},36161(e){"use strict";function t(){return new Error("unsupported in the browser")}e.exports={createImportHook:function(){return function(e,r,n){n(t())}},createSyncImportHook:function(){return function(){throw t()}},existsSync:function(){return!1},readFileSync:function(){throw t()}}},21946(e,t,r){"use strict";var n=r(65606),i=r(77725),o=r(22561),s=r(48287),a=r(88310),u=r(40537),c=r(78559),l=s.Buffer,f={namespace:"org.apache.avro.file"},h=i.Type.forSchema("long",f),p=i.Type.forSchema({type:"map",values:"bytes"},f),d=i.Type.forSchema({name:"Header",type:"record",fields:[{name:"magic",type:{type:"fixed",name:"Magic",size:4}},{name:"meta",type:p},{name:"sync",type:{type:"fixed",name:"Sync",size:16}}]},f),y=i.Type.forSchema({name:"Block",type:"record",fields:[{name:"count",type:"long"},{name:"data",type:"bytes"},{name:"sync",type:"Sync"}]},f),g=o.bufferFrom("Obj"),m=u.format,b=o.Tap;function v(e,t){var r=!!(t=t||{}).noDecode;a.Duplex.call(this,{readableObjectMode:!r,allowHalfOpen:!1}),this._type=i.Type.forSchema(e),this._tap=new b(o.newBuffer(0)),this._writeCb=null,this._needPush=!1,this._readValue=B(r,this._type),this._finished=!1,this.on("finish",function(){this._finished=!0,this._read()})}function w(e){var t=!!(e=e||{}).noDecode;a.Duplex.call(this,{allowHalfOpen:!0,readableObjectMode:!t}),this._rType=void 0!==e.readerSchema?i.Type.forSchema(e.readerSchema):void 0,this._wType=null,this._codecs=e.codecs,this._codec=void 0,this._parseHook=e.parseHook,this._tap=new b(o.newBuffer(0)),this._blockTap=new b(o.newBuffer(0)),this._syncMarker=null,this._readValue=null,this._noDecode=t,this._queue=new o.OrderedQueue,this._decompress=null,this._index=0,this._remaining=void 0,this._needPush=!1,this._finished=!1,this.on("finish",function(){this._finished=!0,this._needPush&&this._read()})}function _(e,t){t=t||{},a.Transform.call(this,{writableObjectMode:!0,allowHalfOpen:!1}),this._type=i.Type.forSchema(e),this._writeValue=function(e,t){try{this._type._write(e,t)}catch(e){this.emit("typeError",e,t,this._type)}},this._tap=new b(o.newBuffer(t.batchSize||65536)),this.on("typeError",function(e){this.emit("error",e)})}function E(e,t){var r;if(t=t||{},a.Duplex.call(this,{allowHalfOpen:!0,writableObjectMode:!0}),i.Type.isType(e)?(r=e,e=void 0):r=i.Type.forSchema(e),this._schema=e,this._type=r,this._writeValue=function(e,t){try{this._type._write(e,t)}catch(e){return this.emit("typeError",e,t,this._type),!1}return!0},this._blockSize=t.blockSize||65536,this._tap=new b(o.newBuffer(this._blockSize)),this._codecs=t.codecs,this._codec=t.codec||"null",this._blockCount=0,this._syncMarker=t.syncMarker||(new o.Lcg).nextBuffer(16),this._queue=new o.OrderedQueue,this._pending=0,this._finished=!1,this._needHeader=!1,this._needPush=!1,this._metadata=t.metadata||{},!p.isValid(this._metadata))throw new Error("invalid metadata");var n=this._codec;if(this._compress=(this._codecs||E.getDefaultCodecs())[n],!this._compress)throw new Error(m("unsupported codec: %s",n));switch(void 0!==t.omitHeader&&(t.writeHeader=t.omitHeader?"never":"auto"),t.writeHeader){case!1:case"never":break;case void 0:case"auto":this._needHeader=!0;break;default:this._writeHeader()}this.on("finish",function(){this._finished=!0,this._blockCount?this._flushChunk():this._finished&&this._needPush&&this.push(null)}),this.on("typeError",function(e){this.emit("error",e)})}function x(e,t,r){this.valueCount=e,this.rawDataLength=t,this.compressedDataLength=r}function S(e,t,r,n){this.index=e,this.buf=t,this.cb=r,this.count=0|n}function A(e){var t=e.pos,r=y._read(e);return e.isValid()?r:(e.pos=t,null)}function B(e,t,r){if(e)return i=t._skip,function(e){var t=e.pos;return i(e),e.buf.slice(t,e.pos)};if(r){var n=r.createResolver(t);return function(e){return n._read(e)}}return function(e){return t._read(e)};var i}u.inherits(v,a.Duplex),v.prototype._write=function(e,t,r){this._writeCb=r;var n=this._tap;n.buf=l.concat([n.buf.slice(n.pos),e]),n.pos=0,this._needPush&&(this._needPush=!1,this._read())},v.prototype._read=function(){this._needPush=!1;var e=this._tap,t=e.pos,r=this._readValue(e);e.isValid()?this.push(r):this._finished?this.push(null):(e.pos=t,this._needPush=!0,this._writeCb&&this._writeCb())},u.inherits(w,a.Duplex),w.defaultCodecs=function(){return{null:function(e,t){t(null,e)},deflate:c.inflateRaw}},w.getDefaultCodecs=w.defaultCodecs,w.prototype._decodeHeader=function(){var e=this._tap;if(e.buf.lengthi.length&&(n.buf=o.newBuffer(2*a)),n.pos=0,this._writeValue(n,e)}r()},_.prototype._flush=function(e){var t=this._tap,r=t.pos;r&&this.push(t.buf.slice(0,r)),e()},u.inherits(E,a.Duplex),E.defaultCodecs=function(){return{null:function(e,t){t(null,e)},deflate:c.deflateRaw}},E.getDefaultCodecs=E.defaultCodecs,E.prototype._writeHeader=function(){var e=JSON.stringify(this._schema?this._schema:this._type.getSchema({exportAttrs:!0})),t=o.copyOwnProperties(this._metadata,{"avro.schema":o.bufferFrom(e),"avro.codec":o.bufferFrom(this._codec)},!0),r=new(d.getRecordConstructor())(g,t,this._syncMarker);this.push(r.toBuffer())},E.prototype._write=function(e,t,r){this._needHeader&&(this._writeHeader(),this._needHeader=!1);var n=this._tap,i=n.pos,s=!1;if(this._writeValue(n,e)){if(!n.isValid()){i&&(this._flushChunk(i,r),s=!0);var a=n.pos-i;a>this._blockSize&&(this._blockSize=2*a),n.buf=o.newBuffer(this._blockSize),n.pos=0,this._writeValue(n,e)}this._blockCount++}else n.pos=i;s||r()},E.prototype._flushChunk=function(e,t){var r=this._tap;e=e||r.pos,this._compress(r.buf.slice(0,e),this._createBlockCallback(e,t)),this._blockCount=0},E.prototype._read=function(){var e=this,t=this._queue.pop();t?(this.push(h.toBuffer(t.count,!0)),this.push(h.toBuffer(t.buf.length,!0)),this.push(t.buf),this.push(this._syncMarker),this._finished||t.cb()):this._finished&&!this._pending?n.nextTick(function(){e.push(null)}):this._needPush=!0},E.prototype._createBlockCallback=function(e,t){var r=this,n=this._index++,i=this._blockCount;return this._pending++,function(o,s){if(o){var a=new Error(m("%s codec compression error",r._codec));return a.cause=o,void r.emit("error",a)}r._pending--,r.emit("block",new x(i,e,s.length)),r._queue.push(new S(n,s,t,i)),r._needPush&&(r._needPush=!1,r._read())}},e.exports={BLOCK_TYPE:y,HEADER_TYPE:d,MAGIC_BYTES:g,streams:{BlockDecoder:w,BlockEncoder:E,RawDecoder:v,RawEncoder:_}}},75942(e,t,r){"use strict";var n=r(65606),i=r(77725),o=r(22561),s=r(48287),a=r(37007),u=r(88310),c=r(40537),l=s.Buffer,f=o.Tap,h=i.Type,p=c.debuglog("avsc:services"),d=c.format,y={namespace:"org.apache.avro.ipc"},g=h.forSchema("boolean",y),m=h.forSchema({type:"map",values:"bytes"},y),b=h.forSchema("string",y),v=h.forSchema({name:"HandshakeRequest",type:"record",fields:[{name:"clientHash",type:{name:"MD5",type:"fixed",size:16}},{name:"clientProtocol",type:["null","string"],default:null},{name:"serverHash",type:"MD5"},{name:"meta",type:["null",m],default:null}]},y),w=h.forSchema({name:"HandshakeResponse",type:"record",fields:[{name:"match",type:{name:"HandshakeMatch",type:"enum",symbols:["BOTH","CLIENT","NONE"]}},{name:"serverProtocol",type:["null","string"],default:null},{name:"serverHash",type:["null","MD5"],default:null},{name:"meta",type:["null",m],default:null}]},y),_=new E("",h.forSchema({name:"PingRequest",type:"record",fields:[]},y),h.forSchema(["string"],y),h.forSchema("null",y));function E(e,t,r,n,i,o){if(this.name=e,!h.isType(t,"record"))throw new Error("invalid request type");if(this.requestType=t,!h.isType(r,"union")||!h.isType(r.getTypes()[0],"string"))throw new Error("invalid error type");if(this.errorType=r,i&&(!h.isType(n,"null")||r.getTypes().length>1))throw new Error("inapplicable one-way parameter");this.responseType=n,this.oneWay=!!i,this.doc=void 0!==o?""+o:void 0,Object.freeze(this)}function x(e,t,r,n,i){if("string"!=typeof e)return x.forProtocol(e,t);this.name=e,this._messagesByName=t||{},this.messages=Object.freeze(o.objectValues(this._messagesByName)),this._typesByName=r||{},this.types=Object.freeze(o.objectValues(this._typesByName)),this.protocol=n,this._hashStr=o.getHash(JSON.stringify(n)).toString("binary"),this.doc=n.doc?""+n.doc:void 0,this._server=i||this.createServer({silent:!0}),Object.freeze(this)}function S(e,t){t=t||{},a.EventEmitter.call(this),this._svc$=e,this._channels$=[],this._fns$=[],this._buffering$=!!t.buffering,this._cache$=t.cache||{},this._policy$=t.channelPolicy,this._strict$=!!t.strictTypes,this._timeout$=o.getOption(t,"timeout",1e4),t.remoteProtocols&&q(this._cache$,t.remoteProtocols,e,!0),this._svc$.messages.forEach(function(e){this[e.name]=this._createMessageHandler$(e)},this)}function A(e,t){t=t||{},a.EventEmitter.call(this),this.service=e,this._handlers={},this._fns=[],this._channels={},this._nextChannelId=1,this._cache=t.cache||{},this._defaultHandler=t.defaultHandler,this._sysErrFormatter=t.systemErrorFormatter,this._silent=!!t.silent,this._strict=!!t.strictTypes,t.remoteProtocols&&q(this._cache,t.remoteProtocols,e,!1),e.messages.forEach(function(e){var r=e.name;t.noCapitalize||(r=o.capitalize(r)),this["on"+r]=this._createMessageHandler(e)},this)}function B(e,t){t=t||{},a.EventEmitter.call(this),this.client=e,this.timeout=o.getOption(t,"timeout",e._timeout$),this._endWritable=!!o.getOption(t,"endWritable",!0),this._prefix=K(t.scope);var r=e._cache$,n=e._svc$,i=t.serverHash;i||(i=n.hash);var s=r[i];s||(s=r[i=n.hash]=new U(n,n,i)),this._adapter=s,this._registry=new j(this,16),this.pending=0,this.destroyed=!1,this.draining=!1,this.once("_eot",function(e,t){p("client channel EOT"),this.destroyed=!0,this.emit("eot",e,t)})}function T(e,t,r){B.call(this,e,r),this._writableFactory=t,r&&r.noPing||(p("emitting ping request"),this.ping())}function O(e,t,r,i){B.call(this,e,i),this._readable=t,this._writable=r,this._connected=!(!i||!i.noPing),this._readable.on("end",d),this._writable.on("finish",y);var s,a=this,u=null;function c(e){if(!a.destroyed){s=a._createHandshakeRequest(a._adapter,!e);var t=[v.toBuffer(s),o.bufferFrom([0,0])];a._writable.write({id:a._prefix,payload:t})}}function f(e){if(a._matchesPrefix(e.id)){var t=l.concat(e.payload);try{var r=z(w,t).head;r.serverHash&&(a._adapter=a._getAdapter(r))}catch(e){return void a.destroy(e)}var i=r.match;p("handshake match: %s",i),a.emit("handshake",s,r),"NONE"===i?n.nextTick(function(){c(!0)}):(p("successfully connected"),u&&(clearTimeout(u),u=null),a._readable.removeListener("data",f).on("data",h),a._connected=!0,a.emit("_ready"),s=null)}else p("discarding unscoped response %s (still connecting)",e.id)}function h(e){var t=e.id;if(a._matchesPrefix(t)){var r=a._registry.get(t);r&&n.nextTick(function(){p("received message %s",t),r(null,l.concat(e.payload),a._adapter)})}else p("discarding unscoped message %s",t)}function d(){a.destroy(!0)}function y(){a.destroy()}this.once("eot",function(){u&&(clearTimeout(u),u=null),a._connected||a.emit("_ready"),this._writable.removeListener("finish",y),this._endWritable&&(p("ending transport"),this._writable.end()),this._readable.removeListener("data",f).removeListener("data",h).removeListener("end",d)}),this._connected?this._readable.on("data",h):(this._readable.on("data",f),n.nextTick(c),a.timeout&&(u=setTimeout(function(){a.destroy(new Error("timeout"))},a.timeout)))}function k(e,t){t=t||{},a.EventEmitter.call(this),this.server=e,this._endWritable=!!o.getOption(t,"endWritable",!0),this._prefix=K(t.scope);var r=e._cache,n=e.service,i=n.hash;r[i]||(r[i]=new U(n,n,i)),this._adapter=null,this.destroyed=!1,this.draining=!1,this.pending=0,this.once("_eot",function(e,t){p("server channel EOT"),this.emit("eot",e,t)})}function I(e,t,r){k.call(this,e,r),this._writable=void 0;var i,o=this;function s(e){var t,r=e.id,n=l.concat(e.payload);try{var i=z(v,n),s=i.head,a=o._getAdapter(s)}catch(e){t=J("INVALID_HANDSHAKE_REQUEST",e)}var u=o._createHandshakeResponse(t,s);function c(e){if(!o.destroyed){if(!o._writable)return void o.once("_writable",function(){c(e)});o._writable.write({id:r,payload:[w.toBuffer(u),e]})}o._writable&&o._endWritable&&o._writable.end()}o.emit("handshake",s,u),t?c(o._encodeSystemError(t)):o._receive(i.tail,a,c)}function a(){o.destroy()}function u(e){i.removeListener("data",s).removeListener("end",a),o.destroy(e||!0)}n.nextTick(function(){i=t.call(o,function(e,t){n.nextTick(function(){e?u(e):(o._writable=t.on("finish",u),o.emit("_writable"))})}).on("data",s).on("end",a)})}function N(e,t,r,n){k.call(this,e,n),this._adapter=void 0,this._writable=r.on("finish",u),this._readable=t.on("data",o).on("end",a),this.once("_drain",function(){this._readable.removeListener("data",o).removeListener("data",s).removeListener("end",a)}).once("eot",function(){this._writable.removeListener("finish",u),this._endWritable&&this._writable.end()});var i=this;function o(e){var t=e.id;if(i._matchesPrefix(t)){var r,n=l.concat(e.payload);try{var a=z(v,n),u=a.head;i._adapter=i._getAdapter(u)}catch(e){r=J("INVALID_HANDSHAKE_REQUEST",e)}var c=i._createHandshakeResponse(r,u);i.emit("handshake",u,c),r?f(i._encodeSystemError(r)):(i._readable.removeListener("data",o).on("data",s),i._receive(a.tail,i._adapter,f))}function f(e){i.destroyed||i._writable.write({id:t,payload:[w.toBuffer(c),e]})}}function s(e){var t=e.id;if(i._matchesPrefix(t)){var r=l.concat(e.payload);i._receive(r,i._adapter,function(e,r){i.destroyed||r||i._writable.write({id:t,payload:[e]})})}}function a(){i.destroy()}function u(){i.destroy(!0)}}function F(e,t,r){this._msg=e,this.headers=t||{},this.request=r||{}}function R(e,t,r,n){this._msg=e,this.headers=t,this.error=r,this.response=n}function L(e,t){this.channel=t,this.locals={},this.message=e,Object.freeze(this)}function j(e,t){this._ctx=e,this._mask=-1>>>(0|t),this._id=0,this._n=0,this._cbs={}}function U(e,t,r,n){this._clientSvc=e,this._serverSvc=t,this._hash=r,this._isRemote=!!n,this._readers=H(e,t)}function C(){u.Transform.call(this,{readableObjectMode:!0}),this._id=void 0,this._buf=o.newBuffer(0),this._bufs=[],this.on("finish",function(){this.push(null)})}function P(){u.Transform.call(this,{writableObjectMode:!0}),this.on("finish",function(){this.push(null)})}function D(){u.Transform.call(this,{readableObjectMode:!0}),this._id=void 0,this._frameCount=0,this._buf=o.newBuffer(0),this._bufs=[],this.on("finish",function(){this.push(null)})}function M(){u.Transform.call(this,{writableObjectMode:!0}),this.on("finish",function(){this.push(null)})}function $(e){var t=o.newBuffer(4);return t.writeInt32BE(e),t}function z(e,t){var r=new f(t),n=e._read(r);if(!r.isValid())throw new Error(d("truncated %j",e.schema()));return{head:n,tail:r.buf.slice(r.pos)}}function V(e,t){return e.equals(t)?e:e.createResolver(t)}function H(e,t){var r={};return e.messages.forEach(function(e){var n=e.name,i=t.message(n);try{if(!i)throw new Error(d("missing server message: %s",n));if(i.oneWay!==e.oneWay)throw new Error(d("inconsistent one-way message: %s",n));r[n+"?"]=V(i.requestType,e.requestType),r[n+"*"]=V(e.errorType,i.errorType),r[n+"!"]=V(e.responseType,i.responseType)}catch(e){throw J("INCOMPATIBLE_PROTOCOL",e)}}),r}function q(e,t,r,n){Object.keys(t).forEach(function(i){var o,s,a=t[i];n?(o=r,s=x.forProtocol(a)):(o=x.forProtocol(a),s=r),e[i]=new U(o,s,i,!0)})}function G(e,t){var r={};return Object.keys(e).forEach(function(n){var i=e[n];if(i._isRemote){var o=t?i._serverSvc:i._clientSvc;r[n]=o.protocol}}),r}function W(e){return!!e&&"[object Error]"===Object.prototype.toString.call(e)}function Z(e,t){var r=new Error(e);return r.cause=t,r}function J(e,t){var r=Z(e.toLowerCase().replace(/_/g," "),t);return r.rpcCode=t&&t.rpcCode?t.rpcCode:e,r}function Y(e,t,r){var n,i,o,s=[];for(n=0,i=r.length;n>16)}function Q(e){return!(!e||!e.pipe)}function ee(e,t){var r=e.message(t);if(!r)throw new Error(d("unknown message: %s",t));return r}function te(e){var t,r=[e.wreq,e.wres],i=[];function o(){var r=i.pop();if(r){var n=!1;r.call(e.ctx,t,function(r){n?e.onError(Z("duplicate backward middleware call",r)):(t=r,n=!0,o())})}else e.onCompletion.call(e.ctx,t)}!function s(a){var u=!1;a1&&(t.errors=n.slice(1)),this.oneWay&&(t["one-way"]=!0),t},o.addDeprecatedGetters(E,["name","errorType","requestType","responseType"]),E.prototype.isOneWay=c.deprecate(function(){return this.oneWay},"use `.oneWay` directly instead of `.isOneWay()`"),x.Client=S,x.Server=A,x.compatible=function(e,t){try{H(e,t)}catch(e){return!1}return!0},x.forProtocol=function(e,t){t=t||{};var r,n=e.protocol;if(!n)throw new Error("missing protocol name");if(void 0!==e.namespace)t.namespace=e.namespace;else{var i=/^(.*)\.[^.]+$/.exec(n);i&&(t.namespace=i[1])}return n=o.qualify(n,t.namespace),e.types&&e.types.forEach(function(e){h.forSchema(e,t)}),e.messages&&(r={},Object.keys(e.messages).forEach(function(n){r[n]=E.forSchema(n,e.messages[n],t)})),new x(n,r,t.registry,e)},x.isService=function(e){return!!e&&e.hasOwnProperty("_hashStr")},x.prototype.createClient=function(e){var t=new S(this,e);return n.nextTick(function(){if(e&&e.server){var r={objectMode:!0},n=[new u.PassThrough(r),new u.PassThrough(r)];e.server.createChannel({readable:n[0],writable:n[1]},r),t.createChannel({readable:n[1],writable:n[0]},r)}else e&&e.transport&&t.createChannel(e.transport)}),t},x.prototype.createServer=function(e){return new A(this,e)},Object.defineProperty(x.prototype,"hash",{enumerable:!0,get:function(){return o.bufferFrom(this._hashStr,"binary")}}),x.prototype.message=function(e){return this._messagesByName[e]},x.prototype.type=function(e){return this._typesByName[e]},x.prototype.inspect=function(){return d("",this.name)},o.addDeprecatedGetters(x,["message","messages","name","type","types"]),x.prototype.createEmitter=c.deprecate(function(e,t){t=t||{};var r,n,i=this.createClient({cache:t.cache,buffering:!1,strictTypes:t.strictErrors,timeout:t.timeout}),o=i.createChannel(e,t);return n=o,(r=i).on("error",function(e){n.emit("error",e,r)}),o},"use `.createClient()` instead of `.createEmitter()`"),x.prototype.createListener=c.deprecate(function(e,t){if(t&&t.strictErrors)throw new Error("use `.createServer()` to support strict errors");return this._server.createChannel(e,t)},"use `.createServer().createChannel()` instead of `.createListener()`"),x.prototype.emit=c.deprecate(function(e,t,r,n){if(!r||!this.equals(r.client._svc$))throw new Error("invalid emitter");var i=r.client;return S.prototype.emitMessage.call(i,e,t,n&&n.bind(this)),r.getPending()},"create a client via `.createClient()` to emit messages instead of `.emit()`"),x.prototype.equals=c.deprecate(function(e){return x.isService(e)&&this.getFingerprint().equals(e.getFingerprint())},"equality testing is deprecated, compare the `.protocol`s instead"),x.prototype.getFingerprint=c.deprecate(function(e){return o.getHash(JSON.stringify(this.protocol),e)},"use `.hash` instead of `.getFingerprint()`"),x.prototype.getSchema=c.deprecate(h.prototype.getSchema,"use `.protocol` instead of `.getSchema()`"),x.prototype.on=c.deprecate(function(e,t){var r=this;return this._server.onMessage(e,function(e,n){return t.call(r,e,this.channel,n)}),this},"use `.createServer().onMessage()` instead of `.on()`"),x.prototype.subprotocol=c.deprecate(function(){var e=this._server,t={strictTypes:e._strict,cache:e._cache},r=new A(e.service,t);return r._handlers=Object.create(e._handlers),new x(this.name,this._messagesByName,this._typesByName,this.protocol,r)},"`.subprotocol()` will be removed in 5.1"),x.prototype._attrs=function(e){var t={protocol:this.name},r=[];this.types.forEach(function(t){if(void 0!==t.getName()){var n=t._attrs(e);"string"!=typeof n&&r.push(n)}}),r.length&&(t.types=r);var n=Object.keys(this._messagesByName);return n.length&&(t.messages={},n.forEach(function(r){t.messages[r]=this._messagesByName[r]._attrs(e)},this)),e&&e.exportAttrs&&void 0!==this.doc&&(t.doc=this.doc),t},c.inherits(S,a.EventEmitter),S.prototype.activeChannels=function(){return this._channels$.slice()},S.prototype.createChannel=function(e,t){var r,n=t&&t.objectMode;if("function"==typeof e){var i;i=n?e:function(t){var n=new P,i=e(function(e,n){if(e)t(e);else{var i=(new C).once("error",function(e){r.destroy(e)});t(null,n.pipe(i))}});if(i)return n.pipe(i),n},r=new T(this,i,t)}else{var o,s;if(Q(e)?o=s=e:(o=e.readable,s=e.writable),!n){var a=new D;o=o.pipe(a);var u=new M;u.pipe(s),s=u}r=new O(this,o,s,t),n||(r.once("eot",function(){o.unpipe(a),u.unpipe(s)}),a.once("error",function(e){r.destroy(e)}))}var c=this._channels$;return c.push(r),r.once("_drain",function(){c.splice(c.indexOf(this),1)}),this._buffering$=!1,this.emit("channel",r),r},S.prototype.destroyChannels=function(e){this._channels$.forEach(function(t){t.destroy(e&&e.noWait)})},S.prototype.emitMessage=function(e,t,r,n){var i=new F(ee(this._svc$,e),{},t);this._emitMessage$(i,r,n)},S.prototype.remoteProtocols=function(){return G(this._cache$,!0)},Object.defineProperty(S.prototype,"service",{enumerable:!0,get:function(){return this._svc$}}),S.prototype.use=function(){var e,t,r;for(e=0,t=arguments.length;e0&&(r=setTimeout(function(){o(new Error("timeout"))},e)),this._cbs[i]=o,this._n++,i;function o(){n._cbs[i]&&(delete n._cbs[i],n._n--,r&&clearTimeout(r),t.apply(n._ctx,arguments))}},j.prototype.clear=function(){Object.keys(this._cbs).forEach(function(e){this._cbs[e](new Error("interrupted"))},this)},U.prototype._decodeRequest=function(e){var t,r,n=new f(e),i=m._read(n),o=b._read(n);if(o?(t=this._serverSvc.message(o),r=this._readers[o+"?"]._read(n)):t=_,!n.isValid())throw new Error(d("truncated %s request",o||"ping$"));return new F(t,i,r)},U.prototype._decodeResponse=function(e,t,r){var n=new f(e);o.copyOwnProperties(m._read(n),t.headers,!0);var i=g._read(n),s=r.name;if(s){var a=this._readers[s+(i?"*":"!")];if(r=this._clientSvc.message(s),i?t.error=a._read(n):t.response=a._read(n),!n.isValid())throw new Error(d("truncated %s response",s))}else r=_},c.inherits(C,u.Transform),C.prototype._transform=function(e,t,r){var n;for(e=l.concat([this._buf,e]);e.length>=4&&e.length>=(n=e.readInt32BE(0))+4;){if(n)this._bufs.push(e.slice(4,n+4));else{var i=this._bufs;this._bufs=[],this.push({id:null,payload:i})}e=e.slice(n+4)}this._buf=e,r()},C.prototype._flush=function(e){if(this._buf.length||this._bufs.length){var t=this._bufs.slice();t.unshift(this._buf);var r=J("TRAILING_DATA");r.trailingData=l.concat(t).toString(),this.emit("error",r)}e()},c.inherits(P,u.Transform),P.prototype._transform=function(e,t,r){var n,i,o,s=e.payload;for(n=0,i=s.length;n=4&&e.length>=(n=e.readInt32BE(0))+4;)this._frameCount--,this._bufs.push(e.slice(4,n+4)),e=e.slice(n+4);if(this._frameCount)return this._buf=e,void r();var i={id:this._id,payload:this._bufs};this._bufs=[],this._id=void 0,this.push(i)}},D.prototype._flush=C.prototype._flush,c.inherits(M,u.Transform),M.prototype._transform=function(e,t,r){var n,i,s=e.payload,a=s.length;for((n=o.newBuffer(8)).writeInt32BE(e.id,0),n.writeInt32BE(a,4),this.push(n),i=0;i1)throw new Error("union annotations are not supported");return this._readUnion();default:var r=this._typeRefs[e.type];return r&&(delete e.type,i.copyOwnProperties(r,e)),Object.keys(e).length>1?e:e.type}},c.prototype._readFixed=function(e){var t=this._tk;return t.next({val:"(",silent:!0})||(e.name=t.next({id:"name"}).val,t.next({val:"("})),e.size=parseInt(t.next({id:"number"}).val),t.next({val:")"}),e},c.prototype._readMap=function(e){var t=this._tk,r=this._implicitTags,n=void 0===t.next({val:"<",silent:r});return e.values=this._readType(),t.next({val:">",silent:n}),e},c.prototype._readArray=function(e){var t=this._tk,r=this._implicitTags,n=void 0===t.next({val:"<",silent:r});return e.items=this._readType(),t.next({val:">",silent:n}),e},c.prototype._readEnum=function(e,t){var r=this._tk;r.next({val:"{",silent:!0})||(e.name=r.next({id:"name"}).val,r.next({val:"{"})),e.symbols=[];do{e.symbols.push(r.next().val)}while(!r.next({val:"}",silent:!0})&&r.next({val:","}));return t&&r.next({val:"=",silent:!0})&&(e.default=r.next().val,r.next({val:";"})),e},c.prototype._readUnion=function(){var e=this._tk,t=[];e.next({val:"{"});do{t.push(this._readType())}while(!e.next({val:"}",silent:!0})&&e.next({val:","}));return t},c.prototype._readRecord=function(e){var t=this._tk;for(t.next({val:"{",silent:!0})||(e.name=t.next({id:"name"}).val,t.next({val:"{"})),e.fields=[];!t.next({val:"}",silent:!0});)e.fields.push(this._readField()),t.next({val:";"});return e},c.prototype._readImports=function(e,t){for(var r=this._tk,n=0,i=r.pos;r.next({val:"import",silent:!0});){if(!n&&t&&r.next({val:"(",silent:!0}))return void(r.pos=i);var o=r.next({id:"name"}).val,s=JSON.parse(r.next({id:"string"}).val);r.next({val:";"}),e.push({kind:o,name:s}),n++}return n},l.prototype.next=function(e){var t,r={pos:this.pos,id:void 0,val:void 0},n=this._skip(e&&e.emitJavadoc);if("string"==typeof n)r.id="javadoc",r.val=n;else{var i=this.pos,o=this._str,a=o.charAt(i);if(a)if(e&&"json"===e.id?(r.id="json",this.pos=this._endOfJson()):'"'===a?(r.id="string",this.pos=this._endOfString()):/[0-9]/.test(a)?(r.id="number",this.pos=this._endOf(/[0-9]/)):/[`A-Za-z_.]/.test(a)?(r.id="name",this.pos=this._endOf(/[`A-Za-z0-9_.]/)):(r.id="operator",this.pos=i+1),r.val=o.slice(i,this.pos),"json"===r.id)try{r.val=JSON.parse(r.val)}catch(t){throw this.error("invalid JSON",r)}else"name"===r.id&&(r.val=r.val.replace(/`/g,""));else r.id="(eof)"}if(e&&e.id&&e.id!==r.id?t=this.error(s("expected ID %s",e.id),r):e&&e.val&&e.val!==r.val&&(t=this.error(s("expected value %s",e.val),r)),t){if(e&&e.silent)return void(this.pos=r.pos);throw t}return r},l.prototype.error=function(e,t){var r,n="number"!=typeof t,i=n?t.pos:t,o=this._str,a=1,u=0;for(r=0;r=-9007199254740990&&e<=9007199254740990}function q(e){return e&&"Buffer"===e.type&&Array.isArray(e.data)}function G(e,t){throw new Error(c("invalid %j: %j",t.schema(),e))}function W(e,t){var r=n.unqualify(e);return $(r)?r:n.qualify(e,t)}function Z(e){var t=e.typeName;switch(t){case"double":case"float":case"int":case"long":return"number";case"bytes":case"fixed":return"buffer";case"enum":return"string";case"map":case"error":case"record":return"object";default:return t}}function J(e){if(null===e)return"null";var t=typeof e;if("object"===t){if(Array.isArray(e))return"array";if(s.isBuffer(e))return"buffer"}return t}y.forSchema=function(e,t){(t=t||{}).registry=t.registry||{};var r,n=function(e){switch(!0===e?e="always":!1===e?e="never":void 0===e?e="auto":"string"==typeof e&&(e=e.toLowerCase()),e){case"always":return T;case"never":return B;case"auto":return;default:throw new Error(c("invalid wrap unions option: %j",e))}}(t.wrapUnions);if(null===e)throw new Error('invalid type: null (did you mean "null"?)');if(y.isType(e))return e;if(t.typeHook&&(r=t.typeHook(e,t))){if(!y.isType(r))throw new Error(c("invalid typehook return value: %j",r));return r}if("string"==typeof e){if(e=W(e,t.namespace),r=t.registry[e])return r;if($(e))return t.registry[e]=y.forSchema({type:e},t);throw new Error(c("undefined type name: %s",e))}if(e.logicalType&&t.logicalTypes&&!p){var i=t.logicalTypes[e.logicalType];if(i){var o=t.namespace,s={};Object.keys(t.registry).forEach(function(e){s[e]=t.registry[e]});try{return u("instantiating logical type for %s",e.logicalType),new i(e,t)}catch(r){if(u("failed to instantiate logical type for %s",e.logicalType),t.assertLogicalTypes)throw r;p=null,t.namespace=o,t.registry=s}}}if(Array.isArray(e)){var a=p;p=null;var f=e.map(function(e){return y.forSchema(e,t)});n||(n=function(e){var t,r,n,i,o={};for(t=0,r=e.length;ts&&(s=i,a=n);return a}(r);case"string":return function(e,t){var r,n,i,o,s={};for(r=0,n=e.length;r0){var a=s[0];s[0]=s[i],s[i]=a,r=y.forSchema(s,t)}}return{name:e,type:r,default:c[e]}})}:{type:"map",values:y.forTypes(a,t)},y.forSchema(s,t)}(r,t)}});return 1===c.length?c[0]:y.forSchema(c,t)},y.isType=function(){var e=arguments.length;if(!e)return!1;var t=arguments[0];if(!t||"function"!=typeof t._update||"function"!=typeof t.fingerprint)return!1;if(1===e)return!0;var r,n=t.typeName;for(r=1;r",t);var r=this.schema({exportAttrs:!0,noDeref:!0});return"object"!=typeof r||y.isType(this,"logical")||(r.type=void 0),c("<%s %j>",t,r)},y.prototype.isValid=function(e,t){var r,n,i=0|(t&&t.noUndeclaredFields),o=t&&t.errorHook;return o&&(n=[],r=function(t,r){o.call(this,n.slice(),t,r,e)}),this._check(e,i,r,n)},y.prototype.random=n.abstractFunction,y.prototype.schema=function(e){return this._attrs({exportAttrs:!(!e||!e.exportAttrs),noDeref:!(!e||!e.noDeref)})},y.prototype.toBuffer=function(e){h.pos=0,this._write(h,e);var t=n.newBuffer(h.pos);return h.isValid()?h.buf.copy(t,0,0,h.pos):this._write(new a(t),e),t},y.prototype.toJSON=function(){return this.schema({exportAttrs:!0})},y.prototype.toString=function(e){return void 0===e?JSON.stringify(this.schema({noDeref:!0})):JSON.stringify(this._copy(e,{coerce:3}))},y.prototype.wrap=function(e){var t=this._branchConstructor;return null===t?null:new t(e)},y.prototype._attrs=function(e){e.derefed=e.derefed||{};var t=this.name;if(void 0!==t){if(e.noDeref||e.derefed[t])return t;e.derefed[t]=!0}var r={};void 0!==this.name&&(r.name=t),r.type=this.typeName;var n=this._deref(r,e);return void 0!==n&&(r=n),e.exportAttrs&&(this.aliases&&this.aliases.length&&(r.aliases=this.aliases),void 0!==this.doc&&(r.doc=this.doc)),r},y.prototype._createBranchConstructor=function(){var e=this.branchName;if("null"===e)return null;var t=~e.indexOf(".")?"this['"+e+"']":"this."+e,r=new Function("return function Branch$(val) { "+t+" = val; };")();return r.type=this,r.prototype.unwrap=new Function("return "+t+";"),r.prototype.unwrapped=r.prototype.unwrap,r},y.prototype._peek=function(e){var t=e.pos,r=this._read(e);return e.pos=t,r},y.prototype._check=n.abstractFunction,y.prototype._copy=n.abstractFunction,y.prototype._deref=n.abstractFunction,y.prototype._match=n.abstractFunction,y.prototype._read=n.abstractFunction,y.prototype._skip=n.abstractFunction,y.prototype._update=n.abstractFunction,y.prototype._write=n.abstractFunction,y.prototype.getAliases=function(){return this.aliases},y.prototype.getFingerprint=y.prototype.fingerprint,y.prototype.getName=function(e){return this.name||!e?this.name:this.branchName},y.prototype.getSchema=y.prototype.schema,y.prototype.getTypeName=function(){return this.typeName},o.inherits(g,y),g.prototype._update=function(e,t){t.typeName===this.typeName&&(e._read=this._read)},g.prototype._copy=function(e){return this._check(e,void 0,G),e},g.prototype._deref=function(){return this.typeName},g.prototype.compare=n.compare,o.inherits(m,g),m.prototype._check=function(e,t,r){var n=null===e;return!n&&r&&r(e,this),n},m.prototype._read=function(){return null},m.prototype._skip=function(){},m.prototype._write=function(e,t){null!==t&&G(t,this)},m.prototype._match=function(){return 0},m.prototype.compare=m.prototype._match,m.prototype.typeName="null",m.prototype.random=m.prototype._read,o.inherits(b,g),b.prototype._check=function(e,t,r){var n="boolean"==typeof e;return!n&&r&&r(e,this),n},b.prototype._read=function(e){return e.readBoolean()},b.prototype._skip=function(e){e.skipBoolean()},b.prototype._write=function(e,t){"boolean"!=typeof t&&G(t,this),e.writeBoolean(t)},b.prototype._match=function(e,t){return e.matchBoolean(t)},b.prototype.typeName="boolean",b.prototype.random=function(){return f.nextBoolean()},o.inherits(v,g),v.prototype._check=function(e,t,r){var n=e===(0|e);return!n&&r&&r(e,this),n},v.prototype._read=function(e){return e.readInt()},v.prototype._skip=function(e){e.skipInt()},v.prototype._write=function(e,t){t!==(0|t)&&G(t,this),e.writeInt(t)},v.prototype._match=function(e,t){return e.matchInt(t)},v.prototype.typeName="int",v.prototype.random=function(){return 0|f.nextInt(1e3)},o.inherits(w,g),w.prototype._check=function(e,t,r){var n="number"==typeof e&&e%1==0&&H(e);return!n&&r&&r(e,this),n},w.prototype._read=function(e){var t=e.readLong();if(!H(t))throw new Error("potential precision loss");return t},w.prototype._skip=function(e){e.skipLong()},w.prototype._write=function(e,t){("number"!=typeof t||t%1||!H(t))&&G(t,this),e.writeLong(t)},w.prototype._match=function(e,t){return e.matchLong(t)},w.prototype._update=function(e,t){switch(t.typeName){case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=this._read}},w.prototype.typeName="long",w.prototype.random=function(){return f.nextInt()},w.__with=function(e,t){e=e||{};var r={toBuffer:"_toBuffer",fromBuffer:"_fromBuffer",fromJSON:"_fromJSON",toJSON:"_toJSON",isValid:"_isValid",compare:"compare"},n=new L(t);return Object.keys(r).forEach(function(t){if(void 0===e[t])throw new Error(c("missing method implementation: %s",t));n[r[t]]=e[t]}),Object.freeze(n)},o.inherits(_,g),_.prototype._check=function(e,t,r){var n="number"==typeof e;return!n&&r&&r(e,this),n},_.prototype._read=function(e){return e.readFloat()},_.prototype._skip=function(e){e.skipFloat()},_.prototype._write=function(e,t){"number"!=typeof t&&G(t,this),e.writeFloat(t)},_.prototype._match=function(e,t){return e.matchFloat(t)},_.prototype._update=function(e,t){switch(t.typeName){case"float":case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=function(e){return e.readLong()}}},_.prototype.typeName="float",_.prototype.random=function(){return f.nextFloat(1e3)},o.inherits(E,g),E.prototype._check=function(e,t,r){var n="number"==typeof e;return!n&&r&&r(e,this),n},E.prototype._read=function(e){return e.readDouble()},E.prototype._skip=function(e){e.skipDouble()},E.prototype._write=function(e,t){"number"!=typeof t&&G(t,this),e.writeDouble(t)},E.prototype._match=function(e,t){return e.matchDouble(t)},E.prototype._update=function(e,t){switch(t.typeName){case"double":case"float":case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=function(e){return e.readLong()}}},E.prototype.typeName="double",E.prototype.random=function(){return f.nextFloat()},o.inherits(x,g),x.prototype._check=function(e,t,r){var n="string"==typeof e;return!n&&r&&r(e,this),n},x.prototype._read=function(e){return e.readString()},x.prototype._skip=function(e){e.skipString()},x.prototype._write=function(e,t){"string"!=typeof t&&G(t,this),e.writeString(t)},x.prototype._match=function(e,t){return e.matchString(t)},x.prototype._update=function(e,t){switch(t.typeName){case"bytes":case"string":e._read=this._read}},x.prototype.typeName="string",x.prototype.random=function(){return f.nextString(f.nextInt(32))},o.inherits(S,g),S.prototype._check=function(e,t,r){var n=s.isBuffer(e);return!n&&r&&r(e,this),n},S.prototype._read=function(e){return e.readBytes()},S.prototype._skip=function(e){e.skipBytes()},S.prototype._write=function(e,t){s.isBuffer(t)||G(t,this),e.writeBytes(t)},S.prototype._match=function(e,t){return e.matchBytes(t)},S.prototype._update=x.prototype._update,S.prototype._copy=function(e,t){var r;switch(0|(t&&t.coerce)){case 3:return this._check(e,void 0,G),e.toString("binary");case 2:if("string"!=typeof e)throw new Error(c("cannot coerce to buffer: %j",e));return r=n.bufferFrom(e,"binary"),this._check(r,void 0,G),r;case 1:if(!q(e))throw new Error(c("cannot coerce to buffer: %j",e));return r=n.bufferFrom(e.data),this._check(r,void 0,G),r;default:return this._check(e,void 0,G),n.bufferFrom(e)}},S.prototype.compare=s.compare,S.prototype.typeName="bytes",S.prototype.random=function(){return f.nextBuffer(f.nextInt(32))},o.inherits(A,y),A.prototype._branchConstructor=function(){throw new Error("unions cannot be directly wrapped")},A.prototype._skip=function(e){this.types[e.readLong()]._skip(e)},A.prototype._match=function(e,t){var r=e.readLong(),n=t.readLong();return r===n?this.types[r]._match(e,t):r1)throw new Error(c("ambiguous aliasing for %s.%s (%s)",t.name,s.name,l));if(l.length)a=l[0],f={resolver:s.type.createResolver(d[a].type,r),name:"_"+s.name},g[a]?g[a].push(f):g[a]=[f],y.push(f.name);else{if(void 0===s.defaultValue())throw new Error(c("no matching field for default-less %s.%s",t.name,s.name));y.push("undefined")}}var m=-1;for(i=p.length;i&&void 0===g[p[--i].name];)m=i;var b=this._getConstructorName(),v=[b],w=[this.recordConstructor],_=" return function read"+b+"(t, b) {\n";for(i=0;i=m?" ":" ",v.push("r"+i),w.push(s.type),_+="r"+i+"._skip(t);\n";else for(o=g[a].length;o--;)_+=~m&&i>=m?" ":" ",v.push("r"+i+"f"+o),f=g[a][o],w.push(f.resolver),_+="var "+f.name+" = ",_+="r"+i+"f"+o+"._"+(o?"peek":"read")+"(t);\n";~m&&(_+=" }\n"),_+=" return new "+b+"("+y.join()+");\n};",e._read=new Function(v.join(),_).apply(void 0,w)},F.prototype._match=function(e,t){var r,n,i,o,s,a=this.fields;for(r=0,n=a.length;r"},e.exports={Type:y,getTypeBucket:Z,getValueBucket:J,isPrimitive:$,builtins:function(){var e,t,r,n={LogicalType:R,UnwrappedUnionType:B,WrappedUnionType:T},i=Object.keys(l);for(e=0,t=i.length;et?l(e):(this._pos+e>t&&(this._slab=l(t),this._pos=0),this._slab.slice(this._pos,this._pos+=e))},y.prototype.nextBoolean=function(){return!!(this._nextInt()%2)},y.prototype.nextInt=function(e,t){return void 0===t&&(t=e,e=0),t=void 0===t?this._max:t,e+Math.floor(this.nextFloat()*(t-e))},y.prototype.nextFloat=function(e,t){return void 0===t&&(t=e,e=0),e+((t=void 0===t?1:t)-e)*this._nextInt()/this._max},y.prototype.nextString=function(e,t){e|=0;var r="";(t=t||"aA").indexOf("a")>-1&&(r+="abcdefghijklmnopqrstuvwxyz"),t.indexOf("A")>-1&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.indexOf("#")>-1&&(r+="0123456789"),t.indexOf("!")>-1&&(r+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\");for(var n=[],i=0;i0&&r[n].index>1].index;)e=r[n],r[n]=r[t],r[t]=e,n=t},g.prototype.pop=function(){var e=this._items,t=e.length-1|0,r=e[0];if(!r||r.index>this._index)return null;if(this._index++,!t)return e.pop(),r;e[0]=e.pop();for(var n,i,o,s,a,u,c,l=t>>1,f=0;f=s.index));)e[o]=s,e[f]=a,f=o;return r},m.prototype.isValid=function(){return this.pos<=this.buf.length},m.prototype._invalidate=function(){this.pos=this.buf.length+1},m.prototype.readBoolean=function(){return!!this.buf[this.pos++]},m.prototype.skipBoolean=function(){this.pos++},m.prototype.writeBoolean=function(e){this.buf[this.pos++]=!!e},m.prototype.readInt=m.prototype.readLong=function(){var e,t,r,n,i=0,o=0,s=this.buf;do{t=128&(e=s[this.pos++]),i|=(127&e)<>1^-(1&i)},m.prototype.skipInt=m.prototype.skipLong=function(){for(var e=this.buf;128&e[this.pos++];);},m.prototype.writeInt=m.prototype.writeLong=function(e){var t,r,n=this.buf;if(e>=-1073741824&&e<1073741824){r=e>=0?e<<1:~e<<1|1;do{n[this.pos]=127&r,r>>=7}while(r&&(n[this.pos++]|=128))}else{t=e>=0?2*e:2*-e-1;do{n[this.pos]=127&t,t/=128}while(t>=1&&(n[this.pos++]|=128))}this.pos++},m.prototype.readFloat=function(){var e=this.buf,t=this.pos;return this.pos+=4,this.pos>e.length?0:this.buf.readFloatLE(t)},m.prototype.skipFloat=function(){this.pos+=4},m.prototype.writeFloat=function(e){var t=this.buf,r=this.pos;if(this.pos+=4,!(this.pos>t.length))return this.buf.writeFloatLE(e,r)},m.prototype.readDouble=function(){var e=this.buf,t=this.pos;return this.pos+=8,this.pos>e.length?0:this.buf.readDoubleLE(t)},m.prototype.skipDouble=function(){this.pos+=8},m.prototype.writeDouble=function(e){var t=this.buf,r=this.pos;if(this.pos+=8,!(this.pos>t.length))return this.buf.writeDoubleLE(e,r)},m.prototype.readFixed=function(e){var t=this.pos;if(this.pos+=e,!(this.pos>this.buf.length)){var r=a.alloc(e);return this.buf.copy(r,0,t,t+e),r}},m.prototype.skipFixed=function(e){this.pos+=e},m.prototype.writeFixed=function(e,t){t=t||e.length;var r=this.pos;this.pos+=t,this.pos>this.buf.length||e.copy(this.buf,r,0,t)},m.prototype.readBytes=function(){var e=this.readLong();if(!(e<0))return this.readFixed(e);this._invalidate()},m.prototype.skipBytes=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},m.prototype.writeBytes=function(e){var t=e.length;this.writeLong(t),this.writeFixed(e,t)},"function"==typeof s.prototype.utf8Slice?m.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,r=this.buf;return this.pos+=e,this.pos>r.length?void 0:this.buf.utf8Slice(t,t+e)}:m.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,r=this.buf;return this.pos+=e,this.pos>r.length?void 0:this.buf.slice(t,t+e).toString()},m.prototype.skipString=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},m.prototype.writeString=function(e){var t=s.byteLength(e),r=this.buf;this.writeLong(t);var n,i,o,a,u=this.pos;if(this.pos+=t,!(this.pos>r.length))if(t>64&&"function"==typeof s.prototype.utf8Write)r.utf8Write(e,u,t);else for(n=0,i=t;n>6|192,r[u++]=63&o|128):55296==(64512&o)&&56320==(64512&(a=e.charCodeAt(n+1)))?(o=65536+((1023&o)<<10)+(1023&a),n++,r[u++]=o>>18|240,r[u++]=o>>12&63|128,r[u++]=o>>6&63|128,r[u++]=63&o|128):(r[u++]=o>>12|224,r[u++]=o>>6&63|128,r[u++]=63&o|128)},"function"==typeof s.prototype.latin1Write?m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.latin1Write(e,r,t)}:"function"==typeof s.prototype.binaryWrite?m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.binaryWrite(e,r,t)}:m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.write(e,r,t,"binary")},m.prototype.matchBoolean=function(e){return this.buf[this.pos++]-e.buf[e.pos++]},m.prototype.matchInt=m.prototype.matchLong=function(e){var t=this.readLong(),r=e.readLong();return t===r?0:t>1;128&e;)n|=(127&(e=s[this.pos++]))<=8&&(o-=8,r[i++]=n,n>>=8);return r[i]=n,t&&b(r,8),r},m.prototype.packLongBytes=function(e){var t,r=(128&e[7])>>7,n=this.buf,i=1,o=0,s=3;r?(b(e,8),t=1):t=0;for(var a=[e.readUIntLE(0,3),e.readUIntLE(3,3),e.readUIntLE(6,2)];s&&!a[--s];);for(;o7;)n[this.pos++]=127&t|128,t>>=7,i-=7;t|=a[s]<>=7}while(t&&(n[this.pos++]|=128));this.pos++,r&&b(e,8)},e.exports={abstractFunction:function(){throw new Error("abstract")},addDeprecatedGetters:function(e,t){var r,n,i,s,a=e.prototype;for(r=0,n=t.length;r=0)return-2;i=r}return i},hasDuplicates:function(e,t){var r,n,i,o=Object.create(null);for(r=0,n=e.length;r0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}(e),s=o[0],a=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),c=0,l=a>0?s-4:s;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function u(e,t,r){for(var n,i=[],o=t;ot.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,f.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,o(this.init_done,"close before init"),o(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},f.prototype.write=function(e,t,r,n,i,o,s){return this._write(!0,e,t,r,n,i,o,s)},f.prototype.writeSync=function(e,t,r,n,i,o,s){return this._write(!1,e,t,r,n,i,o,s)},f.prototype._write=function(e,r,s,a,u,c,l,f){if(o.equal(arguments.length,8),o(this.init_done,"write before init"),o(this.mode!==t.NONE,"already finalized"),o.equal(!1,this.write_in_progress,"write already in progress"),o.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,o.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==s&&(s=n.alloc(0),u=0,a=0),this.strm.avail_in=u,this.strm.input=s,this.strm.next_in=a,this.strm.avail_out=f,this.strm.output=c,this.strm.next_out=l,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return i.nextTick(function(){h._process(),h._after()}),this},f.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},f.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},f.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},f.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},f.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(e,r,n,i,s){o(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),o(e>=8&&e<=15,"invalid windowBits"),o(r>=-1&&r<=9,"invalid compression level"),o(n>=1&&n<=9,"invalid memlevel"),o(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,i,s),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(e,r,n,i,o){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new s,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=o,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=a.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=f},78559(e,t,r){"use strict";var n=r(65606),i=r(48287).Buffer,o=r(88310).Transform,s=r(5974),a=r(40537),u=r(94148).ok,c=r(48287).kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";s.Z_MIN_WINDOWBITS=8,s.Z_MAX_WINDOWBITS=15,s.Z_DEFAULT_WINDOWBITS=15,s.Z_MIN_CHUNK=64,s.Z_MAX_CHUNK=1/0,s.Z_DEFAULT_CHUNK=16384,s.Z_MIN_MEMLEVEL=1,s.Z_MAX_MEMLEVEL=9,s.Z_DEFAULT_MEMLEVEL=8,s.Z_MIN_LEVEL=-1,s.Z_MAX_LEVEL=9,s.Z_DEFAULT_LEVEL=s.Z_DEFAULT_COMPRESSION;for(var f=Object.keys(s),h=0;h=c?s=new RangeError(l):t=i.concat(n,o),n=[],e.close(),r(s,t)}e.on("error",function(t){e.removeListener("end",a),e.removeListener("readable",s),r(t)}),e.on("end",a),e.end(t),s()}function v(e,t){if("string"==typeof t&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function w(e){if(!(this instanceof w))return new w(e);O.call(this,e,s.DEFLATE)}function _(e){if(!(this instanceof _))return new _(e);O.call(this,e,s.INFLATE)}function E(e){if(!(this instanceof E))return new E(e);O.call(this,e,s.GZIP)}function x(e){if(!(this instanceof x))return new x(e);O.call(this,e,s.GUNZIP)}function S(e){if(!(this instanceof S))return new S(e);O.call(this,e,s.DEFLATERAW)}function A(e){if(!(this instanceof A))return new A(e);O.call(this,e,s.INFLATERAW)}function B(e){if(!(this instanceof B))return new B(e);O.call(this,e,s.UNZIP)}function T(e){return e===s.Z_NO_FLUSH||e===s.Z_PARTIAL_FLUSH||e===s.Z_SYNC_FLUSH||e===s.Z_FULL_FLUSH||e===s.Z_FINISH||e===s.Z_BLOCK}function O(e,r){var n=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,o.call(this,e),e.flush&&!T(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!T(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||s.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:s.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!i.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new s.Zlib(r);var a=this;this._hadError=!1,this._handle.onerror=function(e,r){k(a),a._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],a.emit("error",n)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var c=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(c=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,c,e.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=c,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!n._handle},configurable:!0,enumerable:!0})}function k(e,t){t&&n.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function I(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=w,t.Inflate=_,t.Gzip=E,t.Gunzip=x,t.DeflateRaw=S,t.InflateRaw=A,t.Unzip=B,t.createDeflate=function(e){return new w(e)},t.createInflate=function(e){return new _(e)},t.createDeflateRaw=function(e){return new S(e)},t.createInflateRaw=function(e){return new A(e)},t.createGzip=function(e){return new E(e)},t.createGunzip=function(e){return new x(e)},t.createUnzip=function(e){return new B(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new w(t),e,r)},t.deflateSync=function(e,t){return v(new w(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new E(t),e,r)},t.gzipSync=function(e,t){return v(new E(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new S(t),e,r)},t.deflateRawSync=function(e,t){return v(new S(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new B(t),e,r)},t.unzipSync=function(e,t){return v(new B(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new _(t),e,r)},t.inflateSync=function(e,t){return v(new _(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new x(t),e,r)},t.gunzipSync=function(e,t){return v(new x(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new A(t),e,r)},t.inflateRawSync=function(e,t){return v(new A(t),e)},a.inherits(O,o),O.prototype.params=function(e,r,i){if(et.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var o=this;this.flush(s.Z_SYNC_FLUSH,function(){u(o._handle,"zlib binding closed"),o._handle.params(e,r),o._hadError||(o._level=e,o._strategy=r,i&&i())})}else n.nextTick(i)},O.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},O.prototype._flush=function(e){this._transform(i.alloc(0),"",e)},O.prototype.flush=function(e,t){var r=this,o=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=s.Z_FULL_FLUSH),o.ended?t&&n.nextTick(t):o.ending?t&&this.once("end",t):o.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(i.alloc(0),"",t))},O.prototype.close=function(e){k(this,e),n.nextTick(I,this)},O.prototype._transform=function(e,t,r){var n,o=this._writableState,a=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||i.isBuffer(e)?this._handle?(a?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||s.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},O.prototype._processChunk=function(e,t,r){var n=e&&e.length,o=this._chunkSize-this._offset,s=0,a=this,f="function"==typeof r;if(!f){var h,p=[],d=0;this.on("error",function(e){h=e}),u(this._handle,"zlib binding closed");do{var y=this._handle.writeSync(t,e,s,n,this._buffer,this._offset,o)}while(!this._hadError&&b(y[0],y[1]));if(this._hadError)throw h;if(d>=c)throw k(this),new RangeError(l);var g=i.concat(p,d);return k(this),g}u(this._handle,"zlib binding closed");var m=this._handle.write(t,e,s,n,this._buffer,this._offset,o);function b(c,l){if(this&&(this.buffer=null,this.callback=null),!a._hadError){var h=o-l;if(u(h>=0,"have should not go down"),h>0){var y=a._buffer.slice(a._offset,a._offset+h);a._offset+=h,f?a.push(y):(p.push(y),d+=y.length)}if((0===l||a._offset>=a._chunkSize)&&(o=a._chunkSize,a._offset=0,a._buffer=i.allocUnsafe(a._chunkSize)),0===l){if(s+=n-c,n=c,!f)return!0;var g=a._handle.write(t,e,s,n,a._buffer,a._offset,a._chunkSize);return g.callback=b,void(g.buffer=e)}if(!f)return!1;r()}}m.buffer=e,m.callback=b},a.inherits(w,O),a.inherits(_,O),a.inherits(E,O),a.inherits(x,O),a.inherits(S,O),a.inherits(A,O),a.inherits(B,O)},48287(e,t,r){"use strict";const n=r(67526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function B(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function O(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function j(e,t,r,n,i){z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function U(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(e,t,r,n,o){return t=+t,r>>>=0,o||U(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,o){return t=+t,r>>>=0,o||U(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X(function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X(function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||F(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=X(function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=X(function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function V(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),M("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const q=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},13144(e,t,r){"use strict";var n=r(66743),i=r(11002),o=r(10076),s=r(47119);e.exports=s||n.call(o,i)},12205(e,t,r){"use strict";var n=r(66743),i=r(11002),o=r(13144);e.exports=function(){return o(n,i,arguments)}},11002(e){"use strict";e.exports=Function.prototype.apply},10076(e){"use strict";e.exports=Function.prototype.call},73126(e,t,r){"use strict";var n=r(66743),i=r(69675),o=r(10076),s=r(13144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return s(n,o,e)}},47119(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},38075(e,t,r){"use strict";var n=r(70453),i=r(10487),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},10487(e,t,r){"use strict";var n=r(96897),i=r(30655),o=r(73126),s=r(12205);e.exports=function(e){var t=o(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:s}):e.exports.apply=s},36556(e,t,r){"use strict";var n=r(70453),i=r(73126),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},49881(e,t,r){"use strict";const n=r(20893),i=r(79777),o=r(93737),s=r(72893),a=r(15059),u=r(53557),c=r(82903),l=r(207);e.exports={Commented:n,Diagnose:i,Decoder:o,Encoder:s,Simple:a,Tagged:u,Map:c,SharedValueEncoder:l,comment:n.comment,decodeAll:o.decodeAll,decodeFirst:o.decodeFirst,decodeAllSync:o.decodeAllSync,decodeFirstSync:o.decodeFirstSync,diagnose:i.diagnose,encode:s.encode,encodeCanonical:s.encodeCanonical,encodeOne:s.encodeOne,encodeAsync:s.encodeAsync,decode:o.decodeFirstSync,leveldb:{decode:o.decodeFirstSync,encode:s.encode,buffer:!0,name:"cbor"},reset(){s.reset(),u.reset()}}},20893(e,t,r){"use strict";const n=r(88310),i=r(27328),o=r(93737),s=r(5256),{MT:a,NUMBYTES:u,SYMS:c}=r(79452),{Buffer:l}=r(48287);function f(e){return e>1?"s":""}class h extends n.Transform{constructor(e={}){const{depth:t=1,max_depth:r=10,no_summary:n=!1,tags:i={},preferWeb:a,encoding:u,...c}=e;super({...c,readableObjectMode:!1,writableObjectMode:!1}),this.depth=t,this.max_depth=r,this.all=new s,i[24]||(i[24]=this._tag_24.bind(this)),this.parser=new o({tags:i,max_depth:r,preferWeb:a,encoding:u}),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("start-string",this._on_start_string.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("error",this._on_error.bind(this)),n||this.parser.on("data",this._on_data.bind(this)),this.parser.bs.on("read",this._on_read.bind(this))}_tag_24(e){const t=new h({depth:this.depth+1,no_summary:!0});t.on("data",e=>this.push(e)),t.on("error",e=>this.emit("error",e)),t.end(e)}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){return this.parser._flush(e)}static comment(e,t={},r=null){if(null==e)throw new Error("input required");({options:t,cb:r}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"number":return{options:{max_depth:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(t,r));const n=new s,{encoding:o="hex",...a}=t,u=new h(a);let c=null;return"function"==typeof r?(u.on("end",()=>{r(null,n.toString("utf8"))}),u.on("error",r)):c=new Promise((e,t)=>{u.on("end",()=>{e(n.toString("utf8"))}),u.on("error",t)}),u.pipe(n),i.guessEncoding(e,o).pipe(u),c}_on_error(e){this.push("ERROR: "),this.push(e.toString()),this.push("\n")}_on_read(e){this.all.write(e);const t=e.toString("hex");this.push(new Array(this.depth+1).join(" ")),this.push(t);let r=2*(this.max_depth-this.depth)-t.length;r<1&&(r=1),this.push(new Array(r+1).join(" ")),this.push("-- ")}_on_more(e,t,r,n){let i="";switch(this.depth++,e){case a.POS_INT:i="Positive number,";break;case a.NEG_INT:i="Negative number,";break;case a.ARRAY:i="Array, length";break;case a.MAP:i="Map, count";break;case a.BYTE_STRING:i="Bytes, length";break;case a.UTF8_STRING:i="String, length";break;case a.SIMPLE_FLOAT:i=1===t?"Simple value,":"Float,"}this.push(`${i} next ${t} byte${f(t)}\n`)}_on_start_string(e,t,r,n){let i="";switch(this.depth++,e){case a.BYTE_STRING:i=`Bytes, length: ${t}`;break;case a.UTF8_STRING:i=`String, length: ${t.toString()}`}this.push(`${i}\n`)}_on_start(e,t,r,n){switch(this.depth++,r){case a.ARRAY:this.push(`[${n}], `);break;case a.MAP:n%2?this.push(`{Val:${Math.floor(n/2)}}, `):this.push(`{Key:${Math.floor(n/2)}}, `)}switch(e){case a.TAG:this.push(`Tag #${t}`),24===t&&this.push(" Encoded CBOR data item");break;case a.ARRAY:t===c.STREAM?this.push("Array (streaming)"):this.push(`Array, ${t} item${f(t)}`);break;case a.MAP:t===c.STREAM?this.push("Map (streaming)"):this.push(`Map, ${t} pair${f(t)}`);break;case a.BYTE_STRING:this.push("Bytes (streaming)");break;case a.UTF8_STRING:this.push("String (streaming)")}this.push("\n")}_on_stop(e){this.depth--}_on_value(e,t,r,n){if(e!==c.BREAK)switch(t){case a.ARRAY:this.push(`[${r}], `);break;case a.MAP:r%2?this.push(`{Val:${Math.floor(r/2)}}, `):this.push(`{Key:${Math.floor(r/2)}}, `)}const o=i.cborValueToString(e,-1/0);switch("string"==typeof e||l.isBuffer(e)?(e.length>0&&(this.push(o),this.push("\n")),this.depth--):(this.push(o),this.push("\n")),n){case u.ONE:case u.TWO:case u.FOUR:case u.EIGHT:this.depth--}}_on_data(){this.push("0x"),this.push(this.all.read().toString("hex")),this.push("\n")}}e.exports=h},79452(e,t){"use strict";t.MT={POS_INT:0,NEG_INT:1,BYTE_STRING:2,UTF8_STRING:3,ARRAY:4,MAP:5,TAG:6,SIMPLE_FLOAT:7},t.TAG={DATE_STRING:0,DATE_EPOCH:1,POS_BIGINT:2,NEG_BIGINT:3,DECIMAL_FRAC:4,BIGFLOAT:5,BASE64URL_EXPECTED:21,BASE64_EXPECTED:22,BASE16_EXPECTED:23,CBOR:24,URI:32,BASE64URL:33,BASE64:34,REGEXP:35,MIME:36,SET:258},t.NUMBYTES={ZERO:0,ONE:24,TWO:25,FOUR:26,EIGHT:27,INDEFINITE:31},t.SIMPLE={FALSE:20,TRUE:21,NULL:22,UNDEFINED:23},t.SYMS={NULL:Symbol.for("github.com/hildjj/node-cbor/null"),UNDEFINED:Symbol.for("github.com/hildjj/node-cbor/undef"),PARENT:Symbol.for("github.com/hildjj/node-cbor/parent"),BREAK:Symbol.for("github.com/hildjj/node-cbor/break"),STREAM:Symbol.for("github.com/hildjj/node-cbor/stream")},t.SHIFT32=4294967296,t.BI={MINUS_ONE:BigInt(-1),NEG_MAX:BigInt(-1)-BigInt(Number.MAX_SAFE_INTEGER),MAXINT32:BigInt("0xffffffff"),MAXINT64:BigInt("0xffffffffffffffff"),SHIFT32:BigInt(t.SHIFT32)}},93737(e,t,r){"use strict";const n=r(54957),i=r(53557),o=r(15059),s=r(27328),a=r(5256),u=r(79452),{MT:c,NUMBYTES:l,SYMS:f,BI:h}=u,{Buffer:p}=r(48287),d=Symbol("count"),y=Symbol("major type"),g=Symbol("error"),m=Symbol("not found");function b(e,t,r){const n=[];return n[d]=r,n[f.PARENT]=e,n[y]=t,n}function v(e,t){const r=new a;return r[d]=-1,r[f.PARENT]=e,r[y]=t,r}class w extends Error{constructor(e,t){super(`Unexpected data: 0x${e.toString(16)}`),this.name="UnexpectedDataError",this.byte=e,this.value=t}}function _(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}class E extends n{constructor(e={}){const{tags:t={},max_depth:r=-1,preferMap:n=!1,preferWeb:i=!1,required:o=!1,encoding:s="hex",extendedResults:u=!1,preventDuplicateKeys:c=!1,...l}=e;super({defaultEncoding:s,...l}),this.running=!0,this.max_depth=r,this.tags=t,this.preferMap=n,this.preferWeb=i,this.extendedResults=u,this.required=o,this.preventDuplicateKeys=c,u&&(this.bs.on("read",this._onRead.bind(this)),this.valueBytes=new a)}static nullcheck(e){switch(e){case f.NULL:return null;case f.UNDEFINED:return;case m:throw new Error("Value not found");default:return e}}static decodeFirstSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=_(t));const{encoding:r="hex",...n}=t,i=new E(n),o=s.guessEncoding(e,r),a=i._parse();let u=a.next();for(;!u.done;){const e=o.read(u.value);if(null==e||e.length!==u.value)throw new Error("Insufficient data");i.extendedResults&&i.valueBytes.write(e),u=a.next(e)}let c=null;if(i.extendedResults)c=u.value,c.unused=o.read();else if(c=E.nullcheck(u.value),o.length>0){const e=o.read(1);throw o.unshift(e),new w(e[0],c)}return c}static decodeAllSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=_(t));const{encoding:r="hex",...n}=t,i=new E(n),o=s.guessEncoding(e,r),a=[];for(;o.length>0;){const e=i._parse();let t=e.next();for(;!t.done;){const r=o.read(t.value);if(null==r||r.length!==t.value)throw new Error("Insufficient data");i.extendedResults&&i.valueBytes.write(r),t=e.next(r)}a.push(E.nullcheck(t.value))}return a}static decodeFirst(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=_(t,r));const{encoding:n="hex",required:i=!1,...o}=t,a=new E(o);let u=m;const c=s.guessEncoding(e,n),l=new Promise((e,t)=>{a.on("data",e=>{u=E.nullcheck(e),a.close()}),a.once("error",r=>a.extendedResults&&r instanceof w?(u.unused=a.bs.slice(),e(u)):(u!==m&&(r.value=u),u=g,a.close(),t(r))),a.once("end",()=>{switch(u){case m:return i?t(new Error("No CBOR found")):e(u);case g:return;default:return e(u)}})});return"function"==typeof r&&l.then(e=>r(null,e),r),c.pipe(a),l}static decodeAll(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=_(t,r));const{encoding:n="hex",...i}=t,o=new E(i),a=[];o.on("data",e=>a.push(E.nullcheck(e)));const u=new Promise((e,t)=>{o.on("error",t),o.on("end",()=>e(a))});return"function"==typeof r&&u.then(e=>r(void 0,e),e=>r(e,void 0)),s.guessEncoding(e,n).pipe(o),u}close(){this.running=!1,this.__fresh=!0}_onRead(e){this.valueBytes.write(e)}*_parse(){let e=null,t=0,r=null;for(;;){if(this.max_depth>=0&&t>this.max_depth)throw new Error(`Maximum depth ${this.max_depth} exceeded`);const[n]=yield 1;if(!this.running)throw this.bs.unshift(p.from([n])),new w(n);const u=n>>5,g=31&n,m=null==e?void 0:e[y],_=null==e?void 0:e.length;switch(g){case l.ONE:this.emit("more-bytes",u,1,m,_),[r]=yield 1;break;case l.TWO:case l.FOUR:case l.EIGHT:{const e=1<this.stream_errors?(t&&this._on_error(t),e()):e(t))}static diagnose(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(t,r));const{encoding:n="hex",...i}=t,a=new s,u=new c(i);let l=null;return"function"==typeof r?(u.on("end",()=>r(null,a.toString("utf8"))),u.on("error",r)):l=new Promise((e,t)=>{u.on("end",()=>e(a.toString("utf8"))),u.on("error",t)}),u.pipe(a),o.guessEncoding(e,n).pipe(u),l}_on_error(e){this.stream_errors?this.push(e.toString()):this.emit("error",e)}_on_more(e,t,r,n){e===a.SIMPLE_FLOAT&&(this.float_bytes={2:1,4:2,8:3}[t])}_fore(e,t){switch(e){case a.BYTE_STRING:case a.UTF8_STRING:case a.ARRAY:t>0&&this.push(", ");break;case a.MAP:t>0&&(t%2?this.push(": "):this.push(", "))}}_on_value(e,t,r){if(e===u.BREAK)return;this._fore(t,r);const n=this.float_bytes;this.float_bytes=-1,this.push(o.cborValueToString(e,n))}_on_start(e,t,r,n){switch(this._fore(r,n),e){case a.TAG:this.push(`${t}(`);break;case a.ARRAY:this.push("[");break;case a.MAP:this.push("{");break;case a.BYTE_STRING:case a.UTF8_STRING:this.push("(")}t===u.STREAM&&this.push("_ ")}_on_stop(e){switch(e){case a.TAG:this.push(")");break;case a.ARRAY:this.push("]");break;case a.MAP:this.push("}");break;case a.BYTE_STRING:case a.UTF8_STRING:this.push(")")}}_on_data(){this.push(this.separator)}}e.exports=c},72893(e,t,r){"use strict";const n=r(88310),i=r(5256),o=r(27328),s=r(79452),{MT:a,NUMBYTES:u,SHIFT32:c,SIMPLE:l,SYMS:f,TAG:h,BI:p}=s,{Buffer:d}=r(48287),y=a.SIMPLE_FLOAT<<5|u.TWO,g=a.SIMPLE_FLOAT<<5|u.FOUR,m=a.SIMPLE_FLOAT<<5|u.EIGHT,b=a.SIMPLE_FLOAT<<5|l.TRUE,v=a.SIMPLE_FLOAT<<5|l.FALSE,w=a.SIMPLE_FLOAT<<5|l.UNDEFINED,_=a.SIMPLE_FLOAT<<5|l.NULL,E=d.from([255]),x=d.from("f97e00","hex"),S=d.from("f9fc00","hex"),A=d.from("f97c00","hex"),B=d.from("f98000","hex"),T={};let O={};class k extends n.Transform{constructor(e={}){const{canonical:t=!1,encodeUndefined:r,disallowUndefinedKeys:n=!1,dateType:i="number",collapseBigIntegers:o=!1,detectLoops:s=!1,omitUndefinedProperties:a=!1,genTypes:u=[],...c}=e;if(super({...c,readableObjectMode:!1,writableObjectMode:!0}),this.canonical=t,this.encodeUndefined=r,this.disallowUndefinedKeys=n,this.dateType=function(e){if(!e)return"number";switch(e.toLowerCase()){case"number":return"number";case"float":return"float";case"int":case"integer":return"int";case"string":return"string"}throw new TypeError(`dateType invalid, got "${e}"`)}(i),this.collapseBigIntegers=!!this.canonical||o,this.detectLoops=void 0,"boolean"==typeof s)s&&(this.detectLoops=new WeakSet);else{if(!(s instanceof WeakSet))throw new TypeError("detectLoops must be boolean or WeakSet");this.detectLoops=s}if(this.omitUndefinedProperties=a,this.semanticTypes={...k.SEMANTIC_TYPES},Array.isArray(u))for(let e=0,t=u.length;e{const r=typeof e[t];return"function"!==r&&(!this.omitUndefinedProperties||"undefined"!==r)}),n={};if(this.canonical&&r.sort((e,t)=>{const r=n[e]||(n[e]=k.encode(e)),i=n[t]||(n[t]=k.encode(t));return r.compare(i)}),t.indefinite){if(!this._pushUInt8(a.MAP<<5|u.INDEFINITE))return!1}else if(!this._pushInt(r.length,a.MAP))return!1;let i=null;for(let t=0,o=r.length;tvoid 0!==t)),r.indefinite){if(!e._pushUInt8(a.MAP<<5|u.INDEFINITE))return!1}else if(!e._pushInt(n.length,a.MAP))return!1;if(e.canonical){const t=new k({genTypes:e.semanticTypes,canonical:e.canonical,detectLoops:Boolean(e.detectLoops),dateType:e.dateType,disallowUndefinedKeys:e.disallowUndefinedKeys,collapseBigIntegers:e.collapseBigIntegers}),r=new i({highWaterMark:e.readableHighWaterMark});t.pipe(r),n.sort(([e],[n])=>{t.pushAny(e);const i=r.read();t.pushAny(n);const o=r.read();return i.compare(o)});for(const[t,r]of n){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}}else for(const[t,r]of n){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}return!(r.indefinite&&!e.push(E))}static _pushTypedArray(e,t){let r=64,n=t.BYTES_PER_ELEMENT;const{name:i}=t.constructor;return i.startsWith("Float")?(r|=16,n/=2):i.includes("U")||(r|=8),(i.includes("Clamped")||1!==n&&!o.isBigEndian())&&(r|=4),r|={1:0,2:1,4:2,8:3}[n],!!e._pushTag(r)&&k._pushBuffer(e,d.from(t.buffer,t.byteOffset,t.byteLength))}static _pushArrayBuffer(e,t){return k._pushBuffer(e,d.from(t))}static encodeIndefinite(e,t,r={}){if(null==t){if(null==this)throw new Error("No object to encode");t=this}const{chunkSize:n=4096}=r;let i=!0;const s=typeof t;let c=null;if("string"===s){i=i&&e._pushUInt8(a.UTF8_STRING<<5|u.INDEFINITE);let r=0;for(;r{const i=[],o=new k(t);o.on("data",e=>i.push(e)),o.on("error",n),o.on("finish",()=>r(d.concat(i))),o.pushAny(e),o.end()})}static get SEMANTIC_TYPES(){return O}static set SEMANTIC_TYPES(e){O=e}static reset(){k.SEMANTIC_TYPES={...T}}}Object.assign(T,{Array:k.pushArray,Date:k._pushDate,Buffer:k._pushBuffer,[d.name]:k._pushBuffer,Map:k._pushMap,NoFilter:k._pushNoFilter,[i.name]:k._pushNoFilter,RegExp:k._pushRegexp,Set:k._pushSet,ArrayBuffer:k._pushArrayBuffer,Uint8ClampedArray:k._pushTypedArray,Uint8Array:k._pushTypedArray,Uint16Array:k._pushTypedArray,Uint32Array:k._pushTypedArray,Int8Array:k._pushTypedArray,Int16Array:k._pushTypedArray,Int32Array:k._pushTypedArray,Float32Array:k._pushTypedArray,Float64Array:k._pushTypedArray,URL:k._pushURL,Boolean:k._pushBoxed,Number:k._pushBoxed,String:k._pushBoxed}),"undefined"!=typeof BigUint64Array&&(T[BigUint64Array.name]=k._pushTypedArray),"undefined"!=typeof BigInt64Array&&(T[BigInt64Array.name]=k._pushTypedArray),k.reset(),e.exports=k},82903(e,t,r){"use strict";const{Buffer:n}=r(48287),i=r(72893),o=r(93737),{MT:s}=r(79452);class a extends Map{constructor(e){super(e)}static _encode(e){return i.encodeCanonical(e).toString("base64")}static _decode(e){return o.decodeFirstSync(e,"base64")}get(e){return super.get(a._encode(e))}set(e,t){return super.set(a._encode(e),t)}delete(e){return super.delete(a._encode(e))}has(e){return super.has(a._encode(e))}*keys(){for(const e of super.keys())yield a._decode(e)}*entries(){for(const e of super.entries())yield[a._decode(e[0]),e[1]]}[Symbol.iterator](){return this.entries()}forEach(e,t=this){if("function"!=typeof e)throw new TypeError("Must be function");for(const r of super.entries())e.call(t,r[1],a._decode(r[0]),this)}encodeCBOR(e){if(!e._pushInt(this.size,s.MAP))return!1;if(e.canonical){const t=Array.from(super.entries()).map(e=>[n.from(e[0],"base64"),e[1]]);t.sort((e,t)=>e[0].compare(t[0]));for(const r of t)if(!e.push(r[0])||!e.pushAny(r[1]))return!1}else for(const t of super.entries())if(!e.push(n.from(t[0],"base64"))||!e.pushAny(t[1]))return!1;return!0}}e.exports=a},69744(e){"use strict";class t{constructor(){this.clear()}clear(){this.map=new WeakMap,this.count=0,this.recording=!0}stop(){this.recording=!1}check(e){const r=this.map.get(e);if(r)return r.length>1?r[0]||this.recording?r[1]:(r[0]=!0,t.FIRST):this.recording?(r.push(this.count++),r[1]):t.NEVER;if(!this.recording)throw new Error("New object detected when not recording");return this.map.set(e,[!1]),t.NEVER}}t.NEVER=-1,t.FIRST=-2,e.exports=t},207(e,t,r){"use strict";const n=r(72893),i=r(69744),{Buffer:o}=r(48287);class s extends n{constructor(e){super(e),this.valueSharing=new i}_pushObject(e,t){if(null!==e){const t=this.valueSharing.check(e);switch(t){case i.FIRST:this._pushTag(28);break;case i.NEVER:break;default:return this._pushTag(29)&&this._pushIntNum(t)}}return super._pushObject(e,t)}stopRecording(){this.valueSharing.stop()}clearRecording(){this.valueSharing.clear()}static encode(...e){const t=new s;t.on("data",()=>{});for(const r of e)t.pushAny(r);return t.stopRecording(),t.removeAllListeners("data"),t._encodeAll(e)}static encodeCanonical(...e){throw new Error("Cannot encode canonically in a SharedValueEncoder, which serializes objects multiple times.")}static encodeOne(e,t){const r=new s(t);return r.on("data",()=>{}),r.pushAny(e),r.stopRecording(),r.removeAllListeners("data"),r._encodeAll([e])}static encodeAsync(e,t){return new Promise((r,n)=>{const i=[],a=new s(t);a.on("data",()=>{}),a.on("error",n),a.on("finish",()=>r(o.concat(i))),a.pushAny(e),a.stopRecording(),a.removeAllListeners("data"),a.on("data",e=>i.push(e)),a.pushAny(e),a.end()})}}e.exports=s},15059(e,t,r){"use strict";const{MT:n,SIMPLE:i,SYMS:o}=r(79452);class s{constructor(e){if("number"!=typeof e)throw new Error("Invalid Simple type: "+typeof e);if(e<0||e>255||(0|e)!==e)throw new Error(`value must be a small positive integer: ${e}`);this.value=e}toString(){return`simple(${this.value})`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return`simple(${this.value})`}encodeCBOR(e){return e._pushInt(this.value,n.SIMPLE_FLOAT)}static isSimple(e){return e instanceof s}static decode(e,t=!0,r=!1){switch(e){case i.FALSE:return!1;case i.TRUE:return!0;case i.NULL:return t?null:o.NULL;case i.UNDEFINED:if(t)return;return o.UNDEFINED;case-1:if(!t||!r)throw new Error("Invalid BREAK");return o.BREAK;default:return new s(e)}}}e.exports=s},53557(e,t,r){"use strict";const n=r(79452),i=r(27328),o=Symbol("INTERNAL_JSON");function s(e,t){if(i.isBufferish(e))e.toJSON=t;else if(Array.isArray(e))for(const r of e)s(r,t);else if(e&&"object"==typeof e&&(!(e instanceof d)||e.tag<21||e.tag>23))for(const r of Object.values(e))s(r,t)}function a(){return i.base64(this)}function u(){return i.base64url(this)}function c(){return this.toString("hex")}const l={0:e=>new Date(e),1:e=>new Date(1e3*e),2:e=>i.bufferToBigInt(e),3:e=>n.BI.MINUS_ONE-i.bufferToBigInt(e),21:(e,t)=>(i.isBufferish(e)?t[o]=u:s(e,u),t),22:(e,t)=>(i.isBufferish(e)?t[o]=a:s(e,a),t),23:(e,t)=>(i.isBufferish(e)?t[o]=c:s(e,c),t),32:e=>new URL(e),33:(e,t)=>{if(!e.match(/^[a-zA-Z0-9_-]+$/))throw new Error("Invalid base64url characters");const r=e.length%4;if(1===r)throw new Error("Invalid base64url length");if(2===r){if(-1==="AQgw".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding")}else if(3===r&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding");return t},34:(e,t)=>{const r=e.match(/^[a-zA-Z0-9+/]+(?={0,2})$/);if(!r)throw new Error("Invalid base64 characters");if(e.length%4!=0)throw new Error("Invalid base64 length");if("="===r.groups.padding){if(-1==="AQgw".indexOf(e[e.length-2]))throw new Error("Invalid base64 padding")}else if("=="===r.groups.padding&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-3]))throw new Error("Invalid base64 padding");return t},35:e=>new RegExp(e),258:e=>new Set(e)},f={64:Uint8Array,65:Uint16Array,66:Uint32Array,68:Uint8ClampedArray,69:Uint16Array,70:Uint32Array,72:Int8Array,73:Int16Array,74:Int32Array,77:Int16Array,78:Int32Array,81:Float32Array,82:Float64Array,85:Float32Array,86:Float64Array};function h(e,t){if(!i.isBufferish(e))throw new TypeError("val not a buffer");const{tag:r}=t,n=f[r];if(!n)throw new Error(`Invalid typed array tag: ${r}`);const o=2**(((16&r)>>4)+(3&r));return!(4&r)!==i.isBigEndian()&&o>1&&function(e,t,r,n){const i=new DataView(e),[o,s]={2:[i.getUint16,i.setUint16],4:[i.getUint32,i.setUint32],8:[i.getBigUint64,i.setBigUint64]}[t],a=r+n;for(let e=r;e0?this.err=e.message:this.err=e,this}}static get TAGS(){return p}static set TAGS(e){p=e}static reset(){d.TAGS={...l}}}d.INTERNAL_JSON=o,d.reset(),e.exports=d},27328(e,t,r){"use strict";const{Buffer:n}=r(48287),i=r(5256),o=r(88310),s=r(79452),{NUMBYTES:a,SHIFT32:u,BI:c,SYMS:l}=s,f=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});t.utf8=e=>f.decode(e),t.utf8.checksUTF8=!0,t.isBufferish=function(e){return e&&"object"==typeof e&&(n.isBuffer(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof ArrayBuffer||e instanceof DataView)},t.bufferishToBuffer=function(e){return n.isBuffer(e)?e:ArrayBuffer.isView(e)?n.from(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?n.from(e):null},t.parseCBORint=function(e,t){switch(e){case a.ONE:return t.readUInt8(0);case a.TWO:return t.readUInt16BE(0);case a.FOUR:return t.readUInt32BE(0);case a.EIGHT:{const e=t.readUInt32BE(0),r=t.readUInt32BE(4);return e>2097151?BigInt(e)*c.SHIFT32+BigInt(r):e*u+r}default:throw new Error(`Invalid additional info for int: ${e}`)}},t.writeHalf=function(e,t){const r=n.allocUnsafe(4);r.writeFloatBE(t,0);const i=r.readUInt32BE(0);if(8191&i)return!1;let o=i>>16&32768;const s=i>>23&255,a=8388607&i;if(s>=113&&s<=142)o+=(s-112<<10)+(a>>13);else{if(!(s>=103&&s<113))return!1;if(a&(1<<126-s)-1)return!1;o+=a+8388608>>126-s}return e.writeUInt16BE(o),!0},t.parseHalf=function(e){const t=128&e[0]?-1:1,r=(124&e[0])>>2,n=(3&e[0])<<8|e[1];return r?31===r?t*(n?NaN:1/0):t*2**(r-25)*(1024+n):5.960464477539063e-8*t*n},t.parseCBORfloat=function(e){switch(e.length){case 2:return t.parseHalf(e);case 4:return e.readFloatBE(0);case 8:return e.readDoubleBE(0);default:throw new Error(`Invalid float size: ${e.length}`)}},t.hex=function(e){return n.from(e.replace(/^0x/,""),"hex")},t.bin=function(e){let t=0,r=(e=e.replace(/\s/g,"")).length%8||8;const i=[];for(;r<=e.length;)i.push(parseInt(e.slice(t,r),2)),t=r,r+=8;return n.from(i)},t.arrayEqual=function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((e,r)=>e===t[r])},t.bufferToBigInt=function(e){return BigInt(`0x${e.toString("hex")}`)},t.cborValueToString=function(e,r=-1){switch(typeof e){case"symbol":{switch(e){case l.NULL:return"null";case l.UNDEFINED:return"undefined";case l.BREAK:return"BREAK"}if(e.description)return e.description;const t=e.toString().match(/^Symbol\((?.*)\)/);return t&&t.groups.name?t.groups.name:"Symbol"}case"string":return JSON.stringify(e);case"bigint":return e.toString();case"number":{const t=Object.is(e,-0)?"-0":String(e);return r>0?`${t}_${r}`:t}case"object":{if(!e)return"null";const n=t.bufferishToBuffer(e);if(n){const e=n.toString("hex");return r===-1/0?e:`h'${e}'`}return e&&"function"==typeof e[Symbol.for("nodejs.util.inspect.custom")]?e[Symbol.for("nodejs.util.inspect.custom")]():Array.isArray(e)?"[]":"{}"}}return String(e)},t.guessEncoding=function(e,r){if("string"==typeof e)return new i(e,r??"hex");const n=t.bufferishToBuffer(e);if(n)return new i(n);if((s=e)instanceof o.Readable||["read","on","pipe"].every(e=>"function"==typeof s[e]))return e;var s;throw new Error("Unknown input type")};const h={"=":"","+":"-","/":"_"};t.base64url=function(e){return t.bufferishToBuffer(e).toString("base64").replace(/[=+/]/g,e=>h[e])},t.base64=function(e){return t.bufferishToBuffer(e).toString("base64")},t.isBigEndian=function(){const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])}},54957(e,t,r){"use strict";const n=r(88310),i=r(5256);class o extends n.Transform{constructor(e){super(e),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this.bs=new i,this.__restart()}_transform(e,t,r){for(this.bs.write(e);this.bs.length>=this.__needed;){let e=null;const t=null===this.__needed?void 0:this.bs.read(this.__needed);try{e=this.__parser.next(t)}catch(e){return r(e)}this.__needed&&(this.__fresh=!1),e.done?(this.push(e.value),this.__restart()):this.__needed=e.value||1/0}return r()}*_parse(){throw new Error("Must be implemented in subclass")}__restart(){this.__needed=null,this.__parser=this._parse(),this.__fresh=!0}_flush(e){e(this.__fresh?null:new Error("unexpected end of input"))}}e.exports=o},30041(e,t,r){"use strict";var n=r(30655),i=r(58068),o=r(69675),s=r(75795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!s&&s(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===a&&f?f.enumerable:!a,value:r,writable:null===u&&f?f.writable:!u});else{if(!l&&(a||u||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},38452(e,t,r){"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(30041),u=r(30592)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;u?a(e,t,r,!0):a(e,t,r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=d(u,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},60301(e,t,r){"use strict";var n=r(69600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=r),a=e,"[object Array]"===i.call(a)?function(e,t,r){for(var n=0,i=e.length;n1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=z(e,0,1),r=z(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return $(e,H,function(e,t,r,i){n[n.length]=r?$(i,q,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=G("%"+n+"%",t),o=i.name,s=i.value,a=!1,u=i.alias;u&&(n=u[0],M(r,D([0,1],u)));for(var f=1,h=!0;f=r.length){var g=_(s,p);s=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:s[p]}else h=P(s,p),s=s[p];h&&!a&&(R[o]=s)}}return s}},71064(e,t,r){"use strict";var n=r(79612);e.exports=n.getPrototypeOf||null},48648(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},93628(e,t,r){"use strict";var n=r(48648),i=r(71064),o=r(7176);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:o?function(e){return o(e)}:null},6549(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},75795(e,t,r){"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},30592(e,t,r){"use strict";var n=r(30655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},64039(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(41333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},41333(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},49092(e,t,r){"use strict";var n=r(41333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9957(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(66743);e.exports=o.call(n,i)},251(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y}},56698(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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},47244(e,t,r){"use strict";var n=r(49092)(),i=r(36556)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},69600(e){"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var h=document.all;u.call(h)===u.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},48184(e,t,r){"use strict";var n=r(36556),i=r(99721)(/^\s*(?:function)?\*/),o=r(49092)(),s=r(93628),a=n("Object.prototype.toString"),u=n("Function.prototype.toString"),c=r(1687).c;e.exports=function(e){if("function"!=typeof e)return!1;if(i(u(e)))return!0;if(!o)return"[object GeneratorFunction]"===a(e);if(!s)return!1;var t=c();return t&&s(e)===t.prototype}},13003(e){"use strict";e.exports=function(e){return e!=e}},24133(e,t,r){"use strict";var n=r(10487),i=r(38452),o=r(13003),s=r(76642),a=r(92464),u=n(s(),Number);i(u,{getPolyfill:s,implementation:o,shim:a}),e.exports=u},76642(e,t,r){"use strict";var n=r(13003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},92464(e,t,r){"use strict";var n=r(38452),i=r(76642);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},14035(e,t,r){"use strict";var n,i=r(36556),o=r(49092)(),s=r(9957),a=r(75795);if(o){var u=i("RegExp.prototype.exec"),c={},l=function(){throw c},f={toString:l,valueOf:l};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=l),n=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!t||!s(t,"value"))return!1;try{u(e,f)}catch(e){return e===c}}}else{var h=i("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=n},35680(e,t,r){"use strict";var n=r(25767);e.exports=function(e){return!!n(e)}},73065(e,t,r){var n,i;!function(){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},o=null;function s(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var r=this.getLevel(),i=0;i=0&&t<=f.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?h+=":"+e:"symbol"==typeof e&&(h=void 0),f.name=e,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=r||l,f.getLevel=function(){return null!=c?c:null!=a?a:s},f.setLevel=function(e,r){return c=d(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&h){try{return void(window.localStorage[h]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"="+r+";"}catch(e){}}}(c),u.call(f)},f.setDefaultLevel=function(e){a=d(e),p()||f.setLevel(e,!1)},f.resetLevel=function(){c=null,function(){if(typeof window!==t&&h){try{window.localStorage.removeItem(h)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(f)},f.enableAll=function(e){f.setLevel(f.levels.TRACE,e)},f.disableAll=function(e){f.setLevel(f.levels.SILENT,e)},f.rebuild=function(){if(o!==f&&(s=d(o.getLevel())),u.call(f),o===f)for(var e in i)i[e].rebuild()},s=d(o?o.getLevel():"WARN");var y=p();null!=y&&(c=d(y)),u.call(f)}(o=new f).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new f(e,o.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},71514(e){"use strict";e.exports=Math.abs},58968(e){"use strict";e.exports=Math.floor},94459(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},6188(e){"use strict";e.exports=Math.max},68002(e){"use strict";e.exports=Math.min},75880(e){"use strict";e.exports=Math.pow},70414(e){"use strict";e.exports=Math.round},73093(e,t,r){"use strict";var n=r(94459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},5256(e,t,r){"use strict";const n=r(88310),{Buffer:i}=r(48287),o=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});class s extends n.Transform{constructor(e,t,r={}){let n=null,o=null;switch(typeof e){case"object":i.isBuffer(e)?n=e:e&&(r=e);break;case"string":n=e;break;case"undefined":break;default:throw new TypeError("Invalid input")}switch(typeof t){case"object":t&&(r=t);break;case"string":o=t;break;case"undefined":break;default:throw new TypeError("Invalid inputEncoding")}if(!r||"object"!=typeof r)throw new TypeError("Invalid options");null==n&&(n=r.input),null==o&&(o=r.inputEncoding),delete r.input,delete r.inputEncoding;const s=null==r.watchPipe||r.watchPipe;delete r.watchPipe;const a=Boolean(r.readError);delete r.readError,super(r),this.readError=a,s&&this.on("pipe",e=>{const t=e._readableState.objectMode;if(this.length>0&&t!==this._readableState.objectMode)throw new Error("Do not switch objectMode in the middle of the stream");this._readableState.objectMode=t,this._writableState.objectMode=t}),null!=n&&this.end(n,o)}static isNoFilter(e){return e instanceof this}static compare(e,t){if(!(e instanceof this))throw new TypeError("Arguments must be NoFilters");return e===t?0:e.compare(t)}static concat(e,t){if(!Array.isArray(e))throw new TypeError("list argument must be an Array of NoFilters");if(0===e.length||0===t)return i.alloc(0);null==t&&(t=e.reduce((e,t)=>{if(!(t instanceof s))throw new TypeError("list argument must be an Array of NoFilters");return e+t.length},0));let r=!0,n=!0;const o=e.map(e=>{if(!(e instanceof s))throw new TypeError("list argument must be an Array of NoFilters");const t=e.slice();return i.isBuffer(t)?n=!1:r=!1,t});if(r)return i.concat(o,t);if(n)return[].concat(...o).slice(0,t);throw new Error("Concatenating mixed object and byte streams not supported")}_transform(e,t,r){this._readableState.objectMode||i.isBuffer(e)||(e=i.from(e,t)),this.push(e),r()}_bufArray(){let e=this._readableState.buffer;if(!Array.isArray(e)){let t=e.head;for(e=[];null!=t;)e.push(t.data),t=t.next}return e}read(e){const t=super.read(e);if(null!=t){if(this.emit("read",t),this.readError&&t.length{this.length>=e?i(this.read(e)):this.writableFinished?o(new Error(`Stream finished before ${e} bytes were available`)):(t=t=>{this.length>=e&&i(this.read(e))},r=()=>{o(new Error(`Stream finished before ${e} bytes were available`))},n=o,this.on("readable",t),this.on("error",n),this.on("finish",r))}).finally(()=>{t&&(this.removeListener("readable",t),this.removeListener("error",n),this.removeListener("finish",r))})}promise(e){let t=!1;return new Promise((r,n)=>{this.on("finish",()=>{const n=this.read();null==e||t||(t=!0,e(null,n)),r(n)}),this.on("error",r=>{null==e||t||(t=!0,e(r)),n(r)})})}compare(e){if(!(e instanceof s))throw new TypeError("Arguments must be NoFilters");if(this===e)return 0;const t=this.slice(),r=e.slice();if(i.isBuffer(t)&&i.isBuffer(r))return t.compare(r);throw new Error("Cannot compare streams in object mode")}equals(e){return 0===this.compare(e)}slice(e,t){if(this._readableState.objectMode)return this._bufArray().slice(e,t);const r=this._bufArray();switch(r.length){case 0:return i.alloc(0);case 1:return r[0].slice(e,t);default:return i.concat(r).slice(e,t)}}get(e){return this.slice()[e]}toJSON(){const e=this.slice();return i.isBuffer(e)?e.toJSON():e}toString(e,t,r){const n=this.slice(t,r);return i.isBuffer(n)?e&&"utf8"!==e?n.toString(e):o.decode(n):JSON.stringify(n)}[Symbol.for("nodejs.util.inspect.custom")](e,t){const r=this._bufArray().map(e=>i.isBuffer(e)?t.stylize(e.toString("hex"),"string"):JSON.stringify(e)).join(", ");return`${this.constructor.name} [${r}]`}get length(){return this._readableState.length}writeBigInt(e){let t=e.toString(16);if(e<0){const r=BigInt(Math.floor(t.length/2));t=(e=(BigInt(1)<0&&!i.call(e,0))for(var y=0;y0)for(var g=0;g=0&&"[object Function]"===t.call(e.callee)),n}},38403(e,t,r){"use strict";var n=r(1189),i=r(41333)(),o=r(36556),s=r(79612),a=o("Array.prototype.push"),u=o("Object.prototype.propertyIsEnumerable"),c=i?s.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=s(e);if(1===arguments.length)return r;for(var o=1;o>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16}},19681(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},14823(e){"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var o=t,s=i+n;e^=-1;for(var a=i;a>>8^o[255&(e^r[a])];return-1^e}},58411(e,t,r){"use strict";var n,i=r(9805),o=r(23665),s=r(53269),a=r(14823),u=r(54674),c=-2,l=258,f=262,h=103,p=113,d=666;function y(e,t){return e.msg=u[t],t}function g(e){return(e<<1)-(e>4?9:0)}function m(e){for(var t=e.length;--t>=0;)e[t]=0}function b(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function v(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,b(e.strm)}function w(e,t){e.pending_buf[e.pending++]=t}function _(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function E(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),0===o?0:(e.avail_in-=o,i.arraySet(t,e.input,e.next_in,o,r),1===e.state.wrap?e.adler=s(e.adler,t,o,r):2===e.state.wrap&&(e.adler=a(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function x(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,c=e.window,h=e.w_mask,p=e.prev,d=e.strstart+l,y=c[o+s-1],g=c[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(r=t)+s]===g&&c[r+s-1]===y&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&os){if(e.match_start=t,s=n,n>=a)break;y=c[o+s-1],g=c[o+s]}}}while((t=p[t&h])>u&&0!==--i);return s<=e.lookahead?s:e.lookahead}function S(e){var t,r,n,o,s,a=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-f)){i.arraySet(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=a?n-a:0}while(--r);t=r=a;do{n=e.prev[--t],e.prev[t]=n>=a?n-a:0}while(--r);o+=a}if(0===e.strm.avail_in)break;if(r=E(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=r,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(a=2,n-=16),o<1||o>9||8!==r||n<8||n>15||t<0||t>9||s<0||s>4)return y(e,c);8===n&&(n=9);var u=new O;return e.state=u,u.strm=e,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(S(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,v(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(v(e,!1),e.strm.avail_out),1)}),new T(4,4,8,4,A),new T(4,5,16,8,A),new T(4,6,32,32,A),new T(4,4,16,16,B),new T(8,16,32,32,B),new T(8,16,128,128,B),new T(8,32,128,256,B),new T(32,128,258,1024,B),new T(32,258,258,4096,B)],t.deflateInit=function(e,t){return N(e,t,8,15,8,0)},t.deflateInit2=N,t.deflateReset=I,t.deflateResetKeep=k,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var r,i,s,u;if(!e||!e.state||t>5||t<0)return e?y(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===d&&4!==t)return y(e,0===e.avail_out?-5:c);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,w(i,31),w(i,139),w(i,8),i.gzhead?(w(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),w(i,255&i.gzhead.time),w(i,i.gzhead.time>>8&255),w(i,i.gzhead.time>>16&255),w(i,i.gzhead.time>>24&255),w(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),w(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(w(i,255&i.gzhead.extra.length),w(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(w(i,0),w(i,0),w(i,0),w(i,0),w(i,0),w(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),w(i,3),i.status=p);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=p,_(i,f),0!==i.strstart&&(_(i,e.adler>>>16),_(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),b(e),s=i.pending,i.pending!==i.pending_buf_size));)w(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),b(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),b(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&b(e),i.pending+2<=i.pending_buf_size&&(w(i,255&e.adler),w(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(b(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&g(t)<=g(r)&&4!==t)return y(e,-5);if(i.status===d&&0!==e.avail_in)return y(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==d){var E=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(S(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=l){if(S(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+l;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==E&&4!==E||(i.status=d),1===E||3===E)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===E&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),b(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(w(i,255&e.adler),w(i,e.adler>>8&255),w(i,e.adler>>16&255),w(i,e.adler>>24&255),w(i,255&e.total_in),w(i,e.total_in>>8&255),w(i,e.total_in>>16&255),w(i,e.total_in>>24&255)):(_(i,e.adler>>>16),_(i,65535&e.adler)),b(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==d?y(e,c):(e.state=null,t===p?y(e,-3):0):c},t.deflateSetDictionary=function(e,t){var r,n,o,a,u,l,f,h,p=t.length;if(!e||!e.state)return c;if(2===(a=(r=e.state).wrap)||1===a&&42!==r.status||r.lookahead)return c;for(1===a&&(e.adler=s(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===a&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=p,e.next_in=0,e.input=t,S(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<>>=w=v>>>24,d-=w,0==(w=v>>>16&255))B[o++]=65535&v;else{if(!(16&w)){if(64&w){if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}v=y[(65535&v)+(p&(1<>>=w,d-=w),d<15&&(p+=A[n++]<>>=w=v>>>24,d-=w,16&(w=v>>>16&255)){if(E=65535&v,d<(w&=15)&&(p+=A[n++]<u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=w,d-=w,E>(w=o-s)){if((w=E-w)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,S=h,0===f){if(x+=c-w,w<_){_-=w;do{B[o++]=h[x++]}while(--w);x=o-E,S=B}}else if(f2;)B[o++]=S[x++],B[o++]=S[x++],B[o++]=S[x++],_-=3;_&&(B[o++]=S[x++],_>1&&(B[o++]=S[x++]))}else{x=o-E;do{B[o++]=B[x++],B[o++]=B[x++],B[o++]=B[x++],_-=3}while(_>2);_&&(B[o++]=B[x++],_>1&&(B[o++]=B[x++]))}break}if(64&w){e.msg="invalid distance code",r.mode=30;break e}v=g[(65535&v)+(p&(1<>3,p&=(1<<(d-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):u}function y(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):u}function g(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=y(e,t))&&(e.state=null),r):u}var m,b,v=!0;function w(e){if(v){var t;for(m=new n.Buf32(512),b=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,b,0,e.work,{bits:5}),v=!1}e.lencode=m,e.lenbits=9,e.distcode=b,e.distbits=5}function _(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=o(r.check,P,2,0),b=0,v=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg="incorrect header check",r.mode=l;break}if(8!=(15&b)){e.msg="unknown compression method",r.mode=l;break}if(v-=4,R=8+(15&(b>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){e.msg="invalid window size",r.mode=l;break}r.dmax=1<>8&1),512&r.flags&&(P[0]=255&b,P[1]=b>>>8&255,r.check=o(r.check,P,2,0)),b=0,v=0,r.mode=3;case 3:for(;v<32;){if(0===g)break e;g--,b+=h[d++]<>>8&255,P[2]=b>>>16&255,P[3]=b>>>24&255,r.check=o(r.check,P,4,0)),b=0,v=0,r.mode=4;case 4:for(;v<16;){if(0===g)break e;g--,b+=h[d++]<>8),512&r.flags&&(P[0]=255&b,P[1]=b>>>8&255,r.check=o(r.check,P,2,0)),b=0,v=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===g)break e;g--,b+=h[d++]<>>8&255,r.check=o(r.check,P,2,0)),b=0,v=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((S=r.length)>g&&(S=g),S&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,d,S,R)),512&r.flags&&(r.check=o(r.check,h,S,d)),g-=S,d+=S,r.length-=S),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break e;S=0;do{R=h[d+S++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&S>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=c;break;case 10:for(;v<32;){if(0===g)break e;g--,b+=h[d++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===g)break e;g--,b+=h[d++]<>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===t){b>>>=2,v-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=l}b>>>=2,v-=2;break;case 14:for(b>>>=7&v,v-=7&v;v<32;){if(0===g)break e;g--,b+=h[d++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=l;break}if(r.length=65535&b,b=0,v=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(S=r.length){if(S>g&&(S=g),S>m&&(S=m),0===S)break e;n.arraySet(p,h,d,S,y),g-=S,d+=S,m-=S,y+=S,r.length-=S;break}r.mode=c;break;case 17:for(;v<14;){if(0===g)break e;g--,b+=h[d++]<>>=5,v-=5,r.ndist=1+(31&b),b>>>=5,v-=5,r.ncode=4+(15&b),b>>>=4,v-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=l;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,v-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},L=a(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,L){e.msg="invalid code lengths set",r.mode=l;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,k=65535&C,!((T=C>>>24)<=v);){if(0===g)break e;g--,b+=h[d++]<>>=T,v-=T,r.lens[r.have++]=k;else{if(16===k){for(U=T+2;v>>=T,v-=T,0===r.have){e.msg="invalid bit length repeat",r.mode=l;break}R=r.lens[r.have-1],S=3+(3&b),b>>>=2,v-=2}else if(17===k){for(U=T+3;v>>=T)),b>>>=3,v-=3}else{for(U=T+7;v>>=T)),b>>>=7,v-=7}if(r.have+S>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=l;break}for(;S--;)r.lens[r.have++]=R}}if(r.mode===l)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=l;break}if(r.lenbits=9,j={bits:r.lenbits},L=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,L){e.msg="invalid literal/lengths set",r.mode=l;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},L=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,L){e.msg="invalid distances set",r.mode=l;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(g>=6&&m>=258){e.next_out=y,e.avail_out=m,e.next_in=d,e.avail_in=g,r.hold=b,r.bits=v,s(e,x),y=e.next_out,p=e.output,m=e.avail_out,d=e.next_in,h=e.input,g=e.avail_in,b=r.hold,v=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;O=(C=r.lencode[b&(1<>>16&255,k=65535&C,!((T=C>>>24)<=v);){if(0===g)break e;g--,b+=h[d++]<>I)])>>>16&255,k=65535&C,!(I+(T=C>>>24)<=v);){if(0===g)break e;g--,b+=h[d++]<>>=I,v-=I,r.back+=I}if(b>>>=T,v-=T,r.back+=T,r.length=k,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=c;break}if(64&O){e.msg="invalid literal/length code",r.mode=l;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(U=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;O=(C=r.distcode[b&(1<>>16&255,k=65535&C,!((T=C>>>24)<=v);){if(0===g)break e;g--,b+=h[d++]<>I)])>>>16&255,k=65535&C,!(I+(T=C>>>24)<=v);){if(0===g)break e;g--,b+=h[d++]<>>=I,v-=I,r.back+=I}if(b>>>=T,v-=T,r.back+=T,64&O){e.msg="invalid distance code",r.mode=l;break}r.offset=k,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(U=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=l;break}r.mode=25;case 25:if(0===m)break e;if(S=x-m,r.offset>S){if((S=r.offset-S)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=l;break}S>r.wnext?(S-=r.wnext,A=r.wsize-S):A=r.wnext-S,S>r.length&&(S=r.length),B=r.window}else B=p,A=y-r.offset,S=r.length;S>m&&(S=m),m-=S,r.length-=S;do{p[y++]=B[A++]}while(--S);0===r.length&&(r.mode=21);break;case 26:if(0===m)break e;p[y++]=r.length,m--,r.mode=21;break;case 27:if(r.wrap){for(;v<32;){if(0===g)break e;g--,b|=h[d++]<=1&&0===j[B];B--);if(T>B&&(T=B),0===B)return c[l++]=20971520,c[l++]=20971520,h.bits=1,0;for(A=1;A0&&(0===e||1!==B))return-1;for(U[1]=0,x=1;x<15;x++)U[x+1]=U[x]+j[x];for(S=0;S852||2===e&&N>592)return 1;for(;;){v=x-k,f[S]b?(w=C[P+f[S]],_=R[L+f[S]]):(w=96,_=0),p=1<>k)+(d-=p)]=v<<24|w<<16|_}while(0!==d);for(p=1<>=1;if(0!==p?(F&=p-1,F+=p):F=0,S++,0===--j[x]){if(x===B)break;x=t[r+f[S]]}if(x>T&&(F&g)!==y){for(0===k&&(k=T),m+=A,I=1<<(O=x-k);O+k852||2===e&&N>592)return 1;c[y=F&g]=T<<24|O<<16|m-l}}return 0!==F&&(c[m+F]=x-k<<24|64<<16),h.bits=T,0}},54674(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},23665(e,t,r){"use strict";var n=r(9805);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],s=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);i(c);var l=new Array(60);i(l);var f=new Array(512);i(f);var h=new Array(256);i(h);var p=new Array(29);i(p);var d,y,g,m=new Array(30);function b(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function w(e){return e<256?f[e]:f[256+(e>>>7)]}function _(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function E(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function A(e,t,r){var n,i,o=new Array(16),s=0;for(n=1;n<=15;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=S(o[a]++,a))}}function B(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function T(e){e.bi_valid>8?_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function O(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)k(e,o,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],k(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,k(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,s,a,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,d=t.stat_desc.max_length,y=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=u[2*u[2*(n=e.heap[r])+1]+1]+1)>d&&(o=d,y++),u[2*n+1]=o,n>c||(e.bl_count[o]++,s=0,n>=p&&(s=h[n-p]),a=u[2*n],e.opt_len+=a*(o+s),f&&(e.static_len+=a*(l[2*n+1]+s)));if(0!==y){do{for(o=d-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[d]--,y-=2}while(y>0);for(o=d;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>c||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(e,t),A(o,c,e.bl_count)}function F(e,t,r){var n,i,o=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a>=7;n<30;n++)for(m[n]=i<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),N(e,e.l_desc),N(e,e.d_desc),s=function(e){var t;for(F(e,e.dyn_ltree,e.l_desc.max_code),F(e,e.dyn_dtree,e.d_desc.max_code),N(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*u[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?j(e,t,r,n):4===e.strategy||o===i?(E(e,2+(n?1:0),3),I(e,c,l)):(E(e,4+(n?1:0),3),function(e,t,r,n){var i;for(E(e,t-257,5),E(e,r-1,5),E(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(h[r]+256+1)]++,e.dyn_dtree[2*w(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){E(e,2,3),x(e,256,c),function(e){16===e.bi_valid?(_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442(e){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},7599(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},73016(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},66920(e,t,r){var n=r(65606),i=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function c(e,t){return e}function l(e,r,n){if(e.customInspect&&r&&x(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return m(i)||(i=l(e,i,n)),i}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(r);if(0===s.length){if(x(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return f(r)}var c,w="",S=!1,A=["{","}"];return p(r)&&(S=!0,A=["[","]"]),x(r)&&(w=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),E(r)&&(w=" "+f(r)),0!==s.length||S&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=S?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,w,A)):A[0]+w+A[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),T(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=y(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),b(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function b(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===S(e)}function E(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function x(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(b(o)&&(o=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=v,t.isObject=w,t.isDate=_,t.isError=E,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(73016);var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[A((e=new Date).getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),B[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(7599),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}},43627(e,t,r){"use strict";var n=r(65606),i="win32"===n.platform,o=r(66920);function s(e,t){for(var r=[],n=0;n=0&&!e[n];n--);return 0===r&&n===t?e:r>n?[]:e.slice(r,n+1)}var u=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,c=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,l={};function f(e){var t=u.exec(e),r=(t[1]||"")+(t[2]||""),n=t[3]||"",i=c.exec(n);return[r,i[1],i[2],i[3]]}function h(e){var t=u.exec(e),r=t[1]||"",n=!!r&&":"!==r[1];return{device:r,isUnc:n,isAbsolute:n||!!t[2],tail:t[3]}}function p(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}l.resolve=function(){for(var e="",t="",r=!1,i=arguments.length-1;i>=-1;i--){var a;if(i>=0?a=arguments[i]:e?(a=n.env["="+e])&&a.substr(0,3).toLowerCase()===e.toLowerCase()+"\\"||(a=e+"\\"):a=n.cwd(),!o.isString(a))throw new TypeError("Arguments to path.resolve must be strings");if(a){var u=h(a),c=u.device,l=u.isUnc,f=u.isAbsolute,d=u.tail;if((!c||!e||c.toLowerCase()===e.toLowerCase())&&(e||(e=c),r||(t=d+"\\"+t,r=f),e&&r))break}}return l&&(e=p(e)),e+(r?"\\":"")+(t=s(t.split(/[\\\/]+/),!r).join("\\"))||"."},l.normalize=function(e){var t=h(e),r=t.device,n=t.isUnc,i=t.isAbsolute,o=t.tail,a=/[\\\/]$/.test(o);return(o=s(o.split(/[\\\/]+/),!i).join("\\"))||i||(o="."),o&&a&&(o+="\\"),n&&(r=p(r)),r+(i?"\\":"")+o},l.isAbsolute=function(e){return h(e).isAbsolute},l.join=function(){for(var e=[],t=0;t=-1&&!t;r--){var i=r>=0?arguments[r]:n.cwd();if(!o.isString(i))throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i[0])}return(t?"/":"")+(e=s(e.split("/"),!t).join("/"))||"."},y.normalize=function(e){var t=y.isAbsolute(e),r=e&&"/"===e[e.length-1];return(e=s(e.split("/"),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},y.isAbsolute=function(e){return"/"===e.charAt(0)},y.join=function(){for(var e="",t=0;t1)for(var r=1;r4294967295||u(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&s){var l=s(e,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(c=!1)}return(n||c||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},88310(e,t,r){e.exports=i;var n=r(37007).EventEmitter;function i(){n.call(this)}r(56698)(i,n),i.Readable=r(46891),i.Writable=r(81999),i.Duplex=r(88101),i.Transform=r(59083),i.PassThrough=r(3681),i.finished=r(14257),i.pipeline=r(5267),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",c),e.on("error",c),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},12463(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},88101(e,t,r){"use strict";var n=r(65606),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(46891),s=r(81999);r(56698)(l,o);for(var a=i(s.prototype),u=0;u0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?E(e,new _):T(e,a,t,!0);else if(a.ended)E(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?T(e,a,t,!1):F(e,a)):T(e,a,t,!1)}else n||(a.reading=!1,F(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(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 I(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(N,e))}function N(e){var t=e._readableState;o("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,C(e)}function F(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function j(e){o("readable nexttick read 0"),e.read(0)}function U(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function D(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function $(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):I(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&D(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e0?P(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),r!==e&&t.ended&&D(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){E(this,new w("_read()"))},A.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?y:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",c);var l=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==$(n.pipes,e))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),y(),e.removeListener("error",h),0===s(e,"error")&&E(e,t)}function p(){e.removeListener("finish",d),y()}function d(){o("onfinish"),e.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?I(this):n.reading||i.nextTick(j,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(L,this),r},A.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(L,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(U,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!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-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,N(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(e,t){t(e)}},65034(e,t,r){"use strict";var n,i=r(65606);function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(14257),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[f]=null,e[a]=null,e[u]=null,t(d(r,!1)))}}function g(e){i.nextTick(y,e)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[c]?r(e[c]):t(d(void 0,!0))})});var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[l]?r(d(void 0,!0)):t[h](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),n),m);e.exports=function(e){var t,r=Object.create(b,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[p].read();n?(r[f]=null,r[a]=null,r[u]=null,e(d(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[f]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[l]=!0}),e.on("readable",g.bind(null,r)),r}},81766(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?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,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},54347(e,t,r){"use strict";var n=r(65606);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)}),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 r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},14257(e,t,r){"use strict";var n=r(12463).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0,function(e){l||(l=e),e&&h.forEach(u),o||(h.forEach(u),f(l))})});return t.reduce(c)}},66644(e,t,r){"use strict";var n=r(12463).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},41396(e,t,r){e.exports=r(37007).EventEmitter},83141(e,t,r){"use strict";var n=r(15003).Buffer,i=n.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 o(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&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(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,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r: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 u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=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=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.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}},15003(e,t,r){var n=r(48287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},90031(e,t){!function(e){var t,r,n,i=String.fromCharCode;function o(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function a(e,t){return i(e>>t&63|128)}function u(e){if(!(4294967168&e))return i(e);var t="";return 4294965248&e?4294901760&e?4292870144&e||(t=i(e>>18&7|240),t+=a(e,12),t+=a(e,6)):(s(e),t=i(e>>12&15|224),t+=a(e,6)):t=i(e>>6&31|192),t+i(63&e|128)}function c(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,!(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|c())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|c()<<6|c())>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|c()<<12|c()<<6|c())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,n=-1,i="";++n65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t);return o}(a)}}(t)},94643(e,t,r){function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},81135(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},49032(e,t,r){"use strict";var n=r(47244),i=r(48184),o=r(25767),s=r(35680);function a(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===l(e)}function b(e){return"[object Set]"===l(e)}function v(e){return"[object WeakMap]"===l(e)}function w(e){return"[object WeakSet]"===l(e)}function _(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function x(e){return"[object DataView]"===l(e)}function S(e){return"undefined"!=typeof DataView&&(x.working?x(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||S(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),t.isArrayBuffer=E,x.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&x(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=S;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function B(e){return"[object SharedArrayBuffer]"===l(e)}function T(e){return void 0!==A&&(void 0===B.working&&(B.working=B(new A)),B.working?B(e):e instanceof A)}function O(e){return g(e,f)}function k(e){return g(e,h)}function I(e){return g(e,p)}function N(e){return u&&g(e,d)}function F(e){return c&&g(e,y)}t.isSharedArrayBuffer=T,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=O,t.isStringObject=k,t.isBooleanObject=I,t.isBigIntObject=N,t.isSymbolObject=F,t.isBoxedPrimitive=function(e){return O(e)||k(e)||I(e)||N(e)||F(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||T(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},40537(e,t,r){var n=r(65606),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,e,n.depth)}function l(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function f(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=h(e,i,n)),i}var o=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return p(r)}var c,l="",f=!1,E=["{","}"];return y(r)&&(f=!0,E=["[","]"]),A(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(l=" "+RegExp.prototype.toString.call(r)),x(r)&&(l=" "+Date.prototype.toUTCString.call(r)),S(r)&&(l=" "+p(r)),0!==s.length||f&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=f?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,E)):E[0]+l+E[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(r)?h(e,u.value,null):h(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function w(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===B(e)}function E(e){return"object"==typeof e&&null!==e}function x(e){return E(e)&&"[object Date]"===B(e)}function S(e){return E(e)&&("[object Error]"===B(e)||e instanceof Error)}function A(e){return"function"==typeof e}function B(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(49032),t.isArray=y,t.isBoolean=g,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=_,t.types.isRegExp=_,t.isObject=E,t.isDate=x,t.types.isDate=x,t.isError=S,t.types.isNativeError=S,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(81135);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[T((e=new Date).getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":"),[e.getDate(),O[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(56698),t._extend=function(e,t){if(!t||!E(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function N(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(I&&e[I]){var t;if("function"!=typeof(t=e[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o-1?t:"Object"===t&&function(e){var t=!1;return n(y,function(r,n){if(!t)try{r(e),t=p(n,1)}catch(e){}}),t}(e)}return a?function(e){var t=!1;return n(y,function(r,n){if(!t)try{"$"+r(e)===n&&(t=p(n,1))}catch(e){}}),t}(e):null}},63779(){},77199(){},25172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},16993(e,t,r){var n=r(75546);function i(){var t,r,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function u(e,i,o,s){var a=i&&i.prototype instanceof l?i:l,u=Object.create(a.prototype);return n(u,"_invoke",function(e,n,i){var o,s,a,u=0,l=i||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return o=e,s=0,a=t,h.n=r,c}};function p(e,n){for(s=e,a=n,r=0;!f&&u&&!i&&r3?(i=d===n)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=e<2&&pn||n>d)&&(o[4]=e,o[5]=n,h.n=d,s=0))}if(i||e>1)return c;throw f=!0,n}return function(i,l,d){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,d),s=l,a=d;(r=s<2?t:a)||!f;){o||(s?s<3?(s>1&&(h.n=-1),p(s,a)):h.n=a:h.v=a);try{if(u=2,o){if(s||(i="next"),r=o[i]){if(!(r=r.call(o,a)))throw TypeError("iterator result is not an object");if(!r.done)return r;a=r.value,s<2&&(s=0)}else 1===s&&(r=o.return)&&r.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((r=(f=h.n<0)?a:e.call(n,h))!==c)break}catch(e){o=t,s=1,a=e}finally{u=1}}return{value:r,done:f}}}(e,o,s),!0),u}var c={};function l(){}function f(){}function h(){}r=Object.getPrototypeOf;var p=[][s]?r(r([][s]())):(n(r={},s,function(){return this}),r),d=h.prototype=l.prototype=Object.create(p);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,n(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return f.prototype=h,n(d,"constructor",h),n(h,"constructor",f),f.displayName="GeneratorFunction",n(h,a,"GeneratorFunction"),n(d),n(d,a,"Generator"),n(d,s,function(){return this}),n(d,"toString",function(){return"[object Generator]"}),(e.exports=i=function(){return{w:u,m:y}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},55869(e,t,r){var n=r(887);e.exports=function(e,t,r,i,o){var s=n(e,t,r,i,o);return s.next().then(function(e){return e.done?e.value:s.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,r){var n=r(16993),i=r(11791);e.exports=function(e,t,r,o,s){return new i(n().w(e,t,r,o),s||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},11791(e,t,r){var n=r(25172),i=r(75546);e.exports=function e(t,r){function o(e,i,s,a){try{var u=t[e](i),c=u.value;return c instanceof n?r.resolve(c.v).then(function(e){o("next",e,s,a)},function(e){o("throw",e,s,a)}):r.resolve(c).then(function(e){u.value=e,s(u)},function(e){return o("throw",e,s,a)})}catch(e){a(e)}}var s;this.next||(i(e.prototype),i(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(e,t,n){function i(){return new r(function(t,r){o(e,n,t,r)})}return s=s?s.then(i,i):i()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},75546(e){function t(r,n,i,o){var s=Object.defineProperty;try{s({},"",{})}catch(r){s=0}e.exports=t=function(e,r,n,i){function o(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?s?s(e,r,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,r){var n=r(25172),i=r(16993),o=r(55869),s=r(887),a=r(11791),u=r(4373),c=r(30579);function l(){"use strict";var t=i(),r=t.m(l),f=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function d(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,p[e],t)},delegateYield:function(e,i,o){return t.resultName=i,r(n.d,c(e),o)},finish:function(e){return r(n.f,e)}},r=function(e,r,i){n.p=t.prev,n.n=t.next;try{return e(r,i)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,r,n,i){return t.w(d(e),r,n,i&&i.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:a,async:function(e,t,r,n,i){return(h(t)?s:o)(d(e),t,r,n,i)},keys:u,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},30579(e,t,r){var n=r(73738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},73738(e){function t(r){return e.exports=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.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756(e,t,r){var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},39209(e,t,r){"use strict";var n=r(76578),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;tn});var n=r.cjs(function(e,t){const r=function*(){}.constructor;e.exports=()=>r})}};const t={};function r(n){const i=t[n];if(void 0!==i)return i.exports;const o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;nObject.prototype.hasOwnProperty.call(e,t),r.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports},(()=>{"use strict";function e(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(i,o){var s=t.apply(r,n);function a(t){e(s,i,o,a,u,"next",t)}function u(t){e(s,i,o,a,u,"throw",t)}a(void 0)})}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return i="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},i(e)}function o(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function s(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if("string"==typeof e&&(e=U.strToArrayBuffer(e)),e instanceof ArrayBuffer&&(e=new Uint8Array(e)),64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new S(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,n,i,o,s,a,u,c="",l=0;l>2,s=(3&r)<<4|(n=e[l++])>>4,a=(15&n)<<2|(i=e[l++])>>6,u=63&i,isNaN(n)?a=u=64:isNaN(i)&&(u=64),c+=t.charAt(o)+t.charAt(s)+t.charAt(a)+t.charAt(u);return c}function B(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new S(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${t.length}: ${t}`);if(n){var o=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(o,"")}if(i){if(e.length%4==1)throw new S(`Error: Invalid Base64 input length (${e.length}). Cannot be 4n+1, even without padding chars.`);if(65===t.length){var s=t.charAt(64),a=e.indexOf(s);if(a>=0){if(a>2,l=(3&p)<<6|d,(u=f<<2|h>>4)>=0&&u<256&&y.push(u),c>=0&&c<256&&64!==p&&y.push(c),l>=0&&l<256&&64!==d&&y.push(l)}return"string"===r?U.byteArrayToUtf8(y):y}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(r<1||Math.round(r)!==r)throw new S("Byte length must be a positive integer");if("None"!==t){var n="Auto"===t?/[^a-f\d]|0x/gi:U.regexRep(t);e=e.split(n)}else e=[e];for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:"Auto",r="Auto"===t?/[^\d-]+/:U.regexRep(t),n=e.split(r);n=n.filter(function(e){return""!==e});for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(r<1||Math.round(r)!==r)throw new S("Byte length must be a positive integer");var n=U.regexRep(t);e=e.replace(n,"");for(var i=[],o=0;o65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),g(e).forEach(function(e,t){n[t]=e}),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(t="string"==typeof t?e.ord(t):t).toString(16).padStart(r,"0")}},{key:"bin",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(t="string"==typeof t?e.ord(t):t).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.replace(/[^\x20-\x7e]/g,"."):(e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),t||(e=e.replace(/[\x09-\x10\u2028\u2029]/g,".")),e)}},{key:"escapeWhitespace",value:function(e){return e.replace(/[\x09-\x10]/g,function(e){return String.fromCharCode(57344+e.charCodeAt(0))})}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([abfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"a":return String.fromCharCode(7);case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}})}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(t){for(var r=[],n=0;n=0;i--)r=256*r+e[i];return r}},{key:"intToByteArray",value:function(e,t,r){var n=new Array(t);if("little"===r)for(var i=0;i>>=8;else for(var o=t-1;o>=0;o--)n[o]=255&e,e>>>=8;return n}},{key:"strToArrayBuffer",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to array buffer`),!t)return new ArrayBuffer;for(var r,n=new Uint8Array(t.length),i=t.length;i--;)if(r=t.charCodeAt(i),n[i]=r,r>255)return e.strToUtf8ArrayBuffer(t);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){if(b().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 array buffer`),!e)return new ArrayBuffer;var t=new TextEncoder("utf-8").encode(e);return e.length!==t.length&&(j()&&self&&"function"==typeof self.setOption?self.setOption("attemptHighlight",!1):L()&&(window.app.options.attemptHighlight=!1)),t.buffer}},{key:"strToByteArray",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to byte array`),!t)return[];for(var r,n=new Array(t.length),i=t.length;i--;)if(r=t.charCodeAt(i),n[i]=r,r>255)return e.strToUtf8ByteArray(t);return n}},{key:"strToUtf8ByteArray",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to UTF8 byte array`),!t)return[];var r=w().encode(t);return t.length!==r.length&&(j()?self.setOption("attemptHighlight",!1):L()&&(window.app.options.attemptHighlight=!1)),e.strToByteArray(r)}},{key:"strToCharcode",value:function(t){if(b().debug(`Converting string[${null==t?void 0:t.length}] to charcode`),!t)return[];for(var r=[],n=0;n=55296&&i<56320){var o=t[n+1].charCodeAt(0);o>=56320&&o<57344&&(i=e.ord(t[n]+t[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(t){var r;if(b().debug(`Converting byte array[${null===(r=t)||void 0===r?void 0:r.length}] to UTF8`),!t||!t.length)return"";t instanceof Uint8Array||(t=new Uint8Array(t));try{var n=new TextDecoder("utf-8",{fatal:!0}).decode(t);return n.length!==t.length&&(j()?self.setOption("attemptHighlight",!1):L()&&(window.app.options.attemptHighlight=!1)),n}catch(r){return e.byteArrayToChars(t)}}},{key:"byteArrayToChars",value:function(e){if(b().debug(`Converting byte array[${null==e?void 0:e.length}] to chars`),!e||!e.length)return"";for(var t="",r=0;r1&&void 0!==arguments[1])||arguments[1];if(b().debug(`Converting array buffer[${null==t?void 0:t.byteLength}] to str`),!t||!t.byteLength)return"";var n=new Uint8Array(t);return r?e.byteArrayToUtf8(n):e.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t0&&r.push(n[t]/e.length);var i,o=0;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],o=!1,s=!1,a="",u=[],c=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var l=0;l=0?(u.push(a),a=""):!s&&i.indexOf(t)>=0?(u.push(a),a="",c.push(u),u=[],i.indexOf(r)>=0&&r!==t&&l++):a+=t:s=!0;return u.length&&(u.push(a),c.push(u)),c}},{key:"stripHtmlTags",value:function(e){function t(e,r){var n=r.replace(e,"");return n.length===r.length?n:t(e,n)}return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=t(/]*>(\s|\S)*?<\/script[^>]*>/gi,e),e=t(/]*>(\s|\S)*?<\/style[^>]*>/gi,e)),t(/<[^>]+>/g,e)}},{key:"escapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\0":""};return e?e.replace(/[&<>"'`\u0000]/g,function(e){return t[e]}):e}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`","":"\0"};return e.replace(/(&#?x?[a-z0-9]{2,4};|\ue000)/gi,function(e){return t[e]||e})}},{key:"toTitleCase",value:function(e){return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,function(e){return t[e]||e})}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",o="",s="";return e.forEach(function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),o=e.disabled?"/disabled":"",s=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${o}${s})`,t&&(r+="\n")}),r}},{key:"parseRecipeConfig",value:function(t){if(0===(t=t.trim()).length)return[];if("["===t[0])return JSON.parse(t);var r,n;t=t.replace(/\n/g,""),e._validatePrettyRecipe(t);for(var i=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,o=[];r=i.exec(t);){n="["+(n=r[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var s={op:r[1].replace(/_/g," "),args:JSON.parse(n)};r[3]&&r[3].indexOf("disabled")>0&&(s.disabled=!0),r[3]&&r[3].indexOf("breakpoint")>0&&(s.breakpoint=!0),o.push(s)}return o}},{key:"_validatePrettyRecipe",value:function(e){for(var t=0;t\n
\n
\n ${e.escapeHtml(t.name)}\n
\n
\n `},o=function(t,r){if(r.startsWith("image")){var n="data:";return n+=r+";",""}return`
${e.escapeHtml(e.arrayBufferToStr(t.buffer))}
`},s=function(){var r=t(p().mark(function t(r,n){var i,s,a,u;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.readFile(r);case 1:return i=t.sent,s=new Blob([i],{type:r.type||"octet/stream"}),a=URL.createObjectURL(s),u=`
\n
\n
\n \n \n ${r.size.toLocaleString()} bytes\n \n save\n \n \n open_in_browser\n \n \n
\n
\n
\n
\n ${o(i,r.type)}\n
\n
\n
`,t.abrupt("return",u);case 2:case"end":return t.stop()}},t)}));return function(e,t){return r.apply(this,arguments)}}(),a=`
\n ${n.length} file(s) found\n
`,u=0;case 1:if(!(u=e.size)t(i);else{var r=e.slice(o,o+s);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),o),o+=s,a()},n.onerror=function(e){r(n.error.message)},a()})}},{key:"readFileSync",value:function(e){if(!R())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(t,r){return r?e.gcd(r,t%r):t}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;re?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))});const P=function(e){function t(){var e,r,i,o;n(this,t);for(var s=arguments.length,a=new Array(s),l=0;lg?c.c=c.e=null:e.e=10;n/=10,r++);return void(r>g?c.c=c.e=null:(c.e=r,c.c=[e]))}return S(c,String(e))}if("bigint"==o)return c.s=e<0?(e=-e,-1):1,S(c,String(e));if("string"==o)i=e;else{if(b)throw Error(V+"BigNumber, string, number, or BigInt expected: "+e);i=String(e)}if(M.test(i))return c.s=45==i.charCodeAt(0)?(i=i.slice(1),-1):1,S(c,i);if(i=i.replace(u,""),a.test(i))return c.s=isNaN(i)?null:i<0?-1:1,void(c.c=c.e=null);if(i=i.replace(s,function(e,r,n){return t="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r}),t)return A(c,i,t,e);if(i=i.replace(/(\d)_(?=\d)/g,"$1"),M.test(i))return c.s=45==i.charCodeAt(0)?(i=i.slice(1),-1):1,S(c,i);if(b)throw Error(V+"Not a number: "+e);c.s=c.c=c.e=null}else{if("string"!=o){if(b)throw Error(V+"String expected: "+e);e=String(e)}Q(t,2,E.length,"Base"),A(c,e.replace(u,""),t,e)}}function S(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(--i););if(t=t.slice(n,++i))if(i-=n,(r=r-n-1)>g)e.c=e.e=null;else if(r=0)){if("_"==o){if(f&&u+1=d)?re(u,s):ne(u,s,"0");else if(o=(e=N(new x(e),t,r)).e,a=(u=K(e.c)).length,1==n||2==n&&(t<=o||o<=p)){for(;as),u=ne(u,o,"0"),o+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function T(e){return e instanceof x||!!e&&!0===e._isBigNumber}function O(e,t){for(var r,n,i=1,o=new x(e[0]);i=10;i/=10,n++);return(r=n+r*q-1)>g?e.c=e.e=null:r=10;a/=10,i++);if((o=t-i)<0)o+=q,s=t,u=f[c=0],l=z(u/h[i-s-1]%10);else if((c=$((o+1)/q))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=l=0,i=1,s=(o%=q)-q+1}else{for(u=a=f[c],i=1;a>=10;a/=10,i++);l=(s=(o%=q)-q+i)<0?0:z(u/h[i-s-1]%10)}if(n=n||t<0||null!=f[c+1]||(s<0?u:u%h[i-s-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(o>0?s>0?u/h[i-s]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=h[(q-t%q)%q],e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=c,a=1,c--):(f.length=c+1,a=h[q-o],f[c]=s>0?z(u/h[i-s]%h[s])*a:0),n)for(;;){if(0==c){for(o=1,s=f[0];s>=10;s/=10,o++);for(s=f[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(e.e++,f[0]==H&&(f[0]=1));break}if(f[c]+=a,f[c]!=H)break;f[c--]=0,a=1}for(o=f.length;0===f[--o];f.pop());}e.e>g?e.c=e.e=null:e.e=d?re(t,r):ne(t,r,"0"),e.s<0?"-"+t:t)}return x.clone=e,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(V+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(f=Q(e[t],0,J,t)),e.hasOwnProperty(t="ROUNDING_MODE")&&(h=Q(e[t],0,8,t)),e.hasOwnProperty(t="EXPONENTIAL_AT")&&(ee(r=e[t])?(Q(r[0],-J,0,t),Q(r[1],0,J,t),p=r[0],d=r[1]):p=-(d=Q(r,-J,J,t)<0?-r:r)),e.hasOwnProperty(t="RANGE")){if(!(r=e[t]))throw Error(V+t+" cannot be zero: "+r);ee(r)?(Q(r[0],-J,-1,t),Q(r[1],1,J,t),y=r[0],g=r[1]):y=-(g=Q(r,-J,J,t)<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(V+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw m=!r,Error(V+"crypto unavailable");m=r}else m=r}if(e.hasOwnProperty(t="STRICT")){if((r=e[t])!==!!r)throw Error(V+t+" not true or false: "+r);b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(v=Q(e[t],0,9,t)),e.hasOwnProperty(t="POW_PRECISION")&&(w=Q(e[t],0,J,t)),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(V+t+" not an object: "+r);for(t in r)r.hasOwnProperty(t)&&_.hasOwnProperty(t)&&(_[t]=r[t])}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(V+t+" invalid: "+r);E=r}}return{DECIMAL_PLACES:f,ROUNDING_MODE:h,EXPONENTIAL_AT:[p,d],RANGE:[y,g],CRYPTO:m,STRICT:b,MODULO_MODE:v,POW_PRECISION:w,FORMAT:_,ALPHABET:E}},x.fromFormat=function(e,t){if("string"!=typeof e)throw Error(V+"Not a string: "+e);if(null==t)t=_;else{if("object"!=typeof t)throw Error(V+"Argument not an object: "+t);t=I(t)}var r,n,i,o,s=t.negativeSign||"-",a=t.positiveSign||"",u=t.prefix||"",c=t.suffix||"",l=t.groupSeparator||"",f=t.decimalSeparator||".",h=t.fractionGroupSeparator||"";if(u&&0===e.indexOf(u)&&(e=e.slice(u.length)),c&&e.lastIndexOf(c)===e.length-c.length&&(e=e.slice(0,-c.length)),s&&0===e.indexOf(s)?(e=e.slice(s.length),n=!0):a&&0===e.indexOf(a)&&(e=e.slice(a.length)),(r=e.indexOf(f))<0){if(l)for(;e.indexOf(l)>-1;)e=e.replace(l,"")}else{if(i=e.slice(0,r),o=e.slice(r+f.length),l)for(;i.indexOf(l)>-1;)i=i.replace(l,"");if(h)for(;o.indexOf(h)>-1;)o=o.replace(h,"");e=i+"."+o}return new x(n?"-"+e:e)},x.isBigNumber=function(e){if(!T(e))return!1;var t,r,n=e.c,i=e.e,o=e.s;if(!ee(n))return null===n&&null===i&&(null===o||1===o||-1===o);if(1!==o&&-1!==o||i<-J||i>J||i!==z(i))return!1;if(0===n[0])return 0===i&&1===n.length;if((t=(i+1)%q)<1&&(t+=q),String(n[0]).length!==t)return!1;for(t=0;t=H||r!==z(r))return!1;return 0!==r},x.maximum=x.max=function(){return O(arguments,-1)},x.minimum=x.min=function(){return O(arguments,1)},x.random=(i=9007199254740992,o=Math.random()*i&2097151?function(){return z(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,s,a=0,u=[],c=new x(l);if(e=null==e?f:Q(e,0,J),i=$(e/q),m)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));a>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(u.push(s%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw m=!1,Error(V+"crypto unavailable");for(t=crypto.randomBytes(i*=7);a=9e15?crypto.randomBytes(7).copy(t,a):(u.push(s%1e14),a+=7);a=i/7}if(!m)for(;a=10;s/=10,a++);ar-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,l,p,d,y,g,m,b=n.indexOf("."),v=f,_=h;for(b>=0&&(p=w,w=0,n=n.replace(".",""),y=(m=new x(i)).pow(n.length-b),w=p,m.c=t(ne(K(y.c),y.e,"0"),10,o,e),m.e=m.c.length),l=p=(g=t(n,i,o,a?(u=E,e):(u=e,E))).length;0==g[--p];g.pop());if(!g[0])return u.charAt(0);if(b<0?--l:(y.c=g,y.e=l,y.s=s,g=(y=r(y,m,v,_,o)).c,d=y.r,l=y.e),b=g[c=l+v+1],p=o/2,d=d||c<0||null!=g[c+1],d=_<4?(null!=b||d)&&(0==_||_==(y.s<0?3:2)):b>p||b==p&&(4==_||d||6==_&&1&g[c-1]||_==(y.s<0?8:7)),c<1||!g[0])n=d?ne(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(co;)g[c]=0,c||(++l,g=[1].concat(g));for(p=g.length;!g[--p];);for(b=0,n="";b<=p;n+=u.charAt(g[b++]));n=ne(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%Z,l=t/Z|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%Z)+(n=l*o+(s=e[u]/Z|0)*c)%Z*Z+a)/r|0)+(n/Z|0)+l*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,o,s,a){var u,c,l,f,h,p,d,y,g,m,b,v,w,_,E,S,A,B=n.s==i.s?1:-1,T=n.c,O=i.c;if(!(T&&T[0]&&O&&O[0]))return new x(n.s&&i.s&&(T?!O||T[0]!=O[0]:O)?T&&0==T[0]||!O?0*B:B/0:NaN);for(g=(y=new x(B)).c=[],B=o+(c=n.e-i.e)+1,a||(a=H,c=Y(n.e/q)-Y(i.e/q),B=B/q|0),l=0;O[l]==(T[l]||0);l++);if(O[l]>(T[l]||0)&&c--,B<0)g.push(1),f=!0;else{for(_=T.length,S=O.length,l=0,B+=2,(h=z(a/(O[0]+1)))>1&&(O=e(O,h,a),T=e(T,h,a),S=O.length,_=T.length),w=S,b=(m=T.slice(0,S)).length;b=a/2&&E++;do{if(h=0,(u=t(O,m,S,b))<0){if(v=m[0],S!=b&&(v=v*a+(m[1]||0)),(h=z(v/E))>1)for(h>=a&&(h=a-1),d=(p=e(O,h,a)).length,b=m.length;1==t(p,m,d,b);)h--,r(p,S=10;B/=10,l++);N(y,o+(y.e=l+c*q-1)+1,s,f)}else y.e=c,y.r=+f;return y}}(),c.absoluteValue=c.abs=function(){var e=new x(this);return e.s<0&&(e.s=1),e},c.comparedTo=function(e,t){return X(this,new x(e,t))},c.decimalPlaces=c.dp=function(e,t){var r,n,i,o=this;if(null!=e)return N(new x(o),Q(e,-J,J)+o.e+1,null==t?h:Q(t,0,8));if(!(r=o.c))return null;if(n=((i=r.length-1)-Y(this.e/q))*q,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},c.dividedBy=c.div=function(e,t){return r(this,new x(e,t),f,h)},c.dividedToIntegerBy=c.idiv=function(e,t){return r(this,new x(e,t),0,1)},c.exponentiatedBy=c.pow=function(e,t){var r,n,i,o,s,a,u,c,f=this;if((e=new x(e)).c&&!e.isInteger())throw Error(V+"Exponent not an integer: "+F(e));if(null!=t&&(t=new x(t)),s=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return c=new x(Math.pow(+F(f),s?e.s*(2-te(e)):+F(e))),t?c.mod(t):c;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new x(NaN);(n=!a&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||s&&f.c[1]>=24e7:f.c[0]<8e13||s&&f.c[0]<=9999975e7)))return o=f.s<0&&te(e)?-0:0,f.e>-1&&(o=1/o),new x(a?1/o:o);w&&(o=$(w/q+2))}for(s?(r=new x(.5),a&&(e.s=1),u=te(e)):u=(i=Math.abs(+F(e)))%2,c=new x(l);;){if(u){if(!(c=c.times(f)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=z(i/2)))break;u=i%2}else if(N(e=e.times(r),e.e+1,1),e.e>14)u=te(e);else{if(0===(i=+F(e)))break;u=i%2}f=f.times(f),o?f.c&&f.c.length>o&&(f.c.length=o):n&&(f=f.mod(t))}return n?c:(a&&(c=l.div(c)),t?c.mod(t):o?N(c,w,h,void 0):c)},c.integerValue=function(e){var t=new x(this);return N(t,t.e+1,null==e?h:Q(e,0,8))},c.isEqualTo=c.eq=function(e,t){return 0===X(this,new x(e,t))},c.isFinite=function(){return!!this.c},c.isGreaterThan=c.gt=function(e,t){return X(this,new x(e,t))>0},c.isGreaterThanOrEqualTo=c.gte=function(e,t){return 1===(t=X(this,new x(e,t)))||0===t},c.isInteger=function(){return!!this.c&&Y(this.e/q)>this.c.length-2},c.isLessThan=c.lt=function(e,t){return X(this,new x(e,t))<0},c.isLessThanOrEqualTo=c.lte=function(e,t){return-1===(t=X(this,new x(e,t)))||0===t},c.isNaN=function(){return!this.s},c.isNegative=function(){return this.s<0},c.isPositive=function(){return this.s>0},c.isZero=function(){return!!this.c&&0==this.c[0]},c.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new x(e,t)).s,!a||!t)return new x(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/q,c=e.e/q,l=s.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new x(f?s:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new x(l[0]?s:3==h?-0:0)}if(u=Y(u),c=Y(c),l=l.slice(),a=u-c){for((o=a<0)?(a=-a,i=l):(c=u,i=f),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=f.length))?a:t,a=t=0;t0)for(;t--;l[r++]=0);for(t=H-1;n>a;){if(l[--n]=0;){for(r=0,h=v[i]%g,p=v[i]/g|0,o=i+(s=u);o>i;)r=((c=h*(c=b[--s]%g)+(a=p*c+(l=b[s]/g|0)*h)%g*g+d[o]+r)/y|0)+(a/g|0)+p*l,d[o--]=c%y;d[o]=r}return r?++n:d.splice(0,1),k(e,d,n)},c.negated=function(){var e=new x(this);return e.s=-e.s||null,e},c.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new x(e,t)).s,!i||!t)return new x(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/q,s=e.e/q,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new x(i/0);if(!a[0]||!u[0])return u[0]?e:new x(a[0]?n:0*i)}if(o=Y(o),s=Y(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/H|0,a[t]=H===a[t]?0:a[t]%H;return i&&(a=[i].concat(a),++s),k(e,a,s)},c.precision=c.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return N(new x(o),Q(e,1,J),null==t?h:Q(t,0,8));if(!(r=o.c))return null;if(n=(i=r.length-1)*q+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},c.shiftedBy=function(e){return this.times("1e"+Q(e,-G,G))},c.squareRoot=c.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,l=f+4,p=new x("0.5");if(1!==u||!a||!a[0])return new x(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+F(s)))||u==1/0?(((t=K(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=Y((c+1)/2)-(c<0||c%2),n=new x(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new x(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(o=n,n=p.times(o.plus(r(s,o,l,1))),K(o.c).slice(0,u)===(t=K(n.c)).slice(0,u)){if(n.eQ(o,0,J)&&(e=o),null!=i&&0!==Q(i,0,J)){if(null!=o&&i>o)throw Error(V+"Minimum must not exceed maximum");e0&&y>0){for(u=y%l||l,s=p.substr(0,u);u0&&(s+=h+p.slice(u))}else s=p;d&&((u=+r.fractionGroupSize)&&(d=d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||""))),s+=(r.decimalSeparator||"")+d)}return(r.prefix||"")+(n?r.negativeSign||"":a.s>0&&r.positiveSign||"")+s+(r.suffix||"")},c.toFraction=function(e){var t,n,i,o,s,a,u,c,f,h,p,d,y,m,b=this,v=b.c;if(null!=e&&(!(u=new x(e)).isInteger()&&(u.c||1!==u.s)||u.lt(l)))throw Error(V+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+F(u));if(!v)return[new x(b.s||0),new x(0)];for(t=new x(l),f=n=new x(l),i=c=new x(l),d=K(v),s=t.e=d.length-b.e-1,t.c[0]=W[(a=s%q)<0?q+a:a],e=!e||u.comparedTo(t)>0?s>0?t:f:u,a=g,g=1/0,m=u=new x(d),y=t,c.c[0]=0;h=r(u,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,f=c.plus(h.times(o=f)),c=o,t=u.minus(h.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(f)),n=n.plus(o.times(i)),(p=f.times(y).minus(m.times(i)).abs().times(n).comparedTo(c.times(y).minus(m.times(n)).abs().times(i))<1?[f,i]:[c,n])[0].s=b.s,g=a,p},c.toNumber=function(){return+F(this)},c.toObject=function(){var e=this;return{c:e.c?e.c.slice():null,e:e.e,s:e.s}},c.toPrecision=function(e,t){return B(this,null==e?e:Q(e,1,J),t,2)},c.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=p||o>=d?re(K(r.c),o):ne(K(r.c),o,"0"):(Q(e,2,E.length,"Base"),t=n(ne(K(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},c.valueOf=c.toJSON=function(){return F(this)},c._isBigNumber=!0,null!=t&&x.set(t),x}(),M=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,$=Math.ceil,z=Math.floor,V="[BigNumber Error] ",H=1e14,q=14,G=9007199254740991,W=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Z=1e7,J=1e9;function Y(e){var t=0|e;return e>0||e===t?t:t-1}function K(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nc^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;so[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function Q(e,t,r,n){if(er||e!==z(e))throw Error(V+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e));return e}function ee(e){return"[object Array]"=={}.toString.call(e)}function te(e){var t=e.c.length-1;return Y(e.e/q)==t&&e.c[t]%2!=0}function re(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ne(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n(this,e),this.bytes=t,this.length=this.bytes.length,this.position=r,this.bitPos=i}return a(e,[{key:"clone",value:function(){return new e(this.bytes,this.position,this.bitPos)}},{key:"getBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.position>this.length)){var t=null!==e?this.position+e:this.length,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(this.position>this.length)){-1===e&&(e=this.length-this.position);for(var t="",r=this.position;r1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r,n=0,i=0;for(n=this.bytes[this.position++]&(r=this.bitPos,"be"===t?(1<<8-r)-1:256-(1<>>=this.bitPos),i=8-this.bitPos,this.bitPos=0;ie){var o=i-e;"be"===t?n>>>=o:n&=(1<this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n,i=function(e,t){var r=new Array;return e.forEach(function(e,n){r[e]=t-n}),r}(e,t);this.position=0;o--)if(this.bytes[this.position-t+o]!==e[o]){n=!1,this.position+=i[e[o]];break}if(n){this.position-=t;break}}}else for(;++this.positionthis.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;return this.bitPos>0&&t++,this.bytes.slice(e,t)}}])}();function se(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ae(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r>4],u=i[(15&s)>>2],c=(2&s)>>1;if("free"===a||"bad"===a||"reserved"===u){r.moveBackwardsBy(1);break}var l=Math.floor(144*a/u+c);if(r.position+l>r.length){r.moveTo(r.length);break}r.moveForwardsBy(l-3)}return r.carve()}},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");for(n++;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:ce},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:ce}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var o=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(o-2),r.moveForwardsBy(32);var s=r.readInt(4,"le"),a=r.readInt(4,"le");if(s>0)return r.moveTo(s+a),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var u=r.readInt(4,"le"),c=r.readInt(4,"le");return r.moveTo(c+u),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var o=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var s=r.readInt(2,i),a=r.readInt(2,i);return r.moveTo(o),r.moveForwardsBy(s*a),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:le},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:le},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:ce},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=function(){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join(""))return r.moveBackwardsBy(262),1;r.moveBackwardsBy(138);var e=0;r.getBytes(11).forEach(function(t,r){e+=(t-48).toString()}),e=512*Math.ceil(parseInt(e,8)/512),r.moveForwardsBy(e+377)};r.hasMore()&&!n(););return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}return 8&n&&(r.continueUntil(0),r.moveForwardsBy(1)),16&n&&(r.continueUntil(0),r.moveForwardsBy(1)),2&n&&r.moveForwardsBy(2),ge(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i=2368&&r.moveForwardsBy(4);var a=r.readInt(1,"be");if(r.moveForwardsBy(a),64&s){var u=r.readInt(4,"be");r.moveForwardsBy(u)}for(r.moveForwardsBy(4);r.hasMore();){var c=r.readInt(4,"be");if(0===c)break;var l=r.readInt(4,"be"),f=c===l?i:i+n;r.moveForwardsBy(l+4*f)}return r.carve()}},{name:"Linux deb package",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:function(e,t){var r=new oe(e.slice(t));for(r.moveForwardsBy(8);r.hasMore();){r.moveForwardsBy(48);var n,i="",o=se(r.getBytes(10));try{for(o.s();!(n=o.n()).done;){var s=n.value;i+=String.fromCharCode(s)}}catch(e){o.e(e)}finally{o.f()}i=parseInt(i.trim(),10),r.moveForwardsBy(2),r.moveForwardsBy(i)}return r.carve()}},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;for(r.moveForwardsBy(n);r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(112),r.moveTo(4096*(r.readInt(4,"le")+1)),r.carve()}},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(12),r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;for(r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(20),r.moveForwardsBy(r.readInt(4)),r.carve()}},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4},{0:149,1:5,2:134,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(52),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function ce(e,t){var r=new oe(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function le(e,t){var r="207250237254",n=new oe(e.slice(t)),i=n.getBytes(4).join("");return n.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,o=0;o0&&e.moveForwardsBy(1)}var me=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],be=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ve(e,t,r){for(var n,i=0;(n=_e(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(me[n-257],"le"),n=_e(e,r),e.readBits(be[n],"le"))}}function we(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<>=1;for(var h=o<<16|u,p=c;p>>16;if(u>s)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${u}`);return e.moveBackwardsByBits(s-u),65535&a}function Ee(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}const Se=function(){return a(function e(){n(this,e)},null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){throw new Error("fromArrayBuffer has not been implemented")}}])}();function Ae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ae=function(){return!!e})()}const Be=function(e){function t(){return n(this,t),e=this,i=arguments,r=c(r=t),u(e,Ae()?Reflect.construct(r,i||[],c(e).constructor):r.apply(e,i));var e,r,i}return f(t,e),a(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}])}(Se);function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Te=function(){return!!e})()}const Oe=function(e){function t(){return n(this,t),e=this,i=arguments,r=c(r=t),u(e,Te()?Reflect.construct(r,i||[],c(e).constructor):r.apply(e,i));var e,r,i}return f(t,e),a(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=ie.isBigNumber(this.value)?U.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value);try{this.value=new ie(U.arrayBufferToStr(this.value))}catch(e){this.value=new ie(NaN)}}}])}(Se);function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ke=function(){return!!e})()}const Ie=function(e){function t(){return n(this,t),e=this,i=arguments,r=c(r=t),u(e,ke()?Reflect.construct(r,i||[],c(e).constructor):r.apply(e,i));var e,r,i}return f(t,e),a(t,null,[{key:"toArrayBuffer",value:function(){var e=this;if(t.checkForValue(this.value),!R())return new Promise(function(t,r){U.readFile(e.value).then(function(t){return e.value=t.buffer}).then(t).catch(r)});this.value=U.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new File(this.value,"unknown")}}])}(Se);function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ne=function(){return!!e})()}const Fe=function(e){function t(){return n(this,t),e=this,i=arguments,r=c(r=t),u(e,Ne()?Reflect.construct(r,i||[],c(e).constructor):r.apply(e,i));var e,r,i}return f(t,e),a(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?U.arrayBufferToStr(this.value):""}}])}(Se);function Re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Re=function(){return!!e})()}const Le=function(e){function t(){return n(this,t),e=this,i=arguments,r=c(r=t),u(e,Re()?Reflect.construct(r,i||[],c(e).constructor):r.apply(e,i));var e,r,i}return f(t,e),a(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(U.unescapeHtml(U.stripHtmlTags(this.value,!0))):new ArrayBuffer}}])}(Fe);function je(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(je=function(){return!!e})()}const Ue=function(e){function t(){return n(this,t),e=this,i=arguments,r=c(r=t),u(e,je()?Reflect.construct(r,i||[],c(e).constructor):r.apply(e,i));var e,r,i}return f(t,e),a(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=void 0!==this.value?U.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=JSON.parse(U.arrayBufferToStr(this.value))}}])}(Se);function Ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ce=function(){return!!e})()}const Pe=function(e){function r(){return n(this,r),e=this,i=arguments,t=c(t=r),u(e,Ce()?Reflect.construct(t,i||[],c(e).constructor):t.apply(e,i));var e,t,i}return f(r,e),a(r,null,[{key:"toArrayBuffer",value:(o=t(p().mark(function e(){return p().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r.checkForValue(this.value),!R()){e.next=1;break}this.value=this.value.map(function(e){return Uint8Array.from(e.data)}),e.next=3;break;case 1:return e.next=2,r.concatenateTypedArraysWithTypedElements.apply(r,g(this.value));case 2:this.value=e.sent;case 3:case"end":return e.stop()}},e,this)})),function(){return o.apply(this,arguments)})},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:(i=t(p().mark(function e(){var t,r,n,i,o,s,a,u,c,l,f,h,d,y=arguments;return p().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,r=y.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(n(this,e),this.value=new ArrayBuffer(0),this.type=e.ARRAY_BUFFER,t&&Object.prototype.hasOwnProperty.call(t,"value")&&Object.prototype.hasOwnProperty.call(t,"type"))this.set(t.value,t.type);else if(t&&null!==r)this.set(t,r);else if(t){var i=e.typeEnum(t.constructor.name);this.set(t,i)}}return a(e,[{key:"get",value:function(t){var r=this;return"string"==typeof t&&(t=e.typeEnum(t)),this.type!==t?R()?(this._translate(t),this.value):new Promise(function(e,n){r._translate(t).then(function(){e(r.value)}).catch(n)}):this.value}},{key:"set",value:function(t,r){if("string"==typeof r&&(r=e.typeEnum(r)),b().debug("Dish type: "+e.enumLookup(r)),this.value=t,this.type=r,!this.valid()){var n=U.truncate(JSON.stringify(this.value),25);throw new P(`Data is not a valid ${e.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){return this.clone().get(e)}},{key:"detectDishType",value:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(ue);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in ue)t.includes(i)&&(n[i]=ue[i]);for(var o in n)n[o].forEach(function(t){Ee(t.signature,e)&&r.push(t)});return r}(new Uint8Array(this.value.slice(0,2048)));return e.length&&e[0].mime&&"text/plain"===e[0].mime?e[0].mime:null}},{key:"getTitle",value:(r=t(p().mark(function t(r){var n,i,o,s;return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n="",o=this.type,t.next=o===e.FILE?1:o===e.LIST_FILE?2:o===e.JSON?3:o===e.NUMBER||o===e.BIG_NUMBER?4:o===e.ARRAY_BUFFER||o===e.BYTE_ARRAY?5:6;break;case 1:return n=this.value.name,t.abrupt("continue",9);case 2:return n=`${this.value.length} file(s)`,t.abrupt("continue",9);case 3:return n="application/json",t.abrupt("continue",9);case 4:return n=this.value.toString(),t.abrupt("continue",9);case 5:if(null===(n=this.detectDishType())){t.next=6;break}return t.abrupt("continue",9);case 6:return t.prev=6,(i=this.clone()).value=i.value.slice(0,256),t.next=7,i.get(e.STRING);case 7:n=t.sent,t.next=9;break;case 8:t.prev=8,s=t.catch(6),b().error(`${e.enumLookup(this.type)} cannot be sliced. ${s}`);case 9:return t.abrupt("return",n.slice(0,r));case 10:case"end":return t.stop()}},t,this,[[6,8]])})),function(e){return r.apply(this,arguments)})},{key:"valid",value:function(){switch(this.type){case e.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var t=0;t255)return!1;return!0;case e.STRING:case e.HTML:return"string"==typeof this.value;case e.NUMBER:return"number"==typeof this.value;case e.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case e.BIG_NUMBER:return!!ie.isBigNumber(this.value)||!!Object.keys(this.value).sort().equals(["c","e","s"])&&(this.value=new ie({s:this.value.s,e:this.value.e,c:this.value.c,_isBigNumber:!0}),!0);case e.JSON:return!0;case e.FILE:return this.value instanceof File;case e.LIST_FILE:return this.value instanceof Array&&this.value.reduce(function(e,t){return e&&t instanceof File},!0);default:return!1}}},{key:"size",get:function(){switch(this.type){case e.BYTE_ARRAY:case e.STRING:case e.HTML:return this.value.length;case e.NUMBER:case e.BIG_NUMBER:return this.value.toString().length;case e.ARRAY_BUFFER:return this.value.byteLength;case e.JSON:return JSON.stringify(this.value).length;case e.FILE:return this.value.size;case e.LIST_FILE:return this.value.reduce(function(e,t){return e+t.size},0);default:return-1}}},{key:"clone",value:function(){var t=new e;switch(this.type){case e.STRING:case e.HTML:case e.NUMBER:case e.BIG_NUMBER:t.set(this.value,this.type);break;case e.BYTE_ARRAY:case e.JSON:t.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case e.ARRAY_BUFFER:t.set(this.value.slice(0),this.type);break;case e.FILE:t.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case e.LIST_FILE:t.set(this.value.map(function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})}),this.type);break;default:throw new P("Cannot clone Dish, unknown type")}return t}},{key:"_translate",value:function(t){var r=this;if(b().debug(`Translating Dish from ${e.enumLookup(this.type)} to ${e.enumLookup(t)}`),!R())return new Promise(function(n,i){r._toArrayBuffer().then(function(){return r.type=e.ARRAY_BUFFER}).then(function(){r._fromArrayBuffer(t),n()}).catch(i)});this._toArrayBuffer(),this.type=e.ARRAY_BUFFER,this._fromArrayBuffer(t)}},{key:"_toArrayBuffer",value:function(){var t=this,r={browser:{[e.STRING]:function(){return Promise.resolve(Fe.toArrayBuffer.bind(t)())},[e.NUMBER]:function(){return Promise.resolve(Me.toArrayBuffer.bind(t)())},[e.HTML]:function(){return Promise.resolve(Le.toArrayBuffer.bind(t)())},[e.ARRAY_BUFFER]:function(){return Promise.resolve()},[e.BIG_NUMBER]:function(){return Promise.resolve(Oe.toArrayBuffer.bind(t)())},[e.JSON]:function(){return Promise.resolve(Ue.toArrayBuffer.bind(t)())},[e.FILE]:function(){return Ie.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Promise.resolve(Pe.toArrayBuffer.bind(t)())},[e.BYTE_ARRAY]:function(){return Promise.resolve(Be.toArrayBuffer.bind(t)())}},node:{[e.STRING]:function(){return Fe.toArrayBuffer.bind(t)()},[e.NUMBER]:function(){return Me.toArrayBuffer.bind(t)()},[e.HTML]:function(){return Le.toArrayBuffer.bind(t)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return Oe.toArrayBuffer.bind(t)()},[e.JSON]:function(){return Ue.toArrayBuffer.bind(t)()},[e.FILE]:function(){return Ie.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Pe.toArrayBuffer.bind(t)()},[e.BYTE_ARRAY]:function(){return Be.toArrayBuffer.bind(t)()}}};try{return r[R()?"node":"browser"][this.type]()}catch(t){throw new P(`Error translating from ${e.enumLookup(this.type)} to ArrayBuffer: ${t}`)}}},{key:"_fromArrayBuffer",value:function(t){var r=this,n={[e.STRING]:function(){return Fe.fromArrayBuffer.bind(r)()},[e.NUMBER]:function(){return Me.fromArrayBuffer.bind(r)()},[e.HTML]:function(){return Le.fromArrayBuffer.bind(r)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return Oe.fromArrayBuffer.bind(r)()},[e.JSON]:function(){return Ue.fromArrayBuffer.bind(r)()},[e.FILE]:function(){return Ie.fromArrayBuffer.bind(r)()},[e.LIST_FILE]:function(){return Pe.fromArrayBuffer.bind(r)()},[e.BYTE_ARRAY]:function(){return Be.fromArrayBuffer.bind(r)()}};try{n[t](),this.type=t}catch(r){throw new P(`Error translating from ArrayBuffer to ${e.enumLookup(t)}: ${r}`)}}}],[{key:"typeEnum",value:function(t){switch(t.toLowerCase()){case"bytearray":case"byte array":return e.BYTE_ARRAY;case"string":return e.STRING;case"number":return e.NUMBER;case"html":return e.HTML;case"arraybuffer":case"array buffer":return e.ARRAY_BUFFER;case"bignumber":case"big number":return e.BIG_NUMBER;case"json":case"object":return e.JSON;case"file":return e.FILE;case"list":return e.LIST_FILE;default:throw new P("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(t){switch(t){case e.BYTE_ARRAY:return"byteArray";case e.STRING:return"string";case e.NUMBER:return"number";case e.HTML:return"html";case e.ARRAY_BUFFER:return"ArrayBuffer";case e.BIG_NUMBER:return"BigNumber";case e.JSON:return"JSON";case e.FILE:return"File";case e.LIST_FILE:return"List";default:throw new P("Invalid data type enum. No matching type.")}}}]);var r}();$e.BYTE_ARRAY=0,$e.STRING=1,$e.NUMBER=2,$e.HTML=3,$e.ARRAY_BUFFER=4,$e.BIG_NUMBER=5,$e.JSON=6,$e.FILE=7,$e.LIST_FILE=8;const ze=$e,Ve=function(){function e(t){n(this,e),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.maxLength=null,this.min=null,this.max=null,this.step=1,this.integer=!1,this.allowEmpty=!0,t&&this._parseConfig(t)}return a(e,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.maxLength=e.maxLength||null,this.min=e.min,this.max=e.max,this.step=e.step,this.integer=void 0!==e.integer&&!!e.integer,this.allowEmpty=void 0===e.allowEmpty||!!e.allowEmpty}},{key:"validate",value:function(e){if(this.disabled)return!0;var t,r,n,i=e;null==i&&(i=this.defaultValue),"toggleString"===this.type&&i&&"object"==typeof i&&"string"in i&&(i=i.string),"option"===this.type&&Array.isArray(i)&&(i=i[null!==(t=this.defaultIndex)&&void 0!==t?t:0]),"argSelector"===this.type&&Array.isArray(i)&&(i=(null===(r=i[null!==(n=this.defaultIndex)&&void 0!==n?n:0])||void 0===r?void 0:r.name)||"");var o=!1;if((null==i||""===i||"number"==typeof i.length&&0===i.length)&&(o=!0),o){var s=!1;if("option"===this.type&&Array.isArray(this.defaultValue)?s=this.defaultValue.includes(""):"argSelector"===this.type&&Array.isArray(this.defaultValue)&&(s=this.defaultValue.some(function(e){return""===e.name})),!1===this.allowEmpty||("option"===this.type||"argSelector"===this.type)&&!s)throw new S(`${this.name} cannot be empty.`);return!0}if("number"==typeof this.maxLength&&null!=i){if("string"==typeof i&&i.length>this.maxLength)throw new S(`${this.name} length cannot exceed ${this.maxLength}.`);if(Array.isArray(i)&&i.length>this.maxLength)throw new S(`${this.name} length cannot exceed ${this.maxLength}.`);if(i instanceof Uint8Array&&i.length>this.maxLength)throw new S(`${this.name} length cannot exceed ${this.maxLength}.`)}if("number"===this.type){if(null==i||isNaN(i))throw new S(`${this.name} must be a number.`);if(this.integer&&!Number.isInteger(i))throw new S(`${this.name} must be an integer.`);if("number"==typeof this.min&&ithis.max)throw new S(`${this.name} must be less than or equal to ${this.max}.`)}if("option"===this.type&&Array.isArray(this.defaultValue)){var a=this.defaultValue.filter(function(e){return"string"==typeof e&&!e.match(/^\[\/?[a-z0-9 -()^]+\]$/i)}),u=null!=i?String(i).toLowerCase():"";if(!a.find(function(e){return e.toLowerCase()===u}))throw new S(`${this.name} must be one of the following: ${a.join(", ")}.`)}if("argSelector"===this.type&&Array.isArray(this.defaultValue)){var c=this.defaultValue.map(function(e){return e.name}).filter(function(e){return"string"==typeof e&&!e.match(/^\[\/?[a-z0-9 -()^]+\]$/i)}),l=null!=i?String(i).toLowerCase():"";if(!c.find(function(e){return e.toLowerCase()===l}))throw new S(`${this.name} must be one of the following: ${c.join(", ")}.`)}return!0}},{key:"config",get:function(){return this._value}},{key:"value",get:function(){return this._value},set:function(t){this._value=e.prepare(t,this.type)}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return U.parseEscapedChars(e);case"byteArray":return"string"==typeof e?T(e=e.replace(/\s+/g,"")):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r)){var n=U.truncate(e.toString(),10);throw new S("Invalid ingredient value. Not a number: "+n)}return r;default:return e}}}])}();var He=function(){return a(function e(){n(this,e),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null},[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"inputType",get:function(){return ze.enumLookup(this._inputType)},set:function(e){this._inputType=ze.typeEnum(e)}},{key:"outputType",get:function(){return ze.enumLookup(this._outputType)},set:function(e){this._outputType=ze.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)}},{key:"presentType",get:function(){return ze.enumLookup(this._presentType)},set:function(e){this._presentType=ze.typeEnum(e)}},{key:"args",get:function(){return this._ingList.map(function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),e.maxLength&&(t.maxLength=e.maxLength),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),void 0!==e.integer&&(t.integer=e.integer),void 0!==e.allowEmpty&&(t.allowEmpty=e.allowEmpty),t})},set:function(e){var t=this;e.forEach(function(e){var r=new Ve(e);t.addIngredient(r)})}},{key:"validateIngredients",value:function(e){var t=e||this.ingValues;return this._ingList.forEach(function(e,r){r{const e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get;return t=>e.call(t)})();function Xe(e){return"Uint8Array"===Ke(e)}function Qe(e){return"object"==typeof e&&null!=e&&Symbol.toStringTag in e&&("ArrayBuffer"===e[Symbol.toStringTag]||"SharedArrayBuffer"===e[Symbol.toStringTag])}function et(e){return e instanceof RegExp||"[object RegExp]"===Object.prototype.toString.call(e)}function tt(e){return"object"==typeof e&&null!=e&&Symbol.toStringTag in e&&"Map"===e[Symbol.toStringTag]}function rt(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function nt(e,t){return JSON.stringify(e,(e,t)=>"bigint"==typeof t?{$numberLong:`${t}`}:tt(t)?Object.fromEntries(t):t)}const it=Symbol.for("@@mdb.bson.version"),ot=2147483647,st=-2147483648,at=Math.pow(2,63)-1,ut=-Math.pow(2,63),ct=Math.pow(2,53),lt=-Math.pow(2,53);Object.freeze({double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:-1,maxKey:127});class ft extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(e,t){super(e,t)}static isBSONError(e){return null!=e&&"object"==typeof e&&"bsonError"in e&&!0===e.bsonError&&"name"in e&&"message"in e&&"stack"in e}}class ht extends ft{get name(){return"BSONVersionError"}constructor(){super("Unsupported BSON version, bson types must be from bson 7.x.x")}}class pt extends ft{get name(){return"BSONRuntimeError"}constructor(e){super(e)}}class dt extends ft{get name(){return"BSONOffsetError"}offset;constructor(e,t,r){super(`${e}. offset: ${t}`,r),this.offset=t}}let yt,gt;function mt(e,t,r,n){if(n){yt??=new TextDecoder("utf8",{fatal:!0});try{return yt.decode(e.subarray(t,r))}catch(e){throw new ft("Invalid UTF-8 string in BSON document",{cause:e})}}return gt??=new TextDecoder("utf8",{fatal:!1}),gt.decode(e.subarray(t,r))}function bt(e,t,r){if(0===e.length)return"";const n=r-t;if(0===n)return"";if(n>20)return null;if(1===n&&e[t]<128)return String.fromCharCode(e[t]);if(2===n&&e[t]<128&&e[t+1]<128)return String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);if(3===n&&e[t]<128&&e[t+1]<128&&e[t+2]<128)return String.fromCharCode(e[t])+String.fromCharCode(e[t+1])+String.fromCharCode(e[t+2]);const i=[];for(let n=t;n127)return null;i.push(t)}return String.fromCharCode(...i)}function vt(e){return Et.fromNumberArray(Array.from({length:e},()=>Math.floor(256*Math.random())))}function wt(e){return crypto.getRandomValues(Et.allocate(e))}const _t=(()=>{const{crypto:e}=globalThis;return null!=e&&"function"==typeof e.getRandomValues?wt:vt})(),Et={isUint8Array:Xe,toLocalBufferType(e){if(Ye.isBuffer(e))return e;if(ArrayBuffer.isView(e))return Ye.from(e.buffer,e.byteOffset,e.byteLength);const t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if("ArrayBuffer"===t||"SharedArrayBuffer"===t||"[object ArrayBuffer]"===t||"[object SharedArrayBuffer]"===t)return Ye.from(e);throw new ft("Cannot create Buffer from the passed potentialBuffer.")},allocate:e=>Ye.alloc(e),allocateUnsafe:e=>Ye.allocUnsafe(e),compare:(e,t)=>Et.toLocalBufferType(e).compare(t),concat:e=>Ye.concat(e),copy:(e,t,r,n,i)=>Et.toLocalBufferType(e).copy(t,r??0,n??0,i??e.length),equals:(e,t)=>Et.toLocalBufferType(e).equals(t),fromNumberArray:e=>Ye.from(e),fromBase64:e=>Ye.from(e,"base64"),fromUTF8:e=>Ye.from(e,"utf8"),toBase64:e=>Et.toLocalBufferType(e).toString("base64"),fromISO88591:e=>Ye.from(e,"binary"),toISO88591:e=>Et.toLocalBufferType(e).toString("binary"),fromHex:e=>Ye.from(e,"hex"),toHex:e=>Et.toLocalBufferType(e).toString("hex"),toUTF8(e,t,r,n){const i=r-t<=20?bt(e,t,r):null;if(null!=i)return i;const o=Et.toLocalBufferType(e).toString("utf8",t,r);if(n)for(let n=0;nYe.byteLength(e,"utf8"),encodeUTF8Into(e,t,r){const n=function(e,t,r){if(0===t.length)return 0;if(t.length>25)return null;if(e.length-r127)return null;e[i]=r}return t.length}(e,t,r);return null!=n?n:Et.toLocalBufferType(e).write(t,r,void 0,"utf8")},randomBytes:_t,swap32:e=>Et.toLocalBufferType(e).swap32()};function xt(e){if(e<0)throw new RangeError(`The argument 'byteLength' is invalid. Received ${e}`);return Bt.fromNumberArray(Array.from({length:e},()=>Math.floor(256*Math.random())))}const St=(()=>{const{crypto:e}=globalThis;if(null!=e&&"function"==typeof e.getRandomValues)return t=>e.getRandomValues(Bt.allocate(t));if(function(){const{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}()){const{console:e}=globalThis;e?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return xt})(),At=/(\d|[a-f])/i,Bt={isUint8Array:Xe,toLocalBufferType(e){const t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if("Uint8Array"===t)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));if("ArrayBuffer"===t||"SharedArrayBuffer"===t||"[object ArrayBuffer]"===t||"[object SharedArrayBuffer]"===t)return new Uint8Array(e);throw new ft("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(e){if("number"!=typeof e)throw new TypeError(`The "size" argument must be of type number. Received ${String(e)}`);return new Uint8Array(e)},allocateUnsafe:e=>Bt.allocate(e),compare(e,t){if(e===t)return 0;const r=Math.min(e.length,t.length);for(let n=0;nt[n])return 1}return e.lengtht.length?1:0},concat(e){if(0===e.length)return Bt.allocate(0);let t=0;for(const r of e)t+=r.length;const r=Bt.allocate(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r},copy(e,t,r,n,i){if(void 0!==i&&i<0)throw new RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${i}`);if(i=i??e.length,void 0!==n&&(n<0||n>i))throw new RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${i}. Received ${n}`);if(n=n??0,void 0!==r&&r<0)throw new RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${r}`);r=r??0;const o=e.subarray(n,i),s=Math.min(o.length,t.length-r);return s<=0?0:(t.set(o.subarray(0,s),r),s)},equals(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;rUint8Array.from(e),fromBase64:e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)),fromUTF8:e=>(new TextEncoder).encode(e),toBase64:e=>btoa(Bt.toISO88591(e)),fromISO88591:e=>Uint8Array.from(e,e=>255&e.charCodeAt(0)),toISO88591:e=>Array.from(Uint16Array.from(e),e=>String.fromCharCode(e)).join(""),fromHex(e){const t=e.length%2==0?e:e.slice(0,e.length-1),r=[];for(let e=0;eArray.from(e,e=>e.toString(16).padStart(2,"0")).join(""),toUTF8(e,t,r,n){const i=r-t<=20?bt(e,t,r):null;return null!=i?i:mt(e,t,r,n)},utf8ByteLength:e=>(new TextEncoder).encode(e).byteLength,encodeUTF8Into(e,t,r){const n=(new TextEncoder).encode(t);return e.set(n,r),n.byteLength},randomBytes:St,swap32(e){if(e.length%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t127)throw new RangeError(`Size cannot be negative at offset: ${t}`);return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},getInt32LE:(e,t)=>e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,getUint32LE:(e,t)=>e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3],getUint32BE:(e,t)=>e[t+3]+256*e[t+2]+65536*e[t+1]+16777216*e[t],getBigInt64LE:(e,t)=>(BigInt(e[t+4]+256*e[t+5]+65536*e[t+6]+(e[t+7]<<24))<<32n)+BigInt(e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]),getFloat64LE:Ft?(e,t)=>(Nt[7]=e[t],Nt[6]=e[t+1],Nt[5]=e[t+2],Nt[4]=e[t+3],Nt[3]=e[t+4],Nt[2]=e[t+5],Nt[1]=e[t+6],Nt[0]=e[t+7],It[0]):(e,t)=>(Nt[0]=e[t],Nt[1]=e[t+1],Nt[2]=e[t+2],Nt[3]=e[t+3],Nt[4]=e[t+4],Nt[5]=e[t+5],Nt[6]=e[t+6],Nt[7]=e[t+7],It[0]),setInt32BE:(e,t,r)=>(e[t+3]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t]=r,4),setInt32LE:(e,t,r)=>(e[t]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+3]=r,4),setBigInt64LE(e,t,r){const n=0xffffffffn;let i=Number(r&n);e[t]=i,i>>=8,e[t+1]=i,i>>=8,e[t+2]=i,i>>=8,e[t+3]=i;let o=Number(r>>32n&n);return e[t+4]=o,o>>=8,e[t+5]=o,o>>=8,e[t+6]=o,o>>=8,e[t+7]=o,8},setFloat64LE:Ft?(e,t,r)=>(It[0]=r,e[t]=Nt[7],e[t+1]=Nt[6],e[t+2]=Nt[5],e[t+3]=Nt[4],e[t+4]=Nt[3],e[t+5]=Nt[2],e[t+6]=Nt[1],e[t+7]=Nt[0],8):(e,t,r)=>(It[0]=r,e[t]=Nt[0],e[t+1]=Nt[1],e[t+2]=Nt[2],e[t+3]=Nt[3],e[t+4]=Nt[4],e[t+5]=Nt[5],e[t+6]=Nt[6],e[t+7]=Nt[7],8)};class Lt extends kt{get _bsontype(){return"Binary"}static BSON_BINARY_SUBTYPE_DEFAULT=0;static BUFFER_SIZE=256;static SUBTYPE_DEFAULT=0;static SUBTYPE_FUNCTION=1;static SUBTYPE_BYTE_ARRAY=2;static SUBTYPE_UUID_OLD=3;static SUBTYPE_UUID=4;static SUBTYPE_MD5=5;static SUBTYPE_ENCRYPTED=6;static SUBTYPE_COLUMN=7;static SUBTYPE_SENSITIVE=8;static SUBTYPE_VECTOR=9;static SUBTYPE_USER_DEFINED=128;static VECTOR_TYPE=Object.freeze({Int8:3,Float32:39,PackedBit:16});buffer;sub_type;position;constructor(e,t){if(super(),null!=e&&"string"==typeof e&&!ArrayBuffer.isView(e)&&!Qe(e)&&!Array.isArray(e))throw new ft("Binary can only be constructed from Uint8Array or number[]");this.sub_type=255&(t??Lt.BSON_BINARY_SUBTYPE_DEFAULT),null==e?(this.buffer=Tt.allocate(Lt.BUFFER_SIZE),this.position=0):(this.buffer=Array.isArray(e)?Tt.fromNumberArray(e):Tt.toLocalBufferType(e),this.position=this.buffer.byteLength)}put(e){if("string"==typeof e&&1!==e.length)throw new ft("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new ft("only accepts single character Uint8Array or Array");let t;if(t="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0],t<0||t>255)throw new ft("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=t;else{const e=Tt.allocate(Lt.BUFFER_SIZE+this.buffer.length);e.set(this.buffer,0),this.buffer=e,this.buffer[this.position++]=t}}write(e,t){if(t="number"==typeof t?t:this.position,this.buffer.byteLengththis.position?t+e.length:this.position;else if("string"==typeof e)throw new ft("input cannot be string")}read(e,t){const r=e+(t=t&&t>0?t:this.position);return this.buffer.subarray(e,r>this.position?this.position:r)}value(){return this.buffer.length===this.position?this.buffer:this.buffer.subarray(0,this.position)}length(){return this.position}toJSON(){return Tt.toBase64(this.buffer.subarray(0,this.position))}toString(e){return"hex"===e?Tt.toHex(this.buffer.subarray(0,this.position)):"base64"===e?Tt.toBase64(this.buffer.subarray(0,this.position)):Tt.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(e){e=e||{},this.sub_type===Lt.SUBTYPE_VECTOR&&jt(this);const t=Tt.toBase64(this.buffer),r=Number(this.sub_type).toString(16);return e.legacy?{$binary:t,$type:1===r.length?"0"+r:r}:{$binary:{base64:t,subType:1===r.length?"0"+r:r}}}toUUID(){if(this.sub_type===Lt.SUBTYPE_UUID)return new Pt(this.buffer.subarray(0,this.position));throw new ft(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${Lt.SUBTYPE_UUID.toString(16).padStart(2,"0")} is currently supported.`)}static createFromHexString(e,t){return new Lt(Tt.fromHex(e),t)}static createFromBase64(e,t){return new Lt(Tt.fromBase64(e),t)}static fromExtendedJSON(e,t){let r,n;if(t=t||{},"$binary"in e?t.legacy&&"string"==typeof e.$binary&&"$type"in e?(n=e.$type?parseInt(e.$type,16):0,r=Tt.fromBase64(e.$binary)):"string"!=typeof e.$binary&&(n=e.$binary.subType?parseInt(e.$binary.subType,16):0,r=Tt.fromBase64(e.$binary.base64)):"$uuid"in e&&(n=4,r=Pt.bytesFromString(e.$uuid)),!r)throw new ft(`Unexpected Binary Extended JSON format ${JSON.stringify(e)}`);return 4===n?new Pt(r):new Lt(r,n)}inspect(e,t,r){return r??=nt,`Binary.createFromBase64(${r(Tt.toBase64(this.buffer.subarray(0,this.position)),t)}, ${r(this.sub_type,t)})`}toInt8Array(){if(this.sub_type!==Lt.SUBTYPE_VECTOR)throw new ft("Binary sub_type is not Vector");if(this.buffer[0]!==Lt.VECTOR_TYPE.Int8)throw new ft("Binary datatype field is not Int8");return jt(this),new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==Lt.SUBTYPE_VECTOR)throw new ft("Binary sub_type is not Vector");if(this.buffer[0]!==Lt.VECTOR_TYPE.Float32)throw new ft("Binary datatype field is not Float32");jt(this);const e=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));return Rt.isBigEndian&&Tt.swap32(e),new Float32Array(e.buffer)}toPackedBits(){if(this.sub_type!==Lt.SUBTYPE_VECTOR)throw new ft("Binary sub_type is not Vector");if(this.buffer[0]!==Lt.VECTOR_TYPE.PackedBit)throw new ft("Binary datatype field is not packed bit");return jt(this),new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==Lt.SUBTYPE_VECTOR)throw new ft("Binary sub_type is not Vector");if(this.buffer[0]!==Lt.VECTOR_TYPE.PackedBit)throw new ft("Binary datatype field is not packed bit");jt(this);const e=8*(this.length()-2)-this.buffer[1],t=new Int8Array(e);for(let e=0;e>7-e%8&1;t[e]=n}return t}static fromInt8Array(e){const t=Tt.allocate(e.byteLength+2);t[0]=Lt.VECTOR_TYPE.Int8,t[1]=0;const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.set(r,2);const n=new this(t,this.SUBTYPE_VECTOR);return jt(n),n}static fromFloat32Array(e){const t=Tt.allocate(e.byteLength+2);t[0]=Lt.VECTOR_TYPE.Float32,t[1]=0;const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.set(r,2),Rt.isBigEndian&&Tt.swap32(new Uint8Array(t.buffer,2));const n=new this(t,this.SUBTYPE_VECTOR);return jt(n),n}static fromPackedBits(e,t=0){const r=Tt.allocate(e.byteLength+2);r[0]=Lt.VECTOR_TYPE.PackedBit,r[1]=t,r.set(e,2);const n=new this(r,this.SUBTYPE_VECTOR);return jt(n),n}static fromBits(e){const t=e.length+7>>>3,r=new Uint8Array(t+2);r[0]=Lt.VECTOR_TYPE.PackedBit;const n=e.length%8;r[1]=0===n?0:8-n;for(let t=0;t>>3,i=e[t];if(0!==i&&1!==i)throw new ft(`Invalid bit value at ${t}: must be 0 or 1, found ${e[t]}`);if(0===i)continue;const o=7-t%8;r[n+2]|=i<7)throw new ft(`Invalid Vector: padding must be a value between 0 and 7. found: ${n}`)}const Ut=/^[0-9A-F]{32}$/i,Ct=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class Pt extends Lt{constructor(e){let t;if(null==e)t=Pt.generate();else if(e instanceof Pt)t=Tt.toLocalBufferType(new Uint8Array(e.buffer));else if(ArrayBuffer.isView(e)&&16===e.byteLength)t=Tt.toLocalBufferType(e);else{if("string"!=typeof e)throw new ft("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");t=Pt.bytesFromString(e)}super(t,4)}get id(){return this.buffer}set id(e){this.buffer=e}toHexString(e=!0){return e?[Tt.toHex(this.buffer.subarray(0,4)),Tt.toHex(this.buffer.subarray(4,6)),Tt.toHex(this.buffer.subarray(6,8)),Tt.toHex(this.buffer.subarray(8,10)),Tt.toHex(this.buffer.subarray(10,16))].join("-"):Tt.toHex(this.buffer)}toString(e){return"hex"===e?Tt.toHex(this.id):"base64"===e?Tt.toBase64(this.id):this.toHexString()}toJSON(){return this.toHexString()}equals(e){if(!e)return!1;if(e instanceof Pt)return Tt.equals(e.id,this.id);try{return Tt.equals(new Pt(e).id,this.id)}catch{return!1}}toBinary(){return new Lt(this.id,Lt.SUBTYPE_UUID)}static generate(){const e=Tt.randomBytes(16);return e[6]=15&e[6]|64,e[8]=63&e[8]|128,e}static isValid(e){return!!e&&("string"==typeof e?Pt.isValidUUIDString(e):Xe(e)?16===e.byteLength:"Binary"===e._bsontype&&e.sub_type===this.SUBTYPE_UUID&&16===e.buffer.byteLength)}static createFromHexString(e){const t=Pt.bytesFromString(e);return new Pt(t)}static createFromBase64(e){return new Pt(Tt.fromBase64(e))}static bytesFromString(e){if(!Pt.isValidUUIDString(e))throw new ft("UUID string representation must be 32 hex digits or canonical hyphenated representation");return Tt.fromHex(e.replace(/-/g,""))}static isValidUUIDString(e){return Ut.test(e)||Ct.test(e)}inspect(e,t,r){return r??=nt,`new UUID(${r(this.toHexString(),t)})`}}class Dt extends kt{get _bsontype(){return"Code"}code;scope;constructor(e,t){super(),this.code=e.toString(),this.scope=t??null}toJSON(){return null!=this.scope?{code:this.code,scope:this.scope}:{code:this.code}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(e){return new Dt(e.$code,e.$scope)}inspect(e,t,r){r??=nt;let n=r(this.code,t);const i=n.includes("\n");return null!=this.scope&&(n+=`,${i?"\n":" "}${r(this.scope,t)}`),`new Code(${i?"\n":""}${n}${i&&null===this.scope?"\n":""})`}}function Mt(e){return null!=e&&"object"==typeof e&&"$id"in e&&null!=e.$id&&"$ref"in e&&"string"==typeof e.$ref&&(!("$db"in e)||"$db"in e&&"string"==typeof e.$db)}class $t extends kt{get _bsontype(){return"DBRef"}collection;oid;db;fields;constructor(e,t,r,n){super();const i=e.split(".");2===i.length&&(r=i.shift(),e=i.shift()),this.collection=e,this.oid=t,this.db=r,this.fields=n||{}}get namespace(){return this.collection}set namespace(e){this.collection=e}toJSON(){const e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(e.$db=this.db),e}toExtendedJSON(e){e=e||{};let t={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(t.$db=this.db),t=Object.assign(t,this.fields)),t}static fromExtendedJSON(e){const t=Object.assign({},e);return delete t.$ref,delete t.$id,delete t.$db,new $t(e.$ref,e.$id,e.$db,t)}inspect(e,t,r){r??=nt;const n=[r(this.namespace,t),r(this.oid,t),...this.db?[r(this.db,t)]:[],...Object.keys(this.fields).length>0?[r(this.fields,t)]:[]];return n[1]=r===nt?`new ObjectId(${n[1]})`:n[1],`new DBRef(${n.join(", ")})`}}function zt(e){if(""===e)return e;let t=0;const r="-"===e[t],n="+"===e[t];(n||r)&&(t+=1);let i=!1;for(;t>>=0)&&e<256)&&(n=Zt[e],n)?n:(r=Yt.fromBits(e,(0|e)<0?-1:0,!0),i&&(Zt[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=Wt[e],n)?n:(r=Yt.fromBits(e,e<0?-1:0,!1),i&&(Wt[e]=r),r)}static fromNumber(e,t){if(isNaN(e))return t?Yt.UZERO:Yt.ZERO;if(t){if(e<0)return Yt.UZERO;if(e>=qt)return Yt.MAX_UNSIGNED_VALUE}else{if(e<=-Gt)return Yt.MIN_VALUE;if(e+1>=Gt)return Yt.MAX_VALUE}return e<0?Yt.fromNumber(-e,t).neg():Yt.fromBits(e%Ht|0,e/Ht|0,t)}static fromBigInt(e,t){const r=0xffffffffn;return new Yt(Number(e&r),Number(e>>32n&r),t)}static _fromString(e,t,r){if(0===e.length)throw new ft("empty string");if(r<2||360)throw new ft("interior hyphen");if(0===n)return Yt._fromString(e.substring(1),t,r).neg();const i=Yt.fromNumber(Math.pow(r,8));let o=Yt.ZERO;for(let t=0;t>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,o=e.high>>>16,s=65535&e.high,a=e.low>>>16;let u=0,c=0,l=0,f=0;return f+=i+(65535&e.low),l+=f>>>16,f&=65535,l+=n+a,c+=l>>>16,l&=65535,c+=r+s,u+=c>>>16,c&=65535,u+=t+o,u&=65535,Yt.fromBits(l<<16|f,u<<16|c,this.unsigned)}and(e){return Yt.isLong(e)||(e=Yt.fromValue(e)),Yt.fromBits(this.low&e.low,this.high&e.high,this.unsigned)}compare(e){if(Yt.isLong(e)||(e=Yt.fromValue(e)),this.eq(e))return 0;const t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1}comp(e){return this.compare(e)}divide(e){if(Yt.isLong(e)||(e=Yt.fromValue(e)),e.isZero())throw new ft("division by zero");if(Vt){if(!this.unsigned&&-2147483648===this.high&&-1===e.low&&-1===e.high)return this;const t=(this.unsigned?Vt.div_u:Vt.div_s)(this.low,this.high,e.low,e.high);return Yt.fromBits(t,Vt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Yt.UZERO:Yt.ZERO;let t,r,n;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Yt.UZERO;if(e.gt(this.shru(1)))return Yt.UONE;n=Yt.UZERO}else{if(this.eq(Yt.MIN_VALUE))return e.eq(Yt.ONE)||e.eq(Yt.NEG_ONE)?Yt.MIN_VALUE:e.eq(Yt.MIN_VALUE)?Yt.ONE:(t=this.shr(1).div(e).shl(1),t.eq(Yt.ZERO)?e.isNegative()?Yt.ONE:Yt.NEG_ONE:(r=this.sub(e.mul(t)),n=t.add(r.div(e)),n));if(e.eq(Yt.MIN_VALUE))return this.unsigned?Yt.UZERO:Yt.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=Yt.ZERO}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));const i=Math.ceil(Math.log(t)/Math.LN2),o=i<=48?1:Math.pow(2,i-48);let s=Yt.fromNumber(t),a=s.mul(e);for(;a.isNegative()||a.gt(r);)t-=o,s=Yt.fromNumber(t,this.unsigned),a=s.mul(e);s.isZero()&&(s=Yt.ONE),n=n.add(s),r=r.sub(a)}return n}div(e){return this.divide(e)}equals(e){return Yt.isLong(e)||(e=Yt.fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low}eq(e){return this.equals(e)}getHighBits(){return this.high}getHighBitsUnsigned(){return this.high>>>0}getLowBits(){return this.low}getLowBitsUnsigned(){return this.low>>>0}getNumBitsAbs(){if(this.isNegative())return this.eq(Yt.MIN_VALUE)?64:this.neg().getNumBitsAbs();const e=0!==this.high?this.high:this.low;let t;for(t=31;t>0&&!(e&1<0}gt(e){return this.greaterThan(e)}greaterThanOrEqual(e){return this.comp(e)>=0}gte(e){return this.greaterThanOrEqual(e)}ge(e){return this.greaterThanOrEqual(e)}isEven(){return!(1&this.low)}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return!(1&~this.low)}isPositive(){return this.unsigned||this.high>=0}isZero(){return 0===this.high&&0===this.low}lessThan(e){return this.comp(e)<0}lt(e){return this.lessThan(e)}lessThanOrEqual(e){return this.comp(e)<=0}lte(e){return this.lessThanOrEqual(e)}modulo(e){if(Yt.isLong(e)||(e=Yt.fromValue(e)),Vt){const t=(this.unsigned?Vt.rem_u:Vt.rem_s)(this.low,this.high,e.low,e.high);return Yt.fromBits(t,Vt.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))}mod(e){return this.modulo(e)}rem(e){return this.modulo(e)}multiply(e){if(this.isZero())return Yt.ZERO;if(Yt.isLong(e)||(e=Yt.fromValue(e)),Vt){const t=Vt.mul(this.low,this.high,e.low,e.high);return Yt.fromBits(t,Vt.get_high(),this.unsigned)}if(e.isZero())return Yt.ZERO;if(this.eq(Yt.MIN_VALUE))return e.isOdd()?Yt.MIN_VALUE:Yt.ZERO;if(e.eq(Yt.MIN_VALUE))return this.isOdd()?Yt.MIN_VALUE:Yt.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Yt.TWO_PWR_24)&&e.lt(Yt.TWO_PWR_24))return Yt.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);const t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,o=e.high>>>16,s=65535&e.high,a=e.low>>>16,u=65535&e.low;let c=0,l=0,f=0,h=0;return h+=i*u,f+=h>>>16,h&=65535,f+=n*u,l+=f>>>16,f&=65535,f+=i*a,l+=f>>>16,f&=65535,l+=r*u,c+=l>>>16,l&=65535,l+=n*a,c+=l>>>16,l&=65535,l+=i*s,c+=l>>>16,l&=65535,c+=t*u+r*a+n*s+i*o,c&=65535,Yt.fromBits(f<<16|h,c<<16|l,this.unsigned)}mul(e){return this.multiply(e)}negate(){return!this.unsigned&&this.eq(Yt.MIN_VALUE)?Yt.MIN_VALUE:this.not().add(Yt.ONE)}neg(){return this.negate()}not(){return Yt.fromBits(~this.low,~this.high,this.unsigned)}notEquals(e){return!this.equals(e)}neq(e){return this.notEquals(e)}ne(e){return this.notEquals(e)}or(e){return Yt.isLong(e)||(e=Yt.fromValue(e)),Yt.fromBits(this.low|e.low,this.high|e.high,this.unsigned)}shiftLeft(e){return Yt.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?Yt.fromBits(this.low<>>32-e,this.unsigned):Yt.fromBits(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):Yt.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)}shr(e){return this.shiftRight(e)}shiftRightUnsigned(e){if(Yt.isLong(e)&&(e=e.toInt()),0==(e&=63))return this;{const t=this.high;if(e<32){const r=this.low;return Yt.fromBits(r>>>e|t<<32-e,t>>>e,this.unsigned)}return 32===e?Yt.fromBits(t,0,this.unsigned):Yt.fromBits(t>>>e-32,0,this.unsigned)}}shr_u(e){return this.shiftRightUnsigned(e)}shru(e){return this.shiftRightUnsigned(e)}subtract(e){return Yt.isLong(e)||(e=Yt.fromValue(e)),this.add(e.neg())}sub(e){return this.subtract(e)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*Ht+(this.low>>>0):this.high*Ht+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(e){return e?this.toBytesLE():this.toBytesBE()}toBytesLE(){const e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]}toBytesBE(){const e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]}toSigned(){return this.unsigned?Yt.fromBits(this.low,this.high,!1):this}toString(e){if((e=e||10)<2||36>>0).toString(e);if(r=i,r.isZero())return o+n;for(;o.length<6;)o="0"+o;n=""+o+n}}toUnsigned(){return this.unsigned?this:Yt.fromBits(this.low,this.high,!0)}xor(e){return Yt.isLong(e)||(e=Yt.fromValue(e)),Yt.fromBits(this.low^e.low,this.high^e.high,this.unsigned)}eqz(){return this.isZero()}le(e){return this.lessThanOrEqual(e)}toExtendedJSON(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(e,t){const{useBigInt64:r=!1,relaxed:n=!0}={...t};if(e.$numberLong.length>20)throw new ft("$numberLong string is too long");if(!Jt.test(e.$numberLong))throw new ft(`$numberLong string "${e.$numberLong}" is in an invalid format`);if(r){const t=BigInt(e.$numberLong);return BigInt.asIntN(64,t)}const i=Yt.fromString(e.$numberLong);return n?i.toNumber():i}inspect(e,t,r){return r??=nt,`new Long(${r(this.toString(),t)}${this.unsigned?`, ${r(this.unsigned,t)}`:""})`}}const Kt=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Xt=/^(\+|-)?(Infinity|inf)$/i,Qt=/^(\+|-)?NaN$/i,er=6111,tr=-6176,rr=Tt.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),nr=Tt.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),ir=Tt.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),or=/^([-+])?(\d+)?$/;function sr(e){return!isNaN(parseInt(e,10))}function ar(e){const t=Yt.fromNumber(1e9);let r=Yt.fromNumber(0);if(!(e.parts[0]||e.parts[1]||e.parts[2]||e.parts[3]))return{quotient:e,rem:r};for(let n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new Yt(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function ur(e,t){throw new ft(`"${e}" is not a valid Decimal128 string - ${t}`)}class cr extends kt{get _bsontype(){return"Decimal128"}bytes;constructor(e){if(super(),"string"==typeof e)this.bytes=cr.fromString(e).bytes;else{if(!(e instanceof Uint8Array||Xe(e)))throw new ft("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new ft("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}static fromString(e){return cr._fromString(e,{allowRounding:!1})}static fromStringWithRounding(e){return cr._fromString(e,{allowRounding:!0})}static _fromString(e,t){let r=!1,n=!1,i=!1,o=!1,s=0,a=0,u=0,c=0,l=0;const f=[0];let h=0,p=0,d=0,y=0,g=new Yt(0,0),m=new Yt(0,0),b=0,v=0;if(e.length>=7e3)throw new ft(e+" not a valid Decimal128 string");const w=e.match(Kt),_=e.match(Xt),E=e.match(Qt);if(!w&&!_&&!E||0===e.length)throw new ft(e+" not a valid Decimal128 string");if(w){const t=w[2],r=w[4],n=w[5],i=w[6];r&&void 0===i&&ur(e,"missing exponent power"),r&&void 0===t&&ur(e,"missing exponent base"),void 0===r&&(n||i)&&ur(e,"missing e before exponent")}if("+"!==e[v]&&"-"!==e[v]||(n=!0,r="-"===e[v++]),!sr(e[v])&&"."!==e[v]){if("i"===e[v]||"I"===e[v])return new cr(r?nr:ir);if("N"===e[v])return new cr(rr)}for(;sr(e[v])||"."===e[v];)"."!==e[v]?(h<34&&("0"!==e[v]||o)&&(o||(l=a),o=!0,f[p++]=parseInt(e[v],10),h+=1),o&&(u+=1),i&&(c+=1),a+=1,v+=1):(i&&ur(e,"contains multiple periods"),i=!0,v+=1);if(i&&!a)throw new ft(e+" not a valid Decimal128 string");if("e"===e[v]||"E"===e[v]){const t=e.substr(++v).match(or);if(!t||!t[2])return new cr(rr);y=parseInt(t[0],10),v+=t[0].length}if(e[v])return new cr(rr);if(h){if(d=h-1,s=u,1!==s)for(;"0"===e[l+s-1+Number(n)+Number(i)];)s-=1}else f[0]=0,u=1,h=1,s=0;for(y<=c&&c>y+16384?y=tr:y-=c;y>er;){if(d+=1,d>=34){if(0===s){y=er;break}ur(e,"overflow")}y-=1}if(t.allowRounding){for(;y=5&&(s=1,5===o)){s=f[d]%2==1?1:0;for(let r=l+d+2;r=0&&++f[e]>9;e--)if(f[e]=0,0===e){if(!(y>>0,n=t.high>>>0;return r>>0>>0}(x.low,m)&&(x.high=x.high.add(Yt.fromNumber(1))),b=y+6176;const S={low:Yt.fromNumber(0),high:Yt.fromNumber(0)};x.high.shiftRightUnsigned(49).and(Yt.fromNumber(1)).equals(Yt.fromNumber(1))?(S.high=S.high.or(Yt.fromNumber(3).shiftLeft(61)),S.high=S.high.or(Yt.fromNumber(b).and(Yt.fromNumber(16383).shiftLeft(47))),S.high=S.high.or(x.high.and(Yt.fromNumber(0x7fffffffffff)))):(S.high=S.high.or(Yt.fromNumber(16383&b).shiftLeft(49)),S.high=S.high.or(x.high.and(Yt.fromNumber(562949953421311)))),S.low=x.low,r&&(S.high=S.high.or(Yt.fromString("9223372036854775808")));const A=Tt.allocateUnsafe(16);return v=0,A[v++]=255&S.low.low,A[v++]=S.low.low>>8&255,A[v++]=S.low.low>>16&255,A[v++]=S.low.low>>24&255,A[v++]=255&S.low.high,A[v++]=S.low.high>>8&255,A[v++]=S.low.high>>16&255,A[v++]=S.low.high>>24&255,A[v++]=255&S.high.low,A[v++]=S.high.low>>8&255,A[v++]=S.high.low>>16&255,A[v++]=S.high.low>>24&255,A[v++]=255&S.high.high,A[v++]=S.high.high>>8&255,A[v++]=S.high.high>>16&255,A[v++]=S.high.high>>24&255,new cr(A)}toString(){let e,t=0;const r=new Array(36);for(let e=0;e>26&31;if(y>>3==3){if(30===y)return c.join("")+"Infinity";if(31===y)return"NaN";e=d>>15&16383,n=8+(d>>14&1)}else n=d>>14&7,e=d>>17&16383;const g=e-6176;if(u.parts[0]=(16383&d)+((15&n)<<14),u.parts[1]=p,u.parts[2]=h,u.parts[3]=f,0===u.parts[0]&&0===u.parts[1]&&0===u.parts[2]&&0===u.parts[3])a=!0;else for(o=3;o>=0;o--){let e=0;const t=ar(u);if(u=t.quotient,e=t.rem.low,e)for(i=8;i>=0;i--)r[9*o+i]=e%10,e=Math.floor(e/10)}if(a)t=1,r[s]=0;else for(t=36;!r[s];)t-=1,s+=1;const m=t-1+g;if(m>=34||m<=-7||g>0){if(t>34)return c.push("0"),g>0?c.push(`E+${g}`):g<0&&c.push(`E${g}`),c.join("");c.push(`${r[s++]}`),t-=1,t&&c.push(".");for(let e=0;e0?c.push(`+${m}`):c.push(`${m}`)}else if(g>=0)for(let e=0;e0)for(let t=0;tr)throw new ft(`Input: '${e}' is smaller than the minimum value for Int32`);if(!Number.isSafeInteger(r))throw new ft(`Input: '${e}' is not a safe integer`);if(r.toString()!==t)throw new ft(`Input: '${e}' is not a valid Int32 string`);return new fr(r)}valueOf(){return this.value}toString(e){return this.value.toString(e)}toJSON(){return this.value}toExtendedJSON(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(e,t){return t&&t.relaxed?parseInt(e.$numberInt,10):new fr(e.$numberInt)}inspect(e,t,r){return r??=nt,`new Int32(${r(this.value,t)})`}}class hr extends kt{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new hr}inspect(){return"new MaxKey()"}}class pr extends kt{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new pr}inspect(){return"new MinKey()"}}const dr=new WeakMap;class yr extends kt{get _bsontype(){return"ObjectId"}static index=0;static PROCESS_UNIQUE=null;static resetState=()=>{this.index=Math.floor(16777216*Math.random()),this.PROCESS_UNIQUE=Tt.randomBytes(5)};static{this.resetState();const{startupSnapshot:e}=globalThis?.process?.getBuiltinModule?.("v8")??{};e?.isBuildingSnapshot?.()&&e?.addDeserializeCallback?.(this.resetState)}static cacheHexString;buffer;constructor(e){let t;if(super(),"object"==typeof e&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new ft("Argument passed in must have an id that is of type string or Buffer");t="toHexString"in e&&"function"==typeof e.toHexString?Tt.fromHex(e.toHexString()):e.id}else t=e;if(null==t)this.buffer=yr.generate();else if(ArrayBuffer.isView(t)&&12===t.byteLength)this.buffer=Tt.toLocalBufferType(t);else{if("string"!=typeof t)throw new ft("Argument passed in does not match the accepted types");if(!yr.validateHexString(t))throw new ft("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");this.buffer=Tt.fromHex(t),yr.cacheHexString&&dr.set(this,t)}}get id(){return this.buffer}set id(e){this.buffer=e,yr.cacheHexString&&dr.set(this,Tt.toHex(e))}static validateHexString(e){if(24!==e?.length)return!1;for(let t=0;t<24;t++){const r=e.charCodeAt(t);if(!(r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70))return!1}return!0}toHexString(){if(yr.cacheHexString){const e=dr.get(this);if(e)return e}const e=Tt.toHex(this.id);return yr.cacheHexString&&dr.set(this,e),e}static getInc(){return yr.index=(yr.index+1)%16777216}static generate(e){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));const t=yr.getInc(),r=Tt.allocateUnsafe(12);Rt.setInt32BE(r,0,e);const n=this.PROCESS_UNIQUE;return r[4]=n[0],r[5]=n[1],r[6]=n[2],r[7]=n[3],r[8]=n[4],r[11]=255&t,r[10]=t>>8&255,r[9]=t>>16&255,r}toString(e){return"base64"===e?Tt.toBase64(this.id):this.toHexString()}toJSON(){return this.toHexString()}static is(e){return null!=e&&"object"==typeof e&&"_bsontype"in e&&"ObjectId"===e._bsontype}equals(e){if(null==e)return!1;if(yr.is(e))return this.buffer[11]===e.buffer[11]&&Tt.equals(this.buffer,e.buffer);if("string"==typeof e)return e.toLowerCase()===this.toHexString();if("object"==typeof e&&"function"==typeof e.toHexString){const t=e.toHexString(),r=this.toHexString();return"string"==typeof t&&t.toLowerCase()===r}return!1}getTimestamp(){const e=new Date,t=Rt.getUint32BE(this.buffer,0);return e.setTime(1e3*Math.floor(t)),e}static createPk(){return new yr}serializeInto(e,t){return e[t]=this.buffer[0],e[t+1]=this.buffer[1],e[t+2]=this.buffer[2],e[t+3]=this.buffer[3],e[t+4]=this.buffer[4],e[t+5]=this.buffer[5],e[t+6]=this.buffer[6],e[t+7]=this.buffer[7],e[t+8]=this.buffer[8],e[t+9]=this.buffer[9],e[t+10]=this.buffer[10],e[t+11]=this.buffer[11],12}static createFromTime(e){const t=Tt.allocate(12);for(let e=11;e>=4;e--)t[e]=0;return Rt.setInt32BE(t,0,e),new yr(t)}static createFromHexString(e){if(24!==e?.length)throw new ft("hex string must be 24 characters");return new yr(Tt.fromHex(e))}static createFromBase64(e){if(16!==e?.length)throw new ft("base64 string must be 16 characters");return new yr(Tt.fromBase64(e))}static isValid(e){if(null==e)return!1;if("string"==typeof e)return yr.validateHexString(e);try{return new yr(e),!0}catch{return!1}}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(e){return new yr(e.$oid)}isCached(){return yr.cacheHexString&&dr.has(this)}inspect(e,t,r){return r??=nt,`new ObjectId(${r(this.toHexString(),t)})`}}class gr extends kt{get _bsontype(){return"BSONRegExp"}pattern;options;constructor(e,t){if(super(),this.pattern=e,this.options=(t??"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new ft(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(-1!==this.options.indexOf("\0"))throw new ft(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let e=0;ee);return r??=nt,`new BSONRegExp(${n(r(this.pattern),"regexp")}, ${n(r(this.options),"regexp")})`}}class mr extends kt{get _bsontype(){return"BSONSymbol"}value;constructor(e){super(),this.value=e}valueOf(){return this.value}toString(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(e){return new mr(e.$symbol)}inspect(e,t,r){return r??=nt,`new BSONSymbol(${r(this.value,t)})`}}const br=Yt;class vr extends br{get _bsontype(){return"Timestamp"}get[Ot](){return"Timestamp"}static MAX_VALUE=Yt.MAX_UNSIGNED_VALUE;get i(){return this.low>>>0}get t(){return this.high>>>0}constructor(e){if(null==e)super(0,0,!0);else if("bigint"==typeof e)super(e,!0);else if(Yt.isLong(e))super(e.low,e.high,!0);else{if("object"!=typeof e||!("t"in e)||!("i"in e))throw new ft("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }");{if("number"!=typeof e.t&&("object"!=typeof e.t||"Int32"!==e.t._bsontype))throw new ft("Timestamp constructed from { t, i } must provide t as a number");if("number"!=typeof e.i&&("object"!=typeof e.i||"Int32"!==e.i._bsontype))throw new ft("Timestamp constructed from { t, i } must provide i as a number");const t=Number(e.t),r=Number(e.i);if(t<0||Number.isNaN(t))throw new ft("Timestamp constructed from { t, i } must provide a positive t");if(r<0||Number.isNaN(r))throw new ft("Timestamp constructed from { t, i } must provide a positive i");if(t>4294967295)throw new ft("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(r>4294967295)throw new ft("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(r,t,!0)}}}toJSON(){return{$timestamp:this.toString()}}static fromInt(e){return new vr(Yt.fromInt(e,!0))}static fromNumber(e){return new vr(Yt.fromNumber(e,!0))}static fromBits(e,t){return new vr({i:e,t})}static fromString(e,t){return new vr(Yt.fromString(e,!0,t))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(e){const t=Yt.isLong(e.$timestamp.i)?e.$timestamp.i.getLowBitsUnsigned():e.$timestamp.i,r=Yt.isLong(e.$timestamp.t)?e.$timestamp.t.getLowBitsUnsigned():e.$timestamp.t;return new vr({t:r,i:t})}inspect(e,t,r){return r??=nt,`new Timestamp({ t: ${r(this.t,t)}, i: ${r(this.i,t)} })`}}const wr=Yt.fromNumber(ct),_r=Yt.fromNumber(lt);const Er=/^\$ref$|^\$id$|^\$db$/;function xr(e,t,r){"__proto__"===t?Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[t]=r}function Sr(e){if(Mt(e)){const{$ref:t,$id:r,$db:n,...i}=e;return new $t(t,r,n,i)}return e}const Ar=/\x00/,Br=new Set(["$db","$ref","$id","$clusterTime"]);function Tr(e,t,r,n){e[n++]=2,e[(n=n+Tt.encodeUTF8Into(e,t,n)+1)-1]=0;const i=Tt.encodeUTF8Into(e,r,n+4);return Rt.setInt32LE(e,n,i+1),n=n+4+i,e[n++]=0,n}function Or(e,t,r,n){const i=!Object.is(r,-0)&&Number.isSafeInteger(r)&&r<=ot&&r>=st?16:1;return e[n++]=i,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,n+(16===i?Rt.setInt32LE(e,n,r):Rt.setFloat64LE(e,n,r))}function kr(e,t,r,n){return e[n++]=18,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,n+Rt.setBigInt64LE(e,n,r)}function Ir(e,t,r,n){return e[n++]=10,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,n}function Nr(e,t,r,n){return e[n++]=8,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,e[n++]=r?1:0,n}function Fr(e,t,r,n){e[n++]=9,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0;const i=Yt.fromNumber(r.getTime()),o=i.getLowBits(),s=i.getHighBits();return(n+=Rt.setInt32LE(e,n,o))+Rt.setInt32LE(e,n,s)}function Rr(e,t,r,n){if(e[n++]=11,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,r.source&&null!=r.source.match(Ar))throw new ft("value "+r.source+" must not contain null bytes");return n+=Tt.encodeUTF8Into(e,r.source,n),e[n++]=0,r.ignoreCase&&(e[n++]=105),r.global&&(e[n++]=115),r.multiline&&(e[n++]=109),e[n++]=0,n}function Lr(e,t,r,n){if(e[n++]=11,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,null!=r.pattern.match(Ar))throw new ft("pattern "+r.pattern+" must not contain null bytes");n+=Tt.encodeUTF8Into(e,r.pattern,n),e[n++]=0;const i=r.options.split("").sort().join("");return n+=Tt.encodeUTF8Into(e,i,n),e[n++]=0,n}function jr(e,t,r,n){return null===r?e[n++]=10:"MinKey"===r[Ot]?e[n++]=255:e[n++]=127,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,n}function Ur(e,t,r,n){return e[n++]=7,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0,n+r.serializeInto(e,n)}function Cr(e,t,r,n){e[n++]=5,n+=Tt.encodeUTF8Into(e,t,n),e[n++]=0;const i=r.length;if(n+=Rt.setInt32LE(e,n,i),e[n++]=0,i<=16)for(let t=0;t=st,n=e<=at&&e>=ut;if(t.relaxed||t.legacy)return e;if(Number.isInteger(e)&&!Object.is(e,-0)){if(r)return new fr(e);if(n)return t.useBigInt64?BigInt(e):Yt.fromNumber(e)}return new lr(e)}if(null==e||"object"!=typeof e)return e;if(e.$undefined)return null;const r=Object.keys(e).filter(t=>t.startsWith("$")&&null!=e[t]);for(let n=0;ne.startsWith("$"));let n=!0;if(r.forEach(e=>{-1===["$ref","$id","$db"].indexOf(e)&&(n=!1)}),n)return $t.fromExtendedJSON(t)}return e}function Zr(e){const t=e.toISOString();return 0!==e.getUTCMilliseconds()?t:t.slice(0,-5)+"Z"}function Jr(e,t){if(e instanceof Map||tt(e)){const r=Object.create(null);for(const[t,n]of e){if("string"!=typeof t)throw new ft("Can only serialize maps with string keys");r[t]=n}return Jr(r,t)}if(("object"==typeof e||"function"==typeof e)&&null!==e){const r=t.seenObjects.findIndex(t=>t.obj===e);if(-1!==r){const e=t.seenObjects.map(e=>e.propertyName),n=e.slice(0,r).map(e=>`${e} -> `).join(""),i=e[r],o=" -> "+e.slice(r+1,e.length-1).map(e=>`${e} -> `).join(""),s=e[e.length-1],a=" ".repeat(n.length+i.length/2),u="-".repeat(o.length+(i.length+s.length)/2-1);throw new ft(`Converting circular structure to EJSON:\n ${n}${i}${o}${s}\n ${a}\\${u}/`)}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return function(e,t){return e.map((e,r)=>{t.seenObjects.push({propertyName:`index ${r}`,obj:null});try{return Jr(e,t)}finally{t.seenObjects.pop()}})}(e,t);if(void 0===e)return t.ignoreUndefined?void 0:null;if(e instanceof Date||rt(e)){const r=e.getTime(),n=r>-1&&r<2534023188e5;return t.legacy?t.relaxed&&n?{$date:e.getTime()}:{$date:Zr(e)}:t.relaxed&&n?{$date:Zr(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(!("number"!=typeof e||t.relaxed&&isFinite(e))){if(Number.isInteger(e)&&!Object.is(e,-0)){if(e>=st&&e<=ot)return{$numberInt:e.toString()};if(e>=ut&&e<=at)return{$numberLong:e.toString()}}return{$numberDouble:Object.is(e,-0)?"-0.0":e.toString()}}if("bigint"==typeof e)return t.relaxed?Number(BigInt.asIntN(64,e)):{$numberLong:BigInt.asIntN(64,e).toString()};if(e instanceof RegExp||et(e)){let r=e.flags;if(void 0===r){const t=e.toString().match(/[gimuy]*$/);t&&(r=t[0])}return new gr(e.source,r).toExtendedJSON(t)}return null!=e&&"object"==typeof e?function(e,t){if(null==e||"object"!=typeof e)throw new ft("not an object instance");const r=e._bsontype;if(void 0===r){const r={};for(const n of Object.keys(e)){t.seenObjects.push({propertyName:n,obj:null});try{const i=Jr(e[n],t);"__proto__"===n?Object.defineProperty(r,n,{value:i,writable:!0,enumerable:!0,configurable:!0}):r[n]=i}finally{t.seenObjects.pop()}}return r}if(null!=e&&"object"==typeof e&&"string"==typeof e._bsontype&&7!==e[it])throw new ht;if(function(e){return null!=e&&"object"==typeof e&&"_bsontype"in e&&"string"==typeof e._bsontype}(e)){let n=e;if("function"!=typeof n.toExtendedJSON){const t=Yr[e._bsontype];if(!t)throw new ft("Unrecognized or invalid _bsontype: "+e._bsontype);n=t(n)}return"Code"===r&&n.scope?n=new Dt(n.code,Jr(n.scope,t)):"DBRef"===r&&n.oid&&(n=new $t(Jr(n.collection,t),Jr(n.oid,t),Jr(n.db,t),Jr(n.fields,t))),n.toExtendedJSON(t)}throw new ft("_bsontype must be a string, but was: "+typeof r)}(e,t):e}const Yr={Binary:e=>new Lt(e.value(),e.sub_type),Code:e=>new Dt(e.code,e.scope),DBRef:e=>new $t(e.collection||e.namespace,e.oid,e.db,e.fields),Decimal128:e=>new cr(e.bytes),Double:e=>new lr(e.value),Int32:e=>new fr(e.value),Long:e=>Yt.fromBits(null!=e.low?e.low:e.low_,null!=e.low?e.high:e.high_,null!=e.low?e.unsigned:e.unsigned_),MaxKey:()=>new hr,MinKey:()=>new pr,ObjectId:e=>new yr(e),BSONRegExp:e=>new gr(e.pattern,e.options),BSONSymbol:e=>new mr(e.value),Timestamp:e=>vr.fromBits(e.low,e.high)};function Kr(e,t){const r={useBigInt64:t?.useBigInt64??!1,relaxed:t?.relaxed??!0,legacy:t?.legacy??!1};return JSON.parse(e,(e,t)=>{if(-1!==e.indexOf("\0"))throw new ft(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(e)}`);return Wr(t,r)})}function Xr(e,t,r,n){null!=r&&"object"==typeof r&&(n=r,r=void 0),null==t||"object"!=typeof t||Array.isArray(t)||(n=t,t=void 0);const i=Jr(e,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(i,t,r)}const Qr=Object.create(null);Qr.parse=Kr,Qr.stringify=Xr,Qr.serialize=function(e,t){return t=t||{},JSON.parse(Xr(e,t))},Qr.deserialize=function(e,t){return t=t||{},Kr(JSON.stringify(e),t)},Object.freeze(Qr);function en(e,t){try{return Rt.getNonnegativeInt32LE(e,t)}catch(e){throw new dt("BSON size cannot be negative",t,{cause:e})}}function tn(e,t){let r=t;for(;0!==e[r];r++);if(r===e.length-1)throw new dt("Null terminator not found",t);return r}const rn=Object.create(null);rn.parseToElements=function(e,t=0){if(t??=0,e.length<5)throw new dt(`Input must be at least 5 bytes, got ${e.length} bytes`,t);const r=en(e,t);if(r>e.length-t)throw new dt(`Parsed documentSize (${r} bytes) does not match input length (${e.length} bytes)`,t);if(0!==e[t+r-1])throw new dt("BSON documents must end in 0x00",t+r);const n=[];let i=t+4;for(;i<=r+t;){const o=e[i];if(i+=1,0===o){if(i-t!==r)throw new dt("Invalid 0x00 type byte",i);break}const s=i,a=tn(e,i)-s;let u;if(i+=a+1,1===o||18===o||9===o||17===o)u=8;else if(16===o)u=4;else if(7===o)u=12;else if(19===o)u=16;else if(8===o)u=1;else if(10===o||6===o||127===o||255===o)u=0;else if(11===o)u=tn(e,tn(e,i)+1)+1-i;else if(3===o||4===o||15===o)u=en(e,i);else{if(2!==o&&5!==o&&12!==o&&13!==o&&14!==o)throw new dt(`Invalid 0x${o.toString(16).padStart(2,"0")} type byte`,i);u=en(e,i)+4,5===o&&(u+=1),12===o&&(u+=12)}if(u>r)throw new dt("value reports length larger than document",i);n.push([o,s,a,i,u]),i+=u}return n},rn.ByteUtils=Tt,rn.NumberUtils=Rt,Object.freeze(rn);const nn=17825792;let on=Tt.allocate(nn);function sn(e,t={}){const r="boolean"==typeof t.checkKeys&&t.checkKeys,n="boolean"==typeof t.serializeFunctions&&t.serializeFunctions,i="boolean"!=typeof t.ignoreUndefined||t.ignoreUndefined,o="number"==typeof t.minInternalBufferSize?t.minInternalBufferSize:nn;on.length=t.keys.length){e[u++]=0,Rt.setInt32LE(e,t.objectSizeIndex,u-t.objectSizeIndex),null!==t.codeSizeIndex&&Rt.setInt32LE(e,t.codeSizeIndex,u-t.codeSizeIndex),s.delete(t.sourceObject),a=t.prev;continue}r=t.keys[t.keyIndex++],n=t.iterTarget[r]}else{const i=t.iterTarget;if(t.keyIndex>=i.length){e[u++]=0,Rt.setInt32LE(e,t.objectSizeIndex,u-t.objectSizeIndex),null!==t.codeSizeIndex&&Rt.setInt32LE(e,t.codeSizeIndex,u-t.codeSizeIndex),s.delete(t.sourceObject),a=t.prev;continue}const o=t.keyIndex++;r=String(o),n=i[o]}if("function"==typeof n?.toBSON&&(n=n.toBSON()),!(t.isArray||"string"!=typeof r||"$"===r[0]&&Br.has(r))){if(Ar.test(r))throw new ft("key "+r+" must not contain null bytes");if(t.checkKeys){if("$"===r[0])throw new ft("key "+r+" must not start with '$'");if(r.includes("."))throw new ft("key "+r+" must not contain '.'")}}const o=typeof n;if(void 0===n)(t.isArray||!1===t.ignoreUndefined)&&(u=Ir(e,r,0,u));else if(null===n)u=Ir(e,r,0,u);else if("string"===o)u=Tr(e,r,n,u);else if("number"===o)u=Or(e,r,n,u);else if("bigint"===o)u=kr(e,r,n,u);else if("boolean"===o)u=Nr(e,r,n,u);else if("object"===o&&null==n._bsontype)if(n instanceof Date||rt(n))u=Fr(e,r,n,u);else if(n instanceof Uint8Array||Xe(n))u=Cr(e,r,n,u);else if(n instanceof RegExp||et(n))u=Rr(e,r,n,u);else{if(s.has(n))throw new ft("Cannot convert circular structure to BSON");const i=Array.isArray(n);e[u++]=i?4:3,u+=Tt.encodeUTF8Into(e,r,u),e[u++]=0;const o=u;s.add(n),a=qr(n,o,null,t,t.checkKeys,t.ignoreUndefined),u+=4}else if("object"===o){if(7!==n[it])throw new ht;const i=n[Ot];if("ObjectId"===i)u=Ur(e,r,n,u);else if("Decimal128"===i)u=Pr(e,r,n,u);else if("Long"===i||"Timestamp"===i)u=Dr(e,r,n,u);else if("Double"===i)u=$r(e,r,n,u);else if("Code"===i){const i=n;if(i.scope&&"object"==typeof i.scope){e[u++]=15,u+=Tt.encodeUTF8Into(e,r,u),e[u++]=0;const n=u;u+=4;const o=i.code,c=Tt.encodeUTF8Into(e,o,u+4)+1;Rt.setInt32LE(e,u,c),e[u+4+c-1]=0,u=u+c+4;const l=i.scope;if(s.has(l))throw new ft("Cannot convert circular structure to BSON");s.add(l),a=qr(l,u,n,t,t.checkKeys,t.ignoreUndefined),u+=4}else{e[u++]=13,u+=Tt.encodeUTF8Into(e,r,u),e[u++]=0;const t=i.code.toString(),n=Tt.encodeUTF8Into(e,t,u+4)+1;Rt.setInt32LE(e,u,n),u=u+4+n-1,e[u++]=0}}else if("Binary"===i)u=Vr(e,r,n,u);else if("BSONSymbol"===i)u=Hr(e,r,n,u);else if("DBRef"===i){const i=n,o=Object.assign({$ref:i.collection,$id:i.oid},null!=i.db?{$db:i.db}:null,i.fields);e[u++]=3,u+=Tt.encodeUTF8Into(e,r,u),e[u++]=0,s.add(o),a=qr(o,u,null,t,!1,!0),u+=4}else if("BSONRegExp"===i)u=Lr(e,r,n,u);else if("Int32"===i)u=Mr(e,r,n,u);else if("MinKey"===i||"MaxKey"===i)u=jr(e,r,n,u);else if(void 0!==n._bsontype)throw new ft(`Unrecognized or invalid _bsontype: ${String(n._bsontype)}`)}else"function"===o&&i&&(u=zr(e,r,n,u))}return u}(on,e,r,0,n,i,null),a=Tt.allocateUnsafe(s);return a.set(on.subarray(0,s),0),a}function an(e,t={}){return function(e,t,r){const n=(t=t??{})&&t.index?t.index:0,i=Rt.getInt32LE(e,n);if(i<5)throw new ft(`bson size must be >= 5, is ${i}`);if(t.allowObjectSmallerThanBufferSize&&e.length= bson size ${i}`);if(!t.allowObjectSmallerThanBufferSize&&e.length!==i)throw new ft(`buffer length ${e.length} must === bson size ${i}`);if(i+n>e.byteLength)throw new ft(`(bson size ${i} + options.index ${n} must be <= buffer length ${e.byteLength})`);if(0!==e[n+i-1])throw new ft("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return function(e,t,r,n=!1){const i=null==(r={...r}).fieldsAsRaw?null:r.fieldsAsRaw,o=null!=r.raw&&r.raw,s="boolean"==typeof r.bsonRegExp&&r.bsonRegExp,a=r.promoteBuffers??!1,u=r.promoteLongs??!0,c=r.promoteValues??!0,l=r.useBigInt64??!1;if(l&&!c)throw new ft("Must either request bigint or Long for int64 deserialization");if(l&&!u)throw new ft("Must either request bigint or Long for int64 deserialization");let f,h,p=!0;const d=(null==r.validation?{utf8:!0}:r.validation).utf8;if("boolean"==typeof d)f=d;else{p=!1;const e=Object.keys(d).map(function(e){return d[e]});if(0===e.length)throw new ft("UTF-8 validation setting cannot be empty");if("boolean"!=typeof e[0])throw new ft("Invalid UTF-8 validation option, must specify boolean values");if(f=e[0],!e.every(e=>e===f))throw new ft("Invalid UTF-8 validation option - keys must be all true or all false")}if(!p){h=new Set;for(const e of Object.keys(d))h.add(e)}const y=t;if(e.length<5)throw new ft("corrupt bson message < 5 bytes long");const g=Rt.getInt32LE(e,t);if(t+=4,g<5||g>e.length)throw new ft("corrupt bson message");const m=n?[]:{};let b=0,v=!n&&null,w=null,_=m,E=n;for(;;){const r=e[t++];if(0===r){if(w){if(t===w.lastIndex){const e=w;w=e.prev,null===w?(_=m,E=n):(_=w.holdingDocument,E=w.isArray);let t=e.holdingDocument;switch(e.elementType){case 3:e.isPossibleDBRef&&(t=Sr(t));break;case 4:break;case 15:t=new Dt(e.functionString,e.holdingDocument);break;default:throw new ft("Unexpected element type in frame stack")}xr(_,e.propertyName,t);continue}if(4===w.elementType)throw new ft("corrupted array bson");throw new ft("Bad BSON Document: object not properly terminated")}break}let d=t;for(;0!==e[d]&&d=e.byteLength)throw new ft("Bad BSON Document: illegal CString");const y=E?null!==w?w.arrayIndex++:b++:Tt.toUTF8(e,t,d,!1);let g,x;g=null!==w?w.validationSetting:p||h?.has(y)?f:!f,null!==w?!1!==w.isPossibleDBRef&&"string"==typeof y&&"$"===y[0]&&(w.isPossibleDBRef=Er.test(y)):!1!==v&&"$"===y[0]&&(v=Er.test(y));let S=!1;if(t=d+1,2===r){const r=Rt.getInt32LE(e,t);if(t+=4,r<=0||r>e.length-t||0!==e[t+r-1])throw new ft("bad string length in bson");x=Tt.toUTF8(e,t,t+r-1,g),t+=r}else if(7===r){const r=Tt.allocateUnsafe(12);for(let n=0;n<12;n++)r[n]=e[t+n];x=new yr(r),t+=12}else if(16===r&&!1===c)x=new fr(Rt.getInt32LE(e,t)),t+=4;else if(16===r)x=Rt.getInt32LE(e,t),t+=4;else if(1===r)x=Rt.getFloat64LE(e,t),t+=8,!1===c&&(x=new lr(x));else if(9===r){const r=Rt.getInt32LE(e,t),n=Rt.getInt32LE(e,t+4);t+=8,x=new Date(new Yt(r,n).toNumber())}else if(8===r){if(0!==e[t]&&1!==e[t])throw new ft("illegal boolean type value");x=1===e[t++]}else if(3===r){const r=Rt.getInt32LE(e,t);if(r<5||r>e.length-t)throw new ft("bad embedded document length in bson");if(o||w?.raw)x=e.subarray(t,t+r),t+=r;else{S=!0;const e={holdingDocument:{},elementType:3,propertyName:y,functionString:null,lastIndex:t+r,isArray:!1,arrayIndex:0,raw:!1,isPossibleDBRef:null,validationSetting:g,prev:w};w=e,_=e.holdingDocument,E=!1,t+=4}}else if(4===r){const r=Rt.getInt32LE(e,t);if(r<5||r>e.length-t)throw new ft("bad embedded array length in bson");S=!0;const n={holdingDocument:[],elementType:4,propertyName:y,functionString:null,lastIndex:t+r,isArray:!0,arrayIndex:0,raw:!(!i||!i[y])||(w?.raw??!1),isPossibleDBRef:!1,validationSetting:g,prev:w};w=n,_=n.holdingDocument,E=!0,t+=4}else if(6===r)x=void 0;else if(10===r)x=null;else if(18===r)if(l)x=Rt.getBigInt64LE(e,t),t+=8;else{const r=Rt.getInt32LE(e,t),n=Rt.getInt32LE(e,t+4);t+=8;const i=new Yt(r,n);x=u&&!0===c&&i.lessThanOrEqual(wr)&&i.greaterThanOrEqual(_r)?i.toNumber():i}else if(19===r){const r=Tt.allocateUnsafe(16);for(let n=0;n<16;n++)r[n]=e[t+n];t+=16,x=new cr(r)}else if(5===r){let r=Rt.getInt32LE(e,t);t+=4;const n=r,i=e[t++];if(r<0)throw new ft("Negative binary type element size found");if(r>e.byteLength)throw new ft("Binary type size larger than document size");if(i===Lt.SUBTYPE_BYTE_ARRAY){if(r=Rt.getInt32LE(e,t),t+=4,r<0)throw new ft("Negative binary type element size found for subtype 0x02");if(r>n-4)throw new ft("Binary type with subtype 0x02 contains too long binary size");if(r=e.length)throw new ft("Bad BSON Document: illegal CString");const r=Tt.toUTF8(e,t,d,!1);for(d=t=d+1;0!==e[d]&&d=e.length)throw new ft("Bad BSON Document: illegal CString");const n=Tt.toUTF8(e,t,d,!1);t=d+1;const i=new Array(n.length);for(d=0;d=e.length)throw new ft("Bad BSON Document: illegal CString");const r=Tt.toUTF8(e,t,d,!1);for(d=t=d+1;0!==e[d]&&d=e.length)throw new ft("Bad BSON Document: illegal CString");const n=Tt.toUTF8(e,t,d,!1);t=d+1,x=new gr(r,n)}else if(14===r){const r=Rt.getInt32LE(e,t);if(t+=4,r<=0||r>e.length-t||0!==e[t+r-1])throw new ft("bad string length in bson");const n=Tt.toUTF8(e,t,t+r-1,g);x=c?n:new mr(n),t+=r}else if(17===r)x=new vr({i:Rt.getUint32LE(e,t),t:Rt.getUint32LE(e,t+4)}),t+=8;else if(255===r)x=new pr;else if(127===r)x=new hr;else if(13===r){const r=Rt.getInt32LE(e,t);if(t+=4,r<=0||r>e.length-t||0!==e[t+r-1])throw new ft("bad string length in bson");const n=Tt.toUTF8(e,t,t+r-1,g);x=new Dt(n),t+=r}else if(15===r){const r=Rt.getInt32LE(e,t);if(t+=4,r<13)throw new ft("code_w_scope total size shorter minimum expected length");const n=Rt.getInt32LE(e,t);if(t+=4,n<=0||n>e.length-t||0!==e[t+n-1])throw new ft("bad string length in bson");const i=Tt.toUTF8(e,t,t+n-1,g),o=t+=n,s=Rt.getInt32LE(e,t);if(s<5||s>e.length-t)throw new ft("bad scope document size in code_w_scope");if(r<8+s+n)throw new ft("code_w_scope total size is too short, truncating scope");if(r>8+s+n)throw new ft("code_w_scope total size is too long, clips outer document");S=!0;const a={holdingDocument:{},elementType:15,propertyName:y,functionString:i,lastIndex:o+s,isArray:!1,arrayIndex:0,raw:!1,isPossibleDBRef:null,validationSetting:g,prev:w};w=a,_=a.holdingDocument,E=!1,t+=4}else{if(12!==r)throw new ft(`Detected unknown BSON type ${r.toString(16)} for fieldname "${y}"`);{const r=Rt.getInt32LE(e,t);if(t+=4,r<=0||r>e.length-t||0!==e[t+r-1])throw new ft("bad string length in bson");const n=Tt.toUTF8(e,t,t+r-1,g);t+=r;const i=Tt.allocateUnsafe(12);for(let r=0;r<12;r++)i[r]=e[t+r];const o=new yr(i);t+=12,x=new $t(n,o)}}S||xr(_,y,x)}if(null!==w)throw new ft("corrupted bson, more objects expected based on the current document size");const x=m;if(g!==t-y){if(n)throw new ft("corrupt array bson");throw new ft("corrupt object bson")}return v?Sr(x):x}(e,n,t,r)}(Tt.toLocalBufferType(e),t)}function un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(un=function(){return!!e})()}const cn=function(e){function t(){var e,r,i,o;return n(this,t),r=this,i=c(i=t),(e=u(r,un()?Reflect.construct(i,[],c(r).constructor):i.apply(r,o))).name="BSON deserialise",e.module="Serialise",e.description="BSON is a computer data interchange format used mainly as a data storage and network transfer format in the MongoDB database. It is a binary form for representing simple data structures, associative arrays (called objects or documents in MongoDB), and various data types of specific interest to MongoDB. The name 'BSON' is based on the term JSON and stands for 'Binary JSON'.

Input data should be in a raw bytes format.",e.infoURL="https://wikipedia.org/wiki/BSON",e.inputType="ArrayBuffer",e.outputType="string",e.args=[],e}return f(t,e),a(t,[{key:"run",value:function(e,t){if(!e.byteLength)return"";try{var r=an(new Uint8Array(e));return JSON.stringify(r,null,2)}catch(e){throw new S(e.toString())}}}])}(qe);function ln(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ln=function(){return!!e})()}const fn=function(e){function t(){var e,r,i,o;return n(this,t),r=this,i=c(i=t),(e=u(r,ln()?Reflect.construct(i,[],c(r).constructor):i.apply(r,o))).name="BSON serialise",e.module="Serialise",e.description="BSON is a computer data interchange format used mainly as a data storage and network transfer format in the MongoDB database. It is a binary form for representing simple data structures, associative arrays (called objects or documents in MongoDB), and various data types of specific interest to MongoDB. The name 'BSON' is based on the term JSON and stands for 'Binary JSON'.

Input data should be valid JSON.",e.infoURL="https://wikipedia.org/wiki/BSON",e.inputType="string",e.outputType="ArrayBuffer",e.args=[],e}return f(t,e),a(t,[{key:"run",value:function(e,t){if(!e)return new ArrayBuffer;try{var r=sn(JSON.parse(e));return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}catch(e){throw new S(e.toString())}}}])}(qe);var hn=r(49881),pn=r.n(hn),dn=r(48287).Buffer;function yn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(yn=function(){return!!e})()}const gn=function(e){function t(){var e,r,i,o;return n(this,t),r=this,i=c(i=t),(e=u(r,yn()?Reflect.construct(i,[],c(r).constructor):i.apply(r,o))).name="CBOR Decode",e.module="Serialise",e.description="Concise Binary Object Representation (CBOR) is a binary data serialization format loosely based on JSON. Like JSON it allows the transmission of data objects that contain name–value pairs, but in a more concise manner. This increases processing and transfer speeds at the cost of human readability. It is defined in IETF RFC 8949.",e.infoURL="https://wikipedia.org/wiki/CBOR",e.inputType="ArrayBuffer",e.outputType="JSON",e.args=[],e}return f(t,e),a(t,[{key:"run",value:function(e,t){return pn().decodeFirstSync(dn.from(e).toString("hex"))}}])}(qe);function mn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mn=function(){return!!e})()}const bn=function(e){function t(){var e,r,i,o;return n(this,t),r=this,i=c(i=t),(e=u(r,mn()?Reflect.construct(i,[],c(r).constructor):i.apply(r,o))).name="CBOR Encode",e.module="Serialise",e.description="Concise Binary Object Representation (CBOR) is a binary data serialization format loosely based on JSON. Like JSON it allows the transmission of data objects that contain name–value pairs, but in a more concise manner. This increases processing and transfer speeds at the cost of human readability. It is defined in IETF RFC 8949.",e.infoURL="https://wikipedia.org/wiki/CBOR",e.inputType="JSON",e.outputType="ArrayBuffer",e.args=[],e}return f(t,e),a(t,[{key:"run",value:function(e,t){return new Uint8Array(pn().encodeCanonical(e)).buffer}}])}(qe);function vn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(vn=function(){return!!e})()}const wn=function(e){function t(){var e,r,i,o;return n(this,t),r=this,i=c(i=t),(e=u(r,vn()?Reflect.construct(i,[],c(r).constructor):i.apply(r,o))).name="Parse ObjectID timestamp",e.module="Serialise",e.description="Parse timestamp from MongoDB/BSON ObjectID hex string.",e.infoURL="https://docs.mongodb.com/manual/reference/method/ObjectId.getTimestamp/",e.inputType="string",e.outputType="string",e.args=[],e}return f(t,e),a(t,[{key:"run",value:function(e,t){try{return new yr(e).getTimestamp().toISOString()}catch(e){throw new S(e)}}}])}(qe);("undefined"==typeof self?{}:self.OpModules||{}).Serialise={"Avro to JSON":Je,"BSON deserialise":cn,"BSON serialise":fn,"CBOR Decode":gn,"CBOR Encode":bn,"Parse ObjectID timestamp":wn}})()})();