@loaders.gl/parquet 3.4.13 → 3.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -9,7 +9,7 @@
9
9
  `))):s=t.stylize("[Circular]","special")),Xi(f)){if(o&&i.match(/^\d+$/))return s;f=JSON.stringify(""+i),f.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(f=f.substr(1,f.length-2),f=t.stylize(f,"name")):(f=f.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),f=t.stylize(f,"string"))}return f+": "+s}function J2(t,e,r){var n=t.reduce(function(i,o){return o.indexOf(`
10
10
  `)>=0,i+o.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(e===""?"":e+`
11
11
  `)+" "+t.join(`,
12
- `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Gv(t){return Array.isArray(t)}function _h(t){return typeof t=="boolean"}function yp(t){return t===null}function Z2(t){return t==null}function Jv(t){return typeof t=="number"}function jp(t){return typeof t=="string"}function X2(t){return babelHelpers.typeof(t)==="symbol"}function Xi(t){return t===void 0}function _p(t){return Gs(t)&&vh(t)==="[object RegExp]"}function Gs(t){return babelHelpers.typeof(t)==="object"&&t!==null}function qh(t){return Gs(t)&&vh(t)==="[object Date]"}function qp(t){return Gs(t)&&(vh(t)==="[object Error]"||t instanceof Error)}function vp(t){return typeof t=="function"}function Q2(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||babelHelpers.typeof(t)==="symbol"||typeof t=="undefined"}function $2(t){return Buffer.isBuffer(t)}function vh(t){return Object.prototype.toString.call(t)}function Th(t){return t<10?"0"+t.toString(10):t.toString(10)}function tN(){var t=new Date,e=[Th(t.getHours()),Th(t.getMinutes()),Th(t.getSeconds())].join(":");return[t.getDate(),eN[t.getMonth()],e].join(" ")}function rN(){console.log("%s - %s",tN(),wh.apply(null,arguments))}function Zv(t,e){if(!e||!Gs(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function Xv(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var hp,S2,x2,E2,di,gn,A2,dh,Kf,Wv,mh,z2,H2,Ks,ye,M8,U8,L8,C8,Mo,V8,bh,W8,ln,Y8,Uo,K8,M2,hh,U2,L2,wp,gh,eN,nN,_t,G8,J8,Z8,X8,Q8,$8,eC,tC,rC,nC,Kn,iC,oC,Se,fC,Js,sC,Gf,aC,Jf,lC,Tp,cC,Zs,pC,Xs,dC,Qi,mC,G,bC,hC,wC,gC,yC,jC,_C,qC,vC,TC,BC,kC,IC,SC,xC,EC,AC,OC,NC,DC,FC,PC,RC,zC,HC,MC,UC,LC,CC,VC,WC,YC,KC,GC,Bh,JC,Lo,ZC,Qs,XC,Co,QC,$C,Bp,eV,kp,tV,Kl,rV,nV,Gl,iV,oV,Ip,fV,xe,sV,aV,lV,Qv,uV,$v,cV,pV,dV,mV,bV,hV,wV,gV,yV,jV,_V,qV,vV,TV,BV,kV,IV,SV,xV,EV,AV,OV,NV,DV,FV,PV,RV,zV,HV,MV,UV,LV,CV,VV,WV,YV,KV,GV,JV,ZV,XV,QV,$V,e5,t5,r5,n5,i5,o5,f5,s5,a5,kh=re(()=>{hp=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};S2=O2,x2=D2,E2=R2,di=[],gn=[],A2=typeof Uint8Array!="undefined"?Uint8Array:Array,dh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Kf=0,Wv=dh.length;Kf<Wv;++Kf)di[Kf]=dh[Kf],gn[dh.charCodeAt(Kf)]=Kf;gn["-".charCodeAt(0)]=62;gn["_".charCodeAt(0)]=63;mh={byteLength:S2,toByteArray:x2,fromByteArray:E2},z2=function(e,r,n,i,o){var f,s,a=o*8-i-1,u=(1<<a)-1,c=u>>1,_=-7,p=n?o-1:0,j=n?-1:1,S=e[r+p];for(p+=j,f=S&(1<<-_)-1,S>>=-_,_+=a;_>0;f=f*256+e[r+p],p+=j,_-=8);for(s=f&(1<<-_)-1,f>>=-_,_+=i;_>0;s=s*256+e[r+p],p+=j,_-=8);if(f===0)f=1-c;else{if(f===u)return s?NaN:(S?-1:1)*(1/0);s=s+Math.pow(2,i),f=f-c}return(S?-1:1)*s*Math.pow(2,f-i)},H2=function(e,r,n,i,o,f){var s,a,u,c=f*8-o-1,_=(1<<c)-1,p=_>>1,j=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=i?0:f-1,T=i?1:-1,U=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,s=_):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+p>=1?r+=j/u:r+=j*Math.pow(2,1-p),r*u>=2&&(s++,u/=2),s+p>=_?(a=0,s=_):s+p>=1?(a=(r*u-1)*Math.pow(2,o),s=s+p):(a=r*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;e[n+S]=a&255,S+=T,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+S]=s&255,S+=T,s/=256,c-=8);e[n+S-T]|=U*128},Ks={read:z2,write:H2},ye=Ft(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=U,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,f.TYPED_ARRAY_SUPPORT=i(),!f.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var q=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(q,d),q.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(!!f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(!!f.isBuffer(this))return this.byteOffset}});function o(q){if(q>n)throw new RangeError('The value "'+q+'" is invalid for option "size"');var d=new Uint8Array(q);return Object.setPrototypeOf(d,f.prototype),d}function f(q,d,m){if(typeof q=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(q)}return s(q,d,m)}f.poolSize=8192;function s(q,d,m){if(typeof q=="string")return _(q,d);if(ArrayBuffer.isView(q))return p(q);if(q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(q));if(Ke(q,ArrayBuffer)||q&&Ke(q.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ke(q,SharedArrayBuffer)||q&&Ke(q.buffer,SharedArrayBuffer)))return j(q,d,m);if(typeof q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var B=q.valueOf&&q.valueOf();if(B!=null&&B!==q)return f.from(B,d,m);var R=S(q);if(R)return R;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof q[Symbol.toPrimitive]=="function")return f.from(q[Symbol.toPrimitive]("string"),d,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(q))}f.from=function(q,d,m){return s(q,d,m)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function a(q){if(typeof q!="number")throw new TypeError('"size" argument must be of type number');if(q<0)throw new RangeError('The value "'+q+'" is invalid for option "size"')}function u(q,d,m){return a(q),q<=0?o(q):d!==void 0?typeof m=="string"?o(q).fill(d,m):o(q).fill(d):o(q)}f.alloc=function(q,d,m){return u(q,d,m)};function c(q){return a(q),o(q<0?0:T(q)|0)}f.allocUnsafe=function(q){return c(q)},f.allocUnsafeSlow=function(q){return c(q)};function _(q,d){if((typeof d!="string"||d==="")&&(d="utf8"),!f.isEncoding(d))throw new TypeError("Unknown encoding: "+d);var m=W(q,d)|0,B=o(m),R=B.write(q,d);return R!==m&&(B=B.slice(0,R)),B}function p(q){for(var d=q.length<0?0:T(q.length)|0,m=o(d),B=0;B<d;B+=1)m[B]=q[B]&255;return m}function j(q,d,m){if(d<0||q.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(q.byteLength<d+(m||0))throw new RangeError('"length" is outside of buffer bounds');var B;return d===void 0&&m===void 0?B=new Uint8Array(q):m===void 0?B=new Uint8Array(q,d):B=new Uint8Array(q,d,m),Object.setPrototypeOf(B,f.prototype),B}function S(q){if(f.isBuffer(q)){var d=T(q.length)|0,m=o(d);return m.length===0||q.copy(m,0,0,d),m}if(q.length!==void 0)return typeof q.length!="number"||Ht(q.length)?o(0):p(q);if(q.type==="Buffer"&&Array.isArray(q.data))return p(q.data)}function T(q){if(q>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return q|0}function U(q){return+q!=q&&(q=0),f.alloc(+q)}f.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==f.prototype},f.compare=function(d,m){if(Ke(d,Uint8Array)&&(d=f.from(d,d.offset,d.byteLength)),Ke(m,Uint8Array)&&(m=f.from(m,m.offset,m.byteLength)),!f.isBuffer(d)||!f.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===m)return 0;for(var B=d.length,R=m.length,fe=0,se=Math.min(B,R);fe<se;++fe)if(d[fe]!==m[fe]){B=d[fe],R=m[fe];break}return B<R?-1:R<B?1:0},f.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(d,m){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return f.alloc(0);var B;if(m===void 0)for(m=0,B=0;B<d.length;++B)m+=d[B].length;var R=f.allocUnsafe(m),fe=0;for(B=0;B<d.length;++B){var se=d[B];if(Ke(se,Uint8Array)&&(se=f.from(se)),!f.isBuffer(se))throw new TypeError('"list" argument must be an Array of Buffers');se.copy(R,fe),fe+=se.length}return R};function W(q,d){if(f.isBuffer(q))return q.length;if(ArrayBuffer.isView(q)||Ke(q,ArrayBuffer))return q.byteLength;if(typeof q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(q));var m=q.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&m===0)return 0;for(var R=!1;;)switch(d){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return _e(q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return So(q).length;default:if(R)return B?-1:_e(q).length;d=(""+d).toLowerCase(),R=!0}}f.byteLength=W;function L(q,d,m){var B=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,d>>>=0,m<=d))return"";for(q||(q="utf8");;)switch(q){case"hex":return A(this,d,m);case"utf8":case"utf-8":return b(this,d,m);case"ascii":return M(this,d,m);case"latin1":case"binary":return oe(this,d,m);case"base64":return N(this,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,d,m);default:if(B)throw new TypeError("Unknown encoding: "+q);q=(q+"").toLowerCase(),B=!0}}f.prototype._isBuffer=!0;function te(q,d,m){var B=q[d];q[d]=q[m],q[m]=B}f.prototype.swap16=function(){var d=this.length;if(d%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var m=0;m<d;m+=2)te(this,m,m+1);return this},f.prototype.swap32=function(){var d=this.length;if(d%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var m=0;m<d;m+=4)te(this,m,m+3),te(this,m+1,m+2);return this},f.prototype.swap64=function(){var d=this.length;if(d%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var m=0;m<d;m+=8)te(this,m,m+7),te(this,m+1,m+6),te(this,m+2,m+5),te(this,m+3,m+4);return this},f.prototype.toString=function(){var d=this.length;return d===0?"":arguments.length===0?b(this,0,d):L.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(d){if(!f.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:f.compare(this,d)===0},f.prototype.inspect=function(){var d="",m=e.INSPECT_MAX_BYTES;return d=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(d+=" ... "),"<Buffer "+d+">"},r&&(f.prototype[r]=f.prototype.inspect),f.prototype.compare=function(d,m,B,R,fe){if(Ke(d,Uint8Array)&&(d=f.from(d,d.offset,d.byteLength)),!f.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(d));if(m===void 0&&(m=0),B===void 0&&(B=d?d.length:0),R===void 0&&(R=0),fe===void 0&&(fe=this.length),m<0||B>d.length||R<0||fe>this.length)throw new RangeError("out of range index");if(R>=fe&&m>=B)return 0;if(R>=fe)return-1;if(m>=B)return 1;if(m>>>=0,B>>>=0,R>>>=0,fe>>>=0,this===d)return 0;for(var se=fe-R,nt=B-m,Ze=Math.min(se,nt),Tt=this.slice(R,fe),hr=d.slice(m,B),ke=0;ke<Ze;++ke)if(Tt[ke]!==hr[ke]){se=Tt[ke],nt=hr[ke];break}return se<nt?-1:nt<se?1:0};function pe(q,d,m,B,R){if(q.length===0)return-1;if(typeof m=="string"?(B=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ht(m)&&(m=R?0:q.length-1),m<0&&(m=q.length+m),m>=q.length){if(R)return-1;m=q.length-1}else if(m<0)if(R)m=0;else return-1;if(typeof d=="string"&&(d=f.from(d,B)),f.isBuffer(d))return d.length===0?-1:J(q,d,m,B,R);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(q,d,m):Uint8Array.prototype.lastIndexOf.call(q,d,m):J(q,[d],m,B,R);throw new TypeError("val must be string, number or Buffer")}function J(q,d,m,B,R){var fe=1,se=q.length,nt=d.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(q.length<2||d.length<2)return-1;fe=2,se/=2,nt/=2,m/=2}function Ze(v,I){return fe===1?v[I]:v.readUInt16BE(I*fe)}var Tt;if(R){var hr=-1;for(Tt=m;Tt<se;Tt++)if(Ze(q,Tt)===Ze(d,hr===-1?0:Tt-hr)){if(hr===-1&&(hr=Tt),Tt-hr+1===nt)return hr*fe}else hr!==-1&&(Tt-=Tt-hr),hr=-1}else for(m+nt>se&&(m=se-nt),Tt=m;Tt>=0;Tt--){for(var ke=!0,Cn=0;Cn<nt;Cn++)if(Ze(q,Tt+Cn)!==Ze(d,Cn)){ke=!1;break}if(ke)return Tt}return-1}f.prototype.includes=function(d,m,B){return this.indexOf(d,m,B)!==-1},f.prototype.indexOf=function(d,m,B){return pe(this,d,m,B,!0)},f.prototype.lastIndexOf=function(d,m,B){return pe(this,d,m,B,!1)};function D(q,d,m,B){m=Number(m)||0;var R=q.length-m;B?(B=Number(B),B>R&&(B=R)):B=R;var fe=d.length;B>fe/2&&(B=fe/2);for(var se=0;se<B;++se){var nt=parseInt(d.substr(se*2,2),16);if(Ht(nt))return se;q[m+se]=nt}return se}function le(q,d,m,B){return St(_e(d,q.length-m),q,m,B)}function Y(q,d,m,B){return St($(d),q,m,B)}function de(q,d,m,B){return Y(q,d,m,B)}function y(q,d,m,B){return St(So(d),q,m,B)}function g(q,d,m,B){return St(Io(d,q.length-m),q,m,B)}f.prototype.write=function(d,m,B,R){if(m===void 0)R="utf8",B=this.length,m=0;else if(B===void 0&&typeof m=="string")R=m,B=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(B)?(B=B>>>0,R===void 0&&(R="utf8")):(R=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var fe=this.length-m;if((B===void 0||B>fe)&&(B=fe),d.length>0&&(B<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");R||(R="utf8");for(var se=!1;;)switch(R){case"hex":return D(this,d,m,B);case"utf8":case"utf-8":return le(this,d,m,B);case"ascii":return Y(this,d,m,B);case"latin1":case"binary":return de(this,d,m,B);case"base64":return y(this,d,m,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,d,m,B);default:if(se)throw new TypeError("Unknown encoding: "+R);R=(""+R).toLowerCase(),se=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(q,d,m){return d===0&&m===q.length?mh.fromByteArray(q):mh.fromByteArray(q.slice(d,m))}function b(q,d,m){m=Math.min(q.length,m);for(var B=[],R=d;R<m;){var fe=q[R],se=null,nt=fe>239?4:fe>223?3:fe>191?2:1;if(R+nt<=m){var Ze,Tt,hr,ke;switch(nt){case 1:fe<128&&(se=fe);break;case 2:Ze=q[R+1],(Ze&192)==128&&(ke=(fe&31)<<6|Ze&63,ke>127&&(se=ke));break;case 3:Ze=q[R+1],Tt=q[R+2],(Ze&192)==128&&(Tt&192)==128&&(ke=(fe&15)<<12|(Ze&63)<<6|Tt&63,ke>2047&&(ke<55296||ke>57343)&&(se=ke));break;case 4:Ze=q[R+1],Tt=q[R+2],hr=q[R+3],(Ze&192)==128&&(Tt&192)==128&&(hr&192)==128&&(ke=(fe&15)<<18|(Ze&63)<<12|(Tt&63)<<6|hr&63,ke>65535&&ke<1114112&&(se=ke))}}se===null?(se=65533,nt=1):se>65535&&(se-=65536,B.push(se>>>10&1023|55296),se=56320|se&1023),B.push(se),R+=nt}return K(B)}var z=4096;function K(q){var d=q.length;if(d<=z)return String.fromCharCode.apply(String,q);for(var m="",B=0;B<d;)m+=String.fromCharCode.apply(String,q.slice(B,B+=z));return m}function M(q,d,m){var B="";m=Math.min(q.length,m);for(var R=d;R<m;++R)B+=String.fromCharCode(q[R]&127);return B}function oe(q,d,m){var B="";m=Math.min(q.length,m);for(var R=d;R<m;++R)B+=String.fromCharCode(q[R]);return B}function A(q,d,m){var B=q.length;(!d||d<0)&&(d=0),(!m||m<0||m>B)&&(m=B);for(var R="",fe=d;fe<m;++fe)R+=bt[q[fe]];return R}function Ye(q,d,m){for(var B=q.slice(d,m),R="",fe=0;fe<B.length;fe+=2)R+=String.fromCharCode(B[fe]+B[fe+1]*256);return R}f.prototype.slice=function(d,m){var B=this.length;d=~~d,m=m===void 0?B:~~m,d<0?(d+=B,d<0&&(d=0)):d>B&&(d=B),m<0?(m+=B,m<0&&(m=0)):m>B&&(m=B),m<d&&(m=d);var R=this.subarray(d,m);return Object.setPrototypeOf(R,f.prototype),R};function me(q,d,m){if(q%1!=0||q<0)throw new RangeError("offset is not uint");if(q+d>m)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=this[d],fe=1,se=0;++se<m&&(fe*=256);)R+=this[d+se]*fe;return R},f.prototype.readUIntBE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=this[d+--m],fe=1;m>0&&(fe*=256);)R+=this[d+--m]*fe;return R},f.prototype.readUInt8=function(d,m){return d=d>>>0,m||me(d,1,this.length),this[d]},f.prototype.readUInt16LE=function(d,m){return d=d>>>0,m||me(d,2,this.length),this[d]|this[d+1]<<8},f.prototype.readUInt16BE=function(d,m){return d=d>>>0,m||me(d,2,this.length),this[d]<<8|this[d+1]},f.prototype.readUInt32LE=function(d,m){return d=d>>>0,m||me(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},f.prototype.readUInt32BE=function(d,m){return d=d>>>0,m||me(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},f.prototype.readIntLE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=this[d],fe=1,se=0;++se<m&&(fe*=256);)R+=this[d+se]*fe;return fe*=128,R>=fe&&(R-=Math.pow(2,8*m)),R},f.prototype.readIntBE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=m,fe=1,se=this[d+--R];R>0&&(fe*=256);)se+=this[d+--R]*fe;return fe*=128,se>=fe&&(se-=Math.pow(2,8*m)),se},f.prototype.readInt8=function(d,m){return d=d>>>0,m||me(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},f.prototype.readInt16LE=function(d,m){d=d>>>0,m||me(d,2,this.length);var B=this[d]|this[d+1]<<8;return B&32768?B|4294901760:B},f.prototype.readInt16BE=function(d,m){d=d>>>0,m||me(d,2,this.length);var B=this[d+1]|this[d]<<8;return B&32768?B|4294901760:B},f.prototype.readInt32LE=function(d,m){return d=d>>>0,m||me(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},f.prototype.readInt32BE=function(d,m){return d=d>>>0,m||me(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},f.prototype.readFloatLE=function(d,m){return d=d>>>0,m||me(d,4,this.length),Ks.read(this,d,!0,23,4)},f.prototype.readFloatBE=function(d,m){return d=d>>>0,m||me(d,4,this.length),Ks.read(this,d,!1,23,4)},f.prototype.readDoubleLE=function(d,m){return d=d>>>0,m||me(d,8,this.length),Ks.read(this,d,!0,52,8)},f.prototype.readDoubleBE=function(d,m){return d=d>>>0,m||me(d,8,this.length),Ks.read(this,d,!1,52,8)};function V(q,d,m,B,R,fe){if(!f.isBuffer(q))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>R||d<fe)throw new RangeError('"value" argument is out of bounds');if(m+B>q.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(d,m,B,R){if(d=+d,m=m>>>0,B=B>>>0,!R){var fe=Math.pow(2,8*B)-1;V(this,d,m,B,fe,0)}var se=1,nt=0;for(this[m]=d&255;++nt<B&&(se*=256);)this[m+nt]=d/se&255;return m+B},f.prototype.writeUIntBE=function(d,m,B,R){if(d=+d,m=m>>>0,B=B>>>0,!R){var fe=Math.pow(2,8*B)-1;V(this,d,m,B,fe,0)}var se=B-1,nt=1;for(this[m+se]=d&255;--se>=0&&(nt*=256);)this[m+se]=d/nt&255;return m+B},f.prototype.writeUInt8=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,1,255,0),this[m]=d&255,m+1},f.prototype.writeUInt16LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,65535,0),this[m]=d&255,this[m+1]=d>>>8,m+2},f.prototype.writeUInt16BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,65535,0),this[m]=d>>>8,this[m+1]=d&255,m+2},f.prototype.writeUInt32LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,4294967295,0),this[m+3]=d>>>24,this[m+2]=d>>>16,this[m+1]=d>>>8,this[m]=d&255,m+4},f.prototype.writeUInt32BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,4294967295,0),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4},f.prototype.writeIntLE=function(d,m,B,R){if(d=+d,m=m>>>0,!R){var fe=Math.pow(2,8*B-1);V(this,d,m,B,fe-1,-fe)}var se=0,nt=1,Ze=0;for(this[m]=d&255;++se<B&&(nt*=256);)d<0&&Ze===0&&this[m+se-1]!==0&&(Ze=1),this[m+se]=(d/nt>>0)-Ze&255;return m+B},f.prototype.writeIntBE=function(d,m,B,R){if(d=+d,m=m>>>0,!R){var fe=Math.pow(2,8*B-1);V(this,d,m,B,fe-1,-fe)}var se=B-1,nt=1,Ze=0;for(this[m+se]=d&255;--se>=0&&(nt*=256);)d<0&&Ze===0&&this[m+se+1]!==0&&(Ze=1),this[m+se]=(d/nt>>0)-Ze&255;return m+B},f.prototype.writeInt8=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,1,127,-128),d<0&&(d=255+d+1),this[m]=d&255,m+1},f.prototype.writeInt16LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,32767,-32768),this[m]=d&255,this[m+1]=d>>>8,m+2},f.prototype.writeInt16BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,32767,-32768),this[m]=d>>>8,this[m+1]=d&255,m+2},f.prototype.writeInt32LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,2147483647,-2147483648),this[m]=d&255,this[m+1]=d>>>8,this[m+2]=d>>>16,this[m+3]=d>>>24,m+4},f.prototype.writeInt32BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4};function X(q,d,m,B,R,fe){if(m+B>q.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function He(q,d,m,B,R){return d=+d,m=m>>>0,R||X(q,d,m,4),Ks.write(q,d,m,B,23,4),m+4}f.prototype.writeFloatLE=function(d,m,B){return He(this,d,m,!0,B)},f.prototype.writeFloatBE=function(d,m,B){return He(this,d,m,!1,B)};function we(q,d,m,B,R){return d=+d,m=m>>>0,R||X(q,d,m,8),Ks.write(q,d,m,B,52,8),m+8}f.prototype.writeDoubleLE=function(d,m,B){return we(this,d,m,!0,B)},f.prototype.writeDoubleBE=function(d,m,B){return we(this,d,m,!1,B)},f.prototype.copy=function(d,m,B,R){if(!f.isBuffer(d))throw new TypeError("argument should be a Buffer");if(B||(B=0),!R&&R!==0&&(R=this.length),m>=d.length&&(m=d.length),m||(m=0),R>0&&R<B&&(R=B),R===B||d.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("sourceEnd out of bounds");R>this.length&&(R=this.length),d.length-m<R-B&&(R=d.length-m+B);var fe=R-B;if(this===d&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(m,B,R);else if(this===d&&B<m&&m<R)for(var se=fe-1;se>=0;--se)d[se+m]=this[se+B];else Uint8Array.prototype.set.call(d,this.subarray(B,R),m);return fe},f.prototype.fill=function(d,m,B,R){if(typeof d=="string"){if(typeof m=="string"?(R=m,m=0,B=this.length):typeof B=="string"&&(R=B,B=this.length),R!==void 0&&typeof R!="string")throw new TypeError("encoding must be a string");if(typeof R=="string"&&!f.isEncoding(R))throw new TypeError("Unknown encoding: "+R);if(d.length===1){var fe=d.charCodeAt(0);(R==="utf8"&&fe<128||R==="latin1")&&(d=fe)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(m<0||this.length<m||this.length<B)throw new RangeError("Out of range index");if(B<=m)return this;m=m>>>0,B=B===void 0?this.length:B>>>0,d||(d=0);var se;if(typeof d=="number")for(se=m;se<B;++se)this[se]=d;else{var nt=f.isBuffer(d)?d:f.from(d,R),Ze=nt.length;if(Ze===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(se=0;se<B-m;++se)this[se+m]=nt[se%Ze]}return this};var rt=/[^+/0-9A-Za-z-_]/g;function Ir(q){if(q=q.split("=")[0],q=q.trim().replace(rt,""),q.length<2)return"";for(;q.length%4!=0;)q=q+"=";return q}function _e(q,d){d=d||1/0;for(var m,B=q.length,R=null,fe=[],se=0;se<B;++se){if(m=q.charCodeAt(se),m>55295&&m<57344){if(!R){if(m>56319){(d-=3)>-1&&fe.push(239,191,189);continue}else if(se+1===B){(d-=3)>-1&&fe.push(239,191,189);continue}R=m;continue}if(m<56320){(d-=3)>-1&&fe.push(239,191,189),R=m;continue}m=(R-55296<<10|m-56320)+65536}else R&&(d-=3)>-1&&fe.push(239,191,189);if(R=null,m<128){if((d-=1)<0)break;fe.push(m)}else if(m<2048){if((d-=2)<0)break;fe.push(m>>6|192,m&63|128)}else if(m<65536){if((d-=3)<0)break;fe.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((d-=4)<0)break;fe.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return fe}function $(q){for(var d=[],m=0;m<q.length;++m)d.push(q.charCodeAt(m)&255);return d}function Io(q,d){for(var m,B,R,fe=[],se=0;se<q.length&&!((d-=2)<0);++se)m=q.charCodeAt(se),B=m>>8,R=m%256,fe.push(R),fe.push(B);return fe}function So(q){return mh.toByteArray(Ir(q))}function St(q,d,m,B){for(var R=0;R<B&&!(R+m>=d.length||R>=q.length);++R)d[R+m]=q[R];return R}function Ke(q,d){return q instanceof d||q!=null&&q.constructor!=null&&q.constructor.name!=null&&q.constructor.name===d.name}function Ht(q){return q!==q}var bt=function(){for(var q="0123456789abcdef",d=new Array(256),m=0;m<16;++m)for(var B=m*16,R=0;R<16;++R)d[B+R]=q[m]+q[R];return d}()}),M8=ye.Buffer,U8=ye.SlowBuffer,L8=ye.INSPECT_MAX_BYTES,C8=ye.kMaxLength,Mo=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ensureBuffer=void 0;function r(n){if(ye.Buffer.isBuffer(n))return n;if(ArrayBuffer.isView(n))return ye.Buffer.from(n.buffer);if(n instanceof ArrayBuffer)return ye.Buffer.from(n);throw new TypeError("Must use either Buffer or TypedArray")}e.ensureBuffer=r});Ut(Mo);V8=Mo.ensureBuffer,bh=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseUUID=void 0;let r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function n(i){if(typeof i!="string")throw new TypeError("Invalid type for UUID, expected string but got "+typeof i);if(!r.test(i))throw new TypeError("Invalid format for UUID: "+i);let o,f=new Uint8Array(16);return f[0]=(o=parseInt(i.slice(0,8),16))>>>24,f[1]=o>>>16&255,f[2]=o>>>8&255,f[3]=o&255,f[4]=(o=parseInt(i.slice(9,13),16))>>>8,f[5]=o&255,f[6]=(o=parseInt(i.slice(14,18),16))>>>8,f[7]=o&255,f[8]=(o=parseInt(i.slice(19,23),16))>>>8,f[9]=o&255,f[10]=(o=parseInt(i.slice(24,36),16))/1099511627776&255,f[11]=o/4294967296&255,f[12]=o>>>24&255,f[13]=o>>>16&255,f[14]=o>>>8&255,f[15]=o&255,f}e.parseUUID=n});Ut(bh);W8=bh.parseUUID,ln=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binary=void 0;class r{constructor(i,o){if(i!=null&&typeof i!="string"&&!ArrayBuffer.isView(i)&&!(i instanceof ArrayBuffer)&&!Array.isArray(i))throw new TypeError("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=o??r.BSON_BINARY_SUBTYPE_DEFAULT,i==null?(this.buffer=ye.Buffer.alloc(r.BUFFER_SIZE),this.position=0):(typeof i=="string"?this.buffer=ye.Buffer.from(i,"binary"):Array.isArray(i)?this.buffer=ye.Buffer.from(i):this.buffer=Mo.ensureBuffer(i),this.position=this.buffer.byteLength)}put(i){if(typeof i=="string"&&i.length!==1)throw new TypeError("only accepts single character String");if(typeof i!="number"&&i.length!==1)throw new TypeError("only accepts single character Uint8Array or Array");let o;if(typeof i=="string"?o=i.charCodeAt(0):typeof i=="number"?o=i:o=i[0],o<0||o>255)throw new TypeError("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=o;else{let f=ye.Buffer.alloc(r.BUFFER_SIZE+this.buffer.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f,this.buffer[this.position++]=o}}write(i,o){if(o=typeof o=="number"?o:this.position,this.buffer.length<o+i.length){let f=ye.Buffer.alloc(this.buffer.length+i.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f}ArrayBuffer.isView(i)?(this.buffer.set(Mo.ensureBuffer(i),o),this.position=o+i.byteLength>this.position?o+i.length:this.position):typeof i=="string"&&(this.buffer.write(i,o,i.length,"binary"),this.position=o+i.length>this.position?o+i.length:this.position)}read(i,o){return o=o&&o>0?o:this.position,this.buffer.slice(i,i+o)}value(i){return i=!!i,i&&this.buffer.length===this.position?this.buffer:i?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)}length(){return this.position}toJSON(){return this.buffer.toString("base64")}toString(i){return this.buffer.toString(i)}toExtendedJSON(i){i=i||{};let o=this.buffer.toString("base64"),f=Number(this.sub_type).toString(16);return i.legacy?{$binary:o,$type:f.length===1?"0"+f:f}:{$binary:{base64:o,subType:f.length===1?"0"+f:f}}}static fromExtendedJSON(i,o){o=o||{};let f,s;if("$binary"in i?o.legacy&&typeof i.$binary=="string"&&"$type"in i?(s=i.$type?parseInt(i.$type,16):0,f=ye.Buffer.from(i.$binary,"base64")):typeof i.$binary!="string"&&(s=i.$binary.subType?parseInt(i.$binary.subType,16):0,f=ye.Buffer.from(i.$binary.base64,"base64")):"$uuid"in i&&(s=4,f=ye.Buffer.from(bh.parseUUID(i.$uuid))),!f)throw new TypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(i)}`);return new r(f,s)}}e.Binary=r,r.BSON_BINARY_SUBTYPE_DEFAULT=0,r.BUFFER_SIZE=256,r.SUBTYPE_DEFAULT=0,r.SUBTYPE_FUNCTION=1,r.SUBTYPE_BYTE_ARRAY=2,r.SUBTYPE_UUID_OLD=3,r.SUBTYPE_UUID=4,r.SUBTYPE_MD5=5,r.SUBTYPE_USER_DEFINED=128,Object.defineProperty(r.prototype,"_bsontype",{value:"Binary"})});Ut(ln);Y8=ln.Binary,Uo=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Code=void 0;class r{constructor(i,o){this.code=i,this.scope=o}toJSON(){return{code:this.code,scope:this.scope}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(i){return new r(i.$code,i.$scope)}}e.Code=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Code"})});Ut(Uo);K8=Uo.Code,M2={};typeof Object.create=="function"?hh=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:hh=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};U2=hh,L2=/%[sdj%]/g;wp={};Zi.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]};Zi.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};eN=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];nN={inherits:U2,_extend:Zv,log:rN,isBuffer:$2,isPrimitive:Q2,isFunction:vp,isError:qp,isDate:qh,isObject:Gs,isRegExp:_p,isUndefined:Xi,isSymbol:X2,isString:jp,isNumber:Jv,isNullOrUndefined:Z2,isNull:yp,isBoolean:_h,isArray:Gv,inspect:Zi,deprecate:Kv,format:wh,debuglog:C2},_t=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deprecate=e.isObjectLike=e.isDate=e.isBuffer=e.haveBuffer=e.isBigUInt64Array=e.isBigInt64Array=e.isUint8Array=e.randomBytes=e.normalizedFunctionString=void 0;function r(p){return p.toString().replace("function(","function (")}e.normalizedFunctionString=r;function n(p){let j=ye.Buffer.alloc(p);for(let S=0;S<p;++S)j[S]=Math.floor(Math.random()*256);return j}if(e.randomBytes=n,typeof window!="undefined"&&window.crypto&&window.crypto.getRandomValues)e.randomBytes=p=>window.crypto.getRandomValues(ye.Buffer.alloc(p));else{try{e.randomBytes=M2.randomBytes}catch{}e.randomBytes==null&&(e.randomBytes=n)}function i(p){return Object.prototype.toString.call(p)==="[object Uint8Array]"}e.isUint8Array=i;function o(p){return Object.prototype.toString.call(p)==="[object BigInt64Array]"}e.isBigInt64Array=o;function f(p){return Object.prototype.toString.call(p)==="[object BigUint64Array]"}e.isBigUInt64Array=f;function s(){return typeof hp!="undefined"&&typeof hp.Buffer!="undefined"}e.haveBuffer=s;function a(p){return s()&&ye.Buffer.isBuffer(p)}e.isBuffer=a;function u(p){return c(p)&&Object.prototype.toString.call(p)==="[object Date]"}e.isDate=u;function c(p){return typeof p=="object"&&p!==null}e.isObjectLike=c;function _(p,j){if(typeof window=="undefined"||typeof self=="undefined")return nN.deprecate(p,j);let S=!1;function T(...U){return S||(console.warn(j),S=!0),p.apply(this,...U)}return T}e.deprecate=_});Ut(_t);G8=_t.deprecate,J8=_t.isObjectLike,Z8=_t.isDate,X8=_t.isBuffer,Q8=_t.haveBuffer,$8=_t.isBigUInt64Array,eC=_t.isBigInt64Array,tC=_t.isUint8Array,rC=_t.randomBytes,nC=_t.normalizedFunctionString,Kn=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DBRef=e.isDBRefLike=void 0;function r(i){return _t.isObjectLike(i)&&i.$id!=null&&i.$ref!=null}e.isDBRefLike=r;class n{constructor(o,f,s,a){let u=o.split(".");u.length===2&&(s=u.shift(),o=u.shift()),this.collection=o,this.oid=f,this.db=s,this.fields=a||{}}get namespace(){return this.collection}set namespace(o){this.collection=o}toJSON(){let o=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(o.$db=this.db),o}toExtendedJSON(o){o=o||{};let f={$ref:this.collection,$id:this.oid};return o.legacy||(this.db&&(f.$db=this.db),f=Object.assign(f,this.fields)),f}static fromExtendedJSON(o){let f=Object.assign({},o);return delete f.$ref,delete f.$id,delete f.$db,new n(o.$ref,o.$id,o.$db,f)}}e.DBRef=n,Object.defineProperty(n.prototype,"_bsontype",{value:"DBRef"})});Ut(Kn);iC=Kn.DBRef,oC=Kn.isDBRefLike,Se=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Long=void 0;let r;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}let n=1<<16,i=1<<24,o=n*n,f=o*o,s=f/2,a={},u={};class c{constructor(p=0,j=0,S){this.comp=c.prototype.compare,this.div=c.prototype.divide,this.eq=c.prototype.equals,this.gt=c.prototype.greaterThan,this.gte=c.prototype.greaterThanOrEqual,this.ge=c.prototype.greaterThanOrEqual,this.lt=c.prototype.lessThan,this.lte=c.prototype.lessThanOrEqual,this.mod=c.prototype.modulo,this.rem=c.prototype.modulo,this.mul=c.prototype.multiply,this.neg=c.prototype.negate,this.neq=c.prototype.notEquals,this.ne=c.prototype.notEquals,this.shl=c.prototype.shiftLeft,this.shr=c.prototype.shiftRight,this.shr_u=c.prototype.shiftRightUnsigned,this.shru=c.prototype.shiftRightUnsigned,this.sub=c.prototype.subtract,this.eqz=c.prototype.isZero,this.le=c.prototype.lessThanOrEqual,this.low=p|0,this.high=j|0,this.unsigned=!!S,Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}static fromBits(p,j,S){return new c(p,j,S)}static fromInt(p,j){let S,T,U;return j?(p>>>=0,(U=0<=p&&p<256)&&(T=u[p],T)?T:(S=c.fromBits(p,(p|0)<0?-1:0,!0),U&&(u[p]=S),S)):(p|=0,(U=-128<=p&&p<128)&&(T=a[p],T)?T:(S=c.fromBits(p,p<0?-1:0,!1),U&&(a[p]=S),S))}static fromNumber(p,j){if(isNaN(p))return j?c.UZERO:c.ZERO;if(j){if(p<0)return c.UZERO;if(p>=f)return c.MAX_UNSIGNED_VALUE}else{if(p<=-s)return c.MIN_VALUE;if(p+1>=s)return c.MAX_VALUE}return p<0?c.fromNumber(-p,j).neg():c.fromBits(p%o|0,p/o|0,j)}static fromBigInt(p,j){return c.fromString(p.toString(),j)}static fromString(p,j,S){if(p.length===0)throw Error("empty string");if(p==="NaN"||p==="Infinity"||p==="+Infinity"||p==="-Infinity")return c.ZERO;if(typeof j=="number"?(S=j,j=!1):j=!!j,S=S||10,S<2||36<S)throw RangeError("radix");let T;if((T=p.indexOf("-"))>0)throw Error("interior hyphen");if(T===0)return c.fromString(p.substring(1),j,S).neg();let U=c.fromNumber(Math.pow(S,8)),W=c.ZERO;for(let L=0;L<p.length;L+=8){let te=Math.min(8,p.length-L),pe=parseInt(p.substring(L,L+te),S);if(te<8){let J=c.fromNumber(Math.pow(S,te));W=W.mul(J).add(c.fromNumber(pe))}else W=W.mul(U),W=W.add(c.fromNumber(pe))}return W.unsigned=j,W}static fromBytes(p,j,S){return S?c.fromBytesLE(p,j):c.fromBytesBE(p,j)}static fromBytesLE(p,j){return new c(p[0]|p[1]<<8|p[2]<<16|p[3]<<24,p[4]|p[5]<<8|p[6]<<16|p[7]<<24,j)}static fromBytesBE(p,j){return new c(p[4]<<24|p[5]<<16|p[6]<<8|p[7],p[0]<<24|p[1]<<16|p[2]<<8|p[3],j)}static isLong(p){return _t.isObjectLike(p)&&p.__isLong__===!0}static fromValue(p,j){return typeof p=="number"?c.fromNumber(p,j):typeof p=="string"?c.fromString(p,j):c.fromBits(p.low,p.high,typeof j=="boolean"?j:p.unsigned)}add(p){c.isLong(p)||(p=c.fromValue(p));let j=this.high>>>16,S=this.high&65535,T=this.low>>>16,U=this.low&65535,W=p.high>>>16,L=p.high&65535,te=p.low>>>16,pe=p.low&65535,J=0,D=0,le=0,Y=0;return Y+=U+pe,le+=Y>>>16,Y&=65535,le+=T+te,D+=le>>>16,le&=65535,D+=S+L,J+=D>>>16,D&=65535,J+=j+W,J&=65535,c.fromBits(le<<16|Y,J<<16|D,this.unsigned)}and(p){return c.isLong(p)||(p=c.fromValue(p)),c.fromBits(this.low&p.low,this.high&p.high,this.unsigned)}compare(p){if(c.isLong(p)||(p=c.fromValue(p)),this.eq(p))return 0;let j=this.isNegative(),S=p.isNegative();return j&&!S?-1:!j&&S?1:this.unsigned?p.high>>>0>this.high>>>0||p.high===this.high&&p.low>>>0>this.low>>>0?-1:1:this.sub(p).isNegative()?-1:1}divide(p){if(c.isLong(p)||(p=c.fromValue(p)),p.isZero())throw Error("division by zero");if(r){if(!this.unsigned&&this.high===-2147483648&&p.low===-1&&p.high===-1)return this;let U=(this.unsigned?r.div_u:r.div_s)(this.low,this.high,p.low,p.high);return c.fromBits(U,r.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?c.UZERO:c.ZERO;let j,S,T;if(this.unsigned){if(p.unsigned||(p=p.toUnsigned()),p.gt(this))return c.UZERO;if(p.gt(this.shru(1)))return c.UONE;T=c.UZERO}else{if(this.eq(c.MIN_VALUE))return p.eq(c.ONE)||p.eq(c.NEG_ONE)?c.MIN_VALUE:p.eq(c.MIN_VALUE)?c.ONE:(j=this.shr(1).div(p).shl(1),j.eq(c.ZERO)?p.isNegative()?c.ONE:c.NEG_ONE:(S=this.sub(p.mul(j)),T=j.add(S.div(p)),T));if(p.eq(c.MIN_VALUE))return this.unsigned?c.UZERO:c.ZERO;if(this.isNegative())return p.isNegative()?this.neg().div(p.neg()):this.neg().div(p).neg();if(p.isNegative())return this.div(p.neg()).neg();T=c.ZERO}for(S=this;S.gte(p);){j=Math.max(1,Math.floor(S.toNumber()/p.toNumber()));let U=Math.ceil(Math.log(j)/Math.LN2),W=U<=48?1:Math.pow(2,U-48),L=c.fromNumber(j),te=L.mul(p);for(;te.isNegative()||te.gt(S);)j-=W,L=c.fromNumber(j,this.unsigned),te=L.mul(p);L.isZero()&&(L=c.ONE),T=T.add(L),S=S.sub(te)}return T}equals(p){return c.isLong(p)||(p=c.fromValue(p)),this.unsigned!==p.unsigned&&this.high>>>31==1&&p.high>>>31==1?!1:this.high===p.high&&this.low===p.low}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(c.MIN_VALUE)?64:this.neg().getNumBitsAbs();let p=this.high!==0?this.high:this.low,j;for(j=31;j>0&&(p&1<<j)==0;j--);return this.high!==0?j+33:j+1}greaterThan(p){return this.comp(p)>0}greaterThanOrEqual(p){return this.comp(p)>=0}isEven(){return(this.low&1)==0}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return(this.low&1)==1}isPositive(){return this.unsigned||this.high>=0}isZero(){return this.high===0&&this.low===0}lessThan(p){return this.comp(p)<0}lessThanOrEqual(p){return this.comp(p)<=0}modulo(p){if(c.isLong(p)||(p=c.fromValue(p)),r){let j=(this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,p.low,p.high);return c.fromBits(j,r.get_high(),this.unsigned)}return this.sub(this.div(p).mul(p))}multiply(p){if(this.isZero())return c.ZERO;if(c.isLong(p)||(p=c.fromValue(p)),r){let de=r.mul(this.low,this.high,p.low,p.high);return c.fromBits(de,r.get_high(),this.unsigned)}if(p.isZero())return c.ZERO;if(this.eq(c.MIN_VALUE))return p.isOdd()?c.MIN_VALUE:c.ZERO;if(p.eq(c.MIN_VALUE))return this.isOdd()?c.MIN_VALUE:c.ZERO;if(this.isNegative())return p.isNegative()?this.neg().mul(p.neg()):this.neg().mul(p).neg();if(p.isNegative())return this.mul(p.neg()).neg();if(this.lt(c.TWO_PWR_24)&&p.lt(c.TWO_PWR_24))return c.fromNumber(this.toNumber()*p.toNumber(),this.unsigned);let j=this.high>>>16,S=this.high&65535,T=this.low>>>16,U=this.low&65535,W=p.high>>>16,L=p.high&65535,te=p.low>>>16,pe=p.low&65535,J=0,D=0,le=0,Y=0;return Y+=U*pe,le+=Y>>>16,Y&=65535,le+=T*pe,D+=le>>>16,le&=65535,le+=U*te,D+=le>>>16,le&=65535,D+=S*pe,J+=D>>>16,D&=65535,D+=T*te,J+=D>>>16,D&=65535,D+=U*L,J+=D>>>16,D&=65535,J+=j*pe+S*te+T*L+U*W,J&=65535,c.fromBits(le<<16|Y,J<<16|D,this.unsigned)}negate(){return!this.unsigned&&this.eq(c.MIN_VALUE)?c.MIN_VALUE:this.not().add(c.ONE)}not(){return c.fromBits(~this.low,~this.high,this.unsigned)}notEquals(p){return!this.equals(p)}or(p){return c.isLong(p)||(p=c.fromValue(p)),c.fromBits(this.low|p.low,this.high|p.high,this.unsigned)}shiftLeft(p){return c.isLong(p)&&(p=p.toInt()),(p&=63)==0?this:p<32?c.fromBits(this.low<<p,this.high<<p|this.low>>>32-p,this.unsigned):c.fromBits(0,this.low<<p-32,this.unsigned)}shiftRight(p){return c.isLong(p)&&(p=p.toInt()),(p&=63)==0?this:p<32?c.fromBits(this.low>>>p|this.high<<32-p,this.high>>p,this.unsigned):c.fromBits(this.high>>p-32,this.high>=0?0:-1,this.unsigned)}shiftRightUnsigned(p){if(c.isLong(p)&&(p=p.toInt()),p&=63,p===0)return this;{let j=this.high;if(p<32){let S=this.low;return c.fromBits(S>>>p|j<<32-p,j>>>p,this.unsigned)}else return p===32?c.fromBits(j,0,this.unsigned):c.fromBits(j>>>p-32,0,this.unsigned)}}subtract(p){return c.isLong(p)||(p=c.fromValue(p)),this.add(p.neg())}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(p){return p?this.toBytesLE():this.toBytesBE()}toBytesLE(){let p=this.high,j=this.low;return[j&255,j>>>8&255,j>>>16&255,j>>>24,p&255,p>>>8&255,p>>>16&255,p>>>24]}toBytesBE(){let p=this.high,j=this.low;return[p>>>24,p>>>16&255,p>>>8&255,p&255,j>>>24,j>>>16&255,j>>>8&255,j&255]}toSigned(){return this.unsigned?c.fromBits(this.low,this.high,!1):this}toString(p){if(p=p||10,p<2||36<p)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(c.MIN_VALUE)){let U=c.fromNumber(p),W=this.div(U),L=W.mul(U).sub(this);return W.toString(p)+L.toInt().toString(p)}else return"-"+this.neg().toString(p);let j=c.fromNumber(Math.pow(p,6),this.unsigned),S=this,T="";for(;;){let U=S.div(j),L=(S.sub(U.mul(j)).toInt()>>>0).toString(p);if(S=U,S.isZero())return L+T;for(;L.length<6;)L="0"+L;T=""+L+T}}toUnsigned(){return this.unsigned?this:c.fromBits(this.low,this.high,!0)}xor(p){return c.isLong(p)||(p=c.fromValue(p)),c.fromBits(this.low^p.low,this.high^p.high,this.unsigned)}toExtendedJSON(p){return p&&p.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(p,j){let S=c.fromString(p.$numberLong);return j&&j.relaxed?S.toNumber():S}}e.Long=c,c.TWO_PWR_24=c.fromInt(i),c.MAX_UNSIGNED_VALUE=c.fromBits(4294967295|0,4294967295|0,!0),c.ZERO=c.fromInt(0),c.UZERO=c.fromInt(0,!0),c.ONE=c.fromInt(1),c.UONE=c.fromInt(1,!0),c.NEG_ONE=c.fromInt(-1),c.MAX_VALUE=c.fromBits(4294967295|0,2147483647|0,!1),c.MIN_VALUE=c.fromBits(0,2147483648|0,!1),Object.defineProperty(c.prototype,"__isLong__",{value:!0}),Object.defineProperty(c.prototype,"_bsontype",{value:"Long"})});Ut(Se);fC=Se.Long,Js=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decimal128=void 0;let r=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,n=/^(\+|-)?(Infinity|inf)$/i,i=/^(\+|-)?NaN$/i,o=6111,f=-6176,s=6176,a=34,u=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),c=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),_=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),p=/^([-+])?(\d+)?$/,j=31,S=16383,T=30,U=31;function W(le){return!isNaN(parseInt(le,10))}function L(le){let Y=Se.Long.fromNumber(1e3*1e3*1e3),de=Se.Long.fromNumber(0);if(!le.parts[0]&&!le.parts[1]&&!le.parts[2]&&!le.parts[3])return{quotient:le,rem:de};for(let y=0;y<=3;y++)de=de.shiftLeft(32),de=de.add(new Se.Long(le.parts[y],0)),le.parts[y]=de.div(Y).low,de=de.modulo(Y);return{quotient:le,rem:de}}function te(le,Y){if(!le&&!Y)return{high:Se.Long.fromNumber(0),low:Se.Long.fromNumber(0)};let de=le.shiftRightUnsigned(32),y=new Se.Long(le.getLowBits(),0),g=Y.shiftRightUnsigned(32),N=new Se.Long(Y.getLowBits(),0),b=de.multiply(g),z=de.multiply(N),K=y.multiply(g),M=y.multiply(N);return b=b.add(z.shiftRightUnsigned(32)),z=new Se.Long(z.getLowBits(),0).add(K).add(M.shiftRightUnsigned(32)),b=b.add(z.shiftRightUnsigned(32)),M=z.shiftLeft(32).add(new Se.Long(M.getLowBits(),0)),{high:b,low:M}}function pe(le,Y){let de=le.high>>>0,y=Y.high>>>0;if(de<y)return!0;if(de===y){let g=le.low>>>0,N=Y.low>>>0;if(g<N)return!0}return!1}function J(le,Y){throw new TypeError(`"${le}" is not a valid Decimal128 string - ${Y}`)}class D{constructor(Y){this.bytes=Y}static fromString(Y){let de=!1,y=!1,g=!1,N=0,b=0,z=0,K=0,M=0,oe=[0],A=0,Ye=0,me=0,V=0,X=0,He=0,we=new Se.Long(0,0),rt=new Se.Long(0,0),Ir=0,_e=0;if(Y.length>=7e3)throw new TypeError(""+Y+" not a valid Decimal128 string");let $=Y.match(r),Io=Y.match(n),So=Y.match(i);if(!$&&!Io&&!So||Y.length===0)throw new TypeError(""+Y+" not a valid Decimal128 string");if($){let bt=$[2],q=$[4],d=$[5],m=$[6];q&&m===void 0&&J(Y,"missing exponent power"),q&&bt===void 0&&J(Y,"missing exponent base"),q===void 0&&(d||m)&&J(Y,"missing e before exponent")}if((Y[_e]==="+"||Y[_e]==="-")&&(de=Y[_e++]==="-"),!W(Y[_e])&&Y[_e]!=="."){if(Y[_e]==="i"||Y[_e]==="I")return new D(ye.Buffer.from(de?c:_));if(Y[_e]==="N")return new D(ye.Buffer.from(u))}for(;W(Y[_e])||Y[_e]===".";){if(Y[_e]==="."){y&&J(Y,"contains multiple periods"),y=!0,_e=_e+1;continue}A<34&&(Y[_e]!=="0"||g)&&(g||(M=b),g=!0,oe[Ye++]=parseInt(Y[_e],10),A=A+1),g&&(z=z+1),y&&(K=K+1),b=b+1,_e=_e+1}if(y&&!b)throw new TypeError(""+Y+" not a valid Decimal128 string");if(Y[_e]==="e"||Y[_e]==="E"){let bt=Y.substr(++_e).match(p);if(!bt||!bt[2])return new D(ye.Buffer.from(u));X=parseInt(bt[0],10),_e=_e+bt[0].length}if(Y[_e])return new D(ye.Buffer.from(u));if(me=0,!A)me=0,V=0,oe[0]=0,z=1,A=1,N=0;else if(V=A-1,N=z,N!==1)for(;Y[M+N-1]==="0";)N=N-1;for(X<=K&&K-X>1<<14?X=f:X=X-K;X>o;){if(V=V+1,V-me>a){if(oe.join("").match(/^0+$/)){X=o;break}J(Y,"overflow")}X=X-1}for(;X<f||A<z;){if(V===0&&N<A){X=f,N=0;break}if(A<z?z=z-1:V=V-1,X<o)X=X+1;else{if(oe.join("").match(/^0+$/)){X=o;break}J(Y,"overflow")}}if(V-me+1<N){let bt=b;y&&(M=M+1,bt=bt+1),de&&(M=M+1,bt=bt+1);let q=parseInt(Y[M+V+1],10),d=0;if(q>=5&&(d=1,q===5)){for(d=oe[V]%2==1?1:0,He=M+V+2;He<bt;He++)if(parseInt(Y[He],10)){d=1;break}}if(d){let m=V;for(;m>=0;m--)if(++oe[m]>9&&(oe[m]=0,m===0))if(X<o)X=X+1,oe[m]=1;else return new D(ye.Buffer.from(de?c:_))}}if(we=Se.Long.fromNumber(0),rt=Se.Long.fromNumber(0),N===0)we=Se.Long.fromNumber(0),rt=Se.Long.fromNumber(0);else if(V-me<17){let bt=me;for(rt=Se.Long.fromNumber(oe[bt++]),we=new Se.Long(0,0);bt<=V;bt++)rt=rt.multiply(Se.Long.fromNumber(10)),rt=rt.add(Se.Long.fromNumber(oe[bt]))}else{let bt=me;for(we=Se.Long.fromNumber(oe[bt++]);bt<=V-17;bt++)we=we.multiply(Se.Long.fromNumber(10)),we=we.add(Se.Long.fromNumber(oe[bt]));for(rt=Se.Long.fromNumber(oe[bt++]);bt<=V;bt++)rt=rt.multiply(Se.Long.fromNumber(10)),rt=rt.add(Se.Long.fromNumber(oe[bt]))}let St=te(we,Se.Long.fromString("100000000000000000"));St.low=St.low.add(rt),pe(St.low,rt)&&(St.high=St.high.add(Se.Long.fromNumber(1))),Ir=X+s;let Ke={low:Se.Long.fromNumber(0),high:Se.Long.fromNumber(0)};St.high.shiftRightUnsigned(49).and(Se.Long.fromNumber(1)).equals(Se.Long.fromNumber(1))?(Ke.high=Ke.high.or(Se.Long.fromNumber(3).shiftLeft(61)),Ke.high=Ke.high.or(Se.Long.fromNumber(Ir).and(Se.Long.fromNumber(16383).shiftLeft(47))),Ke.high=Ke.high.or(St.high.and(Se.Long.fromNumber(140737488355327)))):(Ke.high=Ke.high.or(Se.Long.fromNumber(Ir&16383).shiftLeft(49)),Ke.high=Ke.high.or(St.high.and(Se.Long.fromNumber(562949953421311)))),Ke.low=St.low,de&&(Ke.high=Ke.high.or(Se.Long.fromString("9223372036854775808")));let Ht=ye.Buffer.alloc(16);return _e=0,Ht[_e++]=Ke.low.low&255,Ht[_e++]=Ke.low.low>>8&255,Ht[_e++]=Ke.low.low>>16&255,Ht[_e++]=Ke.low.low>>24&255,Ht[_e++]=Ke.low.high&255,Ht[_e++]=Ke.low.high>>8&255,Ht[_e++]=Ke.low.high>>16&255,Ht[_e++]=Ke.low.high>>24&255,Ht[_e++]=Ke.high.low&255,Ht[_e++]=Ke.high.low>>8&255,Ht[_e++]=Ke.high.low>>16&255,Ht[_e++]=Ke.high.low>>24&255,Ht[_e++]=Ke.high.high&255,Ht[_e++]=Ke.high.high>>8&255,Ht[_e++]=Ke.high.high>>16&255,Ht[_e++]=Ke.high.high>>24&255,new D(Ht)}toString(){let Y,de=0,y=new Array(36);for(let _e=0;_e<y.length;_e++)y[_e]=0;let g=0,N=!1,b,z={parts:[0,0,0,0]},K,M,oe=[];g=0;let A=this.bytes,Ye=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24,me=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24,V=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24,X=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24;g=0,{low:new Se.Long(Ye,me),high:new Se.Long(V,X)}.high.lessThan(Se.Long.ZERO)&&oe.push("-");let we=X>>26&j;if(we>>3==3){if(we===T)return oe.join("")+"Infinity";if(we===U)return"NaN";Y=X>>15&S,b=8+(X>>14&1)}else b=X>>14&7,Y=X>>17&S;let rt=Y-s;if(z.parts[0]=(X&16383)+((b&15)<<14),z.parts[1]=V,z.parts[2]=me,z.parts[3]=Ye,z.parts[0]===0&&z.parts[1]===0&&z.parts[2]===0&&z.parts[3]===0)N=!0;else for(M=3;M>=0;M--){let _e=0,$=L(z);if(z=$.quotient,_e=$.rem.low,!!_e)for(K=8;K>=0;K--)y[M*9+K]=_e%10,_e=Math.floor(_e/10)}if(N)de=1,y[g]=0;else for(de=36;!y[g];)de=de-1,g=g+1;let Ir=de-1+rt;if(Ir>=34||Ir<=-7||rt>0){if(de>34)return oe.push(`${0}`),rt>0?oe.push("E+"+rt):rt<0&&oe.push("E"+rt),oe.join("");oe.push(`${y[g++]}`),de=de-1,de&&oe.push(".");for(let _e=0;_e<de;_e++)oe.push(`${y[g++]}`);oe.push("E"),Ir>0?oe.push("+"+Ir):oe.push(`${Ir}`)}else if(rt>=0)for(let _e=0;_e<de;_e++)oe.push(`${y[g++]}`);else{let _e=de+rt;if(_e>0)for(let $=0;$<_e;$++)oe.push(`${y[g++]}`);else oe.push("0");for(oe.push(".");_e++<0;)oe.push("0");for(let $=0;$<de-Math.max(_e-1,0);$++)oe.push(`${y[g++]}`)}return oe.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(Y){return D.fromString(Y.$numberDecimal)}}e.Decimal128=D,Object.defineProperty(D.prototype,"_bsontype",{value:"Decimal128"})});Ut(Js);sC=Js.Decimal128,Gf=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Double=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){if(i&&(i.legacy||i.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:`-${this.value.toFixed(1)}`};let o;return Number.isInteger(this.value)?(o=this.value.toFixed(1),o.length>=13&&(o=this.value.toExponential(13).toUpperCase())):o=this.value.toString(),{$numberDouble:o}}static fromExtendedJSON(i,o){let f=parseFloat(i.$numberDouble);return o&&o.relaxed?f:new r(f)}}e.Double=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Double"})});Ut(Gf);aC=Gf.Double,Jf=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Int32=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){return i&&(i.relaxed||i.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(i,o){return o&&o.relaxed?parseInt(i.$numberInt,10):new r(i.$numberInt)}}e.Int32=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Int32"})});Ut(Jf);lC=Jf.Int32,Tp=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Map=void 0;let r;e.Map=r;let n=function(f){return f&&f.Math==Math&&f};function i(){return n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof hp=="object"&&hp)||Function("return this")()}let o=i();Object.prototype.hasOwnProperty.call(o,"Map")?e.Map=r=o.Map:e.Map=r=class{constructor(s=[]){this._keys=[],this._values={};for(let a=0;a<s.length;a++){if(s[a]==null)continue;let u=s[a],c=u[0],_=u[1];this._keys.push(c),this._values[c]={v:_,i:this._keys.length-1}}}clear(){this._keys=[],this._values={}}delete(s){let a=this._values[s];return a==null?!1:(delete this._values[s],this._keys.splice(a.i,1),!0)}entries(){let s=0;return{next:()=>{let a=this._keys[s++];return{value:a!==void 0?[a,this._values[a].v]:void 0,done:a===void 0}}}}forEach(s,a){a=a||this;for(let u=0;u<this._keys.length;u++){let c=this._keys[u];s.call(a,this._values[c].v,c,a)}}get(s){return this._values[s]?this._values[s].v:void 0}has(s){return this._values[s]!=null}keys(){let s=0;return{next:()=>{let a=this._keys[s++];return{value:a!==void 0?a:void 0,done:a===void 0}}}}set(s,a){return this._values[s]?(this._values[s].v=a,this):(this._keys.push(s),this._values[s]={v:a,i:this._keys.length-1},this)}values(){let s=0;return{next:()=>{let a=this._keys[s++];return{value:a!==void 0?this._values[a].v:void 0,done:a===void 0}}}}get size(){return this._keys.length}}});Ut(Tp);cC=Tp.Map,Zs=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MaxKey=void 0;class r{toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new r}}e.MaxKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MaxKey"})});Ut(Zs);pC=Zs.MaxKey,Xs=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MinKey=void 0;class r{toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new r}}e.MinKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MinKey"})});Ut(Xs);dC=Xs.MinKey,Qi=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectId=void 0;let r=_t.randomBytes(5),n=new RegExp("^[0-9a-fA-F]{24}$"),i=[];for(let c=0;c<256;c++)i[c]=(c<=15?"0":"")+c.toString(16);let o=[],f=0;for(;f<10;)o[48+f]=f++;for(;f<16;)o[65-10+f]=o[97-10+f]=f++;let s=Symbol("id");class a{constructor(_){if(_ instanceof a&&(this[s]=_.id,this.__id=_.__id),typeof _=="object"&&_&&"id"in _&&("toHexString"in _&&typeof _.toHexString=="function"?this[s]=ye.Buffer.from(_.toHexString(),"hex"):this[s]=typeof _.id=="string"?ye.Buffer.from(_.id):_.id),(_==null||typeof _=="number")&&(this[s]=a.generate(typeof _=="number"?_:void 0),a.cacheHexString&&(this.__id=this.id.toString("hex"))),ArrayBuffer.isView(_)&&_.byteLength===12&&(this[s]=Mo.ensureBuffer(_)),typeof _=="string")if(_.length===12){let p=ye.Buffer.from(_);p.byteLength===12&&(this[s]=p)}else if(_.length===24&&n.test(_))this[s]=ye.Buffer.from(_,"hex");else throw new TypeError("Argument passed in must be a Buffer or string of 12 bytes or a string of 24 hex characters");a.cacheHexString&&(this.__id=this.id.toString("hex"))}get id(){return this[s]}set id(_){this[s]=_,a.cacheHexString&&(this.__id=_.toString("hex"))}get generationTime(){return this.id.readInt32BE(0)}set generationTime(_){this.id.writeUInt32BE(_,0)}toHexString(){if(a.cacheHexString&&this.__id)return this.__id;let _=this.id.toString("hex");return a.cacheHexString&&!this.__id&&(this.__id=_),_}static getInc(){return a.index=(a.index+1)%16777215}static generate(_){typeof _!="number"&&(_=~~(Date.now()/1e3));let p=a.getInc(),j=ye.Buffer.alloc(12);return j.writeUInt32BE(_,0),j[4]=r[0],j[5]=r[1],j[6]=r[2],j[7]=r[3],j[8]=r[4],j[11]=p&255,j[10]=p>>8&255,j[9]=p>>16&255,j}toString(_){return _?this.id.toString(_):this.toHexString()}toJSON(){return this.toHexString()}equals(_){return _==null?!1:_ instanceof a?this.toString()===_.toString():typeof _=="string"&&a.isValid(_)&&_.length===12&&this.id instanceof ye.Buffer?_===this.id.toString("binary"):typeof _=="string"&&a.isValid(_)&&_.length===24?_.toLowerCase()===this.toHexString():typeof _=="string"&&a.isValid(_)&&_.length===12?ye.Buffer.from(_).equals(this.id):typeof _=="object"&&"toHexString"in _&&typeof _.toHexString=="function"?_.toHexString()===this.toHexString():!1}getTimestamp(){let _=new Date,p=this.id.readUInt32BE(0);return _.setTime(Math.floor(p)*1e3),_}static createPk(){return new a}static createFromTime(_){let p=ye.Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0]);return p.writeUInt32BE(_,0),new a(p)}static createFromHexString(_){if(typeof _=="undefined"||_!=null&&_.length!==24)throw new TypeError("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new a(ye.Buffer.from(_,"hex"))}static isValid(_){return _==null?!1:typeof _=="number"?!0:typeof _=="string"?_.length===12||_.length===24&&n.test(_):_ instanceof a||_ instanceof ye.Buffer&&_.length===12?!0:typeof _=="object"&&"toHexString"in _&&typeof _.toHexString=="function"?typeof _.id=="string"?_.id.length===12:_.toHexString().length===24&&n.test(_.id.toString("hex")):!1}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(_){return new a(_.$oid)}}e.ObjectId=a,a.index=~~(Math.random()*16777215),Object.defineProperty(a.prototype,"generate",{value:_t.deprecate(c=>a.generate(c),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(a.prototype,"getInc",{value:_t.deprecate(()=>a.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(a.prototype,"get_inc",{value:_t.deprecate(()=>a.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(a,"get_inc",{value:_t.deprecate(()=>a.getInc(),"Please use the static `ObjectId.getInc()` instead")});let u=Symbol.for("nodejs.util.inspect.custom");Object.defineProperty(a.prototype,u,a.prototype.toString),Object.defineProperty(a.prototype,"inspect",a.prototype.toString),Object.defineProperty(a.prototype,"_bsontype",{value:"ObjectID"})});Ut(Qi);mC=Qi.ObjectId,G=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_DATA_MAX_KEY=e.BSON_DATA_MIN_KEY=e.BSON_DATA_DECIMAL128=e.BSON_DATA_LONG=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_INT=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_SYMBOL=e.BSON_DATA_CODE=e.BSON_DATA_DBPOINTER=e.BSON_DATA_REGEXP=e.BSON_DATA_NULL=e.BSON_DATA_DATE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_OID=e.BSON_DATA_UNDEFINED=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_DATA_OBJECT=e.BSON_DATA_STRING=e.BSON_DATA_NUMBER=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=void 0,e.BSON_INT32_MAX=2147483647,e.BSON_INT32_MIN=-2147483648,e.BSON_INT64_MAX=Math.pow(2,63)-1,e.BSON_INT64_MIN=-Math.pow(2,63),e.JS_INT_MAX=Math.pow(2,53),e.JS_INT_MIN=-Math.pow(2,53),e.BSON_DATA_NUMBER=1,e.BSON_DATA_STRING=2,e.BSON_DATA_OBJECT=3,e.BSON_DATA_ARRAY=4,e.BSON_DATA_BINARY=5,e.BSON_DATA_UNDEFINED=6,e.BSON_DATA_OID=7,e.BSON_DATA_BOOLEAN=8,e.BSON_DATA_DATE=9,e.BSON_DATA_NULL=10,e.BSON_DATA_REGEXP=11,e.BSON_DATA_DBPOINTER=12,e.BSON_DATA_CODE=13,e.BSON_DATA_SYMBOL=14,e.BSON_DATA_CODE_W_SCOPE=15,e.BSON_DATA_INT=16,e.BSON_DATA_TIMESTAMP=17,e.BSON_DATA_LONG=18,e.BSON_DATA_DECIMAL128=19,e.BSON_DATA_MIN_KEY=255,e.BSON_DATA_MAX_KEY=127,e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BSON_BINARY_SUBTYPE_FUNCTION=1,e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=2,e.BSON_BINARY_SUBTYPE_UUID=3,e.BSON_BINARY_SUBTYPE_UUID_NEW=4,e.BSON_BINARY_SUBTYPE_MD5=5,e.BSON_BINARY_SUBTYPE_USER_DEFINED=128});Ut(G);bC=G.BSON_BINARY_SUBTYPE_USER_DEFINED,hC=G.BSON_BINARY_SUBTYPE_MD5,wC=G.BSON_BINARY_SUBTYPE_UUID_NEW,gC=G.BSON_BINARY_SUBTYPE_UUID,yC=G.BSON_BINARY_SUBTYPE_BYTE_ARRAY,jC=G.BSON_BINARY_SUBTYPE_FUNCTION,_C=G.BSON_BINARY_SUBTYPE_DEFAULT,qC=G.BSON_DATA_MAX_KEY,vC=G.BSON_DATA_MIN_KEY,TC=G.BSON_DATA_DECIMAL128,BC=G.BSON_DATA_LONG,kC=G.BSON_DATA_TIMESTAMP,IC=G.BSON_DATA_INT,SC=G.BSON_DATA_CODE_W_SCOPE,xC=G.BSON_DATA_SYMBOL,EC=G.BSON_DATA_CODE,AC=G.BSON_DATA_DBPOINTER,OC=G.BSON_DATA_REGEXP,NC=G.BSON_DATA_NULL,DC=G.BSON_DATA_DATE,FC=G.BSON_DATA_BOOLEAN,PC=G.BSON_DATA_OID,RC=G.BSON_DATA_UNDEFINED,zC=G.BSON_DATA_BINARY,HC=G.BSON_DATA_ARRAY,MC=G.BSON_DATA_OBJECT,UC=G.BSON_DATA_STRING,LC=G.BSON_DATA_NUMBER,CC=G.JS_INT_MIN,VC=G.JS_INT_MAX,WC=G.BSON_INT64_MIN,YC=G.BSON_INT64_MAX,KC=G.BSON_INT32_MIN,GC=G.BSON_INT32_MAX,Bh=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateObjectSize=void 0;function r(i,o,f){let s=4+1;if(Array.isArray(i))for(let a=0;a<i.length;a++)s+=n(a.toString(),i[a],o,!0,f);else{i.toBSON&&(i=i.toBSON());for(let a in i)s+=n(a,i[a],o,!1,f)}return s}e.calculateObjectSize=r;function n(i,o,f=!1,s=!1,a=!1){switch(o&&o.toBSON&&(o=o.toBSON()),typeof o){case"string":return 1+ye.Buffer.byteLength(i,"utf8")+1+4+ye.Buffer.byteLength(o,"utf8")+1;case"number":return Math.floor(o)===o&&o>=G.JS_INT_MIN&&o<=G.JS_INT_MAX&&o>=G.BSON_INT32_MIN&&o<=G.BSON_INT32_MAX?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(4+1):(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(8+1);case"undefined":return s||!a?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1:0;case"boolean":return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(1+1);case"object":if(o==null||o._bsontype==="MinKey"||o._bsontype==="MaxKey")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1;if(o._bsontype==="ObjectId"||o._bsontype==="ObjectID")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(12+1);if(o instanceof Date||_t.isDate(o))return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(ArrayBuffer.isView(o)||o instanceof ArrayBuffer)return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(1+4+1)+o.byteLength;if(o._bsontype==="Long"||o._bsontype==="Double"||o._bsontype==="Timestamp")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(o._bsontype==="Decimal128")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(16+1);if(o._bsontype==="Code")return o.scope!=null&&Object.keys(o.scope).length>0?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ye.Buffer.byteLength(o.code.toString(),"utf8")+1+r(o.scope,f,a):(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+ye.Buffer.byteLength(o.code.toString(),"utf8")+1;if(o._bsontype==="Binary")return o.sub_type===ln.Binary.SUBTYPE_BYTE_ARRAY?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(o.position+1+4+1+4):(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(o.position+1+4+1);if(o._bsontype==="Symbol")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+ye.Buffer.byteLength(o.value,"utf8")+4+1+1;if(o._bsontype==="DBRef"){let u=Object.assign({$ref:o.collection,$id:o.oid},o.fields);return o.db!=null&&(u.$db=o.db),(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+r(u,f,a)}else return o instanceof RegExp||Object.prototype.toString.call(o)==="[object RegExp]"?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+ye.Buffer.byteLength(o.source,"utf8")+1+(o.global?1:0)+(o.ignoreCase?1:0)+(o.multiline?1:0)+1:o._bsontype==="BSONRegExp"?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+ye.Buffer.byteLength(o.pattern,"utf8")+1+ye.Buffer.byteLength(o.options,"utf8")+1:(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+r(o,f,a)+1;case"function":if(o instanceof RegExp||Object.prototype.toString.call(o)==="[object RegExp]"||String.call(o)==="[object RegExp]")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+ye.Buffer.byteLength(o.source,"utf8")+1+(o.global?1:0)+(o.ignoreCase?1:0)+(o.multiline?1:0)+1;if(f&&o.scope!=null&&Object.keys(o.scope).length>0)return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ye.Buffer.byteLength(_t.normalizedFunctionString(o),"utf8")+1+r(o.scope,f,a);if(f)return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+ye.Buffer.byteLength(_t.normalizedFunctionString(o),"utf8")+1}return 0}});Ut(Bh);JC=Bh.calculateObjectSize,Lo=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONRegExp=void 0;function r(i){return i.split("").sort().join("")}class n{constructor(o,f){this.pattern=o,this.options=f??"",r(this.options);for(let s=0;s<this.options.length;s++)if(!(this.options[s]==="i"||this.options[s]==="m"||this.options[s]==="x"||this.options[s]==="l"||this.options[s]==="s"||this.options[s]==="u"))throw new Error(`The regular expression option [${this.options[s]}] is not supported`)}static parseOptions(o){return o?o.split("").sort().join(""):""}toExtendedJSON(o){return o=o||{},o.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(o){if("$regex"in o)if(typeof o.$regex!="string"){if(o.$regex._bsontype==="BSONRegExp")return o}else return new n(o.$regex,n.parseOptions(o.$options));if("$regularExpression"in o)return new n(o.$regularExpression.pattern,n.parseOptions(o.$regularExpression.options));throw new TypeError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(o)}`)}}e.BSONRegExp=n,Object.defineProperty(n.prototype,"_bsontype",{value:"BSONRegExp"})});Ut(Lo);ZC=Lo.BSONRegExp,Qs=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONSymbol=void 0;class r{constructor(i){this.value=i}valueOf(){return this.value}toString(){return this.value}inspect(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(i){return new r(i.$symbol)}}e.BSONSymbol=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Symbol"})});Ut(Qs);XC=Qs.BSONSymbol,Co=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.LongWithoutOverridesClass=void 0,e.LongWithoutOverridesClass=Se.Long;class r extends e.LongWithoutOverridesClass{constructor(i,o){Se.Long.isLong(i)?super(i.low,i.high,!0):super(i,o,!0),Object.defineProperty(this,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1})}toJSON(){return{$timestamp:this.toString()}}static fromInt(i){return new r(Se.Long.fromInt(i,!0))}static fromNumber(i){return new r(Se.Long.fromNumber(i,!0))}static fromBits(i,o){return new r(i,o)}static fromString(i,o){return new r(Se.Long.fromString(i,!0,o))}toExtendedJSON(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}}static fromExtendedJSON(i){return new r(i.$timestamp.i,i.$timestamp.t)}}e.Timestamp=r,r.MAX_VALUE=Se.Long.MAX_UNSIGNED_VALUE});Ut(Co);QC=Co.Timestamp,$C=Co.LongWithoutOverridesClass,Bp=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateUtf8=void 0;let r=128,n=192,i=224,o=240,f=248,s=192,a=224,u=240,c=128;function _(p,j,S){let T=0;for(let U=j;U<S;U+=1){let W=p[U];if(T){if((W&n)!==c)return!1;T-=1}else if(W&r)if((W&i)===s)T=1;else if((W&o)===a)T=2;else if((W&f)===u)T=3;else return!1}return!T}e.validateUtf8=_});Ut(Bp);eV=Bp.validateUtf8,kp=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserialize=void 0;let r=Se.Long.fromNumber(G.JS_INT_MAX),n=Se.Long.fromNumber(G.JS_INT_MIN),i={};function o(a,u,c){u=u??{};let _=u&&u.index?u.index:0,p=a[_]|a[_+1]<<8|a[_+2]<<16|a[_+3]<<24;if(p<5)throw new Error(`bson size must be >= 5, is ${p}`);if(u.allowObjectSmallerThanBufferSize&&a.length<p)throw new Error(`buffer length ${a.length} must be >= bson size ${p}`);if(!u.allowObjectSmallerThanBufferSize&&a.length!==p)throw new Error(`buffer length ${a.length} must === bson size ${p}`);if(p+_>a.byteLength)throw new Error(`(bson size ${p} + options.index ${_} must be <= buffer length ${a.byteLength})`);if(a[_+p-1]!==0)throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return f(a,_,u,c)}e.deserialize=o;function f(a,u,c,_=!1){let p=c.evalFunctions==null?!1:c.evalFunctions,j=c.cacheFunctions==null?!1:c.cacheFunctions,S=c.fieldsAsRaw==null?null:c.fieldsAsRaw,T=c.raw==null?!1:c.raw,U=typeof c.bsonRegExp=="boolean"?c.bsonRegExp:!1,W=c.promoteBuffers==null?!1:c.promoteBuffers,L=c.promoteLongs==null?!0:c.promoteLongs,te=c.promoteValues==null?!0:c.promoteValues,pe=u;if(a.length<5)throw new Error("corrupt bson message < 5 bytes long");let J=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(J<5||J>a.length)throw new Error("corrupt bson message");let D=_?[]:{},le=0,Y=!1;for(;!Y;){let g=a[u++];if(g===0)break;let N=u;for(;a[N]!==0&&N<a.length;)N++;if(N>=a.byteLength)throw new Error("Bad BSON Document: illegal CString");let b=_?le++:a.toString("utf8",u,N);if(u=N+1,g===G.BSON_DATA_STRING){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");if(!Bp.validateUtf8(a,u,u+z-1))throw new Error("Invalid UTF-8 string in BSON document");let K=a.toString("utf8",u,u+z-1);D[b]=K,u=u+z}else if(g===G.BSON_DATA_OID){let z=ye.Buffer.alloc(12);a.copy(z,0,u,u+12),D[b]=new Qi.ObjectId(z),u=u+12}else if(g===G.BSON_DATA_INT&&te===!1)D[b]=new Jf.Int32(a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24);else if(g===G.BSON_DATA_INT)D[b]=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;else if(g===G.BSON_DATA_NUMBER&&te===!1)D[b]=new Gf.Double(a.readDoubleLE(u)),u=u+8;else if(g===G.BSON_DATA_NUMBER)D[b]=a.readDoubleLE(u),u=u+8;else if(g===G.BSON_DATA_DATE){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;D[b]=new Date(new Se.Long(z,K).toNumber())}else if(g===G.BSON_DATA_BOOLEAN){if(a[u]!==0&&a[u]!==1)throw new Error("illegal boolean type value");D[b]=a[u++]===1}else if(g===G.BSON_DATA_OBJECT){let z=u,K=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24;if(K<=0||K>a.length-u)throw new Error("bad embedded document length in bson");T?D[b]=a.slice(u,u+K):D[b]=f(a,z,c,!1),u=u+K}else if(g===G.BSON_DATA_ARRAY){let z=u,K=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24,M=c,oe=u+K;if(S&&S[b]){M={};for(let A in c)M[A]=c[A];M.raw=!0}if(D[b]=f(a,z,M,!0),u=u+K,a[u-1]!==0)throw new Error("invalid array terminator byte");if(u!==oe)throw new Error("corrupted array bson")}else if(g===G.BSON_DATA_UNDEFINED)D[b]=void 0;else if(g===G.BSON_DATA_NULL)D[b]=null;else if(g===G.BSON_DATA_LONG){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,M=new Se.Long(z,K);L&&te===!0?D[b]=M.lessThanOrEqual(r)&&M.greaterThanOrEqual(n)?M.toNumber():M:D[b]=M}else if(g===G.BSON_DATA_DECIMAL128){let z=ye.Buffer.alloc(16);a.copy(z,0,u,u+16),u=u+16;let K=new Js.Decimal128(z);"toObject"in K&&typeof K.toObject=="function"?D[b]=K.toObject():D[b]=K}else if(g===G.BSON_DATA_BINARY){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=z,M=a[u++];if(z<0)throw new Error("Negative binary type element size found");if(z>a.byteLength)throw new Error("Binary type size larger than document size");if(a.slice!=null){if(M===ln.Binary.SUBTYPE_BYTE_ARRAY){if(z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,z<0)throw new Error("Negative binary type element size found for subtype 0x02");if(z>K-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(z<K-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}W&&te?D[b]=a.slice(u,u+z):D[b]=new ln.Binary(a.slice(u,u+z),M)}else{let oe=ye.Buffer.alloc(z);if(M===ln.Binary.SUBTYPE_BYTE_ARRAY){if(z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,z<0)throw new Error("Negative binary type element size found for subtype 0x02");if(z>K-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(z<K-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}for(N=0;N<z;N++)oe[N]=a[u+N];W&&te?D[b]=oe:D[b]=new ln.Binary(oe,M)}u=u+z}else if(g===G.BSON_DATA_REGEXP&&U===!1){for(N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let z=a.toString("utf8",u,N);for(u=N+1,N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let K=a.toString("utf8",u,N);u=N+1;let M=new Array(K.length);for(N=0;N<K.length;N++)switch(K[N]){case"m":M[N]="m";break;case"s":M[N]="g";break;case"i":M[N]="i";break}D[b]=new RegExp(z,M.join(""))}else if(g===G.BSON_DATA_REGEXP&&U===!0){for(N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let z=a.toString("utf8",u,N);for(u=N+1,N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let K=a.toString("utf8",u,N);u=N+1,D[b]=new Lo.BSONRegExp(z,K)}else if(g===G.BSON_DATA_SYMBOL){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");let K=a.toString("utf8",u,u+z-1);D[b]=te?K:new Qs.BSONSymbol(K),u=u+z}else if(g===G.BSON_DATA_TIMESTAMP){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;D[b]=new Co.Timestamp(z,K)}else if(g===G.BSON_DATA_MIN_KEY)D[b]=new Xs.MinKey;else if(g===G.BSON_DATA_MAX_KEY)D[b]=new Zs.MaxKey;else if(g===G.BSON_DATA_CODE){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");let K=a.toString("utf8",u,u+z-1);p?j?D[b]=s(K,i,D):D[b]=s(K):D[b]=new Uo.Code(K),u=u+z}else if(g===G.BSON_DATA_CODE_W_SCOPE){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<4+4+4+1)throw new Error("code_w_scope total size shorter minimum expected length");let K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(K<=0||K>a.length-u||a[u+K-1]!==0)throw new Error("bad string length in bson");let M=a.toString("utf8",u,u+K-1);u=u+K;let oe=u,A=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24,Ye=f(a,oe,c,!1);if(u=u+A,z<4+4+A+K)throw new Error("code_w_scope total size is too short, truncating scope");if(z>4+4+A+K)throw new Error("code_w_scope total size is too long, clips outer document");p?(j?D[b]=s(M,i,D):D[b]=s(M),D[b].scope=Ye):D[b]=new Uo.Code(M,Ye)}else if(g===G.BSON_DATA_DBPOINTER){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");if(!Bp.validateUtf8(a,u,u+z-1))throw new Error("Invalid UTF-8 string in BSON document");let K=a.toString("utf8",u,u+z-1);u=u+z;let M=ye.Buffer.alloc(12);a.copy(M,0,u,u+12);let oe=new Qi.ObjectId(M);u=u+12,D[b]=new Kn.DBRef(K,oe)}else throw new Error("Detected unknown BSON type "+g.toString(16)+' for fieldname "'+b+'"')}if(J!==u-pe)throw _?new Error("corrupt array bson"):new Error("corrupt object bson");let de=Object.keys(D).filter(g=>g.startsWith("$")),y=!0;if(de.forEach(g=>{["$ref","$id","$db"].indexOf(g)===-1&&(y=!1)}),!y)return D;if(Kn.isDBRefLike(D)){let g=Object.assign({},D);return delete g.$ref,delete g.$id,delete g.$db,new Kn.DBRef(D.$ref,D.$id,D.$db,g)}return D}function s(a,u,c){return u?(u[a]==null&&(u[a]=new Function(a)),u[a].bind(c)):new Function(a)}});Ut(kp);tV=kp.deserialize,Kl=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=e.isBSONType=void 0;function r(T){return _t.isObjectLike(T)&&Reflect.has(T,"_bsontype")&&typeof T._bsontype=="string"}e.isBSONType=r;let n=2147483647,i=-2147483648,o=9223372036854776e3,f=-9223372036854776e3,s={$oid:Qi.ObjectId,$binary:ln.Binary,$uuid:ln.Binary,$symbol:Qs.BSONSymbol,$numberInt:Jf.Int32,$numberDecimal:Js.Decimal128,$numberDouble:Gf.Double,$numberLong:Se.Long,$minKey:Xs.MinKey,$maxKey:Zs.MaxKey,$regex:Lo.BSONRegExp,$regularExpression:Lo.BSONRegExp,$timestamp:Co.Timestamp};function a(T,U={}){if(typeof T=="number"){if(U.relaxed||U.legacy)return T;if(Math.floor(T)===T){if(T>=i&&T<=n)return new Jf.Int32(T);if(T>=f&&T<=o)return Se.Long.fromNumber(T)}return new Gf.Double(T)}if(T==null||typeof T!="object")return T;if(T.$undefined)return null;let W=Object.keys(T).filter(L=>L.startsWith("$")&&T[L]!=null);for(let L=0;L<W.length;L++){let te=s[W[L]];if(te)return te.fromExtendedJSON(T,U)}if(T.$date!=null){let L=T.$date,te=new Date;return U.legacy?typeof L=="number"?te.setTime(L):typeof L=="string"&&te.setTime(Date.parse(L)):typeof L=="string"?te.setTime(Date.parse(L)):Se.Long.isLong(L)?te.setTime(L.toNumber()):typeof L=="number"&&U.relaxed&&te.setTime(L),te}if(T.$code!=null){let L=Object.assign({},T);return T.$scope&&(L.$scope=a(T.$scope)),Uo.Code.fromExtendedJSON(T)}if(T.$ref!=null||T.$dbPointer!=null){let L=T.$ref?T:T.$dbPointer;if(L instanceof Kn.DBRef)return L;let te=Object.keys(L).filter(J=>J.startsWith("$")),pe=!0;if(te.forEach(J=>{["$ref","$id","$db"].indexOf(J)===-1&&(pe=!1)}),pe)return Kn.DBRef.fromExtendedJSON(L)}return T}function u(T,U){return T.map(W=>_(W,U))}function c(T){let U=T.toISOString();return T.getUTCMilliseconds()!==0?U:U.slice(0,-5)+"Z"}function _(T,U){if(Array.isArray(T))return u(T,U);if(T===void 0)return null;if(T instanceof Date){let W=T.getTime(),L=W>-1&&W<2534023188e5;return U.legacy?U.relaxed&&L?{$date:T.getTime()}:{$date:c(T)}:U.relaxed&&L?{$date:c(T)}:{$date:{$numberLong:T.getTime().toString()}}}if(typeof T=="number"&&!U.relaxed){if(Math.floor(T)===T){let W=T>=i&&T<=n,L=T>=f&&T<=o;if(W)return{$numberInt:T.toString()};if(L)return{$numberLong:T.toString()}}return{$numberDouble:T.toString()}}if(T instanceof RegExp){let W=T.flags;if(W===void 0){let te=T.toString().match(/[gimuy]*$/);te&&(W=te[0])}return new Lo.BSONRegExp(T.source,W).toExtendedJSON(U)}return T!=null&&typeof T=="object"?j(T,U):T}let p={Binary:T=>new ln.Binary(T.value(),T.sub_type),Code:T=>new Uo.Code(T.code,T.scope),DBRef:T=>new Kn.DBRef(T.collection||T.namespace,T.oid,T.db,T.fields),Decimal128:T=>new Js.Decimal128(T.bytes),Double:T=>new Gf.Double(T.value),Int32:T=>new Jf.Int32(T.value),Long:T=>Se.Long.fromBits(T.low!=null?T.low:T.low_,T.low!=null?T.high:T.high_,T.low!=null?T.unsigned:T.unsigned_),MaxKey:()=>new Zs.MaxKey,MinKey:()=>new Xs.MinKey,ObjectID:T=>new Qi.ObjectId(T),ObjectId:T=>new Qi.ObjectId(T),BSONRegExp:T=>new Lo.BSONRegExp(T.pattern,T.options),Symbol:T=>new Qs.BSONSymbol(T.value),Timestamp:T=>Co.Timestamp.fromBits(T.low,T.high)};function j(T,U){if(T==null||typeof T!="object")throw new Error("not an object instance");let W=T._bsontype;if(typeof W=="undefined"){let L={};for(let te in T)L[te]=_(T[te],U);return L}else if(r(T)){let L=T;if(typeof L.toExtendedJSON!="function"){let te=p[T._bsontype];if(!te)throw new TypeError("Unrecognized or invalid _bsontype: "+T._bsontype);L=te(L)}return W==="Code"&&L.scope?L=new Uo.Code(L.code,_(L.scope,U)):W==="DBRef"&&L.oid&&(L=new Kn.DBRef(L.collection,_(L.oid,U),L.db,L.fields)),L.toExtendedJSON(U)}else throw new Error("_bsontype must be a string, but was: "+typeof W)}var S;(function(T){function U(pe,J){let D=Object.assign({},{relaxed:!0,legacy:!1},J);return typeof D.relaxed=="boolean"&&(D.strict=!D.relaxed),typeof D.strict=="boolean"&&(D.relaxed=!D.strict),JSON.parse(pe,(le,Y)=>a(Y,D))}T.parse=U;function W(pe,J,D,le){D!=null&&typeof D=="object"&&(le=D,D=0),J!=null&&typeof J=="object"&&!Array.isArray(J)&&(le=J,J=void 0,D=0),le=Object.assign({},{relaxed:!0,legacy:!1},le);let Y=_(pe,le);return JSON.stringify(Y,J,D)}T.stringify=W;function L(pe,J){return J=J||{},JSON.parse(W(pe,J))}T.serialize=L;function te(pe,J){return J=J||{},U(JSON.stringify(pe),J)}T.deserialize=te})(S=e.EJSON||(e.EJSON={}))});Ut(Kl);rV=Kl.EJSON,nV=Kl.isBSONType,Gl=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.writeIEEE754=e.readIEEE754=void 0;function r(i,o,f,s,a){let u,c,_=f==="big",p=a*8-s-1,j=(1<<p)-1,S=j>>1,T=-7,U=_?0:a-1,W=_?1:-1,L=i[o+U];for(U+=W,u=L&(1<<-T)-1,L>>=-T,T+=p;T>0;u=u*256+i[o+U],U+=W,T-=8);for(c=u&(1<<-T)-1,u>>=-T,T+=s;T>0;c=c*256+i[o+U],U+=W,T-=8);if(u===0)u=1-S;else{if(u===j)return c?NaN:(L?-1:1)*(1/0);c=c+Math.pow(2,s),u=u-S}return(L?-1:1)*c*Math.pow(2,u-s)}e.readIEEE754=r;function n(i,o,f,s,a,u){let c,_,p,j=s==="big",S=u*8-a-1,T=(1<<S)-1,U=T>>1,W=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=j?u-1:0,te=j?-1:1,pe=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(_=isNaN(o)?1:0,c=T):(c=Math.floor(Math.log(o)/Math.LN2),o*(p=Math.pow(2,-c))<1&&(c--,p*=2),c+U>=1?o+=W/p:o+=W*Math.pow(2,1-U),o*p>=2&&(c++,p/=2),c+U>=T?(_=0,c=T):c+U>=1?(_=(o*p-1)*Math.pow(2,a),c=c+U):(_=o*Math.pow(2,U-1)*Math.pow(2,a),c=0)),isNaN(o)&&(_=0);a>=8;)i[f+L]=_&255,L+=te,_/=256,a-=8;for(c=c<<a|_,isNaN(o)&&(c+=8),S+=a;S>0;)i[f+L]=c&255,L+=te,c/=256,S-=8;i[f+L-te]|=pe*128}e.writeIEEE754=n});Ut(Gl);iV=Gl.writeIEEE754,oV=Gl.readIEEE754,Ip=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeInto=void 0;let r=/\x00/,n=new Set(["$db","$ref","$id","$clusterTime"]);function i(y){return Object.prototype.toString.call(y)==="[object RegExp]"}function o(y,g,N,b,z){y[b++]=G.BSON_DATA_STRING;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K+1,y[b-1]=0;let M=y.write(N,b+4,void 0,"utf8");return y[b+3]=M+1>>24&255,y[b+2]=M+1>>16&255,y[b+1]=M+1>>8&255,y[b]=M+1&255,b=b+4+M,y[b++]=0,b}function f(y,g,N,b,z){if(Number.isInteger(N)&&N>=G.BSON_INT32_MIN&&N<=G.BSON_INT32_MAX){y[b++]=G.BSON_DATA_INT;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0,y[b++]=N&255,y[b++]=N>>8&255,y[b++]=N>>16&255,y[b++]=N>>24&255}else{y[b++]=G.BSON_DATA_NUMBER;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0,Gl.writeIEEE754(y,N,b,"little",52,8),b=b+8}return b}function s(y,g,N,b,z){y[b++]=G.BSON_DATA_NULL;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,b}function a(y,g,N,b,z){y[b++]=G.BSON_DATA_BOOLEAN;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,y[b++]=N?1:0,b}function u(y,g,N,b,z){y[b++]=G.BSON_DATA_DATE;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=Se.Long.fromNumber(N.getTime()),oe=M.getLowBits(),A=M.getHighBits();return y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255,y[b++]=A&255,y[b++]=A>>8&255,y[b++]=A>>16&255,y[b++]=A>>24&255,b}function c(y,g,N,b,z){y[b++]=G.BSON_DATA_REGEXP;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");if(b=b+K,y[b++]=0,N.source&&N.source.match(r)!=null)throw Error("value "+N.source+" must not contain null bytes");return b=b+y.write(N.source,b,void 0,"utf8"),y[b++]=0,N.ignoreCase&&(y[b++]=105),N.global&&(y[b++]=115),N.multiline&&(y[b++]=109),y[b++]=0,b}function _(y,g,N,b,z){y[b++]=G.BSON_DATA_REGEXP;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");if(b=b+K,y[b++]=0,N.pattern.match(r)!=null)throw Error("pattern "+N.pattern+" must not contain null bytes");return b=b+y.write(N.pattern,b,void 0,"utf8"),y[b++]=0,b=b+y.write(N.options.split("").sort().join(""),b,void 0,"utf8"),y[b++]=0,b}function p(y,g,N,b,z){N===null?y[b++]=G.BSON_DATA_NULL:N._bsontype==="MinKey"?y[b++]=G.BSON_DATA_MIN_KEY:y[b++]=G.BSON_DATA_MAX_KEY;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,b}function j(y,g,N,b,z){y[b++]=G.BSON_DATA_OID;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");if(b=b+K,y[b++]=0,typeof N.id=="string")y.write(N.id,b,void 0,"binary");else if(N.id&&N.id.copy)N.id.copy(y,b,0,12);else throw new TypeError("object ["+JSON.stringify(N)+"] is not a valid ObjectId");return b+12}function S(y,g,N,b,z){y[b++]=G.BSON_DATA_BINARY;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=N.length;return y[b++]=M&255,y[b++]=M>>8&255,y[b++]=M>>16&255,y[b++]=M>>24&255,y[b++]=G.BSON_BINARY_SUBTYPE_DEFAULT,y.set(Mo.ensureBuffer(N),b),b=b+M,b}function T(y,g,N,b,z=!1,K=0,M=!1,oe=!0,A=!1,Ye=[]){for(let X=0;X<Ye.length;X++)if(Ye[X]===N)throw new Error("cyclic dependency detected");Ye.push(N),y[b++]=Array.isArray(N)?G.BSON_DATA_ARRAY:G.BSON_DATA_OBJECT;let me=A?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+me,y[b++]=0;let V=de(y,N,z,b,K+1,M,oe,Ye);return Ye.pop(),V}function U(y,g,N,b,z){y[b++]=G.BSON_DATA_DECIMAL128;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,N.bytes.copy(y,b,0,16),b+16}function W(y,g,N,b,z){y[b++]=N._bsontype==="Long"?G.BSON_DATA_LONG:G.BSON_DATA_TIMESTAMP;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=N.getLowBits(),oe=N.getHighBits();return y[b++]=M&255,y[b++]=M>>8&255,y[b++]=M>>16&255,y[b++]=M>>24&255,y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255,b}function L(y,g,N,b,z){N=N.valueOf(),y[b++]=G.BSON_DATA_INT;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,y[b++]=N&255,y[b++]=N>>8&255,y[b++]=N>>16&255,y[b++]=N>>24&255,b}function te(y,g,N,b,z){y[b++]=G.BSON_DATA_NUMBER;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,Gl.writeIEEE754(y,N.value,b,"little",52,8),b=b+8,b}function pe(y,g,N,b,z=!1,K=0,M){y[b++]=G.BSON_DATA_CODE;let oe=M?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+oe,y[b++]=0;let A=_t.normalizedFunctionString(N),Ye=y.write(A,b+4,void 0,"utf8")+1;return y[b]=Ye&255,y[b+1]=Ye>>8&255,y[b+2]=Ye>>16&255,y[b+3]=Ye>>24&255,b=b+4+Ye-1,y[b++]=0,b}function J(y,g,N,b,z=!1,K=0,M=!1,oe=!0,A=!1){if(N.scope&&typeof N.scope=="object"){y[b++]=G.BSON_DATA_CODE_W_SCOPE;let Ye=A?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+Ye,y[b++]=0;let me=b,V=typeof N.code=="string"?N.code:N.code.toString();b=b+4;let X=y.write(V,b+4,void 0,"utf8")+1;y[b]=X&255,y[b+1]=X>>8&255,y[b+2]=X>>16&255,y[b+3]=X>>24&255,y[b+4+X-1]=0,b=b+X+4;let He=de(y,N.scope,z,b,K+1,M,oe);b=He-1;let we=He-me;y[me++]=we&255,y[me++]=we>>8&255,y[me++]=we>>16&255,y[me++]=we>>24&255,y[b++]=0}else{y[b++]=G.BSON_DATA_CODE;let Ye=A?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+Ye,y[b++]=0;let me=N.code.toString(),V=y.write(me,b+4,void 0,"utf8")+1;y[b]=V&255,y[b+1]=V>>8&255,y[b+2]=V>>16&255,y[b+3]=V>>24&255,b=b+4+V-1,y[b++]=0}return b}function D(y,g,N,b,z){y[b++]=G.BSON_DATA_BINARY;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=N.value(!0),oe=N.position;return N.sub_type===ln.Binary.SUBTYPE_BYTE_ARRAY&&(oe=oe+4),y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255,y[b++]=N.sub_type,N.sub_type===ln.Binary.SUBTYPE_BYTE_ARRAY&&(oe=oe-4,y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255),y.set(M,b),b=b+N.position,b}function le(y,g,N,b,z){y[b++]=G.BSON_DATA_SYMBOL;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=y.write(N.value,b+4,void 0,"utf8")+1;return y[b]=M&255,y[b+1]=M>>8&255,y[b+2]=M>>16&255,y[b+3]=M>>24&255,b=b+4+M-1,y[b++]=0,b}function Y(y,g,N,b,z,K,M){y[b++]=G.BSON_DATA_OBJECT;let oe=M?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+oe,y[b++]=0;let A=b,Ye={$ref:N.collection||N.namespace,$id:N.oid};N.db!=null&&(Ye.$db=N.db),Ye=Object.assign(Ye,N.fields);let me=de(y,Ye,!1,b,z+1,K),V=me-A;return y[A++]=V&255,y[A++]=V>>8&255,y[A++]=V>>16&255,y[A++]=V>>24&255,me}function de(y,g,N=!1,b=0,z=0,K=!1,M=!0,oe=[]){b=b||0,oe=oe||[],oe.push(g);let A=b+4;if(Array.isArray(g))for(let me=0;me<g.length;me++){let V=""+me,X=g[me];if(X&&X.toBSON){if(typeof X.toBSON!="function")throw new TypeError("toBSON is not a function");X=X.toBSON()}if(typeof X=="string")A=o(y,V,X,A,!0);else if(typeof X=="number")A=f(y,V,X,A,!0);else{if(typeof X=="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(typeof X=="boolean")A=a(y,V,X,A,!0);else if(X instanceof Date||_t.isDate(X))A=u(y,V,X,A,!0);else if(X===void 0)A=s(y,V,X,A,!0);else if(X===null)A=s(y,V,X,A,!0);else if(X._bsontype==="ObjectId"||X._bsontype==="ObjectID")A=j(y,V,X,A,!0);else if(ye.Buffer.isBuffer(X)||_t.isUint8Array(X))A=S(y,V,X,A,!0);else if(X instanceof RegExp||i(X))A=c(y,V,X,A,!0);else if(typeof X=="object"&&X._bsontype==null)A=T(y,V,X,A,N,z,K,M,!0,oe);else if(typeof X=="object"&&Kl.isBSONType(X)&&X._bsontype==="Decimal128")A=U(y,V,X,A,!0);else if(X._bsontype==="Long"||X._bsontype==="Timestamp")A=W(y,V,X,A,!0);else if(X._bsontype==="Double")A=te(y,V,X,A,!0);else if(typeof X=="function"&&K)A=pe(y,V,X,A,N,z,!0);else if(X._bsontype==="Code")A=J(y,V,X,A,N,z,K,M,!0);else if(X._bsontype==="Binary")A=D(y,V,X,A,!0);else if(X._bsontype==="Symbol")A=le(y,V,X,A,!0);else if(X._bsontype==="DBRef")A=Y(y,V,X,A,z,K,!0);else if(X._bsontype==="BSONRegExp")A=_(y,V,X,A,!0);else if(X._bsontype==="Int32")A=L(y,V,X,A,!0);else if(X._bsontype==="MinKey"||X._bsontype==="MaxKey")A=p(y,V,X,A,!0);else if(typeof X._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+X._bsontype)}}else if(g instanceof Tp.Map){let me=g.entries(),V=!1;for(;!V;){let X=me.next();if(V=!!X.done,V)continue;let He=X.value[0],we=X.value[1],rt=typeof we;if(typeof He=="string"&&!n.has(He)){if(He.match(r)!=null)throw Error("key "+He+" must not contain null bytes");if(N){if(He[0]==="$")throw Error("key "+He+" must not start with '$'");if(~He.indexOf("."))throw Error("key "+He+" must not contain '.'")}}if(rt==="string")A=o(y,He,we,A);else if(rt==="number")A=f(y,He,we,A);else{if(rt==="bigint"||_t.isBigInt64Array(we)||_t.isBigUInt64Array(we))throw new TypeError("Unsupported type BigInt, please use Decimal128");if(rt==="boolean")A=a(y,He,we,A);else if(we instanceof Date||_t.isDate(we))A=u(y,He,we,A);else if(we===null||we===void 0&&M===!1)A=s(y,He,we,A);else if(we._bsontype==="ObjectId"||we._bsontype==="ObjectID")A=j(y,He,we,A);else if(ye.Buffer.isBuffer(we)||_t.isUint8Array(we))A=S(y,He,we,A);else if(we instanceof RegExp||i(we))A=c(y,He,we,A);else if(rt==="object"&&we._bsontype==null)A=T(y,He,we,A,N,z,K,M,!1,oe);else if(rt==="object"&&we._bsontype==="Decimal128")A=U(y,He,we,A);else if(we._bsontype==="Long"||we._bsontype==="Timestamp")A=W(y,He,we,A);else if(we._bsontype==="Double")A=te(y,He,we,A);else if(we._bsontype==="Code")A=J(y,He,we,A,N,z,K,M);else if(typeof we=="function"&&K)A=pe(y,He,we,A,N,z,K);else if(we._bsontype==="Binary")A=D(y,He,we,A);else if(we._bsontype==="Symbol")A=le(y,He,we,A);else if(we._bsontype==="DBRef")A=Y(y,He,we,A,z,K);else if(we._bsontype==="BSONRegExp")A=_(y,He,we,A);else if(we._bsontype==="Int32")A=L(y,He,we,A);else if(we._bsontype==="MinKey"||we._bsontype==="MaxKey")A=p(y,He,we,A);else if(typeof we._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+we._bsontype)}}}else{if(g.toBSON){if(typeof g.toBSON!="function")throw new TypeError("toBSON is not a function");if(g=g.toBSON(),g!=null&&typeof g!="object")throw new TypeError("toBSON function did not return an object")}for(let me in g){let V=g[me];if(V&&V.toBSON){if(typeof V.toBSON!="function")throw new TypeError("toBSON is not a function");V=V.toBSON()}let X=typeof V;if(typeof me=="string"&&!n.has(me)){if(me.match(r)!=null)throw Error("key "+me+" must not contain null bytes");if(N){if(me[0]==="$")throw Error("key "+me+" must not start with '$'");if(~me.indexOf("."))throw Error("key "+me+" must not contain '.'")}}if(X==="string")A=o(y,me,V,A);else if(X==="number")A=f(y,me,V,A);else{if(X==="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(X==="boolean")A=a(y,me,V,A);else if(V instanceof Date||_t.isDate(V))A=u(y,me,V,A);else if(V===void 0)M===!1&&(A=s(y,me,V,A));else if(V===null)A=s(y,me,V,A);else if(V._bsontype==="ObjectId"||V._bsontype==="ObjectID")A=j(y,me,V,A);else if(ye.Buffer.isBuffer(V)||_t.isUint8Array(V))A=S(y,me,V,A);else if(V instanceof RegExp||i(V))A=c(y,me,V,A);else if(X==="object"&&V._bsontype==null)A=T(y,me,V,A,N,z,K,M,!1,oe);else if(X==="object"&&V._bsontype==="Decimal128")A=U(y,me,V,A);else if(V._bsontype==="Long"||V._bsontype==="Timestamp")A=W(y,me,V,A);else if(V._bsontype==="Double")A=te(y,me,V,A);else if(V._bsontype==="Code")A=J(y,me,V,A,N,z,K,M);else if(typeof V=="function"&&K)A=pe(y,me,V,A,N,z,K);else if(V._bsontype==="Binary")A=D(y,me,V,A);else if(V._bsontype==="Symbol")A=le(y,me,V,A);else if(V._bsontype==="DBRef")A=Y(y,me,V,A,z,K);else if(V._bsontype==="BSONRegExp")A=_(y,me,V,A);else if(V._bsontype==="Int32")A=L(y,me,V,A);else if(V._bsontype==="MinKey"||V._bsontype==="MaxKey")A=p(y,me,V,A);else if(typeof V._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+V._bsontype)}}}oe.pop(),y[A++]=0;let Ye=A-b;return y[b++]=Ye&255,y[b++]=Ye>>8&255,y[b++]=Ye>>16&255,y[b++]=Ye>>24&255,A}e.serializeInto=de});Ut(Ip);fV=Ip.serializeInto,xe=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeStream=e.calculateObjectSize=e.deserialize=e.serializeWithBufferAndIndex=e.serialize=e.setInternalBufferSize=e.ObjectID=e.Decimal128=e.BSONRegExp=e.MaxKey=e.MinKey=e.Int32=e.Double=e.Timestamp=e.Long=e.ObjectId=e.Binary=e.DBRef=e.BSONSymbol=e.Map=e.Code=e.LongWithoutOverridesClass=e.EJSON=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=e.BSON_DATA_UNDEFINED=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_SYMBOL=e.BSON_DATA_STRING=e.BSON_DATA_REGEXP=e.BSON_DATA_OID=e.BSON_DATA_OBJECT=e.BSON_DATA_NUMBER=e.BSON_DATA_NULL=e.BSON_DATA_MIN_KEY=e.BSON_DATA_MAX_KEY=e.BSON_DATA_LONG=e.BSON_DATA_INT=e.BSON_DATA_DECIMAL128=e.BSON_DATA_DBPOINTER=e.BSON_DATA_DATE=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_CODE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=void 0,Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return ln.Binary}}),Object.defineProperty(e,"Code",{enumerable:!0,get:function(){return Uo.Code}}),Object.defineProperty(e,"DBRef",{enumerable:!0,get:function(){return Kn.DBRef}}),Object.defineProperty(e,"Decimal128",{enumerable:!0,get:function(){return Js.Decimal128}}),Object.defineProperty(e,"Double",{enumerable:!0,get:function(){return Gf.Double}}),Object.defineProperty(e,"Int32",{enumerable:!0,get:function(){return Jf.Int32}}),Object.defineProperty(e,"Long",{enumerable:!0,get:function(){return Se.Long}}),Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return Tp.Map}}),Object.defineProperty(e,"MaxKey",{enumerable:!0,get:function(){return Zs.MaxKey}}),Object.defineProperty(e,"MinKey",{enumerable:!0,get:function(){return Xs.MinKey}}),Object.defineProperty(e,"ObjectId",{enumerable:!0,get:function(){return Qi.ObjectId}}),Object.defineProperty(e,"ObjectID",{enumerable:!0,get:function(){return Qi.ObjectId}}),Object.defineProperty(e,"BSONRegExp",{enumerable:!0,get:function(){return Lo.BSONRegExp}}),Object.defineProperty(e,"BSONSymbol",{enumerable:!0,get:function(){return Qs.BSONSymbol}}),Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return Co.Timestamp}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_BYTE_ARRAY",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_BYTE_ARRAY}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_DEFAULT",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_DEFAULT}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_FUNCTION",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_FUNCTION}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_MD5",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_MD5}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_USER_DEFINED",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_USER_DEFINED}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_UUID}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID_NEW",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_UUID_NEW}}),Object.defineProperty(e,"BSON_DATA_ARRAY",{enumerable:!0,get:function(){return G.BSON_DATA_ARRAY}}),Object.defineProperty(e,"BSON_DATA_BINARY",{enumerable:!0,get:function(){return G.BSON_DATA_BINARY}}),Object.defineProperty(e,"BSON_DATA_BOOLEAN",{enumerable:!0,get:function(){return G.BSON_DATA_BOOLEAN}}),Object.defineProperty(e,"BSON_DATA_CODE",{enumerable:!0,get:function(){return G.BSON_DATA_CODE}}),Object.defineProperty(e,"BSON_DATA_CODE_W_SCOPE",{enumerable:!0,get:function(){return G.BSON_DATA_CODE_W_SCOPE}}),Object.defineProperty(e,"BSON_DATA_DATE",{enumerable:!0,get:function(){return G.BSON_DATA_DATE}}),Object.defineProperty(e,"BSON_DATA_DBPOINTER",{enumerable:!0,get:function(){return G.BSON_DATA_DBPOINTER}}),Object.defineProperty(e,"BSON_DATA_DECIMAL128",{enumerable:!0,get:function(){return G.BSON_DATA_DECIMAL128}}),Object.defineProperty(e,"BSON_DATA_INT",{enumerable:!0,get:function(){return G.BSON_DATA_INT}}),Object.defineProperty(e,"BSON_DATA_LONG",{enumerable:!0,get:function(){return G.BSON_DATA_LONG}}),Object.defineProperty(e,"BSON_DATA_MAX_KEY",{enumerable:!0,get:function(){return G.BSON_DATA_MAX_KEY}}),Object.defineProperty(e,"BSON_DATA_MIN_KEY",{enumerable:!0,get:function(){return G.BSON_DATA_MIN_KEY}}),Object.defineProperty(e,"BSON_DATA_NULL",{enumerable:!0,get:function(){return G.BSON_DATA_NULL}}),Object.defineProperty(e,"BSON_DATA_NUMBER",{enumerable:!0,get:function(){return G.BSON_DATA_NUMBER}}),Object.defineProperty(e,"BSON_DATA_OBJECT",{enumerable:!0,get:function(){return G.BSON_DATA_OBJECT}}),Object.defineProperty(e,"BSON_DATA_OID",{enumerable:!0,get:function(){return G.BSON_DATA_OID}}),Object.defineProperty(e,"BSON_DATA_REGEXP",{enumerable:!0,get:function(){return G.BSON_DATA_REGEXP}}),Object.defineProperty(e,"BSON_DATA_STRING",{enumerable:!0,get:function(){return G.BSON_DATA_STRING}}),Object.defineProperty(e,"BSON_DATA_SYMBOL",{enumerable:!0,get:function(){return G.BSON_DATA_SYMBOL}}),Object.defineProperty(e,"BSON_DATA_TIMESTAMP",{enumerable:!0,get:function(){return G.BSON_DATA_TIMESTAMP}}),Object.defineProperty(e,"BSON_DATA_UNDEFINED",{enumerable:!0,get:function(){return G.BSON_DATA_UNDEFINED}}),Object.defineProperty(e,"BSON_INT32_MAX",{enumerable:!0,get:function(){return G.BSON_INT32_MAX}}),Object.defineProperty(e,"BSON_INT32_MIN",{enumerable:!0,get:function(){return G.BSON_INT32_MIN}}),Object.defineProperty(e,"BSON_INT64_MAX",{enumerable:!0,get:function(){return G.BSON_INT64_MAX}}),Object.defineProperty(e,"BSON_INT64_MIN",{enumerable:!0,get:function(){return G.BSON_INT64_MIN}}),Object.defineProperty(e,"JS_INT_MAX",{enumerable:!0,get:function(){return G.JS_INT_MAX}}),Object.defineProperty(e,"JS_INT_MIN",{enumerable:!0,get:function(){return G.JS_INT_MIN}}),Object.defineProperty(e,"EJSON",{enumerable:!0,get:function(){return Kl.EJSON}});var r=Co;Object.defineProperty(e,"LongWithoutOverridesClass",{enumerable:!0,get:function(){return r.LongWithoutOverridesClass}});let n=1024*1024*17,i=ye.Buffer.alloc(n);function o(_){i.length<_&&(i=ye.Buffer.alloc(_))}e.setInternalBufferSize=o;function f(_,p={}){let j=typeof p.checkKeys=="boolean"?p.checkKeys:!1,S=typeof p.serializeFunctions=="boolean"?p.serializeFunctions:!1,T=typeof p.ignoreUndefined=="boolean"?p.ignoreUndefined:!0,U=typeof p.minInternalBufferSize=="number"?p.minInternalBufferSize:n;i.length<U&&(i=ye.Buffer.alloc(U));let W=Ip.serializeInto(i,_,j,0,0,S,T,[]),L=ye.Buffer.alloc(W);return i.copy(L,0,0,L.length),L}e.serialize=f;function s(_,p,j={}){let S=typeof j.checkKeys=="boolean"?j.checkKeys:!1,T=typeof j.serializeFunctions=="boolean"?j.serializeFunctions:!1,U=typeof j.ignoreUndefined=="boolean"?j.ignoreUndefined:!0,W=typeof j.index=="number"?j.index:0,L=Ip.serializeInto(i,_,S,0,0,T,U);return i.copy(p,W,0,L),W+L-1}e.serializeWithBufferAndIndex=s;function a(_,p={}){return kp.deserialize(Mo.ensureBuffer(_),p)}e.deserialize=a;function u(_,p={}){p=p||{};let j=typeof p.serializeFunctions=="boolean"?p.serializeFunctions:!1,S=typeof p.ignoreUndefined=="boolean"?p.ignoreUndefined:!0;return Bh.calculateObjectSize(_,j,S)}e.calculateObjectSize=u;function c(_,p,j,S,T,U){let W=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},U),L=Mo.ensureBuffer(_),te=p;for(let pe=0;pe<j;pe++){let J=L[te]|L[te+1]<<8|L[te+2]<<16|L[te+3]<<24;W.index=te,S[T+pe]=kp.deserialize(L,W),te=te+J}return te}e.deserializeStream=c}),sV=Ut(xe),aV=xe.deserializeStream,lV=xe.calculateObjectSize,Qv=xe.deserialize,uV=xe.serializeWithBufferAndIndex,$v=xe.serialize,cV=xe.setInternalBufferSize,pV=xe.ObjectID,dV=xe.Decimal128,mV=xe.BSONRegExp,bV=xe.MaxKey,hV=xe.MinKey,wV=xe.Int32,gV=xe.Double,yV=xe.Timestamp,jV=xe.Long,_V=xe.ObjectId,qV=xe.Binary,vV=xe.DBRef,TV=xe.BSONSymbol,BV=xe.Map,kV=xe.Code,IV=xe.LongWithoutOverridesClass,SV=xe.EJSON,xV=xe.JS_INT_MIN,EV=xe.JS_INT_MAX,AV=xe.BSON_INT64_MIN,OV=xe.BSON_INT64_MAX,NV=xe.BSON_INT32_MIN,DV=xe.BSON_INT32_MAX,FV=xe.BSON_DATA_UNDEFINED,PV=xe.BSON_DATA_TIMESTAMP,RV=xe.BSON_DATA_SYMBOL,zV=xe.BSON_DATA_STRING,HV=xe.BSON_DATA_REGEXP,MV=xe.BSON_DATA_OID,UV=xe.BSON_DATA_OBJECT,LV=xe.BSON_DATA_NUMBER,CV=xe.BSON_DATA_NULL,VV=xe.BSON_DATA_MIN_KEY,WV=xe.BSON_DATA_MAX_KEY,YV=xe.BSON_DATA_LONG,KV=xe.BSON_DATA_INT,GV=xe.BSON_DATA_DECIMAL128,JV=xe.BSON_DATA_DBPOINTER,ZV=xe.BSON_DATA_DATE,XV=xe.BSON_DATA_CODE_W_SCOPE,QV=xe.BSON_DATA_CODE,$V=xe.BSON_DATA_BOOLEAN,e5=xe.BSON_DATA_BINARY,t5=xe.BSON_DATA_ARRAY,r5=xe.BSON_BINARY_SUBTYPE_UUID_NEW,n5=xe.BSON_BINARY_SUBTYPE_UUID,i5=xe.BSON_BINARY_SUBTYPE_USER_DEFINED,o5=xe.BSON_BINARY_SUBTYPE_MD5,f5=xe.BSON_BINARY_SUBTYPE_FUNCTION,s5=xe.BSON_BINARY_SUBTYPE_DEFAULT,a5=xe.BSON_BINARY_SUBTYPE_BYTE_ARRAY});function Ih(t,e){return Qv(new Uint8Array(t),e)}var eT=re(()=>{kh()});async function oN(t,e){let r={...Sh.bson,...e==null?void 0:e.bson};return Ih(t,r)}function fN(t,e){let r={...Sh.bson,...e==null?void 0:e.bson};return Ih(t,r)}var iN,Sh,xh,tT=re(()=>{eT();iN="3.4.13",Sh={bson:{}},xh={name:"BSON",id:"bson",module:"bson",version:iN,extensions:["bson"],mimeTypes:["application/bson"],category:"json",binary:!0,parse:oN,parseSync:fN,options:Sh}});function Eh(t,e){return $v(t).buffer}var rT=re(()=>{kh()});var sN,Ah,nT=re(()=>{rT();sN="3.4.13",Ah={name:"BSON",id:"bson",module:"bson",version:sN,extensions:["bson"],options:{image:{mimeType:"application/bson"}},async encode(t,e){return Eh(t,{})},encodeSync(t,e){return Eh(t,{})}}});var iT=re(()=>{tT();nT()});function oT(t,e,r){if(!(t in Zf))throw new Error(`invalid type: ${t}`);return Zf[t].toPrimitive(e,r)}function fT(t,e,r){if(!(t in Zf))throw new Error(`invalid type: ${t}`);return"fromPrimitive"in Zf[t]?Zf[t].fromPrimitive?.(e,r):e}function aN(t){return Boolean(t)}function lN(t){return Boolean(t)}function uN(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for FLOAT: ${t}`);return e}function cN(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for DOUBLE: ${t}`);return e}function pN(t){let e=parseInt(t,10);if(e<-128||e>127||isNaN(e))throw new Error(`invalid value for INT8: ${t}`);return e}function dN(t){let e=parseInt(t,10);if(e<0||e>255||isNaN(e))throw new Error(`invalid value for UINT8: ${t}`);return e}function mN(t){let e=parseInt(t,10);if(e<-32768||e>32767||isNaN(e))throw new Error(`invalid value for INT16: ${t}`);return e}function bN(t){let e=parseInt(t,10);if(e<0||e>65535||isNaN(e))throw new Error(`invalid value for UINT16: ${t}`);return e}function sT(t){let e=parseInt(t,10);if(e<-2147483648||e>2147483647||isNaN(e))throw new Error(`invalid value for INT32: ${t}`);return e}function hN(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(n<-2147483648||n>2147483647||isNaN(n))throw new Error(`invalid value for INT32: ${t}`);return n}function wN(t){let e=parseInt(t,10);if(e<0||e>281474976710655||isNaN(e))throw new Error(`invalid value for UINT32: ${t}`);return e}function aT(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT64: ${t}`);return e}function gN(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(isNaN(n))throw new Error(`invalid value for INT64: ${t}`);return n}function yN(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for UINT64: ${t}`);return e}function jN(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT96: ${t}`);return e}function lT(t){return Buffer.from(t)}function uT(t){return Buffer.from(t)}function _N(t){return Buffer.from(t,"utf8")}function qN(t){return t.toString()}function vN(t){return Buffer.from(JSON.stringify(t))}function TN(t){return JSON.parse(t)}function BN(t){let e=Ah.encodeSync?.(t);return Buffer.from(e)}function kN(t){return xh.parseSync?.(t)}function IN(t){let e=parseInt(t,10);if(e<0||e>18446744073709552e3||isNaN(e))throw new Error(`invalid value for TIME_MILLIS: ${t}`);return e}function SN(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIME_MICROS: ${t}`);return e}function xN(t){if(t instanceof Date)return t.getTime()/cT;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for DATE: ${t}`);return e}}function EN(t){return new Date(t*cT)}function AN(t){if(t instanceof Date)return t.getTime();{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MILLIS: ${t}`);return e}}function ON(t){return new Date(t)}function NN(t){if(t instanceof Date)return t.getTime()*1e3;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MICROS: ${t}`);return e}}function DN(t){return new Date(t/1e3)}function FN(t){if(!t.months||!t.days||!t.milliseconds)throw new Error("value for INTERVAL must be object { months: ..., days: ..., milliseconds: ... }");let e=Buffer.alloc(12);return e.writeUInt32LE(t.months,0),e.writeUInt32LE(t.days,4),e.writeUInt32LE(t.milliseconds,8),e}function PN(t){let e=Buffer.from(t),r=e.readUInt32LE(0),n=e.readUInt32LE(4),i=e.readUInt32LE(8);return{months:r,days:n,milliseconds:i}}function pT(t,e){return Math.round(t*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}function dT(t,e){let r=0;if(t.length<=4)for(let i=0;i<t.length;i++)r+=t[i]<<8*(t.length-i-1);else for(let i=0;i<t.length;i++)r+=t[i]*2**(8*(t.length-1-i));return Math.round(r*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}var Zf,cT,Oh=re(()=>{iT();Zf={BOOLEAN:{primitiveType:"BOOLEAN",toPrimitive:aN,fromPrimitive:lN},INT32:{primitiveType:"INT32",toPrimitive:sT},INT64:{primitiveType:"INT64",toPrimitive:aT},INT96:{primitiveType:"INT96",toPrimitive:jN},FLOAT:{primitiveType:"FLOAT",toPrimitive:uN},DOUBLE:{primitiveType:"DOUBLE",toPrimitive:cN},BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",toPrimitive:lT},FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",toPrimitive:lT},UTF8:{primitiveType:"BYTE_ARRAY",originalType:"UTF8",toPrimitive:_N,fromPrimitive:qN},TIME_MILLIS:{primitiveType:"INT32",originalType:"TIME_MILLIS",toPrimitive:IN},TIME_MICROS:{primitiveType:"INT64",originalType:"TIME_MICROS",toPrimitive:SN},DATE:{primitiveType:"INT32",originalType:"DATE",toPrimitive:xN,fromPrimitive:EN},TIMESTAMP_MILLIS:{primitiveType:"INT64",originalType:"TIMESTAMP_MILLIS",toPrimitive:AN,fromPrimitive:ON},TIMESTAMP_MICROS:{primitiveType:"INT64",originalType:"TIMESTAMP_MICROS",toPrimitive:NN,fromPrimitive:DN},UINT_8:{primitiveType:"INT32",originalType:"UINT_8",toPrimitive:dN},UINT_16:{primitiveType:"INT32",originalType:"UINT_16",toPrimitive:bN},UINT_32:{primitiveType:"INT32",originalType:"UINT_32",toPrimitive:wN},UINT_64:{primitiveType:"INT64",originalType:"UINT_64",toPrimitive:yN},INT_8:{primitiveType:"INT32",originalType:"INT_8",toPrimitive:pN},INT_16:{primitiveType:"INT32",originalType:"INT_16",toPrimitive:mN},INT_32:{primitiveType:"INT32",originalType:"INT_32",toPrimitive:sT},INT_64:{primitiveType:"INT64",originalType:"INT_64",toPrimitive:aT},JSON:{primitiveType:"BYTE_ARRAY",originalType:"JSON",toPrimitive:vN,fromPrimitive:TN},BSON:{primitiveType:"BYTE_ARRAY",originalType:"BSON",toPrimitive:BN,fromPrimitive:kN},INTERVAL:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"INTERVAL",typeLength:12,toPrimitive:FN,fromPrimitive:PN},DECIMAL_INT32:{primitiveType:"INT32",originalType:"DECIMAL_INT32",toPrimitive:hN,fromPrimitive:pT},DECIMAL_INT64:{primitiveType:"INT64",originalType:"DECIMAL_INT64",toPrimitive:gN,fromPrimitive:pT},DECIMAL_BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",originalType:"DECIMAL_BYTE_ARRAY",toPrimitive:uT,fromPrimitive:dT},DECIMAL_FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"DECIMAL_FIXED_LEN_BYTE_ARRAY",toPrimitive:uT,fromPrimitive:dT}};cT=864e5});function Nh(t){let e={};for(let r of t.fieldList)e[r.key]={dlevels:[],rlevels:[],values:[],pageHeaders:[],count:0};return{rowCount:0,columnData:e}}function Sp(t,e,r){let n=Nh(t).columnData;if(Dh(t.fields,e,n,0,0),r.rowCount===0){r.rowCount=1,r.columnData=n;return}r.rowCount+=1;for(let i of t.fieldList)Array.prototype.push.apply(r.columnData[i.key].rlevels,n[i.key].rlevels),Array.prototype.push.apply(r.columnData[i.key].dlevels,n[i.key].dlevels),Array.prototype.push.apply(r.columnData[i.key].values,n[i.key].values),r.columnData[i.key].count+=n[i.key].count}function Dh(t,e,r,n,i){for(let o in t){let f=t[o],s=[];if(e&&f.name in e&&e[f.name]!==void 0&&e[f.name]!==null&&(e[f.name].constructor===Array?s=e[f.name]:s.push(e[f.name])),s.length===0&&Boolean(e)&&f.repetitionType==="REQUIRED")throw new Error(`missing required field: ${f.name}`);if(s.length>1&&f.repetitionType!=="REPEATED")throw new Error(`too many values for field: ${f.name}`);if(s.length===0){f.isNested?Dh(f.fields,null,r,n,i):(r[f.key].count+=1,r[f.key].rlevels.push(n),r[f.key].dlevels.push(i));continue}for(let a=0;a<s.length;a++){let u=a===0?n:f.rLevelMax;f.isNested?Dh(f.fields,s[a],r,u,f.dLevelMax):(r[f.key].count+=1,r[f.key].rlevels.push(u),r[f.key].dlevels.push(f.dLevelMax),r[f.key].values.push(oT(f.originalType||f.primitiveType,s[a])))}}}function xp(t,e){let r=[];for(let n=0;n<e.rowCount;n++)r.push({});for(let n in e.columnData){let i=e.columnData[n];i.count&&RN(t,i,n,r)}return r}function RN(t,e,r,n){let i=t.findField(r),o=t.findFieldBranch(r),f=new Array(i.rLevelMax+1).fill(0),s=0;for(let a=0;a<e.count;a++){let u=e.dlevels[a],c=e.rlevels[a];f[c]++,f.fill(0,c+1);let _=0,p=n[f[_++]-1];for(let j of o){if(j===i||u<j.dLevelMax)break;switch(j.repetitionType){case"REPEATED":j.name in p||(p[j.name]=[]);let S=f[_++];for(;p[j.name].length<=S;)p[j.name].push({});p=p[j.name][S];break;default:p[j.name]=p[j.name]||{},p=p[j.name]}}if(u===i.dLevelMax){let j=fT(i.originalType||i.primitiveType,e.values[s],i);switch(s++,i.repetitionType){case"REPEATED":i.name in p||(p[i.name]=[]);let S=f[_];for(;p[i.name].length<=S;)p[i.name].push(null);p[i.name][S]=j;break;default:p[i.name]=j}}}}var Ep=re(()=>{Oh()});function Fh(t,e){for(let r in t){let n=t[r];n.fields?Fh(n.fields,e):n.compression=e}}function mT(t,e,r,n){let i={};for(let o in t){let f=t[o],s=!f.optional,a=Boolean(f.repeated),u=e,c=r,_="REQUIRED";if(s||(_="OPTIONAL",c++),a&&(_="REPEATED",u++,s&&c++),f.fields){let S=n.concat([o]);i[o]={name:o,path:S,key:S.join(),repetitionType:_,rLevelMax:u,dLevelMax:c,isNested:!0,fieldCount:Object.keys(f.fields).length,fields:mT(f.fields,u,c,S)};continue}let p=Zf[f.type];if(!p)throw new Error(`invalid parquet type: ${f.type}`);if(f.encoding=f.encoding||"PLAIN",!(f.encoding in No))throw new Error(`unsupported parquet encoding: ${f.encoding}`);if(f.compression=f.compression||"UNCOMPRESSED",!(f.compression in Wl))throw new Error(`unsupported compression method: ${f.compression}`);let j=n.concat([o]);i[o]={name:o,primitiveType:p.primitiveType,originalType:p.originalType,path:j,key:j.join(),repetitionType:_,encoding:f.encoding,compression:f.compression,typeLength:f.typeLength||p.typeLength,presision:f.presision,scale:f.scale,rLevelMax:u,dLevelMax:c}}return i}function bT(t){let e=[];for(let r in t)e.push(t[r]),t[r].isNested&&(e=e.concat(bT(t[r].fields)));return e}var Jl,Ph=re(()=>{Fc();Yl();Ep();Oh();Jl=class{constructor(e){this.schema=e,this.fields=mT(e,0,0,[]),this.fieldList=bT(this.fields)}findField(e){typeof e=="string"?e=e.split(","):e=e.slice(0);let r=this.fields;for(;e.length>1;e.shift())r=r[e[0]].fields;return r[e[0]]}findFieldBranch(e){typeof e=="string"&&(e=e.split(","));let r=[],n=this.fields;for(;e.length>0;e.shift())r.push(n[e[0]]),e.length>1&&(n=n[e[0]].fields);return r}shredRecord(e,r){Sp(this,e,r)}materializeRecords(e){return xp(this,e)}compress(e){return Fh(this.schema,e),Fh(this.fields,e),this}buffer(){return Nh(this)}}});var $i,hT=re(()=>{(function(a){a[a.BOOLEAN=0]="BOOLEAN",a[a.INT32=1]="INT32",a[a.INT64=2]="INT64",a[a.INT96=3]="INT96",a[a.FLOAT=4]="FLOAT",a[a.DOUBLE=5]="DOUBLE",a[a.BYTE_ARRAY=6]="BYTE_ARRAY",a[a.FIXED_LEN_BYTE_ARRAY=7]="FIXED_LEN_BYTE_ARRAY"})($i||($i={}))});var $s,wT=re(()=>{(function(D){D[D.UTF8=0]="UTF8",D[D.MAP=1]="MAP",D[D.MAP_KEY_VALUE=2]="MAP_KEY_VALUE",D[D.LIST=3]="LIST",D[D.ENUM=4]="ENUM",D[D.DECIMAL=5]="DECIMAL",D[D.DATE=6]="DATE",D[D.TIME_MILLIS=7]="TIME_MILLIS",D[D.TIME_MICROS=8]="TIME_MICROS",D[D.TIMESTAMP_MILLIS=9]="TIMESTAMP_MILLIS",D[D.TIMESTAMP_MICROS=10]="TIMESTAMP_MICROS",D[D.UINT_8=11]="UINT_8",D[D.UINT_16=12]="UINT_16",D[D.UINT_32=13]="UINT_32",D[D.UINT_64=14]="UINT_64",D[D.INT_8=15]="INT_8",D[D.INT_16=16]="INT_16",D[D.INT_32=17]="INT_32",D[D.INT_64=18]="INT_64",D[D.JSON=19]="JSON",D[D.BSON=20]="BSON",D[D.INTERVAL=21]="INTERVAL"})($s||($s={}))});var ea,gT=re(()=>{(function(n){n[n.REQUIRED=0]="REQUIRED",n[n.OPTIONAL=1]="OPTIONAL",n[n.REPEATED=2]="REPEATED"})(ea||(ea={}))});var Gr,yT=re(()=>{(function(a){a[a.PLAIN=0]="PLAIN",a[a.PLAIN_DICTIONARY=2]="PLAIN_DICTIONARY",a[a.RLE=3]="RLE",a[a.BIT_PACKED=4]="BIT_PACKED",a[a.DELTA_BINARY_PACKED=5]="DELTA_BINARY_PACKED",a[a.DELTA_LENGTH_BYTE_ARRAY=6]="DELTA_LENGTH_BYTE_ARRAY",a[a.DELTA_BYTE_ARRAY=7]="DELTA_BYTE_ARRAY",a[a.RLE_DICTIONARY=8]="RLE_DICTIONARY"})(Gr||(Gr={}))});var ta,jT=re(()=>{(function(a){a[a.UNCOMPRESSED=0]="UNCOMPRESSED",a[a.SNAPPY=1]="SNAPPY",a[a.GZIP=2]="GZIP",a[a.LZO=3]="LZO",a[a.BROTLI=4]="BROTLI",a[a.LZ4=5]="LZ4",a[a.ZSTD=6]="ZSTD",a[a.LZ4_RAW=7]="LZ4_RAW"})(ta||(ta={}))});var Xf,_T=re(()=>{(function(i){i[i.DATA_PAGE=0]="DATA_PAGE",i[i.INDEX_PAGE=1]="INDEX_PAGE",i[i.DICTIONARY_PAGE=2]="DICTIONARY_PAGE",i[i.DATA_PAGE_V2=3]="DATA_PAGE_V2"})(Xf||(Xf={}))});var qT,vT=re(()=>{(function(n){n[n.UNORDERED=0]="UNORDERED",n[n.ASCENDING=1]="ASCENDING",n[n.DESCENDING=2]="DESCENDING"})(qT||(qT={}))});var Mr=H((R5,BT)=>{var Rh=4294967296,TT=[];for(ra=0;ra<256;ra++)TT[ra]=(ra>15?"":"0")+ra.toString(16);var ra,Zl=BT.exports=function(t,e){t instanceof Buffer?(this.buffer=t,this.offset=e||0):Object.prototype.toString.call(t)=="[object Uint8Array]"?(this.buffer=new Buffer(t),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};Zl.MAX_INT=Math.pow(2,53);Zl.MIN_INT=-Math.pow(2,53);Zl.prototype={constructor:Zl,_2scomp:function(){for(var t=this.buffer,e=this.offset,r=1,n=e+7;n>=e;n--){var i=(t[n]^255)+r;t[n]=i&255,r=i>>8}},setValue:function(t,e){var r=!1;if(arguments.length==1)if(typeof t=="number"){if(r=t<0,t=Math.abs(t),e=t%Rh,t=t/Rh,t>Rh)throw new RangeError(t+" is outside Int64 range");t=t|0}else if(typeof t=="string")t=(t+"").replace(/^0x/,""),e=t.substr(-8),t=t.length>8?t.substr(0,t.length-8):"",t=parseInt(t,16),e=parseInt(e,16);else throw new Error(t+" must be a Number or String");for(var n=this.buffer,i=this.offset,o=7;o>=0;o--)n[i+o]=e&255,e=o==4?t:e>>>8;r&&this._2scomp()},toNumber:function(t){for(var e=this.buffer,r=this.offset,n=e[r]&128,i=0,o=1,f=7,s=1;f>=0;f--,s*=256){var a=e[r+f];n&&(a=(a^255)+o,o=a>>8,a=a&255),i+=a*s}return!t&&i>=Zl.MAX_INT?n?-1/0:1/0:n?-i:i},valueOf:function(){return this.toNumber(!1)},toString:function(t){return this.valueOf().toString(t||10)},toOctetString:function(t){for(var e=new Array(8),r=this.buffer,n=this.offset,i=0;i<8;i++)e[i]=TT[r[n+i]];return e.join(t||"")},toBuffer:function(t){if(t&&this.offset===0)return this.buffer;var e=new Buffer(8);return this.buffer.copy(e,0,this.offset,this.offset+8),e},copy:function(t,e){this.buffer.copy(t,e||0,this.offset,this.offset+8)},compare:function(t){if((this.buffer[this.offset]&128)!=(t.buffer[t.offset]&128))return t.buffer[t.offset]-this.buffer[this.offset];for(var e=0;e<8;e++)if(this.buffer[this.offset+e]!==t.buffer[t.offset+e])return this.buffer[this.offset+e]-t.buffer[t.offset+e];return 0},equals:function(t){return this.compare(t)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var IT=H((z5,kT)=>{kT.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var ST=H((H5,zh)=>{typeof Object.create=="function"?zh.exports=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:zh.exports=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}});var eo=H(wt=>{var xT=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(e,r[i]);return n},zN=/%[sdj%]/g;wt.format=function(t){if(!Dp(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(Vo(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(zN,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return s}}),f=n[r];r<i;f=n[++r])Np(f)||!na(f)?o+=" "+f:o+=" "+Vo(f);return o};wt.deprecate=function(t,e){if(typeof process!="undefined"&&process.noDeprecation===!0)return t;if(typeof process=="undefined")return function(){return wt.deprecate(t,e).apply(this,arguments)};var r=!1;function n(){if(!r){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n};var Ap={},Hh;wt.debuglog=function(t){if(Wo(Hh)&&(Hh=process.env.NODE_DEBUG||""),t=t.toUpperCase(),!Ap[t])if(new RegExp("\\b"+t+"\\b","i").test(Hh)){var e=process.pid;Ap[t]=function(){var r=wt.format.apply(wt,arguments);console.error("%s %d: %s",t,e,r)}}else Ap[t]=function(){};return Ap[t]};function Vo(t,e){var r={seen:[],stylize:MN};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Lh(e)?r.showHidden=e:e&&wt._extend(r,e),Wo(r.showHidden)&&(r.showHidden=!1),Wo(r.depth)&&(r.depth=2),Wo(r.colors)&&(r.colors=!1),Wo(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=HN),Op(r,t,r.depth)}wt.inspect=Vo;Vo.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]};Vo.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function HN(t,e){var r=Vo.styles[e];return r?"["+Vo.colors[r][0]+"m"+t+"["+Vo.colors[r][1]+"m":t}function MN(t,e){return t}function UN(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Op(t,e,r){if(t.customInspect&&e&&Rp(e.inspect)&&e.inspect!==wt.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Dp(n)||(n=Op(t,n,r)),n}var i=LN(t,e);if(i)return i;var o=Object.keys(e),f=UN(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Pp(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Mh(e);if(o.length===0){if(Rp(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Fp(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ch(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Pp(e))return Mh(e)}var a="",u=!1,c=["{","}"];if(ET(e)&&(u=!0,c=["[","]"]),Rp(e)){var _=e.name?": "+e.name:"";a=" [Function"+_+"]"}if(Fp(e)&&(a=" "+RegExp.prototype.toString.call(e)),Ch(e)&&(a=" "+Date.prototype.toUTCString.call(e)),Pp(e)&&(a=" "+Mh(e)),o.length===0&&(!u||e.length==0))return c[0]+a+c[1];if(r<0)return Fp(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var p;return u?p=CN(t,e,r,f,o):p=o.map(function(j){return Uh(t,e,r,f,j,u)}),t.seen.pop(),VN(p,a,c)}function LN(t,e){if(Wo(e))return t.stylize("undefined","undefined");if(Dp(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(AT(e))return t.stylize(""+e,"number");if(Lh(e))return t.stylize(""+e,"boolean");if(Np(e))return t.stylize("null","null")}function Mh(t){return"["+Error.prototype.toString.call(t)+"]"}function CN(t,e,r,n,i){for(var o=[],f=0,s=e.length;f<s;++f)OT(e,String(f))?o.push(Uh(t,e,r,n,String(f),!0)):o.push("");return i.forEach(function(a){a.match(/^\d+$/)||o.push(Uh(t,e,r,n,a,!0))}),o}function Uh(t,e,r,n,i,o){var f,s,a;if(a=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},a.get?a.set?s=t.stylize("[Getter/Setter]","special"):s=t.stylize("[Getter]","special"):a.set&&(s=t.stylize("[Setter]","special")),OT(n,i)||(f="["+i+"]"),s||(t.seen.indexOf(a.value)<0?(Np(r)?s=Op(t,a.value,null):s=Op(t,a.value,r-1),s.indexOf(`
12
+ `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Gv(t){return Array.isArray(t)}function _h(t){return typeof t=="boolean"}function yp(t){return t===null}function Z2(t){return t==null}function Jv(t){return typeof t=="number"}function jp(t){return typeof t=="string"}function X2(t){return babelHelpers.typeof(t)==="symbol"}function Xi(t){return t===void 0}function _p(t){return Gs(t)&&vh(t)==="[object RegExp]"}function Gs(t){return babelHelpers.typeof(t)==="object"&&t!==null}function qh(t){return Gs(t)&&vh(t)==="[object Date]"}function qp(t){return Gs(t)&&(vh(t)==="[object Error]"||t instanceof Error)}function vp(t){return typeof t=="function"}function Q2(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||babelHelpers.typeof(t)==="symbol"||typeof t=="undefined"}function $2(t){return Buffer.isBuffer(t)}function vh(t){return Object.prototype.toString.call(t)}function Th(t){return t<10?"0"+t.toString(10):t.toString(10)}function tN(){var t=new Date,e=[Th(t.getHours()),Th(t.getMinutes()),Th(t.getSeconds())].join(":");return[t.getDate(),eN[t.getMonth()],e].join(" ")}function rN(){console.log("%s - %s",tN(),wh.apply(null,arguments))}function Zv(t,e){if(!e||!Gs(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function Xv(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var hp,S2,x2,E2,di,gn,A2,dh,Kf,Wv,mh,z2,H2,Ks,ye,M8,U8,L8,C8,Mo,V8,bh,W8,ln,Y8,Uo,K8,M2,hh,U2,L2,wp,gh,eN,nN,_t,G8,J8,Z8,X8,Q8,$8,eC,tC,rC,nC,Kn,iC,oC,Se,fC,Js,sC,Gf,aC,Jf,lC,Tp,cC,Zs,pC,Xs,dC,Qi,mC,G,bC,hC,wC,gC,yC,jC,_C,qC,vC,TC,BC,kC,IC,SC,xC,EC,AC,OC,NC,DC,FC,PC,RC,zC,HC,MC,UC,LC,CC,VC,WC,YC,KC,GC,Bh,JC,Lo,ZC,Qs,XC,Co,QC,$C,Bp,eV,kp,tV,Kl,rV,nV,Gl,iV,oV,Ip,fV,xe,sV,aV,lV,Qv,uV,$v,cV,pV,dV,mV,bV,hV,wV,gV,yV,jV,_V,qV,vV,TV,BV,kV,IV,SV,xV,EV,AV,OV,NV,DV,FV,PV,RV,zV,HV,MV,UV,LV,CV,VV,WV,YV,KV,GV,JV,ZV,XV,QV,$V,e5,t5,r5,n5,i5,o5,f5,s5,a5,kh=re(()=>{hp=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};S2=O2,x2=D2,E2=R2,di=[],gn=[],A2=typeof Uint8Array!="undefined"?Uint8Array:Array,dh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Kf=0,Wv=dh.length;Kf<Wv;++Kf)di[Kf]=dh[Kf],gn[dh.charCodeAt(Kf)]=Kf;gn["-".charCodeAt(0)]=62;gn["_".charCodeAt(0)]=63;mh={byteLength:S2,toByteArray:x2,fromByteArray:E2},z2=function(e,r,n,i,o){var f,s,a=o*8-i-1,u=(1<<a)-1,c=u>>1,_=-7,p=n?o-1:0,j=n?-1:1,S=e[r+p];for(p+=j,f=S&(1<<-_)-1,S>>=-_,_+=a;_>0;f=f*256+e[r+p],p+=j,_-=8);for(s=f&(1<<-_)-1,f>>=-_,_+=i;_>0;s=s*256+e[r+p],p+=j,_-=8);if(f===0)f=1-c;else{if(f===u)return s?NaN:(S?-1:1)*(1/0);s=s+Math.pow(2,i),f=f-c}return(S?-1:1)*s*Math.pow(2,f-i)},H2=function(e,r,n,i,o,f){var s,a,u,c=f*8-o-1,_=(1<<c)-1,p=_>>1,j=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=i?0:f-1,T=i?1:-1,U=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,s=_):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+p>=1?r+=j/u:r+=j*Math.pow(2,1-p),r*u>=2&&(s++,u/=2),s+p>=_?(a=0,s=_):s+p>=1?(a=(r*u-1)*Math.pow(2,o),s=s+p):(a=r*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;e[n+S]=a&255,S+=T,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+S]=s&255,S+=T,s/=256,c-=8);e[n+S-T]|=U*128},Ks={read:z2,write:H2},ye=Ft(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=U,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,f.TYPED_ARRAY_SUPPORT=i(),!f.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var q=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(q,d),q.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(!!f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(!!f.isBuffer(this))return this.byteOffset}});function o(q){if(q>n)throw new RangeError('The value "'+q+'" is invalid for option "size"');var d=new Uint8Array(q);return Object.setPrototypeOf(d,f.prototype),d}function f(q,d,m){if(typeof q=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(q)}return s(q,d,m)}f.poolSize=8192;function s(q,d,m){if(typeof q=="string")return _(q,d);if(ArrayBuffer.isView(q))return p(q);if(q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(q));if(Ke(q,ArrayBuffer)||q&&Ke(q.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ke(q,SharedArrayBuffer)||q&&Ke(q.buffer,SharedArrayBuffer)))return j(q,d,m);if(typeof q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var B=q.valueOf&&q.valueOf();if(B!=null&&B!==q)return f.from(B,d,m);var R=S(q);if(R)return R;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof q[Symbol.toPrimitive]=="function")return f.from(q[Symbol.toPrimitive]("string"),d,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(q))}f.from=function(q,d,m){return s(q,d,m)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function a(q){if(typeof q!="number")throw new TypeError('"size" argument must be of type number');if(q<0)throw new RangeError('The value "'+q+'" is invalid for option "size"')}function u(q,d,m){return a(q),q<=0?o(q):d!==void 0?typeof m=="string"?o(q).fill(d,m):o(q).fill(d):o(q)}f.alloc=function(q,d,m){return u(q,d,m)};function c(q){return a(q),o(q<0?0:T(q)|0)}f.allocUnsafe=function(q){return c(q)},f.allocUnsafeSlow=function(q){return c(q)};function _(q,d){if((typeof d!="string"||d==="")&&(d="utf8"),!f.isEncoding(d))throw new TypeError("Unknown encoding: "+d);var m=W(q,d)|0,B=o(m),R=B.write(q,d);return R!==m&&(B=B.slice(0,R)),B}function p(q){for(var d=q.length<0?0:T(q.length)|0,m=o(d),B=0;B<d;B+=1)m[B]=q[B]&255;return m}function j(q,d,m){if(d<0||q.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(q.byteLength<d+(m||0))throw new RangeError('"length" is outside of buffer bounds');var B;return d===void 0&&m===void 0?B=new Uint8Array(q):m===void 0?B=new Uint8Array(q,d):B=new Uint8Array(q,d,m),Object.setPrototypeOf(B,f.prototype),B}function S(q){if(f.isBuffer(q)){var d=T(q.length)|0,m=o(d);return m.length===0||q.copy(m,0,0,d),m}if(q.length!==void 0)return typeof q.length!="number"||Ht(q.length)?o(0):p(q);if(q.type==="Buffer"&&Array.isArray(q.data))return p(q.data)}function T(q){if(q>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return q|0}function U(q){return+q!=q&&(q=0),f.alloc(+q)}f.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==f.prototype},f.compare=function(d,m){if(Ke(d,Uint8Array)&&(d=f.from(d,d.offset,d.byteLength)),Ke(m,Uint8Array)&&(m=f.from(m,m.offset,m.byteLength)),!f.isBuffer(d)||!f.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===m)return 0;for(var B=d.length,R=m.length,fe=0,se=Math.min(B,R);fe<se;++fe)if(d[fe]!==m[fe]){B=d[fe],R=m[fe];break}return B<R?-1:R<B?1:0},f.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(d,m){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return f.alloc(0);var B;if(m===void 0)for(m=0,B=0;B<d.length;++B)m+=d[B].length;var R=f.allocUnsafe(m),fe=0;for(B=0;B<d.length;++B){var se=d[B];if(Ke(se,Uint8Array)&&(se=f.from(se)),!f.isBuffer(se))throw new TypeError('"list" argument must be an Array of Buffers');se.copy(R,fe),fe+=se.length}return R};function W(q,d){if(f.isBuffer(q))return q.length;if(ArrayBuffer.isView(q)||Ke(q,ArrayBuffer))return q.byteLength;if(typeof q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(q));var m=q.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&m===0)return 0;for(var R=!1;;)switch(d){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return _e(q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return So(q).length;default:if(R)return B?-1:_e(q).length;d=(""+d).toLowerCase(),R=!0}}f.byteLength=W;function L(q,d,m){var B=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,d>>>=0,m<=d))return"";for(q||(q="utf8");;)switch(q){case"hex":return A(this,d,m);case"utf8":case"utf-8":return b(this,d,m);case"ascii":return M(this,d,m);case"latin1":case"binary":return oe(this,d,m);case"base64":return N(this,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,d,m);default:if(B)throw new TypeError("Unknown encoding: "+q);q=(q+"").toLowerCase(),B=!0}}f.prototype._isBuffer=!0;function te(q,d,m){var B=q[d];q[d]=q[m],q[m]=B}f.prototype.swap16=function(){var d=this.length;if(d%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var m=0;m<d;m+=2)te(this,m,m+1);return this},f.prototype.swap32=function(){var d=this.length;if(d%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var m=0;m<d;m+=4)te(this,m,m+3),te(this,m+1,m+2);return this},f.prototype.swap64=function(){var d=this.length;if(d%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var m=0;m<d;m+=8)te(this,m,m+7),te(this,m+1,m+6),te(this,m+2,m+5),te(this,m+3,m+4);return this},f.prototype.toString=function(){var d=this.length;return d===0?"":arguments.length===0?b(this,0,d):L.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(d){if(!f.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:f.compare(this,d)===0},f.prototype.inspect=function(){var d="",m=e.INSPECT_MAX_BYTES;return d=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(d+=" ... "),"<Buffer "+d+">"},r&&(f.prototype[r]=f.prototype.inspect),f.prototype.compare=function(d,m,B,R,fe){if(Ke(d,Uint8Array)&&(d=f.from(d,d.offset,d.byteLength)),!f.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(d));if(m===void 0&&(m=0),B===void 0&&(B=d?d.length:0),R===void 0&&(R=0),fe===void 0&&(fe=this.length),m<0||B>d.length||R<0||fe>this.length)throw new RangeError("out of range index");if(R>=fe&&m>=B)return 0;if(R>=fe)return-1;if(m>=B)return 1;if(m>>>=0,B>>>=0,R>>>=0,fe>>>=0,this===d)return 0;for(var se=fe-R,nt=B-m,Ze=Math.min(se,nt),Tt=this.slice(R,fe),hr=d.slice(m,B),ke=0;ke<Ze;++ke)if(Tt[ke]!==hr[ke]){se=Tt[ke],nt=hr[ke];break}return se<nt?-1:nt<se?1:0};function pe(q,d,m,B,R){if(q.length===0)return-1;if(typeof m=="string"?(B=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ht(m)&&(m=R?0:q.length-1),m<0&&(m=q.length+m),m>=q.length){if(R)return-1;m=q.length-1}else if(m<0)if(R)m=0;else return-1;if(typeof d=="string"&&(d=f.from(d,B)),f.isBuffer(d))return d.length===0?-1:J(q,d,m,B,R);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(q,d,m):Uint8Array.prototype.lastIndexOf.call(q,d,m):J(q,[d],m,B,R);throw new TypeError("val must be string, number or Buffer")}function J(q,d,m,B,R){var fe=1,se=q.length,nt=d.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(q.length<2||d.length<2)return-1;fe=2,se/=2,nt/=2,m/=2}function Ze(v,I){return fe===1?v[I]:v.readUInt16BE(I*fe)}var Tt;if(R){var hr=-1;for(Tt=m;Tt<se;Tt++)if(Ze(q,Tt)===Ze(d,hr===-1?0:Tt-hr)){if(hr===-1&&(hr=Tt),Tt-hr+1===nt)return hr*fe}else hr!==-1&&(Tt-=Tt-hr),hr=-1}else for(m+nt>se&&(m=se-nt),Tt=m;Tt>=0;Tt--){for(var ke=!0,Cn=0;Cn<nt;Cn++)if(Ze(q,Tt+Cn)!==Ze(d,Cn)){ke=!1;break}if(ke)return Tt}return-1}f.prototype.includes=function(d,m,B){return this.indexOf(d,m,B)!==-1},f.prototype.indexOf=function(d,m,B){return pe(this,d,m,B,!0)},f.prototype.lastIndexOf=function(d,m,B){return pe(this,d,m,B,!1)};function D(q,d,m,B){m=Number(m)||0;var R=q.length-m;B?(B=Number(B),B>R&&(B=R)):B=R;var fe=d.length;B>fe/2&&(B=fe/2);for(var se=0;se<B;++se){var nt=parseInt(d.substr(se*2,2),16);if(Ht(nt))return se;q[m+se]=nt}return se}function le(q,d,m,B){return St(_e(d,q.length-m),q,m,B)}function Y(q,d,m,B){return St($(d),q,m,B)}function de(q,d,m,B){return Y(q,d,m,B)}function y(q,d,m,B){return St(So(d),q,m,B)}function g(q,d,m,B){return St(Io(d,q.length-m),q,m,B)}f.prototype.write=function(d,m,B,R){if(m===void 0)R="utf8",B=this.length,m=0;else if(B===void 0&&typeof m=="string")R=m,B=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(B)?(B=B>>>0,R===void 0&&(R="utf8")):(R=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var fe=this.length-m;if((B===void 0||B>fe)&&(B=fe),d.length>0&&(B<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");R||(R="utf8");for(var se=!1;;)switch(R){case"hex":return D(this,d,m,B);case"utf8":case"utf-8":return le(this,d,m,B);case"ascii":return Y(this,d,m,B);case"latin1":case"binary":return de(this,d,m,B);case"base64":return y(this,d,m,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,d,m,B);default:if(se)throw new TypeError("Unknown encoding: "+R);R=(""+R).toLowerCase(),se=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(q,d,m){return d===0&&m===q.length?mh.fromByteArray(q):mh.fromByteArray(q.slice(d,m))}function b(q,d,m){m=Math.min(q.length,m);for(var B=[],R=d;R<m;){var fe=q[R],se=null,nt=fe>239?4:fe>223?3:fe>191?2:1;if(R+nt<=m){var Ze,Tt,hr,ke;switch(nt){case 1:fe<128&&(se=fe);break;case 2:Ze=q[R+1],(Ze&192)==128&&(ke=(fe&31)<<6|Ze&63,ke>127&&(se=ke));break;case 3:Ze=q[R+1],Tt=q[R+2],(Ze&192)==128&&(Tt&192)==128&&(ke=(fe&15)<<12|(Ze&63)<<6|Tt&63,ke>2047&&(ke<55296||ke>57343)&&(se=ke));break;case 4:Ze=q[R+1],Tt=q[R+2],hr=q[R+3],(Ze&192)==128&&(Tt&192)==128&&(hr&192)==128&&(ke=(fe&15)<<18|(Ze&63)<<12|(Tt&63)<<6|hr&63,ke>65535&&ke<1114112&&(se=ke))}}se===null?(se=65533,nt=1):se>65535&&(se-=65536,B.push(se>>>10&1023|55296),se=56320|se&1023),B.push(se),R+=nt}return K(B)}var z=4096;function K(q){var d=q.length;if(d<=z)return String.fromCharCode.apply(String,q);for(var m="",B=0;B<d;)m+=String.fromCharCode.apply(String,q.slice(B,B+=z));return m}function M(q,d,m){var B="";m=Math.min(q.length,m);for(var R=d;R<m;++R)B+=String.fromCharCode(q[R]&127);return B}function oe(q,d,m){var B="";m=Math.min(q.length,m);for(var R=d;R<m;++R)B+=String.fromCharCode(q[R]);return B}function A(q,d,m){var B=q.length;(!d||d<0)&&(d=0),(!m||m<0||m>B)&&(m=B);for(var R="",fe=d;fe<m;++fe)R+=bt[q[fe]];return R}function Ye(q,d,m){for(var B=q.slice(d,m),R="",fe=0;fe<B.length;fe+=2)R+=String.fromCharCode(B[fe]+B[fe+1]*256);return R}f.prototype.slice=function(d,m){var B=this.length;d=~~d,m=m===void 0?B:~~m,d<0?(d+=B,d<0&&(d=0)):d>B&&(d=B),m<0?(m+=B,m<0&&(m=0)):m>B&&(m=B),m<d&&(m=d);var R=this.subarray(d,m);return Object.setPrototypeOf(R,f.prototype),R};function me(q,d,m){if(q%1!=0||q<0)throw new RangeError("offset is not uint");if(q+d>m)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=this[d],fe=1,se=0;++se<m&&(fe*=256);)R+=this[d+se]*fe;return R},f.prototype.readUIntBE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=this[d+--m],fe=1;m>0&&(fe*=256);)R+=this[d+--m]*fe;return R},f.prototype.readUInt8=function(d,m){return d=d>>>0,m||me(d,1,this.length),this[d]},f.prototype.readUInt16LE=function(d,m){return d=d>>>0,m||me(d,2,this.length),this[d]|this[d+1]<<8},f.prototype.readUInt16BE=function(d,m){return d=d>>>0,m||me(d,2,this.length),this[d]<<8|this[d+1]},f.prototype.readUInt32LE=function(d,m){return d=d>>>0,m||me(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},f.prototype.readUInt32BE=function(d,m){return d=d>>>0,m||me(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},f.prototype.readIntLE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=this[d],fe=1,se=0;++se<m&&(fe*=256);)R+=this[d+se]*fe;return fe*=128,R>=fe&&(R-=Math.pow(2,8*m)),R},f.prototype.readIntBE=function(d,m,B){d=d>>>0,m=m>>>0,B||me(d,m,this.length);for(var R=m,fe=1,se=this[d+--R];R>0&&(fe*=256);)se+=this[d+--R]*fe;return fe*=128,se>=fe&&(se-=Math.pow(2,8*m)),se},f.prototype.readInt8=function(d,m){return d=d>>>0,m||me(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},f.prototype.readInt16LE=function(d,m){d=d>>>0,m||me(d,2,this.length);var B=this[d]|this[d+1]<<8;return B&32768?B|4294901760:B},f.prototype.readInt16BE=function(d,m){d=d>>>0,m||me(d,2,this.length);var B=this[d+1]|this[d]<<8;return B&32768?B|4294901760:B},f.prototype.readInt32LE=function(d,m){return d=d>>>0,m||me(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},f.prototype.readInt32BE=function(d,m){return d=d>>>0,m||me(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},f.prototype.readFloatLE=function(d,m){return d=d>>>0,m||me(d,4,this.length),Ks.read(this,d,!0,23,4)},f.prototype.readFloatBE=function(d,m){return d=d>>>0,m||me(d,4,this.length),Ks.read(this,d,!1,23,4)},f.prototype.readDoubleLE=function(d,m){return d=d>>>0,m||me(d,8,this.length),Ks.read(this,d,!0,52,8)},f.prototype.readDoubleBE=function(d,m){return d=d>>>0,m||me(d,8,this.length),Ks.read(this,d,!1,52,8)};function V(q,d,m,B,R,fe){if(!f.isBuffer(q))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>R||d<fe)throw new RangeError('"value" argument is out of bounds');if(m+B>q.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(d,m,B,R){if(d=+d,m=m>>>0,B=B>>>0,!R){var fe=Math.pow(2,8*B)-1;V(this,d,m,B,fe,0)}var se=1,nt=0;for(this[m]=d&255;++nt<B&&(se*=256);)this[m+nt]=d/se&255;return m+B},f.prototype.writeUIntBE=function(d,m,B,R){if(d=+d,m=m>>>0,B=B>>>0,!R){var fe=Math.pow(2,8*B)-1;V(this,d,m,B,fe,0)}var se=B-1,nt=1;for(this[m+se]=d&255;--se>=0&&(nt*=256);)this[m+se]=d/nt&255;return m+B},f.prototype.writeUInt8=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,1,255,0),this[m]=d&255,m+1},f.prototype.writeUInt16LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,65535,0),this[m]=d&255,this[m+1]=d>>>8,m+2},f.prototype.writeUInt16BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,65535,0),this[m]=d>>>8,this[m+1]=d&255,m+2},f.prototype.writeUInt32LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,4294967295,0),this[m+3]=d>>>24,this[m+2]=d>>>16,this[m+1]=d>>>8,this[m]=d&255,m+4},f.prototype.writeUInt32BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,4294967295,0),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4},f.prototype.writeIntLE=function(d,m,B,R){if(d=+d,m=m>>>0,!R){var fe=Math.pow(2,8*B-1);V(this,d,m,B,fe-1,-fe)}var se=0,nt=1,Ze=0;for(this[m]=d&255;++se<B&&(nt*=256);)d<0&&Ze===0&&this[m+se-1]!==0&&(Ze=1),this[m+se]=(d/nt>>0)-Ze&255;return m+B},f.prototype.writeIntBE=function(d,m,B,R){if(d=+d,m=m>>>0,!R){var fe=Math.pow(2,8*B-1);V(this,d,m,B,fe-1,-fe)}var se=B-1,nt=1,Ze=0;for(this[m+se]=d&255;--se>=0&&(nt*=256);)d<0&&Ze===0&&this[m+se+1]!==0&&(Ze=1),this[m+se]=(d/nt>>0)-Ze&255;return m+B},f.prototype.writeInt8=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,1,127,-128),d<0&&(d=255+d+1),this[m]=d&255,m+1},f.prototype.writeInt16LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,32767,-32768),this[m]=d&255,this[m+1]=d>>>8,m+2},f.prototype.writeInt16BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,2,32767,-32768),this[m]=d>>>8,this[m+1]=d&255,m+2},f.prototype.writeInt32LE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,2147483647,-2147483648),this[m]=d&255,this[m+1]=d>>>8,this[m+2]=d>>>16,this[m+3]=d>>>24,m+4},f.prototype.writeInt32BE=function(d,m,B){return d=+d,m=m>>>0,B||V(this,d,m,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4};function X(q,d,m,B,R,fe){if(m+B>q.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function He(q,d,m,B,R){return d=+d,m=m>>>0,R||X(q,d,m,4),Ks.write(q,d,m,B,23,4),m+4}f.prototype.writeFloatLE=function(d,m,B){return He(this,d,m,!0,B)},f.prototype.writeFloatBE=function(d,m,B){return He(this,d,m,!1,B)};function we(q,d,m,B,R){return d=+d,m=m>>>0,R||X(q,d,m,8),Ks.write(q,d,m,B,52,8),m+8}f.prototype.writeDoubleLE=function(d,m,B){return we(this,d,m,!0,B)},f.prototype.writeDoubleBE=function(d,m,B){return we(this,d,m,!1,B)},f.prototype.copy=function(d,m,B,R){if(!f.isBuffer(d))throw new TypeError("argument should be a Buffer");if(B||(B=0),!R&&R!==0&&(R=this.length),m>=d.length&&(m=d.length),m||(m=0),R>0&&R<B&&(R=B),R===B||d.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("sourceEnd out of bounds");R>this.length&&(R=this.length),d.length-m<R-B&&(R=d.length-m+B);var fe=R-B;if(this===d&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(m,B,R);else if(this===d&&B<m&&m<R)for(var se=fe-1;se>=0;--se)d[se+m]=this[se+B];else Uint8Array.prototype.set.call(d,this.subarray(B,R),m);return fe},f.prototype.fill=function(d,m,B,R){if(typeof d=="string"){if(typeof m=="string"?(R=m,m=0,B=this.length):typeof B=="string"&&(R=B,B=this.length),R!==void 0&&typeof R!="string")throw new TypeError("encoding must be a string");if(typeof R=="string"&&!f.isEncoding(R))throw new TypeError("Unknown encoding: "+R);if(d.length===1){var fe=d.charCodeAt(0);(R==="utf8"&&fe<128||R==="latin1")&&(d=fe)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(m<0||this.length<m||this.length<B)throw new RangeError("Out of range index");if(B<=m)return this;m=m>>>0,B=B===void 0?this.length:B>>>0,d||(d=0);var se;if(typeof d=="number")for(se=m;se<B;++se)this[se]=d;else{var nt=f.isBuffer(d)?d:f.from(d,R),Ze=nt.length;if(Ze===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(se=0;se<B-m;++se)this[se+m]=nt[se%Ze]}return this};var rt=/[^+/0-9A-Za-z-_]/g;function Ir(q){if(q=q.split("=")[0],q=q.trim().replace(rt,""),q.length<2)return"";for(;q.length%4!=0;)q=q+"=";return q}function _e(q,d){d=d||1/0;for(var m,B=q.length,R=null,fe=[],se=0;se<B;++se){if(m=q.charCodeAt(se),m>55295&&m<57344){if(!R){if(m>56319){(d-=3)>-1&&fe.push(239,191,189);continue}else if(se+1===B){(d-=3)>-1&&fe.push(239,191,189);continue}R=m;continue}if(m<56320){(d-=3)>-1&&fe.push(239,191,189),R=m;continue}m=(R-55296<<10|m-56320)+65536}else R&&(d-=3)>-1&&fe.push(239,191,189);if(R=null,m<128){if((d-=1)<0)break;fe.push(m)}else if(m<2048){if((d-=2)<0)break;fe.push(m>>6|192,m&63|128)}else if(m<65536){if((d-=3)<0)break;fe.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((d-=4)<0)break;fe.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return fe}function $(q){for(var d=[],m=0;m<q.length;++m)d.push(q.charCodeAt(m)&255);return d}function Io(q,d){for(var m,B,R,fe=[],se=0;se<q.length&&!((d-=2)<0);++se)m=q.charCodeAt(se),B=m>>8,R=m%256,fe.push(R),fe.push(B);return fe}function So(q){return mh.toByteArray(Ir(q))}function St(q,d,m,B){for(var R=0;R<B&&!(R+m>=d.length||R>=q.length);++R)d[R+m]=q[R];return R}function Ke(q,d){return q instanceof d||q!=null&&q.constructor!=null&&q.constructor.name!=null&&q.constructor.name===d.name}function Ht(q){return q!==q}var bt=function(){for(var q="0123456789abcdef",d=new Array(256),m=0;m<16;++m)for(var B=m*16,R=0;R<16;++R)d[B+R]=q[m]+q[R];return d}()}),M8=ye.Buffer,U8=ye.SlowBuffer,L8=ye.INSPECT_MAX_BYTES,C8=ye.kMaxLength,Mo=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ensureBuffer=void 0;function r(n){if(ye.Buffer.isBuffer(n))return n;if(ArrayBuffer.isView(n))return ye.Buffer.from(n.buffer);if(n instanceof ArrayBuffer)return ye.Buffer.from(n);throw new TypeError("Must use either Buffer or TypedArray")}e.ensureBuffer=r});Ut(Mo);V8=Mo.ensureBuffer,bh=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseUUID=void 0;let r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function n(i){if(typeof i!="string")throw new TypeError("Invalid type for UUID, expected string but got "+typeof i);if(!r.test(i))throw new TypeError("Invalid format for UUID: "+i);let o,f=new Uint8Array(16);return f[0]=(o=parseInt(i.slice(0,8),16))>>>24,f[1]=o>>>16&255,f[2]=o>>>8&255,f[3]=o&255,f[4]=(o=parseInt(i.slice(9,13),16))>>>8,f[5]=o&255,f[6]=(o=parseInt(i.slice(14,18),16))>>>8,f[7]=o&255,f[8]=(o=parseInt(i.slice(19,23),16))>>>8,f[9]=o&255,f[10]=(o=parseInt(i.slice(24,36),16))/1099511627776&255,f[11]=o/4294967296&255,f[12]=o>>>24&255,f[13]=o>>>16&255,f[14]=o>>>8&255,f[15]=o&255,f}e.parseUUID=n});Ut(bh);W8=bh.parseUUID,ln=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binary=void 0;class r{constructor(i,o){if(i!=null&&typeof i!="string"&&!ArrayBuffer.isView(i)&&!(i instanceof ArrayBuffer)&&!Array.isArray(i))throw new TypeError("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=o??r.BSON_BINARY_SUBTYPE_DEFAULT,i==null?(this.buffer=ye.Buffer.alloc(r.BUFFER_SIZE),this.position=0):(typeof i=="string"?this.buffer=ye.Buffer.from(i,"binary"):Array.isArray(i)?this.buffer=ye.Buffer.from(i):this.buffer=Mo.ensureBuffer(i),this.position=this.buffer.byteLength)}put(i){if(typeof i=="string"&&i.length!==1)throw new TypeError("only accepts single character String");if(typeof i!="number"&&i.length!==1)throw new TypeError("only accepts single character Uint8Array or Array");let o;if(typeof i=="string"?o=i.charCodeAt(0):typeof i=="number"?o=i:o=i[0],o<0||o>255)throw new TypeError("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=o;else{let f=ye.Buffer.alloc(r.BUFFER_SIZE+this.buffer.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f,this.buffer[this.position++]=o}}write(i,o){if(o=typeof o=="number"?o:this.position,this.buffer.length<o+i.length){let f=ye.Buffer.alloc(this.buffer.length+i.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f}ArrayBuffer.isView(i)?(this.buffer.set(Mo.ensureBuffer(i),o),this.position=o+i.byteLength>this.position?o+i.length:this.position):typeof i=="string"&&(this.buffer.write(i,o,i.length,"binary"),this.position=o+i.length>this.position?o+i.length:this.position)}read(i,o){return o=o&&o>0?o:this.position,this.buffer.slice(i,i+o)}value(i){return i=!!i,i&&this.buffer.length===this.position?this.buffer:i?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)}length(){return this.position}toJSON(){return this.buffer.toString("base64")}toString(i){return this.buffer.toString(i)}toExtendedJSON(i){i=i||{};let o=this.buffer.toString("base64"),f=Number(this.sub_type).toString(16);return i.legacy?{$binary:o,$type:f.length===1?"0"+f:f}:{$binary:{base64:o,subType:f.length===1?"0"+f:f}}}static fromExtendedJSON(i,o){o=o||{};let f,s;if("$binary"in i?o.legacy&&typeof i.$binary=="string"&&"$type"in i?(s=i.$type?parseInt(i.$type,16):0,f=ye.Buffer.from(i.$binary,"base64")):typeof i.$binary!="string"&&(s=i.$binary.subType?parseInt(i.$binary.subType,16):0,f=ye.Buffer.from(i.$binary.base64,"base64")):"$uuid"in i&&(s=4,f=ye.Buffer.from(bh.parseUUID(i.$uuid))),!f)throw new TypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(i)}`);return new r(f,s)}}e.Binary=r,r.BSON_BINARY_SUBTYPE_DEFAULT=0,r.BUFFER_SIZE=256,r.SUBTYPE_DEFAULT=0,r.SUBTYPE_FUNCTION=1,r.SUBTYPE_BYTE_ARRAY=2,r.SUBTYPE_UUID_OLD=3,r.SUBTYPE_UUID=4,r.SUBTYPE_MD5=5,r.SUBTYPE_USER_DEFINED=128,Object.defineProperty(r.prototype,"_bsontype",{value:"Binary"})});Ut(ln);Y8=ln.Binary,Uo=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Code=void 0;class r{constructor(i,o){this.code=i,this.scope=o}toJSON(){return{code:this.code,scope:this.scope}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(i){return new r(i.$code,i.$scope)}}e.Code=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Code"})});Ut(Uo);K8=Uo.Code,M2={};typeof Object.create=="function"?hh=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:hh=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};U2=hh,L2=/%[sdj%]/g;wp={};Zi.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]};Zi.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};eN=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];nN={inherits:U2,_extend:Zv,log:rN,isBuffer:$2,isPrimitive:Q2,isFunction:vp,isError:qp,isDate:qh,isObject:Gs,isRegExp:_p,isUndefined:Xi,isSymbol:X2,isString:jp,isNumber:Jv,isNullOrUndefined:Z2,isNull:yp,isBoolean:_h,isArray:Gv,inspect:Zi,deprecate:Kv,format:wh,debuglog:C2},_t=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deprecate=e.isObjectLike=e.isDate=e.isBuffer=e.haveBuffer=e.isBigUInt64Array=e.isBigInt64Array=e.isUint8Array=e.randomBytes=e.normalizedFunctionString=void 0;function r(p){return p.toString().replace("function(","function (")}e.normalizedFunctionString=r;function n(p){let j=ye.Buffer.alloc(p);for(let S=0;S<p;++S)j[S]=Math.floor(Math.random()*256);return j}if(e.randomBytes=n,typeof window!="undefined"&&window.crypto&&window.crypto.getRandomValues)e.randomBytes=p=>window.crypto.getRandomValues(ye.Buffer.alloc(p));else{try{e.randomBytes=M2.randomBytes}catch{}e.randomBytes==null&&(e.randomBytes=n)}function i(p){return Object.prototype.toString.call(p)==="[object Uint8Array]"}e.isUint8Array=i;function o(p){return Object.prototype.toString.call(p)==="[object BigInt64Array]"}e.isBigInt64Array=o;function f(p){return Object.prototype.toString.call(p)==="[object BigUint64Array]"}e.isBigUInt64Array=f;function s(){return typeof hp!="undefined"&&typeof hp.Buffer!="undefined"}e.haveBuffer=s;function a(p){return s()&&ye.Buffer.isBuffer(p)}e.isBuffer=a;function u(p){return c(p)&&Object.prototype.toString.call(p)==="[object Date]"}e.isDate=u;function c(p){return typeof p=="object"&&p!==null}e.isObjectLike=c;function _(p,j){if(typeof window=="undefined"||typeof self=="undefined")return nN.deprecate(p,j);let S=!1;function T(...U){return S||(console.warn(j),S=!0),p.apply(this,...U)}return T}e.deprecate=_});Ut(_t);G8=_t.deprecate,J8=_t.isObjectLike,Z8=_t.isDate,X8=_t.isBuffer,Q8=_t.haveBuffer,$8=_t.isBigUInt64Array,eC=_t.isBigInt64Array,tC=_t.isUint8Array,rC=_t.randomBytes,nC=_t.normalizedFunctionString,Kn=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DBRef=e.isDBRefLike=void 0;function r(i){return _t.isObjectLike(i)&&i.$id!=null&&i.$ref!=null}e.isDBRefLike=r;class n{constructor(o,f,s,a){let u=o.split(".");u.length===2&&(s=u.shift(),o=u.shift()),this.collection=o,this.oid=f,this.db=s,this.fields=a||{}}get namespace(){return this.collection}set namespace(o){this.collection=o}toJSON(){let o=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(o.$db=this.db),o}toExtendedJSON(o){o=o||{};let f={$ref:this.collection,$id:this.oid};return o.legacy||(this.db&&(f.$db=this.db),f=Object.assign(f,this.fields)),f}static fromExtendedJSON(o){let f=Object.assign({},o);return delete f.$ref,delete f.$id,delete f.$db,new n(o.$ref,o.$id,o.$db,f)}}e.DBRef=n,Object.defineProperty(n.prototype,"_bsontype",{value:"DBRef"})});Ut(Kn);iC=Kn.DBRef,oC=Kn.isDBRefLike,Se=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Long=void 0;let r;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}let n=1<<16,i=1<<24,o=n*n,f=o*o,s=f/2,a={},u={};class c{constructor(p=0,j=0,S){this.comp=c.prototype.compare,this.div=c.prototype.divide,this.eq=c.prototype.equals,this.gt=c.prototype.greaterThan,this.gte=c.prototype.greaterThanOrEqual,this.ge=c.prototype.greaterThanOrEqual,this.lt=c.prototype.lessThan,this.lte=c.prototype.lessThanOrEqual,this.mod=c.prototype.modulo,this.rem=c.prototype.modulo,this.mul=c.prototype.multiply,this.neg=c.prototype.negate,this.neq=c.prototype.notEquals,this.ne=c.prototype.notEquals,this.shl=c.prototype.shiftLeft,this.shr=c.prototype.shiftRight,this.shr_u=c.prototype.shiftRightUnsigned,this.shru=c.prototype.shiftRightUnsigned,this.sub=c.prototype.subtract,this.eqz=c.prototype.isZero,this.le=c.prototype.lessThanOrEqual,this.low=p|0,this.high=j|0,this.unsigned=!!S,Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}static fromBits(p,j,S){return new c(p,j,S)}static fromInt(p,j){let S,T,U;return j?(p>>>=0,(U=0<=p&&p<256)&&(T=u[p],T)?T:(S=c.fromBits(p,(p|0)<0?-1:0,!0),U&&(u[p]=S),S)):(p|=0,(U=-128<=p&&p<128)&&(T=a[p],T)?T:(S=c.fromBits(p,p<0?-1:0,!1),U&&(a[p]=S),S))}static fromNumber(p,j){if(isNaN(p))return j?c.UZERO:c.ZERO;if(j){if(p<0)return c.UZERO;if(p>=f)return c.MAX_UNSIGNED_VALUE}else{if(p<=-s)return c.MIN_VALUE;if(p+1>=s)return c.MAX_VALUE}return p<0?c.fromNumber(-p,j).neg():c.fromBits(p%o|0,p/o|0,j)}static fromBigInt(p,j){return c.fromString(p.toString(),j)}static fromString(p,j,S){if(p.length===0)throw Error("empty string");if(p==="NaN"||p==="Infinity"||p==="+Infinity"||p==="-Infinity")return c.ZERO;if(typeof j=="number"?(S=j,j=!1):j=!!j,S=S||10,S<2||36<S)throw RangeError("radix");let T;if((T=p.indexOf("-"))>0)throw Error("interior hyphen");if(T===0)return c.fromString(p.substring(1),j,S).neg();let U=c.fromNumber(Math.pow(S,8)),W=c.ZERO;for(let L=0;L<p.length;L+=8){let te=Math.min(8,p.length-L),pe=parseInt(p.substring(L,L+te),S);if(te<8){let J=c.fromNumber(Math.pow(S,te));W=W.mul(J).add(c.fromNumber(pe))}else W=W.mul(U),W=W.add(c.fromNumber(pe))}return W.unsigned=j,W}static fromBytes(p,j,S){return S?c.fromBytesLE(p,j):c.fromBytesBE(p,j)}static fromBytesLE(p,j){return new c(p[0]|p[1]<<8|p[2]<<16|p[3]<<24,p[4]|p[5]<<8|p[6]<<16|p[7]<<24,j)}static fromBytesBE(p,j){return new c(p[4]<<24|p[5]<<16|p[6]<<8|p[7],p[0]<<24|p[1]<<16|p[2]<<8|p[3],j)}static isLong(p){return _t.isObjectLike(p)&&p.__isLong__===!0}static fromValue(p,j){return typeof p=="number"?c.fromNumber(p,j):typeof p=="string"?c.fromString(p,j):c.fromBits(p.low,p.high,typeof j=="boolean"?j:p.unsigned)}add(p){c.isLong(p)||(p=c.fromValue(p));let j=this.high>>>16,S=this.high&65535,T=this.low>>>16,U=this.low&65535,W=p.high>>>16,L=p.high&65535,te=p.low>>>16,pe=p.low&65535,J=0,D=0,le=0,Y=0;return Y+=U+pe,le+=Y>>>16,Y&=65535,le+=T+te,D+=le>>>16,le&=65535,D+=S+L,J+=D>>>16,D&=65535,J+=j+W,J&=65535,c.fromBits(le<<16|Y,J<<16|D,this.unsigned)}and(p){return c.isLong(p)||(p=c.fromValue(p)),c.fromBits(this.low&p.low,this.high&p.high,this.unsigned)}compare(p){if(c.isLong(p)||(p=c.fromValue(p)),this.eq(p))return 0;let j=this.isNegative(),S=p.isNegative();return j&&!S?-1:!j&&S?1:this.unsigned?p.high>>>0>this.high>>>0||p.high===this.high&&p.low>>>0>this.low>>>0?-1:1:this.sub(p).isNegative()?-1:1}divide(p){if(c.isLong(p)||(p=c.fromValue(p)),p.isZero())throw Error("division by zero");if(r){if(!this.unsigned&&this.high===-2147483648&&p.low===-1&&p.high===-1)return this;let U=(this.unsigned?r.div_u:r.div_s)(this.low,this.high,p.low,p.high);return c.fromBits(U,r.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?c.UZERO:c.ZERO;let j,S,T;if(this.unsigned){if(p.unsigned||(p=p.toUnsigned()),p.gt(this))return c.UZERO;if(p.gt(this.shru(1)))return c.UONE;T=c.UZERO}else{if(this.eq(c.MIN_VALUE))return p.eq(c.ONE)||p.eq(c.NEG_ONE)?c.MIN_VALUE:p.eq(c.MIN_VALUE)?c.ONE:(j=this.shr(1).div(p).shl(1),j.eq(c.ZERO)?p.isNegative()?c.ONE:c.NEG_ONE:(S=this.sub(p.mul(j)),T=j.add(S.div(p)),T));if(p.eq(c.MIN_VALUE))return this.unsigned?c.UZERO:c.ZERO;if(this.isNegative())return p.isNegative()?this.neg().div(p.neg()):this.neg().div(p).neg();if(p.isNegative())return this.div(p.neg()).neg();T=c.ZERO}for(S=this;S.gte(p);){j=Math.max(1,Math.floor(S.toNumber()/p.toNumber()));let U=Math.ceil(Math.log(j)/Math.LN2),W=U<=48?1:Math.pow(2,U-48),L=c.fromNumber(j),te=L.mul(p);for(;te.isNegative()||te.gt(S);)j-=W,L=c.fromNumber(j,this.unsigned),te=L.mul(p);L.isZero()&&(L=c.ONE),T=T.add(L),S=S.sub(te)}return T}equals(p){return c.isLong(p)||(p=c.fromValue(p)),this.unsigned!==p.unsigned&&this.high>>>31==1&&p.high>>>31==1?!1:this.high===p.high&&this.low===p.low}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(c.MIN_VALUE)?64:this.neg().getNumBitsAbs();let p=this.high!==0?this.high:this.low,j;for(j=31;j>0&&(p&1<<j)==0;j--);return this.high!==0?j+33:j+1}greaterThan(p){return this.comp(p)>0}greaterThanOrEqual(p){return this.comp(p)>=0}isEven(){return(this.low&1)==0}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return(this.low&1)==1}isPositive(){return this.unsigned||this.high>=0}isZero(){return this.high===0&&this.low===0}lessThan(p){return this.comp(p)<0}lessThanOrEqual(p){return this.comp(p)<=0}modulo(p){if(c.isLong(p)||(p=c.fromValue(p)),r){let j=(this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,p.low,p.high);return c.fromBits(j,r.get_high(),this.unsigned)}return this.sub(this.div(p).mul(p))}multiply(p){if(this.isZero())return c.ZERO;if(c.isLong(p)||(p=c.fromValue(p)),r){let de=r.mul(this.low,this.high,p.low,p.high);return c.fromBits(de,r.get_high(),this.unsigned)}if(p.isZero())return c.ZERO;if(this.eq(c.MIN_VALUE))return p.isOdd()?c.MIN_VALUE:c.ZERO;if(p.eq(c.MIN_VALUE))return this.isOdd()?c.MIN_VALUE:c.ZERO;if(this.isNegative())return p.isNegative()?this.neg().mul(p.neg()):this.neg().mul(p).neg();if(p.isNegative())return this.mul(p.neg()).neg();if(this.lt(c.TWO_PWR_24)&&p.lt(c.TWO_PWR_24))return c.fromNumber(this.toNumber()*p.toNumber(),this.unsigned);let j=this.high>>>16,S=this.high&65535,T=this.low>>>16,U=this.low&65535,W=p.high>>>16,L=p.high&65535,te=p.low>>>16,pe=p.low&65535,J=0,D=0,le=0,Y=0;return Y+=U*pe,le+=Y>>>16,Y&=65535,le+=T*pe,D+=le>>>16,le&=65535,le+=U*te,D+=le>>>16,le&=65535,D+=S*pe,J+=D>>>16,D&=65535,D+=T*te,J+=D>>>16,D&=65535,D+=U*L,J+=D>>>16,D&=65535,J+=j*pe+S*te+T*L+U*W,J&=65535,c.fromBits(le<<16|Y,J<<16|D,this.unsigned)}negate(){return!this.unsigned&&this.eq(c.MIN_VALUE)?c.MIN_VALUE:this.not().add(c.ONE)}not(){return c.fromBits(~this.low,~this.high,this.unsigned)}notEquals(p){return!this.equals(p)}or(p){return c.isLong(p)||(p=c.fromValue(p)),c.fromBits(this.low|p.low,this.high|p.high,this.unsigned)}shiftLeft(p){return c.isLong(p)&&(p=p.toInt()),(p&=63)==0?this:p<32?c.fromBits(this.low<<p,this.high<<p|this.low>>>32-p,this.unsigned):c.fromBits(0,this.low<<p-32,this.unsigned)}shiftRight(p){return c.isLong(p)&&(p=p.toInt()),(p&=63)==0?this:p<32?c.fromBits(this.low>>>p|this.high<<32-p,this.high>>p,this.unsigned):c.fromBits(this.high>>p-32,this.high>=0?0:-1,this.unsigned)}shiftRightUnsigned(p){if(c.isLong(p)&&(p=p.toInt()),p&=63,p===0)return this;{let j=this.high;if(p<32){let S=this.low;return c.fromBits(S>>>p|j<<32-p,j>>>p,this.unsigned)}else return p===32?c.fromBits(j,0,this.unsigned):c.fromBits(j>>>p-32,0,this.unsigned)}}subtract(p){return c.isLong(p)||(p=c.fromValue(p)),this.add(p.neg())}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(p){return p?this.toBytesLE():this.toBytesBE()}toBytesLE(){let p=this.high,j=this.low;return[j&255,j>>>8&255,j>>>16&255,j>>>24,p&255,p>>>8&255,p>>>16&255,p>>>24]}toBytesBE(){let p=this.high,j=this.low;return[p>>>24,p>>>16&255,p>>>8&255,p&255,j>>>24,j>>>16&255,j>>>8&255,j&255]}toSigned(){return this.unsigned?c.fromBits(this.low,this.high,!1):this}toString(p){if(p=p||10,p<2||36<p)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(c.MIN_VALUE)){let U=c.fromNumber(p),W=this.div(U),L=W.mul(U).sub(this);return W.toString(p)+L.toInt().toString(p)}else return"-"+this.neg().toString(p);let j=c.fromNumber(Math.pow(p,6),this.unsigned),S=this,T="";for(;;){let U=S.div(j),L=(S.sub(U.mul(j)).toInt()>>>0).toString(p);if(S=U,S.isZero())return L+T;for(;L.length<6;)L="0"+L;T=""+L+T}}toUnsigned(){return this.unsigned?this:c.fromBits(this.low,this.high,!0)}xor(p){return c.isLong(p)||(p=c.fromValue(p)),c.fromBits(this.low^p.low,this.high^p.high,this.unsigned)}toExtendedJSON(p){return p&&p.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(p,j){let S=c.fromString(p.$numberLong);return j&&j.relaxed?S.toNumber():S}}e.Long=c,c.TWO_PWR_24=c.fromInt(i),c.MAX_UNSIGNED_VALUE=c.fromBits(4294967295|0,4294967295|0,!0),c.ZERO=c.fromInt(0),c.UZERO=c.fromInt(0,!0),c.ONE=c.fromInt(1),c.UONE=c.fromInt(1,!0),c.NEG_ONE=c.fromInt(-1),c.MAX_VALUE=c.fromBits(4294967295|0,2147483647|0,!1),c.MIN_VALUE=c.fromBits(0,2147483648|0,!1),Object.defineProperty(c.prototype,"__isLong__",{value:!0}),Object.defineProperty(c.prototype,"_bsontype",{value:"Long"})});Ut(Se);fC=Se.Long,Js=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decimal128=void 0;let r=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,n=/^(\+|-)?(Infinity|inf)$/i,i=/^(\+|-)?NaN$/i,o=6111,f=-6176,s=6176,a=34,u=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),c=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),_=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),p=/^([-+])?(\d+)?$/,j=31,S=16383,T=30,U=31;function W(le){return!isNaN(parseInt(le,10))}function L(le){let Y=Se.Long.fromNumber(1e3*1e3*1e3),de=Se.Long.fromNumber(0);if(!le.parts[0]&&!le.parts[1]&&!le.parts[2]&&!le.parts[3])return{quotient:le,rem:de};for(let y=0;y<=3;y++)de=de.shiftLeft(32),de=de.add(new Se.Long(le.parts[y],0)),le.parts[y]=de.div(Y).low,de=de.modulo(Y);return{quotient:le,rem:de}}function te(le,Y){if(!le&&!Y)return{high:Se.Long.fromNumber(0),low:Se.Long.fromNumber(0)};let de=le.shiftRightUnsigned(32),y=new Se.Long(le.getLowBits(),0),g=Y.shiftRightUnsigned(32),N=new Se.Long(Y.getLowBits(),0),b=de.multiply(g),z=de.multiply(N),K=y.multiply(g),M=y.multiply(N);return b=b.add(z.shiftRightUnsigned(32)),z=new Se.Long(z.getLowBits(),0).add(K).add(M.shiftRightUnsigned(32)),b=b.add(z.shiftRightUnsigned(32)),M=z.shiftLeft(32).add(new Se.Long(M.getLowBits(),0)),{high:b,low:M}}function pe(le,Y){let de=le.high>>>0,y=Y.high>>>0;if(de<y)return!0;if(de===y){let g=le.low>>>0,N=Y.low>>>0;if(g<N)return!0}return!1}function J(le,Y){throw new TypeError(`"${le}" is not a valid Decimal128 string - ${Y}`)}class D{constructor(Y){this.bytes=Y}static fromString(Y){let de=!1,y=!1,g=!1,N=0,b=0,z=0,K=0,M=0,oe=[0],A=0,Ye=0,me=0,V=0,X=0,He=0,we=new Se.Long(0,0),rt=new Se.Long(0,0),Ir=0,_e=0;if(Y.length>=7e3)throw new TypeError(""+Y+" not a valid Decimal128 string");let $=Y.match(r),Io=Y.match(n),So=Y.match(i);if(!$&&!Io&&!So||Y.length===0)throw new TypeError(""+Y+" not a valid Decimal128 string");if($){let bt=$[2],q=$[4],d=$[5],m=$[6];q&&m===void 0&&J(Y,"missing exponent power"),q&&bt===void 0&&J(Y,"missing exponent base"),q===void 0&&(d||m)&&J(Y,"missing e before exponent")}if((Y[_e]==="+"||Y[_e]==="-")&&(de=Y[_e++]==="-"),!W(Y[_e])&&Y[_e]!=="."){if(Y[_e]==="i"||Y[_e]==="I")return new D(ye.Buffer.from(de?c:_));if(Y[_e]==="N")return new D(ye.Buffer.from(u))}for(;W(Y[_e])||Y[_e]===".";){if(Y[_e]==="."){y&&J(Y,"contains multiple periods"),y=!0,_e=_e+1;continue}A<34&&(Y[_e]!=="0"||g)&&(g||(M=b),g=!0,oe[Ye++]=parseInt(Y[_e],10),A=A+1),g&&(z=z+1),y&&(K=K+1),b=b+1,_e=_e+1}if(y&&!b)throw new TypeError(""+Y+" not a valid Decimal128 string");if(Y[_e]==="e"||Y[_e]==="E"){let bt=Y.substr(++_e).match(p);if(!bt||!bt[2])return new D(ye.Buffer.from(u));X=parseInt(bt[0],10),_e=_e+bt[0].length}if(Y[_e])return new D(ye.Buffer.from(u));if(me=0,!A)me=0,V=0,oe[0]=0,z=1,A=1,N=0;else if(V=A-1,N=z,N!==1)for(;Y[M+N-1]==="0";)N=N-1;for(X<=K&&K-X>1<<14?X=f:X=X-K;X>o;){if(V=V+1,V-me>a){if(oe.join("").match(/^0+$/)){X=o;break}J(Y,"overflow")}X=X-1}for(;X<f||A<z;){if(V===0&&N<A){X=f,N=0;break}if(A<z?z=z-1:V=V-1,X<o)X=X+1;else{if(oe.join("").match(/^0+$/)){X=o;break}J(Y,"overflow")}}if(V-me+1<N){let bt=b;y&&(M=M+1,bt=bt+1),de&&(M=M+1,bt=bt+1);let q=parseInt(Y[M+V+1],10),d=0;if(q>=5&&(d=1,q===5)){for(d=oe[V]%2==1?1:0,He=M+V+2;He<bt;He++)if(parseInt(Y[He],10)){d=1;break}}if(d){let m=V;for(;m>=0;m--)if(++oe[m]>9&&(oe[m]=0,m===0))if(X<o)X=X+1,oe[m]=1;else return new D(ye.Buffer.from(de?c:_))}}if(we=Se.Long.fromNumber(0),rt=Se.Long.fromNumber(0),N===0)we=Se.Long.fromNumber(0),rt=Se.Long.fromNumber(0);else if(V-me<17){let bt=me;for(rt=Se.Long.fromNumber(oe[bt++]),we=new Se.Long(0,0);bt<=V;bt++)rt=rt.multiply(Se.Long.fromNumber(10)),rt=rt.add(Se.Long.fromNumber(oe[bt]))}else{let bt=me;for(we=Se.Long.fromNumber(oe[bt++]);bt<=V-17;bt++)we=we.multiply(Se.Long.fromNumber(10)),we=we.add(Se.Long.fromNumber(oe[bt]));for(rt=Se.Long.fromNumber(oe[bt++]);bt<=V;bt++)rt=rt.multiply(Se.Long.fromNumber(10)),rt=rt.add(Se.Long.fromNumber(oe[bt]))}let St=te(we,Se.Long.fromString("100000000000000000"));St.low=St.low.add(rt),pe(St.low,rt)&&(St.high=St.high.add(Se.Long.fromNumber(1))),Ir=X+s;let Ke={low:Se.Long.fromNumber(0),high:Se.Long.fromNumber(0)};St.high.shiftRightUnsigned(49).and(Se.Long.fromNumber(1)).equals(Se.Long.fromNumber(1))?(Ke.high=Ke.high.or(Se.Long.fromNumber(3).shiftLeft(61)),Ke.high=Ke.high.or(Se.Long.fromNumber(Ir).and(Se.Long.fromNumber(16383).shiftLeft(47))),Ke.high=Ke.high.or(St.high.and(Se.Long.fromNumber(140737488355327)))):(Ke.high=Ke.high.or(Se.Long.fromNumber(Ir&16383).shiftLeft(49)),Ke.high=Ke.high.or(St.high.and(Se.Long.fromNumber(562949953421311)))),Ke.low=St.low,de&&(Ke.high=Ke.high.or(Se.Long.fromString("9223372036854775808")));let Ht=ye.Buffer.alloc(16);return _e=0,Ht[_e++]=Ke.low.low&255,Ht[_e++]=Ke.low.low>>8&255,Ht[_e++]=Ke.low.low>>16&255,Ht[_e++]=Ke.low.low>>24&255,Ht[_e++]=Ke.low.high&255,Ht[_e++]=Ke.low.high>>8&255,Ht[_e++]=Ke.low.high>>16&255,Ht[_e++]=Ke.low.high>>24&255,Ht[_e++]=Ke.high.low&255,Ht[_e++]=Ke.high.low>>8&255,Ht[_e++]=Ke.high.low>>16&255,Ht[_e++]=Ke.high.low>>24&255,Ht[_e++]=Ke.high.high&255,Ht[_e++]=Ke.high.high>>8&255,Ht[_e++]=Ke.high.high>>16&255,Ht[_e++]=Ke.high.high>>24&255,new D(Ht)}toString(){let Y,de=0,y=new Array(36);for(let _e=0;_e<y.length;_e++)y[_e]=0;let g=0,N=!1,b,z={parts:[0,0,0,0]},K,M,oe=[];g=0;let A=this.bytes,Ye=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24,me=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24,V=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24,X=A[g++]|A[g++]<<8|A[g++]<<16|A[g++]<<24;g=0,{low:new Se.Long(Ye,me),high:new Se.Long(V,X)}.high.lessThan(Se.Long.ZERO)&&oe.push("-");let we=X>>26&j;if(we>>3==3){if(we===T)return oe.join("")+"Infinity";if(we===U)return"NaN";Y=X>>15&S,b=8+(X>>14&1)}else b=X>>14&7,Y=X>>17&S;let rt=Y-s;if(z.parts[0]=(X&16383)+((b&15)<<14),z.parts[1]=V,z.parts[2]=me,z.parts[3]=Ye,z.parts[0]===0&&z.parts[1]===0&&z.parts[2]===0&&z.parts[3]===0)N=!0;else for(M=3;M>=0;M--){let _e=0,$=L(z);if(z=$.quotient,_e=$.rem.low,!!_e)for(K=8;K>=0;K--)y[M*9+K]=_e%10,_e=Math.floor(_e/10)}if(N)de=1,y[g]=0;else for(de=36;!y[g];)de=de-1,g=g+1;let Ir=de-1+rt;if(Ir>=34||Ir<=-7||rt>0){if(de>34)return oe.push(`${0}`),rt>0?oe.push("E+"+rt):rt<0&&oe.push("E"+rt),oe.join("");oe.push(`${y[g++]}`),de=de-1,de&&oe.push(".");for(let _e=0;_e<de;_e++)oe.push(`${y[g++]}`);oe.push("E"),Ir>0?oe.push("+"+Ir):oe.push(`${Ir}`)}else if(rt>=0)for(let _e=0;_e<de;_e++)oe.push(`${y[g++]}`);else{let _e=de+rt;if(_e>0)for(let $=0;$<_e;$++)oe.push(`${y[g++]}`);else oe.push("0");for(oe.push(".");_e++<0;)oe.push("0");for(let $=0;$<de-Math.max(_e-1,0);$++)oe.push(`${y[g++]}`)}return oe.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(Y){return D.fromString(Y.$numberDecimal)}}e.Decimal128=D,Object.defineProperty(D.prototype,"_bsontype",{value:"Decimal128"})});Ut(Js);sC=Js.Decimal128,Gf=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Double=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){if(i&&(i.legacy||i.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:`-${this.value.toFixed(1)}`};let o;return Number.isInteger(this.value)?(o=this.value.toFixed(1),o.length>=13&&(o=this.value.toExponential(13).toUpperCase())):o=this.value.toString(),{$numberDouble:o}}static fromExtendedJSON(i,o){let f=parseFloat(i.$numberDouble);return o&&o.relaxed?f:new r(f)}}e.Double=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Double"})});Ut(Gf);aC=Gf.Double,Jf=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Int32=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){return i&&(i.relaxed||i.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(i,o){return o&&o.relaxed?parseInt(i.$numberInt,10):new r(i.$numberInt)}}e.Int32=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Int32"})});Ut(Jf);lC=Jf.Int32,Tp=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Map=void 0;let r;e.Map=r;let n=function(f){return f&&f.Math==Math&&f};function i(){return n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof hp=="object"&&hp)||Function("return this")()}let o=i();Object.prototype.hasOwnProperty.call(o,"Map")?e.Map=r=o.Map:e.Map=r=class{constructor(s=[]){this._keys=[],this._values={};for(let a=0;a<s.length;a++){if(s[a]==null)continue;let u=s[a],c=u[0],_=u[1];this._keys.push(c),this._values[c]={v:_,i:this._keys.length-1}}}clear(){this._keys=[],this._values={}}delete(s){let a=this._values[s];return a==null?!1:(delete this._values[s],this._keys.splice(a.i,1),!0)}entries(){let s=0;return{next:()=>{let a=this._keys[s++];return{value:a!==void 0?[a,this._values[a].v]:void 0,done:a===void 0}}}}forEach(s,a){a=a||this;for(let u=0;u<this._keys.length;u++){let c=this._keys[u];s.call(a,this._values[c].v,c,a)}}get(s){return this._values[s]?this._values[s].v:void 0}has(s){return this._values[s]!=null}keys(){let s=0;return{next:()=>{let a=this._keys[s++];return{value:a!==void 0?a:void 0,done:a===void 0}}}}set(s,a){return this._values[s]?(this._values[s].v=a,this):(this._keys.push(s),this._values[s]={v:a,i:this._keys.length-1},this)}values(){let s=0;return{next:()=>{let a=this._keys[s++];return{value:a!==void 0?this._values[a].v:void 0,done:a===void 0}}}}get size(){return this._keys.length}}});Ut(Tp);cC=Tp.Map,Zs=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MaxKey=void 0;class r{toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new r}}e.MaxKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MaxKey"})});Ut(Zs);pC=Zs.MaxKey,Xs=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MinKey=void 0;class r{toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new r}}e.MinKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MinKey"})});Ut(Xs);dC=Xs.MinKey,Qi=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectId=void 0;let r=_t.randomBytes(5),n=new RegExp("^[0-9a-fA-F]{24}$"),i=[];for(let c=0;c<256;c++)i[c]=(c<=15?"0":"")+c.toString(16);let o=[],f=0;for(;f<10;)o[48+f]=f++;for(;f<16;)o[65-10+f]=o[97-10+f]=f++;let s=Symbol("id");class a{constructor(_){if(_ instanceof a&&(this[s]=_.id,this.__id=_.__id),typeof _=="object"&&_&&"id"in _&&("toHexString"in _&&typeof _.toHexString=="function"?this[s]=ye.Buffer.from(_.toHexString(),"hex"):this[s]=typeof _.id=="string"?ye.Buffer.from(_.id):_.id),(_==null||typeof _=="number")&&(this[s]=a.generate(typeof _=="number"?_:void 0),a.cacheHexString&&(this.__id=this.id.toString("hex"))),ArrayBuffer.isView(_)&&_.byteLength===12&&(this[s]=Mo.ensureBuffer(_)),typeof _=="string")if(_.length===12){let p=ye.Buffer.from(_);p.byteLength===12&&(this[s]=p)}else if(_.length===24&&n.test(_))this[s]=ye.Buffer.from(_,"hex");else throw new TypeError("Argument passed in must be a Buffer or string of 12 bytes or a string of 24 hex characters");a.cacheHexString&&(this.__id=this.id.toString("hex"))}get id(){return this[s]}set id(_){this[s]=_,a.cacheHexString&&(this.__id=_.toString("hex"))}get generationTime(){return this.id.readInt32BE(0)}set generationTime(_){this.id.writeUInt32BE(_,0)}toHexString(){if(a.cacheHexString&&this.__id)return this.__id;let _=this.id.toString("hex");return a.cacheHexString&&!this.__id&&(this.__id=_),_}static getInc(){return a.index=(a.index+1)%16777215}static generate(_){typeof _!="number"&&(_=~~(Date.now()/1e3));let p=a.getInc(),j=ye.Buffer.alloc(12);return j.writeUInt32BE(_,0),j[4]=r[0],j[5]=r[1],j[6]=r[2],j[7]=r[3],j[8]=r[4],j[11]=p&255,j[10]=p>>8&255,j[9]=p>>16&255,j}toString(_){return _?this.id.toString(_):this.toHexString()}toJSON(){return this.toHexString()}equals(_){return _==null?!1:_ instanceof a?this.toString()===_.toString():typeof _=="string"&&a.isValid(_)&&_.length===12&&this.id instanceof ye.Buffer?_===this.id.toString("binary"):typeof _=="string"&&a.isValid(_)&&_.length===24?_.toLowerCase()===this.toHexString():typeof _=="string"&&a.isValid(_)&&_.length===12?ye.Buffer.from(_).equals(this.id):typeof _=="object"&&"toHexString"in _&&typeof _.toHexString=="function"?_.toHexString()===this.toHexString():!1}getTimestamp(){let _=new Date,p=this.id.readUInt32BE(0);return _.setTime(Math.floor(p)*1e3),_}static createPk(){return new a}static createFromTime(_){let p=ye.Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0]);return p.writeUInt32BE(_,0),new a(p)}static createFromHexString(_){if(typeof _=="undefined"||_!=null&&_.length!==24)throw new TypeError("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new a(ye.Buffer.from(_,"hex"))}static isValid(_){return _==null?!1:typeof _=="number"?!0:typeof _=="string"?_.length===12||_.length===24&&n.test(_):_ instanceof a||_ instanceof ye.Buffer&&_.length===12?!0:typeof _=="object"&&"toHexString"in _&&typeof _.toHexString=="function"?typeof _.id=="string"?_.id.length===12:_.toHexString().length===24&&n.test(_.id.toString("hex")):!1}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(_){return new a(_.$oid)}}e.ObjectId=a,a.index=~~(Math.random()*16777215),Object.defineProperty(a.prototype,"generate",{value:_t.deprecate(c=>a.generate(c),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(a.prototype,"getInc",{value:_t.deprecate(()=>a.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(a.prototype,"get_inc",{value:_t.deprecate(()=>a.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(a,"get_inc",{value:_t.deprecate(()=>a.getInc(),"Please use the static `ObjectId.getInc()` instead")});let u=Symbol.for("nodejs.util.inspect.custom");Object.defineProperty(a.prototype,u,a.prototype.toString),Object.defineProperty(a.prototype,"inspect",a.prototype.toString),Object.defineProperty(a.prototype,"_bsontype",{value:"ObjectID"})});Ut(Qi);mC=Qi.ObjectId,G=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_DATA_MAX_KEY=e.BSON_DATA_MIN_KEY=e.BSON_DATA_DECIMAL128=e.BSON_DATA_LONG=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_INT=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_SYMBOL=e.BSON_DATA_CODE=e.BSON_DATA_DBPOINTER=e.BSON_DATA_REGEXP=e.BSON_DATA_NULL=e.BSON_DATA_DATE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_OID=e.BSON_DATA_UNDEFINED=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_DATA_OBJECT=e.BSON_DATA_STRING=e.BSON_DATA_NUMBER=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=void 0,e.BSON_INT32_MAX=2147483647,e.BSON_INT32_MIN=-2147483648,e.BSON_INT64_MAX=Math.pow(2,63)-1,e.BSON_INT64_MIN=-Math.pow(2,63),e.JS_INT_MAX=Math.pow(2,53),e.JS_INT_MIN=-Math.pow(2,53),e.BSON_DATA_NUMBER=1,e.BSON_DATA_STRING=2,e.BSON_DATA_OBJECT=3,e.BSON_DATA_ARRAY=4,e.BSON_DATA_BINARY=5,e.BSON_DATA_UNDEFINED=6,e.BSON_DATA_OID=7,e.BSON_DATA_BOOLEAN=8,e.BSON_DATA_DATE=9,e.BSON_DATA_NULL=10,e.BSON_DATA_REGEXP=11,e.BSON_DATA_DBPOINTER=12,e.BSON_DATA_CODE=13,e.BSON_DATA_SYMBOL=14,e.BSON_DATA_CODE_W_SCOPE=15,e.BSON_DATA_INT=16,e.BSON_DATA_TIMESTAMP=17,e.BSON_DATA_LONG=18,e.BSON_DATA_DECIMAL128=19,e.BSON_DATA_MIN_KEY=255,e.BSON_DATA_MAX_KEY=127,e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BSON_BINARY_SUBTYPE_FUNCTION=1,e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=2,e.BSON_BINARY_SUBTYPE_UUID=3,e.BSON_BINARY_SUBTYPE_UUID_NEW=4,e.BSON_BINARY_SUBTYPE_MD5=5,e.BSON_BINARY_SUBTYPE_USER_DEFINED=128});Ut(G);bC=G.BSON_BINARY_SUBTYPE_USER_DEFINED,hC=G.BSON_BINARY_SUBTYPE_MD5,wC=G.BSON_BINARY_SUBTYPE_UUID_NEW,gC=G.BSON_BINARY_SUBTYPE_UUID,yC=G.BSON_BINARY_SUBTYPE_BYTE_ARRAY,jC=G.BSON_BINARY_SUBTYPE_FUNCTION,_C=G.BSON_BINARY_SUBTYPE_DEFAULT,qC=G.BSON_DATA_MAX_KEY,vC=G.BSON_DATA_MIN_KEY,TC=G.BSON_DATA_DECIMAL128,BC=G.BSON_DATA_LONG,kC=G.BSON_DATA_TIMESTAMP,IC=G.BSON_DATA_INT,SC=G.BSON_DATA_CODE_W_SCOPE,xC=G.BSON_DATA_SYMBOL,EC=G.BSON_DATA_CODE,AC=G.BSON_DATA_DBPOINTER,OC=G.BSON_DATA_REGEXP,NC=G.BSON_DATA_NULL,DC=G.BSON_DATA_DATE,FC=G.BSON_DATA_BOOLEAN,PC=G.BSON_DATA_OID,RC=G.BSON_DATA_UNDEFINED,zC=G.BSON_DATA_BINARY,HC=G.BSON_DATA_ARRAY,MC=G.BSON_DATA_OBJECT,UC=G.BSON_DATA_STRING,LC=G.BSON_DATA_NUMBER,CC=G.JS_INT_MIN,VC=G.JS_INT_MAX,WC=G.BSON_INT64_MIN,YC=G.BSON_INT64_MAX,KC=G.BSON_INT32_MIN,GC=G.BSON_INT32_MAX,Bh=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateObjectSize=void 0;function r(i,o,f){let s=4+1;if(Array.isArray(i))for(let a=0;a<i.length;a++)s+=n(a.toString(),i[a],o,!0,f);else{i.toBSON&&(i=i.toBSON());for(let a in i)s+=n(a,i[a],o,!1,f)}return s}e.calculateObjectSize=r;function n(i,o,f=!1,s=!1,a=!1){switch(o&&o.toBSON&&(o=o.toBSON()),typeof o){case"string":return 1+ye.Buffer.byteLength(i,"utf8")+1+4+ye.Buffer.byteLength(o,"utf8")+1;case"number":return Math.floor(o)===o&&o>=G.JS_INT_MIN&&o<=G.JS_INT_MAX&&o>=G.BSON_INT32_MIN&&o<=G.BSON_INT32_MAX?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(4+1):(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(8+1);case"undefined":return s||!a?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1:0;case"boolean":return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(1+1);case"object":if(o==null||o._bsontype==="MinKey"||o._bsontype==="MaxKey")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1;if(o._bsontype==="ObjectId"||o._bsontype==="ObjectID")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(12+1);if(o instanceof Date||_t.isDate(o))return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(ArrayBuffer.isView(o)||o instanceof ArrayBuffer)return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(1+4+1)+o.byteLength;if(o._bsontype==="Long"||o._bsontype==="Double"||o._bsontype==="Timestamp")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(o._bsontype==="Decimal128")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(16+1);if(o._bsontype==="Code")return o.scope!=null&&Object.keys(o.scope).length>0?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ye.Buffer.byteLength(o.code.toString(),"utf8")+1+r(o.scope,f,a):(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+ye.Buffer.byteLength(o.code.toString(),"utf8")+1;if(o._bsontype==="Binary")return o.sub_type===ln.Binary.SUBTYPE_BYTE_ARRAY?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(o.position+1+4+1+4):(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+(o.position+1+4+1);if(o._bsontype==="Symbol")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+ye.Buffer.byteLength(o.value,"utf8")+4+1+1;if(o._bsontype==="DBRef"){let u=Object.assign({$ref:o.collection,$id:o.oid},o.fields);return o.db!=null&&(u.$db=o.db),(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+r(u,f,a)}else return o instanceof RegExp||Object.prototype.toString.call(o)==="[object RegExp]"?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+ye.Buffer.byteLength(o.source,"utf8")+1+(o.global?1:0)+(o.ignoreCase?1:0)+(o.multiline?1:0)+1:o._bsontype==="BSONRegExp"?(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+ye.Buffer.byteLength(o.pattern,"utf8")+1+ye.Buffer.byteLength(o.options,"utf8")+1:(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+r(o,f,a)+1;case"function":if(o instanceof RegExp||Object.prototype.toString.call(o)==="[object RegExp]"||String.call(o)==="[object RegExp]")return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+ye.Buffer.byteLength(o.source,"utf8")+1+(o.global?1:0)+(o.ignoreCase?1:0)+(o.multiline?1:0)+1;if(f&&o.scope!=null&&Object.keys(o.scope).length>0)return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ye.Buffer.byteLength(_t.normalizedFunctionString(o),"utf8")+1+r(o.scope,f,a);if(f)return(i!=null?ye.Buffer.byteLength(i,"utf8")+1:0)+1+4+ye.Buffer.byteLength(_t.normalizedFunctionString(o),"utf8")+1}return 0}});Ut(Bh);JC=Bh.calculateObjectSize,Lo=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONRegExp=void 0;function r(i){return i.split("").sort().join("")}class n{constructor(o,f){this.pattern=o,this.options=f??"",r(this.options);for(let s=0;s<this.options.length;s++)if(!(this.options[s]==="i"||this.options[s]==="m"||this.options[s]==="x"||this.options[s]==="l"||this.options[s]==="s"||this.options[s]==="u"))throw new Error(`The regular expression option [${this.options[s]}] is not supported`)}static parseOptions(o){return o?o.split("").sort().join(""):""}toExtendedJSON(o){return o=o||{},o.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(o){if("$regex"in o)if(typeof o.$regex!="string"){if(o.$regex._bsontype==="BSONRegExp")return o}else return new n(o.$regex,n.parseOptions(o.$options));if("$regularExpression"in o)return new n(o.$regularExpression.pattern,n.parseOptions(o.$regularExpression.options));throw new TypeError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(o)}`)}}e.BSONRegExp=n,Object.defineProperty(n.prototype,"_bsontype",{value:"BSONRegExp"})});Ut(Lo);ZC=Lo.BSONRegExp,Qs=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONSymbol=void 0;class r{constructor(i){this.value=i}valueOf(){return this.value}toString(){return this.value}inspect(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(i){return new r(i.$symbol)}}e.BSONSymbol=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Symbol"})});Ut(Qs);XC=Qs.BSONSymbol,Co=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.LongWithoutOverridesClass=void 0,e.LongWithoutOverridesClass=Se.Long;class r extends e.LongWithoutOverridesClass{constructor(i,o){Se.Long.isLong(i)?super(i.low,i.high,!0):super(i,o,!0),Object.defineProperty(this,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1})}toJSON(){return{$timestamp:this.toString()}}static fromInt(i){return new r(Se.Long.fromInt(i,!0))}static fromNumber(i){return new r(Se.Long.fromNumber(i,!0))}static fromBits(i,o){return new r(i,o)}static fromString(i,o){return new r(Se.Long.fromString(i,!0,o))}toExtendedJSON(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}}static fromExtendedJSON(i){return new r(i.$timestamp.i,i.$timestamp.t)}}e.Timestamp=r,r.MAX_VALUE=Se.Long.MAX_UNSIGNED_VALUE});Ut(Co);QC=Co.Timestamp,$C=Co.LongWithoutOverridesClass,Bp=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateUtf8=void 0;let r=128,n=192,i=224,o=240,f=248,s=192,a=224,u=240,c=128;function _(p,j,S){let T=0;for(let U=j;U<S;U+=1){let W=p[U];if(T){if((W&n)!==c)return!1;T-=1}else if(W&r)if((W&i)===s)T=1;else if((W&o)===a)T=2;else if((W&f)===u)T=3;else return!1}return!T}e.validateUtf8=_});Ut(Bp);eV=Bp.validateUtf8,kp=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserialize=void 0;let r=Se.Long.fromNumber(G.JS_INT_MAX),n=Se.Long.fromNumber(G.JS_INT_MIN),i={};function o(a,u,c){u=u??{};let _=u&&u.index?u.index:0,p=a[_]|a[_+1]<<8|a[_+2]<<16|a[_+3]<<24;if(p<5)throw new Error(`bson size must be >= 5, is ${p}`);if(u.allowObjectSmallerThanBufferSize&&a.length<p)throw new Error(`buffer length ${a.length} must be >= bson size ${p}`);if(!u.allowObjectSmallerThanBufferSize&&a.length!==p)throw new Error(`buffer length ${a.length} must === bson size ${p}`);if(p+_>a.byteLength)throw new Error(`(bson size ${p} + options.index ${_} must be <= buffer length ${a.byteLength})`);if(a[_+p-1]!==0)throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return f(a,_,u,c)}e.deserialize=o;function f(a,u,c,_=!1){let p=c.evalFunctions==null?!1:c.evalFunctions,j=c.cacheFunctions==null?!1:c.cacheFunctions,S=c.fieldsAsRaw==null?null:c.fieldsAsRaw,T=c.raw==null?!1:c.raw,U=typeof c.bsonRegExp=="boolean"?c.bsonRegExp:!1,W=c.promoteBuffers==null?!1:c.promoteBuffers,L=c.promoteLongs==null?!0:c.promoteLongs,te=c.promoteValues==null?!0:c.promoteValues,pe=u;if(a.length<5)throw new Error("corrupt bson message < 5 bytes long");let J=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(J<5||J>a.length)throw new Error("corrupt bson message");let D=_?[]:{},le=0,Y=!1;for(;!Y;){let g=a[u++];if(g===0)break;let N=u;for(;a[N]!==0&&N<a.length;)N++;if(N>=a.byteLength)throw new Error("Bad BSON Document: illegal CString");let b=_?le++:a.toString("utf8",u,N);if(u=N+1,g===G.BSON_DATA_STRING){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");if(!Bp.validateUtf8(a,u,u+z-1))throw new Error("Invalid UTF-8 string in BSON document");let K=a.toString("utf8",u,u+z-1);D[b]=K,u=u+z}else if(g===G.BSON_DATA_OID){let z=ye.Buffer.alloc(12);a.copy(z,0,u,u+12),D[b]=new Qi.ObjectId(z),u=u+12}else if(g===G.BSON_DATA_INT&&te===!1)D[b]=new Jf.Int32(a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24);else if(g===G.BSON_DATA_INT)D[b]=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;else if(g===G.BSON_DATA_NUMBER&&te===!1)D[b]=new Gf.Double(a.readDoubleLE(u)),u=u+8;else if(g===G.BSON_DATA_NUMBER)D[b]=a.readDoubleLE(u),u=u+8;else if(g===G.BSON_DATA_DATE){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;D[b]=new Date(new Se.Long(z,K).toNumber())}else if(g===G.BSON_DATA_BOOLEAN){if(a[u]!==0&&a[u]!==1)throw new Error("illegal boolean type value");D[b]=a[u++]===1}else if(g===G.BSON_DATA_OBJECT){let z=u,K=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24;if(K<=0||K>a.length-u)throw new Error("bad embedded document length in bson");T?D[b]=a.slice(u,u+K):D[b]=f(a,z,c,!1),u=u+K}else if(g===G.BSON_DATA_ARRAY){let z=u,K=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24,M=c,oe=u+K;if(S&&S[b]){M={};for(let A in c)M[A]=c[A];M.raw=!0}if(D[b]=f(a,z,M,!0),u=u+K,a[u-1]!==0)throw new Error("invalid array terminator byte");if(u!==oe)throw new Error("corrupted array bson")}else if(g===G.BSON_DATA_UNDEFINED)D[b]=void 0;else if(g===G.BSON_DATA_NULL)D[b]=null;else if(g===G.BSON_DATA_LONG){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,M=new Se.Long(z,K);L&&te===!0?D[b]=M.lessThanOrEqual(r)&&M.greaterThanOrEqual(n)?M.toNumber():M:D[b]=M}else if(g===G.BSON_DATA_DECIMAL128){let z=ye.Buffer.alloc(16);a.copy(z,0,u,u+16),u=u+16;let K=new Js.Decimal128(z);"toObject"in K&&typeof K.toObject=="function"?D[b]=K.toObject():D[b]=K}else if(g===G.BSON_DATA_BINARY){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=z,M=a[u++];if(z<0)throw new Error("Negative binary type element size found");if(z>a.byteLength)throw new Error("Binary type size larger than document size");if(a.slice!=null){if(M===ln.Binary.SUBTYPE_BYTE_ARRAY){if(z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,z<0)throw new Error("Negative binary type element size found for subtype 0x02");if(z>K-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(z<K-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}W&&te?D[b]=a.slice(u,u+z):D[b]=new ln.Binary(a.slice(u,u+z),M)}else{let oe=ye.Buffer.alloc(z);if(M===ln.Binary.SUBTYPE_BYTE_ARRAY){if(z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,z<0)throw new Error("Negative binary type element size found for subtype 0x02");if(z>K-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(z<K-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}for(N=0;N<z;N++)oe[N]=a[u+N];W&&te?D[b]=oe:D[b]=new ln.Binary(oe,M)}u=u+z}else if(g===G.BSON_DATA_REGEXP&&U===!1){for(N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let z=a.toString("utf8",u,N);for(u=N+1,N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let K=a.toString("utf8",u,N);u=N+1;let M=new Array(K.length);for(N=0;N<K.length;N++)switch(K[N]){case"m":M[N]="m";break;case"s":M[N]="g";break;case"i":M[N]="i";break}D[b]=new RegExp(z,M.join(""))}else if(g===G.BSON_DATA_REGEXP&&U===!0){for(N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let z=a.toString("utf8",u,N);for(u=N+1,N=u;a[N]!==0&&N<a.length;)N++;if(N>=a.length)throw new Error("Bad BSON Document: illegal CString");let K=a.toString("utf8",u,N);u=N+1,D[b]=new Lo.BSONRegExp(z,K)}else if(g===G.BSON_DATA_SYMBOL){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");let K=a.toString("utf8",u,u+z-1);D[b]=te?K:new Qs.BSONSymbol(K),u=u+z}else if(g===G.BSON_DATA_TIMESTAMP){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24,K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;D[b]=new Co.Timestamp(z,K)}else if(g===G.BSON_DATA_MIN_KEY)D[b]=new Xs.MinKey;else if(g===G.BSON_DATA_MAX_KEY)D[b]=new Zs.MaxKey;else if(g===G.BSON_DATA_CODE){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");let K=a.toString("utf8",u,u+z-1);p?j?D[b]=s(K,i,D):D[b]=s(K):D[b]=new Uo.Code(K),u=u+z}else if(g===G.BSON_DATA_CODE_W_SCOPE){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<4+4+4+1)throw new Error("code_w_scope total size shorter minimum expected length");let K=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(K<=0||K>a.length-u||a[u+K-1]!==0)throw new Error("bad string length in bson");let M=a.toString("utf8",u,u+K-1);u=u+K;let oe=u,A=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24,Ye=f(a,oe,c,!1);if(u=u+A,z<4+4+A+K)throw new Error("code_w_scope total size is too short, truncating scope");if(z>4+4+A+K)throw new Error("code_w_scope total size is too long, clips outer document");p?(j?D[b]=s(M,i,D):D[b]=s(M),D[b].scope=Ye):D[b]=new Uo.Code(M,Ye)}else if(g===G.BSON_DATA_DBPOINTER){let z=a[u++]|a[u++]<<8|a[u++]<<16|a[u++]<<24;if(z<=0||z>a.length-u||a[u+z-1]!==0)throw new Error("bad string length in bson");if(!Bp.validateUtf8(a,u,u+z-1))throw new Error("Invalid UTF-8 string in BSON document");let K=a.toString("utf8",u,u+z-1);u=u+z;let M=ye.Buffer.alloc(12);a.copy(M,0,u,u+12);let oe=new Qi.ObjectId(M);u=u+12,D[b]=new Kn.DBRef(K,oe)}else throw new Error("Detected unknown BSON type "+g.toString(16)+' for fieldname "'+b+'"')}if(J!==u-pe)throw _?new Error("corrupt array bson"):new Error("corrupt object bson");let de=Object.keys(D).filter(g=>g.startsWith("$")),y=!0;if(de.forEach(g=>{["$ref","$id","$db"].indexOf(g)===-1&&(y=!1)}),!y)return D;if(Kn.isDBRefLike(D)){let g=Object.assign({},D);return delete g.$ref,delete g.$id,delete g.$db,new Kn.DBRef(D.$ref,D.$id,D.$db,g)}return D}function s(a,u,c){return u?(u[a]==null&&(u[a]=new Function(a)),u[a].bind(c)):new Function(a)}});Ut(kp);tV=kp.deserialize,Kl=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=e.isBSONType=void 0;function r(T){return _t.isObjectLike(T)&&Reflect.has(T,"_bsontype")&&typeof T._bsontype=="string"}e.isBSONType=r;let n=2147483647,i=-2147483648,o=9223372036854776e3,f=-9223372036854776e3,s={$oid:Qi.ObjectId,$binary:ln.Binary,$uuid:ln.Binary,$symbol:Qs.BSONSymbol,$numberInt:Jf.Int32,$numberDecimal:Js.Decimal128,$numberDouble:Gf.Double,$numberLong:Se.Long,$minKey:Xs.MinKey,$maxKey:Zs.MaxKey,$regex:Lo.BSONRegExp,$regularExpression:Lo.BSONRegExp,$timestamp:Co.Timestamp};function a(T,U={}){if(typeof T=="number"){if(U.relaxed||U.legacy)return T;if(Math.floor(T)===T){if(T>=i&&T<=n)return new Jf.Int32(T);if(T>=f&&T<=o)return Se.Long.fromNumber(T)}return new Gf.Double(T)}if(T==null||typeof T!="object")return T;if(T.$undefined)return null;let W=Object.keys(T).filter(L=>L.startsWith("$")&&T[L]!=null);for(let L=0;L<W.length;L++){let te=s[W[L]];if(te)return te.fromExtendedJSON(T,U)}if(T.$date!=null){let L=T.$date,te=new Date;return U.legacy?typeof L=="number"?te.setTime(L):typeof L=="string"&&te.setTime(Date.parse(L)):typeof L=="string"?te.setTime(Date.parse(L)):Se.Long.isLong(L)?te.setTime(L.toNumber()):typeof L=="number"&&U.relaxed&&te.setTime(L),te}if(T.$code!=null){let L=Object.assign({},T);return T.$scope&&(L.$scope=a(T.$scope)),Uo.Code.fromExtendedJSON(T)}if(T.$ref!=null||T.$dbPointer!=null){let L=T.$ref?T:T.$dbPointer;if(L instanceof Kn.DBRef)return L;let te=Object.keys(L).filter(J=>J.startsWith("$")),pe=!0;if(te.forEach(J=>{["$ref","$id","$db"].indexOf(J)===-1&&(pe=!1)}),pe)return Kn.DBRef.fromExtendedJSON(L)}return T}function u(T,U){return T.map(W=>_(W,U))}function c(T){let U=T.toISOString();return T.getUTCMilliseconds()!==0?U:U.slice(0,-5)+"Z"}function _(T,U){if(Array.isArray(T))return u(T,U);if(T===void 0)return null;if(T instanceof Date){let W=T.getTime(),L=W>-1&&W<2534023188e5;return U.legacy?U.relaxed&&L?{$date:T.getTime()}:{$date:c(T)}:U.relaxed&&L?{$date:c(T)}:{$date:{$numberLong:T.getTime().toString()}}}if(typeof T=="number"&&!U.relaxed){if(Math.floor(T)===T){let W=T>=i&&T<=n,L=T>=f&&T<=o;if(W)return{$numberInt:T.toString()};if(L)return{$numberLong:T.toString()}}return{$numberDouble:T.toString()}}if(T instanceof RegExp){let W=T.flags;if(W===void 0){let te=T.toString().match(/[gimuy]*$/);te&&(W=te[0])}return new Lo.BSONRegExp(T.source,W).toExtendedJSON(U)}return T!=null&&typeof T=="object"?j(T,U):T}let p={Binary:T=>new ln.Binary(T.value(),T.sub_type),Code:T=>new Uo.Code(T.code,T.scope),DBRef:T=>new Kn.DBRef(T.collection||T.namespace,T.oid,T.db,T.fields),Decimal128:T=>new Js.Decimal128(T.bytes),Double:T=>new Gf.Double(T.value),Int32:T=>new Jf.Int32(T.value),Long:T=>Se.Long.fromBits(T.low!=null?T.low:T.low_,T.low!=null?T.high:T.high_,T.low!=null?T.unsigned:T.unsigned_),MaxKey:()=>new Zs.MaxKey,MinKey:()=>new Xs.MinKey,ObjectID:T=>new Qi.ObjectId(T),ObjectId:T=>new Qi.ObjectId(T),BSONRegExp:T=>new Lo.BSONRegExp(T.pattern,T.options),Symbol:T=>new Qs.BSONSymbol(T.value),Timestamp:T=>Co.Timestamp.fromBits(T.low,T.high)};function j(T,U){if(T==null||typeof T!="object")throw new Error("not an object instance");let W=T._bsontype;if(typeof W=="undefined"){let L={};for(let te in T)L[te]=_(T[te],U);return L}else if(r(T)){let L=T;if(typeof L.toExtendedJSON!="function"){let te=p[T._bsontype];if(!te)throw new TypeError("Unrecognized or invalid _bsontype: "+T._bsontype);L=te(L)}return W==="Code"&&L.scope?L=new Uo.Code(L.code,_(L.scope,U)):W==="DBRef"&&L.oid&&(L=new Kn.DBRef(L.collection,_(L.oid,U),L.db,L.fields)),L.toExtendedJSON(U)}else throw new Error("_bsontype must be a string, but was: "+typeof W)}var S;(function(T){function U(pe,J){let D=Object.assign({},{relaxed:!0,legacy:!1},J);return typeof D.relaxed=="boolean"&&(D.strict=!D.relaxed),typeof D.strict=="boolean"&&(D.relaxed=!D.strict),JSON.parse(pe,(le,Y)=>a(Y,D))}T.parse=U;function W(pe,J,D,le){D!=null&&typeof D=="object"&&(le=D,D=0),J!=null&&typeof J=="object"&&!Array.isArray(J)&&(le=J,J=void 0,D=0),le=Object.assign({},{relaxed:!0,legacy:!1},le);let Y=_(pe,le);return JSON.stringify(Y,J,D)}T.stringify=W;function L(pe,J){return J=J||{},JSON.parse(W(pe,J))}T.serialize=L;function te(pe,J){return J=J||{},U(JSON.stringify(pe),J)}T.deserialize=te})(S=e.EJSON||(e.EJSON={}))});Ut(Kl);rV=Kl.EJSON,nV=Kl.isBSONType,Gl=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.writeIEEE754=e.readIEEE754=void 0;function r(i,o,f,s,a){let u,c,_=f==="big",p=a*8-s-1,j=(1<<p)-1,S=j>>1,T=-7,U=_?0:a-1,W=_?1:-1,L=i[o+U];for(U+=W,u=L&(1<<-T)-1,L>>=-T,T+=p;T>0;u=u*256+i[o+U],U+=W,T-=8);for(c=u&(1<<-T)-1,u>>=-T,T+=s;T>0;c=c*256+i[o+U],U+=W,T-=8);if(u===0)u=1-S;else{if(u===j)return c?NaN:(L?-1:1)*(1/0);c=c+Math.pow(2,s),u=u-S}return(L?-1:1)*c*Math.pow(2,u-s)}e.readIEEE754=r;function n(i,o,f,s,a,u){let c,_,p,j=s==="big",S=u*8-a-1,T=(1<<S)-1,U=T>>1,W=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=j?u-1:0,te=j?-1:1,pe=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(_=isNaN(o)?1:0,c=T):(c=Math.floor(Math.log(o)/Math.LN2),o*(p=Math.pow(2,-c))<1&&(c--,p*=2),c+U>=1?o+=W/p:o+=W*Math.pow(2,1-U),o*p>=2&&(c++,p/=2),c+U>=T?(_=0,c=T):c+U>=1?(_=(o*p-1)*Math.pow(2,a),c=c+U):(_=o*Math.pow(2,U-1)*Math.pow(2,a),c=0)),isNaN(o)&&(_=0);a>=8;)i[f+L]=_&255,L+=te,_/=256,a-=8;for(c=c<<a|_,isNaN(o)&&(c+=8),S+=a;S>0;)i[f+L]=c&255,L+=te,c/=256,S-=8;i[f+L-te]|=pe*128}e.writeIEEE754=n});Ut(Gl);iV=Gl.writeIEEE754,oV=Gl.readIEEE754,Ip=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeInto=void 0;let r=/\x00/,n=new Set(["$db","$ref","$id","$clusterTime"]);function i(y){return Object.prototype.toString.call(y)==="[object RegExp]"}function o(y,g,N,b,z){y[b++]=G.BSON_DATA_STRING;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K+1,y[b-1]=0;let M=y.write(N,b+4,void 0,"utf8");return y[b+3]=M+1>>24&255,y[b+2]=M+1>>16&255,y[b+1]=M+1>>8&255,y[b]=M+1&255,b=b+4+M,y[b++]=0,b}function f(y,g,N,b,z){if(Number.isInteger(N)&&N>=G.BSON_INT32_MIN&&N<=G.BSON_INT32_MAX){y[b++]=G.BSON_DATA_INT;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0,y[b++]=N&255,y[b++]=N>>8&255,y[b++]=N>>16&255,y[b++]=N>>24&255}else{y[b++]=G.BSON_DATA_NUMBER;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0,Gl.writeIEEE754(y,N,b,"little",52,8),b=b+8}return b}function s(y,g,N,b,z){y[b++]=G.BSON_DATA_NULL;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,b}function a(y,g,N,b,z){y[b++]=G.BSON_DATA_BOOLEAN;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,y[b++]=N?1:0,b}function u(y,g,N,b,z){y[b++]=G.BSON_DATA_DATE;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=Se.Long.fromNumber(N.getTime()),oe=M.getLowBits(),A=M.getHighBits();return y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255,y[b++]=A&255,y[b++]=A>>8&255,y[b++]=A>>16&255,y[b++]=A>>24&255,b}function c(y,g,N,b,z){y[b++]=G.BSON_DATA_REGEXP;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");if(b=b+K,y[b++]=0,N.source&&N.source.match(r)!=null)throw Error("value "+N.source+" must not contain null bytes");return b=b+y.write(N.source,b,void 0,"utf8"),y[b++]=0,N.ignoreCase&&(y[b++]=105),N.global&&(y[b++]=115),N.multiline&&(y[b++]=109),y[b++]=0,b}function _(y,g,N,b,z){y[b++]=G.BSON_DATA_REGEXP;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");if(b=b+K,y[b++]=0,N.pattern.match(r)!=null)throw Error("pattern "+N.pattern+" must not contain null bytes");return b=b+y.write(N.pattern,b,void 0,"utf8"),y[b++]=0,b=b+y.write(N.options.split("").sort().join(""),b,void 0,"utf8"),y[b++]=0,b}function p(y,g,N,b,z){N===null?y[b++]=G.BSON_DATA_NULL:N._bsontype==="MinKey"?y[b++]=G.BSON_DATA_MIN_KEY:y[b++]=G.BSON_DATA_MAX_KEY;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,b}function j(y,g,N,b,z){y[b++]=G.BSON_DATA_OID;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");if(b=b+K,y[b++]=0,typeof N.id=="string")y.write(N.id,b,void 0,"binary");else if(N.id&&N.id.copy)N.id.copy(y,b,0,12);else throw new TypeError("object ["+JSON.stringify(N)+"] is not a valid ObjectId");return b+12}function S(y,g,N,b,z){y[b++]=G.BSON_DATA_BINARY;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=N.length;return y[b++]=M&255,y[b++]=M>>8&255,y[b++]=M>>16&255,y[b++]=M>>24&255,y[b++]=G.BSON_BINARY_SUBTYPE_DEFAULT,y.set(Mo.ensureBuffer(N),b),b=b+M,b}function T(y,g,N,b,z=!1,K=0,M=!1,oe=!0,A=!1,Ye=[]){for(let X=0;X<Ye.length;X++)if(Ye[X]===N)throw new Error("cyclic dependency detected");Ye.push(N),y[b++]=Array.isArray(N)?G.BSON_DATA_ARRAY:G.BSON_DATA_OBJECT;let me=A?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+me,y[b++]=0;let V=de(y,N,z,b,K+1,M,oe,Ye);return Ye.pop(),V}function U(y,g,N,b,z){y[b++]=G.BSON_DATA_DECIMAL128;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,N.bytes.copy(y,b,0,16),b+16}function W(y,g,N,b,z){y[b++]=N._bsontype==="Long"?G.BSON_DATA_LONG:G.BSON_DATA_TIMESTAMP;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=N.getLowBits(),oe=N.getHighBits();return y[b++]=M&255,y[b++]=M>>8&255,y[b++]=M>>16&255,y[b++]=M>>24&255,y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255,b}function L(y,g,N,b,z){N=N.valueOf(),y[b++]=G.BSON_DATA_INT;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,y[b++]=N&255,y[b++]=N>>8&255,y[b++]=N>>16&255,y[b++]=N>>24&255,b}function te(y,g,N,b,z){y[b++]=G.BSON_DATA_NUMBER;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");return b=b+K,y[b++]=0,Gl.writeIEEE754(y,N.value,b,"little",52,8),b=b+8,b}function pe(y,g,N,b,z=!1,K=0,M){y[b++]=G.BSON_DATA_CODE;let oe=M?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+oe,y[b++]=0;let A=_t.normalizedFunctionString(N),Ye=y.write(A,b+4,void 0,"utf8")+1;return y[b]=Ye&255,y[b+1]=Ye>>8&255,y[b+2]=Ye>>16&255,y[b+3]=Ye>>24&255,b=b+4+Ye-1,y[b++]=0,b}function J(y,g,N,b,z=!1,K=0,M=!1,oe=!0,A=!1){if(N.scope&&typeof N.scope=="object"){y[b++]=G.BSON_DATA_CODE_W_SCOPE;let Ye=A?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+Ye,y[b++]=0;let me=b,V=typeof N.code=="string"?N.code:N.code.toString();b=b+4;let X=y.write(V,b+4,void 0,"utf8")+1;y[b]=X&255,y[b+1]=X>>8&255,y[b+2]=X>>16&255,y[b+3]=X>>24&255,y[b+4+X-1]=0,b=b+X+4;let He=de(y,N.scope,z,b,K+1,M,oe);b=He-1;let we=He-me;y[me++]=we&255,y[me++]=we>>8&255,y[me++]=we>>16&255,y[me++]=we>>24&255,y[b++]=0}else{y[b++]=G.BSON_DATA_CODE;let Ye=A?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+Ye,y[b++]=0;let me=N.code.toString(),V=y.write(me,b+4,void 0,"utf8")+1;y[b]=V&255,y[b+1]=V>>8&255,y[b+2]=V>>16&255,y[b+3]=V>>24&255,b=b+4+V-1,y[b++]=0}return b}function D(y,g,N,b,z){y[b++]=G.BSON_DATA_BINARY;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=N.value(!0),oe=N.position;return N.sub_type===ln.Binary.SUBTYPE_BYTE_ARRAY&&(oe=oe+4),y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255,y[b++]=N.sub_type,N.sub_type===ln.Binary.SUBTYPE_BYTE_ARRAY&&(oe=oe-4,y[b++]=oe&255,y[b++]=oe>>8&255,y[b++]=oe>>16&255,y[b++]=oe>>24&255),y.set(M,b),b=b+N.position,b}function le(y,g,N,b,z){y[b++]=G.BSON_DATA_SYMBOL;let K=z?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+K,y[b++]=0;let M=y.write(N.value,b+4,void 0,"utf8")+1;return y[b]=M&255,y[b+1]=M>>8&255,y[b+2]=M>>16&255,y[b+3]=M>>24&255,b=b+4+M-1,y[b++]=0,b}function Y(y,g,N,b,z,K,M){y[b++]=G.BSON_DATA_OBJECT;let oe=M?y.write(g,b,void 0,"ascii"):y.write(g,b,void 0,"utf8");b=b+oe,y[b++]=0;let A=b,Ye={$ref:N.collection||N.namespace,$id:N.oid};N.db!=null&&(Ye.$db=N.db),Ye=Object.assign(Ye,N.fields);let me=de(y,Ye,!1,b,z+1,K),V=me-A;return y[A++]=V&255,y[A++]=V>>8&255,y[A++]=V>>16&255,y[A++]=V>>24&255,me}function de(y,g,N=!1,b=0,z=0,K=!1,M=!0,oe=[]){b=b||0,oe=oe||[],oe.push(g);let A=b+4;if(Array.isArray(g))for(let me=0;me<g.length;me++){let V=""+me,X=g[me];if(X&&X.toBSON){if(typeof X.toBSON!="function")throw new TypeError("toBSON is not a function");X=X.toBSON()}if(typeof X=="string")A=o(y,V,X,A,!0);else if(typeof X=="number")A=f(y,V,X,A,!0);else{if(typeof X=="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(typeof X=="boolean")A=a(y,V,X,A,!0);else if(X instanceof Date||_t.isDate(X))A=u(y,V,X,A,!0);else if(X===void 0)A=s(y,V,X,A,!0);else if(X===null)A=s(y,V,X,A,!0);else if(X._bsontype==="ObjectId"||X._bsontype==="ObjectID")A=j(y,V,X,A,!0);else if(ye.Buffer.isBuffer(X)||_t.isUint8Array(X))A=S(y,V,X,A,!0);else if(X instanceof RegExp||i(X))A=c(y,V,X,A,!0);else if(typeof X=="object"&&X._bsontype==null)A=T(y,V,X,A,N,z,K,M,!0,oe);else if(typeof X=="object"&&Kl.isBSONType(X)&&X._bsontype==="Decimal128")A=U(y,V,X,A,!0);else if(X._bsontype==="Long"||X._bsontype==="Timestamp")A=W(y,V,X,A,!0);else if(X._bsontype==="Double")A=te(y,V,X,A,!0);else if(typeof X=="function"&&K)A=pe(y,V,X,A,N,z,!0);else if(X._bsontype==="Code")A=J(y,V,X,A,N,z,K,M,!0);else if(X._bsontype==="Binary")A=D(y,V,X,A,!0);else if(X._bsontype==="Symbol")A=le(y,V,X,A,!0);else if(X._bsontype==="DBRef")A=Y(y,V,X,A,z,K,!0);else if(X._bsontype==="BSONRegExp")A=_(y,V,X,A,!0);else if(X._bsontype==="Int32")A=L(y,V,X,A,!0);else if(X._bsontype==="MinKey"||X._bsontype==="MaxKey")A=p(y,V,X,A,!0);else if(typeof X._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+X._bsontype)}}else if(g instanceof Tp.Map){let me=g.entries(),V=!1;for(;!V;){let X=me.next();if(V=!!X.done,V)continue;let He=X.value[0],we=X.value[1],rt=typeof we;if(typeof He=="string"&&!n.has(He)){if(He.match(r)!=null)throw Error("key "+He+" must not contain null bytes");if(N){if(He[0]==="$")throw Error("key "+He+" must not start with '$'");if(~He.indexOf("."))throw Error("key "+He+" must not contain '.'")}}if(rt==="string")A=o(y,He,we,A);else if(rt==="number")A=f(y,He,we,A);else{if(rt==="bigint"||_t.isBigInt64Array(we)||_t.isBigUInt64Array(we))throw new TypeError("Unsupported type BigInt, please use Decimal128");if(rt==="boolean")A=a(y,He,we,A);else if(we instanceof Date||_t.isDate(we))A=u(y,He,we,A);else if(we===null||we===void 0&&M===!1)A=s(y,He,we,A);else if(we._bsontype==="ObjectId"||we._bsontype==="ObjectID")A=j(y,He,we,A);else if(ye.Buffer.isBuffer(we)||_t.isUint8Array(we))A=S(y,He,we,A);else if(we instanceof RegExp||i(we))A=c(y,He,we,A);else if(rt==="object"&&we._bsontype==null)A=T(y,He,we,A,N,z,K,M,!1,oe);else if(rt==="object"&&we._bsontype==="Decimal128")A=U(y,He,we,A);else if(we._bsontype==="Long"||we._bsontype==="Timestamp")A=W(y,He,we,A);else if(we._bsontype==="Double")A=te(y,He,we,A);else if(we._bsontype==="Code")A=J(y,He,we,A,N,z,K,M);else if(typeof we=="function"&&K)A=pe(y,He,we,A,N,z,K);else if(we._bsontype==="Binary")A=D(y,He,we,A);else if(we._bsontype==="Symbol")A=le(y,He,we,A);else if(we._bsontype==="DBRef")A=Y(y,He,we,A,z,K);else if(we._bsontype==="BSONRegExp")A=_(y,He,we,A);else if(we._bsontype==="Int32")A=L(y,He,we,A);else if(we._bsontype==="MinKey"||we._bsontype==="MaxKey")A=p(y,He,we,A);else if(typeof we._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+we._bsontype)}}}else{if(g.toBSON){if(typeof g.toBSON!="function")throw new TypeError("toBSON is not a function");if(g=g.toBSON(),g!=null&&typeof g!="object")throw new TypeError("toBSON function did not return an object")}for(let me in g){let V=g[me];if(V&&V.toBSON){if(typeof V.toBSON!="function")throw new TypeError("toBSON is not a function");V=V.toBSON()}let X=typeof V;if(typeof me=="string"&&!n.has(me)){if(me.match(r)!=null)throw Error("key "+me+" must not contain null bytes");if(N){if(me[0]==="$")throw Error("key "+me+" must not start with '$'");if(~me.indexOf("."))throw Error("key "+me+" must not contain '.'")}}if(X==="string")A=o(y,me,V,A);else if(X==="number")A=f(y,me,V,A);else{if(X==="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(X==="boolean")A=a(y,me,V,A);else if(V instanceof Date||_t.isDate(V))A=u(y,me,V,A);else if(V===void 0)M===!1&&(A=s(y,me,V,A));else if(V===null)A=s(y,me,V,A);else if(V._bsontype==="ObjectId"||V._bsontype==="ObjectID")A=j(y,me,V,A);else if(ye.Buffer.isBuffer(V)||_t.isUint8Array(V))A=S(y,me,V,A);else if(V instanceof RegExp||i(V))A=c(y,me,V,A);else if(X==="object"&&V._bsontype==null)A=T(y,me,V,A,N,z,K,M,!1,oe);else if(X==="object"&&V._bsontype==="Decimal128")A=U(y,me,V,A);else if(V._bsontype==="Long"||V._bsontype==="Timestamp")A=W(y,me,V,A);else if(V._bsontype==="Double")A=te(y,me,V,A);else if(V._bsontype==="Code")A=J(y,me,V,A,N,z,K,M);else if(typeof V=="function"&&K)A=pe(y,me,V,A,N,z,K);else if(V._bsontype==="Binary")A=D(y,me,V,A);else if(V._bsontype==="Symbol")A=le(y,me,V,A);else if(V._bsontype==="DBRef")A=Y(y,me,V,A,z,K);else if(V._bsontype==="BSONRegExp")A=_(y,me,V,A);else if(V._bsontype==="Int32")A=L(y,me,V,A);else if(V._bsontype==="MinKey"||V._bsontype==="MaxKey")A=p(y,me,V,A);else if(typeof V._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+V._bsontype)}}}oe.pop(),y[A++]=0;let Ye=A-b;return y[b++]=Ye&255,y[b++]=Ye>>8&255,y[b++]=Ye>>16&255,y[b++]=Ye>>24&255,A}e.serializeInto=de});Ut(Ip);fV=Ip.serializeInto,xe=Ft(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeStream=e.calculateObjectSize=e.deserialize=e.serializeWithBufferAndIndex=e.serialize=e.setInternalBufferSize=e.ObjectID=e.Decimal128=e.BSONRegExp=e.MaxKey=e.MinKey=e.Int32=e.Double=e.Timestamp=e.Long=e.ObjectId=e.Binary=e.DBRef=e.BSONSymbol=e.Map=e.Code=e.LongWithoutOverridesClass=e.EJSON=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=e.BSON_DATA_UNDEFINED=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_SYMBOL=e.BSON_DATA_STRING=e.BSON_DATA_REGEXP=e.BSON_DATA_OID=e.BSON_DATA_OBJECT=e.BSON_DATA_NUMBER=e.BSON_DATA_NULL=e.BSON_DATA_MIN_KEY=e.BSON_DATA_MAX_KEY=e.BSON_DATA_LONG=e.BSON_DATA_INT=e.BSON_DATA_DECIMAL128=e.BSON_DATA_DBPOINTER=e.BSON_DATA_DATE=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_CODE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=void 0,Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return ln.Binary}}),Object.defineProperty(e,"Code",{enumerable:!0,get:function(){return Uo.Code}}),Object.defineProperty(e,"DBRef",{enumerable:!0,get:function(){return Kn.DBRef}}),Object.defineProperty(e,"Decimal128",{enumerable:!0,get:function(){return Js.Decimal128}}),Object.defineProperty(e,"Double",{enumerable:!0,get:function(){return Gf.Double}}),Object.defineProperty(e,"Int32",{enumerable:!0,get:function(){return Jf.Int32}}),Object.defineProperty(e,"Long",{enumerable:!0,get:function(){return Se.Long}}),Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return Tp.Map}}),Object.defineProperty(e,"MaxKey",{enumerable:!0,get:function(){return Zs.MaxKey}}),Object.defineProperty(e,"MinKey",{enumerable:!0,get:function(){return Xs.MinKey}}),Object.defineProperty(e,"ObjectId",{enumerable:!0,get:function(){return Qi.ObjectId}}),Object.defineProperty(e,"ObjectID",{enumerable:!0,get:function(){return Qi.ObjectId}}),Object.defineProperty(e,"BSONRegExp",{enumerable:!0,get:function(){return Lo.BSONRegExp}}),Object.defineProperty(e,"BSONSymbol",{enumerable:!0,get:function(){return Qs.BSONSymbol}}),Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return Co.Timestamp}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_BYTE_ARRAY",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_BYTE_ARRAY}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_DEFAULT",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_DEFAULT}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_FUNCTION",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_FUNCTION}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_MD5",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_MD5}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_USER_DEFINED",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_USER_DEFINED}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_UUID}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID_NEW",{enumerable:!0,get:function(){return G.BSON_BINARY_SUBTYPE_UUID_NEW}}),Object.defineProperty(e,"BSON_DATA_ARRAY",{enumerable:!0,get:function(){return G.BSON_DATA_ARRAY}}),Object.defineProperty(e,"BSON_DATA_BINARY",{enumerable:!0,get:function(){return G.BSON_DATA_BINARY}}),Object.defineProperty(e,"BSON_DATA_BOOLEAN",{enumerable:!0,get:function(){return G.BSON_DATA_BOOLEAN}}),Object.defineProperty(e,"BSON_DATA_CODE",{enumerable:!0,get:function(){return G.BSON_DATA_CODE}}),Object.defineProperty(e,"BSON_DATA_CODE_W_SCOPE",{enumerable:!0,get:function(){return G.BSON_DATA_CODE_W_SCOPE}}),Object.defineProperty(e,"BSON_DATA_DATE",{enumerable:!0,get:function(){return G.BSON_DATA_DATE}}),Object.defineProperty(e,"BSON_DATA_DBPOINTER",{enumerable:!0,get:function(){return G.BSON_DATA_DBPOINTER}}),Object.defineProperty(e,"BSON_DATA_DECIMAL128",{enumerable:!0,get:function(){return G.BSON_DATA_DECIMAL128}}),Object.defineProperty(e,"BSON_DATA_INT",{enumerable:!0,get:function(){return G.BSON_DATA_INT}}),Object.defineProperty(e,"BSON_DATA_LONG",{enumerable:!0,get:function(){return G.BSON_DATA_LONG}}),Object.defineProperty(e,"BSON_DATA_MAX_KEY",{enumerable:!0,get:function(){return G.BSON_DATA_MAX_KEY}}),Object.defineProperty(e,"BSON_DATA_MIN_KEY",{enumerable:!0,get:function(){return G.BSON_DATA_MIN_KEY}}),Object.defineProperty(e,"BSON_DATA_NULL",{enumerable:!0,get:function(){return G.BSON_DATA_NULL}}),Object.defineProperty(e,"BSON_DATA_NUMBER",{enumerable:!0,get:function(){return G.BSON_DATA_NUMBER}}),Object.defineProperty(e,"BSON_DATA_OBJECT",{enumerable:!0,get:function(){return G.BSON_DATA_OBJECT}}),Object.defineProperty(e,"BSON_DATA_OID",{enumerable:!0,get:function(){return G.BSON_DATA_OID}}),Object.defineProperty(e,"BSON_DATA_REGEXP",{enumerable:!0,get:function(){return G.BSON_DATA_REGEXP}}),Object.defineProperty(e,"BSON_DATA_STRING",{enumerable:!0,get:function(){return G.BSON_DATA_STRING}}),Object.defineProperty(e,"BSON_DATA_SYMBOL",{enumerable:!0,get:function(){return G.BSON_DATA_SYMBOL}}),Object.defineProperty(e,"BSON_DATA_TIMESTAMP",{enumerable:!0,get:function(){return G.BSON_DATA_TIMESTAMP}}),Object.defineProperty(e,"BSON_DATA_UNDEFINED",{enumerable:!0,get:function(){return G.BSON_DATA_UNDEFINED}}),Object.defineProperty(e,"BSON_INT32_MAX",{enumerable:!0,get:function(){return G.BSON_INT32_MAX}}),Object.defineProperty(e,"BSON_INT32_MIN",{enumerable:!0,get:function(){return G.BSON_INT32_MIN}}),Object.defineProperty(e,"BSON_INT64_MAX",{enumerable:!0,get:function(){return G.BSON_INT64_MAX}}),Object.defineProperty(e,"BSON_INT64_MIN",{enumerable:!0,get:function(){return G.BSON_INT64_MIN}}),Object.defineProperty(e,"JS_INT_MAX",{enumerable:!0,get:function(){return G.JS_INT_MAX}}),Object.defineProperty(e,"JS_INT_MIN",{enumerable:!0,get:function(){return G.JS_INT_MIN}}),Object.defineProperty(e,"EJSON",{enumerable:!0,get:function(){return Kl.EJSON}});var r=Co;Object.defineProperty(e,"LongWithoutOverridesClass",{enumerable:!0,get:function(){return r.LongWithoutOverridesClass}});let n=1024*1024*17,i=ye.Buffer.alloc(n);function o(_){i.length<_&&(i=ye.Buffer.alloc(_))}e.setInternalBufferSize=o;function f(_,p={}){let j=typeof p.checkKeys=="boolean"?p.checkKeys:!1,S=typeof p.serializeFunctions=="boolean"?p.serializeFunctions:!1,T=typeof p.ignoreUndefined=="boolean"?p.ignoreUndefined:!0,U=typeof p.minInternalBufferSize=="number"?p.minInternalBufferSize:n;i.length<U&&(i=ye.Buffer.alloc(U));let W=Ip.serializeInto(i,_,j,0,0,S,T,[]),L=ye.Buffer.alloc(W);return i.copy(L,0,0,L.length),L}e.serialize=f;function s(_,p,j={}){let S=typeof j.checkKeys=="boolean"?j.checkKeys:!1,T=typeof j.serializeFunctions=="boolean"?j.serializeFunctions:!1,U=typeof j.ignoreUndefined=="boolean"?j.ignoreUndefined:!0,W=typeof j.index=="number"?j.index:0,L=Ip.serializeInto(i,_,S,0,0,T,U);return i.copy(p,W,0,L),W+L-1}e.serializeWithBufferAndIndex=s;function a(_,p={}){return kp.deserialize(Mo.ensureBuffer(_),p)}e.deserialize=a;function u(_,p={}){p=p||{};let j=typeof p.serializeFunctions=="boolean"?p.serializeFunctions:!1,S=typeof p.ignoreUndefined=="boolean"?p.ignoreUndefined:!0;return Bh.calculateObjectSize(_,j,S)}e.calculateObjectSize=u;function c(_,p,j,S,T,U){let W=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},U),L=Mo.ensureBuffer(_),te=p;for(let pe=0;pe<j;pe++){let J=L[te]|L[te+1]<<8|L[te+2]<<16|L[te+3]<<24;W.index=te,S[T+pe]=kp.deserialize(L,W),te=te+J}return te}e.deserializeStream=c}),sV=Ut(xe),aV=xe.deserializeStream,lV=xe.calculateObjectSize,Qv=xe.deserialize,uV=xe.serializeWithBufferAndIndex,$v=xe.serialize,cV=xe.setInternalBufferSize,pV=xe.ObjectID,dV=xe.Decimal128,mV=xe.BSONRegExp,bV=xe.MaxKey,hV=xe.MinKey,wV=xe.Int32,gV=xe.Double,yV=xe.Timestamp,jV=xe.Long,_V=xe.ObjectId,qV=xe.Binary,vV=xe.DBRef,TV=xe.BSONSymbol,BV=xe.Map,kV=xe.Code,IV=xe.LongWithoutOverridesClass,SV=xe.EJSON,xV=xe.JS_INT_MIN,EV=xe.JS_INT_MAX,AV=xe.BSON_INT64_MIN,OV=xe.BSON_INT64_MAX,NV=xe.BSON_INT32_MIN,DV=xe.BSON_INT32_MAX,FV=xe.BSON_DATA_UNDEFINED,PV=xe.BSON_DATA_TIMESTAMP,RV=xe.BSON_DATA_SYMBOL,zV=xe.BSON_DATA_STRING,HV=xe.BSON_DATA_REGEXP,MV=xe.BSON_DATA_OID,UV=xe.BSON_DATA_OBJECT,LV=xe.BSON_DATA_NUMBER,CV=xe.BSON_DATA_NULL,VV=xe.BSON_DATA_MIN_KEY,WV=xe.BSON_DATA_MAX_KEY,YV=xe.BSON_DATA_LONG,KV=xe.BSON_DATA_INT,GV=xe.BSON_DATA_DECIMAL128,JV=xe.BSON_DATA_DBPOINTER,ZV=xe.BSON_DATA_DATE,XV=xe.BSON_DATA_CODE_W_SCOPE,QV=xe.BSON_DATA_CODE,$V=xe.BSON_DATA_BOOLEAN,e5=xe.BSON_DATA_BINARY,t5=xe.BSON_DATA_ARRAY,r5=xe.BSON_BINARY_SUBTYPE_UUID_NEW,n5=xe.BSON_BINARY_SUBTYPE_UUID,i5=xe.BSON_BINARY_SUBTYPE_USER_DEFINED,o5=xe.BSON_BINARY_SUBTYPE_MD5,f5=xe.BSON_BINARY_SUBTYPE_FUNCTION,s5=xe.BSON_BINARY_SUBTYPE_DEFAULT,a5=xe.BSON_BINARY_SUBTYPE_BYTE_ARRAY});function Ih(t,e){return Qv(new Uint8Array(t),e)}var eT=re(()=>{kh()});async function oN(t,e){let r={...Sh.bson,...e==null?void 0:e.bson};return Ih(t,r)}function fN(t,e){let r={...Sh.bson,...e==null?void 0:e.bson};return Ih(t,r)}var iN,Sh,xh,tT=re(()=>{eT();iN="3.4.14",Sh={bson:{}},xh={name:"BSON",id:"bson",module:"bson",version:iN,extensions:["bson"],mimeTypes:["application/bson"],category:"json",binary:!0,parse:oN,parseSync:fN,options:Sh}});function Eh(t,e){return $v(t).buffer}var rT=re(()=>{kh()});var sN,Ah,nT=re(()=>{rT();sN="3.4.14",Ah={name:"BSON",id:"bson",module:"bson",version:sN,extensions:["bson"],options:{image:{mimeType:"application/bson"}},async encode(t,e){return Eh(t,{})},encodeSync(t,e){return Eh(t,{})}}});var iT=re(()=>{tT();nT()});function oT(t,e,r){if(!(t in Zf))throw new Error(`invalid type: ${t}`);return Zf[t].toPrimitive(e,r)}function fT(t,e,r){if(!(t in Zf))throw new Error(`invalid type: ${t}`);return"fromPrimitive"in Zf[t]?Zf[t].fromPrimitive?.(e,r):e}function aN(t){return Boolean(t)}function lN(t){return Boolean(t)}function uN(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for FLOAT: ${t}`);return e}function cN(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for DOUBLE: ${t}`);return e}function pN(t){let e=parseInt(t,10);if(e<-128||e>127||isNaN(e))throw new Error(`invalid value for INT8: ${t}`);return e}function dN(t){let e=parseInt(t,10);if(e<0||e>255||isNaN(e))throw new Error(`invalid value for UINT8: ${t}`);return e}function mN(t){let e=parseInt(t,10);if(e<-32768||e>32767||isNaN(e))throw new Error(`invalid value for INT16: ${t}`);return e}function bN(t){let e=parseInt(t,10);if(e<0||e>65535||isNaN(e))throw new Error(`invalid value for UINT16: ${t}`);return e}function sT(t){let e=parseInt(t,10);if(e<-2147483648||e>2147483647||isNaN(e))throw new Error(`invalid value for INT32: ${t}`);return e}function hN(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(n<-2147483648||n>2147483647||isNaN(n))throw new Error(`invalid value for INT32: ${t}`);return n}function wN(t){let e=parseInt(t,10);if(e<0||e>281474976710655||isNaN(e))throw new Error(`invalid value for UINT32: ${t}`);return e}function aT(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT64: ${t}`);return e}function gN(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(isNaN(n))throw new Error(`invalid value for INT64: ${t}`);return n}function yN(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for UINT64: ${t}`);return e}function jN(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT96: ${t}`);return e}function lT(t){return Buffer.from(t)}function uT(t){return Buffer.from(t)}function _N(t){return Buffer.from(t,"utf8")}function qN(t){return t.toString()}function vN(t){return Buffer.from(JSON.stringify(t))}function TN(t){return JSON.parse(t)}function BN(t){let e=Ah.encodeSync?.(t);return Buffer.from(e)}function kN(t){return xh.parseSync?.(t)}function IN(t){let e=parseInt(t,10);if(e<0||e>18446744073709552e3||isNaN(e))throw new Error(`invalid value for TIME_MILLIS: ${t}`);return e}function SN(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIME_MICROS: ${t}`);return e}function xN(t){if(t instanceof Date)return t.getTime()/cT;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for DATE: ${t}`);return e}}function EN(t){return new Date(t*cT)}function AN(t){if(t instanceof Date)return t.getTime();{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MILLIS: ${t}`);return e}}function ON(t){return new Date(t)}function NN(t){if(t instanceof Date)return t.getTime()*1e3;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MICROS: ${t}`);return e}}function DN(t){return new Date(t/1e3)}function FN(t){if(!t.months||!t.days||!t.milliseconds)throw new Error("value for INTERVAL must be object { months: ..., days: ..., milliseconds: ... }");let e=Buffer.alloc(12);return e.writeUInt32LE(t.months,0),e.writeUInt32LE(t.days,4),e.writeUInt32LE(t.milliseconds,8),e}function PN(t){let e=Buffer.from(t),r=e.readUInt32LE(0),n=e.readUInt32LE(4),i=e.readUInt32LE(8);return{months:r,days:n,milliseconds:i}}function pT(t,e){return Math.round(t*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}function dT(t,e){let r=0;if(t.length<=4)for(let i=0;i<t.length;i++)r+=t[i]<<8*(t.length-i-1);else for(let i=0;i<t.length;i++)r+=t[i]*2**(8*(t.length-1-i));return Math.round(r*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}var Zf,cT,Oh=re(()=>{iT();Zf={BOOLEAN:{primitiveType:"BOOLEAN",toPrimitive:aN,fromPrimitive:lN},INT32:{primitiveType:"INT32",toPrimitive:sT},INT64:{primitiveType:"INT64",toPrimitive:aT},INT96:{primitiveType:"INT96",toPrimitive:jN},FLOAT:{primitiveType:"FLOAT",toPrimitive:uN},DOUBLE:{primitiveType:"DOUBLE",toPrimitive:cN},BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",toPrimitive:lT},FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",toPrimitive:lT},UTF8:{primitiveType:"BYTE_ARRAY",originalType:"UTF8",toPrimitive:_N,fromPrimitive:qN},TIME_MILLIS:{primitiveType:"INT32",originalType:"TIME_MILLIS",toPrimitive:IN},TIME_MICROS:{primitiveType:"INT64",originalType:"TIME_MICROS",toPrimitive:SN},DATE:{primitiveType:"INT32",originalType:"DATE",toPrimitive:xN,fromPrimitive:EN},TIMESTAMP_MILLIS:{primitiveType:"INT64",originalType:"TIMESTAMP_MILLIS",toPrimitive:AN,fromPrimitive:ON},TIMESTAMP_MICROS:{primitiveType:"INT64",originalType:"TIMESTAMP_MICROS",toPrimitive:NN,fromPrimitive:DN},UINT_8:{primitiveType:"INT32",originalType:"UINT_8",toPrimitive:dN},UINT_16:{primitiveType:"INT32",originalType:"UINT_16",toPrimitive:bN},UINT_32:{primitiveType:"INT32",originalType:"UINT_32",toPrimitive:wN},UINT_64:{primitiveType:"INT64",originalType:"UINT_64",toPrimitive:yN},INT_8:{primitiveType:"INT32",originalType:"INT_8",toPrimitive:pN},INT_16:{primitiveType:"INT32",originalType:"INT_16",toPrimitive:mN},INT_32:{primitiveType:"INT32",originalType:"INT_32",toPrimitive:sT},INT_64:{primitiveType:"INT64",originalType:"INT_64",toPrimitive:aT},JSON:{primitiveType:"BYTE_ARRAY",originalType:"JSON",toPrimitive:vN,fromPrimitive:TN},BSON:{primitiveType:"BYTE_ARRAY",originalType:"BSON",toPrimitive:BN,fromPrimitive:kN},INTERVAL:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"INTERVAL",typeLength:12,toPrimitive:FN,fromPrimitive:PN},DECIMAL_INT32:{primitiveType:"INT32",originalType:"DECIMAL_INT32",toPrimitive:hN,fromPrimitive:pT},DECIMAL_INT64:{primitiveType:"INT64",originalType:"DECIMAL_INT64",toPrimitive:gN,fromPrimitive:pT},DECIMAL_BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",originalType:"DECIMAL_BYTE_ARRAY",toPrimitive:uT,fromPrimitive:dT},DECIMAL_FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"DECIMAL_FIXED_LEN_BYTE_ARRAY",toPrimitive:uT,fromPrimitive:dT}};cT=864e5});function Nh(t){let e={};for(let r of t.fieldList)e[r.key]={dlevels:[],rlevels:[],values:[],pageHeaders:[],count:0};return{rowCount:0,columnData:e}}function Sp(t,e,r){let n=Nh(t).columnData;if(Dh(t.fields,e,n,0,0),r.rowCount===0){r.rowCount=1,r.columnData=n;return}r.rowCount+=1;for(let i of t.fieldList)Array.prototype.push.apply(r.columnData[i.key].rlevels,n[i.key].rlevels),Array.prototype.push.apply(r.columnData[i.key].dlevels,n[i.key].dlevels),Array.prototype.push.apply(r.columnData[i.key].values,n[i.key].values),r.columnData[i.key].count+=n[i.key].count}function Dh(t,e,r,n,i){for(let o in t){let f=t[o],s=[];if(e&&f.name in e&&e[f.name]!==void 0&&e[f.name]!==null&&(e[f.name].constructor===Array?s=e[f.name]:s.push(e[f.name])),s.length===0&&Boolean(e)&&f.repetitionType==="REQUIRED")throw new Error(`missing required field: ${f.name}`);if(s.length>1&&f.repetitionType!=="REPEATED")throw new Error(`too many values for field: ${f.name}`);if(s.length===0){f.isNested?Dh(f.fields,null,r,n,i):(r[f.key].count+=1,r[f.key].rlevels.push(n),r[f.key].dlevels.push(i));continue}for(let a=0;a<s.length;a++){let u=a===0?n:f.rLevelMax;f.isNested?Dh(f.fields,s[a],r,u,f.dLevelMax):(r[f.key].count+=1,r[f.key].rlevels.push(u),r[f.key].dlevels.push(f.dLevelMax),r[f.key].values.push(oT(f.originalType||f.primitiveType,s[a])))}}}function xp(t,e){let r=[];for(let n=0;n<e.rowCount;n++)r.push({});for(let n in e.columnData){let i=e.columnData[n];i.count&&RN(t,i,n,r)}return r}function RN(t,e,r,n){let i=t.findField(r),o=t.findFieldBranch(r),f=new Array(i.rLevelMax+1).fill(0),s=0;for(let a=0;a<e.count;a++){let u=e.dlevels[a],c=e.rlevels[a];f[c]++,f.fill(0,c+1);let _=0,p=n[f[_++]-1];for(let j of o){if(j===i||u<j.dLevelMax)break;switch(j.repetitionType){case"REPEATED":j.name in p||(p[j.name]=[]);let S=f[_++];for(;p[j.name].length<=S;)p[j.name].push({});p=p[j.name][S];break;default:p[j.name]=p[j.name]||{},p=p[j.name]}}if(u===i.dLevelMax){let j=fT(i.originalType||i.primitiveType,e.values[s],i);switch(s++,i.repetitionType){case"REPEATED":i.name in p||(p[i.name]=[]);let S=f[_];for(;p[i.name].length<=S;)p[i.name].push(null);p[i.name][S]=j;break;default:p[i.name]=j}}}}var Ep=re(()=>{Oh()});function Fh(t,e){for(let r in t){let n=t[r];n.fields?Fh(n.fields,e):n.compression=e}}function mT(t,e,r,n){let i={};for(let o in t){let f=t[o],s=!f.optional,a=Boolean(f.repeated),u=e,c=r,_="REQUIRED";if(s||(_="OPTIONAL",c++),a&&(_="REPEATED",u++,s&&c++),f.fields){let S=n.concat([o]);i[o]={name:o,path:S,key:S.join(),repetitionType:_,rLevelMax:u,dLevelMax:c,isNested:!0,fieldCount:Object.keys(f.fields).length,fields:mT(f.fields,u,c,S)};continue}let p=Zf[f.type];if(!p)throw new Error(`invalid parquet type: ${f.type}`);if(f.encoding=f.encoding||"PLAIN",!(f.encoding in No))throw new Error(`unsupported parquet encoding: ${f.encoding}`);if(f.compression=f.compression||"UNCOMPRESSED",!(f.compression in Wl))throw new Error(`unsupported compression method: ${f.compression}`);let j=n.concat([o]);i[o]={name:o,primitiveType:p.primitiveType,originalType:p.originalType,path:j,key:j.join(),repetitionType:_,encoding:f.encoding,compression:f.compression,typeLength:f.typeLength||p.typeLength,presision:f.presision,scale:f.scale,rLevelMax:u,dLevelMax:c}}return i}function bT(t){let e=[];for(let r in t)e.push(t[r]),t[r].isNested&&(e=e.concat(bT(t[r].fields)));return e}var Jl,Ph=re(()=>{Fc();Yl();Ep();Oh();Jl=class{constructor(e){this.schema=e,this.fields=mT(e,0,0,[]),this.fieldList=bT(this.fields)}findField(e){typeof e=="string"?e=e.split(","):e=e.slice(0);let r=this.fields;for(;e.length>1;e.shift())r=r[e[0]].fields;return r[e[0]]}findFieldBranch(e){typeof e=="string"&&(e=e.split(","));let r=[],n=this.fields;for(;e.length>0;e.shift())r.push(n[e[0]]),e.length>1&&(n=n[e[0]].fields);return r}shredRecord(e,r){Sp(this,e,r)}materializeRecords(e){return xp(this,e)}compress(e){return Fh(this.schema,e),Fh(this.fields,e),this}buffer(){return Nh(this)}}});var $i,hT=re(()=>{(function(a){a[a.BOOLEAN=0]="BOOLEAN",a[a.INT32=1]="INT32",a[a.INT64=2]="INT64",a[a.INT96=3]="INT96",a[a.FLOAT=4]="FLOAT",a[a.DOUBLE=5]="DOUBLE",a[a.BYTE_ARRAY=6]="BYTE_ARRAY",a[a.FIXED_LEN_BYTE_ARRAY=7]="FIXED_LEN_BYTE_ARRAY"})($i||($i={}))});var $s,wT=re(()=>{(function(D){D[D.UTF8=0]="UTF8",D[D.MAP=1]="MAP",D[D.MAP_KEY_VALUE=2]="MAP_KEY_VALUE",D[D.LIST=3]="LIST",D[D.ENUM=4]="ENUM",D[D.DECIMAL=5]="DECIMAL",D[D.DATE=6]="DATE",D[D.TIME_MILLIS=7]="TIME_MILLIS",D[D.TIME_MICROS=8]="TIME_MICROS",D[D.TIMESTAMP_MILLIS=9]="TIMESTAMP_MILLIS",D[D.TIMESTAMP_MICROS=10]="TIMESTAMP_MICROS",D[D.UINT_8=11]="UINT_8",D[D.UINT_16=12]="UINT_16",D[D.UINT_32=13]="UINT_32",D[D.UINT_64=14]="UINT_64",D[D.INT_8=15]="INT_8",D[D.INT_16=16]="INT_16",D[D.INT_32=17]="INT_32",D[D.INT_64=18]="INT_64",D[D.JSON=19]="JSON",D[D.BSON=20]="BSON",D[D.INTERVAL=21]="INTERVAL"})($s||($s={}))});var ea,gT=re(()=>{(function(n){n[n.REQUIRED=0]="REQUIRED",n[n.OPTIONAL=1]="OPTIONAL",n[n.REPEATED=2]="REPEATED"})(ea||(ea={}))});var Gr,yT=re(()=>{(function(a){a[a.PLAIN=0]="PLAIN",a[a.PLAIN_DICTIONARY=2]="PLAIN_DICTIONARY",a[a.RLE=3]="RLE",a[a.BIT_PACKED=4]="BIT_PACKED",a[a.DELTA_BINARY_PACKED=5]="DELTA_BINARY_PACKED",a[a.DELTA_LENGTH_BYTE_ARRAY=6]="DELTA_LENGTH_BYTE_ARRAY",a[a.DELTA_BYTE_ARRAY=7]="DELTA_BYTE_ARRAY",a[a.RLE_DICTIONARY=8]="RLE_DICTIONARY"})(Gr||(Gr={}))});var ta,jT=re(()=>{(function(a){a[a.UNCOMPRESSED=0]="UNCOMPRESSED",a[a.SNAPPY=1]="SNAPPY",a[a.GZIP=2]="GZIP",a[a.LZO=3]="LZO",a[a.BROTLI=4]="BROTLI",a[a.LZ4=5]="LZ4",a[a.ZSTD=6]="ZSTD",a[a.LZ4_RAW=7]="LZ4_RAW"})(ta||(ta={}))});var Xf,_T=re(()=>{(function(i){i[i.DATA_PAGE=0]="DATA_PAGE",i[i.INDEX_PAGE=1]="INDEX_PAGE",i[i.DICTIONARY_PAGE=2]="DICTIONARY_PAGE",i[i.DATA_PAGE_V2=3]="DATA_PAGE_V2"})(Xf||(Xf={}))});var qT,vT=re(()=>{(function(n){n[n.UNORDERED=0]="UNORDERED",n[n.ASCENDING=1]="ASCENDING",n[n.DESCENDING=2]="DESCENDING"})(qT||(qT={}))});var Mr=H((R5,BT)=>{var Rh=4294967296,TT=[];for(ra=0;ra<256;ra++)TT[ra]=(ra>15?"":"0")+ra.toString(16);var ra,Zl=BT.exports=function(t,e){t instanceof Buffer?(this.buffer=t,this.offset=e||0):Object.prototype.toString.call(t)=="[object Uint8Array]"?(this.buffer=new Buffer(t),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};Zl.MAX_INT=Math.pow(2,53);Zl.MIN_INT=-Math.pow(2,53);Zl.prototype={constructor:Zl,_2scomp:function(){for(var t=this.buffer,e=this.offset,r=1,n=e+7;n>=e;n--){var i=(t[n]^255)+r;t[n]=i&255,r=i>>8}},setValue:function(t,e){var r=!1;if(arguments.length==1)if(typeof t=="number"){if(r=t<0,t=Math.abs(t),e=t%Rh,t=t/Rh,t>Rh)throw new RangeError(t+" is outside Int64 range");t=t|0}else if(typeof t=="string")t=(t+"").replace(/^0x/,""),e=t.substr(-8),t=t.length>8?t.substr(0,t.length-8):"",t=parseInt(t,16),e=parseInt(e,16);else throw new Error(t+" must be a Number or String");for(var n=this.buffer,i=this.offset,o=7;o>=0;o--)n[i+o]=e&255,e=o==4?t:e>>>8;r&&this._2scomp()},toNumber:function(t){for(var e=this.buffer,r=this.offset,n=e[r]&128,i=0,o=1,f=7,s=1;f>=0;f--,s*=256){var a=e[r+f];n&&(a=(a^255)+o,o=a>>8,a=a&255),i+=a*s}return!t&&i>=Zl.MAX_INT?n?-1/0:1/0:n?-i:i},valueOf:function(){return this.toNumber(!1)},toString:function(t){return this.valueOf().toString(t||10)},toOctetString:function(t){for(var e=new Array(8),r=this.buffer,n=this.offset,i=0;i<8;i++)e[i]=TT[r[n+i]];return e.join(t||"")},toBuffer:function(t){if(t&&this.offset===0)return this.buffer;var e=new Buffer(8);return this.buffer.copy(e,0,this.offset,this.offset+8),e},copy:function(t,e){this.buffer.copy(t,e||0,this.offset,this.offset+8)},compare:function(t){if((this.buffer[this.offset]&128)!=(t.buffer[t.offset]&128))return t.buffer[t.offset]-this.buffer[this.offset];for(var e=0;e<8;e++)if(this.buffer[this.offset+e]!==t.buffer[t.offset+e])return this.buffer[this.offset+e]-t.buffer[t.offset+e];return 0},equals:function(t){return this.compare(t)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var IT=H((z5,kT)=>{kT.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var ST=H((H5,zh)=>{typeof Object.create=="function"?zh.exports=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:zh.exports=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}});var eo=H(wt=>{var xT=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(e,r[i]);return n},zN=/%[sdj%]/g;wt.format=function(t){if(!Dp(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(Vo(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(zN,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return s}}),f=n[r];r<i;f=n[++r])Np(f)||!na(f)?o+=" "+f:o+=" "+Vo(f);return o};wt.deprecate=function(t,e){if(typeof process!="undefined"&&process.noDeprecation===!0)return t;if(typeof process=="undefined")return function(){return wt.deprecate(t,e).apply(this,arguments)};var r=!1;function n(){if(!r){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n};var Ap={},Hh;wt.debuglog=function(t){if(Wo(Hh)&&(Hh=process.env.NODE_DEBUG||""),t=t.toUpperCase(),!Ap[t])if(new RegExp("\\b"+t+"\\b","i").test(Hh)){var e=process.pid;Ap[t]=function(){var r=wt.format.apply(wt,arguments);console.error("%s %d: %s",t,e,r)}}else Ap[t]=function(){};return Ap[t]};function Vo(t,e){var r={seen:[],stylize:MN};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Lh(e)?r.showHidden=e:e&&wt._extend(r,e),Wo(r.showHidden)&&(r.showHidden=!1),Wo(r.depth)&&(r.depth=2),Wo(r.colors)&&(r.colors=!1),Wo(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=HN),Op(r,t,r.depth)}wt.inspect=Vo;Vo.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]};Vo.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function HN(t,e){var r=Vo.styles[e];return r?"["+Vo.colors[r][0]+"m"+t+"["+Vo.colors[r][1]+"m":t}function MN(t,e){return t}function UN(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Op(t,e,r){if(t.customInspect&&e&&Rp(e.inspect)&&e.inspect!==wt.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Dp(n)||(n=Op(t,n,r)),n}var i=LN(t,e);if(i)return i;var o=Object.keys(e),f=UN(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Pp(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Mh(e);if(o.length===0){if(Rp(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Fp(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ch(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Pp(e))return Mh(e)}var a="",u=!1,c=["{","}"];if(ET(e)&&(u=!0,c=["[","]"]),Rp(e)){var _=e.name?": "+e.name:"";a=" [Function"+_+"]"}if(Fp(e)&&(a=" "+RegExp.prototype.toString.call(e)),Ch(e)&&(a=" "+Date.prototype.toUTCString.call(e)),Pp(e)&&(a=" "+Mh(e)),o.length===0&&(!u||e.length==0))return c[0]+a+c[1];if(r<0)return Fp(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var p;return u?p=CN(t,e,r,f,o):p=o.map(function(j){return Uh(t,e,r,f,j,u)}),t.seen.pop(),VN(p,a,c)}function LN(t,e){if(Wo(e))return t.stylize("undefined","undefined");if(Dp(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(AT(e))return t.stylize(""+e,"number");if(Lh(e))return t.stylize(""+e,"boolean");if(Np(e))return t.stylize("null","null")}function Mh(t){return"["+Error.prototype.toString.call(t)+"]"}function CN(t,e,r,n,i){for(var o=[],f=0,s=e.length;f<s;++f)OT(e,String(f))?o.push(Uh(t,e,r,n,String(f),!0)):o.push("");return i.forEach(function(a){a.match(/^\d+$/)||o.push(Uh(t,e,r,n,a,!0))}),o}function Uh(t,e,r,n,i,o){var f,s,a;if(a=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},a.get?a.set?s=t.stylize("[Getter/Setter]","special"):s=t.stylize("[Getter]","special"):a.set&&(s=t.stylize("[Setter]","special")),OT(n,i)||(f="["+i+"]"),s||(t.seen.indexOf(a.value)<0?(Np(r)?s=Op(t,a.value,null):s=Op(t,a.value,r-1),s.indexOf(`
13
13
  `)>-1&&(o?s=s.split(`
14
14
  `).map(function(u){return" "+u}).join(`
15
15
  `).substr(2):s=`