@fnlb-project/database 1.0.2

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/index.js ADDED
@@ -0,0 +1,928 @@
1
+ // @bun
2
+ var up=Object.create;var{getPrototypeOf:xp,defineProperty:_E,getOwnPropertyNames:gp}=Object;var fp=Object.prototype.hasOwnProperty;var hA=(F,A,D)=>{D=F!=null?up(xp(F)):{};let Z=A||!F||!F.__esModule?_E(D,"default",{value:F,enumerable:!0}):D;for(let J of gp(F))if(!fp.call(Z,J))_E(Z,J,{get:()=>F[J],enumerable:!0});return Z};var E=(F,A)=>()=>(A||F((A={exports:{}}).exports,A),A.exports);var i=import.meta.require;var k$=E((Ni)=>{var yp=(()=>{let F=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get;return(A)=>F.call(A)})();function C7(F){return yp(F)==="Uint8Array"}function L$(F){return typeof F==="object"&&F!=null&&Symbol.toStringTag in F&&(F[Symbol.toStringTag]==="ArrayBuffer"||F[Symbol.toStringTag]==="SharedArrayBuffer")}function Q7(F){return F instanceof RegExp||Object.prototype.toString.call(F)==="[object RegExp]"}function R$(F){return typeof F==="object"&&F!=null&&Symbol.toStringTag in F&&F[Symbol.toStringTag]==="Map"}function K7(F){return F instanceof Date||Object.prototype.toString.call(F)==="[object Date]"}function J6(F,A){return JSON.stringify(F,(D,Z)=>{if(typeof Z==="bigint")return{$numberLong:`${Z}`};else if(R$(Z))return Object.fromEntries(Z);return Z})}function bp(F){if(F!=null&&typeof F==="object"&&"stylize"in F&&typeof F.stylize==="function")return F.stylize}var $9=6,z7=Symbol.for("@@mdb.bson.version"),W5=2147483647,C5=-2147483648,nE=Math.pow(2,63)-1,sE=-Math.pow(2,63),rE=Math.pow(2,53),tE=-Math.pow(2,53),w$=1,oE=2,P$=3,eE=4,I$=5,hp=6,FU=7,AU=8,DU=9,M$=10,dA=11,vp=12,N$=13,ZU=14,JU=15,B5=16,XU=17,j$=18,$U=19,YU=255,GU=127,mp=0,T$=4,BU=Object.freeze({double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:-1,maxKey:127});class h extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(F,A){super(F,A)}static isBSONError(F){return F!=null&&typeof F==="object"&&"bsonError"in F&&F.bsonError===!0&&"name"in F&&"message"in F&&"stack"in F}}class z4 extends h{get name(){return"BSONVersionError"}constructor(){super(`Unsupported BSON version, bson types must be from bson ${$9}.x.x`)}}class H5 extends h{get name(){return"BSONRuntimeError"}constructor(F){super(F)}}class s6 extends h{get name(){return"BSONOffsetError"}constructor(F,A,D){super(`${F}. offset: ${A}`,D);this.offset=A}}var uE,xE;function HU(F,A,D,Z){if(Z){uE??=new TextDecoder("utf8",{fatal:!0});try{return uE.decode(F.subarray(A,D))}catch(J){throw new h("Invalid UTF-8 string in BSON document",{cause:J})}}return xE??=new TextDecoder("utf8",{fatal:!1}),xE.decode(F.subarray(A,D))}function qU(F,A,D){if(F.length===0)return"";let Z=D-A;if(Z===0)return"";if(Z>20)return null;if(Z===1&&F[A]<128)return String.fromCharCode(F[A]);if(Z===2&&F[A]<128&&F[A+1]<128)return String.fromCharCode(F[A])+String.fromCharCode(F[A+1]);if(Z===3&&F[A]<128&&F[A+1]<128&&F[A+2]<128)return String.fromCharCode(F[A])+String.fromCharCode(F[A+1])+String.fromCharCode(F[A+2]);let J=[];for(let X=A;X<D;X++){let $=F[X];if($>127)return null;J.push($)}return String.fromCharCode(...J)}function dp(F,A,D){if(A.length===0)return 0;if(A.length>25)return null;if(F.length-D<A.length)return null;for(let Z=0,J=D;Z<A.length;Z++,J++){let X=A.charCodeAt(Z);if(X>127)return null;F[J]=X}return A.length}function cp(F){return u3.fromNumberArray(Array.from({length:F},()=>Math.floor(Math.random()*256)))}var lp=(()=>{try{return i("node:crypto").randomBytes}catch{return cp}})(),u3={toLocalBufferType(F){if(Buffer.isBuffer(F))return F;if(ArrayBuffer.isView(F))return Buffer.from(F.buffer,F.byteOffset,F.byteLength);let A=F?.[Symbol.toStringTag]??Object.prototype.toString.call(F);if(A==="ArrayBuffer"||A==="SharedArrayBuffer"||A==="[object ArrayBuffer]"||A==="[object SharedArrayBuffer]")return Buffer.from(F);throw new h("Cannot create Buffer from the passed potentialBuffer.")},allocate(F){return Buffer.alloc(F)},allocateUnsafe(F){return Buffer.allocUnsafe(F)},equals(F,A){return u3.toLocalBufferType(F).equals(A)},fromNumberArray(F){return Buffer.from(F)},fromBase64(F){return Buffer.from(F,"base64")},toBase64(F){return u3.toLocalBufferType(F).toString("base64")},fromISO88591(F){return Buffer.from(F,"binary")},toISO88591(F){return u3.toLocalBufferType(F).toString("binary")},fromHex(F){return Buffer.from(F,"hex")},toHex(F){return u3.toLocalBufferType(F).toString("hex")},toUTF8(F,A,D,Z){let J=D-A<=20?qU(F,A,D):null;if(J!=null)return J;let X=u3.toLocalBufferType(F).toString("utf8",A,D);if(Z){for(let $=0;$<X.length;$++)if(X.charCodeAt($)===65533){HU(F,A,D,!0);break}}return X},utf8ByteLength(F){return Buffer.byteLength(F,"utf8")},encodeUTF8Into(F,A,D){let Z=dp(F,A,D);if(Z!=null)return Z;return u3.toLocalBufferType(F).write(A,D,void 0,"utf8")},randomBytes:lp,swap32(F){return u3.toLocalBufferType(F).swap32()}};function pp(){let{navigator:F}=globalThis;return typeof F==="object"&&F.product==="ReactNative"}function ip(F){if(F<0)throw new RangeError(`The argument 'byteLength' is invalid. Received ${F}`);return q5.fromNumberArray(Array.from({length:F},()=>Math.floor(Math.random()*256)))}var ap=(()=>{let{crypto:F}=globalThis;if(F!=null&&typeof F.getRandomValues==="function")return(A)=>{return F.getRandomValues(q5.allocate(A))};else{if(pp()){let{console:A}=globalThis;A?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return ip}})(),gE=/(\d|[a-f])/i,q5={toLocalBufferType(F){let A=F?.[Symbol.toStringTag]??Object.prototype.toString.call(F);if(A==="Uint8Array")return F;if(ArrayBuffer.isView(F))return new Uint8Array(F.buffer.slice(F.byteOffset,F.byteOffset+F.byteLength));if(A==="ArrayBuffer"||A==="SharedArrayBuffer"||A==="[object ArrayBuffer]"||A==="[object SharedArrayBuffer]")return new Uint8Array(F);throw new h("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(F){if(typeof F!=="number")throw new TypeError(`The "size" argument must be of type number. Received ${String(F)}`);return new Uint8Array(F)},allocateUnsafe(F){return q5.allocate(F)},equals(F,A){if(F.byteLength!==A.byteLength)return!1;for(let D=0;D<F.byteLength;D++)if(F[D]!==A[D])return!1;return!0},fromNumberArray(F){return Uint8Array.from(F)},fromBase64(F){return Uint8Array.from(atob(F),(A)=>A.charCodeAt(0))},toBase64(F){return btoa(q5.toISO88591(F))},fromISO88591(F){return Uint8Array.from(F,(A)=>A.charCodeAt(0)&255)},toISO88591(F){return Array.from(Uint16Array.from(F),(A)=>String.fromCharCode(A)).join("")},fromHex(F){let A=F.length%2===0?F:F.slice(0,F.length-1),D=[];for(let Z=0;Z<A.length;Z+=2){let J=A[Z],X=A[Z+1];if(!gE.test(J))break;if(!gE.test(X))break;let $=Number.parseInt(`${J}${X}`,16);D.push($)}return Uint8Array.from(D)},toHex(F){return Array.from(F,(A)=>A.toString(16).padStart(2,"0")).join("")},toUTF8(F,A,D,Z){let J=D-A<=20?qU(F,A,D):null;if(J!=null)return J;return HU(F,A,D,Z)},utf8ByteLength(F){return new TextEncoder().encode(F).byteLength},encodeUTF8Into(F,A,D){let Z=new TextEncoder().encode(A);return F.set(Z,D),Z.byteLength},randomBytes:ap,swap32(F){if(F.length%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<F.length;A+=4){let D=F[A],Z=F[A+1],J=F[A+2],X=F[A+3];F[A]=X,F[A+1]=J,F[A+2]=Z,F[A+3]=D}return F}},np=typeof Buffer==="function"&&Buffer.prototype?._isBuffer!==!0,f=np?u3:q5;class N2{get[z7](){return $9}[Symbol.for("nodejs.util.inspect.custom")](F,A,D){return this.inspect(F,A,D)}}var E7=new Float64Array(1),_1=new Uint8Array(E7.buffer,0,8);E7[0]=-1;var sX=_1[7]===0,$1={isBigEndian:sX,getNonnegativeInt32LE(F,A){if(F[A+3]>127)throw new RangeError(`Size cannot be negative at offset: ${A}`);return F[A]|F[A+1]<<8|F[A+2]<<16|F[A+3]<<24},getInt32LE(F,A){return F[A]|F[A+1]<<8|F[A+2]<<16|F[A+3]<<24},getUint32LE(F,A){return F[A]+F[A+1]*256+F[A+2]*65536+F[A+3]*16777216},getUint32BE(F,A){return F[A+3]+F[A+2]*256+F[A+1]*65536+F[A]*16777216},getBigInt64LE(F,A){let D=BigInt(F[A+4]+F[A+5]*256+F[A+6]*65536+(F[A+7]<<24)),Z=BigInt(F[A]+F[A+1]*256+F[A+2]*65536+F[A+3]*16777216);return(D<<BigInt(32))+Z},getFloat64LE:sX?(F,A)=>{return _1[7]=F[A],_1[6]=F[A+1],_1[5]=F[A+2],_1[4]=F[A+3],_1[3]=F[A+4],_1[2]=F[A+5],_1[1]=F[A+6],_1[0]=F[A+7],E7[0]}:(F,A)=>{return _1[0]=F[A],_1[1]=F[A+1],_1[2]=F[A+2],_1[3]=F[A+3],_1[4]=F[A+4],_1[5]=F[A+5],_1[6]=F[A+6],_1[7]=F[A+7],E7[0]},setInt32BE(F,A,D){return F[A+3]=D,D>>>=8,F[A+2]=D,D>>>=8,F[A+1]=D,D>>>=8,F[A]=D,4},setInt32LE(F,A,D){return F[A]=D,D>>>=8,F[A+1]=D,D>>>=8,F[A+2]=D,D>>>=8,F[A+3]=D,4},setBigInt64LE(F,A,D){let Z=BigInt(4294967295),J=Number(D&Z);F[A]=J,J>>=8,F[A+1]=J,J>>=8,F[A+2]=J,J>>=8,F[A+3]=J;let X=Number(D>>BigInt(32)&Z);return F[A+4]=X,X>>=8,F[A+5]=X,X>>=8,F[A+6]=X,X>>=8,F[A+7]=X,8},setFloat64LE:sX?(F,A,D)=>{return E7[0]=D,F[A]=_1[7],F[A+1]=_1[6],F[A+2]=_1[5],F[A+3]=_1[4],F[A+4]=_1[3],F[A+5]=_1[2],F[A+6]=_1[1],F[A+7]=_1[0],8}:(F,A,D)=>{return E7[0]=D,F[A]=_1[0],F[A+1]=_1[1],F[A+2]=_1[2],F[A+3]=_1[3],F[A+4]=_1[4],F[A+5]=_1[5],F[A+6]=_1[6],F[A+7]=_1[7],8}};class Z1 extends N2{get _bsontype(){return"Binary"}constructor(F,A){super();if(F!=null&&typeof F==="string"&&!ArrayBuffer.isView(F)&&!L$(F)&&!Array.isArray(F))throw new h("Binary can only be constructed from Uint8Array or number[]");if(this.sub_type=A??Z1.BSON_BINARY_SUBTYPE_DEFAULT,F==null)this.buffer=f.allocate(Z1.BUFFER_SIZE),this.position=0;else this.buffer=Array.isArray(F)?f.fromNumberArray(F):f.toLocalBufferType(F),this.position=this.buffer.byteLength}put(F){if(typeof F==="string"&&F.length!==1)throw new h("only accepts single character String");else if(typeof F!=="number"&&F.length!==1)throw new h("only accepts single character Uint8Array or Array");let A;if(typeof F==="string")A=F.charCodeAt(0);else if(typeof F==="number")A=F;else A=F[0];if(A<0||A>255)throw new h("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=A;else{let D=f.allocate(Z1.BUFFER_SIZE+this.buffer.length);D.set(this.buffer,0),this.buffer=D,this.buffer[this.position++]=A}}write(F,A){if(A=typeof A==="number"?A:this.position,this.buffer.byteLength<A+F.length){let D=f.allocate(this.buffer.byteLength+F.length);D.set(this.buffer,0),this.buffer=D}if(ArrayBuffer.isView(F))this.buffer.set(f.toLocalBufferType(F),A),this.position=A+F.byteLength>this.position?A+F.length:this.position;else if(typeof F==="string")throw new h("input cannot be string")}read(F,A){A=A&&A>0?A:this.position;let D=F+A;return this.buffer.subarray(F,D>this.position?this.position:D)}value(){return this.buffer.length===this.position?this.buffer:this.buffer.subarray(0,this.position)}length(){return this.position}toJSON(){return f.toBase64(this.buffer.subarray(0,this.position))}toString(F){if(F==="hex")return f.toHex(this.buffer.subarray(0,this.position));if(F==="base64")return f.toBase64(this.buffer.subarray(0,this.position));if(F==="utf8"||F==="utf-8")return f.toUTF8(this.buffer,0,this.position,!1);return f.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(F){if(F=F||{},this.sub_type===Z1.SUBTYPE_VECTOR)WU(this);let A=f.toBase64(this.buffer),D=Number(this.sub_type).toString(16);if(F.legacy)return{$binary:A,$type:D.length===1?"0"+D:D};return{$binary:{base64:A,subType:D.length===1?"0"+D:D}}}toUUID(){if(this.sub_type===Z1.SUBTYPE_UUID)return new l0(this.buffer.subarray(0,this.position));throw new h(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${Z1.SUBTYPE_UUID}" is currently supported.`)}static createFromHexString(F,A){return new Z1(f.fromHex(F),A)}static createFromBase64(F,A){return new Z1(f.fromBase64(F),A)}static fromExtendedJSON(F,A){A=A||{};let D,Z;if("$binary"in F){if(A.legacy&&typeof F.$binary==="string"&&"$type"in F)Z=F.$type?parseInt(F.$type,16):0,D=f.fromBase64(F.$binary);else if(typeof F.$binary!=="string")Z=F.$binary.subType?parseInt(F.$binary.subType,16):0,D=f.fromBase64(F.$binary.base64)}else if("$uuid"in F)Z=4,D=l0.bytesFromString(F.$uuid);if(!D)throw new h(`Unexpected Binary Extended JSON format ${JSON.stringify(F)}`);return Z===T$?new l0(D):new Z1(D,Z)}inspect(F,A,D){D??=J6;let Z=f.toBase64(this.buffer.subarray(0,this.position)),J=D(Z,A),X=D(this.sub_type,A);return`Binary.createFromBase64(${J}, ${X})`}toInt8Array(){if(this.sub_type!==Z1.SUBTYPE_VECTOR)throw new h("Binary sub_type is not Vector");if(this.buffer[0]!==Z1.VECTOR_TYPE.Int8)throw new h("Binary datatype field is not Int8");return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==Z1.SUBTYPE_VECTOR)throw new h("Binary sub_type is not Vector");if(this.buffer[0]!==Z1.VECTOR_TYPE.Float32)throw new h("Binary datatype field is not Float32");let F=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));if($1.isBigEndian)f.swap32(F);return new Float32Array(F.buffer)}toPackedBits(){if(this.sub_type!==Z1.SUBTYPE_VECTOR)throw new h("Binary sub_type is not Vector");if(this.buffer[0]!==Z1.VECTOR_TYPE.PackedBit)throw new h("Binary datatype field is not packed bit");return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==Z1.SUBTYPE_VECTOR)throw new h("Binary sub_type is not Vector");if(this.buffer[0]!==Z1.VECTOR_TYPE.PackedBit)throw new h("Binary datatype field is not packed bit");let A=(this.length()-2)*8-this.buffer[1],D=new Int8Array(A);for(let Z=0;Z<D.length;Z++){let J=Z/8|0,X=this.buffer[J+2],$=7-Z%8,G=X>>$&1;D[Z]=G}return D}static fromInt8Array(F){let A=f.allocate(F.byteLength+2);A[0]=Z1.VECTOR_TYPE.Int8,A[1]=0;let D=new Uint8Array(F.buffer,F.byteOffset,F.byteLength);return A.set(D,2),new this(A,this.SUBTYPE_VECTOR)}static fromFloat32Array(F){let A=f.allocate(F.byteLength+2);A[0]=Z1.VECTOR_TYPE.Float32,A[1]=0;let D=new Uint8Array(F.buffer,F.byteOffset,F.byteLength);if(A.set(D,2),$1.isBigEndian)f.swap32(new Uint8Array(A.buffer,2));return new this(A,this.SUBTYPE_VECTOR)}static fromPackedBits(F,A=0){let D=f.allocate(F.byteLength+2);return D[0]=Z1.VECTOR_TYPE.PackedBit,D[1]=A,D.set(F,2),new this(D,this.SUBTYPE_VECTOR)}static fromBits(F){let A=F.length+7>>>3,D=new Uint8Array(A+2);D[0]=Z1.VECTOR_TYPE.PackedBit;let Z=F.length%8;D[1]=Z===0?0:8-Z;for(let J=0;J<F.length;J++){let X=J>>>3,$=F[J];if($!==0&&$!==1)throw new h(`Invalid bit value at ${J}: must be 0 or 1, found ${F[J]}`);if($===0)continue;let G=7-J%8;D[X+2]|=$<<G}return new this(D,Z1.SUBTYPE_VECTOR)}}Z1.BSON_BINARY_SUBTYPE_DEFAULT=0;Z1.BUFFER_SIZE=256;Z1.SUBTYPE_DEFAULT=0;Z1.SUBTYPE_FUNCTION=1;Z1.SUBTYPE_BYTE_ARRAY=2;Z1.SUBTYPE_UUID_OLD=3;Z1.SUBTYPE_UUID=4;Z1.SUBTYPE_MD5=5;Z1.SUBTYPE_ENCRYPTED=6;Z1.SUBTYPE_COLUMN=7;Z1.SUBTYPE_SENSITIVE=8;Z1.SUBTYPE_VECTOR=9;Z1.SUBTYPE_USER_DEFINED=128;Z1.VECTOR_TYPE=Object.freeze({Int8:3,Float32:39,PackedBit:16});function WU(F){if(F.sub_type!==Z1.SUBTYPE_VECTOR)return;let A=F.position,D=F.buffer[0],Z=F.buffer[1];if((D===Z1.VECTOR_TYPE.Float32||D===Z1.VECTOR_TYPE.Int8)&&Z!==0)throw new h("Invalid Vector: padding must be zero for int8 and float32 vectors");if(D===Z1.VECTOR_TYPE.PackedBit&&Z!==0&&A===2)throw new h("Invalid Vector: padding must be zero for packed bit vectors that are empty");if(D===Z1.VECTOR_TYPE.PackedBit&&Z>7)throw new h(`Invalid Vector: padding must be a value between 0 and 7. found: ${Z}`)}var rX=16,sp=/^[0-9A-F]{32}$/i,rp=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class l0 extends Z1{constructor(F){let A;if(F==null)A=l0.generate();else if(F instanceof l0)A=f.toLocalBufferType(new Uint8Array(F.buffer));else if(ArrayBuffer.isView(F)&&F.byteLength===rX)A=f.toLocalBufferType(F);else if(typeof F==="string")A=l0.bytesFromString(F);else throw new h("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");super(A,T$)}get id(){return this.buffer}set id(F){this.buffer=F}toHexString(F=!0){if(F)return[f.toHex(this.buffer.subarray(0,4)),f.toHex(this.buffer.subarray(4,6)),f.toHex(this.buffer.subarray(6,8)),f.toHex(this.buffer.subarray(8,10)),f.toHex(this.buffer.subarray(10,16))].join("-");return f.toHex(this.buffer)}toString(F){if(F==="hex")return f.toHex(this.id);if(F==="base64")return f.toBase64(this.id);return this.toHexString()}toJSON(){return this.toHexString()}equals(F){if(!F)return!1;if(F instanceof l0)return f.equals(F.id,this.id);try{return f.equals(new l0(F).id,this.id)}catch{return!1}}toBinary(){return new Z1(this.id,Z1.SUBTYPE_UUID)}static generate(){let F=f.randomBytes(rX);return F[6]=F[6]&15|64,F[8]=F[8]&63|128,F}static isValid(F){if(!F)return!1;if(typeof F==="string")return l0.isValidUUIDString(F);if(C7(F))return F.byteLength===rX;return F._bsontype==="Binary"&&F.sub_type===this.SUBTYPE_UUID&&F.buffer.byteLength===16}static createFromHexString(F){let A=l0.bytesFromString(F);return new l0(A)}static createFromBase64(F){return new l0(f.fromBase64(F))}static bytesFromString(F){if(!l0.isValidUUIDString(F))throw new h("UUID string representation must be 32 hex digits or canonical hyphenated representation");return f.fromHex(F.replace(/-/g,""))}static isValidUUIDString(F){return sp.test(F)||rp.test(F)}inspect(F,A,D){return D??=J6,`new UUID(${D(this.toHexString(),A)})`}}class g3 extends N2{get _bsontype(){return"Code"}constructor(F,A){super();this.code=F.toString(),this.scope=A??null}toJSON(){if(this.scope!=null)return{code:this.code,scope:this.scope};return{code:this.code}}toExtendedJSON(){if(this.scope)return{$code:this.code,$scope:this.scope};return{$code:this.code}}static fromExtendedJSON(F){return new g3(F.$code,F.$scope)}inspect(F,A,D){D??=J6;let Z=D(this.code,A),J=Z.includes(`
3
+ `);if(this.scope!=null)Z+=`,${J?`
4
+ `:" "}${D(this.scope,A)}`;let X=J&&this.scope===null;return`new Code(${J?`
5
+ `:""}${Z}${X?`
6
+ `:""})`}}function CU(F){return F!=null&&typeof F==="object"&&"$id"in F&&F.$id!=null&&"$ref"in F&&typeof F.$ref==="string"&&(!("$db"in F)||("$db"in F)&&typeof F.$db==="string")}class E3 extends N2{get _bsontype(){return"DBRef"}constructor(F,A,D,Z){super();let J=F.split(".");if(J.length===2)D=J.shift(),F=J.shift();this.collection=F,this.oid=A,this.db=D,this.fields=Z||{}}get namespace(){return this.collection}set namespace(F){this.collection=F}toJSON(){let F=Object.assign({$ref:this.collection,$id:this.oid},this.fields);if(this.db!=null)F.$db=this.db;return F}toExtendedJSON(F){F=F||{};let A={$ref:this.collection,$id:this.oid};if(F.legacy)return A;if(this.db)A.$db=this.db;return A=Object.assign(A,this.fields),A}static fromExtendedJSON(F){let A=Object.assign({},F);return delete A.$ref,delete A.$id,delete A.$db,new E3(F.$ref,F.$id,F.$db,A)}inspect(F,A,D){D??=J6;let Z=[D(this.namespace,A),D(this.oid,A),...this.db?[D(this.db,A)]:[],...Object.keys(this.fields).length>0?[D(this.fields,A)]:[]];return Z[1]=D===J6?`new ObjectId(${Z[1]})`:Z[1],`new DBRef(${Z.join(", ")})`}}function QU(F){if(F==="")return F;let A=0,D=F[A]==="-",Z=F[A]==="+";if(Z||D)A+=1;let J=!1;for(;A<F.length&&F[A]==="0";++A)J=!0;if(!J)return Z?F.slice(1):F;return`${D?"-":""}${F.length===A?"0":F.slice(A)}`}function tp(F,A){A=A??10;let D="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,A);return new RegExp(`[^-+${D}]`,"i").test(F)?!1:F}var R6=void 0;try{R6=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{}var fE=65536,op=16777216,U7=fE*fE,KU=U7*U7,ep=KU/2,yE={},bE={},Fi=20,Ai=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class j extends N2{get _bsontype(){return"Long"}get __isLong__(){return!0}constructor(F=0,A,D){super();let Z=typeof A==="boolean"?A:Boolean(D),J=typeof A==="number"?A:0,X=typeof F==="string"?j.fromString(F,Z):typeof F==="bigint"?j.fromBigInt(F,Z):{low:F|0,high:J|0,unsigned:Z};this.low=X.low,this.high=X.high,this.unsigned=X.unsigned}static fromBits(F,A,D){return new j(F,A,D)}static fromInt(F,A){let D,Z,J;if(A){if(F>>>=0,J=0<=F&&F<256){if(Z=bE[F],Z)return Z}if(D=j.fromBits(F,(F|0)<0?-1:0,!0),J)bE[F]=D;return D}else{if(F|=0,J=-128<=F&&F<128){if(Z=yE[F],Z)return Z}if(D=j.fromBits(F,F<0?-1:0,!1),J)yE[F]=D;return D}}static fromNumber(F,A){if(isNaN(F))return A?j.UZERO:j.ZERO;if(A){if(F<0)return j.UZERO;if(F>=KU)return j.MAX_UNSIGNED_VALUE}else{if(F<=-9223372036854776000)return j.MIN_VALUE;if(F+1>=ep)return j.MAX_VALUE}if(F<0)return j.fromNumber(-F,A).neg();return j.fromBits(F%U7|0,F/U7|0,A)}static fromBigInt(F,A){let D=BigInt(4294967295),Z=BigInt(32);return new j(Number(F&D),Number(F>>Z&D),A)}static _fromString(F,A,D){if(F.length===0)throw new h("empty string");if(D<2||36<D)throw new h("radix");let Z;if((Z=F.indexOf("-"))>0)throw new h("interior hyphen");else if(Z===0)return j._fromString(F.substring(1),A,D).neg();let J=j.fromNumber(Math.pow(D,8)),X=j.ZERO;for(let $=0;$<F.length;$+=8){let G=Math.min(8,F.length-$),Y=parseInt(F.substring($,$+G),D);if(G<8){let B=j.fromNumber(Math.pow(D,G));X=X.mul(B).add(j.fromNumber(Y))}else X=X.mul(J),X=X.add(j.fromNumber(Y))}return X.unsigned=A,X}static fromStringStrict(F,A,D){let Z=!1;if(typeof A==="number")D=A,A=!1;else Z=!!A;if(D??=10,F.trim()!==F)throw new h(`Input: '${F}' contains leading and/or trailing whitespace`);if(!tp(F,D))throw new h(`Input: '${F}' contains invalid characters for radix: ${D}`);let J=QU(F),X=j._fromString(J,Z,D);if(X.toString(D).toLowerCase()!==J.toLowerCase())throw new h(`Input: ${F} is not representable as ${X.unsigned?"an unsigned":"a signed"} 64-bit Long ${D!=null?`with radix: ${D}`:""}`);return X}static fromString(F,A,D){let Z=!1;if(typeof A==="number")D=A,A=!1;else Z=!!A;if(D??=10,F==="NaN"&&D<24)return j.ZERO;else if((F==="Infinity"||F==="+Infinity"||F==="-Infinity")&&D<35)return j.ZERO;return j._fromString(F,Z,D)}static fromBytes(F,A,D){return D?j.fromBytesLE(F,A):j.fromBytesBE(F,A)}static fromBytesLE(F,A){return new j(F[0]|F[1]<<8|F[2]<<16|F[3]<<24,F[4]|F[5]<<8|F[6]<<16|F[7]<<24,A)}static fromBytesBE(F,A){return new j(F[4]<<24|F[5]<<16|F[6]<<8|F[7],F[0]<<24|F[1]<<16|F[2]<<8|F[3],A)}static isLong(F){return F!=null&&typeof F==="object"&&"__isLong__"in F&&F.__isLong__===!0}static fromValue(F,A){if(typeof F==="number")return j.fromNumber(F,A);if(typeof F==="string")return j.fromString(F,A);return j.fromBits(F.low,F.high,typeof A==="boolean"?A:F.unsigned)}add(F){if(!j.isLong(F))F=j.fromValue(F);let A=this.high>>>16,D=this.high&65535,Z=this.low>>>16,J=this.low&65535,X=F.high>>>16,$=F.high&65535,G=F.low>>>16,Y=F.low&65535,B=0,H=0,q=0,W=0;return W+=J+Y,q+=W>>>16,W&=65535,q+=Z+G,H+=q>>>16,q&=65535,H+=D+$,B+=H>>>16,H&=65535,B+=A+X,B&=65535,j.fromBits(q<<16|W,B<<16|H,this.unsigned)}and(F){if(!j.isLong(F))F=j.fromValue(F);return j.fromBits(this.low&F.low,this.high&F.high,this.unsigned)}compare(F){if(!j.isLong(F))F=j.fromValue(F);if(this.eq(F))return 0;let A=this.isNegative(),D=F.isNegative();if(A&&!D)return-1;if(!A&&D)return 1;if(!this.unsigned)return this.sub(F).isNegative()?-1:1;return F.high>>>0>this.high>>>0||F.high===this.high&&F.low>>>0>this.low>>>0?-1:1}comp(F){return this.compare(F)}divide(F){if(!j.isLong(F))F=j.fromValue(F);if(F.isZero())throw new h("division by zero");if(R6){if(!this.unsigned&&this.high===-2147483648&&F.low===-1&&F.high===-1)return this;let J=(this.unsigned?R6.div_u:R6.div_s)(this.low,this.high,F.low,F.high);return j.fromBits(J,R6.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?j.UZERO:j.ZERO;let A,D,Z;if(!this.unsigned){if(this.eq(j.MIN_VALUE))if(F.eq(j.ONE)||F.eq(j.NEG_ONE))return j.MIN_VALUE;else if(F.eq(j.MIN_VALUE))return j.ONE;else if(A=this.shr(1).div(F).shl(1),A.eq(j.ZERO))return F.isNegative()?j.ONE:j.NEG_ONE;else return D=this.sub(F.mul(A)),Z=A.add(D.div(F)),Z;else if(F.eq(j.MIN_VALUE))return this.unsigned?j.UZERO:j.ZERO;if(this.isNegative()){if(F.isNegative())return this.neg().div(F.neg());return this.neg().div(F).neg()}else if(F.isNegative())return this.div(F.neg()).neg();Z=j.ZERO}else{if(!F.unsigned)F=F.toUnsigned();if(F.gt(this))return j.UZERO;if(F.gt(this.shru(1)))return j.UONE;Z=j.UZERO}D=this;while(D.gte(F)){A=Math.max(1,Math.floor(D.toNumber()/F.toNumber()));let J=Math.ceil(Math.log(A)/Math.LN2),X=J<=48?1:Math.pow(2,J-48),$=j.fromNumber(A),G=$.mul(F);while(G.isNegative()||G.gt(D))A-=X,$=j.fromNumber(A,this.unsigned),G=$.mul(F);if($.isZero())$=j.ONE;Z=Z.add($),D=D.sub(G)}return Z}div(F){return this.divide(F)}equals(F){if(!j.isLong(F))F=j.fromValue(F);if(this.unsigned!==F.unsigned&&this.high>>>31===1&&F.high>>>31===1)return!1;return this.high===F.high&&this.low===F.low}eq(F){return this.equals(F)}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(j.MIN_VALUE)?64:this.neg().getNumBitsAbs();let F=this.high!==0?this.high:this.low,A;for(A=31;A>0;A--)if((F&1<<A)!==0)break;return this.high!==0?A+33:A+1}greaterThan(F){return this.comp(F)>0}gt(F){return this.greaterThan(F)}greaterThanOrEqual(F){return this.comp(F)>=0}gte(F){return this.greaterThanOrEqual(F)}ge(F){return this.greaterThanOrEqual(F)}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(F){return this.comp(F)<0}lt(F){return this.lessThan(F)}lessThanOrEqual(F){return this.comp(F)<=0}lte(F){return this.lessThanOrEqual(F)}modulo(F){if(!j.isLong(F))F=j.fromValue(F);if(R6){let A=(this.unsigned?R6.rem_u:R6.rem_s)(this.low,this.high,F.low,F.high);return j.fromBits(A,R6.get_high(),this.unsigned)}return this.sub(this.div(F).mul(F))}mod(F){return this.modulo(F)}rem(F){return this.modulo(F)}multiply(F){if(this.isZero())return j.ZERO;if(!j.isLong(F))F=j.fromValue(F);if(R6){let C=R6.mul(this.low,this.high,F.low,F.high);return j.fromBits(C,R6.get_high(),this.unsigned)}if(F.isZero())return j.ZERO;if(this.eq(j.MIN_VALUE))return F.isOdd()?j.MIN_VALUE:j.ZERO;if(F.eq(j.MIN_VALUE))return this.isOdd()?j.MIN_VALUE:j.ZERO;if(this.isNegative())if(F.isNegative())return this.neg().mul(F.neg());else return this.neg().mul(F).neg();else if(F.isNegative())return this.mul(F.neg()).neg();if(this.lt(j.TWO_PWR_24)&&F.lt(j.TWO_PWR_24))return j.fromNumber(this.toNumber()*F.toNumber(),this.unsigned);let A=this.high>>>16,D=this.high&65535,Z=this.low>>>16,J=this.low&65535,X=F.high>>>16,$=F.high&65535,G=F.low>>>16,Y=F.low&65535,B=0,H=0,q=0,W=0;return W+=J*Y,q+=W>>>16,W&=65535,q+=Z*Y,H+=q>>>16,q&=65535,q+=J*G,H+=q>>>16,q&=65535,H+=D*Y,B+=H>>>16,H&=65535,H+=Z*G,B+=H>>>16,H&=65535,H+=J*$,B+=H>>>16,H&=65535,B+=A*Y+D*G+Z*$+J*X,B&=65535,j.fromBits(q<<16|W,B<<16|H,this.unsigned)}mul(F){return this.multiply(F)}negate(){if(!this.unsigned&&this.eq(j.MIN_VALUE))return j.MIN_VALUE;return this.not().add(j.ONE)}neg(){return this.negate()}not(){return j.fromBits(~this.low,~this.high,this.unsigned)}notEquals(F){return!this.equals(F)}neq(F){return this.notEquals(F)}ne(F){return this.notEquals(F)}or(F){if(!j.isLong(F))F=j.fromValue(F);return j.fromBits(this.low|F.low,this.high|F.high,this.unsigned)}shiftLeft(F){if(j.isLong(F))F=F.toInt();if((F&=63)===0)return this;else if(F<32)return j.fromBits(this.low<<F,this.high<<F|this.low>>>32-F,this.unsigned);else return j.fromBits(0,this.low<<F-32,this.unsigned)}shl(F){return this.shiftLeft(F)}shiftRight(F){if(j.isLong(F))F=F.toInt();if((F&=63)===0)return this;else if(F<32)return j.fromBits(this.low>>>F|this.high<<32-F,this.high>>F,this.unsigned);else return j.fromBits(this.high>>F-32,this.high>=0?0:-1,this.unsigned)}shr(F){return this.shiftRight(F)}shiftRightUnsigned(F){if(j.isLong(F))F=F.toInt();if(F&=63,F===0)return this;else{let A=this.high;if(F<32){let D=this.low;return j.fromBits(D>>>F|A<<32-F,A>>>F,this.unsigned)}else if(F===32)return j.fromBits(A,0,this.unsigned);else return j.fromBits(A>>>F-32,0,this.unsigned)}}shr_u(F){return this.shiftRightUnsigned(F)}shru(F){return this.shiftRightUnsigned(F)}subtract(F){if(!j.isLong(F))F=j.fromValue(F);return this.add(F.neg())}sub(F){return this.subtract(F)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){if(this.unsigned)return(this.high>>>0)*U7+(this.low>>>0);return this.high*U7+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(F){return F?this.toBytesLE():this.toBytesBE()}toBytesLE(){let F=this.high,A=this.low;return[A&255,A>>>8&255,A>>>16&255,A>>>24,F&255,F>>>8&255,F>>>16&255,F>>>24]}toBytesBE(){let F=this.high,A=this.low;return[F>>>24,F>>>16&255,F>>>8&255,F&255,A>>>24,A>>>16&255,A>>>8&255,A&255]}toSigned(){if(!this.unsigned)return this;return j.fromBits(this.low,this.high,!1)}toString(F){if(F=F||10,F<2||36<F)throw new h("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(j.MIN_VALUE)){let J=j.fromNumber(F),X=this.div(J),$=X.mul(J).sub(this);return X.toString(F)+$.toInt().toString(F)}else return"-"+this.neg().toString(F);let A=j.fromNumber(Math.pow(F,6),this.unsigned),D=this,Z="";while(!0){let J=D.div(A),$=(D.sub(J.mul(A)).toInt()>>>0).toString(F);if(D=J,D.isZero())return $+Z;else{while($.length<6)$="0"+$;Z=""+$+Z}}}toUnsigned(){if(this.unsigned)return this;return j.fromBits(this.low,this.high,!0)}xor(F){if(!j.isLong(F))F=j.fromValue(F);return j.fromBits(this.low^F.low,this.high^F.high,this.unsigned)}eqz(){return this.isZero()}le(F){return this.lessThanOrEqual(F)}toExtendedJSON(F){if(F&&F.relaxed)return this.toNumber();return{$numberLong:this.toString()}}static fromExtendedJSON(F,A){let{useBigInt64:D=!1,relaxed:Z=!0}={...A};if(F.$numberLong.length>Fi)throw new h("$numberLong string is too long");if(!Ai.test(F.$numberLong))throw new h(`$numberLong string "${F.$numberLong}" is in an invalid format`);if(D){let X=BigInt(F.$numberLong);return BigInt.asIntN(64,X)}let J=j.fromString(F.$numberLong);if(Z)return J.toNumber();return J}inspect(F,A,D){D??=J6;let Z=D(this.toString(),A),J=this.unsigned?`, ${D(this.unsigned,A)}`:"";return`new Long(${Z}${J})`}}j.TWO_PWR_24=j.fromInt(op);j.MAX_UNSIGNED_VALUE=j.fromBits(-1,-1,!0);j.ZERO=j.fromInt(0);j.UZERO=j.fromInt(0,!0);j.ONE=j.fromInt(1);j.UONE=j.fromInt(1,!0);j.NEG_ONE=j.fromInt(-1);j.MAX_VALUE=j.fromBits(-1,2147483647,!1);j.MIN_VALUE=j.fromBits(0,-2147483648,!1);var Di=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Zi=/^(\+|-)?(Infinity|inf)$/i,Ji=/^(\+|-)?NaN$/i,q7=6111,Y5=-6176,hE=6176,vE=34,tX=f.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),mE=f.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),dE=f.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),Xi=/^([-+])?(\d+)?$/,$i=31,cE=16383,Yi=30,Gi=31;function lE(F){return!isNaN(parseInt(F,10))}function Bi(F){let A=j.fromNumber(1e9),D=j.fromNumber(0);if(!F.parts[0]&&!F.parts[1]&&!F.parts[2]&&!F.parts[3])return{quotient:F,rem:D};for(let Z=0;Z<=3;Z++)D=D.shiftLeft(32),D=D.add(new j(F.parts[Z],0)),F.parts[Z]=D.div(A).low,D=D.modulo(A);return{quotient:F,rem:D}}function Hi(F,A){if(!F&&!A)return{high:j.fromNumber(0),low:j.fromNumber(0)};let D=F.shiftRightUnsigned(32),Z=new j(F.getLowBits(),0),J=A.shiftRightUnsigned(32),X=new j(A.getLowBits(),0),$=D.multiply(J),G=D.multiply(X),Y=Z.multiply(J),B=Z.multiply(X);return $=$.add(G.shiftRightUnsigned(32)),G=new j(G.getLowBits(),0).add(Y).add(B.shiftRightUnsigned(32)),$=$.add(G.shiftRightUnsigned(32)),B=G.shiftLeft(32).add(new j(B.getLowBits(),0)),{high:$,low:B}}function qi(F,A){let D=F.high>>>0,Z=A.high>>>0;if(D<Z)return!0;else if(D===Z){let J=F.low>>>0,X=A.low>>>0;if(J<X)return!0}return!1}function n6(F,A){throw new h(`"${F}" is not a valid Decimal128 string - ${A}`)}class $2 extends N2{get _bsontype(){return"Decimal128"}constructor(F){super();if(typeof F==="string")this.bytes=$2.fromString(F).bytes;else if(F instanceof Uint8Array||C7(F)){if(F.byteLength!==16)throw new h("Decimal128 must take a Buffer of 16 bytes");this.bytes=F}else throw new h("Decimal128 must take a Buffer or string")}static fromString(F){return $2._fromString(F,{allowRounding:!1})}static fromStringWithRounding(F){return $2._fromString(F,{allowRounding:!0})}static _fromString(F,A){let D=!1,Z=!1,J=!1,X=!1,$=0,G=0,Y=0,B=0,H=0,q=[0],W=0,C=0,Q=0,K=0,U=new j(0,0),z=new j(0,0),L=0,V=0;if(F.length>=7000)throw new h(""+F+" not a valid Decimal128 string");let P=F.match(Di),I=F.match(Zi),M=F.match(Ji);if(!P&&!I&&!M||F.length===0)throw new h(""+F+" not a valid Decimal128 string");if(P){let R=P[2],S=P[4],u=P[5],c=P[6];if(S&&c===void 0)n6(F,"missing exponent power");if(S&&R===void 0)n6(F,"missing exponent base");if(S===void 0&&(u||c))n6(F,"missing e before exponent")}if(F[V]==="+"||F[V]==="-")Z=!0,D=F[V++]==="-";if(!lE(F[V])&&F[V]!=="."){if(F[V]==="i"||F[V]==="I")return new $2(D?mE:dE);else if(F[V]==="N")return new $2(tX)}while(lE(F[V])||F[V]==="."){if(F[V]==="."){if(J)n6(F,"contains multiple periods");J=!0,V=V+1;continue}if(W<vE){if(F[V]!=="0"||X){if(!X)H=G;X=!0,q[C++]=parseInt(F[V],10),W=W+1}}if(X)Y=Y+1;if(J)B=B+1;G=G+1,V=V+1}if(J&&!G)throw new h(""+F+" not a valid Decimal128 string");if(F[V]==="e"||F[V]==="E"){let R=F.substr(++V).match(Xi);if(!R||!R[2])return new $2(tX);K=parseInt(R[0],10),V=V+R[0].length}if(F[V])return new $2(tX);if(!W)q[0]=0,Y=1,W=1,$=0;else if(Q=W-1,$=Y,$!==1)while(F[H+$-1+Number(Z)+Number(J)]==="0")$=$-1;if(K<=B&&B>K+16384)K=Y5;else K=K-B;while(K>q7){if(Q=Q+1,Q>=vE){if($===0){K=q7;break}n6(F,"overflow")}K=K-1}if(A.allowRounding){while(K<Y5||W<Y){if(Q===0&&$<W){K=Y5,$=0;break}if(W<Y)Y=Y-1;else Q=Q-1;if(K<q7)K=K+1;else{if(q.join("").match(/^0+$/)){K=q7;break}n6(F,"overflow")}}if(Q+1<$){let R=G;if(J)H=H+1,R=R+1;if(Z)H=H+1,R=R+1;let S=parseInt(F[H+Q+1],10),u=0;if(S>=5){if(u=1,S===5){u=q[Q]%2===1?1:0;for(let c=H+Q+2;c<R;c++)if(parseInt(F[c],10)){u=1;break}}}if(u){let c=Q;for(;c>=0;c--)if(++q[c]>9){if(q[c]=0,c===0)if(K<q7)K=K+1,q[c]=1;else return new $2(D?mE:dE)}else break}}}else{while(K<Y5||W<Y){if(Q===0){if($===0){K=Y5;break}n6(F,"exponent underflow")}if(W<Y){if(F[Y-1+Number(Z)+Number(J)]!=="0"&&$!==0)n6(F,"inexact rounding");Y=Y-1}else{if(q[Q]!==0)n6(F,"inexact rounding");Q=Q-1}if(K<q7)K=K+1;else n6(F,"overflow")}if(Q+1<$){if(J)H=H+1;if(Z)H=H+1;if(parseInt(F[H+Q+1],10)!==0)n6(F,"inexact rounding")}}if(U=j.fromNumber(0),z=j.fromNumber(0),$===0)U=j.fromNumber(0),z=j.fromNumber(0);else if(Q<17){let R=0;z=j.fromNumber(q[R++]),U=new j(0,0);for(;R<=Q;R++)z=z.multiply(j.fromNumber(10)),z=z.add(j.fromNumber(q[R]))}else{let R=0;U=j.fromNumber(q[R++]);for(;R<=Q-17;R++)U=U.multiply(j.fromNumber(10)),U=U.add(j.fromNumber(q[R]));z=j.fromNumber(q[R++]);for(;R<=Q;R++)z=z.multiply(j.fromNumber(10)),z=z.add(j.fromNumber(q[R]))}let x=Hi(U,j.fromString("100000000000000000"));if(x.low=x.low.add(z),qi(x.low,z))x.high=x.high.add(j.fromNumber(1));L=K+hE;let _={low:j.fromNumber(0),high:j.fromNumber(0)};if(x.high.shiftRightUnsigned(49).and(j.fromNumber(1)).equals(j.fromNumber(1)))_.high=_.high.or(j.fromNumber(3).shiftLeft(61)),_.high=_.high.or(j.fromNumber(L).and(j.fromNumber(16383).shiftLeft(47))),_.high=_.high.or(x.high.and(j.fromNumber(140737488355327)));else _.high=_.high.or(j.fromNumber(L&16383).shiftLeft(49)),_.high=_.high.or(x.high.and(j.fromNumber(562949953421311)));if(_.low=x.low,D)_.high=_.high.or(j.fromString("9223372036854775808"));let O=f.allocateUnsafe(16);return V=0,O[V++]=_.low.low&255,O[V++]=_.low.low>>8&255,O[V++]=_.low.low>>16&255,O[V++]=_.low.low>>24&255,O[V++]=_.low.high&255,O[V++]=_.low.high>>8&255,O[V++]=_.low.high>>16&255,O[V++]=_.low.high>>24&255,O[V++]=_.high.low&255,O[V++]=_.high.low>>8&255,O[V++]=_.high.low>>16&255,O[V++]=_.high.low>>24&255,O[V++]=_.high.high&255,O[V++]=_.high.high>>8&255,O[V++]=_.high.high>>16&255,O[V++]=_.high.high>>24&255,new $2(O)}toString(){let F,A=0,D=new Array(36);for(let V=0;V<D.length;V++)D[V]=0;let Z=0,J=!1,X,$={parts:[0,0,0,0]},G,Y,B=[];Z=0;let H=this.bytes,q=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24,W=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24,C=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24,Q=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24;if(Z=0,{low:new j(q,W),high:new j(C,Q)}.high.lessThan(j.ZERO))B.push("-");let U=Q>>26&$i;if(U>>3===3)if(U===Yi)return B.join("")+"Infinity";else if(U===Gi)return"NaN";else F=Q>>15&cE,X=8+(Q>>14&1);else X=Q>>14&7,F=Q>>17&cE;let z=F-hE;if($.parts[0]=(Q&16383)+((X&15)<<14),$.parts[1]=C,$.parts[2]=W,$.parts[3]=q,$.parts[0]===0&&$.parts[1]===0&&$.parts[2]===0&&$.parts[3]===0)J=!0;else for(Y=3;Y>=0;Y--){let V=0,P=Bi($);if($=P.quotient,V=P.rem.low,!V)continue;for(G=8;G>=0;G--)D[Y*9+G]=V%10,V=Math.floor(V/10)}if(J)A=1,D[Z]=0;else{A=36;while(!D[Z])A=A-1,Z=Z+1}let L=A-1+z;if(L>=34||L<=-7||z>0){if(A>34){if(B.push("0"),z>0)B.push(`E+${z}`);else if(z<0)B.push(`E${z}`);return B.join("")}if(B.push(`${D[Z++]}`),A=A-1,A)B.push(".");for(let V=0;V<A;V++)B.push(`${D[Z++]}`);if(B.push("E"),L>0)B.push(`+${L}`);else B.push(`${L}`)}else if(z>=0)for(let V=0;V<A;V++)B.push(`${D[Z++]}`);else{let V=A+z;if(V>0)for(let P=0;P<V;P++)B.push(`${D[Z++]}`);else B.push("0");B.push(".");while(V++<0)B.push("0");for(let P=0;P<A-Math.max(V-1,0);P++)B.push(`${D[Z++]}`)}return B.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(F){return $2.fromString(F.$numberDecimal)}inspect(F,A,D){return D??=J6,`new Decimal128(${D(this.toString(),A)})`}}class w6 extends N2{get _bsontype(){return"Double"}constructor(F){super();if(F instanceof Number)F=F.valueOf();this.value=+F}static fromString(F){let A=Number(F);if(F==="NaN")return new w6(NaN);if(F==="Infinity")return new w6(1/0);if(F==="-Infinity")return new w6(-1/0);if(!Number.isFinite(A))throw new h(`Input: ${F} is not representable as a Double`);if(F.trim()!==F)throw new h(`Input: '${F}' contains whitespace`);if(F==="")throw new h("Input is an empty string");if(/[^-0-9.+eE]/.test(F))throw new h(`Input: '${F}' is not in decimal or exponential notation`);return new w6(A)}valueOf(){return this.value}toJSON(){return this.value}toString(F){return this.value.toString(F)}toExtendedJSON(F){if(F&&(F.legacy||F.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:"-0.0"};return{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(F,A){let D=parseFloat(F.$numberDouble);return A&&A.relaxed?D:new w6(D)}inspect(F,A,D){return D??=J6,`new Double(${D(this.value,A)})`}}class f3 extends N2{get _bsontype(){return"Int32"}constructor(F){super();if(F instanceof Number)F=F.valueOf();this.value=+F|0}static fromString(F){let A=QU(F),D=Number(F);if(W5<D)throw new h(`Input: '${F}' is larger than the maximum value for Int32`);else if(C5>D)throw new h(`Input: '${F}' is smaller than the minimum value for Int32`);else if(!Number.isSafeInteger(D))throw new h(`Input: '${F}' is not a safe integer`);else if(D.toString()!==A)throw new h(`Input: '${F}' is not a valid Int32 string`);return new f3(D)}valueOf(){return this.value}toString(F){return this.value.toString(F)}toJSON(){return this.value}toExtendedJSON(F){if(F&&(F.relaxed||F.legacy))return this.value;return{$numberInt:this.value.toString()}}static fromExtendedJSON(F,A){return A&&A.relaxed?parseInt(F.$numberInt,10):new f3(F.$numberInt)}inspect(F,A,D){return D??=J6,`new Int32(${D(this.value,A)})`}}class Y9 extends N2{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new Y9}inspect(){return"new MaxKey()"}}class G9 extends N2{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new G9}inspect(){return"new MinKey()"}}var X9=null,G5=new WeakMap;class o1 extends N2{get _bsontype(){return"ObjectId"}constructor(F){super();let A;if(typeof F==="object"&&F&&"id"in F){if(typeof F.id!=="string"&&!ArrayBuffer.isView(F.id))throw new h("Argument passed in must have an id that is of type string or Buffer");if("toHexString"in F&&typeof F.toHexString==="function")A=f.fromHex(F.toHexString());else A=F.id}else A=F;if(A==null||typeof A==="number")this.buffer=o1.generate(typeof A==="number"?A:void 0);else if(ArrayBuffer.isView(A)&&A.byteLength===12)this.buffer=f.toLocalBufferType(A);else if(typeof A==="string")if(o1.validateHexString(A)){if(this.buffer=f.fromHex(A),o1.cacheHexString)G5.set(this,A)}else throw new h("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");else throw new h("Argument passed in does not match the accepted types")}get id(){return this.buffer}set id(F){if(this.buffer=F,o1.cacheHexString)G5.set(this,f.toHex(F))}static validateHexString(F){if(F?.length!==24)return!1;for(let A=0;A<24;A++){let D=F.charCodeAt(A);if(D>=48&&D<=57||D>=97&&D<=102||D>=65&&D<=70)continue;return!1}return!0}toHexString(){if(o1.cacheHexString){let A=G5.get(this);if(A)return A}let F=f.toHex(this.id);if(o1.cacheHexString)G5.set(this,F);return F}static getInc(){return o1.index=(o1.index+1)%16777215}static generate(F){if(typeof F!=="number")F=Math.floor(Date.now()/1000);let A=o1.getInc(),D=f.allocateUnsafe(12);if($1.setInt32BE(D,0,F),X9===null)X9=f.randomBytes(5);return D[4]=X9[0],D[5]=X9[1],D[6]=X9[2],D[7]=X9[3],D[8]=X9[4],D[11]=A&255,D[10]=A>>8&255,D[9]=A>>16&255,D}toString(F){if(F==="base64")return f.toBase64(this.id);if(F==="hex")return this.toHexString();return this.toHexString()}toJSON(){return this.toHexString()}static is(F){return F!=null&&typeof F==="object"&&"_bsontype"in F&&F._bsontype==="ObjectId"}equals(F){if(F===void 0||F===null)return!1;if(o1.is(F))return this.buffer[11]===F.buffer[11]&&f.equals(this.buffer,F.buffer);if(typeof F==="string")return F.toLowerCase()===this.toHexString();if(typeof F==="object"&&typeof F.toHexString==="function"){let A=F.toHexString(),D=this.toHexString();return typeof A==="string"&&A.toLowerCase()===D}return!1}getTimestamp(){let F=new Date,A=$1.getUint32BE(this.buffer,0);return F.setTime(Math.floor(A)*1000),F}static createPk(){return new o1}serializeInto(F,A){return F[A]=this.buffer[0],F[A+1]=this.buffer[1],F[A+2]=this.buffer[2],F[A+3]=this.buffer[3],F[A+4]=this.buffer[4],F[A+5]=this.buffer[5],F[A+6]=this.buffer[6],F[A+7]=this.buffer[7],F[A+8]=this.buffer[8],F[A+9]=this.buffer[9],F[A+10]=this.buffer[10],F[A+11]=this.buffer[11],12}static createFromTime(F){let A=f.allocate(12);for(let D=11;D>=4;D--)A[D]=0;return $1.setInt32BE(A,0,F),new o1(A)}static createFromHexString(F){if(F?.length!==24)throw new h("hex string must be 24 characters");return new o1(f.fromHex(F))}static createFromBase64(F){if(F?.length!==16)throw new h("base64 string must be 16 characters");return new o1(f.fromBase64(F))}static isValid(F){if(F==null)return!1;if(typeof F==="string")return o1.validateHexString(F);try{return new o1(F),!0}catch{return!1}}toExtendedJSON(){if(this.toHexString)return{$oid:this.toHexString()};return{$oid:this.toString("hex")}}static fromExtendedJSON(F){return new o1(F.$oid)}isCached(){return o1.cacheHexString&&G5.has(this)}inspect(F,A,D){return D??=J6,`new ObjectId(${D(this.toHexString(),A)})`}}o1.index=Math.floor(Math.random()*16777215);function vA(F,A,D){let Z=5;if(Array.isArray(F))for(let J=0;J<F.length;J++)Z+=pE(J.toString(),F[J],A,!0,D);else{if(typeof F?.toBSON==="function")F=F.toBSON();for(let J of Object.keys(F))Z+=pE(J,F[J],A,!1,D)}return Z}function pE(F,A,D=!1,Z=!1,J=!1){if(typeof A?.toBSON==="function")A=A.toBSON();switch(typeof A){case"string":return 1+f.utf8ByteLength(F)+1+4+f.utf8ByteLength(A)+1;case"number":if(Math.floor(A)===A&&A>=tE&&A<=rE)if(A>=C5&&A<=W5)return(F!=null?f.utf8ByteLength(F)+1:0)+5;else return(F!=null?f.utf8ByteLength(F)+1:0)+9;else return(F!=null?f.utf8ByteLength(F)+1:0)+9;case"undefined":if(Z||!J)return(F!=null?f.utf8ByteLength(F)+1:0)+1;return 0;case"boolean":return(F!=null?f.utf8ByteLength(F)+1:0)+2;case"object":if(A!=null&&typeof A._bsontype==="string"&&A[z7]!==$9)throw new z4;else if(A==null||A._bsontype==="MinKey"||A._bsontype==="MaxKey")return(F!=null?f.utf8ByteLength(F)+1:0)+1;else if(A._bsontype==="ObjectId")return(F!=null?f.utf8ByteLength(F)+1:0)+13;else if(A instanceof Date||K7(A))return(F!=null?f.utf8ByteLength(F)+1:0)+9;else if(ArrayBuffer.isView(A)||A instanceof ArrayBuffer||L$(A))return(F!=null?f.utf8ByteLength(F)+1:0)+6+A.byteLength;else if(A._bsontype==="Long"||A._bsontype==="Double"||A._bsontype==="Timestamp")return(F!=null?f.utf8ByteLength(F)+1:0)+9;else if(A._bsontype==="Decimal128")return(F!=null?f.utf8ByteLength(F)+1:0)+17;else if(A._bsontype==="Code")if(A.scope!=null&&Object.keys(A.scope).length>0)return(F!=null?f.utf8ByteLength(F)+1:0)+1+4+4+f.utf8ByteLength(A.code.toString())+1+vA(A.scope,D,J);else return(F!=null?f.utf8ByteLength(F)+1:0)+1+4+f.utf8ByteLength(A.code.toString())+1;else if(A._bsontype==="Binary"){let X=A;if(X.sub_type===Z1.SUBTYPE_BYTE_ARRAY)return(F!=null?f.utf8ByteLength(F)+1:0)+(X.position+1+4+1+4);else return(F!=null?f.utf8ByteLength(F)+1:0)+(X.position+1+4+1)}else if(A._bsontype==="Symbol")return(F!=null?f.utf8ByteLength(F)+1:0)+f.utf8ByteLength(A.value)+4+1+1;else if(A._bsontype==="DBRef"){let X=Object.assign({$ref:A.collection,$id:A.oid},A.fields);if(A.db!=null)X.$db=A.db;return(F!=null?f.utf8ByteLength(F)+1:0)+1+vA(X,D,J)}else if(A instanceof RegExp||Q7(A))return(F!=null?f.utf8ByteLength(F)+1:0)+1+f.utf8ByteLength(A.source)+1+(A.global?1:0)+(A.ignoreCase?1:0)+(A.multiline?1:0)+1;else if(A._bsontype==="BSONRegExp")return(F!=null?f.utf8ByteLength(F)+1:0)+1+f.utf8ByteLength(A.pattern)+1+f.utf8ByteLength(A.options)+1;else return(F!=null?f.utf8ByteLength(F)+1:0)+vA(A,D,J)+1;case"function":if(D)return(F!=null?f.utf8ByteLength(F)+1:0)+1+4+f.utf8ByteLength(A.toString())+1;return 0;case"bigint":return(F!=null?f.utf8ByteLength(F)+1:0)+9;case"symbol":return 0;default:throw new h(`Unrecognized JS type: ${typeof A}`)}}function Wi(F){return F.split("").sort().join("")}class I6 extends N2{get _bsontype(){return"BSONRegExp"}constructor(F,A){super();if(this.pattern=F,this.options=Wi(A??""),this.pattern.indexOf("\x00")!==-1)throw new h(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(this.options.indexOf("\x00")!==-1)throw new h(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let D=0;D<this.options.length;D++)if(!(this.options[D]==="i"||this.options[D]==="m"||this.options[D]==="x"||this.options[D]==="l"||this.options[D]==="s"||this.options[D]==="u"))throw new h(`The regular expression option [${this.options[D]}] is not supported`)}static parseOptions(F){return F?F.split("").sort().join(""):""}toExtendedJSON(F){if(F=F||{},F.legacy)return{$regex:this.pattern,$options:this.options};return{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(F){if("$regex"in F)if(typeof F.$regex!=="string"){if(F.$regex._bsontype==="BSONRegExp")return F}else return new I6(F.$regex,I6.parseOptions(F.$options));if("$regularExpression"in F)return new I6(F.$regularExpression.pattern,I6.parseOptions(F.$regularExpression.options));throw new h(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(F)}`)}inspect(F,A,D){let Z=bp(A)??(($)=>$);D??=J6;let J=Z(D(this.pattern),"regexp"),X=Z(D(this.options),"regexp");return`new BSONRegExp(${J}, ${X})`}}class B9 extends N2{get _bsontype(){return"BSONSymbol"}constructor(F){super();this.value=F}valueOf(){return this.value}toString(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(F){return new B9(F.$symbol)}inspect(F,A,D){return D??=J6,`new BSONSymbol(${D(this.value,A)})`}}var Ci=j;class P6 extends Ci{get _bsontype(){return"Timestamp"}get i(){return this.low>>>0}get t(){return this.high>>>0}constructor(F){if(F==null)super(0,0,!0);else if(typeof F==="bigint")super(F,!0);else if(j.isLong(F))super(F.low,F.high,!0);else if(typeof F==="object"&&"t"in F&&"i"in F){if(typeof F.t!=="number"&&(typeof F.t!=="object"||F.t._bsontype!=="Int32"))throw new h("Timestamp constructed from { t, i } must provide t as a number");if(typeof F.i!=="number"&&(typeof F.i!=="object"||F.i._bsontype!=="Int32"))throw new h("Timestamp constructed from { t, i } must provide i as a number");let A=Number(F.t),D=Number(F.i);if(A<0||Number.isNaN(A))throw new h("Timestamp constructed from { t, i } must provide a positive t");if(D<0||Number.isNaN(D))throw new h("Timestamp constructed from { t, i } must provide a positive i");if(A>4294967295)throw new h("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(D>4294967295)throw new h("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(D,A,!0)}else throw new h("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }")}toJSON(){return{$timestamp:this.toString()}}static fromInt(F){return new P6(j.fromInt(F,!0))}static fromNumber(F){return new P6(j.fromNumber(F,!0))}static fromBits(F,A){return new P6({i:F,t:A})}static fromString(F,A){return new P6(j.fromString(F,!0,A))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(F){let A=j.isLong(F.$timestamp.i)?F.$timestamp.i.getLowBitsUnsigned():F.$timestamp.i,D=j.isLong(F.$timestamp.t)?F.$timestamp.t.getLowBitsUnsigned():F.$timestamp.t;return new P6({t:D,i:A})}inspect(F,A,D){D??=J6;let Z=D(this.t,A),J=D(this.i,A);return`new Timestamp({ t: ${Z}, i: ${J} })`}}P6.MAX_VALUE=j.MAX_UNSIGNED_VALUE;var Qi=j.fromNumber(rE),Ki=j.fromNumber(tE);function EU(F,A,D){A=A==null?{}:A;let Z=A&&A.index?A.index:0,J=$1.getInt32LE(F,Z);if(J<5)throw new h(`bson size must be >= 5, is ${J}`);if(A.allowObjectSmallerThanBufferSize&&F.length<J)throw new h(`buffer length ${F.length} must be >= bson size ${J}`);if(!A.allowObjectSmallerThanBufferSize&&F.length!==J)throw new h(`buffer length ${F.length} must === bson size ${J}`);if(J+Z>F.byteLength)throw new h(`(bson size ${J} + options.index ${Z} must be <= buffer length ${F.byteLength})`);if(F[Z+J-1]!==0)throw new h("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return mA(F,Z,A,D)}var Ei=/^\$ref$|^\$id$|^\$db$/;function mA(F,A,D,Z=!1){let J=D.fieldsAsRaw==null?null:D.fieldsAsRaw,X=D.raw==null?!1:D.raw,$=typeof D.bsonRegExp==="boolean"?D.bsonRegExp:!1,G=D.promoteBuffers??!1,Y=D.promoteLongs??!0,B=D.promoteValues??!0,H=D.useBigInt64??!1;if(H&&!B)throw new h("Must either request bigint or Long for int64 deserialization");if(H&&!Y)throw new h("Must either request bigint or Long for int64 deserialization");let q=D.validation==null?{utf8:!0}:D.validation,W=!0,C,Q,K=q.utf8;if(typeof K==="boolean")C=K;else{W=!1;let I=Object.keys(K).map(function(M){return K[M]});if(I.length===0)throw new h("UTF-8 validation setting cannot be empty");if(typeof I[0]!=="boolean")throw new h("Invalid UTF-8 validation option, must specify boolean values");if(C=I[0],!I.every((M)=>M===C))throw new h("Invalid UTF-8 validation option - keys must be all true or all false")}if(!W){Q=new Set;for(let I of Object.keys(K))Q.add(I)}let U=A;if(F.length<5)throw new h("corrupt bson message < 5 bytes long");let z=$1.getInt32LE(F,A);if(A+=4,z<5||z>F.length)throw new h("corrupt bson message");let L=Z?[]:{},V=0,P=Z?!1:null;while(!0){let I=F[A++];if(I===0)break;let M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.byteLength)throw new h("Bad BSON Document: illegal CString");let x=Z?V++:f.toUTF8(F,A,M,!1),_=!0;if(W||Q?.has(x))_=C;else _=!C;if(P!==!1&&x[0]==="$")P=Ei.test(x);let O;if(A=M+1,I===oE){let R=$1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new h("bad string length in bson");O=f.toUTF8(F,A,A+R-1,_),A=A+R}else if(I===FU){let R=f.allocateUnsafe(12);for(let S=0;S<12;S++)R[S]=F[A+S];O=new o1(R),A=A+12}else if(I===B5&&B===!1)O=new f3($1.getInt32LE(F,A)),A+=4;else if(I===B5)O=$1.getInt32LE(F,A),A+=4;else if(I===w$){if(O=$1.getFloat64LE(F,A),A+=8,B===!1)O=new w6(O)}else if(I===DU){let R=$1.getInt32LE(F,A),S=$1.getInt32LE(F,A+4);A+=8,O=new Date(new j(R,S).toNumber())}else if(I===AU){if(F[A]!==0&&F[A]!==1)throw new h("illegal boolean type value");O=F[A++]===1}else if(I===P$){let R=A,S=$1.getInt32LE(F,A);if(S<=0||S>F.length-A)throw new h("bad embedded document length in bson");if(X)O=F.subarray(A,A+S);else{let u=D;if(!W)u={...D,validation:{utf8:_}};O=mA(F,R,u,!1)}A=A+S}else if(I===eE){let R=A,S=$1.getInt32LE(F,A),u=D,c=A+S;if(J&&J[x])u={...D,raw:!0};if(!W)u={...u,validation:{utf8:_}};if(O=mA(F,R,u,!0),A=A+S,F[A-1]!==0)throw new h("invalid array terminator byte");if(A!==c)throw new h("corrupted array bson")}else if(I===hp)O=void 0;else if(I===M$)O=null;else if(I===j$)if(H)O=$1.getBigInt64LE(F,A),A+=8;else{let R=$1.getInt32LE(F,A),S=$1.getInt32LE(F,A+4);A+=8;let u=new j(R,S);if(Y&&B===!0)O=u.lessThanOrEqual(Qi)&&u.greaterThanOrEqual(Ki)?u.toNumber():u;else O=u}else if(I===$U){let R=f.allocateUnsafe(16);for(let S=0;S<16;S++)R[S]=F[A+S];A=A+16,O=new $2(R)}else if(I===I$){let R=$1.getInt32LE(F,A);A+=4;let S=R,u=F[A++];if(R<0)throw new h("Negative binary type element size found");if(R>F.byteLength)throw new h("Binary type size larger than document size");if(u===Z1.SUBTYPE_BYTE_ARRAY){if(R=$1.getInt32LE(F,A),A+=4,R<0)throw new h("Negative binary type element size found for subtype 0x02");if(R>S-4)throw new h("Binary type with subtype 0x02 contains too long binary size");if(R<S-4)throw new h("Binary type with subtype 0x02 contains too short binary size")}if(G&&B)O=f.toLocalBufferType(F.subarray(A,A+R));else if(O=new Z1(F.subarray(A,A+R),u),u===T$&&l0.isValid(O))O=O.toUUID();A=A+R}else if(I===dA&&$===!1){M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new h("Bad BSON Document: illegal CString");let R=f.toUTF8(F,A,M,!1);A=M+1,M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new h("Bad BSON Document: illegal CString");let S=f.toUTF8(F,A,M,!1);A=M+1;let u=new Array(S.length);for(M=0;M<S.length;M++)switch(S[M]){case"m":u[M]="m";break;case"s":u[M]="g";break;case"i":u[M]="i";break}O=new RegExp(R,u.join(""))}else if(I===dA&&$===!0){M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new h("Bad BSON Document: illegal CString");let R=f.toUTF8(F,A,M,!1);A=M+1,M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new h("Bad BSON Document: illegal CString");let S=f.toUTF8(F,A,M,!1);A=M+1,O=new I6(R,S)}else if(I===ZU){let R=$1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new h("bad string length in bson");let S=f.toUTF8(F,A,A+R-1,_);O=B?S:new B9(S),A=A+R}else if(I===XU)O=new P6({i:$1.getUint32LE(F,A),t:$1.getUint32LE(F,A+4)}),A+=8;else if(I===YU)O=new G9;else if(I===GU)O=new Y9;else if(I===N$){let R=$1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new h("bad string length in bson");let S=f.toUTF8(F,A,A+R-1,_);O=new g3(S),A=A+R}else if(I===JU){let R=$1.getInt32LE(F,A);if(A+=4,R<13)throw new h("code_w_scope total size shorter minimum expected length");let S=$1.getInt32LE(F,A);if(A+=4,S<=0||S>F.length-A||F[A+S-1]!==0)throw new h("bad string length in bson");let u=f.toUTF8(F,A,A+S-1,_);A=A+S;let c=A,r=$1.getInt32LE(F,A),J0=mA(F,c,D,!1);if(A=A+r,R<8+r+S)throw new h("code_w_scope total size is too short, truncating scope");if(R>8+r+S)throw new h("code_w_scope total size is too long, clips outer document");O=new g3(u,J0)}else if(I===vp){let R=$1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new h("bad string length in bson");let S=f.toUTF8(F,A,A+R-1,_);A=A+R;let u=f.allocateUnsafe(12);for(let r=0;r<12;r++)u[r]=F[A+r];let c=new o1(u);A=A+12,O=new E3(S,c)}else throw new h(`Detected unknown BSON type ${I.toString(16)} for fieldname "${x}"`);if(x==="__proto__")Object.defineProperty(L,x,{value:O,writable:!0,enumerable:!0,configurable:!0});else L[x]=O}if(z!==A-U){if(Z)throw new h("corrupt array bson");throw new h("corrupt object bson")}if(!P)return L;if(CU(L)){let I=Object.assign({},L);return delete I.$ref,delete I.$id,delete I.$db,new E3(L.$ref,L.$id,L.$db,I)}return L}var cA=/\x00/,iE=new Set(["$db","$ref","$id","$clusterTime"]);function oX(F,A,D,Z){F[Z++]=oE;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J+1,F[Z-1]=0;let X=f.encodeUTF8Into(F,D,Z+4);return $1.setInt32LE(F,Z,X+1),Z=Z+4+X,F[Z++]=0,Z}function eX(F,A,D,Z){let X=!Object.is(D,-0)&&Number.isSafeInteger(D)&&D<=W5&&D>=C5?B5:w$;F[Z++]=X;let $=f.encodeUTF8Into(F,A,Z);if(Z=Z+$,F[Z++]=0,X===B5)Z+=$1.setInt32LE(F,Z,D);else Z+=$1.setFloat64LE(F,Z,D);return Z}function F$(F,A,D,Z){F[Z++]=j$;let J=f.encodeUTF8Into(F,A,Z);return Z+=J,F[Z++]=0,Z+=$1.setBigInt64LE(F,Z,D),Z}function W7(F,A,D,Z){F[Z++]=M$;let J=f.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z}function A$(F,A,D,Z){F[Z++]=AU;let J=f.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,F[Z++]=D?1:0,Z}function D$(F,A,D,Z){F[Z++]=DU;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=j.fromNumber(D.getTime()),$=X.getLowBits(),G=X.getHighBits();return Z+=$1.setInt32LE(F,Z,$),Z+=$1.setInt32LE(F,Z,G),Z}function Z$(F,A,D,Z){F[Z++]=dA;let J=f.encodeUTF8Into(F,A,Z);if(Z=Z+J,F[Z++]=0,D.source&&D.source.match(cA)!=null)throw new h("value "+D.source+" must not contain null bytes");if(Z=Z+f.encodeUTF8Into(F,D.source,Z),F[Z++]=0,D.ignoreCase)F[Z++]=105;if(D.global)F[Z++]=115;if(D.multiline)F[Z++]=109;return F[Z++]=0,Z}function J$(F,A,D,Z){F[Z++]=dA;let J=f.encodeUTF8Into(F,A,Z);if(Z=Z+J,F[Z++]=0,D.pattern.match(cA)!=null)throw new h("pattern "+D.pattern+" must not contain null bytes");Z=Z+f.encodeUTF8Into(F,D.pattern,Z),F[Z++]=0;let X=D.options.split("").sort().join("");return Z=Z+f.encodeUTF8Into(F,X,Z),F[Z++]=0,Z}function X$(F,A,D,Z){if(D===null)F[Z++]=M$;else if(D._bsontype==="MinKey")F[Z++]=YU;else F[Z++]=GU;let J=f.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z}function $$(F,A,D,Z){F[Z++]=FU;let J=f.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z+=D.serializeInto(F,Z),Z}function Y$(F,A,D,Z){F[Z++]=I$;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=D.length;if(Z+=$1.setInt32LE(F,Z,X),F[Z++]=mp,X<=16)for(let $=0;$<X;$++)F[Z+$]=D[$];else F.set(D,Z);return Z=Z+X,Z}function G$(F,A,D,Z,J,X,$,G,Y){if(Y.has(D))throw new h("Cannot convert circular structure to BSON");Y.add(D),F[Z++]=Array.isArray(D)?eE:P$;let B=f.encodeUTF8Into(F,A,Z);Z=Z+B,F[Z++]=0;let H=Q5(F,D,J,Z,X+1,$,G,Y);return Y.delete(D),H}function B$(F,A,D,Z){F[Z++]=$U;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;for(let X=0;X<16;X++)F[Z+X]=D.bytes[X];return Z+16}function H$(F,A,D,Z){F[Z++]=D._bsontype==="Long"?j$:XU;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=D.getLowBits(),$=D.getHighBits();return Z+=$1.setInt32LE(F,Z,X),Z+=$1.setInt32LE(F,Z,$),Z}function q$(F,A,D,Z){D=D.valueOf(),F[Z++]=B5;let J=f.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z+=$1.setInt32LE(F,Z,D),Z}function W$(F,A,D,Z){F[Z++]=w$;let J=f.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z+=$1.setFloat64LE(F,Z,D.value),Z}function C$(F,A,D,Z){F[Z++]=N$;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=D.toString(),$=f.encodeUTF8Into(F,X,Z+4)+1;return $1.setInt32LE(F,Z,$),Z=Z+4+$-1,F[Z++]=0,Z}function Q$(F,A,D,Z,J=!1,X=0,$=!1,G=!0,Y){if(D.scope&&typeof D.scope==="object"){F[Z++]=JU;let B=f.encodeUTF8Into(F,A,Z);Z=Z+B,F[Z++]=0;let H=Z,q=D.code;Z=Z+4;let W=f.encodeUTF8Into(F,q,Z+4)+1;$1.setInt32LE(F,Z,W),F[Z+4+W-1]=0,Z=Z+W+4;let C=Q5(F,D.scope,J,Z,X+1,$,G,Y);Z=C-1;let Q=C-H;H+=$1.setInt32LE(F,H,Q),F[Z++]=0}else{F[Z++]=N$;let B=f.encodeUTF8Into(F,A,Z);Z=Z+B,F[Z++]=0;let H=D.code.toString(),q=f.encodeUTF8Into(F,H,Z+4)+1;$1.setInt32LE(F,Z,q),Z=Z+4+q-1,F[Z++]=0}return Z}function K$(F,A,D,Z){F[Z++]=I$;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let{buffer:X,position:$}=D;if(D.sub_type===Z1.SUBTYPE_BYTE_ARRAY)$=$+4;if(Z+=$1.setInt32LE(F,Z,$),F[Z++]=D.sub_type,D.sub_type===Z1.SUBTYPE_BYTE_ARRAY)$=$-4,Z+=$1.setInt32LE(F,Z,$);if(D.sub_type===Z1.SUBTYPE_VECTOR)WU(D);if($<=16)for(let G=0;G<$;G++)F[Z+G]=X[G];else F.set(X,Z);return Z=Z+D.position,Z}function E$(F,A,D,Z){F[Z++]=ZU;let J=f.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=f.encodeUTF8Into(F,D.value,Z+4)+1;return $1.setInt32LE(F,Z,X),Z=Z+4+X-1,F[Z++]=0,Z}function U$(F,A,D,Z,J,X,$){F[Z++]=P$;let G=f.encodeUTF8Into(F,A,Z);Z=Z+G,F[Z++]=0;let Y=Z,B={$ref:D.collection||D.namespace,$id:D.oid};if(D.db!=null)B.$db=D.db;B=Object.assign(B,D.fields);let H=Q5(F,B,!1,Z,J+1,X,!0,$),q=H-Y;return Y+=$1.setInt32LE(F,Z,q),H}function Q5(F,A,D,Z,J,X,$,G){if(G==null){if(A==null)return F[0]=5,F[1]=0,F[2]=0,F[3]=0,F[4]=0,5;if(Array.isArray(A))throw new h("serialize does not support an array as the root input");if(typeof A!=="object")throw new h("serialize does not support non-object as the root input");else if("_bsontype"in A&&typeof A._bsontype==="string")throw new h("BSON types cannot be serialized as a document");else if(K7(A)||Q7(A)||C7(A)||L$(A))throw new h("date, regexp, typedarray, and arraybuffer cannot be BSON documents");G=new Set}G.add(A);let Y=Z+4;if(Array.isArray(A))for(let H=0;H<A.length;H++){let q=`${H}`,W=A[H];if(typeof W?.toBSON==="function")W=W.toBSON();let C=typeof W;if(W===void 0)Y=W7(F,q,W,Y);else if(W===null)Y=W7(F,q,W,Y);else if(C==="string")Y=oX(F,q,W,Y);else if(C==="number")Y=eX(F,q,W,Y);else if(C==="bigint")Y=F$(F,q,W,Y);else if(C==="boolean")Y=A$(F,q,W,Y);else if(C==="object"&&W._bsontype==null)if(W instanceof Date||K7(W))Y=D$(F,q,W,Y);else if(W instanceof Uint8Array||C7(W))Y=Y$(F,q,W,Y);else if(W instanceof RegExp||Q7(W))Y=Z$(F,q,W,Y);else Y=G$(F,q,W,Y,D,J,X,$,G);else if(C==="object"){if(W[z7]!==$9)throw new z4;else if(W._bsontype==="ObjectId")Y=$$(F,q,W,Y);else if(W._bsontype==="Decimal128")Y=B$(F,q,W,Y);else if(W._bsontype==="Long"||W._bsontype==="Timestamp")Y=H$(F,q,W,Y);else if(W._bsontype==="Double")Y=W$(F,q,W,Y);else if(W._bsontype==="Code")Y=Q$(F,q,W,Y,D,J,X,$,G);else if(W._bsontype==="Binary")Y=K$(F,q,W,Y);else if(W._bsontype==="BSONSymbol")Y=E$(F,q,W,Y);else if(W._bsontype==="DBRef")Y=U$(F,q,W,Y,J,X,G);else if(W._bsontype==="BSONRegExp")Y=J$(F,q,W,Y);else if(W._bsontype==="Int32")Y=q$(F,q,W,Y);else if(W._bsontype==="MinKey"||W._bsontype==="MaxKey")Y=X$(F,q,W,Y);else if(typeof W._bsontype!=="undefined")throw new h(`Unrecognized or invalid _bsontype: ${String(W._bsontype)}`)}else if(C==="function"&&X)Y=C$(F,q,W,Y)}else if(A instanceof Map||R$(A)){let H=A.entries(),q=!1;while(!q){let W=H.next();if(q=!!W.done,q)continue;let C=W.value?W.value[0]:void 0,Q=W.value?W.value[1]:void 0;if(typeof Q?.toBSON==="function")Q=Q.toBSON();let K=typeof Q;if(typeof C==="string"&&!iE.has(C)){if(C.match(cA)!=null)throw new h("key "+C+" must not contain null bytes");if(D){if(C[0]==="$")throw new h("key "+C+" must not start with '$'");else if(C.includes("."))throw new h("key "+C+" must not contain '.'")}}if(Q===void 0){if($===!1)Y=W7(F,C,Q,Y)}else if(Q===null)Y=W7(F,C,Q,Y);else if(K==="string")Y=oX(F,C,Q,Y);else if(K==="number")Y=eX(F,C,Q,Y);else if(K==="bigint")Y=F$(F,C,Q,Y);else if(K==="boolean")Y=A$(F,C,Q,Y);else if(K==="object"&&Q._bsontype==null)if(Q instanceof Date||K7(Q))Y=D$(F,C,Q,Y);else if(Q instanceof Uint8Array||C7(Q))Y=Y$(F,C,Q,Y);else if(Q instanceof RegExp||Q7(Q))Y=Z$(F,C,Q,Y);else Y=G$(F,C,Q,Y,D,J,X,$,G);else if(K==="object"){if(Q[z7]!==$9)throw new z4;else if(Q._bsontype==="ObjectId")Y=$$(F,C,Q,Y);else if(Q._bsontype==="Decimal128")Y=B$(F,C,Q,Y);else if(Q._bsontype==="Long"||Q._bsontype==="Timestamp")Y=H$(F,C,Q,Y);else if(Q._bsontype==="Double")Y=W$(F,C,Q,Y);else if(Q._bsontype==="Code")Y=Q$(F,C,Q,Y,D,J,X,$,G);else if(Q._bsontype==="Binary")Y=K$(F,C,Q,Y);else if(Q._bsontype==="BSONSymbol")Y=E$(F,C,Q,Y);else if(Q._bsontype==="DBRef")Y=U$(F,C,Q,Y,J,X,G);else if(Q._bsontype==="BSONRegExp")Y=J$(F,C,Q,Y);else if(Q._bsontype==="Int32")Y=q$(F,C,Q,Y);else if(Q._bsontype==="MinKey"||Q._bsontype==="MaxKey")Y=X$(F,C,Q,Y);else if(typeof Q._bsontype!=="undefined")throw new h(`Unrecognized or invalid _bsontype: ${String(Q._bsontype)}`)}else if(K==="function"&&X)Y=C$(F,C,Q,Y)}}else{if(typeof A?.toBSON==="function"){if(A=A.toBSON(),A!=null&&typeof A!=="object")throw new h("toBSON function did not return an object")}for(let H of Object.keys(A)){let q=A[H];if(typeof q?.toBSON==="function")q=q.toBSON();let W=typeof q;if(typeof H==="string"&&!iE.has(H)){if(H.match(cA)!=null)throw new h("key "+H+" must not contain null bytes");if(D){if(H[0]==="$")throw new h("key "+H+" must not start with '$'");else if(H.includes("."))throw new h("key "+H+" must not contain '.'")}}if(q===void 0){if($===!1)Y=W7(F,H,q,Y)}else if(q===null)Y=W7(F,H,q,Y);else if(W==="string")Y=oX(F,H,q,Y);else if(W==="number")Y=eX(F,H,q,Y);else if(W==="bigint")Y=F$(F,H,q,Y);else if(W==="boolean")Y=A$(F,H,q,Y);else if(W==="object"&&q._bsontype==null)if(q instanceof Date||K7(q))Y=D$(F,H,q,Y);else if(q instanceof Uint8Array||C7(q))Y=Y$(F,H,q,Y);else if(q instanceof RegExp||Q7(q))Y=Z$(F,H,q,Y);else Y=G$(F,H,q,Y,D,J,X,$,G);else if(W==="object"){if(q[z7]!==$9)throw new z4;else if(q._bsontype==="ObjectId")Y=$$(F,H,q,Y);else if(q._bsontype==="Decimal128")Y=B$(F,H,q,Y);else if(q._bsontype==="Long"||q._bsontype==="Timestamp")Y=H$(F,H,q,Y);else if(q._bsontype==="Double")Y=W$(F,H,q,Y);else if(q._bsontype==="Code")Y=Q$(F,H,q,Y,D,J,X,$,G);else if(q._bsontype==="Binary")Y=K$(F,H,q,Y);else if(q._bsontype==="BSONSymbol")Y=E$(F,H,q,Y);else if(q._bsontype==="DBRef")Y=U$(F,H,q,Y,J,X,G);else if(q._bsontype==="BSONRegExp")Y=J$(F,H,q,Y);else if(q._bsontype==="Int32")Y=q$(F,H,q,Y);else if(q._bsontype==="MinKey"||q._bsontype==="MaxKey")Y=X$(F,H,q,Y);else if(typeof q._bsontype!=="undefined")throw new h(`Unrecognized or invalid _bsontype: ${String(q._bsontype)}`)}else if(W==="function"&&X)Y=C$(F,H,q,Y)}}G.delete(A),F[Y++]=0;let B=Y-Z;return Z+=$1.setInt32LE(F,Z,B),Y}function Ui(F){return F!=null&&typeof F==="object"&&"_bsontype"in F&&typeof F._bsontype==="string"}var zi={$oid:o1,$binary:Z1,$uuid:Z1,$symbol:B9,$numberInt:f3,$numberDecimal:$2,$numberDouble:w6,$numberLong:j,$minKey:G9,$maxKey:Y9,$regex:I6,$regularExpression:I6,$timestamp:P6};function UU(F,A={}){if(typeof F==="number"){let Z=F<=W5&&F>=C5,J=F<=nE&&F>=sE;if(A.relaxed||A.legacy)return F;if(Number.isInteger(F)&&!Object.is(F,-0)){if(Z)return new f3(F);if(J){if(A.useBigInt64)return BigInt(F);return j.fromNumber(F)}}return new w6(F)}if(F==null||typeof F!=="object")return F;if(F.$undefined)return null;let D=Object.keys(F).filter((Z)=>Z.startsWith("$")&&F[Z]!=null);for(let Z=0;Z<D.length;Z++){let J=zi[D[Z]];if(J)return J.fromExtendedJSON(F,A)}if(F.$date!=null){let Z=F.$date,J=new Date;if(A.legacy)if(typeof Z==="number")J.setTime(Z);else if(typeof Z==="string")J.setTime(Date.parse(Z));else if(typeof Z==="bigint")J.setTime(Number(Z));else throw new H5(`Unrecognized type for EJSON date: ${typeof Z}`);else if(typeof Z==="string")J.setTime(Date.parse(Z));else if(j.isLong(Z))J.setTime(Z.toNumber());else if(typeof Z==="number"&&A.relaxed)J.setTime(Z);else if(typeof Z==="bigint")J.setTime(Number(Z));else throw new H5(`Unrecognized type for EJSON date: ${typeof Z}`);return J}if(F.$code!=null){let Z=Object.assign({},F);if(F.$scope)Z.$scope=UU(F.$scope);return g3.fromExtendedJSON(F)}if(CU(F)||F.$dbPointer){let Z=F.$ref?F:F.$dbPointer;if(Z instanceof E3)return Z;let J=Object.keys(Z).filter(($)=>$.startsWith("$")),X=!0;if(J.forEach(($)=>{if(["$ref","$id","$db"].indexOf($)===-1)X=!1}),X)return E3.fromExtendedJSON(Z)}return F}function Vi(F,A){return F.map((D,Z)=>{A.seenObjects.push({propertyName:`index ${Z}`,obj:null});try{return x3(D,A)}finally{A.seenObjects.pop()}})}function aE(F){let A=F.toISOString();return F.getUTCMilliseconds()!==0?A:A.slice(0,-5)+"Z"}function x3(F,A){if(F instanceof Map||R$(F)){let D=Object.create(null);for(let[Z,J]of F){if(typeof Z!=="string")throw new h("Can only serialize maps with string keys");D[Z]=J}return x3(D,A)}if((typeof F==="object"||typeof F==="function")&&F!==null){let D=A.seenObjects.findIndex((Z)=>Z.obj===F);if(D!==-1){let Z=A.seenObjects.map((H)=>H.propertyName),J=Z.slice(0,D).map((H)=>`${H} -> `).join(""),X=Z[D],$=" -> "+Z.slice(D+1,Z.length-1).map((H)=>`${H} -> `).join(""),G=Z[Z.length-1],Y=" ".repeat(J.length+X.length/2),B="-".repeat($.length+(X.length+G.length)/2-1);throw new h(`Converting circular structure to EJSON:
7
+ ${J}${X}${$}${G}
8
+ ${Y}\\${B}/`)}A.seenObjects[A.seenObjects.length-1].obj=F}if(Array.isArray(F))return Vi(F,A);if(F===void 0)return null;if(F instanceof Date||K7(F)){let D=F.getTime(),Z=D>-1&&D<253402318800000;if(A.legacy)return A.relaxed&&Z?{$date:F.getTime()}:{$date:aE(F)};return A.relaxed&&Z?{$date:aE(F)}:{$date:{$numberLong:F.getTime().toString()}}}if(typeof F==="number"&&(!A.relaxed||!isFinite(F))){if(Number.isInteger(F)&&!Object.is(F,-0)){if(F>=C5&&F<=W5)return{$numberInt:F.toString()};if(F>=sE&&F<=nE)return{$numberLong:F.toString()}}return{$numberDouble:Object.is(F,-0)?"-0.0":F.toString()}}if(typeof F==="bigint"){if(!A.relaxed)return{$numberLong:BigInt.asIntN(64,F).toString()};return Number(BigInt.asIntN(64,F))}if(F instanceof RegExp||Q7(F)){let D=F.flags;if(D===void 0){let J=F.toString().match(/[gimuy]*$/);if(J)D=J[0]}return new I6(F.source,D).toExtendedJSON(A)}if(F!=null&&typeof F==="object")return Ri(F,A);return F}var Li={Binary:(F)=>new Z1(F.value(),F.sub_type),Code:(F)=>new g3(F.code,F.scope),DBRef:(F)=>new E3(F.collection||F.namespace,F.oid,F.db,F.fields),Decimal128:(F)=>new $2(F.bytes),Double:(F)=>new w6(F.value),Int32:(F)=>new f3(F.value),Long:(F)=>j.fromBits(F.low!=null?F.low:F.low_,F.low!=null?F.high:F.high_,F.low!=null?F.unsigned:F.unsigned_),MaxKey:()=>new Y9,MinKey:()=>new G9,ObjectId:(F)=>new o1(F),BSONRegExp:(F)=>new I6(F.pattern,F.options),BSONSymbol:(F)=>new B9(F.value),Timestamp:(F)=>P6.fromBits(F.low,F.high)};function Ri(F,A){if(F==null||typeof F!=="object")throw new h("not an object instance");let D=F._bsontype;if(typeof D==="undefined"){let Z={};for(let J of Object.keys(F)){A.seenObjects.push({propertyName:J,obj:null});try{let X=x3(F[J],A);if(J==="__proto__")Object.defineProperty(Z,J,{value:X,writable:!0,enumerable:!0,configurable:!0});else Z[J]=X}finally{A.seenObjects.pop()}}return Z}else if(F!=null&&typeof F==="object"&&typeof F._bsontype==="string"&&F[z7]!==$9)throw new z4;else if(Ui(F)){let Z=F;if(typeof Z.toExtendedJSON!=="function"){let J=Li[F._bsontype];if(!J)throw new h("Unrecognized or invalid _bsontype: "+F._bsontype);Z=J(Z)}if(D==="Code"&&Z.scope)Z=new g3(Z.code,x3(Z.scope,A));else if(D==="DBRef"&&Z.oid)Z=new E3(x3(Z.collection,A),x3(Z.oid,A),x3(Z.db,A),x3(Z.fields,A));return Z.toExtendedJSON(A)}else throw new h("_bsontype must be a string, but was: "+typeof D)}function zU(F,A){let D={useBigInt64:A?.useBigInt64??!1,relaxed:A?.relaxed??!0,legacy:A?.legacy??!1};return JSON.parse(F,(Z,J)=>{if(Z.indexOf("\x00")!==-1)throw new h(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(Z)}`);return UU(J,D)})}function VU(F,A,D,Z){if(D!=null&&typeof D==="object")Z=D,D=0;if(A!=null&&typeof A==="object"&&!Array.isArray(A))Z=A,A=void 0,D=0;let J=Object.assign({relaxed:!0,legacy:!1},Z,{seenObjects:[{propertyName:"(root)",obj:null}]}),X=x3(F,J);return JSON.stringify(X,A,D)}function wi(F,A){return A=A||{},JSON.parse(VU(F,A))}function Pi(F,A){return A=A||{},zU(JSON.stringify(F),A)}var H9=Object.create(null);H9.parse=zU;H9.stringify=VU;H9.serialize=wi;H9.deserialize=Pi;Object.freeze(H9);function z$(F,A){try{return $1.getNonnegativeInt32LE(F,A)}catch(D){throw new s6("BSON size cannot be negative",A,{cause:D})}}function V$(F,A){let D=A;for(;F[D]!==0;D++);if(D===F.length-1)throw new s6("Null terminator not found",A);return D}function Ii(F,A=0){if(A??=0,F.length<5)throw new s6(`Input must be at least 5 bytes, got ${F.length} bytes`,A);let D=z$(F,A);if(D>F.length-A)throw new s6(`Parsed documentSize (${D} bytes) does not match input length (${F.length} bytes)`,A);if(F[A+D-1]!==0)throw new s6("BSON documents must end in 0x00",A+D);let Z=[],J=A+4;while(J<=D+A){let X=F[J];if(J+=1,X===0){if(J-A!==D)throw new s6("Invalid 0x00 type byte",J);break}let $=J,G=V$(F,J)-$;J+=G+1;let Y;if(X===1||X===18||X===9||X===17)Y=8;else if(X===16)Y=4;else if(X===7)Y=12;else if(X===19)Y=16;else if(X===8)Y=1;else if(X===10||X===6||X===127||X===255)Y=0;else if(X===11)Y=V$(F,V$(F,J)+1)+1-J;else if(X===3||X===4||X===15)Y=z$(F,J);else if(X===2||X===5||X===12||X===13||X===14){if(Y=z$(F,J)+4,X===5)Y+=1;if(X===12)Y+=12}else throw new s6(`Invalid 0x${X.toString(16).padStart(2,"0")} type byte`,J);if(Y>D)throw new s6("value reports length larger than document",J);Z.push([X,$,G,J,Y]),J+=Y}return Z}var V7=Object.create(null);V7.parseToElements=Ii;V7.ByteUtils=f;V7.NumberUtils=$1;Object.freeze(V7);var LU=17825792,U4=f.allocate(LU);function RU(F){if(U4.length<F)U4=f.allocate(F)}function wU(F,A={}){let D=typeof A.checkKeys==="boolean"?A.checkKeys:!1,Z=typeof A.serializeFunctions==="boolean"?A.serializeFunctions:!1,J=typeof A.ignoreUndefined==="boolean"?A.ignoreUndefined:!0,X=typeof A.minInternalBufferSize==="number"?A.minInternalBufferSize:LU;if(U4.length<X)U4=f.allocate(X);let $=Q5(U4,F,D,0,0,Z,J,null),G=f.allocateUnsafe($);return G.set(U4.subarray(0,$),0),G}function PU(F,A,D={}){let Z=typeof D.checkKeys==="boolean"?D.checkKeys:!1,J=typeof D.serializeFunctions==="boolean"?D.serializeFunctions:!1,X=typeof D.ignoreUndefined==="boolean"?D.ignoreUndefined:!0,$=typeof D.index==="number"?D.index:0,G=Q5(U4,F,Z,0,0,J,X,null);return A.set(U4.subarray(0,G),$),$+G-1}function IU(F,A={}){return EU(f.toLocalBufferType(F),A)}function MU(F,A={}){A=A||{};let D=typeof A.serializeFunctions==="boolean"?A.serializeFunctions:!1,Z=typeof A.ignoreUndefined==="boolean"?A.ignoreUndefined:!0;return vA(F,D,Z)}function NU(F,A,D,Z,J,X){let $=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},X),G=f.toLocalBufferType(F),Y=A;for(let B=0;B<D;B++){let H=$1.getInt32LE(G,Y);$.index=Y,Z[J+B]=EU(G,$),Y=Y+H}return Y}var Mi=Object.freeze({__proto__:null,BSONError:h,BSONOffsetError:s6,BSONRegExp:I6,BSONRuntimeError:H5,BSONSymbol:B9,BSONType:BU,BSONValue:N2,BSONVersionError:z4,Binary:Z1,Code:g3,DBRef:E3,Decimal128:$2,Double:w6,EJSON:H9,Int32:f3,Long:j,MaxKey:Y9,MinKey:G9,ObjectId:o1,Timestamp:P6,UUID:l0,calculateObjectSize:MU,deserialize:IU,deserializeStream:NU,onDemand:V7,serialize:wU,serializeWithBufferAndIndex:PU,setInternalBufferSize:RU});Ni.BSON=Mi;Ni.BSONError=h;Ni.BSONOffsetError=s6;Ni.BSONRegExp=I6;Ni.BSONRuntimeError=H5;Ni.BSONSymbol=B9;Ni.BSONType=BU;Ni.BSONValue=N2;Ni.BSONVersionError=z4;Ni.Binary=Z1;Ni.Code=g3;Ni.DBRef=E3;Ni.Decimal128=$2;Ni.Double=w6;Ni.EJSON=H9;Ni.Int32=f3;Ni.Long=j;Ni.MaxKey=Y9;Ni.MinKey=G9;Ni.ObjectId=o1;Ni.Timestamp=P6;Ni.UUID=l0;Ni.calculateObjectSize=MU;Ni.deserialize=IU;Ni.deserializeStream=NU;Ni.onDemand=V7;Ni.serialize=wU;Ni.serializeWithBufferAndIndex=PU;Ni.setInternalBufferSize=RU});var k1=E((C0)=>{Object.defineProperty(C0,"__esModule",{value:!0});C0.toUTF8=C0.getBigInt64LE=C0.getFloat64LE=C0.getInt32LE=C0.UUID=C0.Timestamp=C0.serialize=C0.ObjectId=C0.MinKey=C0.MaxKey=C0.Long=C0.Int32=C0.EJSON=C0.Double=C0.deserialize=C0.Decimal128=C0.DBRef=C0.Code=C0.calculateObjectSize=C0.BSONType=C0.BSONSymbol=C0.BSONRegExp=C0.BSONError=C0.BSON=C0.Binary=void 0;C0.parseToElementsToArray=Da;C0.pluckBSONSerializeOptions=Za;C0.resolveBSONOptions=Ja;C0.parseUtf8ValidationOption=Xa;var K5=k$(),M0=k$();Object.defineProperty(C0,"Binary",{enumerable:!0,get:function(){return M0.Binary}});Object.defineProperty(C0,"BSON",{enumerable:!0,get:function(){return M0.BSON}});Object.defineProperty(C0,"BSONError",{enumerable:!0,get:function(){return M0.BSONError}});Object.defineProperty(C0,"BSONRegExp",{enumerable:!0,get:function(){return M0.BSONRegExp}});Object.defineProperty(C0,"BSONSymbol",{enumerable:!0,get:function(){return M0.BSONSymbol}});Object.defineProperty(C0,"BSONType",{enumerable:!0,get:function(){return M0.BSONType}});Object.defineProperty(C0,"calculateObjectSize",{enumerable:!0,get:function(){return M0.calculateObjectSize}});Object.defineProperty(C0,"Code",{enumerable:!0,get:function(){return M0.Code}});Object.defineProperty(C0,"DBRef",{enumerable:!0,get:function(){return M0.DBRef}});Object.defineProperty(C0,"Decimal128",{enumerable:!0,get:function(){return M0.Decimal128}});Object.defineProperty(C0,"deserialize",{enumerable:!0,get:function(){return M0.deserialize}});Object.defineProperty(C0,"Double",{enumerable:!0,get:function(){return M0.Double}});Object.defineProperty(C0,"EJSON",{enumerable:!0,get:function(){return M0.EJSON}});Object.defineProperty(C0,"Int32",{enumerable:!0,get:function(){return M0.Int32}});Object.defineProperty(C0,"Long",{enumerable:!0,get:function(){return M0.Long}});Object.defineProperty(C0,"MaxKey",{enumerable:!0,get:function(){return M0.MaxKey}});Object.defineProperty(C0,"MinKey",{enumerable:!0,get:function(){return M0.MinKey}});Object.defineProperty(C0,"ObjectId",{enumerable:!0,get:function(){return M0.ObjectId}});Object.defineProperty(C0,"serialize",{enumerable:!0,get:function(){return M0.serialize}});Object.defineProperty(C0,"Timestamp",{enumerable:!0,get:function(){return M0.Timestamp}});Object.defineProperty(C0,"UUID",{enumerable:!0,get:function(){return M0.UUID}});function Da(F,A){let D=K5.BSON.onDemand.parseToElements(F,A);return Array.isArray(D)?D:[...D]}C0.getInt32LE=K5.BSON.onDemand.NumberUtils.getInt32LE;C0.getFloat64LE=K5.BSON.onDemand.NumberUtils.getFloat64LE;C0.getBigInt64LE=K5.BSON.onDemand.NumberUtils.getBigInt64LE;C0.toUTF8=K5.BSON.onDemand.ByteUtils.toUTF8;function Za(F){let{fieldsAsRaw:A,useBigInt64:D,promoteValues:Z,promoteBuffers:J,promoteLongs:X,serializeFunctions:$,ignoreUndefined:G,bsonRegExp:Y,raw:B,enableUtf8Validation:H}=F;return{fieldsAsRaw:A,useBigInt64:D,promoteValues:Z,promoteBuffers:J,promoteLongs:X,serializeFunctions:$,ignoreUndefined:G,bsonRegExp:Y,raw:B,enableUtf8Validation:H}}function Ja(F,A){let D=A?.bsonOptions;return{raw:F?.raw??D?.raw??!1,useBigInt64:F?.useBigInt64??D?.useBigInt64??!1,promoteLongs:F?.promoteLongs??D?.promoteLongs??!0,promoteValues:F?.promoteValues??D?.promoteValues??!0,promoteBuffers:F?.promoteBuffers??D?.promoteBuffers??!1,ignoreUndefined:F?.ignoreUndefined??D?.ignoreUndefined??!1,bsonRegExp:F?.bsonRegExp??D?.bsonRegExp??!1,serializeFunctions:F?.serializeFunctions??D?.serializeFunctions??!1,fieldsAsRaw:F?.fieldsAsRaw??D?.fieldsAsRaw??{},enableUtf8Validation:F?.enableUtf8Validation??D?.enableUtf8Validation??!0}}function Xa(F){if(F?.enableUtf8Validation===!1)return{utf8:!1};return{utf8:{writeErrors:!1}}}});var n=E(($z)=>{Object.defineProperty($z,"__esModule",{value:!0});$z.MongoWriteConcernError=$z.MongoServerSelectionError=$z.MongoSystemError=$z.MongoMissingDependencyError=$z.MongoMissingCredentialsError=$z.MongoCompatibilityError=$z.MongoInvalidArgumentError=$z.MongoParseError=$z.MongoNetworkTimeoutError=$z.MongoNetworkError=$z.MongoTopologyClosedError=$z.MongoCursorExhaustedError=$z.MongoServerClosedError=$z.MongoCursorInUseError=$z.MongoOperationTimeoutError=$z.MongoUnexpectedServerResponseError=$z.MongoGridFSChunkError=$z.MongoGridFSStreamError=$z.MongoTailableCursorError=$z.MongoChangeStreamError=$z.MongoClientBulkWriteExecutionError=$z.MongoClientBulkWriteCursorError=$z.MongoClientBulkWriteError=$z.MongoGCPError=$z.MongoAzureError=$z.MongoOIDCError=$z.MongoAWSError=$z.MongoKerberosError=$z.MongoExpiredSessionError=$z.MongoTransactionError=$z.MongoNotConnectedError=$z.MongoDecompressionError=$z.MongoBatchReExecutionError=$z.MongoStalePrimaryError=$z.MongoRuntimeError=$z.MongoAPIError=$z.MongoDriverError=$z.MongoServerError=$z.MongoError=$z.MongoErrorLabel=$z.GET_MORE_RESUMABLE_CODES=$z.MONGODB_ERROR_CODES=$z.NODE_IS_RECOVERING_ERROR_MESSAGE=$z.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=$z.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=void 0;$z.needsRetryableWriteLabel=Qa;$z.isRetryableWriteError=Jz;$z.isRetryableReadError=Ka;$z.isNodeShuttingDownError=La;$z.isSDAMUnrecoverableError=Ra;$z.isNetworkTimeoutError=wa;$z.isResumableError=Pa;$z.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=new RegExp("not master","i");$z.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=new RegExp("not master or secondary","i");$z.NODE_IS_RECOVERING_ERROR_MESSAGE=new RegExp("node is recovering","i");$z.MONGODB_ERROR_CODES=Object.freeze({HostUnreachable:6,HostNotFound:7,AuthenticationFailed:18,NetworkTimeout:89,ShutdownInProgress:91,PrimarySteppedDown:189,ExceededTimeLimit:262,SocketException:9001,NotWritablePrimary:10107,InterruptedAtShutdown:11600,InterruptedDueToReplStateChange:11602,NotPrimaryNoSecondaryOk:13435,NotPrimaryOrSecondary:13436,StaleShardVersion:63,StaleEpoch:150,StaleConfig:13388,RetryChangeStream:234,FailedToSatisfyReadPreference:133,CursorNotFound:43,LegacyNotPrimary:10058,WriteConcernFailed:64,NamespaceNotFound:26,IllegalOperation:20,MaxTimeMSExpired:50,UnknownReplWriteConcern:79,UnsatisfiableWriteConcern:100,Reauthenticate:391,ReadConcernMajorityNotAvailableYet:134});$z.GET_MORE_RESUMABLE_CODES=new Set([$z.MONGODB_ERROR_CODES.HostUnreachable,$z.MONGODB_ERROR_CODES.HostNotFound,$z.MONGODB_ERROR_CODES.NetworkTimeout,$z.MONGODB_ERROR_CODES.ShutdownInProgress,$z.MONGODB_ERROR_CODES.PrimarySteppedDown,$z.MONGODB_ERROR_CODES.ExceededTimeLimit,$z.MONGODB_ERROR_CODES.SocketException,$z.MONGODB_ERROR_CODES.NotWritablePrimary,$z.MONGODB_ERROR_CODES.InterruptedAtShutdown,$z.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,$z.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,$z.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,$z.MONGODB_ERROR_CODES.StaleShardVersion,$z.MONGODB_ERROR_CODES.StaleEpoch,$z.MONGODB_ERROR_CODES.StaleConfig,$z.MONGODB_ERROR_CODES.RetryChangeStream,$z.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference,$z.MONGODB_ERROR_CODES.CursorNotFound]);$z.MongoErrorLabel=Object.freeze({RetryableWriteError:"RetryableWriteError",TransientTransactionError:"TransientTransactionError",UnknownTransactionCommitResult:"UnknownTransactionCommitResult",ResumableChangeStreamError:"ResumableChangeStreamError",HandshakeError:"HandshakeError",ResetPool:"ResetPool",PoolRequstedRetry:"PoolRequstedRetry",InterruptInUseConnections:"InterruptInUseConnections",NoWritesPerformed:"NoWritesPerformed"});function Ca(F){return F!=null&&typeof F==="object"&&"errors"in F&&Array.isArray(F.errors)}class U3 extends Error{get errorLabels(){return Array.from(this.errorLabelSet)}constructor(F,A){super(F,A);this.errorLabelSet=new Set}static buildErrorMessage(F){if(typeof F==="string")return F;if(Ca(F)&&F.message.length===0)return F.errors.length===0?"AggregateError has an empty errors array. Please check the `cause` property for more information.":F.errors.map(({message:A})=>A).join(", ");return F!=null&&typeof F==="object"&&"message"in F&&typeof F.message==="string"?F.message:"empty error message"}get name(){return"MongoError"}get errmsg(){return this.message}hasErrorLabel(F){return this.errorLabelSet.has(F)}addErrorLabel(F){this.errorLabelSet.add(F)}}$z.MongoError=U3;class lA extends U3{constructor(F){super(F.message||F.errmsg||F.$err||"n/a");if(F.errorLabels)for(let A of F.errorLabels)this.addErrorLabel(A);this.errorResponse=F;for(let A in F)if(A!=="errorLabels"&&A!=="errmsg"&&A!=="message"&&A!=="errorResponse")this[A]=F[A]}get name(){return"MongoServerError"}}$z.MongoServerError=lA;class L7 extends U3{constructor(F,A){super(F,A)}get name(){return"MongoDriverError"}}$z.MongoDriverError=L7;class j2 extends L7{constructor(F,A){super(F,A)}get name(){return"MongoAPIError"}}$z.MongoAPIError=j2;class X6 extends L7{constructor(F,A){super(F,A)}get name(){return"MongoRuntimeError"}}$z.MongoRuntimeError=X6;class TU extends X6{constructor(F,A){super(F,A)}get name(){return"MongoStalePrimaryError"}}$z.MongoStalePrimaryError=TU;class kU extends j2{constructor(F="This batch has already been executed, create new batch to execute"){super(F)}get name(){return"MongoBatchReExecutionError"}}$z.MongoBatchReExecutionError=kU;class OU extends X6{constructor(F){super(F)}get name(){return"MongoDecompressionError"}}$z.MongoDecompressionError=OU;class SU extends j2{constructor(F){super(F)}get name(){return"MongoNotConnectedError"}}$z.MongoNotConnectedError=SU;class _U extends j2{constructor(F){super(F)}get name(){return"MongoTransactionError"}}$z.MongoTransactionError=_U;class uU extends j2{constructor(F="Cannot use a session that has ended"){super(F)}get name(){return"MongoExpiredSessionError"}}$z.MongoExpiredSessionError=uU;class xU extends X6{constructor(F){super(F)}get name(){return"MongoKerberosError"}}$z.MongoKerberosError=xU;class gU extends X6{constructor(F,A){super(F,A)}get name(){return"MongoAWSError"}}$z.MongoAWSError=gU;class pA extends X6{constructor(F){super(F)}get name(){return"MongoOIDCError"}}$z.MongoOIDCError=pA;class fU extends pA{constructor(F){super(F)}get name(){return"MongoAzureError"}}$z.MongoAzureError=fU;class yU extends pA{constructor(F){super(F)}get name(){return"MongoGCPError"}}$z.MongoGCPError=yU;class bU extends lA{constructor(F){super(F);this.writeConcernErrors=[],this.writeErrors=new Map}get name(){return"MongoClientBulkWriteError"}}$z.MongoClientBulkWriteError=bU;class hU extends X6{constructor(F){super(F)}get name(){return"MongoClientBulkWriteCursorError"}}$z.MongoClientBulkWriteCursorError=hU;class vU extends X6{constructor(F){super(F)}get name(){return"MongoClientBulkWriteExecutionError"}}$z.MongoClientBulkWriteExecutionError=vU;class mU extends X6{constructor(F){super(F)}get name(){return"MongoChangeStreamError"}}$z.MongoChangeStreamError=mU;class dU extends j2{constructor(F="Tailable cursor does not support this operation"){super(F)}get name(){return"MongoTailableCursorError"}}$z.MongoTailableCursorError=dU;class cU extends X6{constructor(F){super(F)}get name(){return"MongoGridFSStreamError"}}$z.MongoGridFSStreamError=cU;class lU extends X6{constructor(F){super(F)}get name(){return"MongoGridFSChunkError"}}$z.MongoGridFSChunkError=lU;class pU extends X6{constructor(F,A){super(F,A)}get name(){return"MongoUnexpectedServerResponseError"}}$z.MongoUnexpectedServerResponseError=pU;class iU extends L7{get name(){return"MongoOperationTimeoutError"}}$z.MongoOperationTimeoutError=iU;class aU extends j2{constructor(F="Cursor is already initialized"){super(F)}get name(){return"MongoCursorInUseError"}}$z.MongoCursorInUseError=aU;class nU extends j2{constructor(F="Server is closed"){super(F)}get name(){return"MongoServerClosedError"}}$z.MongoServerClosedError=nU;class sU extends j2{constructor(F){super(F||"Cursor is exhausted")}get name(){return"MongoCursorExhaustedError"}}$z.MongoCursorExhaustedError=sU;class rU extends j2{constructor(F="Topology is closed"){super(F)}get name(){return"MongoTopologyClosedError"}}$z.MongoTopologyClosedError=rU;class q9 extends U3{constructor(F,A){super(F,{cause:A?.cause});this.beforeHandshake=!!A?.beforeHandshake}get name(){return"MongoNetworkError"}}$z.MongoNetworkError=q9;class tU extends q9{constructor(F,A){super(F,A)}get name(){return"MongoNetworkTimeoutError"}}$z.MongoNetworkTimeoutError=tU;class S$ extends L7{constructor(F){super(F)}get name(){return"MongoParseError"}}$z.MongoParseError=S$;class oU extends j2{constructor(F,A){super(F,A)}get name(){return"MongoInvalidArgumentError"}}$z.MongoInvalidArgumentError=oU;class eU extends j2{constructor(F){super(F)}get name(){return"MongoCompatibilityError"}}$z.MongoCompatibilityError=eU;class Fz extends j2{constructor(F){super(F)}get name(){return"MongoMissingCredentialsError"}}$z.MongoMissingCredentialsError=Fz;class Az extends j2{constructor(F,A){super(F,A);this.dependencyName=A.dependencyName}get name(){return"MongoMissingDependencyError"}}$z.MongoMissingDependencyError=Az;class _$ extends U3{constructor(F,A){if(A&&A.error)super(U3.buildErrorMessage(A.error.message||A.error),{cause:A.error});else super(F);if(A)this.reason=A;this.code=A.error?.code}get name(){return"MongoSystemError"}}$z.MongoSystemError=_$;class Dz extends _${constructor(F,A){super(F,A)}get name(){return"MongoServerSelectionError"}}$z.MongoServerSelectionError=Dz;class u$ extends lA{constructor(F){super({...F.writeConcernError,...F});this.errInfo=F.writeConcernError.errInfo,this.result=F}get name(){return"MongoWriteConcernError"}}$z.MongoWriteConcernError=u$;var Zz=new Set([$z.MONGODB_ERROR_CODES.HostUnreachable,$z.MONGODB_ERROR_CODES.HostNotFound,$z.MONGODB_ERROR_CODES.NetworkTimeout,$z.MONGODB_ERROR_CODES.ShutdownInProgress,$z.MONGODB_ERROR_CODES.PrimarySteppedDown,$z.MONGODB_ERROR_CODES.SocketException,$z.MONGODB_ERROR_CODES.NotWritablePrimary,$z.MONGODB_ERROR_CODES.InterruptedAtShutdown,$z.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,$z.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,$z.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,$z.MONGODB_ERROR_CODES.ExceededTimeLimit,$z.MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet]),O$=Zz;function Qa(F,A,D){if(F instanceof q9)return!0;if(F instanceof U3){if((A>=9||Jz(F))&&!F.hasErrorLabel($z.MongoErrorLabel.HandshakeError))return!1}if(F instanceof u$){if(D==="Mongos"&&A<9)return O$.has(F.result.code??0);let X=F.result.writeConcernError.code??Number(F.code);return O$.has(Number.isNaN(X)?0:X)}if(F instanceof U3)return O$.has(Number(F.code));if($z.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(F.message))return!0;if($z.NODE_IS_RECOVERING_ERROR_MESSAGE.test(F.message))return!0;return!1}function Jz(F){return F.hasErrorLabel($z.MongoErrorLabel.RetryableWriteError)||F.hasErrorLabel($z.MongoErrorLabel.PoolRequstedRetry)}function Ka(F){if(typeof F.code==="number"?Zz.has(F.code):!1)return!0;if(F instanceof q9)return!0;if($z.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(F.message))return!0;if($z.NODE_IS_RECOVERING_ERROR_MESSAGE.test(F.message))return!0;return!1}var Ea=new Set([$z.MONGODB_ERROR_CODES.ShutdownInProgress,$z.MONGODB_ERROR_CODES.PrimarySteppedDown,$z.MONGODB_ERROR_CODES.InterruptedAtShutdown,$z.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,$z.MONGODB_ERROR_CODES.NotPrimaryOrSecondary]),Ua=new Set([$z.MONGODB_ERROR_CODES.NotWritablePrimary,$z.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,$z.MONGODB_ERROR_CODES.LegacyNotPrimary]),za=new Set([$z.MONGODB_ERROR_CODES.InterruptedAtShutdown,$z.MONGODB_ERROR_CODES.ShutdownInProgress]);function Xz(F){if(typeof F.code==="number")return Ea.has(F.code);return $z.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(F.message)||$z.NODE_IS_RECOVERING_ERROR_MESSAGE.test(F.message)}function Va(F){if(typeof F.code==="number")return Ua.has(F.code);if(Xz(F))return!1;return $z.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(F.message)}function La(F){return!!(typeof F.code==="number"&&za.has(F.code))}function Ra(F){if(F instanceof S$||F==null)return!0;return Xz(F)||Va(F)}function wa(F){return!!(F instanceof q9&&F.message.match(/timed out/))}function Pa(F,A){if(F==null||!(F instanceof U3))return!1;if(F instanceof q9)return!0;if(A!=null&&A>=9){if(F.code===$z.MONGODB_ERROR_CODES.CursorNotFound)return!0;return F.hasErrorLabel($z.MongoErrorLabel.ResumableChangeStreamError)}if(typeof F.code==="number")return $z.GET_MORE_RESUMABLE_CODES.has(F.code);return!1}});var N0=E((Hz)=>{Object.defineProperty(Hz,"__esModule",{value:!0});Hz.END=Hz.CHANGE=Hz.INIT=Hz.MORE=Hz.RESPONSE=Hz.SERVER_HEARTBEAT_FAILED=Hz.SERVER_HEARTBEAT_SUCCEEDED=Hz.SERVER_HEARTBEAT_STARTED=Hz.COMMAND_FAILED=Hz.COMMAND_SUCCEEDED=Hz.COMMAND_STARTED=Hz.CLUSTER_TIME_RECEIVED=Hz.CONNECTION_CHECKED_IN=Hz.CONNECTION_CHECKED_OUT=Hz.CONNECTION_CHECK_OUT_FAILED=Hz.CONNECTION_CHECK_OUT_STARTED=Hz.CONNECTION_CLOSED=Hz.CONNECTION_READY=Hz.CONNECTION_CREATED=Hz.CONNECTION_POOL_READY=Hz.CONNECTION_POOL_CLEARED=Hz.CONNECTION_POOL_CLOSED=Hz.CONNECTION_POOL_CREATED=Hz.WAITING_FOR_SUITABLE_SERVER=Hz.SERVER_SELECTION_SUCCEEDED=Hz.SERVER_SELECTION_FAILED=Hz.SERVER_SELECTION_STARTED=Hz.TOPOLOGY_DESCRIPTION_CHANGED=Hz.TOPOLOGY_CLOSED=Hz.TOPOLOGY_OPENING=Hz.SERVER_DESCRIPTION_CHANGED=Hz.SERVER_CLOSED=Hz.SERVER_OPENING=Hz.DESCRIPTION_RECEIVED=Hz.UNPINNED=Hz.PINNED=Hz.MESSAGE=Hz.ENDED=Hz.CLOSED=Hz.CONNECT=Hz.OPEN=Hz.CLOSE=Hz.TIMEOUT=Hz.ERROR=Hz.SYSTEM_JS_COLLECTION=Hz.SYSTEM_COMMAND_COLLECTION=Hz.SYSTEM_USER_COLLECTION=Hz.SYSTEM_PROFILE_COLLECTION=Hz.SYSTEM_INDEX_COLLECTION=Hz.SYSTEM_NAMESPACE_COLLECTION=void 0;Hz.kDecoratedKeys=Hz.kDecorateResult=Hz.LEGACY_HELLO_COMMAND_CAMEL_CASE=Hz.LEGACY_HELLO_COMMAND=Hz.MONGO_CLIENT_EVENTS=Hz.LOCAL_SERVER_EVENTS=Hz.SERVER_RELAY_EVENTS=Hz.APM_EVENTS=Hz.TOPOLOGY_EVENTS=Hz.CMAP_EVENTS=Hz.HEARTBEAT_EVENTS=Hz.RESUME_TOKEN_CHANGED=void 0;Hz.SYSTEM_NAMESPACE_COLLECTION="system.namespaces";Hz.SYSTEM_INDEX_COLLECTION="system.indexes";Hz.SYSTEM_PROFILE_COLLECTION="system.profile";Hz.SYSTEM_USER_COLLECTION="system.users";Hz.SYSTEM_COMMAND_COLLECTION="$cmd";Hz.SYSTEM_JS_COLLECTION="system.js";Hz.ERROR="error";Hz.TIMEOUT="timeout";Hz.CLOSE="close";Hz.OPEN="open";Hz.CONNECT="connect";Hz.CLOSED="closed";Hz.ENDED="ended";Hz.MESSAGE="message";Hz.PINNED="pinned";Hz.UNPINNED="unpinned";Hz.DESCRIPTION_RECEIVED="descriptionReceived";Hz.SERVER_OPENING="serverOpening";Hz.SERVER_CLOSED="serverClosed";Hz.SERVER_DESCRIPTION_CHANGED="serverDescriptionChanged";Hz.TOPOLOGY_OPENING="topologyOpening";Hz.TOPOLOGY_CLOSED="topologyClosed";Hz.TOPOLOGY_DESCRIPTION_CHANGED="topologyDescriptionChanged";Hz.SERVER_SELECTION_STARTED="serverSelectionStarted";Hz.SERVER_SELECTION_FAILED="serverSelectionFailed";Hz.SERVER_SELECTION_SUCCEEDED="serverSelectionSucceeded";Hz.WAITING_FOR_SUITABLE_SERVER="waitingForSuitableServer";Hz.CONNECTION_POOL_CREATED="connectionPoolCreated";Hz.CONNECTION_POOL_CLOSED="connectionPoolClosed";Hz.CONNECTION_POOL_CLEARED="connectionPoolCleared";Hz.CONNECTION_POOL_READY="connectionPoolReady";Hz.CONNECTION_CREATED="connectionCreated";Hz.CONNECTION_READY="connectionReady";Hz.CONNECTION_CLOSED="connectionClosed";Hz.CONNECTION_CHECK_OUT_STARTED="connectionCheckOutStarted";Hz.CONNECTION_CHECK_OUT_FAILED="connectionCheckOutFailed";Hz.CONNECTION_CHECKED_OUT="connectionCheckedOut";Hz.CONNECTION_CHECKED_IN="connectionCheckedIn";Hz.CLUSTER_TIME_RECEIVED="clusterTimeReceived";Hz.COMMAND_STARTED="commandStarted";Hz.COMMAND_SUCCEEDED="commandSucceeded";Hz.COMMAND_FAILED="commandFailed";Hz.SERVER_HEARTBEAT_STARTED="serverHeartbeatStarted";Hz.SERVER_HEARTBEAT_SUCCEEDED="serverHeartbeatSucceeded";Hz.SERVER_HEARTBEAT_FAILED="serverHeartbeatFailed";Hz.RESPONSE="response";Hz.MORE="more";Hz.INIT="init";Hz.CHANGE="change";Hz.END="end";Hz.RESUME_TOKEN_CHANGED="resumeTokenChanged";Hz.HEARTBEAT_EVENTS=Object.freeze([Hz.SERVER_HEARTBEAT_STARTED,Hz.SERVER_HEARTBEAT_SUCCEEDED,Hz.SERVER_HEARTBEAT_FAILED]);Hz.CMAP_EVENTS=Object.freeze([Hz.CONNECTION_POOL_CREATED,Hz.CONNECTION_POOL_READY,Hz.CONNECTION_POOL_CLEARED,Hz.CONNECTION_POOL_CLOSED,Hz.CONNECTION_CREATED,Hz.CONNECTION_READY,Hz.CONNECTION_CLOSED,Hz.CONNECTION_CHECK_OUT_STARTED,Hz.CONNECTION_CHECK_OUT_FAILED,Hz.CONNECTION_CHECKED_OUT,Hz.CONNECTION_CHECKED_IN]);Hz.TOPOLOGY_EVENTS=Object.freeze([Hz.SERVER_OPENING,Hz.SERVER_CLOSED,Hz.SERVER_DESCRIPTION_CHANGED,Hz.TOPOLOGY_OPENING,Hz.TOPOLOGY_CLOSED,Hz.TOPOLOGY_DESCRIPTION_CHANGED,Hz.ERROR,Hz.TIMEOUT,Hz.CLOSE]);Hz.APM_EVENTS=Object.freeze([Hz.COMMAND_STARTED,Hz.COMMAND_SUCCEEDED,Hz.COMMAND_FAILED]);Hz.SERVER_RELAY_EVENTS=Object.freeze([Hz.SERVER_HEARTBEAT_STARTED,Hz.SERVER_HEARTBEAT_SUCCEEDED,Hz.SERVER_HEARTBEAT_FAILED,Hz.COMMAND_STARTED,Hz.COMMAND_SUCCEEDED,Hz.COMMAND_FAILED,...Hz.CMAP_EVENTS]);Hz.LOCAL_SERVER_EVENTS=Object.freeze([Hz.CONNECT,Hz.DESCRIPTION_RECEIVED,Hz.CLOSED,Hz.ENDED]);Hz.MONGO_CLIENT_EVENTS=Object.freeze([...Hz.CMAP_EVENTS,...Hz.APM_EVENTS,...Hz.TOPOLOGY_EVENTS,...Hz.HEARTBEAT_EVENTS]);Hz.LEGACY_HELLO_COMMAND="ismaster";Hz.LEGACY_HELLO_COMMAND_CAMEL_CASE="isMaster";Hz.kDecorateResult=Symbol.for("@@mdb.decorateDecryptionResult");Hz.kDecoratedKeys=Symbol.for("@@mdb.decryptedKeys")});var W9=E((vz)=>{Object.defineProperty(vz,"__esModule",{value:!0});vz.OP_MSG=vz.OP_COMPRESSED=vz.OP_DELETE=vz.OP_QUERY=vz.OP_INSERT=vz.OP_UPDATE=vz.OP_REPLY=vz.MIN_SUPPORTED_QE_SERVER_VERSION=vz.MIN_SUPPORTED_QE_WIRE_VERSION=vz.MAX_SUPPORTED_WIRE_VERSION=vz.MIN_SUPPORTED_WIRE_VERSION=vz.MAX_SUPPORTED_SERVER_VERSION=vz.MIN_SUPPORTED_SERVER_VERSION=void 0;vz.MIN_SUPPORTED_SERVER_VERSION="4.0";vz.MAX_SUPPORTED_SERVER_VERSION="8.0";vz.MIN_SUPPORTED_WIRE_VERSION=7;vz.MAX_SUPPORTED_WIRE_VERSION=25;vz.MIN_SUPPORTED_QE_WIRE_VERSION=21;vz.MIN_SUPPORTED_QE_SERVER_VERSION="7.0";vz.OP_REPLY=1;vz.OP_UPDATE=2001;vz.OP_INSERT=2002;vz.OP_QUERY=2004;vz.OP_DELETE=2006;vz.OP_COMPRESSED=2012;vz.OP_MSG=2013});var M6=E((dz)=>{Object.defineProperty(dz,"__esModule",{value:!0});dz.ReadConcern=dz.ReadConcernLevel=void 0;dz.ReadConcernLevel=Object.freeze({local:"local",majority:"majority",linearizable:"linearizable",available:"available",snapshot:"snapshot"});class w7{constructor(F){this.level=dz.ReadConcernLevel[F]??F}static fromOptions(F){if(F==null)return;if(F.readConcern){let{readConcern:A}=F;if(A instanceof w7)return A;else if(typeof A==="string")return new w7(A);else if("level"in A&&A.level)return new w7(A.level)}if(F.level)return new w7(F.level);return}static get MAJORITY(){return dz.ReadConcernLevel.majority}static get AVAILABLE(){return dz.ReadConcernLevel.available}static get LINEARIZABLE(){return dz.ReadConcernLevel.linearizable}static get SNAPSHOT(){return dz.ReadConcernLevel.snapshot}toJSON(){return{level:this.level}}}dz.ReadConcern=w7});var y0=E((lz)=>{Object.defineProperty(lz,"__esModule",{value:!0});lz.ReadPreference=lz.ReadPreferenceMode=void 0;var C9=n();lz.ReadPreferenceMode=Object.freeze({primary:"primary",primaryPreferred:"primaryPreferred",secondary:"secondary",secondaryPreferred:"secondaryPreferred",nearest:"nearest"});class P1{constructor(F,A,D){if(!P1.isValid(F))throw new C9.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(F)}`);if(D==null&&typeof A==="object"&&!Array.isArray(A))D=A,A=void 0;else if(A&&!Array.isArray(A))throw new C9.MongoInvalidArgumentError("ReadPreference tags must be an array");if(this.mode=F,this.tags=A,this.hedge=D?.hedge,this.maxStalenessSeconds=void 0,this.minWireVersion=void 0,D=D??{},D.maxStalenessSeconds!=null){if(D.maxStalenessSeconds<=0)throw new C9.MongoInvalidArgumentError("maxStalenessSeconds must be a positive integer");this.maxStalenessSeconds=D.maxStalenessSeconds,this.minWireVersion=5}if(this.mode===P1.PRIMARY){if(this.tags&&Array.isArray(this.tags)&&this.tags.length>0)throw new C9.MongoInvalidArgumentError("Primary read preference cannot be combined with tags");if(this.maxStalenessSeconds)throw new C9.MongoInvalidArgumentError("Primary read preference cannot be combined with maxStalenessSeconds");if(this.hedge)throw new C9.MongoInvalidArgumentError("Primary read preference cannot be combined with hedge")}}get preference(){return this.mode}static fromString(F){return new P1(F)}static fromOptions(F){if(!F)return;let A=F.readPreference??F.session?.transaction.options.readPreference,D=F.readPreferenceTags;if(A==null)return;if(typeof A==="string")return new P1(A,D,{maxStalenessSeconds:F.maxStalenessSeconds,hedge:F.hedge});else if(!(A instanceof P1)&&typeof A==="object"){let Z=A.mode||A.preference;if(Z&&typeof Z==="string")return new P1(Z,A.tags??D,{maxStalenessSeconds:A.maxStalenessSeconds,hedge:F.hedge})}if(D)A.tags=D;return A}static translate(F){if(F.readPreference==null)return F;let A=F.readPreference;if(typeof A==="string")F.readPreference=new P1(A);else if(A&&!(A instanceof P1)&&typeof A==="object"){let D=A.mode||A.preference;if(D&&typeof D==="string")F.readPreference=new P1(D,A.tags,{maxStalenessSeconds:A.maxStalenessSeconds})}else if(!(A instanceof P1))throw new C9.MongoInvalidArgumentError(`Invalid read preference: ${A}`);return F}static isValid(F){return new Set([P1.PRIMARY,P1.PRIMARY_PREFERRED,P1.SECONDARY,P1.SECONDARY_PREFERRED,P1.NEAREST,null]).has(F)}isValid(F){return P1.isValid(typeof F==="string"?F:this.mode)}secondaryOk(){return new Set([P1.PRIMARY_PREFERRED,P1.SECONDARY,P1.SECONDARY_PREFERRED,P1.NEAREST]).has(this.mode)}equals(F){return F.mode===this.mode}toJSON(){let F={mode:this.mode};if(Array.isArray(this.tags))F.tags=this.tags;if(this.maxStalenessSeconds)F.maxStalenessSeconds=this.maxStalenessSeconds;if(this.hedge)F.hedge=this.hedge;return F}}lz.ReadPreference=P1;P1.PRIMARY=lz.ReadPreferenceMode.primary;P1.PRIMARY_PREFERRED=lz.ReadPreferenceMode.primaryPreferred;P1.SECONDARY=lz.ReadPreferenceMode.secondary;P1.SECONDARY_PREFERRED=lz.ReadPreferenceMode.secondaryPreferred;P1.NEAREST=lz.ReadPreferenceMode.nearest;P1.primary=new P1(lz.ReadPreferenceMode.primary);P1.primaryPreferred=new P1(lz.ReadPreferenceMode.primaryPreferred);P1.secondary=new P1(lz.ReadPreferenceMode.secondary);P1.secondaryPreferred=new P1(lz.ReadPreferenceMode.secondaryPreferred);P1.nearest=new P1(lz.ReadPreferenceMode.nearest)});var $6=E((iz)=>{Object.defineProperty(iz,"__esModule",{value:!0});iz.ServerType=iz.TopologyType=iz.STATE_CONNECTED=iz.STATE_CONNECTING=iz.STATE_CLOSED=iz.STATE_CLOSING=void 0;iz._advanceClusterTime=Fs;iz.STATE_CLOSING="closing";iz.STATE_CLOSED="closed";iz.STATE_CONNECTING="connecting";iz.STATE_CONNECTED="connected";iz.TopologyType=Object.freeze({Single:"Single",ReplicaSetNoPrimary:"ReplicaSetNoPrimary",ReplicaSetWithPrimary:"ReplicaSetWithPrimary",Sharded:"Sharded",Unknown:"Unknown",LoadBalanced:"LoadBalanced"});iz.ServerType=Object.freeze({Standalone:"Standalone",Mongos:"Mongos",PossiblePrimary:"PossiblePrimary",RSPrimary:"RSPrimary",RSSecondary:"RSSecondary",RSArbiter:"RSArbiter",RSOther:"RSOther",RSGhost:"RSGhost",Unknown:"Unknown",LoadBalancer:"LoadBalancer"});function Fs(F,A){if(F.clusterTime==null)F.clusterTime=A;else if(A.clusterTime.greaterThan(F.clusterTime.clusterTime))F.clusterTime=A}});var rz=E((nz)=>{Object.defineProperty(nz,"__esModule",{value:!0});nz.OnDemandDocument=void 0;var L1=k1();class nA{constructor(F,A=0,D=!1,Z){this.bson=F,this.offset=A,this.isArray=D,this.cache=Object.create(null),this.indexFound=Object.create(null),this.elements=Z??L1.parseToElementsToArray(this.bson,A)}isElementName(F,A){let D=A[2],Z=A[1];if(F.length!==D)return!1;let J=Z+D;for(let X=Z,$=0;$<F.length&&X<J;$++,X++)if(this.bson[X]!==F.charCodeAt($))return!1;return!0}getElement(F){let A=this.cache[F];if(A===!1)return null;if(A!=null)return A;if(typeof F==="number")if(this.isArray)if(F<this.elements.length){let Z={element:this.elements[F],value:void 0};return this.cache[F]=Z,this.indexFound[F]=!0,Z}else return null;else return null;for(let D=0;D<this.elements.length;D++){let Z=this.elements[D];if(!(D in this.indexFound)&&this.isElementName(F,Z)){let J={element:Z,value:void 0};return this.cache[F]=J,this.indexFound[D]=!0,J}}return this.cache[F]=!1,null}toJSValue(F,A){let D=F[0],Z=F[3],J=F[4];if(A!==D)return null;switch(A){case L1.BSONType.null:case L1.BSONType.undefined:return null;case L1.BSONType.double:return L1.getFloat64LE(this.bson,Z);case L1.BSONType.int:return L1.getInt32LE(this.bson,Z);case L1.BSONType.long:return L1.getBigInt64LE(this.bson,Z);case L1.BSONType.bool:return Boolean(this.bson[Z]);case L1.BSONType.objectId:return new L1.ObjectId(this.bson.subarray(Z,Z+12));case L1.BSONType.timestamp:return new L1.Timestamp(L1.getBigInt64LE(this.bson,Z));case L1.BSONType.string:return L1.toUTF8(this.bson,Z+4,Z+J-1,!1);case L1.BSONType.binData:{let X=L1.getInt32LE(this.bson,Z),$=this.bson[Z+4];if($===2){let G=L1.getInt32LE(this.bson,Z+1+4);if(G<0)throw new L1.BSONError("Negative binary type element size found for subtype 0x02");if(G>X-4)throw new L1.BSONError("Binary type with subtype 0x02 contains too long binary size");if(G<X-4)throw new L1.BSONError("Binary type with subtype 0x02 contains too short binary size");return new L1.Binary(this.bson.subarray(Z+1+4+4,Z+1+4+4+G),2)}return new L1.Binary(this.bson.subarray(Z+1+4,Z+1+4+X),$)}case L1.BSONType.date:return new Date(Number(L1.getBigInt64LE(this.bson,Z)));case L1.BSONType.object:return new nA(this.bson,Z);case L1.BSONType.array:return new nA(this.bson,Z,!0);default:throw new L1.BSONError(`Unsupported BSON type: ${A}`)}}size(){return this.elements.length}has(F){let A=this.cache[F];if(A===!1)return!1;if(A!=null)return!0;return this.getElement(F)!=null}get(F,A,D){let Z=this.getElement(F);if(Z==null)if(D===!0)throw new L1.BSONError(`BSON element "${F}" is missing`);else return null;if(Z.value==null){let J=this.toJSValue(Z.element,A);if(J==null)if(D===!0)throw new L1.BSONError(`BSON element "${F}" is missing`);else return null;Z.value=J}return Z.value}getNumber(F,A){let D=this.get(F,L1.BSONType.bool),Z=D==null?null:D?1:0,J=this.get(F,L1.BSONType.long),X=J==null?null:Number(J),$=Z??X??this.get(F,L1.BSONType.int)??this.get(F,L1.BSONType.double);if(A===!0&&$==null)throw new L1.BSONError(`BSON element "${F}" is missing`);return $}toObject(F){return L1.deserialize(this.bson,{...F,index:this.offset,allowObjectSmallerThanBufferSize:!0})}toBytes(){let F=L1.getInt32LE(this.bson,this.offset);return this.bson.subarray(this.offset,this.offset+F)}}nz.OnDemandDocument=nA});var t6=E((AV)=>{Object.defineProperty(AV,"__esModule",{value:!0});AV.ClientBulkWriteCursorResponse=AV.ExplainedCursorResponse=AV.CursorResponse=AV.MongoDBResponse=void 0;AV.isErrorResponse=oz;var N1=k1(),Q9=n(),tz=e(),Ys=rz();function oz(F,A){for(let D=0;D<A.length;D++){let Z=A[D];if(Z[2]===2){let J=Z[1];if(F[J]===111&&F[J+1]===107){let X=Z[3],$=Z[4];for(let G=X;G<X+$;G++)if(F[G]!==0)return!1;return!0}}}return!0}class K9 extends Ys.OnDemandDocument{get(F,A,D){try{return super.get(F,A,D)}catch(Z){throw new Q9.MongoUnexpectedServerResponseError(Z.message,{cause:Z})}}static is(F){return F instanceof K9}static make(F){let A=N1.parseToElementsToArray(F,0);return oz(F,A)?new K9(F,0,!1,A):new this(F,0,!1,A)}get isMaxTimeExpiredError(){if(this.ok===0&&this.code===Q9.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;if(this.ok===0)return!1;if(this.get("writeConcernError",N1.BSONType.object)?.getNumber("code")===Q9.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;let D=this.get("writeErrors",N1.BSONType.array);if(D?.size()){for(let Z=0;Z<D.size();Z++)if(D.get(Z,N1.BSONType.object)?.getNumber("code")===Q9.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0}return!1}get recoveryToken(){return this.get("recoveryToken",N1.BSONType.object)?.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}})??null}get atClusterTime(){return this.get("cursor",N1.BSONType.object)?.get("atClusterTime",N1.BSONType.timestamp)??this.get("atClusterTime",N1.BSONType.timestamp)}get operationTime(){return this.get("operationTime",N1.BSONType.timestamp)}get ok(){return this.getNumber("ok")?1:0}get $err(){return this.get("$err",N1.BSONType.string)}get errmsg(){return this.get("errmsg",N1.BSONType.string)}get code(){return this.getNumber("code")}get $clusterTime(){if(!("clusterTime"in this)){let F=this.get("$clusterTime",N1.BSONType.object);if(F==null)return this.clusterTime=null,null;let A=F.get("clusterTime",N1.BSONType.timestamp,!0),D=F.get("signature",N1.BSONType.object)?.toObject();this.clusterTime={clusterTime:A,signature:D}}return this.clusterTime??null}toObject(F){let A={...N1.pluckBSONSerializeOptions(F??{}),validation:N1.parseUtf8ValidationOption(F)};return super.toObject(A)}}AV.MongoDBResponse=K9;K9.empty=new K9(new Uint8Array([13,0,0,0,16,111,107,0,1,0,0,0,0]));class E9 extends K9{constructor(){super(...arguments);this._batch=null,this.iterated=0,this._encryptedBatch=null}static is(F){return F instanceof E9||F===E9.emptyGetMore}get cursor(){return this.get("cursor",N1.BSONType.object,!0)}get id(){try{return N1.Long.fromBigInt(this.cursor.get("id",N1.BSONType.long,!0))}catch(F){throw new Q9.MongoUnexpectedServerResponseError(F.message,{cause:F})}}get ns(){let F=this.cursor.get("ns",N1.BSONType.string);if(F!=null)return tz.ns(F);return null}get length(){return Math.max(this.batchSize-this.iterated,0)}get encryptedBatch(){if(this.encryptedResponse==null)return null;if(this._encryptedBatch!=null)return this._encryptedBatch;let F=this.encryptedResponse?.get("cursor",N1.BSONType.object);if(F?.has("firstBatch"))this._encryptedBatch=F.get("firstBatch",N1.BSONType.array,!0);else if(F?.has("nextBatch"))this._encryptedBatch=F.get("nextBatch",N1.BSONType.array,!0);else throw new Q9.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._encryptedBatch}get batch(){if(this._batch!=null)return this._batch;let F=this.cursor;if(F.has("firstBatch"))this._batch=F.get("firstBatch",N1.BSONType.array,!0);else if(F.has("nextBatch"))this._batch=F.get("nextBatch",N1.BSONType.array,!0);else throw new Q9.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._batch}get batchSize(){return this.batch?.size()}get postBatchResumeToken(){return this.cursor.get("postBatchResumeToken",N1.BSONType.object)?.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}})??null}shift(F){if(this.iterated>=this.batchSize)return null;let A=this.batch.get(this.iterated,N1.BSONType.object,!0)??null,D=this.encryptedBatch?.get(this.iterated,N1.BSONType.object,!0)??null;if(this.iterated+=1,F?.raw)return A.toBytes();else{let Z=A.toObject(F);if(D)tz.decorateDecryptionResult(Z,D.toObject(F),!0);return Z}}clear(){this.iterated=this.batchSize}}AV.CursorResponse=E9;E9.emptyGetMore={id:new N1.Long(0),length:0,shift:()=>null};class ez extends E9{constructor(){super(...arguments);this.isExplain=!0,this._length=1}get id(){return N1.Long.fromBigInt(0n)}get batchSize(){return 0}get ns(){return null}get length(){return this._length}shift(F){if(this._length===0)return null;return this._length-=1,this.toObject(F)}}AV.ExplainedCursorResponse=ez;class FV extends E9{get insertedCount(){return this.get("nInserted",N1.BSONType.int,!0)}get upsertedCount(){return this.get("nUpserted",N1.BSONType.int,!0)}get matchedCount(){return this.get("nMatched",N1.BSONType.int,!0)}get modifiedCount(){return this.get("nModified",N1.BSONType.int,!0)}get deletedCount(){return this.get("nDeleted",N1.BSONType.int,!0)}get writeConcernError(){return this.get("writeConcernError",N1.BSONType.object,!1)}}AV.ClientBulkWriteCursorResponse=FV});var Y2=E((JV)=>{Object.defineProperty(JV,"__esModule",{value:!0});JV.WriteConcern=JV.WRITE_CONCERN_KEYS=void 0;JV.throwIfWriteConcernError=Cs;var ZV=t6(),Ws=n();JV.WRITE_CONCERN_KEYS=["w","wtimeout","j","journal","fsync"];class U5{constructor(F,A,D,Z){if(F!=null)if(!Number.isNaN(Number(F)))this.w=Number(F);else this.w=F;if(A!=null)this.wtimeoutMS=this.wtimeout=A;if(D!=null)this.journal=this.j=D;if(Z!=null)this.journal=this.j=Z?!0:!1}static apply(F,A){let D={};if(A.w!=null)D.w=A.w;if(A.wtimeoutMS!=null)D.wtimeout=A.wtimeoutMS;if(A.journal!=null)D.j=A.j;return F.writeConcern=D,F}static fromOptions(F,A){if(F==null)return;A=A??{};let D;if(typeof F==="string"||typeof F==="number")D={w:F};else if(F instanceof U5)D=F;else D=F.writeConcern;let Z=A instanceof U5?A:A.writeConcern,{w:J=void 0,wtimeout:X=void 0,j:$=void 0,fsync:G=void 0,journal:Y=void 0,wtimeoutMS:B=void 0}={...Z,...D};if(J!=null||X!=null||B!=null||$!=null||Y!=null||G!=null)return new U5(J,X??B,$??Y,G);return}}JV.WriteConcern=U5;function Cs(F){if(typeof F==="object"&&F!=null){let A=ZV.MongoDBResponse.is(F)&&F.has("writeConcernError")?F.toObject():!ZV.MongoDBResponse.is(F)&&("writeConcernError"in F)?F:null;if(A!=null)throw new Ws.MongoWriteConcernError(A)}}});var e=E((zV)=>{Object.defineProperty(zV,"__esModule",{value:!0});zV.kDispose=zV.randomBytes=zV.COSMOS_DB_MSG=zV.DOCUMENT_DB_MSG=zV.COSMOS_DB_CHECK=zV.DOCUMENT_DB_CHECK=zV.MONGODB_WARNING_CODE=zV.DEFAULT_PK_FACTORY=zV.HostAddress=zV.BufferPool=zV.List=zV.MongoDBCollectionNamespace=zV.MongoDBNamespace=zV.ByteUtils=void 0;zV.isUint8Array=Is;zV.hostMatchesWildcards=Ms;zV.normalizeHintField=Ns;zV.isObject=d$;zV.mergeOptions=Ts;zV.filterOptions=ks;zV.applyRetryableWrites=Os;zV.isPromiseLike=Ss;zV.decorateWithCollation=_s;zV.decorateWithReadConcern=us;zV.getTopology=HV;zV.ns=xs;zV.makeCounter=gs;zV.uuidV4=fs;zV.maxWireVersion=ys;zV.arrayStrictEqual=bs;zV.errorStrictEqual=hs;zV.makeStateMachine=vs;zV.now=qV;zV.calculateDurationInMs=ms;zV.hasAtomicOperators=WV;zV.resolveTimeoutOptions=ds;zV.resolveOptions=cs;zV.isSuperset=CV;zV.isHello=ls;zV.setDifference=ps;zV.isRecord=as;zV.emitWarning=KV;zV.emitWarningOnce=ns;zV.enumToString=ss;zV.supportsRetryableWrites=ts;zV.shuffle=os;zV.commandSupportsReadConcern=es;zV.compareObjectId=Fr;zV.parseInteger=EV;zV.parseUnsignedInteger=Ar;zV.checkParentDomainMatch=Dr;zV.get=Zr;zV.request=Jr;zV.isHostMatch=Xr;zV.promiseWithResolvers=i$;zV.squashError=$r;zV.once=Yr;zV.maybeAddIdToDocuments=Gr;zV.fileIsAccessible=Br;zV.csotMin=Hr;zV.noop=qr;zV.decorateDecryptionResult=UV;zV.addAbortListener=a$;zV.abortable=Wr;var GV=i("node:crypto"),Es=i("node:fs"),BV=i("node:http"),m$=i("node:timers"),Us=i("node:url"),zs=i("node:url"),Vs=i("node:util"),c$=k1(),Ls=W9(),sA=N0(),T2=n(),Rs=M6(),ws=y0(),Ps=$6(),$V=Y2();zV.ByteUtils={toLocalBufferType(F){return Buffer.isBuffer(F)?F:Buffer.from(F.buffer,F.byteOffset,F.byteLength)},equals(F,A){return zV.ByteUtils.toLocalBufferType(F).equals(A)},compare(F,A){return zV.ByteUtils.toLocalBufferType(F).compare(A)},toBase64(F){return zV.ByteUtils.toLocalBufferType(F).toString("base64")}};function Is(F){return F!=null&&typeof F==="object"&&Symbol.toStringTag in F&&F[Symbol.toStringTag]==="Uint8Array"}function Ms(F,A){for(let D of A)if(F===D||D.startsWith("*.")&&F?.endsWith(D.substring(2,D.length))||D.startsWith("*/")&&F?.endsWith(D.substring(2,D.length)))return!0;return!1}function Ns(F){let A=void 0;if(typeof F==="string")A=F;else if(Array.isArray(F))A={},F.forEach((D)=>{A[D]=1});else if(F!=null&&typeof F==="object"){A={};for(let D in F)A[D]=F[D]}return A}var js=(F)=>Object.prototype.toString.call(F);function d$(F){return js(F)==="[object Object]"}function Ts(F,A){return{...F,...A}}function ks(F,A){let D={};for(let Z in F)if(A.includes(Z))D[Z]=F[Z];return D}function Os(F,A){if(A&&A.s.options?.retryWrites)F.retryWrites=!0;return F}function Ss(F){return F!=null&&typeof F==="object"&&"then"in F&&typeof F.then==="function"}function _s(F,A,D){let Z=HV(A).capabilities;if(D.collation&&typeof D.collation==="object")if(Z&&Z.commandsTakeCollation)F.collation=D.collation;else throw new T2.MongoCompatibilityError("Current topology does not support collation")}function us(F,A,D){if(D&&D.session&&D.session.inTransaction())return;let Z=Object.assign({},F.readConcern||{});if(A.s.readConcern)Object.assign(Z,A.s.readConcern);if(Object.keys(Z).length>0)Object.assign(F,{readConcern:Z})}function HV(F){if("topology"in F&&F.topology)return F.topology;else if("client"in F&&F.client.topology)return F.client.topology;throw new T2.MongoNotConnectedError("MongoClient must be connected to perform this operation")}function xs(F){return L5.fromString(F)}class L5{constructor(F,A){this.db=F,this.collection=A,this.collection=A===""?void 0:A}toString(){return this.collection?`${this.db}.${this.collection}`:this.db}withCollection(F){return new l$(this.db,F)}static fromString(F){if(typeof F!=="string"||F==="")throw new T2.MongoRuntimeError(`Cannot parse namespace from "${F}"`);let[A,...D]=F.split("."),Z=D.join(".");return new L5(A,Z===""?void 0:Z)}}zV.MongoDBNamespace=L5;class l$ extends L5{constructor(F,A){super(F,A);this.collection=A}static fromString(F){return super.fromString(F)}}zV.MongoDBCollectionNamespace=l$;function*gs(F=0){let A=F;while(!0){let D=A;A+=1,yield D}}function fs(){let F=GV.randomBytes(16);return F[6]=F[6]&15|64,F[8]=F[8]&63|128,F}function ys(F){if(F){if(F.loadBalanced||F.serverApi?.version)return Ls.MAX_SUPPORTED_WIRE_VERSION;if(F.hello)return F.hello.maxWireVersion;if("lastHello"in F&&typeof F.lastHello==="function"){let A=F.lastHello();if(A)return A.maxWireVersion}if(F.description&&"maxWireVersion"in F.description&&F.description.maxWireVersion!=null)return F.description.maxWireVersion}return 0}function bs(F,A){if(!Array.isArray(F)||!Array.isArray(A))return!1;return F.length===A.length&&F.every((D,Z)=>D===A[Z])}function hs(F,A){if(F===A)return!0;if(!F||!A)return F===A;if(F==null&&A!=null||F!=null&&A==null)return!1;if(F.constructor.name!==A.constructor.name)return!1;if(F.message!==A.message)return!1;return!0}function vs(F){return function A(D,Z){let J=F[D.s.state];if(J&&J.indexOf(Z)<0)throw new T2.MongoRuntimeError(`illegal state transition from [${D.s.state}] => [${Z}], allowed: [${J}]`);D.emit("stateChanged",D.s.state,Z),D.s.state=Z}}function qV(){let F=process.hrtime();return Math.floor(F[0]*1000+F[1]/1e6)}function ms(F){if(typeof F!=="number")return-1;let A=qV()-F;return A<0?0:A}function WV(F){if(Array.isArray(F)){for(let D of F)if(WV(D))return!0;return!1}let A=Object.keys(F);return A.length>0&&A[0][0]==="$"}function ds(F,A){let{socketTimeoutMS:D,serverSelectionTimeoutMS:Z,waitQueueTimeoutMS:J,timeoutMS:X}=F.s.options;return{socketTimeoutMS:D,serverSelectionTimeoutMS:Z,waitQueueTimeoutMS:J,timeoutMS:X,...A}}function cs(F,A){let D=Object.assign({},A,c$.resolveBSONOptions(A,F)),Z=A?.timeoutMS??F?.timeoutMS,J=A?.session;if(!J?.inTransaction()){let G=Rs.ReadConcern.fromOptions(A)??F?.readConcern;if(G)D.readConcern=G;let Y=$V.WriteConcern.fromOptions(A)??F?.writeConcern;if(Y){if(Z!=null)Y=$V.WriteConcern.fromOptions({writeConcern:{...Y,wtimeout:void 0,wtimeoutMS:void 0}});D.writeConcern=Y}}D.timeoutMS=Z;let X=ws.ReadPreference.fromOptions(A)??F?.readPreference;if(X)D.readPreference=X;if(J?.explicit&&J?.timeoutContext!=null&&A?.timeoutMS!=null)throw new T2.MongoInvalidArgumentError("An operation cannot be given a timeoutMS setting when inside a withTransaction call that has a timeoutMS setting");return D}function CV(F,A){F=Array.isArray(F)?new Set(F):F,A=Array.isArray(A)?new Set(A):A;for(let D of A)if(!F.has(D))return!1;return!0}function ls(F){return F[sA.LEGACY_HELLO_COMMAND]||F.hello?!0:!1}function ps(F,A){let D=new Set(F);for(let Z of A)D.delete(Z);return D}var is=(F,A)=>Object.prototype.hasOwnProperty.call(F,A);function as(F,A=void 0){if(!d$(F))return!1;let D=F.constructor;if(D&&D.prototype){if(!d$(D.prototype))return!1;if(!is(D.prototype,"isPrototypeOf"))return!1}if(A){let Z=Object.keys(F);return CV(Z,A)}return!0}class p${get length(){return this.count}get[Symbol.toStringTag](){return"List"}constructor(){this.count=0,this.head={next:null,prev:null,value:null},this.head.next=this.head,this.head.prev=this.head}toArray(){return Array.from(this)}toString(){return`head <=> ${this.toArray().join(" <=> ")} <=> head`}*[Symbol.iterator](){for(let F of this.nodes())yield F.value}*nodes(){let F=this.head.next;while(F!==this.head){let{next:A}=F;yield F,F=A}}push(F){this.count+=1;let A={next:this.head,prev:this.head.prev,value:F};this.head.prev.next=A,this.head.prev=A}pushMany(F){for(let A of F)this.push(A)}unshift(F){this.count+=1;let A={next:this.head.next,prev:this.head,value:F};this.head.next.prev=A,this.head.next=A}remove(F){if(F===this.head||this.length===0)return null;this.count-=1;let{prev:A,next:D}=F;return A.next=D,D.prev=A,F.value}shift(){return this.remove(this.head.next)}pop(){return this.remove(this.head.prev)}prune(F){for(let A of this.nodes())if(F(A.value))this.remove(A)}clear(){this.count=0,this.head.next=this.head,this.head.prev=this.head}first(){return this.head.next.value}last(){return this.head.prev.value}}zV.List=p$;class QV{constructor(){this.buffers=new p$,this.totalByteLength=0}get length(){return this.totalByteLength}append(F){this.buffers.push(F),this.totalByteLength+=F.length}getInt32(){if(this.totalByteLength<4)return null;let F=this.buffers.first();if(F!=null&&F.byteLength>=4)return F.readInt32LE(0);let A=this.read(4),D=A.readInt32LE(0);return this.totalByteLength+=4,this.buffers.unshift(A),D}read(F){if(typeof F!=="number"||F<0)throw new T2.MongoInvalidArgumentError('Argument "size" must be a non-negative number');if(F>this.totalByteLength)return Buffer.alloc(0);let A=Buffer.allocUnsafe(F);for(let D=0;D<F;){let Z=this.buffers.shift();if(Z==null)break;let J=F-D,X=Math.min(J,Z.byteLength),$=Z.subarray(0,X);if(A.set($,D),D+=X,this.totalByteLength-=X,X<Z.byteLength)this.buffers.unshift(Z.subarray(X))}return A}}zV.BufferPool=QV;class V5{constructor(F){this.host=void 0,this.port=void 0,this.socketPath=void 0,this.isIPv6=!1;let A=F.split(" ").join("%20");if(A.endsWith(".sock")){this.socketPath=decodeURIComponent(A);return}let D=`iLoveJS://${A}`,Z;try{Z=new zs.URL(D)}catch(G){let Y=new T2.MongoRuntimeError(`Unable to parse ${A} with URL`);throw Y.cause=G,Y}let{hostname:J,port:X}=Z,$=decodeURIComponent(J).toLowerCase();if($.startsWith("[")&&$.endsWith("]"))this.isIPv6=!0,$=$.substring(1,J.length-1);if(this.host=$.toLowerCase(),typeof X==="number")this.port=X;else if(typeof X==="string"&&X!=="")this.port=Number.parseInt(X,10);else this.port=27017;if(this.port===0)throw new T2.MongoParseError("Invalid port (zero) with hostname");Object.freeze(this)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new HostAddress('${this.toString()}')`}toString(){if(typeof this.host==="string"){if(this.isIPv6)return`[${this.host}]:${this.port}`;return`${this.host}:${this.port}`}return`${this.socketPath}`}static fromString(F){return new V5(F)}static fromHostPort(F,A){if(F.includes(":"))F=`[${F}]`;return V5.fromString(`${F}:${A}`)}static fromSrvRecord({name:F,port:A}){return V5.fromHostPort(F,A)}toHostPort(){if(this.socketPath)return{host:this.socketPath,port:0};let F=this.host??"",A=this.port??0;return{host:F,port:A}}}zV.HostAddress=V5;zV.DEFAULT_PK_FACTORY={createPk(){return new c$.ObjectId}};zV.MONGODB_WARNING_CODE="MONGODB DRIVER";function KV(F){return process.emitWarning(F,{code:zV.MONGODB_WARNING_CODE})}var YV=new Set;function ns(F){if(!YV.has(F))return YV.add(F),KV(F)}function ss(F){return Object.values(F).join(", ")}function ts(F){if(!F)return!1;if(F.loadBalanced)return!0;if(F.description.logicalSessionTimeoutMinutes!=null){if(F.description.type!==Ps.ServerType.Standalone)return!0}return!1}function os(F,A=0){let D=Array.from(F);if(A>D.length)throw new T2.MongoRuntimeError("Limit must be less than the number of items");let Z=D.length,J=A%D.length===0?1:D.length-A;while(Z>J){let X=Math.floor(Math.random()*Z);Z-=1;let $=D[Z];D[Z]=D[X],D[X]=$}return A%D.length===0?D:D.slice(J)}function es(F){if(F.aggregate||F.count||F.distinct||F.find||F.geoNear)return!0;return!1}function Fr(F,A){if(F==null&&A==null)return 0;if(F==null)return-1;if(A==null)return 1;return zV.ByteUtils.compare(F.id,A.id)}function EV(F){if(typeof F==="number")return Math.trunc(F);let A=Number.parseInt(String(F),10);return Number.isNaN(A)?null:A}function Ar(F){let A=EV(F);return A!=null&&A>=0?A:null}function Dr(F,A){let D=F.endsWith(".")?F.slice(0,F.length-1):F,Z=A.endsWith(".")?A.slice(0,A.length-1):A,J=/^.*?\./,X=Z.split(".").length<3,$=`.${D.replace(J,"")}`,G=X?Z:`.${Z.replace(J,"")}`;if(!G.startsWith("."))G="."+G;if(X&&D.split(".").length<=Z.split(".").length)throw new T2.MongoAPIError("Server record does not have at least one more domain level than parent URI");if(!$.endsWith(G))throw new T2.MongoAPIError("Server record does not share hostname with parent URI")}function Zr(F,A={}){return new Promise((D,Z)=>{let J,X=BV.get(F,A,($)=>{$.setEncoding("utf8");let G="";$.on("data",(Y)=>G+=Y),$.on("end",()=>{m$.clearTimeout(J),D({status:$.statusCode,body:G})})}).on("error",($)=>{m$.clearTimeout(J),Z($)}).end();J=m$.setTimeout(()=>{X.destroy(new T2.MongoNetworkTimeoutError("request timed out after 10 seconds"))},1e4)})}async function Jr(F,A={}){return await new Promise((D,Z)=>{let J={method:"GET",timeout:1e4,json:!0,...Us.parse(F),...A},X=BV.request(J,($)=>{$.setEncoding("utf8");let G="";$.on("data",(Y)=>{G+=Y}),$.once("end",()=>{if(A.json===!1){D(G);return}try{let Y=JSON.parse(G);D(Y)}catch{Z(new T2.MongoRuntimeError(`Invalid JSON response: "${G}"`))}})});X.once("timeout",()=>X.destroy(new T2.MongoNetworkTimeoutError(`Network request to ${F} timed out after ${A.timeout} ms`))),X.once("error",($)=>Z($)),X.end()})}zV.DOCUMENT_DB_CHECK=/(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/;zV.COSMOS_DB_CHECK=/\.cosmos\.azure\.com$/;zV.DOCUMENT_DB_MSG="You appear to be connected to a DocumentDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/documentdb";zV.COSMOS_DB_MSG="You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb";function Xr(F,A){return A&&F.test(A.toLowerCase())?!0:!1}function i$(){let F,A;return{promise:new Promise(function Z(J,X){F=J,A=X}),resolve:F,reject:A}}function $r(F){return}zV.randomBytes=Vs.promisify(GV.randomBytes);async function Yr(F,A,D){D?.signal?.throwIfAborted();let{promise:Z,resolve:J,reject:X}=i$(),$=(B)=>J(B),G=(B)=>X(B),Y=a$(D?.signal,function(){X(this.reason)});F.once(A,$).once("error",G);try{return await Z}finally{F.off(A,$),F.off("error",G),Y?.[zV.kDispose]()}}function Gr(F,A,D){if((typeof D.forceServerObjectId==="boolean"?D.forceServerObjectId:F.s.db.options?.forceServerObjectId)===!0)return A;let J=(X)=>{if(X._id==null)X._id=F.s.pkFactory.createPk();return X};return Array.isArray(A)?A.map(J):J(A)}async function Br(F,A){try{return await Es.promises.access(F,A),!0}catch{return!1}}function Hr(F,A){if(F===0)return A;if(A===0)return F;return Math.min(F,A)}function qr(){return}function UV(F,A,D=!0){if(D){if(Buffer.isBuffer(A))A=c$.deserialize(A);if(Buffer.isBuffer(F))throw new T2.MongoRuntimeError("Expected result of decryption to be deserialized BSON object")}if(!F||typeof F!=="object")return;for(let Z of Object.keys(F)){let J=A[Z];if(J&&J._bsontype==="Binary"&&J.sub_type===6){if(!F[sA.kDecoratedKeys])Object.defineProperty(F,sA.kDecoratedKeys,{value:[],configurable:!0,enumerable:!1,writable:!1});F[sA.kDecoratedKeys].push(Z);continue}UV(F[Z],J,!1)}}zV.kDispose=Symbol.dispose??Symbol("dispose");function a$(F,A){if(F==null)return;return F.addEventListener("abort",A,{once:!0}),{[zV.kDispose]:()=>F.removeEventListener("abort",A)}}async function Wr(F,{signal:A}){if(A==null)return await F;let{promise:D,reject:Z}=i$(),J=A.aborted?Z(A.reason):a$(A,function(){Z(this.reason)});try{return await Promise.race([F,D])}finally{J?.[zV.kDispose]()}}});var R4=E((MV)=>{Object.defineProperty(MV,"__esModule",{value:!0});MV.MongoLogger=MV.MongoLoggableComponent=MV.SEVERITY_LEVEL_MAP=MV.DEFAULT_MAX_DOCUMENT_LENGTH=MV.SeverityLevel=void 0;MV.parseSeverityFromString=r$;MV.createStdioLogger=U9;MV.stringifyWithMaxLen=L4;MV.defaultLogTransform=PV;var LV=i("node:util"),RV=k1(),e1=N0(),z9=e();MV.SeverityLevel=Object.freeze({EMERGENCY:"emergency",ALERT:"alert",CRITICAL:"critical",ERROR:"error",WARNING:"warn",NOTICE:"notice",INFORMATIONAL:"info",DEBUG:"debug",TRACE:"trace",OFF:"off"});MV.DEFAULT_MAX_DOCUMENT_LENGTH=1000;class wV extends Map{constructor(F){let A=[];for(let[D,Z]of F)A.push([Z,D]);A.push(...F);super(A)}getNumericSeverityLevel(F){return this.get(F)}getSeverityLevelName(F){return this.get(F)}}MV.SEVERITY_LEVEL_MAP=new wV([[MV.SeverityLevel.OFF,-1/0],[MV.SeverityLevel.EMERGENCY,0],[MV.SeverityLevel.ALERT,1],[MV.SeverityLevel.CRITICAL,2],[MV.SeverityLevel.ERROR,3],[MV.SeverityLevel.WARNING,4],[MV.SeverityLevel.NOTICE,5],[MV.SeverityLevel.INFORMATIONAL,6],[MV.SeverityLevel.DEBUG,7],[MV.SeverityLevel.TRACE,8]]);MV.MongoLoggableComponent=Object.freeze({COMMAND:"command",TOPOLOGY:"topology",SERVER_SELECTION:"serverSelection",CONNECTION:"connection",CLIENT:"client"});function r$(F){let A=Object.values(MV.SeverityLevel),D=F?.toLowerCase();if(D!=null&&A.includes(D))return D;return null}function U9(F){return{write:LV.promisify((A,D)=>{let Z=LV.inspect(A,{compact:!0,breakLength:1/0});F.write(`${Z}
9
+ `,"utf-8",D);return})}}function Lt({MONGODB_LOG_PATH:F},{mongodbLogPath:A}){if(typeof A==="string"&&/^stderr$/i.test(A))return{mongodbLogPath:U9(process.stderr),mongodbLogPathIsStdErr:!0};if(typeof A==="string"&&/^stdout$/i.test(A))return{mongodbLogPath:U9(process.stdout),mongodbLogPathIsStdErr:!1};if(typeof A==="object"&&typeof A?.write==="function")return{mongodbLogPath:A,mongodbLogPathIsStdErr:!1};if(F&&/^stderr$/i.test(F))return{mongodbLogPath:U9(process.stderr),mongodbLogPathIsStdErr:!0};if(F&&/^stdout$/i.test(F))return{mongodbLogPath:U9(process.stdout),mongodbLogPathIsStdErr:!1};return{mongodbLogPath:U9(process.stderr),mongodbLogPathIsStdErr:!0}}function P7(F,A,D){return r$(F)??r$(A)??D}function Rt(F,A){let D=MV.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(F),Z=MV.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(A);return D<Z?-1:D>Z?1:0}function L4(F,A,D={}){let Z="",J=0,X=function $(G,Y){if(J>=A)return;if(G==="")return J+=1,Y;if(J+=G.length+4,Y==null)return Y;switch(typeof Y){case"string":J+=Y.length+2;break;case"number":case"bigint":J+=String(Y).length;break;case"boolean":J+=Y?4:5;break;case"object":if(z9.isUint8Array(Y))J+=22+Y.byteLength+Y.byteLength*0.33+18|0;else if("_bsontype"in Y){let B=Y;switch(B._bsontype){case"Int32":J+=String(B.value).length;break;case"Double":J+=(B.value|0)===B.value?String(B.value).length+2:String(B.value).length;break;case"Long":J+=B.toString().length;break;case"ObjectId":J+=35;break;case"MaxKey":case"MinKey":J+=13;break;case"Binary":J+=22+Y.position+Y.position*0.33+18|0;break;case"Timestamp":J+=19+String(B.t).length+5+String(B.i).length+2;break;case"Code":if(B.scope==null)J+=B.code.length+10+2;else J+=B.code.length+10+11;break;case"BSONRegExp":J+=34+B.pattern.length+13+B.options.length+3;break}}}return Y};if(typeof F==="string")Z=F;else if(typeof F==="function")Z=F.name;else try{if(A!==0)Z=RV.EJSON.stringify(F,X,0,D);else Z=RV.EJSON.stringify(F,D)}catch($){Z=`Extended JSON serialization failed with: ${$.message}`}if(A!==0&&Z.length>A&&Z.charCodeAt(A-1)!==Z.codePointAt(A-1)){if(A--,A===0)return""}return A!==0&&Z.length>A?`${Z.slice(0,A)}...`:Z}function wt(F){let A=F;return A.toLog!==void 0&&typeof A.toLog==="function"}function rA(F,A,D=MV.DEFAULT_MAX_DOCUMENT_LENGTH){let{selector:Z,operation:J,topologyDescription:X,message:$}=A;return F.selector=L4(Z,D),F.operation=J,F.topologyDescription=L4(X,D),F.message=$,F}function n$(F,A){F.commandName=A.commandName,F.requestId=A.requestId,F.driverConnectionId=A.connectionId;let{host:D,port:Z}=z9.HostAddress.fromString(A.address).toHostPort();if(F.serverHost=D,F.serverPort=Z,A?.serviceId)F.serviceId=A.serviceId.toHexString();return F.databaseName=A.databaseName,F.serverConnectionId=A.serverConnectionId,F}function Y6(F,A){let{host:D,port:Z}=z9.HostAddress.fromString(A.address).toHostPort();return F.serverHost=D,F.serverPort=Z,F}function V4(F,A){return F.topologyId=A.topologyId,F}function s$(F,A){let{awaited:D,connectionId:Z}=A;F.awaited=D,F.driverConnectionId=A.connectionId;let{host:J,port:X}=z9.HostAddress.fromString(Z).toHostPort();return F.serverHost=J,F.serverPort=X,F}function PV(F,A=MV.DEFAULT_MAX_DOCUMENT_LENGTH){let D=Object.create(null);switch(F.name){case e1.SERVER_SELECTION_STARTED:return D=rA(D,F,A),D;case e1.SERVER_SELECTION_FAILED:return D=rA(D,F,A),D.failure=F.failure?.message,D;case e1.SERVER_SELECTION_SUCCEEDED:return D=rA(D,F,A),D.serverHost=F.serverHost,D.serverPort=F.serverPort,D;case e1.WAITING_FOR_SUITABLE_SERVER:return D=rA(D,F,A),D.remainingTimeMS=F.remainingTimeMS,D;case e1.COMMAND_STARTED:return D=n$(D,F),D.message="Command started",D.command=L4(F.command,A,{relaxed:!0}),D.databaseName=F.databaseName,D;case e1.COMMAND_SUCCEEDED:return D=n$(D,F),D.message="Command succeeded",D.durationMS=F.duration,D.reply=L4(F.reply,A,{relaxed:!0}),D;case e1.COMMAND_FAILED:return D=n$(D,F),D.message="Command failed",D.durationMS=F.duration,D.failure=F.failure?.message??"(redacted)",D;case e1.CONNECTION_POOL_CREATED:if(D=Y6(D,F),D.message="Connection pool created",F.options){let{maxIdleTimeMS:Z,minPoolSize:J,maxPoolSize:X,maxConnecting:$,waitQueueTimeoutMS:G}=F.options;D={...D,maxIdleTimeMS:Z,minPoolSize:J,maxPoolSize:X,maxConnecting:$,waitQueueTimeoutMS:G}}return D;case e1.CONNECTION_POOL_READY:return D=Y6(D,F),D.message="Connection pool ready",D;case e1.CONNECTION_POOL_CLEARED:if(D=Y6(D,F),D.message="Connection pool cleared",F.serviceId?._bsontype==="ObjectId")D.serviceId=F.serviceId?.toHexString();return D;case e1.CONNECTION_POOL_CLOSED:return D=Y6(D,F),D.message="Connection pool closed",D;case e1.CONNECTION_CREATED:return D=Y6(D,F),D.message="Connection created",D.driverConnectionId=F.connectionId,D;case e1.CONNECTION_READY:return D=Y6(D,F),D.message="Connection ready",D.driverConnectionId=F.connectionId,D.durationMS=F.durationMS,D;case e1.CONNECTION_CLOSED:switch(D=Y6(D,F),D.message="Connection closed",D.driverConnectionId=F.connectionId,F.reason){case"stale":D.reason="Connection became stale because the pool was cleared";break;case"idle":D.reason="Connection has been available but unused for longer than the configured max idle time";break;case"error":if(D.reason="An error occurred while using the connection",F.error)D.error=F.error;break;case"poolClosed":D.reason="Connection pool was closed";break;default:D.reason=`Unknown close reason: ${F.reason}`}return D;case e1.CONNECTION_CHECK_OUT_STARTED:return D=Y6(D,F),D.message="Connection checkout started",D;case e1.CONNECTION_CHECK_OUT_FAILED:switch(D=Y6(D,F),D.message="Connection checkout failed",F.reason){case"poolClosed":D.reason="Connection pool was closed";break;case"timeout":D.reason="Wait queue timeout elapsed without a connection becoming available";break;case"connectionError":if(D.reason="An error occurred while trying to establish a new connection",F.error)D.error=F.error;break;default:D.reason=`Unknown close reason: ${F.reason}`}return D.durationMS=F.durationMS,D;case e1.CONNECTION_CHECKED_OUT:return D=Y6(D,F),D.message="Connection checked out",D.driverConnectionId=F.connectionId,D.durationMS=F.durationMS,D;case e1.CONNECTION_CHECKED_IN:return D=Y6(D,F),D.message="Connection checked in",D.driverConnectionId=F.connectionId,D;case e1.SERVER_OPENING:return D=V4(D,F),D=Y6(D,F),D.message="Starting server monitoring",D;case e1.SERVER_CLOSED:return D=V4(D,F),D=Y6(D,F),D.message="Stopped server monitoring",D;case e1.SERVER_HEARTBEAT_STARTED:return D=V4(D,F),D=s$(D,F),D.message="Server heartbeat started",D;case e1.SERVER_HEARTBEAT_SUCCEEDED:return D=V4(D,F),D=s$(D,F),D.message="Server heartbeat succeeded",D.durationMS=F.duration,D.serverConnectionId=F.serverConnectionId,D.reply=L4(F.reply,A,{relaxed:!0}),D;case e1.SERVER_HEARTBEAT_FAILED:return D=V4(D,F),D=s$(D,F),D.message="Server heartbeat failed",D.durationMS=F.duration,D.failure=F.failure?.message,D;case e1.TOPOLOGY_OPENING:return D=V4(D,F),D.message="Starting topology monitoring",D;case e1.TOPOLOGY_CLOSED:return D=V4(D,F),D.message="Stopped topology monitoring",D;case e1.TOPOLOGY_DESCRIPTION_CHANGED:return D=V4(D,F),D.message="Topology description changed",D.previousDescription=D.reply=L4(F.previousDescription,A),D.newDescription=D.reply=L4(F.newDescription,A),D;default:for(let[Z,J]of Object.entries(F))if(J!=null)D[Z]=J}return D}class IV{constructor(F){this.pendingLog=null,this.error=this.log.bind(this,"error"),this.warn=this.log.bind(this,"warn"),this.info=this.log.bind(this,"info"),this.debug=this.log.bind(this,"debug"),this.trace=this.log.bind(this,"trace"),this.componentSeverities=F.componentSeverities,this.maxDocumentLength=F.maxDocumentLength,this.logDestination=F.logDestination,this.logDestinationIsStdErr=F.logDestinationIsStdErr,this.severities=this.createLoggingSeverities()}createLoggingSeverities(){let F=Object();for(let A of Object.values(MV.MongoLoggableComponent)){F[A]={};for(let D of Object.values(MV.SeverityLevel))F[A][D]=Rt(D,this.componentSeverities[A])<=0}return F}turnOffSeverities(){for(let F of Object.values(MV.MongoLoggableComponent)){this.componentSeverities[F]=MV.SeverityLevel.OFF;for(let A of Object.values(MV.SeverityLevel))this.severities[F][A]=!1}}logWriteFailureHandler(F){if(this.logDestinationIsStdErr){this.turnOffSeverities(),this.clearPendingLog();return}this.logDestination=U9(process.stderr),this.logDestinationIsStdErr=!0,this.clearPendingLog(),this.error(MV.MongoLoggableComponent.CLIENT,{toLog:function(){return{message:"User input for mongodbLogPath is now invalid. Logging is halted.",error:F.message}}}),this.turnOffSeverities(),this.clearPendingLog()}clearPendingLog(){this.pendingLog=null}willLog(F,A){if(A===MV.SeverityLevel.OFF)return!1;return this.severities[F][A]}log(F,A,D){if(!this.willLog(A,F))return;let Z={t:new Date,c:A,s:F};if(typeof D==="string")Z.message=D;else if(typeof D==="object")if(wt(D))Z={...Z,...D.toLog()};else Z={...Z,...PV(D,this.maxDocumentLength)};if(z9.isPromiseLike(this.pendingLog)){this.pendingLog=this.pendingLog.then(()=>this.logDestination.write(Z)).then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this));return}try{let J=this.logDestination.write(Z);if(z9.isPromiseLike(J))this.pendingLog=J.then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this))}catch(J){this.logWriteFailureHandler(J)}}static resolveOptions(F,A){let D=Lt(F,A),Z={...F,...A,mongodbLogPath:D.mongodbLogPath,mongodbLogPathIsStdErr:D.mongodbLogPathIsStdErr},J=P7(Z.mongodbLogComponentSeverities?.default,Z.MONGODB_LOG_ALL,MV.SeverityLevel.OFF);return{componentSeverities:{command:P7(Z.mongodbLogComponentSeverities?.command,Z.MONGODB_LOG_COMMAND,J),topology:P7(Z.mongodbLogComponentSeverities?.topology,Z.MONGODB_LOG_TOPOLOGY,J),serverSelection:P7(Z.mongodbLogComponentSeverities?.serverSelection,Z.MONGODB_LOG_SERVER_SELECTION,J),connection:P7(Z.mongodbLogComponentSeverities?.connection,Z.MONGODB_LOG_CONNECTION,J),client:P7(Z.mongodbLogComponentSeverities?.client,Z.MONGODB_LOG_CLIENT,J),default:J},maxDocumentLength:Z.mongodbLogMaxDocumentLength??z9.parseUnsignedInteger(Z.MONGODB_LOG_MAX_DOCUMENT_LENGTH)??1000,logDestination:Z.mongodbLogPath,logDestinationIsStdErr:Z.mongodbLogPathIsStdErr}}}MV.MongoLogger=IV});var G6=E((TV)=>{Object.defineProperty(TV,"__esModule",{value:!0});TV.CancellationToken=TV.TypedEventEmitter=void 0;var jt=i("node:events"),Tt=R4(),kt=e();class e$ extends jt.EventEmitter{emitAndLog(F,...A){if(this.emit(F,...A),this.component)this.mongoLogger?.debug(this.component,A[0])}emitAndLogHeartbeat(F,A,D,...Z){if(this.emit(F,...Z),this.component){let J={topologyId:A,serverConnectionId:D??null,...Z[0]};this.mongoLogger?.debug(this.component,J)}}emitAndLogCommand(F,A,D,Z,...J){if(F)this.emit(A,...J);if(Z){let X={databaseName:D,...J[0]};this.mongoLogger?.debug(Tt.MongoLoggableComponent.COMMAND,X)}}}TV.TypedEventEmitter=e$;class jV extends e${constructor(...F){super(...F);this.on("error",kt.noop)}}TV.CancellationToken=jV});var P5=E((_V)=>{Object.defineProperty(_V,"__esModule",{value:!0});_V.MIN_SECONDARY_WRITE_WIRE_VERSION=void 0;_V.writableServerSelector=_t;_V.sameServerSelector=ut;_V.secondaryWritableServerSelector=xt;_V.readPreferenceServerSelector=FY;var FD=n(),w5=y0(),B6=$6(),St=1e4,OV=90;_V.MIN_SECONDARY_WRITE_WIRE_VERSION=13;function _t(){return function F(A,D){return oA(A,D.filter((Z)=>Z.isWritable))}}function ut(F){return function A(D,Z){if(!F)return[];return Z.filter((J)=>{return J.address===F.address&&J.type!==B6.ServerType.Unknown})}}function xt(F,A){if(!A||!F||F&&F<_V.MIN_SECONDARY_WRITE_WIRE_VERSION)return FY(w5.ReadPreference.primary);return FY(A)}function gt(F,A,D){if(F.maxStalenessSeconds==null||F.maxStalenessSeconds<0)return D;let Z=F.maxStalenessSeconds,J=(A.heartbeatFrequencyMS+St)/1000;if(Z<J)throw new FD.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${J} seconds`);if(Z<OV)throw new FD.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${OV} seconds`);if(A.type===B6.TopologyType.ReplicaSetWithPrimary){let X=Array.from(A.servers.values()).filter(eA)[0];return D.reduce(($,G)=>{let B=(G.lastUpdateTime-G.lastWriteDate-(X.lastUpdateTime-X.lastWriteDate)+A.heartbeatFrequencyMS)/1000,H=F.maxStalenessSeconds??0;if(B<=H)$.push(G);return $},[])}if(A.type===B6.TopologyType.ReplicaSetNoPrimary){if(D.length===0)return D;let X=D.reduce(($,G)=>G.lastWriteDate>$.lastWriteDate?G:$);return D.reduce(($,G)=>{let B=(X.lastWriteDate-G.lastWriteDate+A.heartbeatFrequencyMS)/1000,H=F.maxStalenessSeconds??0;if(B<=H)$.push(G);return $},[])}return D}function ft(F,A){let D=Object.keys(F),Z=Object.keys(A);for(let J=0;J<D.length;++J){let X=D[J];if(Z.indexOf(X)===-1||A[X]!==F[X])return!1}return!0}function yt(F,A){if(F.tags==null||Array.isArray(F.tags)&&F.tags.length===0)return A;for(let D=0;D<F.tags.length;++D){let Z=F.tags[D],J=A.reduce((X,$)=>{if(ft(Z,$.tags))X.push($);return X},[]);if(J.length)return J}return[]}function oA(F,A){let D=A.reduce((J,X)=>Math.min(X.roundTripTime,J),1/0),Z=D+F.localThresholdMS;return A.reduce((J,X)=>{if(X.roundTripTime<=Z&&X.roundTripTime>=D)J.push(X);return J},[])}function eA(F){return F.type===B6.ServerType.RSPrimary}function bt(F){return F.type===B6.ServerType.RSSecondary}function ht(F){return F.type===B6.ServerType.RSSecondary||F.type===B6.ServerType.RSPrimary}function SV(F){return F.type!==B6.ServerType.Unknown}function vt(F){return F.type===B6.ServerType.LoadBalancer}function FY(F){if(!F.isValid())throw new FD.MongoInvalidArgumentError("Invalid read preference specified");return function A(D,Z,J=[]){let X=D.commonWireVersion;if(X&&F.minWireVersion&&F.minWireVersion>X)throw new FD.MongoCompatibilityError(`Minimum wire version '${F.minWireVersion}' required, but found '${X}'`);if(D.type===B6.TopologyType.LoadBalanced)return Z.filter(vt);if(D.type===B6.TopologyType.Unknown)return[];if(D.type===B6.TopologyType.Single)return oA(D,Z.filter(SV));if(D.type===B6.TopologyType.Sharded){let B=Z.filter((q)=>{return!J.includes(q)}),H=B.length>0?B:J;return oA(D,H.filter(SV))}let $=F.mode;if($===w5.ReadPreference.PRIMARY)return Z.filter(eA);if($===w5.ReadPreference.PRIMARY_PREFERRED){let B=Z.filter(eA);if(B.length)return B}let G=$===w5.ReadPreference.NEAREST?ht:bt,Y=oA(D,yt(F,gt(F,D,Z.filter(G))));if($===w5.ReadPreference.SECONDARY_PREFERRED&&Y.length===0)return Z.filter(eA);return Y}}});var G2=E((xV)=>{Object.defineProperty(xV,"__esModule",{value:!0});xV.LegacyTimeoutContext=xV.CSOTTimeoutContext=xV.TimeoutContext=xV.Timeout=xV.TimeoutError=void 0;var uV=i("node:timers"),V9=n(),DY=e();class AD extends Error{get name(){return"TimeoutError"}constructor(F,A){super(F,A);this.duration=A.duration}static is(F){return F!=null&&typeof F==="object"&&"name"in F&&F.name==="TimeoutError"}}xV.TimeoutError=AD;class H6 extends Promise{get remainingTime(){if(this.timedOut)return 0;if(this.duration===0)return 1/0;return this.start+this.duration-Math.trunc(performance.now())}get timeElapsed(){return Math.trunc(performance.now())-this.start}constructor(F=()=>null,A){let D=A?.duration??0,Z=!!A?.unref,J=A?.rejection;if(D<0)throw new V9.MongoInvalidArgumentError("Cannot create a Timeout with a negative duration");let X;super(($,G)=>{X=G,F(DY.noop,G)});if(this.ended=null,this.timedOut=!1,this.cleared=!1,this.duration=D,this.start=Math.trunc(performance.now()),J==null&&this.duration>0){if(this.id=uV.setTimeout(()=>{this.ended=Math.trunc(performance.now()),this.timedOut=!0,X(new AD(`Expired after ${D}ms`,{duration:D}))},this.duration),typeof this.id.unref==="function"&&Z)this.id.unref()}else if(J!=null)this.ended=Math.trunc(performance.now()),this.timedOut=!0,X(J)}clear(){uV.clearTimeout(this.id),this.id=void 0,this.timedOut=!1,this.cleared=!0}throwIfExpired(){if(this.timedOut)throw this.then(void 0,DY.squashError),new AD("Timed out",{duration:this.duration})}static expires(F,A){return new H6(void 0,{duration:F,unref:A})}static reject(F){return new H6(void 0,{duration:0,unref:!0,rejection:F})}}xV.Timeout=H6;function pt(F){return F!=null&&typeof F==="object"&&"serverSelectionTimeoutMS"in F&&typeof F.serverSelectionTimeoutMS==="number"&&"waitQueueTimeoutMS"in F&&typeof F.waitQueueTimeoutMS==="number"}function it(F){return F!=null&&typeof F==="object"&&"serverSelectionTimeoutMS"in F&&typeof F.serverSelectionTimeoutMS==="number"&&"timeoutMS"in F&&typeof F.timeoutMS==="number"}class DD{static create(F){if(F.session?.timeoutContext!=null)return F.session?.timeoutContext;if(it(F))return new I5(F);else if(pt(F))return new ZD(F);else throw new V9.MongoRuntimeError("Unrecognized options")}}xV.TimeoutContext=DD;class I5 extends DD{constructor(F){super();this.minRoundTripTime=0,this.start=Math.trunc(performance.now()),this.timeoutMS=F.timeoutMS,this.serverSelectionTimeoutMS=F.serverSelectionTimeoutMS,this.socketTimeoutMS=F.socketTimeoutMS,this.clearServerSelectionTimeout=!1}get maxTimeMS(){return this.remainingTimeMS-this.minRoundTripTime}get remainingTimeMS(){let F=Math.trunc(performance.now())-this.start;return this.timeoutMS<=0?1/0:this.timeoutMS-F}csotEnabled(){return!0}get serverSelectionTimeout(){if(typeof this._serverSelectionTimeout!=="object"||this._serverSelectionTimeout?.cleared){let{remainingTimeMS:F,serverSelectionTimeoutMS:A}=this;if(F<=0)return H6.reject(new V9.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`));if(A!==0&&DY.csotMin(F,A)===A)this._serverSelectionTimeout=H6.expires(A);else if(F>0&&Number.isFinite(F))this._serverSelectionTimeout=H6.expires(F);else this._serverSelectionTimeout=null}return this._serverSelectionTimeout}get connectionCheckoutTimeout(){if(typeof this._connectionCheckoutTimeout!=="object"||this._connectionCheckoutTimeout?.cleared)if(typeof this._serverSelectionTimeout==="object")this._connectionCheckoutTimeout=this._serverSelectionTimeout;else throw new V9.MongoRuntimeError("Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira");return this._connectionCheckoutTimeout}get timeoutForSocketWrite(){let{remainingTimeMS:F}=this;if(!Number.isFinite(F))return null;if(F>0)return H6.expires(F);return H6.reject(new V9.MongoOperationTimeoutError("Timed out before socket write"))}get timeoutForSocketRead(){let{remainingTimeMS:F}=this;if(!Number.isFinite(F))return null;if(F>0)return H6.expires(F);return H6.reject(new V9.MongoOperationTimeoutError("Timed out before socket read"))}refresh(){this.start=Math.trunc(performance.now()),this.minRoundTripTime=0,this._serverSelectionTimeout?.clear(),this._connectionCheckoutTimeout?.clear()}clear(){this._serverSelectionTimeout?.clear(),this._connectionCheckoutTimeout?.clear()}getRemainingTimeMSOrThrow(F){let{remainingTimeMS:A}=this;if(A<=0)throw new V9.MongoOperationTimeoutError(F??`Expired after ${this.timeoutMS}ms`);return A}clone(){let F=new I5({timeoutMS:this.timeoutMS,serverSelectionTimeoutMS:this.serverSelectionTimeoutMS});return F.start=this.start,F}refreshed(){return new I5(this)}addMaxTimeMSToCommand(F,A){if(A.omitMaxTimeMS)return;let D=this.remainingTimeMS-this.minRoundTripTime;if(D>0&&Number.isFinite(D))F.maxTimeMS=D}getSocketTimeoutMS(){return 0}}xV.CSOTTimeoutContext=I5;class ZD extends DD{constructor(F){super();this.options=F,this.clearServerSelectionTimeout=!0}csotEnabled(){return!1}get serverSelectionTimeout(){if(this.options.serverSelectionTimeoutMS!=null&&this.options.serverSelectionTimeoutMS>0)return H6.expires(this.options.serverSelectionTimeoutMS);return null}get connectionCheckoutTimeout(){if(this.options.waitQueueTimeoutMS!=null&&this.options.waitQueueTimeoutMS>0)return H6.expires(this.options.waitQueueTimeoutMS);return null}get timeoutForSocketWrite(){return null}get timeoutForSocketRead(){return null}refresh(){return}clear(){return}get maxTimeMS(){return null}refreshed(){return new ZD(this.options)}addMaxTimeMSToCommand(F,A){}getSocketTimeoutMS(){return this.options.socketTimeoutMS}}xV.LegacyTimeoutContext=ZD});var y1=E((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});yV.AbstractOperation=yV.Aspect=void 0;yV.defineAspects=ot;var tt=k1(),ZY=y0();yV.Aspect={READ_OPERATION:Symbol("READ_OPERATION"),WRITE_OPERATION:Symbol("WRITE_OPERATION"),RETRYABLE:Symbol("RETRYABLE"),EXPLAINABLE:Symbol("EXPLAINABLE"),SKIP_COLLATION:Symbol("SKIP_COLLATION"),CURSOR_CREATING:Symbol("CURSOR_CREATING"),MUST_SELECT_SAME_SERVER:Symbol("MUST_SELECT_SAME_SERVER"),COMMAND_BATCHING:Symbol("COMMAND_BATCHING")};class fV{constructor(F={}){this.readPreference=this.hasAspect(yV.Aspect.WRITE_OPERATION)?ZY.ReadPreference.primary:ZY.ReadPreference.fromOptions(F)??ZY.ReadPreference.primary,this.bsonOptions=tt.resolveBSONOptions(F),this._session=F.session!=null?F.session:void 0,this.options=F,this.bypassPinningCheck=!!F.bypassPinningCheck,this.trySecondaryWrite=!1}hasAspect(F){let A=this.constructor;if(A.aspects==null)return!1;return A.aspects.has(F)}get session(){return this._session}clearSession(){this._session=void 0}resetBatch(){return!0}get canRetryRead(){return this.hasAspect(yV.Aspect.RETRYABLE)&&this.hasAspect(yV.Aspect.READ_OPERATION)}get canRetryWrite(){return this.hasAspect(yV.Aspect.RETRYABLE)&&this.hasAspect(yV.Aspect.WRITE_OPERATION)}}yV.AbstractOperation=fV;function ot(F,A){if(!Array.isArray(A)&&!(A instanceof Set))A=[A];return A=new Set(A),Object.defineProperty(F,"aspects",{value:A,writable:!1}),A}});var H2=E((dV)=>{Object.defineProperty(dV,"__esModule",{value:!0});dV.executeOperation=Do;var B2=n(),hV=y0(),vV=P5(),Fo=G2(),JY=e(),y3=y1(),Ao=B2.MONGODB_ERROR_CODES.IllegalOperation,mV="This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.";async function Do(F,A,D){if(!(A instanceof y3.AbstractOperation))throw new B2.MongoRuntimeError("This method requires a valid operation instance");let Z=F.topology==null?await JY.abortable(Zo(F),A.options):F.topology,J=A.session,X;if(J==null)X=Symbol(),J=F.startSession({owner:X,explicit:!1});else if(J.hasEnded)throw new B2.MongoExpiredSessionError("Use of expired sessions is not permitted");else if(J.snapshotEnabled&&!Z.capabilities.supportsSnapshotReads)throw new B2.MongoCompatibilityError("Snapshot reads require MongoDB 5.0 or later");else if(J.client!==F)throw new B2.MongoInvalidArgumentError("ClientSession must be from the same MongoClient");let $=A.readPreference??hV.ReadPreference.primary,G=!!J?.inTransaction(),Y=A.hasAspect(y3.Aspect.READ_OPERATION);if(G&&!$.equals(hV.ReadPreference.primary)&&(Y||A.commandName==="runCommand"))throw new B2.MongoTransactionError(`Read preference in a transaction must be primary, not: ${$.mode}`);if(J?.isPinned&&J.transaction.isCommitted&&!A.bypassPinningCheck)J.unpin();D??=Fo.TimeoutContext.create({session:J,serverSelectionTimeoutMS:F.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:F.s.options.waitQueueTimeoutMS,timeoutMS:A.options.timeoutMS});try{return await Jo(A,{topology:Z,timeoutContext:D,session:J,readPreference:$})}finally{if(J?.owner!=null&&J.owner===X)await J.endSession()}}async function Zo(F){if(F.topology==null){if(F.s.hasBeenClosed)throw new B2.MongoNotConnectedError("Client must be connected before running operations");F.s.options.__skipPingOnConnect=!0;try{if(await F.connect(),F.topology==null)throw new B2.MongoRuntimeError("client.connect did not create a topology but also did not throw");return F.topology}finally{delete F.s.options.__skipPingOnConnect}}return F.topology}async function Jo(F,{topology:A,timeoutContext:D,session:Z,readPreference:J}){let X;if(F.hasAspect(y3.Aspect.MUST_SELECT_SAME_SERVER))X=vV.sameServerSelector(F.server?.description);else if(F.trySecondaryWrite)X=vV.secondaryWritableServerSelector(A.commonWireVersion,J);else X=J;let $=await A.selectServer(X,{session:Z,operationName:F.commandName,timeoutContext:D,signal:F.options.signal}),G=F.hasAspect(y3.Aspect.READ_OPERATION),Y=F.hasAspect(y3.Aspect.WRITE_OPERATION),B=Z?.inTransaction()??!1,H=A.s.options.retryReads&&!B&&F.canRetryRead,q=A.s.options.retryWrites&&!B&&JY.supportsRetryableWrites($)&&F.canRetryWrite,W=F.hasAspect(y3.Aspect.RETRYABLE)&&Z!=null&&(G&&H||Y&&q);if(Y&&q&&Z!=null)F.options.willRetryWrite=!0,Z.incrementTransactionNumber();let C=W?D.csotEnabled()?1/0:2:1,Q,K;for(let U=0;U<C;U++){if(Q){if(Y&&Q.code===Ao)throw new B2.MongoServerError({message:mV,errmsg:mV,originalError:Q});if(F.hasAspect(y3.Aspect.COMMAND_BATCHING)&&!F.canRetryWrite)throw Q;if(Y&&!B2.isRetryableWriteError(Q))throw Q;if(G&&!B2.isRetryableReadError(Q))throw Q;if(Q instanceof B2.MongoNetworkError&&F.hasAspect(y3.Aspect.CURSOR_CREATING)&&Z!=null&&Z.isPinned&&!Z.inTransaction())Z.unpin({force:!0,forceClear:!0});if($=await A.selectServer(X,{session:Z,operationName:F.commandName,previousServer:K,signal:F.options.signal}),Y&&!JY.supportsRetryableWrites($))throw new B2.MongoUnexpectedServerResponseError("Selected server does not support retryable writes")}try{if(U>0&&F.hasAspect(y3.Aspect.COMMAND_BATCHING))F.resetBatch();return await F.execute($,Z,D)}catch(z){if(!(z instanceof B2.MongoError))throw z;if(Q!=null&&z.hasErrorLabel(B2.MongoErrorLabel.NoWritesPerformed))throw Q;K=$.description,Q=z,D.clear()}}throw Q??new B2.MongoRuntimeError("Tried to propagate retryability error, but no error was found.")}});var YY=E((cV)=>{Object.defineProperty(cV,"__esModule",{value:!0});cV.GetMoreOperation=void 0;var $o=t6(),XY=n(),Yo=e(),JD=y1();class $Y extends JD.AbstractOperation{constructor(F,A,D,Z){super(Z);this.options=Z,this.ns=F,this.cursorId=A,this.server=D}get commandName(){return"getMore"}async execute(F,A,D){if(F!==this.server)throw new XY.MongoRuntimeError("Getmore must run on the same server operation began on");if(this.cursorId==null||this.cursorId.isZero())throw new XY.MongoRuntimeError("Unable to iterate cursor with no id");let Z=this.ns.collection;if(Z==null)throw new XY.MongoRuntimeError("A collection name must be determined before getMore");let J={getMore:this.cursorId,collection:Z};if(typeof this.options.batchSize==="number")J.batchSize=Math.abs(this.options.batchSize);if(typeof this.options.maxAwaitTimeMS==="number")J.maxTimeMS=this.options.maxAwaitTimeMS;if(this.options.comment!==void 0&&Yo.maxWireVersion(F)>=9)J.comment=this.options.comment;let X={returnFieldSelector:null,documentsReturnedIn:"nextBatch",timeoutContext:D,...this.options};return await F.command(this.ns,J,X,$o.CursorResponse)}}cV.GetMoreOperation=$Y;JD.defineAspects($Y,[JD.Aspect.READ_OPERATION,JD.Aspect.MUST_SELECT_SAME_SERVER])});var nV=E((iV)=>{Object.defineProperty(iV,"__esModule",{value:!0});iV.KillCursorsOperation=void 0;var pV=n(),Go=e(),GY=y1();class BY extends GY.AbstractOperation{constructor(F,A,D,Z){super(Z);this.ns=A,this.cursorId=F,this.server=D}get commandName(){return"killCursors"}async execute(F,A,D){if(F!==this.server)throw new pV.MongoRuntimeError("Killcursor must run on the same server operation began on");let Z=this.ns.collection;if(Z==null)throw new pV.MongoRuntimeError("A collection name must be determined before killCursors");let J={killCursors:Z,cursors:[this.cursorId]};try{await F.command(this.ns,J,{session:A,timeoutContext:D})}catch(X){Go.squashError(X)}}}iV.KillCursorsOperation=BY;GY.defineAspects(BY,[GY.Aspect.MUST_SELECT_SAME_SERVER])});var HY=E((tV)=>{Object.defineProperty(tV,"__esModule",{value:!0});tV.OrderedBulkOperation=void 0;var Bo=k1(),sV=n(),XD=M7();class rV extends XD.BulkOperationBase{constructor(F,A){super(F,A,!0)}addToOperationsList(F,A){let D=Bo.calculateObjectSize(A,{checkKeys:!1,ignoreUndefined:!1});if(D>=this.s.maxBsonObjectSize)throw new sV.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch==null)this.s.currentBatch=new XD.Batch(F,this.s.currentIndex);let Z=this.s.maxKeySize;if(this.s.currentBatchSize+1>=this.s.maxWriteBatchSize||this.s.currentBatchSize>0&&this.s.currentBatchSizeBytes+Z+D>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==F)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new XD.Batch(F,this.s.currentIndex),this.s.currentBatchSize=0,this.s.currentBatchSizeBytes=0;if(F===XD.BatchType.INSERT)this.s.bulkResult.insertedIds.push({index:this.s.currentIndex,_id:A._id});if(Array.isArray(A))throw new sV.MongoInvalidArgumentError("Operation passed in cannot be an Array");return this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentBatch.operations.push(A),this.s.currentBatchSize+=1,this.s.currentBatchSizeBytes+=Z+D,this.s.currentIndex+=1,this}}tV.OrderedBulkOperation=rV});var qY=E((AL)=>{Object.defineProperty(AL,"__esModule",{value:!0});AL.UnorderedBulkOperation=void 0;var Ho=k1(),eV=n(),b3=M7();class FL extends b3.BulkOperationBase{constructor(F,A){super(F,A,!1)}handleWriteError(F){if(this.s.batches.length)return;return super.handleWriteError(F)}addToOperationsList(F,A){let D=Ho.calculateObjectSize(A,{checkKeys:!1,ignoreUndefined:!1});if(D>=this.s.maxBsonObjectSize)throw new eV.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch=void 0,F===b3.BatchType.INSERT)this.s.currentBatch=this.s.currentInsertBatch;else if(F===b3.BatchType.UPDATE)this.s.currentBatch=this.s.currentUpdateBatch;else if(F===b3.BatchType.DELETE)this.s.currentBatch=this.s.currentRemoveBatch;let Z=this.s.maxKeySize;if(this.s.currentBatch==null)this.s.currentBatch=new b3.Batch(F,this.s.currentIndex);if(this.s.currentBatch.size+1>=this.s.maxWriteBatchSize||this.s.currentBatch.size>0&&this.s.currentBatch.sizeBytes+Z+D>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==F)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new b3.Batch(F,this.s.currentIndex);if(Array.isArray(A))throw new eV.MongoInvalidArgumentError("Operation passed in cannot be an Array");if(this.s.currentBatch.operations.push(A),this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentIndex=this.s.currentIndex+1,F===b3.BatchType.INSERT)this.s.currentInsertBatch=this.s.currentBatch,this.s.bulkResult.insertedIds.push({index:this.s.bulkResult.insertedIds.length,_id:A._id});else if(F===b3.BatchType.UPDATE)this.s.currentUpdateBatch=this.s.currentBatch;else if(F===b3.BatchType.DELETE)this.s.currentRemoveBatch=this.s.currentBatch;return this.s.currentBatch.size+=1,this.s.currentBatch.sizeBytes+=Z+D,this}}AL.UnorderedBulkOperation=FL});var CY=E((XL)=>{Object.defineProperty(XL,"__esModule",{value:!0});XL.AggregateOperation=XL.DB_AGGREGATE_COLLECTION=void 0;var ZL=t6(),JL=n(),qo=e(),Wo=Y2(),Co=E0(),M5=y1();XL.DB_AGGREGATE_COLLECTION=1;var Qo=8;class WY extends Co.CommandOperation{constructor(F,A,D){super(void 0,{...D,dbName:F.db});if(this.options={...D},this.target=F.collection||XL.DB_AGGREGATE_COLLECTION,this.pipeline=A,this.hasWriteStage=!1,typeof D?.out==="string")this.pipeline=this.pipeline.concat({$out:D.out}),this.hasWriteStage=!0;else if(A.length>0){let Z=A[A.length-1];if(Z.$out||Z.$merge)this.hasWriteStage=!0}if(this.hasWriteStage)this.trySecondaryWrite=!0;else delete this.options.writeConcern;if(this.explain&&this.writeConcern)throw new JL.MongoInvalidArgumentError('Option "explain" cannot be used on an aggregate call with writeConcern');if(D?.cursor!=null&&typeof D.cursor!=="object")throw new JL.MongoInvalidArgumentError("Cursor options must be an object")}get commandName(){return"aggregate"}get canRetryRead(){return!this.hasWriteStage}addToPipeline(F){this.pipeline.push(F)}async execute(F,A,D){let Z=this.options,J=qo.maxWireVersion(F),X={aggregate:this.target,pipeline:this.pipeline};if(this.hasWriteStage&&J<Qo)this.readConcern=void 0;if(this.hasWriteStage&&this.writeConcern)Wo.WriteConcern.apply(X,this.writeConcern);if(Z.bypassDocumentValidation===!0)X.bypassDocumentValidation=Z.bypassDocumentValidation;if(typeof Z.allowDiskUse==="boolean")X.allowDiskUse=Z.allowDiskUse;if(Z.hint)X.hint=Z.hint;if(Z.let)X.let=Z.let;if(Z.comment!==void 0)X.comment=Z.comment;if(X.cursor=Z.cursor||{},Z.batchSize&&!this.hasWriteStage)X.cursor.batchSize=Z.batchSize;return await super.executeCommand(F,A,X,D,this.explain?ZL.ExplainedCursorResponse:ZL.CursorResponse)}}XL.AggregateOperation=WY;M5.defineAspects(WY,[M5.Aspect.READ_OPERATION,M5.Aspect.RETRYABLE,M5.Aspect.EXPLAINABLE,M5.Aspect.CURSOR_CREATING])});var N5=E((qL)=>{Object.defineProperty(qL,"__esModule",{value:!0});qL.AggregationCursor=void 0;var QY=n(),KY=L9(),GL=CY(),BL=H2(),Ko=e(),HL=q2();class EY extends KY.ExplainableCursor{constructor(F,A,D=[],Z={}){super(F,A,Z);this.pipeline=D,this.aggregateOptions=Z;let J=this.pipeline[this.pipeline.length-1];if(this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===HL.CursorTimeoutMode.ITERATION&&(J?.$merge!=null||J?.$out!=null))throw new QY.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode")}clone(){let F=Ko.mergeOptions({},this.aggregateOptions);return delete F.session,new EY(this.client,this.namespace,this.pipeline,{...F})}map(F){return super.map(F)}async _initialize(F){let A={...this.aggregateOptions,...this.cursorOptions,session:F,signal:this.signal};if(A.explain)try{KY.validateExplainTimeoutOptions(A,KY.Explain.fromOptions(A))}catch{throw new QY.MongoAPIError("timeoutMS cannot be used with explain when explain is specified in aggregateOptions")}let D=new GL.AggregateOperation(this.namespace,this.pipeline,A),Z=await BL.executeOperation(this.client,D,this.timeoutContext);return{server:D.server,session:F,response:Z}}async explain(F,A){let{explain:D,timeout:Z}=this.resolveExplainTimeoutOptions(F,A);return(await BL.executeOperation(this.client,new GL.AggregateOperation(this.namespace,this.pipeline,{...this.aggregateOptions,...this.cursorOptions,...Z,explain:D??!0}))).shift(this.deserializationOptions)}addStage(F){if(this.throwIfInitialized(),this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===HL.CursorTimeoutMode.ITERATION&&(F.$out!=null||F.$merge!=null))throw new QY.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode");return this.pipeline.push(F),this}group(F){return this.addStage({$group:F})}limit(F){return this.addStage({$limit:F})}match(F){return this.addStage({$match:F})}out(F){return this.addStage({$out:F})}project(F){return this.addStage({$project:F})}lookup(F){return this.addStage({$lookup:F})}redact(F){return this.addStage({$redact:F})}skip(F){return this.addStage({$skip:F})}sort(F){return this.addStage({$sort:F})}unwind(F){return this.addStage({$unwind:F})}geoNear(F){return this.addStage({$geoNear:F})}}qL.AggregationCursor=EY});var VY=E((CL)=>{Object.defineProperty(CL,"__esModule",{value:!0});CL.CountOperation=void 0;var Eo=E0(),UY=y1();class zY extends Eo.CommandOperation{constructor(F,A,D){super({s:{namespace:F}},D);this.options=D,this.collectionName=F.collection,this.query=A}get commandName(){return"count"}async execute(F,A,D){let Z=this.options,J={count:this.collectionName,query:this.query};if(typeof Z.limit==="number")J.limit=Z.limit;if(typeof Z.skip==="number")J.skip=Z.skip;if(Z.hint!=null)J.hint=Z.hint;if(typeof Z.maxTimeMS==="number")J.maxTimeMS=Z.maxTimeMS;let X=await super.executeCommand(F,A,J,D);return X?X.n:0}}CL.CountOperation=zY;UY.defineAspects(zY,[UY.Aspect.READ_OPERATION,UY.Aspect.RETRYABLE])});var $D=E((EL)=>{Object.defineProperty(EL,"__esModule",{value:!0});EL.formatSort=No;var KL=n();function N7(F=1){let A=`${F}`.toLowerCase();if(Uo(F))return F;switch(A){case"ascending":case"asc":case"1":return 1;case"descending":case"desc":case"-1":return-1;default:throw new KL.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(F)}`)}}function Uo(F){return typeof F==="object"&&F!=null&&"$meta"in F&&typeof F.$meta==="string"}function zo(F){if(Array.isArray(F)&&F.length===2)try{return N7(F[1]),!0}catch{return!1}return!1}function Vo(F){return Array.isArray(F)&&Array.isArray(F[0])}function Lo(F){return F instanceof Map&&F.size>0}function Ro(F){return new Map([[`${F[0]}`,N7([F[1]])]])}function wo(F){let A=F.map(([D,Z])=>[`${D}`,N7(Z)]);return new Map(A)}function Po(F){let A=F.map((D)=>[`${D}`,1]);return new Map(A)}function Io(F){let A=Object.entries(F).map(([D,Z])=>[`${D}`,N7(Z)]);return new Map(A)}function Mo(F){let A=Array.from(F).map(([D,Z])=>[`${D}`,N7(Z)]);return new Map(A)}function No(F,A){if(F==null)return;if(typeof F==="string")return new Map([[F,N7(A)]]);if(typeof F!=="object")throw new KL.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(F)} Sort must be a valid object`);if(!Array.isArray(F))return Lo(F)?Mo(F):Object.keys(F).length?Io(F):void 0;if(!F.length)return;if(Vo(F))return wo(F);if(zo(F))return Ro(F);return Po(F)}});var RL=E((VL)=>{Object.defineProperty(VL,"__esModule",{value:!0});VL.FindOperation=void 0;var UL=t6(),To=n(),zL=L9(),ko=M6(),Oo=$D(),So=e(),_o=E0(),j5=y1();class LY extends _o.CommandOperation{constructor(F,A={},D={}){super(void 0,D);if(this.options={...D},delete this.options.writeConcern,this.ns=F,typeof A!=="object"||Array.isArray(A))throw new To.MongoInvalidArgumentError("Query filter must be a plain object or ObjectId");this.filter=A!=null&&A._bsontype==="ObjectId"?{_id:A}:A}get commandName(){return"find"}async execute(F,A,D){this.server=F;let Z=this.options,J=uo(this.ns,this.filter,Z);if(this.explain)zL.validateExplainTimeoutOptions(this.options,this.explain),J=zL.decorateWithExplain(J,this.explain);return await F.command(this.ns,J,{...this.options,...this.bsonOptions,documentsReturnedIn:"firstBatch",session:A,timeoutContext:D},this.explain?UL.ExplainedCursorResponse:UL.CursorResponse)}}VL.FindOperation=LY;function uo(F,A,D){let Z={find:F.collection,filter:A};if(D.sort)Z.sort=Oo.formatSort(D.sort);if(D.projection){let X=D.projection;if(X&&Array.isArray(X))X=X.length?X.reduce(($,G)=>{return $[G]=1,$},{}):{_id:1};Z.projection=X}if(D.hint)Z.hint=So.normalizeHintField(D.hint);if(typeof D.skip==="number")Z.skip=D.skip;if(typeof D.limit==="number")if(D.limit<0)Z.limit=-D.limit,Z.singleBatch=!0;else Z.limit=D.limit;if(typeof D.batchSize==="number")if(D.batchSize<0){if(D.limit&&D.limit!==0&&Math.abs(D.batchSize)<Math.abs(D.limit))Z.limit=-D.batchSize;Z.singleBatch=!0}else Z.batchSize=D.batchSize;if(typeof D.singleBatch==="boolean")Z.singleBatch=D.singleBatch;if(D.comment!==void 0)Z.comment=D.comment;if(typeof D.maxTimeMS==="number")Z.maxTimeMS=D.maxTimeMS;let J=ko.ReadConcern.fromOptions(D);if(J)Z.readConcern=J.toJSON();if(D.max)Z.max=D.max;if(D.min)Z.min=D.min;if(typeof D.returnKey==="boolean")Z.returnKey=D.returnKey;if(typeof D.showRecordId==="boolean")Z.showRecordId=D.showRecordId;if(typeof D.tailable==="boolean")Z.tailable=D.tailable;if(typeof D.oplogReplay==="boolean")Z.oplogReplay=D.oplogReplay;if(typeof D.timeout==="boolean")Z.noCursorTimeout=!D.timeout;else if(typeof D.noCursorTimeout==="boolean")Z.noCursorTimeout=D.noCursorTimeout;if(typeof D.awaitData==="boolean")Z.awaitData=D.awaitData;if(typeof D.allowPartialResults==="boolean")Z.allowPartialResults=D.allowPartialResults;if(D.collation)Z.collation=D.collation;if(typeof D.allowDiskUse==="boolean")Z.allowDiskUse=D.allowDiskUse;if(D.let)Z.let=D.let;return Z}j5.defineAspects(LY,[j5.Aspect.READ_OPERATION,j5.Aspect.RETRYABLE,j5.Aspect.EXPLAINABLE,j5.Aspect.CURSOR_CREATING])});var NY=E((PL)=>{Object.defineProperty(PL,"__esModule",{value:!0});PL.FindCursor=PL.FLAGS=void 0;var xo=t6(),N6=n(),RY=L9(),go=VY(),wY=H2(),wL=RL(),PY=$D(),IY=e();PL.FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];class MY extends RY.ExplainableCursor{constructor(F,A,D={},Z={}){super(F,A,Z);if(this.numReturned=0,this.cursorFilter=D,this.findOptions=Z,Z.sort!=null)this.findOptions.sort=PY.formatSort(Z.sort)}clone(){let F=IY.mergeOptions({},this.findOptions);return delete F.session,new MY(this.client,this.namespace,this.cursorFilter,{...F})}map(F){return super.map(F)}async _initialize(F){let A={...this.findOptions,...this.cursorOptions,session:F,signal:this.signal};if(A.explain)try{RY.validateExplainTimeoutOptions(A,RY.Explain.fromOptions(A))}catch{throw new N6.MongoAPIError("timeoutMS cannot be used with explain when explain is specified in findOptions")}let D=new wL.FindOperation(this.namespace,this.cursorFilter,A),Z=await wY.executeOperation(this.client,D,this.timeoutContext);return this.numReturned=Z.batchSize,{server:D.server,session:F,response:Z}}async getMore(F){let A=this.numReturned;if(A){let Z=this.findOptions.limit;if(F=Z&&Z>0&&A+F>Z?Z-A:F,F<=0){try{await this.close()}catch(J){IY.squashError(J)}return xo.CursorResponse.emptyGetMore}}let D=await super.getMore(F);return this.numReturned=this.numReturned+D.batchSize,D}async count(F){if(IY.emitWarningOnce("cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead "),typeof F==="boolean")throw new N6.MongoInvalidArgumentError("Invalid first parameter to count");return await wY.executeOperation(this.client,new go.CountOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...F}))}async explain(F,A){let{explain:D,timeout:Z}=this.resolveExplainTimeoutOptions(F,A);return(await wY.executeOperation(this.client,new wL.FindOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...Z,explain:D??!0}))).shift(this.deserializationOptions)}filter(F){return this.throwIfInitialized(),this.cursorFilter=F,this}hint(F){return this.throwIfInitialized(),this.findOptions.hint=F,this}min(F){return this.throwIfInitialized(),this.findOptions.min=F,this}max(F){return this.throwIfInitialized(),this.findOptions.max=F,this}returnKey(F){return this.throwIfInitialized(),this.findOptions.returnKey=F,this}showRecordId(F){return this.throwIfInitialized(),this.findOptions.showRecordId=F,this}addQueryModifier(F,A){if(this.throwIfInitialized(),F[0]!=="$")throw new N6.MongoInvalidArgumentError(`${F} is not a valid query modifier`);switch(F.substr(1)){case"comment":this.findOptions.comment=A;break;case"explain":this.findOptions.explain=A;break;case"hint":this.findOptions.hint=A;break;case"max":this.findOptions.max=A;break;case"maxTimeMS":this.findOptions.maxTimeMS=A;break;case"min":this.findOptions.min=A;break;case"orderby":this.findOptions.sort=PY.formatSort(A);break;case"query":this.cursorFilter=A;break;case"returnKey":this.findOptions.returnKey=A;break;case"showDiskLoc":this.findOptions.showRecordId=A;break;default:throw new N6.MongoInvalidArgumentError(`Invalid query modifier: ${F}`)}return this}comment(F){return this.throwIfInitialized(),this.findOptions.comment=F,this}maxAwaitTimeMS(F){if(this.throwIfInitialized(),typeof F!=="number")throw new N6.MongoInvalidArgumentError("Argument for maxAwaitTimeMS must be a number");return this.findOptions.maxAwaitTimeMS=F,this}maxTimeMS(F){if(this.throwIfInitialized(),typeof F!=="number")throw new N6.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.findOptions.maxTimeMS=F,this}project(F){return this.throwIfInitialized(),this.findOptions.projection=F,this}sort(F,A){if(this.throwIfInitialized(),this.findOptions.tailable)throw new N6.MongoTailableCursorError("Tailable cursor does not support sorting");return this.findOptions.sort=PY.formatSort(F,A),this}allowDiskUse(F=!0){if(this.throwIfInitialized(),!this.findOptions.sort)throw new N6.MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification');if(!F)return this.findOptions.allowDiskUse=!1,this;return this.findOptions.allowDiskUse=!0,this}collation(F){return this.throwIfInitialized(),this.findOptions.collation=F,this}limit(F){if(this.throwIfInitialized(),this.findOptions.tailable)throw new N6.MongoTailableCursorError("Tailable cursor does not support limit");if(typeof F!=="number")throw new N6.MongoInvalidArgumentError('Operation "limit" requires an integer');return this.findOptions.limit=F,this}skip(F){if(this.throwIfInitialized(),this.findOptions.tailable)throw new N6.MongoTailableCursorError("Tailable cursor does not support skip");if(typeof F!=="number")throw new N6.MongoInvalidArgumentError('Operation "skip" requires an integer');return this.findOptions.skip=F,this}}PL.FindCursor=MY});var k5=E((ML)=>{Object.defineProperty(ML,"__esModule",{value:!0});ML.ListIndexesOperation=ML.DropIndexOperation=ML.CreateIndexesOperation=void 0;var yo=t6(),bo=n(),jY=e(),TY=E0(),w4=y1(),ho=new Set(["background","unique","name","partialFilterExpression","sparse","hidden","expireAfterSeconds","storageEngine","collation","version","weights","default_language","language_override","textIndexVersion","2dsphereIndexVersion","bits","min","max","bucketSize","wildcardProjection"]);function vo(F){return typeof F==="number"||F==="2d"||F==="2dsphere"||F==="text"||F==="geoHaystack"}function mo(F){return Array.isArray(F)&&F.length===2&&vo(F[1])}function co(F){let A=new Map,D=!Array.isArray(F)||mo(F)?[F]:F;for(let Z of D)if(typeof Z==="string")A.set(Z,1);else if(Array.isArray(Z))A.set(Z[0],Z[1]??1);else if(Z instanceof Map)for(let[J,X]of Z)A.set(J,X);else if(jY.isObject(Z))for(let[J,X]of Object.entries(Z))A.set(J,X);return A}function lo(F){let A=Object.entries(F).filter(([D])=>ho.has(D));return Object.fromEntries(A.map(([D,Z])=>D==="version"?["v",Z]:[D,Z]))}class T5 extends TY.CommandOperation{constructor(F,A,D,Z){super(F,Z);this.options=Z??{},this.collectionName=A,this.indexes=D.map((J)=>{let X=J.key instanceof Map?J.key:new Map(Object.entries(J.key)),$=J.name??Array.from(X).flat().join("_");return{...lo(J),name:$,key:X}})}static fromIndexDescriptionArray(F,A,D,Z){return new T5(F,A,D,Z)}static fromIndexSpecification(F,A,D,Z={}){let J=co(D),X={...Z,key:J};return new T5(F,A,[X],Z)}get commandName(){return"createIndexes"}async execute(F,A,D){let Z=this.options,J=this.indexes,X=jY.maxWireVersion(F),$={createIndexes:this.collectionName,indexes:J};if(Z.commitQuorum!=null){if(X<9)throw new bo.MongoCompatibilityError("Option `commitQuorum` for `createIndexes` not supported on servers < 4.4");$.commitQuorum=Z.commitQuorum}return this.options.collation=void 0,await super.executeCommand(F,A,$,D),J.map((Y)=>Y.name||"")}}ML.CreateIndexesOperation=T5;class kY extends TY.CommandOperation{constructor(F,A,D){super(F,D);this.options=D??{},this.collection=F,this.indexName=A}get commandName(){return"dropIndexes"}async execute(F,A,D){let Z={dropIndexes:this.collection.collectionName,index:this.indexName};return await super.executeCommand(F,A,Z,D)}}ML.DropIndexOperation=kY;class OY extends TY.CommandOperation{constructor(F,A){super(F,A);this.options={...A},delete this.options.writeConcern,this.collectionNamespace=F.s.namespace}get commandName(){return"listIndexes"}async execute(F,A,D){let Z=jY.maxWireVersion(F),J=this.options.batchSize?{batchSize:this.options.batchSize}:{},X={listIndexes:this.collectionNamespace.collection,cursor:J};if(Z>=9&&this.options.comment!==void 0)X.comment=this.options.comment;return await super.executeCommand(F,A,X,D,yo.CursorResponse)}}ML.ListIndexesOperation=OY;w4.defineAspects(OY,[w4.Aspect.READ_OPERATION,w4.Aspect.RETRYABLE,w4.Aspect.CURSOR_CREATING]);w4.defineAspects(T5,[w4.Aspect.WRITE_OPERATION]);w4.defineAspects(kY,[w4.Aspect.WRITE_OPERATION])});var _Y=E((jL)=>{Object.defineProperty(jL,"__esModule",{value:!0});jL.ListIndexesCursor=void 0;var ao=H2(),no=k5(),so=q2();class SY extends so.AbstractCursor{constructor(F,A){super(F.client,F.s.namespace,A);this.parent=F,this.options=A}clone(){return new SY(this.parent,{...this.options,...this.cursorOptions})}async _initialize(F){let A=new no.ListIndexesOperation(this.parent,{...this.cursorOptions,...this.options,session:F}),D=await ao.executeOperation(this.parent.client,A,this.timeoutContext);return{server:A.server,session:F,response:D}}}jL.ListIndexesCursor=SY});var _L=E((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});OL.ListSearchIndexesCursor=void 0;var ro=N5();class kL extends ro.AggregationCursor{constructor({fullNamespace:F,client:A},D,Z={}){let J=D==null?[{$listSearchIndexes:{}}]:[{$listSearchIndexes:{name:D}}];super(A,F,J,Z)}}OL.ListSearchIndexesCursor=kL});var gY=E((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});uL.BulkWriteOperation=void 0;var uY=y1();class xY extends uY.AbstractOperation{constructor(F,A,D){super(D);this.options=D,this.collection=F,this.operations=A}get commandName(){return"bulkWrite"}async execute(F,A,D){let Z=this.collection,J=this.operations,X={...this.options,...this.bsonOptions,readPreference:this.readPreference,timeoutContext:D},$=X.ordered===!1?Z.initializeUnorderedBulkOp(X):Z.initializeOrderedBulkOp(X);for(let G=0;G<J.length;G++)$.raw(J[G]);return await $.execute({...X,session:A})}}uL.BulkWriteOperation=xY;uY.defineAspects(xY,[uY.Aspect.WRITE_OPERATION])});var bL=E((fL)=>{Object.defineProperty(fL,"__esModule",{value:!0});fL.DistinctOperation=void 0;var gL=e(),to=E0(),YD=y1();class fY extends to.CommandOperation{constructor(F,A,D,Z){super(F,Z);this.options=Z??{},this.collection=F,this.key=A,this.query=D}get commandName(){return"distinct"}async execute(F,A,D){let Z=this.collection,J=this.key,X=this.query,$=this.options,G={distinct:Z.collectionName,key:J,query:X};if(typeof $.maxTimeMS==="number")G.maxTimeMS=$.maxTimeMS;if(typeof $.comment!=="undefined")G.comment=$.comment;gL.decorateWithReadConcern(G,Z,$),gL.decorateWithCollation(G,Z,$);let Y=await super.executeCommand(F,A,G,D);return this.explain?Y:Y.values}}fL.DistinctOperation=fY;YD.defineAspects(fY,[YD.Aspect.READ_OPERATION,YD.Aspect.RETRYABLE,YD.Aspect.EXPLAINABLE])});var bY=E((mL)=>{Object.defineProperty(mL,"__esModule",{value:!0});mL.DropDatabaseOperation=mL.DropCollectionOperation=void 0;var hL=n(),vL=E0(),GD=y1();class BD extends vL.CommandOperation{constructor(F,A,D={}){super(F,D);this.db=F,this.options=D,this.name=A}get commandName(){return"drop"}async execute(F,A,D){let Z=this.db,J=this.options,X=this.name,$=Z.client.s.options.autoEncryption?.encryptedFieldsMap,G=J.encryptedFields??$?.[`${Z.databaseName}.${X}`];if(!G&&$)G=(await Z.listCollections({name:X},{nameOnly:!1}).toArray())?.[0]?.options?.encryptedFields;if(G){let Y=G.escCollection||`enxcol_.${X}.esc`,B=G.ecocCollection||`enxcol_.${X}.ecoc`;for(let H of[Y,B]){let q=new BD(Z,H);try{await q.executeWithoutEncryptedFieldsCheck(F,A,D)}catch(W){if(!(W instanceof hL.MongoServerError)||W.code!==hL.MONGODB_ERROR_CODES.NamespaceNotFound)throw W}}}return await this.executeWithoutEncryptedFieldsCheck(F,A,D)}async executeWithoutEncryptedFieldsCheck(F,A,D){return await super.executeCommand(F,A,{drop:this.name},D),!0}}mL.DropCollectionOperation=BD;class yY extends vL.CommandOperation{constructor(F,A){super(F,A);this.options=A}get commandName(){return"dropDatabase"}async execute(F,A,D){return await super.executeCommand(F,A,{dropDatabase:1},D),!0}}mL.DropDatabaseOperation=yY;GD.defineAspects(BD,[GD.Aspect.WRITE_OPERATION]);GD.defineAspects(yY,[GD.Aspect.WRITE_OPERATION])});var pL=E((cL)=>{Object.defineProperty(cL,"__esModule",{value:!0});cL.EstimatedDocumentCountOperation=void 0;var eo=E0(),HD=y1();class hY extends eo.CommandOperation{constructor(F,A={}){super(F,A);this.options=A,this.collectionName=F.collectionName}get commandName(){return"count"}async execute(F,A,D){let Z={count:this.collectionName};if(typeof this.options.maxTimeMS==="number")Z.maxTimeMS=this.options.maxTimeMS;if(this.options.comment!==void 0)Z.comment=this.options.comment;return(await super.executeCommand(F,A,Z,D))?.n||0}}cL.EstimatedDocumentCountOperation=hY;HD.defineAspects(hY,[HD.Aspect.READ_OPERATION,HD.Aspect.RETRYABLE,HD.Aspect.CURSOR_CREATING])});var vY=E((rL)=>{Object.defineProperty(rL,"__esModule",{value:!0});rL.FindOneAndUpdateOperation=rL.FindOneAndReplaceOperation=rL.FindOneAndDeleteOperation=rL.FindAndModifyOperation=rL.ReturnDocument=void 0;var P4=n(),Fe=y0(),Ae=$D(),WD=e(),De=E0(),qD=y1();rL.ReturnDocument=Object.freeze({BEFORE:"before",AFTER:"after"});function iL(F,A){if(F.new=A.returnDocument===rL.ReturnDocument.AFTER,F.upsert=A.upsert===!0,A.bypassDocumentValidation===!0)F.bypassDocumentValidation=A.bypassDocumentValidation;return F}class j7 extends De.CommandOperation{constructor(F,A,D){super(F,D);this.options=D??{},this.cmdBase={remove:!1,new:!1,upsert:!1},D.includeResultMetadata??=!1;let Z=Ae.formatSort(D.sort);if(Z)this.cmdBase.sort=Z;if(D.projection)this.cmdBase.fields=D.projection;if(D.maxTimeMS)this.cmdBase.maxTimeMS=D.maxTimeMS;if(D.writeConcern)this.cmdBase.writeConcern=D.writeConcern;if(D.let)this.cmdBase.let=D.let;if(D.comment!==void 0)this.cmdBase.comment=D.comment;this.readPreference=Fe.ReadPreference.primary,this.collection=F,this.query=A}get commandName(){return"findAndModify"}async execute(F,A,D){let Z=this.collection,J=this.query,X={...this.options,...this.bsonOptions},$={findAndModify:Z.collectionName,query:J,...this.cmdBase};if(WD.decorateWithCollation($,Z,X),X.hint){if(this.writeConcern?.w===0||WD.maxWireVersion(F)<8)throw new P4.MongoCompatibilityError("The current topology does not support a hint on findAndModify commands");$.hint=X.hint}let G=await super.executeCommand(F,A,$,D);return X.includeResultMetadata?G:G.value??null}}rL.FindAndModifyOperation=j7;class aL extends j7{constructor(F,A,D){if(A==null||typeof A!=="object")throw new P4.MongoInvalidArgumentError('Argument "filter" must be an object');super(F,A,D);this.cmdBase.remove=!0}}rL.FindOneAndDeleteOperation=aL;class nL extends j7{constructor(F,A,D,Z){if(A==null||typeof A!=="object")throw new P4.MongoInvalidArgumentError('Argument "filter" must be an object');if(D==null||typeof D!=="object")throw new P4.MongoInvalidArgumentError('Argument "replacement" must be an object');if(WD.hasAtomicOperators(D))throw new P4.MongoInvalidArgumentError("Replacement document must not contain atomic operators");super(F,A,Z);this.cmdBase.update=D,iL(this.cmdBase,Z)}}rL.FindOneAndReplaceOperation=nL;class sL extends j7{constructor(F,A,D,Z){if(A==null||typeof A!=="object")throw new P4.MongoInvalidArgumentError('Argument "filter" must be an object');if(D==null||typeof D!=="object")throw new P4.MongoInvalidArgumentError('Argument "update" must be an object');if(!WD.hasAtomicOperators(D))throw new P4.MongoInvalidArgumentError("Update document requires atomic operators");super(F,A,Z);if(this.cmdBase.update=D,iL(this.cmdBase,Z),Z.arrayFilters)this.cmdBase.arrayFilters=Z.arrayFilters}}rL.FindOneAndUpdateOperation=sL;qD.defineAspects(j7,[qD.Aspect.WRITE_OPERATION,qD.Aspect.RETRYABLE,qD.Aspect.EXPLAINABLE])});var cY=E((eL)=>{Object.defineProperty(eL,"__esModule",{value:!0});eL.InsertManyOperation=eL.InsertOneOperation=eL.InsertOperation=void 0;var CD=n(),$e=e(),Ye=Y2(),Ge=gY(),Be=E0(),h3=y1();class QD extends Be.CommandOperation{constructor(F,A,D){super(void 0,D);this.options={...D,checkKeys:D.checkKeys??!1},this.ns=F,this.documents=A}get commandName(){return"insert"}async execute(F,A,D){let Z=this.options??{},J=typeof Z.ordered==="boolean"?Z.ordered:!0,X={insert:this.ns.collection,documents:this.documents,ordered:J};if(typeof Z.bypassDocumentValidation==="boolean")X.bypassDocumentValidation=Z.bypassDocumentValidation;if(Z.comment!==void 0)X.comment=Z.comment;return await super.executeCommand(F,A,X,D)}}eL.InsertOperation=QD;class mY extends QD{constructor(F,A,D){super(F.s.namespace,$e.maybeAddIdToDocuments(F,[A],D),D)}async execute(F,A,D){let Z=await super.execute(F,A,D);if(Z.code)throw new CD.MongoServerError(Z);if(Z.writeErrors)throw new CD.MongoServerError(Z.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,insertedId:this.documents[0]._id}}}eL.InsertOneOperation=mY;class dY extends h3.AbstractOperation{constructor(F,A,D){super(D);if(!Array.isArray(A))throw new CD.MongoInvalidArgumentError('Argument "docs" must be an array of documents');this.options=D,this.collection=F,this.docs=A}get commandName(){return"insert"}async execute(F,A,D){let Z=this.collection,J={...this.options,...this.bsonOptions,readPreference:this.readPreference},X=Ye.WriteConcern.fromOptions(J),$=new Ge.BulkWriteOperation(Z,this.docs.map((G)=>({insertOne:{document:G}})),J);try{let G=await $.execute(F,A,D);return{acknowledged:X?.w!==0,insertedCount:G.insertedCount,insertedIds:G.insertedIds}}catch(G){if(G&&G.message==="Operation must be an object with an operation key")throw new CD.MongoInvalidArgumentError("Collection.insertMany() cannot be called with an array that has null/undefined values");throw G}}}eL.InsertManyOperation=dY;h3.defineAspects(QD,[h3.Aspect.RETRYABLE,h3.Aspect.WRITE_OPERATION]);h3.defineAspects(mY,[h3.Aspect.RETRYABLE,h3.Aspect.WRITE_OPERATION]);h3.defineAspects(dY,[h3.Aspect.WRITE_OPERATION])});var JR=E((DR)=>{Object.defineProperty(DR,"__esModule",{value:!0});DR.IsCappedOperation=void 0;var We=n(),Ce=y1();class AR extends Ce.AbstractOperation{constructor(F,A){super(A);this.options=A,this.collection=F}get commandName(){return"listCollections"}async execute(F,A){let D=this.collection,[Z]=await D.s.db.listCollections({name:D.collectionName},{...this.options,nameOnly:!1,readPreference:this.readPreference,session:A}).toArray();if(Z==null||Z.options==null)throw new We.MongoAPIError(`collection ${D.namespace} not found`);return!!Z.options?.capped}}DR.IsCappedOperation=AR});var GR=E(($R)=>{Object.defineProperty($R,"__esModule",{value:!0});$R.OptionsOperation=void 0;var Qe=n(),Ke=y1();class XR extends Ke.AbstractOperation{constructor(F,A){super(A);this.options=A,this.collection=F}get commandName(){return"listCollections"}async execute(F,A){let D=this.collection,[Z]=await D.s.db.listCollections({name:D.collectionName},{...this.options,nameOnly:!1,readPreference:this.readPreference,session:A}).toArray();if(Z==null||Z.options==null)throw new Qe.MongoAPIError(`collection ${D.namespace} not found`);return Z.options}}$R.OptionsOperation=XR});var pY=E((HR)=>{Object.defineProperty(HR,"__esModule",{value:!0});HR.RenameOperation=void 0;var Ee=R9(),Ue=e(),ze=E0(),BR=y1();class lY extends ze.CommandOperation{constructor(F,A,D){super(F,D);this.collection=F,this.newName=A,this.options=D,this.ns=new Ue.MongoDBNamespace("admin","$cmd")}get commandName(){return"renameCollection"}async execute(F,A,D){let Z=this.collection.namespace,J=this.collection.s.namespace.withCollection(this.newName).toString(),X=typeof this.options.dropTarget==="boolean"?this.options.dropTarget:!1,$={renameCollection:Z,to:J,dropTarget:X};return await super.executeCommand(F,A,$,D),new Ee.Collection(this.collection.s.db,this.newName,this.collection.s.options)}}HR.RenameOperation=lY;BR.defineAspects(lY,[BR.Aspect.WRITE_OPERATION])});var KR=E((CR)=>{Object.defineProperty(CR,"__esModule",{value:!0});CR.CreateSearchIndexesOperation=void 0;var Ve=y1();class WR extends Ve.AbstractOperation{constructor(F,A){super();this.collection=F,this.descriptions=A}get commandName(){return"createSearchIndexes"}async execute(F,A,D){let Z=this.collection.fullNamespace,J={createSearchIndexes:Z.collection,indexes:this.descriptions};return((await F.command(Z,J,{session:A,timeoutContext:D}))?.indexesCreated??[]).map(({name:G})=>G)}}CR.CreateSearchIndexesOperation=WR});var LR=E((zR)=>{Object.defineProperty(zR,"__esModule",{value:!0});zR.DropSearchIndexOperation=void 0;var ER=n(),Le=y1();class UR extends Le.AbstractOperation{constructor(F,A){super();this.collection=F,this.name=A}get commandName(){return"dropSearchIndex"}async execute(F,A,D){let Z=this.collection.fullNamespace,J={dropSearchIndex:Z.collection};if(typeof this.name==="string")J.name=this.name;try{await F.command(Z,J,{session:A,timeoutContext:D})}catch(X){if(!(X instanceof ER.MongoServerError&&X.code===ER.MONGODB_ERROR_CODES.NamespaceNotFound))throw X}}}zR.DropSearchIndexOperation=UR});var IR=E((wR)=>{Object.defineProperty(wR,"__esModule",{value:!0});wR.UpdateSearchIndexOperation=void 0;var Re=y1();class RR extends Re.AbstractOperation{constructor(F,A,D){super();this.collection=F,this.name=A,this.definition=D}get commandName(){return"updateSearchIndex"}async execute(F,A,D){let Z=this.collection.fullNamespace,J={updateSearchIndex:Z.collection,name:this.name,definition:this.definition};await F.command(Z,J,{session:A,timeoutContext:D});return}}wR.UpdateSearchIndexOperation=RR});var rY=E((MR)=>{Object.defineProperty(MR,"__esModule",{value:!0});MR.ReplaceOneOperation=MR.UpdateManyOperation=MR.UpdateOneOperation=MR.UpdateOperation=void 0;MR.makeUpdateStatement=KD;var j6=n(),iY=e(),we=E0(),i0=y1();class T7 extends we.CommandOperation{constructor(F,A,D){super(void 0,D);this.options=D,this.ns=F,this.statements=A}get commandName(){return"update"}get canRetryWrite(){if(super.canRetryWrite===!1)return!1;return this.statements.every((F)=>F.multi==null||F.multi===!1)}async execute(F,A,D){let Z=this.options??{},J=typeof Z.ordered==="boolean"?Z.ordered:!0,X={update:this.ns.collection,updates:this.statements,ordered:J};if(typeof Z.bypassDocumentValidation==="boolean")X.bypassDocumentValidation=Z.bypassDocumentValidation;if(Z.let)X.let=Z.let;if(Z.comment!==void 0)X.comment=Z.comment;if(this.writeConcern&&this.writeConcern.w===0){if(this.statements.find((Y)=>Y.hint))throw new j6.MongoCompatibilityError("hint is not supported with unacknowledged writes")}return await super.executeCommand(F,A,X,D)}}MR.UpdateOperation=T7;class aY extends T7{constructor(F,A,D,Z){super(F.s.namespace,[KD(A,D,{...Z,multi:!1})],Z);if(!iY.hasAtomicOperators(D))throw new j6.MongoInvalidArgumentError("Update document requires atomic operators")}async execute(F,A,D){let Z=await super.execute(F,A,D);if(this.explain!=null)return Z;if(Z.code)throw new j6.MongoServerError(Z);if(Z.writeErrors)throw new j6.MongoServerError(Z.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:Z.nModified??Z.n,upsertedId:Array.isArray(Z.upserted)&&Z.upserted.length>0?Z.upserted[0]._id:null,upsertedCount:Array.isArray(Z.upserted)&&Z.upserted.length?Z.upserted.length:0,matchedCount:Array.isArray(Z.upserted)&&Z.upserted.length>0?0:Z.n}}}MR.UpdateOneOperation=aY;class nY extends T7{constructor(F,A,D,Z){super(F.s.namespace,[KD(A,D,{...Z,multi:!0})],Z);if(!iY.hasAtomicOperators(D))throw new j6.MongoInvalidArgumentError("Update document requires atomic operators")}async execute(F,A,D){let Z=await super.execute(F,A,D);if(this.explain!=null)return Z;if(Z.code)throw new j6.MongoServerError(Z);if(Z.writeErrors)throw new j6.MongoServerError(Z.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:Z.nModified??Z.n,upsertedId:Array.isArray(Z.upserted)&&Z.upserted.length>0?Z.upserted[0]._id:null,upsertedCount:Array.isArray(Z.upserted)&&Z.upserted.length?Z.upserted.length:0,matchedCount:Array.isArray(Z.upserted)&&Z.upserted.length>0?0:Z.n}}}MR.UpdateManyOperation=nY;class sY extends T7{constructor(F,A,D,Z){super(F.s.namespace,[KD(A,D,{...Z,multi:!1})],Z);if(iY.hasAtomicOperators(D))throw new j6.MongoInvalidArgumentError("Replacement document must not contain atomic operators")}async execute(F,A,D){let Z=await super.execute(F,A,D);if(this.explain!=null)return Z;if(Z.code)throw new j6.MongoServerError(Z);if(Z.writeErrors)throw new j6.MongoServerError(Z.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:Z.nModified??Z.n,upsertedId:Array.isArray(Z.upserted)&&Z.upserted.length>0?Z.upserted[0]._id:null,upsertedCount:Array.isArray(Z.upserted)&&Z.upserted.length?Z.upserted.length:0,matchedCount:Array.isArray(Z.upserted)&&Z.upserted.length>0?0:Z.n}}}MR.ReplaceOneOperation=sY;function KD(F,A,D){if(F==null||typeof F!=="object")throw new j6.MongoInvalidArgumentError("Selector must be a valid JavaScript object");if(A==null||typeof A!=="object")throw new j6.MongoInvalidArgumentError("Document must be a valid JavaScript object");let Z={q:F,u:A};if(typeof D.upsert==="boolean")Z.upsert=D.upsert;if(D.multi)Z.multi=D.multi;if(D.hint)Z.hint=D.hint;if(D.arrayFilters)Z.arrayFilters=D.arrayFilters;if(D.collation)Z.collation=D.collation;return Z}i0.defineAspects(T7,[i0.Aspect.RETRYABLE,i0.Aspect.WRITE_OPERATION,i0.Aspect.SKIP_COLLATION]);i0.defineAspects(aY,[i0.Aspect.RETRYABLE,i0.Aspect.WRITE_OPERATION,i0.Aspect.EXPLAINABLE,i0.Aspect.SKIP_COLLATION]);i0.defineAspects(nY,[i0.Aspect.WRITE_OPERATION,i0.Aspect.EXPLAINABLE,i0.Aspect.SKIP_COLLATION]);i0.defineAspects(sY,[i0.Aspect.RETRYABLE,i0.Aspect.WRITE_OPERATION,i0.Aspect.SKIP_COLLATION])});var R9=E((OR)=>{Object.defineProperty(OR,"__esModule",{value:!0});OR.Collection=void 0;var je=k1(),Te=HY(),ke=qY(),Oe=w9(),Se=N5(),_e=NY(),ue=_Y(),xe=_L(),tY=n(),ge=gY(),fe=VY(),jR=AG(),ye=bL(),be=bY(),he=pL(),$0=H2(),oY=vY(),ED=k5(),TR=cY(),ve=JR(),me=GR(),de=pY(),ce=KR(),le=LR(),pe=IR(),eY=rY(),ie=M6(),FG=y0(),b1=e(),ae=Y2();class kR{constructor(F,A,D){this.s={db:F,options:D,namespace:new b1.MongoDBCollectionNamespace(F.databaseName,A),pkFactory:F.options?.pkFactory??b1.DEFAULT_PK_FACTORY,readPreference:FG.ReadPreference.fromOptions(D),bsonOptions:je.resolveBSONOptions(D,F),readConcern:ie.ReadConcern.fromOptions(D),writeConcern:ae.WriteConcern.fromOptions(D)},this.client=F.client}get dbName(){return this.s.namespace.db}get collectionName(){return this.s.namespace.collection}get namespace(){return this.fullNamespace.toString()}get fullNamespace(){return this.s.namespace}get readConcern(){if(this.s.readConcern==null)return this.s.db.readConcern;return this.s.readConcern}get readPreference(){if(this.s.readPreference==null)return this.s.db.readPreference;return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){if(this.s.writeConcern==null)return this.s.db.writeConcern;return this.s.writeConcern}get hint(){return this.s.collectionHint}set hint(F){this.s.collectionHint=b1.normalizeHintField(F)}get timeoutMS(){return this.s.options.timeoutMS}async insertOne(F,A){return await $0.executeOperation(this.client,new TR.InsertOneOperation(this,F,b1.resolveOptions(this,A)))}async insertMany(F,A){return await $0.executeOperation(this.client,new TR.InsertManyOperation(this,F,b1.resolveOptions(this,A??{ordered:!0})))}async bulkWrite(F,A){if(!Array.isArray(F))throw new tY.MongoInvalidArgumentError('Argument "operations" must be an array of documents');return await $0.executeOperation(this.client,new ge.BulkWriteOperation(this,F,b1.resolveOptions(this,A??{ordered:!0})))}async updateOne(F,A,D){return await $0.executeOperation(this.client,new eY.UpdateOneOperation(this,F,A,b1.resolveOptions(this,D)))}async replaceOne(F,A,D){return await $0.executeOperation(this.client,new eY.ReplaceOneOperation(this,F,A,b1.resolveOptions(this,D)))}async updateMany(F,A,D){return await $0.executeOperation(this.client,new eY.UpdateManyOperation(this,F,A,b1.resolveOptions(this,D)))}async deleteOne(F={},A={}){return await $0.executeOperation(this.client,new jR.DeleteOneOperation(this,F,b1.resolveOptions(this,A)))}async deleteMany(F={},A={}){return await $0.executeOperation(this.client,new jR.DeleteManyOperation(this,F,b1.resolveOptions(this,A)))}async rename(F,A){return await $0.executeOperation(this.client,new de.RenameOperation(this,F,b1.resolveOptions(void 0,{...A,readPreference:FG.ReadPreference.PRIMARY})))}async drop(F){return await $0.executeOperation(this.client,new be.DropCollectionOperation(this.s.db,this.collectionName,F))}async findOne(F={},A={}){let D=this.find(F,A).limit(-1).batchSize(1),Z=await D.next();return await D.close(),Z}find(F={},A={}){return new _e.FindCursor(this.client,this.s.namespace,F,b1.resolveOptions(this,A))}async options(F){return await $0.executeOperation(this.client,new me.OptionsOperation(this,b1.resolveOptions(this,F)))}async isCapped(F){return await $0.executeOperation(this.client,new ve.IsCappedOperation(this,b1.resolveOptions(this,F)))}async createIndex(F,A){return(await $0.executeOperation(this.client,ED.CreateIndexesOperation.fromIndexSpecification(this,this.collectionName,F,b1.resolveOptions(this,A))))[0]}async createIndexes(F,A){return await $0.executeOperation(this.client,ED.CreateIndexesOperation.fromIndexDescriptionArray(this,this.collectionName,F,b1.resolveOptions(this,{...A,maxTimeMS:void 0})))}async dropIndex(F,A){return await $0.executeOperation(this.client,new ED.DropIndexOperation(this,F,{...b1.resolveOptions(this,A),readPreference:FG.ReadPreference.primary}))}async dropIndexes(F){try{return await $0.executeOperation(this.client,new ED.DropIndexOperation(this,"*",b1.resolveOptions(this,F))),!0}catch(A){if(A instanceof tY.MongoOperationTimeoutError)throw A;return!1}}listIndexes(F){return new ue.ListIndexesCursor(this,b1.resolveOptions(this,F))}async indexExists(F,A){let D=Array.isArray(F)?F:[F],Z=new Set(await this.listIndexes(A).map(({name:J})=>J).toArray());return D.every((J)=>Z.has(J))}async indexInformation(F){return await this.indexes({...F,full:F?.full??!1})}async estimatedDocumentCount(F){return await $0.executeOperation(this.client,new he.EstimatedDocumentCountOperation(this,b1.resolveOptions(this,F)))}async countDocuments(F={},A={}){let D=[];if(D.push({$match:F}),typeof A.skip==="number")D.push({$skip:A.skip});if(typeof A.limit==="number")D.push({$limit:A.limit});D.push({$group:{_id:1,n:{$sum:1}}});let Z=this.aggregate(D,A),J=await Z.next();return await Z.close(),J?.n??0}async distinct(F,A={},D={}){return await $0.executeOperation(this.client,new ye.DistinctOperation(this,F,A,b1.resolveOptions(this,D)))}async indexes(F){let A=await this.listIndexes(F).toArray();if(F?.full??!0)return A;return Object.fromEntries(A.map(({name:J,key:X})=>[J,Object.entries(X)]))}async findOneAndDelete(F,A){return await $0.executeOperation(this.client,new oY.FindOneAndDeleteOperation(this,F,b1.resolveOptions(this,A)))}async findOneAndReplace(F,A,D){return await $0.executeOperation(this.client,new oY.FindOneAndReplaceOperation(this,F,A,b1.resolveOptions(this,D)))}async findOneAndUpdate(F,A,D){return await $0.executeOperation(this.client,new oY.FindOneAndUpdateOperation(this,F,A,b1.resolveOptions(this,D)))}aggregate(F=[],A){if(!Array.isArray(F))throw new tY.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages');return new Se.AggregationCursor(this.client,this.s.namespace,F,b1.resolveOptions(this,A))}watch(F=[],A={}){if(!Array.isArray(F))A=F,F=[];return new Oe.ChangeStream(this,F,b1.resolveOptions(this,A))}initializeUnorderedBulkOp(F){return new ke.UnorderedBulkOperation(this,b1.resolveOptions(this,F))}initializeOrderedBulkOp(F){return new Te.OrderedBulkOperation(this,b1.resolveOptions(this,F))}async count(F={},A={}){return await $0.executeOperation(this.client,new fe.CountOperation(this.fullNamespace,F,b1.resolveOptions(this,A)))}listSearchIndexes(F,A){A=typeof F==="object"?F:A==null?{}:A;let D=F==null?null:typeof F==="object"?null:F;return new xe.ListSearchIndexesCursor(this,D,A)}async createSearchIndex(F){let[A]=await this.createSearchIndexes([F]);return A}async createSearchIndexes(F){return await $0.executeOperation(this.client,new ce.CreateSearchIndexesOperation(this,F))}async dropSearchIndex(F){return await $0.executeOperation(this.client,new le.DropSearchIndexOperation(this,F))}async updateSearchIndex(F,A){return await $0.executeOperation(this.client,new pe.UpdateSearchIndexOperation(this,F,A))}}OR.Collection=kR});var XG=E((uR)=>{Object.defineProperty(uR,"__esModule",{value:!0});uR.ChangeStreamCursor=void 0;var DG=w9(),_R=N0(),ne=CY(),se=H2(),ZG=e(),re=q2();class JG extends re.AbstractCursor{constructor(F,A,D=[],Z={}){super(F,A,{...Z,tailable:!0,awaitData:!0});if(this.pipeline=D,this.changeStreamCursorOptions=Z,this._resumeToken=null,this.startAtOperationTime=Z.startAtOperationTime??null,Z.startAfter)this.resumeToken=Z.startAfter;else if(Z.resumeAfter)this.resumeToken=Z.resumeAfter}set resumeToken(F){this._resumeToken=F,this.emit(DG.ChangeStream.RESUME_TOKEN_CHANGED,F)}get resumeToken(){return this._resumeToken}get resumeOptions(){let F={...this.changeStreamCursorOptions};for(let A of["resumeAfter","startAfter","startAtOperationTime"])delete F[A];if(this.resumeToken!=null)if(this.changeStreamCursorOptions.startAfter&&!this.hasReceived)F.startAfter=this.resumeToken;else F.resumeAfter=this.resumeToken;else if(this.startAtOperationTime!=null&&ZG.maxWireVersion(this.server)>=7)F.startAtOperationTime=this.startAtOperationTime;return F}cacheResumeToken(F){if(this.bufferedCount()===0&&this.postBatchResumeToken)this.resumeToken=this.postBatchResumeToken;else this.resumeToken=F;this.hasReceived=!0}_processBatch(F){let{postBatchResumeToken:A}=F;if(A){if(this.postBatchResumeToken=A,F.batchSize===0)this.resumeToken=A}}clone(){return new JG(this.client,this.namespace,this.pipeline,{...this.cursorOptions})}async _initialize(F){let A=new ne.AggregateOperation(this.namespace,this.pipeline,{...this.cursorOptions,...this.changeStreamCursorOptions,session:F}),D=await se.executeOperation(F.client,A,this.timeoutContext),Z=A.server;if(this.maxWireVersion=ZG.maxWireVersion(Z),this.startAtOperationTime==null&&this.changeStreamCursorOptions.resumeAfter==null&&this.changeStreamCursorOptions.startAfter==null&&this.maxWireVersion>=7)this.startAtOperationTime=D.operationTime;return this._processBatch(D),this.emit(_R.INIT,D),this.emit(_R.RESPONSE),{server:Z,session:F,response:D}}async getMore(F){let A=await super.getMore(F);return this.maxWireVersion=ZG.maxWireVersion(this.server),this._processBatch(A),this.emit(DG.ChangeStream.MORE,A),this.emit(DG.ChangeStream.RESPONSE),A}}uR.ChangeStreamCursor=JG});var bR=E((fR)=>{Object.defineProperty(fR,"__esModule",{value:!0});fR.ListDatabasesOperation=void 0;var gR=e(),te=E0(),$G=y1();class YG extends te.CommandOperation{constructor(F,A){super(F,A);this.options=A??{},this.ns=new gR.MongoDBNamespace("admin","$cmd")}get commandName(){return"listDatabases"}async execute(F,A,D){let Z={listDatabases:1};if(typeof this.options.nameOnly==="boolean")Z.nameOnly=this.options.nameOnly;if(this.options.filter)Z.filter=this.options.filter;if(typeof this.options.authorizedDatabases==="boolean")Z.authorizedDatabases=this.options.authorizedDatabases;if(gR.maxWireVersion(F)>=9&&this.options.comment!==void 0)Z.comment=this.options.comment;return await super.executeCommand(F,A,Z,D)}}fR.ListDatabasesOperation=YG;$G.defineAspects(YG,[$G.Aspect.READ_OPERATION,$G.Aspect.RETRYABLE])});var BG=E((vR)=>{Object.defineProperty(vR,"__esModule",{value:!0});vR.RemoveUserOperation=void 0;var oe=E0(),hR=y1();class GG extends oe.CommandOperation{constructor(F,A,D){super(F,D);this.options=D,this.username=A}get commandName(){return"dropUser"}async execute(F,A,D){return await super.executeCommand(F,A,{dropUser:this.username},D),!0}}vR.RemoveUserOperation=GG;hR.defineAspects(GG,[hR.Aspect.WRITE_OPERATION])});var k7=E((pR)=>{Object.defineProperty(pR,"__esModule",{value:!0});pR.RunAdminCommandOperation=pR.RunCommandOperation=void 0;var ee=e(),dR=y1();class cR extends dR.AbstractOperation{constructor(F,A,D){super(D);this.command=A,this.options=D,this.ns=F.s.namespace.withCollection("$cmd")}get commandName(){return"runCommand"}async execute(F,A,D){return this.server=F,await F.command(this.ns,this.command,{...this.options,readPreference:this.readPreference,session:A,timeoutContext:D},this.options.responseType)}}pR.RunCommandOperation=cR;class lR extends dR.AbstractOperation{constructor(F,A){super(A);this.command=F,this.options=A,this.ns=new ee.MongoDBNamespace("admin","$cmd")}get commandName(){return"runCommand"}async execute(F,A,D){return this.server=F,await F.command(this.ns,this.command,{...this.options,readPreference:this.readPreference,session:A,timeoutContext:D})}}pR.RunAdminCommandOperation=lR});var rR=E((nR)=>{Object.defineProperty(nR,"__esModule",{value:!0});nR.ValidateCollectionOperation=void 0;var HG=n(),A11=E0();class aR extends A11.CommandOperation{constructor(F,A,D){let Z={validate:A},J=Object.keys(D);for(let X=0;X<J.length;X++)if(Object.prototype.hasOwnProperty.call(D,J[X])&&J[X]!=="session")Z[J[X]]=D[J[X]];super(F.s.db,D);this.options=D,this.command=Z,this.collectionName=A}get commandName(){return"validate"}async execute(F,A,D){let Z=this.collectionName,J=await super.executeCommand(F,A,this.command,D);if(J.result!=null&&typeof J.result!=="string")throw new HG.MongoUnexpectedServerResponseError("Error with validation data");if(J.result!=null&&J.result.match(/exception|corrupt/)!=null)throw new HG.MongoUnexpectedServerResponseError(`Invalid collection ${Z}`);if(J.valid!=null&&!J.valid)throw new HG.MongoUnexpectedServerResponseError(`Invalid collection ${Z}`);return J}}nR.ValidateCollectionOperation=aR});var qG=E((oR)=>{Object.defineProperty(oR,"__esModule",{value:!0});oR.Admin=void 0;var D11=k1(),UD=H2(),Z11=bR(),J11=BG(),X11=k7(),$11=rR();class tR{constructor(F){this.s={db:F}}async command(F,A){return await UD.executeOperation(this.s.db.client,new X11.RunAdminCommandOperation(F,{...D11.resolveBSONOptions(A),session:A?.session,readPreference:A?.readPreference,timeoutMS:A?.timeoutMS??this.s.db.timeoutMS}))}async buildInfo(F){return await this.command({buildinfo:1},F)}async serverInfo(F){return await this.command({buildinfo:1},F)}async serverStatus(F){return await this.command({serverStatus:1},F)}async ping(F){return await this.command({ping:1},F)}async removeUser(F,A){return await UD.executeOperation(this.s.db.client,new J11.RemoveUserOperation(this.s.db,F,{dbName:"admin",...A}))}async validateCollection(F,A={}){return await UD.executeOperation(this.s.db.client,new $11.ValidateCollectionOperation(this,F,A))}async listDatabases(F){return await UD.executeOperation(this.s.db.client,new Z11.ListDatabasesOperation(this.s.db,{timeoutMS:this.s.db.timeoutMS,...F}))}async replSetGetStatus(F){return await this.command({replSetGetStatus:1},F)}}oR.Admin=tR});var Dw=E((Fw)=>{Object.defineProperty(Fw,"__esModule",{value:!0});Fw.ListCollectionsOperation=void 0;var Y11=t6(),G11=e(),B11=E0(),zD=y1();class WG extends B11.CommandOperation{constructor(F,A,D){super(F,D);if(this.options={...D},delete this.options.writeConcern,this.db=F,this.filter=A,this.nameOnly=!!this.options.nameOnly,this.authorizedCollections=!!this.options.authorizedCollections,typeof this.options.batchSize==="number")this.batchSize=this.options.batchSize}get commandName(){return"listCollections"}async execute(F,A,D){return await super.executeCommand(F,A,this.generateCommand(G11.maxWireVersion(F)),D,Y11.CursorResponse)}generateCommand(F){let A={listCollections:1,filter:this.filter,cursor:this.batchSize?{batchSize:this.batchSize}:{},nameOnly:this.nameOnly,authorizedCollections:this.authorizedCollections};if(F>=9&&this.options.comment!==void 0)A.comment=this.options.comment;return A}}Fw.ListCollectionsOperation=WG;zD.defineAspects(WG,[zD.Aspect.READ_OPERATION,zD.Aspect.RETRYABLE,zD.Aspect.CURSOR_CREATING])});var QG=E((Zw)=>{Object.defineProperty(Zw,"__esModule",{value:!0});Zw.ListCollectionsCursor=void 0;var H11=H2(),q11=Dw(),W11=q2();class CG extends W11.AbstractCursor{constructor(F,A,D){super(F.client,F.s.namespace,D);this.parent=F,this.filter=A,this.options=D}clone(){return new CG(this.parent,this.filter,{...this.options,...this.cursorOptions})}async _initialize(F){let A=new q11.ListCollectionsOperation(this.parent,this.filter,{...this.cursorOptions,...this.options,session:F,signal:this.signal}),D=await H11.executeOperation(this.parent.client,A,this.timeoutContext);return{server:A.server,session:F,response:D}}}Zw.ListCollectionsCursor=CG});var Bw=E((Yw)=>{Object.defineProperty(Yw,"__esModule",{value:!0});Yw.RunCommandCursor=void 0;var C11=t6(),O5=n(),Xw=H2(),Q11=YY(),K11=k7(),E11=e(),U11=q2();class $w extends U11.AbstractCursor{setComment(F){return this.getMoreOptions.comment=F,this}setMaxTimeMS(F){return this.getMoreOptions.maxAwaitTimeMS=F,this}setBatchSize(F){return this.getMoreOptions.batchSize=F,this}clone(){throw new O5.MongoAPIError("Clone not supported, create a new cursor with db.runCursorCommand")}withReadConcern(F){throw new O5.MongoAPIError("RunCommandCursor does not support readConcern it must be attached to the command being run")}addCursorFlag(F,A){throw new O5.MongoAPIError("RunCommandCursor does not support cursor flags, they must be attached to the command being run")}maxTimeMS(F){throw new O5.MongoAPIError("maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()")}batchSize(F){throw new O5.MongoAPIError("batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()")}constructor(F,A,D={}){super(F.client,E11.ns(F.namespace),D);this.getMoreOptions={},this.db=F,this.command=Object.freeze({...A})}async _initialize(F){let A=new K11.RunCommandOperation(this.db,this.command,{...this.cursorOptions,session:F,readPreference:this.cursorOptions.readPreference,responseType:C11.CursorResponse}),D=await Xw.executeOperation(this.client,A,this.timeoutContext);return{server:A.server,session:F,response:D}}async getMore(F){let A=new Q11.GetMoreOperation(this.namespace,this.id,this.server,{...this.cursorOptions,session:this.session,...this.getMoreOptions});return await Xw.executeOperation(this.client,A,this.timeoutContext)}}Yw.RunCommandCursor=$w});var Cw=E((qw)=>{Object.defineProperty(qw,"__esModule",{value:!0});qw.CollectionsOperation=void 0;var z11=R9(),V11=y1();class Hw extends V11.AbstractOperation{constructor(F,A){super(A);this.options=A,this.db=F}get commandName(){return"listCollections"}async execute(F,A){let D=await this.db.listCollections({},{...this.options,nameOnly:!0,readPreference:this.readPreference,session:A}).toArray(),Z=[];for(let{name:J}of D)if(!J.includes("$"))Z.push(new z11.Collection(this.db,J,this.db.s.options));return Z}}qw.CollectionsOperation=Hw});var zw=E((Ew)=>{Object.defineProperty(Ew,"__esModule",{value:!0});Ew.CreateCollectionOperation=void 0;var Qw=W9(),L11=R9(),R11=n(),w11=E0(),P11=k5(),Kw=y1(),I11=new Set(["w","wtimeout","timeoutMS","j","fsync","autoIndexId","pkFactory","raw","readPreference","session","readConcern","writeConcern","raw","fieldsAsRaw","useBigInt64","promoteLongs","promoteValues","promoteBuffers","bsonRegExp","serializeFunctions","ignoreUndefined","enableUtf8Validation"]),M11="Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption.";class VD extends w11.CommandOperation{constructor(F,A,D={}){super(F,D);this.options=D,this.db=F,this.name=A}get commandName(){return"create"}async execute(F,A,D){let Z=this.db,J=this.name,X=this.options,$=X.encryptedFields??Z.client.s.options.autoEncryption?.encryptedFieldsMap?.[`${Z.databaseName}.${J}`];if($){if(!F.loadBalanced&&F.description.maxWireVersion<Qw.MIN_SUPPORTED_QE_WIRE_VERSION)throw new R11.MongoCompatibilityError(`${M11} The minimum server version required is ${Qw.MIN_SUPPORTED_QE_SERVER_VERSION}`);let Y=$.escCollection??`enxcol_.${J}.esc`,B=$.ecocCollection??`enxcol_.${J}.ecoc`;for(let H of[Y,B])await new VD(Z,H,{clusteredIndex:{key:{_id:1},unique:!0}}).executeWithoutEncryptedFieldsCheck(F,A,D);if(!X.encryptedFields)this.options={...this.options,encryptedFields:$}}let G=await this.executeWithoutEncryptedFieldsCheck(F,A,D);if($)await P11.CreateIndexesOperation.fromIndexSpecification(Z,J,{__safeContent__:1},{}).execute(F,A,D);return G}async executeWithoutEncryptedFieldsCheck(F,A,D){let Z=this.db,J=this.name,X=this.options,$={create:J};for(let G in X)if(X[G]!=null&&typeof X[G]!=="function"&&!I11.has(G))$[G]=X[G];return await super.executeCommand(F,A,$,D),new L11.Collection(Z,J,X)}}Ew.CreateCollectionOperation=VD;Kw.defineAspects(VD,[Kw.Aspect.WRITE_OPERATION])});var Pw=E((Rw)=>{Object.defineProperty(Rw,"__esModule",{value:!0});Rw.ProfilingLevelOperation=void 0;var Vw=n(),N11=E0();class Lw extends N11.CommandOperation{constructor(F,A){super(F,A);this.options=A}get commandName(){return"profile"}async execute(F,A,D){let Z=await super.executeCommand(F,A,{profile:-1},D);if(Z.ok===1){let J=Z.was;if(J===0)return"off";if(J===1)return"slow_only";if(J===2)return"all";throw new Vw.MongoUnexpectedServerResponseError(`Illegal profiling level value ${J}`)}else throw new Vw.MongoUnexpectedServerResponseError("Error with profile command")}}Rw.ProfilingLevelOperation=Lw});var KG=E((Mw)=>{Object.defineProperty(Mw,"__esModule",{value:!0});Mw.SetProfilingLevelOperation=Mw.ProfilingLevel=void 0;var j11=n(),T11=e(),k11=E0(),O11=new Set(["off","slow_only","all"]);Mw.ProfilingLevel=Object.freeze({off:"off",slowOnly:"slow_only",all:"all"});class Iw extends k11.CommandOperation{constructor(F,A,D){super(F,D);switch(this.options=D,A){case Mw.ProfilingLevel.off:this.profile=0;break;case Mw.ProfilingLevel.slowOnly:this.profile=1;break;case Mw.ProfilingLevel.all:this.profile=2;break;default:this.profile=0;break}this.level=A}get commandName(){return"profile"}async execute(F,A,D){let Z=this.level;if(!O11.has(Z))throw new j11.MongoInvalidArgumentError(`Profiling level must be one of "${T11.enumToString(Mw.ProfilingLevel)}"`);return await super.executeCommand(F,A,{profile:this.profile},D),Z}}Mw.SetProfilingLevelOperation=Iw});var Ow=E((Tw)=>{Object.defineProperty(Tw,"__esModule",{value:!0});Tw.DbStatsOperation=void 0;var S11=E0(),jw=y1();class EG extends S11.CommandOperation{constructor(F,A){super(F,A);this.options=A}get commandName(){return"dbStats"}async execute(F,A,D){let Z={dbStats:!0};if(this.options.scale!=null)Z.scale=this.options.scale;return await super.executeCommand(F,A,Z,D)}}Tw.DbStatsOperation=EG;jw.defineAspects(EG,[jw.Aspect.READ_OPERATION])});var LD=E((gw)=>{Object.defineProperty(gw,"__esModule",{value:!0});gw.Db=void 0;var _11=qG(),Sw=k1(),u11=w9(),x11=R9(),O7=N0(),g11=N5(),f11=QG(),y11=Bw(),_w=n(),b11=Cw(),h11=zw(),uw=bY(),o6=H2(),v11=k5(),m11=Pw(),d11=BG(),c11=pY(),l11=k7(),p11=KG(),i11=Ow(),a11=M6(),xw=y0(),b0=e(),n11=Y2(),s11=["writeConcern","readPreference","readPreferenceTags","native_parser","forceServerObjectId","pkFactory","serializeFunctions","raw","authSource","ignoreUndefined","readConcern","retryMiliSeconds","numberOfRetries","useBigInt64","promoteBuffers","promoteLongs","bsonRegExp","enableUtf8Validation","promoteValues","compression","retryWrites","timeoutMS"];class I4{constructor(F,A,D){if(D=D??{},D=b0.filterOptions(D,s11),typeof A==="string"&&A.includes("."))throw new _w.MongoInvalidArgumentError("Database names cannot contain the character '.'");this.s={options:D,readPreference:xw.ReadPreference.fromOptions(D),bsonOptions:Sw.resolveBSONOptions(D,F),pkFactory:D?.pkFactory??b0.DEFAULT_PK_FACTORY,readConcern:a11.ReadConcern.fromOptions(D),writeConcern:n11.WriteConcern.fromOptions(D),namespace:new b0.MongoDBNamespace(A)},this.client=F}get databaseName(){return this.s.namespace.db}get options(){return this.s.options}get secondaryOk(){return this.s.readPreference?.preference!=="primary"||!1}get readConcern(){return this.s.readConcern}get readPreference(){if(this.s.readPreference==null)return this.client.readPreference;return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern}get namespace(){return this.s.namespace.toString()}get timeoutMS(){return this.s.options?.timeoutMS}async createCollection(F,A){return await o6.executeOperation(this.client,new h11.CreateCollectionOperation(this,F,b0.resolveOptions(this,A)))}async command(F,A){return await o6.executeOperation(this.client,new l11.RunCommandOperation(this,F,b0.resolveOptions(void 0,{...Sw.resolveBSONOptions(A),timeoutMS:A?.timeoutMS??this.timeoutMS,session:A?.session,readPreference:A?.readPreference,signal:A?.signal})))}aggregate(F=[],A){return new g11.AggregationCursor(this.client,this.s.namespace,F,b0.resolveOptions(this,A))}admin(){return new _11.Admin(this)}collection(F,A={}){if(typeof A==="function")throw new _w.MongoInvalidArgumentError("The callback form of this helper has been removed.");return new x11.Collection(this,F,b0.resolveOptions(this,A))}async stats(F){return await o6.executeOperation(this.client,new i11.DbStatsOperation(this,b0.resolveOptions(this,F)))}listCollections(F={},A={}){return new f11.ListCollectionsCursor(this,F,b0.resolveOptions(this,A))}async renameCollection(F,A,D){return await o6.executeOperation(this.client,new c11.RenameOperation(this.collection(F),A,b0.resolveOptions(void 0,{...D,new_collection:!0,readPreference:xw.ReadPreference.primary})))}async dropCollection(F,A){return await o6.executeOperation(this.client,new uw.DropCollectionOperation(this,F,b0.resolveOptions(this,A)))}async dropDatabase(F){return await o6.executeOperation(this.client,new uw.DropDatabaseOperation(this,b0.resolveOptions(this,F)))}async collections(F){return await o6.executeOperation(this.client,new b11.CollectionsOperation(this,b0.resolveOptions(this,F)))}async createIndex(F,A,D){return(await o6.executeOperation(this.client,v11.CreateIndexesOperation.fromIndexSpecification(this,F,A,D)))[0]}async removeUser(F,A){return await o6.executeOperation(this.client,new d11.RemoveUserOperation(this,F,b0.resolveOptions(this,A)))}async setProfilingLevel(F,A){return await o6.executeOperation(this.client,new p11.SetProfilingLevelOperation(this,F,b0.resolveOptions(this,A)))}async profilingLevel(F){return await o6.executeOperation(this.client,new m11.ProfilingLevelOperation(this,b0.resolveOptions(this,F)))}async indexInformation(F,A){return await this.collection(F).indexInformation(b0.resolveOptions(this,A))}watch(F=[],A={}){if(!Array.isArray(F))A=F,F=[];return new u11.ChangeStream(this,F,b0.resolveOptions(this,A))}runCursorCommand(F,A){return new y11.RunCommandCursor(this,F,A)}}gw.Db=I4;I4.SYSTEM_NAMESPACE_COLLECTION=O7.SYSTEM_NAMESPACE_COLLECTION;I4.SYSTEM_INDEX_COLLECTION=O7.SYSTEM_INDEX_COLLECTION;I4.SYSTEM_PROFILE_COLLECTION=O7.SYSTEM_PROFILE_COLLECTION;I4.SYSTEM_USER_COLLECTION=O7.SYSTEM_USER_COLLECTION;I4.SYSTEM_COMMAND_COLLECTION=O7.SYSTEM_COMMAND_COLLECTION;I4.SYSTEM_JS_COLLECTION=O7.SYSTEM_JS_COLLECTION});var w9=E((yw)=>{Object.defineProperty(yw,"__esModule",{value:!0});yw.ChangeStream=void 0;var r11=R9(),e6=N0(),t11=q2(),o11=XG(),e11=LD(),h0=n(),F01=M4(),A01=G6(),D01=S7(),Z01=G2(),z3=e(),J01=["resumeAfter","startAfter","startAtOperationTime","fullDocument","fullDocumentBeforeChange","showExpandedEvents"],P9={COLLECTION:Symbol("Collection"),DATABASE:Symbol("Database"),CLUSTER:Symbol("Cluster")},X01=[e6.RESUME_TOKEN_CHANGED,e6.END,e6.CLOSE],$01="A change stream document has been received that lacks a resume token (_id).",RD="ChangeStream is closed";class W2 extends A01.TypedEventEmitter{async asyncDispose(){await this.close()}constructor(F,A=[],D={}){super();this.pipeline=A,this.options={...D};let Z;if(delete this.options.writeConcern,F instanceof r11.Collection)this.type=P9.COLLECTION,Z=F.s.db.client.options.serverSelectionTimeoutMS;else if(F instanceof e11.Db)this.type=P9.DATABASE,Z=F.client.options.serverSelectionTimeoutMS;else if(F instanceof F01.MongoClient)this.type=P9.CLUSTER,Z=F.options.serverSelectionTimeoutMS;else throw new h0.MongoChangeStreamError("Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient");if(this.contextOwner=Symbol(),this.parent=F,this.namespace=F.s.namespace,!this.options.readPreference&&F.readPreference)this.options.readPreference=F.readPreference;if(this.cursor=this._createChangeStreamCursor(D),this.isClosed=!1,this.mode=!1,this.on("newListener",(J)=>{if(J==="change"&&this.cursor&&this.listenerCount("change")===0)this._streamEvents(this.cursor)}),this.on("removeListener",(J)=>{if(J==="change"&&this.listenerCount("change")===0&&this.cursor)this.cursorStream?.removeAllListeners("data")}),this.options.timeoutMS!=null)this.timeoutContext=new Z01.CSOTTimeoutContext({timeoutMS:this.options.timeoutMS,serverSelectionTimeoutMS:Z})}get resumeToken(){return this.cursor?.resumeToken}async hasNext(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{return await this.cursor.hasNext()}catch(F){try{await this._processErrorIteratorMode(F,this.cursor.id!=null)}catch(A){if(A instanceof h0.MongoOperationTimeoutError&&this.cursor.id==null)throw A;try{await this.close()}catch(D){z3.squashError(D)}throw A}}}finally{this.timeoutContext?.clear()}}async next(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{let F=await this.cursor.next();return this._processChange(F??null)}catch(F){try{await this._processErrorIteratorMode(F,this.cursor.id!=null)}catch(A){if(A instanceof h0.MongoOperationTimeoutError&&this.cursor.id==null)throw A;try{await this.close()}catch(D){z3.squashError(D)}throw A}}}finally{this.timeoutContext?.clear()}}async tryNext(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{return await this.cursor.tryNext()??null}catch(F){try{await this._processErrorIteratorMode(F,this.cursor.id!=null)}catch(A){if(A instanceof h0.MongoOperationTimeoutError&&this.cursor.id==null)throw A;try{await this.close()}catch(D){z3.squashError(D)}throw A}}}finally{this.timeoutContext?.clear()}}async*[Symbol.asyncIterator](){if(this.closed)return;try{while(!0)yield await this.next()}finally{try{await this.close()}catch(F){z3.squashError(F)}}}get closed(){return this.isClosed||this.cursor.closed}async close(){this.timeoutContext?.clear(),this.timeoutContext=void 0,this.isClosed=!0;let F=this.cursor;try{await F.close()}finally{this._endStream()}}stream(F){if(this.closed)throw new h0.MongoChangeStreamError(RD);return this.streamOptions=F,this.cursor.stream(F)}_setIsEmitter(){if(this.mode==="iterator")throw new h0.MongoAPIError("ChangeStream cannot be used as an EventEmitter after being used as an iterator");this.mode="emitter"}_setIsIterator(){if(this.mode==="emitter")throw new h0.MongoAPIError("ChangeStream cannot be used as an iterator after being used as an EventEmitter");this.mode="iterator"}_createChangeStreamCursor(F){let A=z3.filterOptions(F,J01);if(this.type===P9.CLUSTER)A.allChangesForCluster=!0;let D=[{$changeStream:A},...this.pipeline],Z=this.type===P9.CLUSTER?this.parent:this.type===P9.DATABASE?this.parent.client:this.type===P9.COLLECTION?this.parent.client:null;if(Z==null)throw new h0.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`);let J=new o11.ChangeStreamCursor(Z,this.namespace,D,{...F,timeoutContext:this.timeoutContext?new t11.CursorTimeoutContext(this.timeoutContext,this.contextOwner):void 0});for(let X of X01)J.on(X,($)=>this.emit(X,$));if(this.listenerCount(W2.CHANGE)>0)this._streamEvents(J);return J}_closeEmitterModeWithError(F){this.emit(W2.ERROR,F),this.close().then(void 0,z3.squashError)}_streamEvents(F){this._setIsEmitter();let A=this.cursorStream??F.stream();this.cursorStream=A,A.on("data",(D)=>{try{let Z=this._processChange(D);this.emit(W2.CHANGE,Z)}catch(Z){this.emit(W2.ERROR,Z)}this.timeoutContext?.refresh()}),A.on("error",(D)=>this._processErrorStreamMode(D,this.cursor.id!=null))}_endStream(){this.cursorStream?.removeAllListeners("data"),this.cursorStream?.removeAllListeners("close"),this.cursorStream?.removeAllListeners("end"),this.cursorStream?.destroy(),this.cursorStream=void 0}_processChange(F){if(this.isClosed)throw new h0.MongoAPIError(RD);if(F==null)throw new h0.MongoRuntimeError(RD);if(F&&!F._id)throw new h0.MongoChangeStreamError($01);return this.cursor.cacheResumeToken(F._id),this.options.startAtOperationTime=void 0,F}_processErrorStreamMode(F,A){if(this.isClosed)return;if(A&&(h0.isResumableError(F,this.cursor.maxWireVersion)||F instanceof h0.MongoOperationTimeoutError))this._endStream(),this.cursor.close().then(()=>this._resume(F),(D)=>{return z3.squashError(D),this._resume(F)}).then(()=>{if(F instanceof h0.MongoOperationTimeoutError)this.emit(W2.ERROR,F)},()=>this._closeEmitterModeWithError(F));else this._closeEmitterModeWithError(F)}async _processErrorIteratorMode(F,A){if(this.isClosed)throw new h0.MongoAPIError(RD);if(A&&(h0.isResumableError(F,this.cursor.maxWireVersion)||F instanceof h0.MongoOperationTimeoutError)){try{await this.cursor.close()}catch(D){z3.squashError(D)}if(await this._resume(F),F instanceof h0.MongoOperationTimeoutError)throw F}else{try{await this.close()}catch(D){z3.squashError(D)}throw F}}async _resume(F){this.timeoutContext?.refresh();let A=z3.getTopology(this.parent);try{await A.selectServer(this.cursor.readPreference,{operationName:"reconnect topology in change stream",timeoutContext:this.timeoutContext}),this.cursor=this._createChangeStreamCursor(this.cursor.resumeOptions)}catch{throw await this.close(),F}}}yw.ChangeStream=W2;W2.RESPONSE=e6.RESPONSE;W2.MORE=e6.MORE;W2.INIT=e6.INIT;W2.CLOSE=e6.CLOSE;W2.CHANGE=e6.CHANGE;W2.END=e6.END;W2.ERROR=e6.ERROR;W2.RESUME_TOKEN_CHANGED=e6.RESUME_TOKEN_CHANGED;D01.configureResourceManagement(W2.prototype)});var F3=E((hw)=>{Object.defineProperty(hw,"__esModule",{value:!0});hw.aws4=void 0;hw.getKerberos=Y01;hw.getZstdLibrary=G01;hw.getAwsCredentialProvider=B01;hw.getGcpMetadata=H01;hw.getSnappy=q01;hw.getSocks=W01;hw.getMongoDBClientEncryption=Q01;var N4=n();function _5(F){return new Proxy(F?{kModuleError:F}:{},{get:(D,Z)=>{if(Z==="kModuleError")return F;throw F},set:()=>{throw F}})}function Y01(){let F;try{F=(()=>{throw new Error("Cannot require module "+"kerberos");})()}catch(A){F=_5(new N4.MongoMissingDependencyError("Optional module `kerberos` not found. Please install it to enable kerberos authentication",{cause:A,dependencyName:"kerberos"}))}return F}function G01(){let F;try{F=(()=>{throw new Error("Cannot require module "+"@mongodb-js/zstd");})()}catch(A){F=_5(new N4.MongoMissingDependencyError("Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression",{cause:A,dependencyName:"zstd"}))}return F}function B01(){try{return (()=>{throw new Error("Cannot require module "+"@aws-sdk/credential-providers");})()}catch(F){return _5(new N4.MongoMissingDependencyError("Optional module `@aws-sdk/credential-providers` not found. Please install it to enable getting aws credentials via the official sdk.",{cause:F,dependencyName:"@aws-sdk/credential-providers"}))}}function H01(){try{return (()=>{throw new Error("Cannot require module "+"gcp-metadata");})()}catch(F){return _5(new N4.MongoMissingDependencyError("Optional module `gcp-metadata` not found. Please install it to enable getting gcp credentials via the official sdk.",{cause:F,dependencyName:"gcp-metadata"}))}}function q01(){try{return (()=>{throw new Error("Cannot require module "+"snappy");})()}catch(F){return{kModuleError:new N4.MongoMissingDependencyError("Optional module `snappy` not found. Please install it to enable snappy compression",{cause:F,dependencyName:"snappy"})}}}function W01(){try{return (()=>{throw new Error("Cannot require module "+"socks");})()}catch(F){return{kModuleError:new N4.MongoMissingDependencyError("Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy",{cause:F,dependencyName:"socks"})}}}hw.aws4=C01();function C01(){let F;try{F=(()=>{throw new Error("Cannot require module "+"aws4");})()}catch(A){F=_5(new N4.MongoMissingDependencyError("Optional module `aws4` not found. Please install it to enable AWS authentication",{cause:A,dependencyName:"aws4"}))}return F}function Q01(){let F=null;try{F=(()=>{throw new Error("Cannot require module "+"mongodb-client-encryption");})()}catch(A){return{kModuleError:new N4.MongoMissingDependencyError("Optional module `mongodb-client-encryption` not found. Please install it to use auto encryption or ClientEncryption.",{cause:A,dependencyName:"mongodb-client-encryption"})}}return F}});var j4=E((cw)=>{Object.defineProperty(cw,"__esModule",{value:!0});cw.AuthProvider=cw.AuthContext=void 0;var w01=n();class mw{constructor(F,A,D){this.reauthenticating=!1,this.connection=F,this.credentials=A,this.options=D}}cw.AuthContext=mw;class dw{async prepare(F,A){return F}async reauth(F){if(F.reauthenticating)throw new w01.MongoRuntimeError("Reauthentication already in progress.");try{F.reauthenticating=!0,await this.auth(F)}finally{F.reauthenticating=!1}}}cw.AuthProvider=dw});var PD=E((sw)=>{Object.defineProperty(sw,"__esModule",{value:!0});sw.GSSAPI=sw.GSSAPICanonicalizationValue=void 0;sw.performGSSAPICanonicalizeHostName=nw;sw.resolveCname=VG;var zG=i("node:dns"),I01=F3(),pw=n(),M01=e(),N01=j4();sw.GSSAPICanonicalizationValue=Object.freeze({on:!0,off:!1,none:"none",forward:"forward",forwardAndReverse:"forwardAndReverse"});async function UG(F,A){return await F.command(M01.ns("$external.$cmd"),A)}var u5;class iw extends N01.AuthProvider{async auth(F){let{connection:A,credentials:D}=F;if(D==null)throw new pw.MongoMissingCredentialsError("Credentials required for GSSAPI authentication");let{username:Z}=D,J=await j01(F),X=await J.step(""),$=await UG(A,T01(X)),G=await aw(J,10,$.payload),Y=await UG(A,k01(G,$.conversationId)),B=await O01(J,Z,Y.payload);await UG(A,{saslContinue:1,conversationId:Y.conversationId,payload:B})}}sw.GSSAPI=iw;async function j01(F){let{hostAddress:A}=F.options,{credentials:D}=F;if(!A||typeof A.host!=="string"||!D)throw new pw.MongoInvalidArgumentError("Connection must have host and port and credentials defined.");if(S01(),"kModuleError"in u5)throw u5.kModuleError;let{initializeClient:Z}=u5,{username:J,password:X}=D,$=D.mechanismProperties,G=$.SERVICE_NAME??"mongodb",Y=await nw(A.host,$),B={};if(X!=null)Object.assign(B,{user:J,password:X});let H=$.SERVICE_HOST??Y,q=`${G}${process.platform==="win32"?"/":"@"}${H}`;if("SERVICE_REALM"in $)q=`${q}@${$.SERVICE_REALM}`;return await Z(q,B)}function T01(F){return{saslStart:1,mechanism:"GSSAPI",payload:F,autoAuthorize:1}}function k01(F,A){return{saslContinue:1,conversationId:A,payload:F}}async function aw(F,A,D){try{return await F.step(D)||""}catch(Z){if(A===0)throw Z;return await aw(F,A-1,D)}}async function O01(F,A,D){let Z=await F.unwrap(D);return await F.wrap(Z||"",{user:A})}async function nw(F,A){let D=A.CANONICALIZE_HOST_NAME;if(!D||D===sw.GSSAPICanonicalizationValue.none)return F;if(D===sw.GSSAPICanonicalizationValue.on||D===sw.GSSAPICanonicalizationValue.forwardAndReverse){let{address:Z}=await zG.promises.lookup(F);try{let J=await zG.promises.resolvePtr(Z);return J.length>0?J[0]:F}catch{return await VG(F)}}else return await VG(F)}async function VG(F){try{let A=await zG.promises.resolveCname(F);return A.length>0?A[0]:F}catch{return F}}function S01(){if(!u5)u5=I01.getKerberos()}});var V3=E((tw)=>{Object.defineProperty(tw,"__esModule",{value:!0});tw.AUTH_MECHS_AUTH_SRC_EXTERNAL=tw.AuthMechanism=void 0;tw.AuthMechanism=Object.freeze({MONGODB_AWS:"MONGODB-AWS",MONGODB_CR:"MONGODB-CR",MONGODB_DEFAULT:"DEFAULT",MONGODB_GSSAPI:"GSSAPI",MONGODB_PLAIN:"PLAIN",MONGODB_SCRAM_SHA1:"SCRAM-SHA-1",MONGODB_SCRAM_SHA256:"SCRAM-SHA-256",MONGODB_X509:"MONGODB-X509",MONGODB_OIDC:"MONGODB-OIDC"});tw.AUTH_MECHS_AUTH_SRC_EXTERNAL=new Set([tw.AuthMechanism.MONGODB_GSSAPI,tw.AuthMechanism.MONGODB_AWS,tw.AuthMechanism.MONGODB_OIDC,tw.AuthMechanism.MONGODB_X509])});var MD=E((AP)=>{Object.defineProperty(AP,"__esModule",{value:!0});AP.MongoCredentials=AP.DEFAULT_ALLOWED_HOSTS=void 0;var T6=n(),x01=PD(),k2=V3();function g01(F){if(F){if(Array.isArray(F.saslSupportedMechs))return F.saslSupportedMechs.includes(k2.AuthMechanism.MONGODB_SCRAM_SHA256)?k2.AuthMechanism.MONGODB_SCRAM_SHA256:k2.AuthMechanism.MONGODB_SCRAM_SHA1}return k2.AuthMechanism.MONGODB_SCRAM_SHA256}var ew=["test","azure","gcp","k8s"],FP="Auth mechanism property ALLOWED_HOSTS must be an array of strings.";AP.DEFAULT_ALLOWED_HOSTS=["*.mongodb.net","*.mongodb-qa.net","*.mongodb-dev.net","*.mongodbgov.net","localhost","127.0.0.1","::1"];var f01="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.";class ID{constructor(F){if(this.username=F.username??"",this.password=F.password,this.source=F.source,!this.source&&F.db)this.source=F.db;if(this.mechanism=F.mechanism||k2.AuthMechanism.MONGODB_DEFAULT,this.mechanismProperties=F.mechanismProperties||{},this.mechanism.match(/MONGODB-AWS/i)){if(!this.username&&process.env.AWS_ACCESS_KEY_ID)this.username=process.env.AWS_ACCESS_KEY_ID;if(!this.password&&process.env.AWS_SECRET_ACCESS_KEY)this.password=process.env.AWS_SECRET_ACCESS_KEY;if(this.mechanismProperties.AWS_SESSION_TOKEN==null&&process.env.AWS_SESSION_TOKEN!=null)this.mechanismProperties={...this.mechanismProperties,AWS_SESSION_TOKEN:process.env.AWS_SESSION_TOKEN}}if(this.mechanism===k2.AuthMechanism.MONGODB_OIDC&&!this.mechanismProperties.ALLOWED_HOSTS)this.mechanismProperties={...this.mechanismProperties,ALLOWED_HOSTS:AP.DEFAULT_ALLOWED_HOSTS};Object.freeze(this.mechanismProperties),Object.freeze(this)}equals(F){return this.mechanism===F.mechanism&&this.username===F.username&&this.password===F.password&&this.source===F.source}resolveAuthMechanism(F){if(this.mechanism.match(/DEFAULT/i))return new ID({username:this.username,password:this.password,source:this.source,mechanism:g01(F),mechanismProperties:this.mechanismProperties});return this}validate(){if((this.mechanism===k2.AuthMechanism.MONGODB_GSSAPI||this.mechanism===k2.AuthMechanism.MONGODB_PLAIN||this.mechanism===k2.AuthMechanism.MONGODB_SCRAM_SHA1||this.mechanism===k2.AuthMechanism.MONGODB_SCRAM_SHA256)&&!this.username)throw new T6.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`);if(this.mechanism===k2.AuthMechanism.MONGODB_OIDC){if(this.username&&this.mechanismProperties.ENVIRONMENT&&this.mechanismProperties.ENVIRONMENT!=="azure")throw new T6.MongoInvalidArgumentError(`username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.`);if(this.username&&this.password)throw new T6.MongoInvalidArgumentError(`No password is allowed in ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' for '${this.mechanism}'.`);if((this.mechanismProperties.ENVIRONMENT==="azure"||this.mechanismProperties.ENVIRONMENT==="gcp")&&!this.mechanismProperties.TOKEN_RESOURCE)throw new T6.MongoInvalidArgumentError(f01);if(this.mechanismProperties.ENVIRONMENT&&!ew.includes(this.mechanismProperties.ENVIRONMENT))throw new T6.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${ew.join(",")} is supported for mechanism '${this.mechanism}'.`);if(!this.mechanismProperties.ENVIRONMENT&&!this.mechanismProperties.OIDC_CALLBACK&&!this.mechanismProperties.OIDC_HUMAN_CALLBACK)throw new T6.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`);if(this.mechanismProperties.ALLOWED_HOSTS){let A=this.mechanismProperties.ALLOWED_HOSTS;if(!Array.isArray(A))throw new T6.MongoInvalidArgumentError(FP);for(let D of A)if(typeof D!=="string")throw new T6.MongoInvalidArgumentError(FP)}}if(k2.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)){if(this.source!=null&&this.source!=="$external")throw new T6.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`)}if(this.mechanism===k2.AuthMechanism.MONGODB_PLAIN&&this.source==null)throw new T6.MongoAPIError("PLAIN Authentication Mechanism needs an auth source");if(this.mechanism===k2.AuthMechanism.MONGODB_X509&&this.password!=null){if(this.password===""){Reflect.set(this,"password",void 0);return}throw new T6.MongoAPIError("Password not allowed for mechanism MONGODB-X509")}let F=this.mechanismProperties.CANONICALIZE_HOST_NAME??!1;if(!Object.values(x01.GSSAPICanonicalizationValue).includes(F))throw new T6.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${F}`)}static merge(F,A){return new ID({username:A.username??F?.username??"",password:A.password??F?.password??"",mechanism:A.mechanism??F?.mechanism??k2.AuthMechanism.MONGODB_DEFAULT,mechanismProperties:A.mechanismProperties??F?.mechanismProperties??{},source:A.source??A.db??F?.source??"admin"})}}AP.MongoCredentials=ID});var jD=E((YP)=>{function c1(F,A,D){if(D.globals)F=D.globals[F.name];return new F(`${D.context?D.context:"Value"} ${A}.`)}function x7(F,A){if(typeof F==="bigint")throw c1(TypeError,"is a BigInt which cannot be converted to a number",A);if(!A.globals)return Number(F);return A.globals.Number(F)}function XP(F){if(F>0&&F%1===0.5&&(F&1)===0||F<0&&F%1===-0.5&&(F&1)===1)return g5(Math.floor(F));return g5(Math.round(F))}function ND(F){return g5(Math.trunc(F))}function JP(F){return F<0?-1:1}function y01(F,A){let D=F%A;if(JP(A)!==JP(D))return D+A;return D}function g5(F){return F===0?0:F}function g7(F,{unsigned:A}){let D,Z;if(A)D=0,Z=2**F-1;else D=-(2**(F-1)),Z=2**(F-1)-1;let J=2**F,X=2**(F-1);return($,G={})=>{let Y=x7($,G);if(Y=g5(Y),G.enforceRange){if(!Number.isFinite(Y))throw c1(TypeError,"is not a finite number",G);if(Y=ND(Y),Y<D||Y>Z)throw c1(TypeError,`is outside the accepted range of ${D} to ${Z}, inclusive`,G);return Y}if(!Number.isNaN(Y)&&G.clamp)return Y=Math.min(Math.max(Y,D),Z),Y=XP(Y),Y;if(!Number.isFinite(Y)||Y===0)return 0;if(Y=ND(Y),Y>=D&&Y<=Z)return Y;if(Y=y01(Y,J),!A&&Y>=X)return Y-J;return Y}}function $P(F,{unsigned:A}){let D=Number.MAX_SAFE_INTEGER,Z=A?0:Number.MIN_SAFE_INTEGER,J=A?BigInt.asUintN:BigInt.asIntN;return(X,$={})=>{let G=x7(X,$);if(G=g5(G),$.enforceRange){if(!Number.isFinite(G))throw c1(TypeError,"is not a finite number",$);if(G=ND(G),G<Z||G>D)throw c1(TypeError,`is outside the accepted range of ${Z} to ${D}, inclusive`,$);return G}if(!Number.isNaN(G)&&$.clamp)return G=Math.min(Math.max(G,Z),D),G=XP(G),G;if(!Number.isFinite(G)||G===0)return 0;let Y=BigInt(ND(G));return Y=J(F,Y),Number(Y)}}YP.any=(F)=>{return F};YP.undefined=()=>{return};YP.boolean=(F)=>{return Boolean(F)};YP.byte=g7(8,{unsigned:!1});YP.octet=g7(8,{unsigned:!0});YP.short=g7(16,{unsigned:!1});YP["unsigned short"]=g7(16,{unsigned:!0});YP.long=g7(32,{unsigned:!1});YP["unsigned long"]=g7(32,{unsigned:!0});YP["long long"]=$P(64,{unsigned:!1});YP["unsigned long long"]=$P(64,{unsigned:!0});YP.double=(F,A={})=>{let D=x7(F,A);if(!Number.isFinite(D))throw c1(TypeError,"is not a finite floating-point value",A);return D};YP["unrestricted double"]=(F,A={})=>{return x7(F,A)};YP.float=(F,A={})=>{let D=x7(F,A);if(!Number.isFinite(D))throw c1(TypeError,"is not a finite floating-point value",A);if(Object.is(D,-0))return D;let Z=Math.fround(D);if(!Number.isFinite(Z))throw c1(TypeError,"is outside the range of a single-precision floating-point value",A);return Z};YP["unrestricted float"]=(F,A={})=>{let D=x7(F,A);if(isNaN(D))return D;if(Object.is(D,-0))return D;return Math.fround(D)};YP.DOMString=(F,A={})=>{if(A.treatNullAsEmptyString&&F===null)return"";if(typeof F==="symbol")throw c1(TypeError,"is a symbol, which cannot be converted to a string",A);return(A.globals?A.globals.String:String)(F)};YP.ByteString=(F,A={})=>{let D=YP.DOMString(F,A),Z;for(let J=0;(Z=D.codePointAt(J))!==void 0;++J)if(Z>255)throw c1(TypeError,"is not a valid ByteString",A);return D};YP.USVString=(F,A={})=>{let D=YP.DOMString(F,A),Z=D.length,J=[];for(let X=0;X<Z;++X){let $=D.charCodeAt(X);if($<55296||$>57343)J.push(String.fromCodePoint($));else if(56320<=$&&$<=57343)J.push(String.fromCodePoint(65533));else if(X===Z-1)J.push(String.fromCodePoint(65533));else{let G=D.charCodeAt(X+1);if(56320<=G&&G<=57343){let Y=$&1023,B=G&1023;J.push(String.fromCodePoint(65536+1024*Y+B)),++X}else J.push(String.fromCodePoint(65533))}}return J.join("")};YP.object=(F,A={})=>{if(F===null||typeof F!=="object"&&typeof F!=="function")throw c1(TypeError,"is not an object",A);return F};var b01=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,h01=typeof SharedArrayBuffer==="function"?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get:null;function LG(F){try{return b01.call(F),!0}catch{return!1}}function _7(F){try{return h01.call(F),!0}catch{return!1}}function u7(F){try{return new Uint8Array(F),!1}catch{return!0}}YP.ArrayBuffer=(F,A={})=>{if(!LG(F)){if(A.allowShared&&!_7(F))throw c1(TypeError,"is not an ArrayBuffer or SharedArrayBuffer",A);throw c1(TypeError,"is not an ArrayBuffer",A)}if(u7(F))throw c1(TypeError,"is a detached ArrayBuffer",A);return F};var v01=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;YP.DataView=(F,A={})=>{try{v01.call(F)}catch(D){throw c1(TypeError,"is not a DataView",A)}if(!A.allowShared&&_7(F.buffer))throw c1(TypeError,"is backed by a SharedArrayBuffer, which is not allowed",A);if(u7(F.buffer))throw c1(TypeError,"is backed by a detached ArrayBuffer",A);return F};var m01=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach((F)=>{let{name:A}=F,D=/^[AEIOU]/u.test(A)?"an":"a";YP[A]=(Z,J={})=>{if(!ArrayBuffer.isView(Z)||m01.call(Z)!==A)throw c1(TypeError,`is not ${D} ${A} object`,J);if(!J.allowShared&&_7(Z.buffer))throw c1(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",J);if(u7(Z.buffer))throw c1(TypeError,"is a view on a detached ArrayBuffer",J);return Z}});YP.ArrayBufferView=(F,A={})=>{if(!ArrayBuffer.isView(F))throw c1(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",A);if(!A.allowShared&&_7(F.buffer))throw c1(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",A);if(u7(F.buffer))throw c1(TypeError,"is a view on a detached ArrayBuffer",A);return F};YP.BufferSource=(F,A={})=>{if(ArrayBuffer.isView(F)){if(!A.allowShared&&_7(F.buffer))throw c1(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",A);if(u7(F.buffer))throw c1(TypeError,"is a view on a detached ArrayBuffer",A);return F}if(!A.allowShared&&!LG(F))throw c1(TypeError,"is not an ArrayBuffer or a view on one",A);if(A.allowShared&&!_7(F)&&!LG(F))throw c1(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",A);if(u7(F))throw c1(TypeError,"is a detached ArrayBuffer",A);return F};YP.DOMTimeStamp=YP["unsigned long long"]});var kD=E((KP,EP)=>{function H21(F){return typeof F==="object"&&F!==null||typeof F==="function"}var BP=Function.prototype.call.bind(Object.prototype.hasOwnProperty);function q21(F,A){for(let D of Reflect.ownKeys(A)){let Z=Reflect.getOwnPropertyDescriptor(A,D);if(Z&&!Reflect.defineProperty(F,D,Z))throw new TypeError(`Cannot redefine property: ${String(D)}`)}}function W21(F,A){let D=WP(F);return Object.defineProperties(Object.create(D["%Object.prototype%"]),Object.getOwnPropertyDescriptors(A))}var HP=Symbol("wrapper"),qP=Symbol("impl"),f7=Symbol("SameObject caches"),TD=Symbol.for("[webidl2js] constructor registry"),C21=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function WP(F){if(BP(F,TD))return F[TD];let A=Object.create(null);A["%Object.prototype%"]=F.Object.prototype,A["%IteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(new F.Array()[Symbol.iterator]()));try{A["%AsyncIteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(F.eval("(async function* () {})").prototype))}catch{A["%AsyncIteratorPrototype%"]=C21}return F[TD]=A,A}function Q21(F,A,D){if(!F[f7])F[f7]=Object.create(null);if(A in F[f7])return F[f7][A];return F[f7][A]=D(),F[f7][A]}function CP(F){return F?F[HP]:null}function QP(F){return F?F[qP]:null}function K21(F){let A=CP(F);return A?A:F}function E21(F){let A=QP(F);return A?A:F}var U21=Symbol("internal");function z21(F){if(typeof F!=="string")return!1;let A=F>>>0;if(A===4294967295)return!1;let D=`${A}`;if(F!==D)return!1;return!0}var V21=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function L21(F){try{return V21.call(F),!0}catch(A){return!1}}function R21([F,A],D){let Z;switch(D){case"key":Z=F;break;case"value":Z=A;break;case"key+value":Z=[F,A];break}return{value:Z,done:!1}}var w21=Symbol("supports property index"),P21=Symbol("supported property indices"),I21=Symbol("supports property name"),M21=Symbol("supported property names"),N21=Symbol("indexed property get"),j21=Symbol("indexed property set new"),T21=Symbol("indexed property set existing"),k21=Symbol("named property get"),O21=Symbol("named property set new"),S21=Symbol("named property set existing"),_21=Symbol("named property delete"),u21=Symbol("async iterator get the next iteration result"),x21=Symbol("async iterator return steps"),g21=Symbol("async iterator initialization steps"),f21=Symbol("async iterator end of iteration");EP.exports=KP={isObject:H21,hasOwn:BP,define:q21,newObjectInRealm:W21,wrapperSymbol:HP,implSymbol:qP,getSameObject:Q21,ctorRegistrySymbol:TD,initCtorRegistry:WP,wrapperForImpl:CP,implForWrapper:QP,tryWrapperForImpl:K21,tryImplForWrapper:E21,iterInternalSymbol:U21,isArrayBuffer:L21,isArrayIndexPropName:z21,supportsPropertyIndex:w21,supportedPropertyIndices:P21,supportsPropertyName:I21,supportedPropertyNames:M21,indexedGet:N21,indexedSetNew:j21,indexedSetExisting:T21,namedGet:k21,namedSetNew:O21,namedSetExisting:S21,namedDelete:_21,asyncIteratorNext:u21,asyncIteratorReturn:x21,asyncIteratorInit:g21,asyncIteratorEOI:f21,iteratorResult:R21}});var IP=E((Tw1,PP)=>{var y21=/^xn--/,b21=/[^\0-\x7F]/,h21=/[\x2E\u3002\uFF0E\uFF61]/g,v21={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L3=Math.floor,wG=String.fromCharCode;function T4(F){throw new RangeError(v21[F])}function m21(F,A){let D=[],Z=F.length;while(Z--)D[Z]=A(F[Z]);return D}function zP(F,A){let D=F.split("@"),Z="";if(D.length>1)Z=D[0]+"@",F=D[1];F=F.replace(h21,".");let J=F.split("."),X=m21(J,A).join(".");return Z+X}function VP(F){let A=[],D=0,Z=F.length;while(D<Z){let J=F.charCodeAt(D++);if(J>=55296&&J<=56319&&D<Z){let X=F.charCodeAt(D++);if((X&64512)==56320)A.push(((J&1023)<<10)+(X&1023)+65536);else A.push(J),D--}else A.push(J)}return A}var d21=(F)=>String.fromCodePoint(...F),c21=function(F){if(F>=48&&F<58)return 26+(F-48);if(F>=65&&F<91)return F-65;if(F>=97&&F<123)return F-97;return 36},UP=function(F,A){return F+22+75*(F<26)-((A!=0)<<5)},LP=function(F,A,D){let Z=0;F=D?L3(F/700):F>>1,F+=L3(F/A);for(;F>455;Z+=36)F=L3(F/35);return L3(Z+36*F/(F+38))},RP=function(F){let A=[],D=F.length,Z=0,J=128,X=72,$=F.lastIndexOf("-");if($<0)$=0;for(let G=0;G<$;++G){if(F.charCodeAt(G)>=128)T4("not-basic");A.push(F.charCodeAt(G))}for(let G=$>0?$+1:0;G<D;){let Y=Z;for(let H=1,q=36;;q+=36){if(G>=D)T4("invalid-input");let W=c21(F.charCodeAt(G++));if(W>=36)T4("invalid-input");if(W>L3((2147483647-Z)/H))T4("overflow");Z+=W*H;let C=q<=X?1:q>=X+26?26:q-X;if(W<C)break;let Q=36-C;if(H>L3(2147483647/Q))T4("overflow");H*=Q}let B=A.length+1;if(X=LP(Z-Y,B,Y==0),L3(Z/B)>2147483647-J)T4("overflow");J+=L3(Z/B),Z%=B,A.splice(Z++,0,J)}return String.fromCodePoint(...A)},wP=function(F){let A=[];F=VP(F);let D=F.length,Z=128,J=0,X=72;for(let Y of F)if(Y<128)A.push(wG(Y));let $=A.length,G=$;if($)A.push("-");while(G<D){let Y=2147483647;for(let H of F)if(H>=Z&&H<Y)Y=H;let B=G+1;if(Y-Z>L3((2147483647-J)/B))T4("overflow");J+=(Y-Z)*B,Z=Y;for(let H of F){if(H<Z&&++J>2147483647)T4("overflow");if(H===Z){let q=J;for(let W=36;;W+=36){let C=W<=X?1:W>=X+26?26:W-X;if(q<C)break;let Q=q-C,K=36-C;A.push(wG(UP(C+Q%K,0))),q=L3(Q/K)}A.push(wG(UP(q,0))),X=LP(J,B,G===$),J=0,++G}}++J,++Z}return A.join("")},l21=function(F){return zP(F,function(A){return y21.test(A)?RP(A.slice(4).toLowerCase()):A})},p21=function(F){return zP(F,function(A){return b21.test(A)?"xn--"+wP(A):A})},i21={version:"2.3.1",ucs2:{decode:VP,encode:d21},decode:RP,encode:wP,toASCII:p21,toUnicode:l21};PP.exports=i21});var NP=E((kw1,MP)=>{var a21=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10EFD}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{13440}\u{13447}-\u{13455}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u,n21=/[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}]/u,s21=/[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u08A0-\u08A9\u08AF\u08B0\u08B3\u08B4\u08B6-\u08B8\u08BA-\u08BD\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10F46}-\u{10F50}\u{11001}\u{11038}-\u{11046}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{13430}-\u{13438}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E130}-\u{1E136}\u{1E2EC}-\u{1E2EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10F46}-\u{10F50}\u{11001}\u{11038}-\u{11046}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{13430}-\u{13438}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E130}-\u{1E136}\u{1E2EC}-\u{1E2EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0855\u0860\u0862-\u0865\u0867-\u086A\u08A0-\u08AC\u08AE-\u08B4\u08B6-\u08BD\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{1E900}-\u{1E943}]/u,r21=/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,t21=/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B50-\u1B6A\u1B74-\u1B7E\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C88\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6DA}\u{1D6DC}-\u{1D714}\u{1D716}-\u{1D74E}\u{1D750}-\u{1D788}\u{1D78A}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u,o21=/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,e21=/^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0898-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2426\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E3\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EFD}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6DB}\u{1D715}\u{1D74F}\u{1D789}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}\u{1F8B1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA88}\u{1FA90}-\u{1FABD}\u{1FABF}-\u{1FAC5}\u{1FACE}-\u{1FADB}\u{1FAE0}-\u{1FAE8}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBCA}\u{1FBF0}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u,F61=/[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10EFD}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{13440}\u{13447}-\u{13455}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u,A61=/[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u,D61=/[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}]/u,Z61=/^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B50-\u1B7E\u1B80-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C88\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E3\u31F0-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10EFD}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}\u{1F8B1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA88}\u{1FA90}-\u{1FABD}\u{1FABF}-\u{1FAC5}\u{1FACE}-\u{1FADB}\u{1FAE0}-\u{1FAE8}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBCA}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u,J61=/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B50-\u1B6A\u1B74-\u1B7E\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C88\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6DA}\u{1D6DC}-\u{1D714}\u{1D716}-\u{1D74E}\u{1D750}-\u{1D788}\u{1D78A}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10EFD}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{13440}\u{13447}-\u{13455}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u;MP.exports={combiningMarks:a21,combiningClassVirama:n21,validZWNJ:s21,bidiDomain:r21,bidiS1LTR:t21,bidiS1RTL:o21,bidiS2:e21,bidiS3:F61,bidiS4EN:A61,bidiS4AN:D61,bidiS5:Z61,bidiS6:J61}});var jP=E((Ow1,X61)=>{X61.exports=[[[0,44],4],[[45,46],2],[47,4],[[48,57],2],[[58,64],4],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],4],[[97,122],2],[[123,127],4],[[128,159],3],[160,5," "],[[161,167],2],[168,5," \u0308"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,5," \u0304"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,5," \u0301"],[181,1,"\u03BC"],[182,2],[183,2],[184,5," \u0327"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1\u20444"],[189,1,"1\u20442"],[190,1,"3\u20444"],[191,2],[192,1,"\xE0"],[193,1,"\xE1"],[194,1,"\xE2"],[195,1,"\xE3"],[196,1,"\xE4"],[197,1,"\xE5"],[198,1,"\xE6"],[199,1,"\xE7"],[200,1,"\xE8"],[201,1,"\xE9"],[202,1,"\xEA"],[203,1,"\xEB"],[204,1,"\xEC"],[205,1,"\xED"],[206,1,"\xEE"],[207,1,"\xEF"],[208,1,"\xF0"],[209,1,"\xF1"],[210,1,"\xF2"],[211,1,"\xF3"],[212,1,"\xF4"],[213,1,"\xF5"],[214,1,"\xF6"],[215,2],[216,1,"\xF8"],[217,1,"\xF9"],[218,1,"\xFA"],[219,1,"\xFB"],[220,1,"\xFC"],[221,1,"\xFD"],[222,1,"\xFE"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"\u0101"],[257,2],[258,1,"\u0103"],[259,2],[260,1,"\u0105"],[261,2],[262,1,"\u0107"],[263,2],[264,1,"\u0109"],[265,2],[266,1,"\u010B"],[267,2],[268,1,"\u010D"],[269,2],[270,1,"\u010F"],[271,2],[272,1,"\u0111"],[273,2],[274,1,"\u0113"],[275,2],[276,1,"\u0115"],[277,2],[278,1,"\u0117"],[279,2],[280,1,"\u0119"],[281,2],[282,1,"\u011B"],[283,2],[284,1,"\u011D"],[285,2],[286,1,"\u011F"],[287,2],[288,1,"\u0121"],[289,2],[290,1,"\u0123"],[291,2],[292,1,"\u0125"],[293,2],[294,1,"\u0127"],[295,2],[296,1,"\u0129"],[297,2],[298,1,"\u012B"],[299,2],[300,1,"\u012D"],[301,2],[302,1,"\u012F"],[303,2],[304,1,"i\u0307"],[305,2],[[306,307],1,"ij"],[308,1,"\u0135"],[309,2],[310,1,"\u0137"],[[311,312],2],[313,1,"\u013A"],[314,2],[315,1,"\u013C"],[316,2],[317,1,"\u013E"],[318,2],[[319,320],1,"l\xB7"],[321,1,"\u0142"],[322,2],[323,1,"\u0144"],[324,2],[325,1,"\u0146"],[326,2],[327,1,"\u0148"],[328,2],[329,1,"\u02BCn"],[330,1,"\u014B"],[331,2],[332,1,"\u014D"],[333,2],[334,1,"\u014F"],[335,2],[336,1,"\u0151"],[337,2],[338,1,"\u0153"],[339,2],[340,1,"\u0155"],[341,2],[342,1,"\u0157"],[343,2],[344,1,"\u0159"],[345,2],[346,1,"\u015B"],[347,2],[348,1,"\u015D"],[349,2],[350,1,"\u015F"],[351,2],[352,1,"\u0161"],[353,2],[354,1,"\u0163"],[355,2],[356,1,"\u0165"],[357,2],[358,1,"\u0167"],[359,2],[360,1,"\u0169"],[361,2],[362,1,"\u016B"],[363,2],[364,1,"\u016D"],[365,2],[366,1,"\u016F"],[367,2],[368,1,"\u0171"],[369,2],[370,1,"\u0173"],[371,2],[372,1,"\u0175"],[373,2],[374,1,"\u0177"],[375,2],[376,1,"\xFF"],[377,1,"\u017A"],[378,2],[379,1,"\u017C"],[380,2],[381,1,"\u017E"],[382,2],[383,1,"s"],[384,2],[385,1,"\u0253"],[386,1,"\u0183"],[387,2],[388,1,"\u0185"],[389,2],[390,1,"\u0254"],[391,1,"\u0188"],[392,2],[393,1,"\u0256"],[394,1,"\u0257"],[395,1,"\u018C"],[[396,397],2],[398,1,"\u01DD"],[399,1,"\u0259"],[400,1,"\u025B"],[401,1,"\u0192"],[402,2],[403,1,"\u0260"],[404,1,"\u0263"],[405,2],[406,1,"\u0269"],[407,1,"\u0268"],[408,1,"\u0199"],[[409,411],2],[412,1,"\u026F"],[413,1,"\u0272"],[414,2],[415,1,"\u0275"],[416,1,"\u01A1"],[417,2],[418,1,"\u01A3"],[419,2],[420,1,"\u01A5"],[421,2],[422,1,"\u0280"],[423,1,"\u01A8"],[424,2],[425,1,"\u0283"],[[426,427],2],[428,1,"\u01AD"],[429,2],[430,1,"\u0288"],[431,1,"\u01B0"],[432,2],[433,1,"\u028A"],[434,1,"\u028B"],[435,1,"\u01B4"],[436,2],[437,1,"\u01B6"],[438,2],[439,1,"\u0292"],[440,1,"\u01B9"],[[441,443],2],[444,1,"\u01BD"],[[445,451],2],[[452,454],1,"d\u017E"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"\u01CE"],[462,2],[463,1,"\u01D0"],[464,2],[465,1,"\u01D2"],[466,2],[467,1,"\u01D4"],[468,2],[469,1,"\u01D6"],[470,2],[471,1,"\u01D8"],[472,2],[473,1,"\u01DA"],[474,2],[475,1,"\u01DC"],[[476,477],2],[478,1,"\u01DF"],[479,2],[480,1,"\u01E1"],[481,2],[482,1,"\u01E3"],[483,2],[484,1,"\u01E5"],[485,2],[486,1,"\u01E7"],[487,2],[488,1,"\u01E9"],[489,2],[490,1,"\u01EB"],[491,2],[492,1,"\u01ED"],[493,2],[494,1,"\u01EF"],[[495,496],2],[[497,499],1,"dz"],[500,1,"\u01F5"],[501,2],[502,1,"\u0195"],[503,1,"\u01BF"],[504,1,"\u01F9"],[505,2],[506,1,"\u01FB"],[507,2],[508,1,"\u01FD"],[509,2],[510,1,"\u01FF"],[511,2],[512,1,"\u0201"],[513,2],[514,1,"\u0203"],[515,2],[516,1,"\u0205"],[517,2],[518,1,"\u0207"],[519,2],[520,1,"\u0209"],[521,2],[522,1,"\u020B"],[523,2],[524,1,"\u020D"],[525,2],[526,1,"\u020F"],[527,2],[528,1,"\u0211"],[529,2],[530,1,"\u0213"],[531,2],[532,1,"\u0215"],[533,2],[534,1,"\u0217"],[535,2],[536,1,"\u0219"],[537,2],[538,1,"\u021B"],[539,2],[540,1,"\u021D"],[541,2],[542,1,"\u021F"],[543,2],[544,1,"\u019E"],[545,2],[546,1,"\u0223"],[547,2],[548,1,"\u0225"],[549,2],[550,1,"\u0227"],[551,2],[552,1,"\u0229"],[553,2],[554,1,"\u022B"],[555,2],[556,1,"\u022D"],[557,2],[558,1,"\u022F"],[559,2],[560,1,"\u0231"],[561,2],[562,1,"\u0233"],[563,2],[[564,566],2],[[567,569],2],[570,1,"\u2C65"],[571,1,"\u023C"],[572,2],[573,1,"\u019A"],[574,1,"\u2C66"],[[575,576],2],[577,1,"\u0242"],[578,2],[579,1,"\u0180"],[580,1,"\u0289"],[581,1,"\u028C"],[582,1,"\u0247"],[583,2],[584,1,"\u0249"],[585,2],[586,1,"\u024B"],[587,2],[588,1,"\u024D"],[589,2],[590,1,"\u024F"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"\u0266"],[690,1,"j"],[691,1,"r"],[692,1,"\u0279"],[693,1,"\u027B"],[694,1,"\u0281"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,5," \u0306"],[729,5," \u0307"],[730,5," \u030A"],[731,5," \u0328"],[732,5," \u0303"],[733,5," \u030B"],[734,2],[735,2],[736,1,"\u0263"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"\u0295"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"\u0300"],[833,1,"\u0301"],[834,2],[835,1,"\u0313"],[836,1,"\u0308\u0301"],[837,1,"\u03B9"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"\u0371"],[881,2],[882,1,"\u0373"],[883,2],[884,1,"\u02B9"],[885,2],[886,1,"\u0377"],[887,2],[[888,889],3],[890,5," \u03B9"],[[891,893],2],[894,5,";"],[895,1,"\u03F3"],[[896,899],3],[900,5," \u0301"],[901,5," \u0308\u0301"],[902,1,"\u03AC"],[903,1,"\xB7"],[904,1,"\u03AD"],[905,1,"\u03AE"],[906,1,"\u03AF"],[907,3],[908,1,"\u03CC"],[909,3],[910,1,"\u03CD"],[911,1,"\u03CE"],[912,2],[913,1,"\u03B1"],[914,1,"\u03B2"],[915,1,"\u03B3"],[916,1,"\u03B4"],[917,1,"\u03B5"],[918,1,"\u03B6"],[919,1,"\u03B7"],[920,1,"\u03B8"],[921,1,"\u03B9"],[922,1,"\u03BA"],[923,1,"\u03BB"],[924,1,"\u03BC"],[925,1,"\u03BD"],[926,1,"\u03BE"],[927,1,"\u03BF"],[928,1,"\u03C0"],[929,1,"\u03C1"],[930,3],[931,1,"\u03C3"],[932,1,"\u03C4"],[933,1,"\u03C5"],[934,1,"\u03C6"],[935,1,"\u03C7"],[936,1,"\u03C8"],[937,1,"\u03C9"],[938,1,"\u03CA"],[939,1,"\u03CB"],[[940,961],2],[962,6,"\u03C3"],[[963,974],2],[975,1,"\u03D7"],[976,1,"\u03B2"],[977,1,"\u03B8"],[978,1,"\u03C5"],[979,1,"\u03CD"],[980,1,"\u03CB"],[981,1,"\u03C6"],[982,1,"\u03C0"],[983,2],[984,1,"\u03D9"],[985,2],[986,1,"\u03DB"],[987,2],[988,1,"\u03DD"],[989,2],[990,1,"\u03DF"],[991,2],[992,1,"\u03E1"],[993,2],[994,1,"\u03E3"],[995,2],[996,1,"\u03E5"],[997,2],[998,1,"\u03E7"],[999,2],[1000,1,"\u03E9"],[1001,2],[1002,1,"\u03EB"],[1003,2],[1004,1,"\u03ED"],[1005,2],[1006,1,"\u03EF"],[1007,2],[1008,1,"\u03BA"],[1009,1,"\u03C1"],[1010,1,"\u03C3"],[1011,2],[1012,1,"\u03B8"],[1013,1,"\u03B5"],[1014,2],[1015,1,"\u03F8"],[1016,2],[1017,1,"\u03C3"],[1018,1,"\u03FB"],[1019,2],[1020,2],[1021,1,"\u037B"],[1022,1,"\u037C"],[1023,1,"\u037D"],[1024,1,"\u0450"],[1025,1,"\u0451"],[1026,1,"\u0452"],[1027,1,"\u0453"],[1028,1,"\u0454"],[1029,1,"\u0455"],[1030,1,"\u0456"],[1031,1,"\u0457"],[1032,1,"\u0458"],[1033,1,"\u0459"],[1034,1,"\u045A"],[1035,1,"\u045B"],[1036,1,"\u045C"],[1037,1,"\u045D"],[1038,1,"\u045E"],[1039,1,"\u045F"],[1040,1,"\u0430"],[1041,1,"\u0431"],[1042,1,"\u0432"],[1043,1,"\u0433"],[1044,1,"\u0434"],[1045,1,"\u0435"],[1046,1,"\u0436"],[1047,1,"\u0437"],[1048,1,"\u0438"],[1049,1,"\u0439"],[1050,1,"\u043A"],[1051,1,"\u043B"],[1052,1,"\u043C"],[1053,1,"\u043D"],[1054,1,"\u043E"],[1055,1,"\u043F"],[1056,1,"\u0440"],[1057,1,"\u0441"],[1058,1,"\u0442"],[1059,1,"\u0443"],[1060,1,"\u0444"],[1061,1,"\u0445"],[1062,1,"\u0446"],[1063,1,"\u0447"],[1064,1,"\u0448"],[1065,1,"\u0449"],[1066,1,"\u044A"],[1067,1,"\u044B"],[1068,1,"\u044C"],[1069,1,"\u044D"],[1070,1,"\u044E"],[1071,1,"\u044F"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"\u0461"],[1121,2],[1122,1,"\u0463"],[1123,2],[1124,1,"\u0465"],[1125,2],[1126,1,"\u0467"],[1127,2],[1128,1,"\u0469"],[1129,2],[1130,1,"\u046B"],[1131,2],[1132,1,"\u046D"],[1133,2],[1134,1,"\u046F"],[1135,2],[1136,1,"\u0471"],[1137,2],[1138,1,"\u0473"],[1139,2],[1140,1,"\u0475"],[1141,2],[1142,1,"\u0477"],[1143,2],[1144,1,"\u0479"],[1145,2],[1146,1,"\u047B"],[1147,2],[1148,1,"\u047D"],[1149,2],[1150,1,"\u047F"],[1151,2],[1152,1,"\u0481"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"\u048B"],[1163,2],[1164,1,"\u048D"],[1165,2],[1166,1,"\u048F"],[1167,2],[1168,1,"\u0491"],[1169,2],[1170,1,"\u0493"],[1171,2],[1172,1,"\u0495"],[1173,2],[1174,1,"\u0497"],[1175,2],[1176,1,"\u0499"],[1177,2],[1178,1,"\u049B"],[1179,2],[1180,1,"\u049D"],[1181,2],[1182,1,"\u049F"],[1183,2],[1184,1,"\u04A1"],[1185,2],[1186,1,"\u04A3"],[1187,2],[1188,1,"\u04A5"],[1189,2],[1190,1,"\u04A7"],[1191,2],[1192,1,"\u04A9"],[1193,2],[1194,1,"\u04AB"],[1195,2],[1196,1,"\u04AD"],[1197,2],[1198,1,"\u04AF"],[1199,2],[1200,1,"\u04B1"],[1201,2],[1202,1,"\u04B3"],[1203,2],[1204,1,"\u04B5"],[1205,2],[1206,1,"\u04B7"],[1207,2],[1208,1,"\u04B9"],[1209,2],[1210,1,"\u04BB"],[1211,2],[1212,1,"\u04BD"],[1213,2],[1214,1,"\u04BF"],[1215,2],[1216,3],[1217,1,"\u04C2"],[1218,2],[1219,1,"\u04C4"],[1220,2],[1221,1,"\u04C6"],[1222,2],[1223,1,"\u04C8"],[1224,2],[1225,1,"\u04CA"],[1226,2],[1227,1,"\u04CC"],[1228,2],[1229,1,"\u04CE"],[1230,2],[1231,2],[1232,1,"\u04D1"],[1233,2],[1234,1,"\u04D3"],[1235,2],[1236,1,"\u04D5"],[1237,2],[1238,1,"\u04D7"],[1239,2],[1240,1,"\u04D9"],[1241,2],[1242,1,"\u04DB"],[1243,2],[1244,1,"\u04DD"],[1245,2],[1246,1,"\u04DF"],[1247,2],[1248,1,"\u04E1"],[1249,2],[1250,1,"\u04E3"],[1251,2],[1252,1,"\u04E5"],[1253,2],[1254,1,"\u04E7"],[1255,2],[1256,1,"\u04E9"],[1257,2],[1258,1,"\u04EB"],[1259,2],[1260,1,"\u04ED"],[1261,2],[1262,1,"\u04EF"],[1263,2],[1264,1,"\u04F1"],[1265,2],[1266,1,"\u04F3"],[1267,2],[1268,1,"\u04F5"],[1269,2],[1270,1,"\u04F7"],[1271,2],[1272,1,"\u04F9"],[1273,2],[1274,1,"\u04FB"],[1275,2],[1276,1,"\u04FD"],[1277,2],[1278,1,"\u04FF"],[1279,2],[1280,1,"\u0501"],[1281,2],[1282,1,"\u0503"],[1283,2],[1284,1,"\u0505"],[1285,2],[1286,1,"\u0507"],[1287,2],[1288,1,"\u0509"],[1289,2],[1290,1,"\u050B"],[1291,2],[1292,1,"\u050D"],[1293,2],[1294,1,"\u050F"],[1295,2],[1296,1,"\u0511"],[1297,2],[1298,1,"\u0513"],[1299,2],[1300,1,"\u0515"],[1301,2],[1302,1,"\u0517"],[1303,2],[1304,1,"\u0519"],[1305,2],[1306,1,"\u051B"],[1307,2],[1308,1,"\u051D"],[1309,2],[1310,1,"\u051F"],[1311,2],[1312,1,"\u0521"],[1313,2],[1314,1,"\u0523"],[1315,2],[1316,1,"\u0525"],[1317,2],[1318,1,"\u0527"],[1319,2],[1320,1,"\u0529"],[1321,2],[1322,1,"\u052B"],[1323,2],[1324,1,"\u052D"],[1325,2],[1326,1,"\u052F"],[1327,2],[1328,3],[1329,1,"\u0561"],[1330,1,"\u0562"],[1331,1,"\u0563"],[1332,1,"\u0564"],[1333,1,"\u0565"],[1334,1,"\u0566"],[1335,1,"\u0567"],[1336,1,"\u0568"],[1337,1,"\u0569"],[1338,1,"\u056A"],[1339,1,"\u056B"],[1340,1,"\u056C"],[1341,1,"\u056D"],[1342,1,"\u056E"],[1343,1,"\u056F"],[1344,1,"\u0570"],[1345,1,"\u0571"],[1346,1,"\u0572"],[1347,1,"\u0573"],[1348,1,"\u0574"],[1349,1,"\u0575"],[1350,1,"\u0576"],[1351,1,"\u0577"],[1352,1,"\u0578"],[1353,1,"\u0579"],[1354,1,"\u057A"],[1355,1,"\u057B"],[1356,1,"\u057C"],[1357,1,"\u057D"],[1358,1,"\u057E"],[1359,1,"\u057F"],[1360,1,"\u0580"],[1361,1,"\u0581"],[1362,1,"\u0582"],[1363,1,"\u0583"],[1364,1,"\u0584"],[1365,1,"\u0585"],[1366,1,"\u0586"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"\u0565\u0582"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"\u0627\u0674"],[1654,1,"\u0648\u0674"],[1655,1,"\u06C7\u0674"],[1656,1,"\u064A\u0674"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2199],3],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"\u0915\u093C"],[2393,1,"\u0916\u093C"],[2394,1,"\u0917\u093C"],[2395,1,"\u091C\u093C"],[2396,1,"\u0921\u093C"],[2397,1,"\u0922\u093C"],[2398,1,"\u092B\u093C"],[2399,1,"\u092F\u093C"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"\u09A1\u09BC"],[2525,1,"\u09A2\u09BC"],[2526,3],[2527,1,"\u09AF\u09BC"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"\u0A32\u0A3C"],[2612,3],[2613,2],[2614,1,"\u0A38\u0A3C"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"\u0A16\u0A3C"],[2650,1,"\u0A17\u0A3C"],[2651,1,"\u0A1C\u0A3C"],[2652,2],[2653,3],[2654,1,"\u0A2B\u0A3C"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"\u0B21\u0B3C"],[2909,1,"\u0B22\u0B3C"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"\u0E4D\u0E32"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"\u0ECD\u0EB2"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"\u0EAB\u0E99"],[3805,1,"\u0EAB\u0EA1"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"\u0F0B"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"\u0F42\u0FB7"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"\u0F4C\u0FB7"],[[3918,3921],2],[3922,1,"\u0F51\u0FB7"],[[3923,3926],2],[3927,1,"\u0F56\u0FB7"],[[3928,3931],2],[3932,1,"\u0F5B\u0FB7"],[[3933,3944],2],[3945,1,"\u0F40\u0FB5"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"\u0F71\u0F72"],[3956,2],[3957,1,"\u0F71\u0F74"],[3958,1,"\u0FB2\u0F80"],[3959,1,"\u0FB2\u0F71\u0F80"],[3960,1,"\u0FB3\u0F80"],[3961,1,"\u0FB3\u0F71\u0F80"],[[3962,3968],2],[3969,1,"\u0F71\u0F80"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"\u0F92\u0FB7"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"\u0F9C\u0FB7"],[[3998,4001],2],[4002,1,"\u0FA1\u0FB7"],[[4003,4006],2],[4007,1,"\u0FA6\u0FB7"],[[4008,4011],2],[4012,1,"\u0FAB\u0FB7"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"\u0F90\u0FB5"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[[4256,4293],3],[4294,3],[4295,1,"\u2D27"],[[4296,4300],3],[4301,1,"\u2D2D"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"\u10DC"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],3],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"\u13F0"],[5113,1,"\u13F1"],[5114,1,"\u13F2"],[5115,1,"\u13F3"],[5116,1,"\u13F4"],[5117,1,"\u13F5"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],3],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6149],2],[6150,3],[[6151,6154],2],[[6155,6157],7],[6158,3],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[[6989,6991],3],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,3],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"\u0432"],[7297,1,"\u0434"],[7298,1,"\u043E"],[7299,1,"\u0441"],[[7300,7301],1,"\u0442"],[7302,1,"\u044A"],[7303,1,"\u0463"],[7304,1,"\uA64B"],[[7305,7311],3],[7312,1,"\u10D0"],[7313,1,"\u10D1"],[7314,1,"\u10D2"],[7315,1,"\u10D3"],[7316,1,"\u10D4"],[7317,1,"\u10D5"],[7318,1,"\u10D6"],[7319,1,"\u10D7"],[7320,1,"\u10D8"],[7321,1,"\u10D9"],[7322,1,"\u10DA"],[7323,1,"\u10DB"],[7324,1,"\u10DC"],[7325,1,"\u10DD"],[7326,1,"\u10DE"],[7327,1,"\u10DF"],[7328,1,"\u10E0"],[7329,1,"\u10E1"],[7330,1,"\u10E2"],[7331,1,"\u10E3"],[7332,1,"\u10E4"],[7333,1,"\u10E5"],[7334,1,"\u10E6"],[7335,1,"\u10E7"],[7336,1,"\u10E8"],[7337,1,"\u10E9"],[7338,1,"\u10EA"],[7339,1,"\u10EB"],[7340,1,"\u10EC"],[7341,1,"\u10ED"],[7342,1,"\u10EE"],[7343,1,"\u10EF"],[7344,1,"\u10F0"],[7345,1,"\u10F1"],[7346,1,"\u10F2"],[7347,1,"\u10F3"],[7348,1,"\u10F4"],[7349,1,"\u10F5"],[7350,1,"\u10F6"],[7351,1,"\u10F7"],[7352,1,"\u10F8"],[7353,1,"\u10F9"],[7354,1,"\u10FA"],[[7355,7356],3],[7357,1,"\u10FD"],[7358,1,"\u10FE"],[7359,1,"\u10FF"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"\xE6"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"\u01DD"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"\u0223"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"\u0250"],[7493,1,"\u0251"],[7494,1,"\u1D02"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"\u0259"],[7499,1,"\u025B"],[7500,1,"\u025C"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"\u014B"],[7506,1,"o"],[7507,1,"\u0254"],[7508,1,"\u1D16"],[7509,1,"\u1D17"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"\u1D1D"],[7514,1,"\u026F"],[7515,1,"v"],[7516,1,"\u1D25"],[7517,1,"\u03B2"],[7518,1,"\u03B3"],[7519,1,"\u03B4"],[7520,1,"\u03C6"],[7521,1,"\u03C7"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"\u03B2"],[7527,1,"\u03B3"],[7528,1,"\u03C1"],[7529,1,"\u03C6"],[7530,1,"\u03C7"],[7531,2],[[7532,7543],2],[7544,1,"\u043D"],[[7545,7578],2],[7579,1,"\u0252"],[7580,1,"c"],[7581,1,"\u0255"],[7582,1,"\xF0"],[7583,1,"\u025C"],[7584,1,"f"],[7585,1,"\u025F"],[7586,1,"\u0261"],[7587,1,"\u0265"],[7588,1,"\u0268"],[7589,1,"\u0269"],[7590,1,"\u026A"],[7591,1,"\u1D7B"],[7592,1,"\u029D"],[7593,1,"\u026D"],[7594,1,"\u1D85"],[7595,1,"\u029F"],[7596,1,"\u0271"],[7597,1,"\u0270"],[7598,1,"\u0272"],[7599,1,"\u0273"],[7600,1,"\u0274"],[7601,1,"\u0275"],[7602,1,"\u0278"],[7603,1,"\u0282"],[7604,1,"\u0283"],[7605,1,"\u01AB"],[7606,1,"\u0289"],[7607,1,"\u028A"],[7608,1,"\u1D1C"],[7609,1,"\u028B"],[7610,1,"\u028C"],[7611,1,"z"],[7612,1,"\u0290"],[7613,1,"\u0291"],[7614,1,"\u0292"],[7615,1,"\u03B8"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"\u1E01"],[7681,2],[7682,1,"\u1E03"],[7683,2],[7684,1,"\u1E05"],[7685,2],[7686,1,"\u1E07"],[7687,2],[7688,1,"\u1E09"],[7689,2],[7690,1,"\u1E0B"],[7691,2],[7692,1,"\u1E0D"],[7693,2],[7694,1,"\u1E0F"],[7695,2],[7696,1,"\u1E11"],[7697,2],[7698,1,"\u1E13"],[7699,2],[7700,1,"\u1E15"],[7701,2],[7702,1,"\u1E17"],[7703,2],[7704,1,"\u1E19"],[7705,2],[7706,1,"\u1E1B"],[7707,2],[7708,1,"\u1E1D"],[7709,2],[7710,1,"\u1E1F"],[7711,2],[7712,1,"\u1E21"],[7713,2],[7714,1,"\u1E23"],[7715,2],[7716,1,"\u1E25"],[7717,2],[7718,1,"\u1E27"],[7719,2],[7720,1,"\u1E29"],[7721,2],[7722,1,"\u1E2B"],[7723,2],[7724,1,"\u1E2D"],[7725,2],[7726,1,"\u1E2F"],[7727,2],[7728,1,"\u1E31"],[7729,2],[7730,1,"\u1E33"],[7731,2],[7732,1,"\u1E35"],[7733,2],[7734,1,"\u1E37"],[7735,2],[7736,1,"\u1E39"],[7737,2],[7738,1,"\u1E3B"],[7739,2],[7740,1,"\u1E3D"],[7741,2],[7742,1,"\u1E3F"],[7743,2],[7744,1,"\u1E41"],[7745,2],[7746,1,"\u1E43"],[7747,2],[7748,1,"\u1E45"],[7749,2],[7750,1,"\u1E47"],[7751,2],[7752,1,"\u1E49"],[7753,2],[7754,1,"\u1E4B"],[7755,2],[7756,1,"\u1E4D"],[7757,2],[7758,1,"\u1E4F"],[7759,2],[7760,1,"\u1E51"],[7761,2],[7762,1,"\u1E53"],[7763,2],[7764,1,"\u1E55"],[7765,2],[7766,1,"\u1E57"],[7767,2],[7768,1,"\u1E59"],[7769,2],[7770,1,"\u1E5B"],[7771,2],[7772,1,"\u1E5D"],[7773,2],[7774,1,"\u1E5F"],[7775,2],[7776,1,"\u1E61"],[7777,2],[7778,1,"\u1E63"],[7779,2],[7780,1,"\u1E65"],[7781,2],[7782,1,"\u1E67"],[7783,2],[7784,1,"\u1E69"],[7785,2],[7786,1,"\u1E6B"],[7787,2],[7788,1,"\u1E6D"],[7789,2],[7790,1,"\u1E6F"],[7791,2],[7792,1,"\u1E71"],[7793,2],[7794,1,"\u1E73"],[7795,2],[7796,1,"\u1E75"],[7797,2],[7798,1,"\u1E77"],[7799,2],[7800,1,"\u1E79"],[7801,2],[7802,1,"\u1E7B"],[7803,2],[7804,1,"\u1E7D"],[7805,2],[7806,1,"\u1E7F"],[7807,2],[7808,1,"\u1E81"],[7809,2],[7810,1,"\u1E83"],[7811,2],[7812,1,"\u1E85"],[7813,2],[7814,1,"\u1E87"],[7815,2],[7816,1,"\u1E89"],[7817,2],[7818,1,"\u1E8B"],[7819,2],[7820,1,"\u1E8D"],[7821,2],[7822,1,"\u1E8F"],[7823,2],[7824,1,"\u1E91"],[7825,2],[7826,1,"\u1E93"],[7827,2],[7828,1,"\u1E95"],[[7829,7833],2],[7834,1,"a\u02BE"],[7835,1,"\u1E61"],[[7836,7837],2],[7838,1,"ss"],[7839,2],[7840,1,"\u1EA1"],[7841,2],[7842,1,"\u1EA3"],[7843,2],[7844,1,"\u1EA5"],[7845,2],[7846,1,"\u1EA7"],[7847,2],[7848,1,"\u1EA9"],[7849,2],[7850,1,"\u1EAB"],[7851,2],[7852,1,"\u1EAD"],[7853,2],[7854,1,"\u1EAF"],[7855,2],[7856,1,"\u1EB1"],[7857,2],[7858,1,"\u1EB3"],[7859,2],[7860,1,"\u1EB5"],[7861,2],[7862,1,"\u1EB7"],[7863,2],[7864,1,"\u1EB9"],[7865,2],[7866,1,"\u1EBB"],[7867,2],[7868,1,"\u1EBD"],[7869,2],[7870,1,"\u1EBF"],[7871,2],[7872,1,"\u1EC1"],[7873,2],[7874,1,"\u1EC3"],[7875,2],[7876,1,"\u1EC5"],[7877,2],[7878,1,"\u1EC7"],[7879,2],[7880,1,"\u1EC9"],[7881,2],[7882,1,"\u1ECB"],[7883,2],[7884,1,"\u1ECD"],[7885,2],[7886,1,"\u1ECF"],[7887,2],[7888,1,"\u1ED1"],[7889,2],[7890,1,"\u1ED3"],[7891,2],[7892,1,"\u1ED5"],[7893,2],[7894,1,"\u1ED7"],[7895,2],[7896,1,"\u1ED9"],[7897,2],[7898,1,"\u1EDB"],[7899,2],[7900,1,"\u1EDD"],[7901,2],[7902,1,"\u1EDF"],[7903,2],[7904,1,"\u1EE1"],[7905,2],[7906,1,"\u1EE3"],[7907,2],[7908,1,"\u1EE5"],[7909,2],[7910,1,"\u1EE7"],[7911,2],[7912,1,"\u1EE9"],[7913,2],[7914,1,"\u1EEB"],[7915,2],[7916,1,"\u1EED"],[7917,2],[7918,1,"\u1EEF"],[7919,2],[7920,1,"\u1EF1"],[7921,2],[7922,1,"\u1EF3"],[7923,2],[7924,1,"\u1EF5"],[7925,2],[7926,1,"\u1EF7"],[7927,2],[7928,1,"\u1EF9"],[7929,2],[7930,1,"\u1EFB"],[7931,2],[7932,1,"\u1EFD"],[7933,2],[7934,1,"\u1EFF"],[7935,2],[[7936,7943],2],[7944,1,"\u1F00"],[7945,1,"\u1F01"],[7946,1,"\u1F02"],[7947,1,"\u1F03"],[7948,1,"\u1F04"],[7949,1,"\u1F05"],[7950,1,"\u1F06"],[7951,1,"\u1F07"],[[7952,7957],2],[[7958,7959],3],[7960,1,"\u1F10"],[7961,1,"\u1F11"],[7962,1,"\u1F12"],[7963,1,"\u1F13"],[7964,1,"\u1F14"],[7965,1,"\u1F15"],[[7966,7967],3],[[7968,7975],2],[7976,1,"\u1F20"],[7977,1,"\u1F21"],[7978,1,"\u1F22"],[7979,1,"\u1F23"],[7980,1,"\u1F24"],[7981,1,"\u1F25"],[7982,1,"\u1F26"],[7983,1,"\u1F27"],[[7984,7991],2],[7992,1,"\u1F30"],[7993,1,"\u1F31"],[7994,1,"\u1F32"],[7995,1,"\u1F33"],[7996,1,"\u1F34"],[7997,1,"\u1F35"],[7998,1,"\u1F36"],[7999,1,"\u1F37"],[[8000,8005],2],[[8006,8007],3],[8008,1,"\u1F40"],[8009,1,"\u1F41"],[8010,1,"\u1F42"],[8011,1,"\u1F43"],[8012,1,"\u1F44"],[8013,1,"\u1F45"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"\u1F51"],[8026,3],[8027,1,"\u1F53"],[8028,3],[8029,1,"\u1F55"],[8030,3],[8031,1,"\u1F57"],[[8032,8039],2],[8040,1,"\u1F60"],[8041,1,"\u1F61"],[8042,1,"\u1F62"],[8043,1,"\u1F63"],[8044,1,"\u1F64"],[8045,1,"\u1F65"],[8046,1,"\u1F66"],[8047,1,"\u1F67"],[8048,2],[8049,1,"\u03AC"],[8050,2],[8051,1,"\u03AD"],[8052,2],[8053,1,"\u03AE"],[8054,2],[8055,1,"\u03AF"],[8056,2],[8057,1,"\u03CC"],[8058,2],[8059,1,"\u03CD"],[8060,2],[8061,1,"\u03CE"],[[8062,8063],3],[8064,1,"\u1F00\u03B9"],[8065,1,"\u1F01\u03B9"],[8066,1,"\u1F02\u03B9"],[8067,1,"\u1F03\u03B9"],[8068,1,"\u1F04\u03B9"],[8069,1,"\u1F05\u03B9"],[8070,1,"\u1F06\u03B9"],[8071,1,"\u1F07\u03B9"],[8072,1,"\u1F00\u03B9"],[8073,1,"\u1F01\u03B9"],[8074,1,"\u1F02\u03B9"],[8075,1,"\u1F03\u03B9"],[8076,1,"\u1F04\u03B9"],[8077,1,"\u1F05\u03B9"],[8078,1,"\u1F06\u03B9"],[8079,1,"\u1F07\u03B9"],[8080,1,"\u1F20\u03B9"],[8081,1,"\u1F21\u03B9"],[8082,1,"\u1F22\u03B9"],[8083,1,"\u1F23\u03B9"],[8084,1,"\u1F24\u03B9"],[8085,1,"\u1F25\u03B9"],[8086,1,"\u1F26\u03B9"],[8087,1,"\u1F27\u03B9"],[8088,1,"\u1F20\u03B9"],[8089,1,"\u1F21\u03B9"],[8090,1,"\u1F22\u03B9"],[8091,1,"\u1F23\u03B9"],[8092,1,"\u1F24\u03B9"],[8093,1,"\u1F25\u03B9"],[8094,1,"\u1F26\u03B9"],[8095,1,"\u1F27\u03B9"],[8096,1,"\u1F60\u03B9"],[8097,1,"\u1F61\u03B9"],[8098,1,"\u1F62\u03B9"],[8099,1,"\u1F63\u03B9"],[8100,1,"\u1F64\u03B9"],[8101,1,"\u1F65\u03B9"],[8102,1,"\u1F66\u03B9"],[8103,1,"\u1F67\u03B9"],[8104,1,"\u1F60\u03B9"],[8105,1,"\u1F61\u03B9"],[8106,1,"\u1F62\u03B9"],[8107,1,"\u1F63\u03B9"],[8108,1,"\u1F64\u03B9"],[8109,1,"\u1F65\u03B9"],[8110,1,"\u1F66\u03B9"],[8111,1,"\u1F67\u03B9"],[[8112,8113],2],[8114,1,"\u1F70\u03B9"],[8115,1,"\u03B1\u03B9"],[8116,1,"\u03AC\u03B9"],[8117,3],[8118,2],[8119,1,"\u1FB6\u03B9"],[8120,1,"\u1FB0"],[8121,1,"\u1FB1"],[8122,1,"\u1F70"],[8123,1,"\u03AC"],[8124,1,"\u03B1\u03B9"],[8125,5," \u0313"],[8126,1,"\u03B9"],[8127,5," \u0313"],[8128,5," \u0342"],[8129,5," \u0308\u0342"],[8130,1,"\u1F74\u03B9"],[8131,1,"\u03B7\u03B9"],[8132,1,"\u03AE\u03B9"],[8133,3],[8134,2],[8135,1,"\u1FC6\u03B9"],[8136,1,"\u1F72"],[8137,1,"\u03AD"],[8138,1,"\u1F74"],[8139,1,"\u03AE"],[8140,1,"\u03B7\u03B9"],[8141,5," \u0313\u0300"],[8142,5," \u0313\u0301"],[8143,5," \u0313\u0342"],[[8144,8146],2],[8147,1,"\u0390"],[[8148,8149],3],[[8150,8151],2],[8152,1,"\u1FD0"],[8153,1,"\u1FD1"],[8154,1,"\u1F76"],[8155,1,"\u03AF"],[8156,3],[8157,5," \u0314\u0300"],[8158,5," \u0314\u0301"],[8159,5," \u0314\u0342"],[[8160,8162],2],[8163,1,"\u03B0"],[[8164,8167],2],[8168,1,"\u1FE0"],[8169,1,"\u1FE1"],[8170,1,"\u1F7A"],[8171,1,"\u03CD"],[8172,1,"\u1FE5"],[8173,5," \u0308\u0300"],[8174,5," \u0308\u0301"],[8175,5,"`"],[[8176,8177],3],[8178,1,"\u1F7C\u03B9"],[8179,1,"\u03C9\u03B9"],[8180,1,"\u03CE\u03B9"],[8181,3],[8182,2],[8183,1,"\u1FF6\u03B9"],[8184,1,"\u1F78"],[8185,1,"\u03CC"],[8186,1,"\u1F7C"],[8187,1,"\u03CE"],[8188,1,"\u03C9\u03B9"],[8189,5," \u0301"],[8190,5," \u0314"],[8191,3],[[8192,8202],5," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"\u2010"],[[8210,8214],2],[8215,5," \u0333"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,5," "],[[8240,8242],2],[8243,1,"\u2032\u2032"],[8244,1,"\u2032\u2032\u2032"],[8245,2],[8246,1,"\u2035\u2035"],[8247,1,"\u2035\u2035\u2035"],[[8248,8251],2],[8252,5,"!!"],[8253,2],[8254,5," \u0305"],[[8255,8262],2],[8263,5,"??"],[8264,5,"?!"],[8265,5,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"\u2032\u2032\u2032\u2032"],[[8280,8286],2],[8287,5," "],[8288,7],[[8289,8291],3],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],3],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,5,"+"],[8315,1,"\u2212"],[8316,5,"="],[8317,5,"("],[8318,5,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,5,"+"],[8331,1,"\u2212"],[8332,5,"="],[8333,5,"("],[8334,5,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"\u0259"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,5,"a/c"],[8449,5,"a/s"],[8450,1,"c"],[8451,1,"\xB0c"],[8452,2],[8453,5,"c/o"],[8454,5,"c/u"],[8455,1,"\u025B"],[8456,2],[8457,1,"\xB0f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"\u0127"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"\u03C9"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"\xE5"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,3],[8499,1,"m"],[8500,1,"o"],[8501,1,"\u05D0"],[8502,1,"\u05D1"],[8503,1,"\u05D2"],[8504,1,"\u05D3"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"\u03C0"],[[8509,8510],1,"\u03B3"],[8511,1,"\u03C0"],[8512,1,"\u2211"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1\u20447"],[8529,1,"1\u20449"],[8530,1,"1\u204410"],[8531,1,"1\u20443"],[8532,1,"2\u20443"],[8533,1,"1\u20445"],[8534,1,"2\u20445"],[8535,1,"3\u20445"],[8536,1,"4\u20445"],[8537,1,"1\u20446"],[8538,1,"5\u20446"],[8539,1,"1\u20448"],[8540,1,"3\u20448"],[8541,1,"5\u20448"],[8542,1,"7\u20448"],[8543,1,"1\u2044"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,3],[8580,2],[[8581,8584],2],[8585,1,"0\u20443"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"\u222B\u222B"],[8749,1,"\u222B\u222B\u222B"],[8750,2],[8751,1,"\u222E\u222E"],[8752,1,"\u222E\u222E\u222E"],[[8753,8799],2],[8800,4],[[8801,8813],2],[[8814,8815],4],[[8816,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"\u3008"],[9002,1,"\u3009"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,5,"(1)"],[9333,5,"(2)"],[9334,5,"(3)"],[9335,5,"(4)"],[9336,5,"(5)"],[9337,5,"(6)"],[9338,5,"(7)"],[9339,5,"(8)"],[9340,5,"(9)"],[9341,5,"(10)"],[9342,5,"(11)"],[9343,5,"(12)"],[9344,5,"(13)"],[9345,5,"(14)"],[9346,5,"(15)"],[9347,5,"(16)"],[9348,5,"(17)"],[9349,5,"(18)"],[9350,5,"(19)"],[9351,5,"(20)"],[[9352,9371],3],[9372,5,"(a)"],[9373,5,"(b)"],[9374,5,"(c)"],[9375,5,"(d)"],[9376,5,"(e)"],[9377,5,"(f)"],[9378,5,"(g)"],[9379,5,"(h)"],[9380,5,"(i)"],[9381,5,"(j)"],[9382,5,"(k)"],[9383,5,"(l)"],[9384,5,"(m)"],[9385,5,"(n)"],[9386,5,"(o)"],[9387,5,"(p)"],[9388,5,"(q)"],[9389,5,"(r)"],[9390,5,"(s)"],[9391,5,"(t)"],[9392,5,"(u)"],[9393,5,"(v)"],[9394,5,"(w)"],[9395,5,"(x)"],[9396,5,"(y)"],[9397,5,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"\u222B\u222B\u222B\u222B"],[[10765,10867],2],[10868,5,"::="],[10869,5,"=="],[10870,5,"==="],[[10871,10971],2],[10972,1,"\u2ADD\u0338"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"\u2C30"],[11265,1,"\u2C31"],[11266,1,"\u2C32"],[11267,1,"\u2C33"],[11268,1,"\u2C34"],[11269,1,"\u2C35"],[11270,1,"\u2C36"],[11271,1,"\u2C37"],[11272,1,"\u2C38"],[11273,1,"\u2C39"],[11274,1,"\u2C3A"],[11275,1,"\u2C3B"],[11276,1,"\u2C3C"],[11277,1,"\u2C3D"],[11278,1,"\u2C3E"],[11279,1,"\u2C3F"],[11280,1,"\u2C40"],[11281,1,"\u2C41"],[11282,1,"\u2C42"],[11283,1,"\u2C43"],[11284,1,"\u2C44"],[11285,1,"\u2C45"],[11286,1,"\u2C46"],[11287,1,"\u2C47"],[11288,1,"\u2C48"],[11289,1,"\u2C49"],[11290,1,"\u2C4A"],[11291,1,"\u2C4B"],[11292,1,"\u2C4C"],[11293,1,"\u2C4D"],[11294,1,"\u2C4E"],[11295,1,"\u2C4F"],[11296,1,"\u2C50"],[11297,1,"\u2C51"],[11298,1,"\u2C52"],[11299,1,"\u2C53"],[11300,1,"\u2C54"],[11301,1,"\u2C55"],[11302,1,"\u2C56"],[11303,1,"\u2C57"],[11304,1,"\u2C58"],[11305,1,"\u2C59"],[11306,1,"\u2C5A"],[11307,1,"\u2C5B"],[11308,1,"\u2C5C"],[11309,1,"\u2C5D"],[11310,1,"\u2C5E"],[11311,1,"\u2C5F"],[[11312,11358],2],[11359,2],[11360,1,"\u2C61"],[11361,2],[11362,1,"\u026B"],[11363,1,"\u1D7D"],[11364,1,"\u027D"],[[11365,11366],2],[11367,1,"\u2C68"],[11368,2],[11369,1,"\u2C6A"],[11370,2],[11371,1,"\u2C6C"],[11372,2],[11373,1,"\u0251"],[11374,1,"\u0271"],[11375,1,"\u0250"],[11376,1,"\u0252"],[11377,2],[11378,1,"\u2C73"],[11379,2],[11380,2],[11381,1,"\u2C76"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"\u023F"],[11391,1,"\u0240"],[11392,1,"\u2C81"],[11393,2],[11394,1,"\u2C83"],[11395,2],[11396,1,"\u2C85"],[11397,2],[11398,1,"\u2C87"],[11399,2],[11400,1,"\u2C89"],[11401,2],[11402,1,"\u2C8B"],[11403,2],[11404,1,"\u2C8D"],[11405,2],[11406,1,"\u2C8F"],[11407,2],[11408,1,"\u2C91"],[11409,2],[11410,1,"\u2C93"],[11411,2],[11412,1,"\u2C95"],[11413,2],[11414,1,"\u2C97"],[11415,2],[11416,1,"\u2C99"],[11417,2],[11418,1,"\u2C9B"],[11419,2],[11420,1,"\u2C9D"],[11421,2],[11422,1,"\u2C9F"],[11423,2],[11424,1,"\u2CA1"],[11425,2],[11426,1,"\u2CA3"],[11427,2],[11428,1,"\u2CA5"],[11429,2],[11430,1,"\u2CA7"],[11431,2],[11432,1,"\u2CA9"],[11433,2],[11434,1,"\u2CAB"],[11435,2],[11436,1,"\u2CAD"],[11437,2],[11438,1,"\u2CAF"],[11439,2],[11440,1,"\u2CB1"],[11441,2],[11442,1,"\u2CB3"],[11443,2],[11444,1,"\u2CB5"],[11445,2],[11446,1,"\u2CB7"],[11447,2],[11448,1,"\u2CB9"],[11449,2],[11450,1,"\u2CBB"],[11451,2],[11452,1,"\u2CBD"],[11453,2],[11454,1,"\u2CBF"],[11455,2],[11456,1,"\u2CC1"],[11457,2],[11458,1,"\u2CC3"],[11459,2],[11460,1,"\u2CC5"],[11461,2],[11462,1,"\u2CC7"],[11463,2],[11464,1,"\u2CC9"],[11465,2],[11466,1,"\u2CCB"],[11467,2],[11468,1,"\u2CCD"],[11469,2],[11470,1,"\u2CCF"],[11471,2],[11472,1,"\u2CD1"],[11473,2],[11474,1,"\u2CD3"],[11475,2],[11476,1,"\u2CD5"],[11477,2],[11478,1,"\u2CD7"],[11479,2],[11480,1,"\u2CD9"],[11481,2],[11482,1,"\u2CDB"],[11483,2],[11484,1,"\u2CDD"],[11485,2],[11486,1,"\u2CDF"],[11487,2],[11488,1,"\u2CE1"],[11489,2],[11490,1,"\u2CE3"],[[11491,11492],2],[[11493,11498],2],[11499,1,"\u2CEC"],[11500,2],[11501,1,"\u2CEE"],[[11502,11505],2],[11506,1,"\u2CF3"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"\u2D61"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"\u6BCD"],[[11936,12018],2],[12019,1,"\u9F9F"],[[12020,12031],3],[12032,1,"\u4E00"],[12033,1,"\u4E28"],[12034,1,"\u4E36"],[12035,1,"\u4E3F"],[12036,1,"\u4E59"],[12037,1,"\u4E85"],[12038,1,"\u4E8C"],[12039,1,"\u4EA0"],[12040,1,"\u4EBA"],[12041,1,"\u513F"],[12042,1,"\u5165"],[12043,1,"\u516B"],[12044,1,"\u5182"],[12045,1,"\u5196"],[12046,1,"\u51AB"],[12047,1,"\u51E0"],[12048,1,"\u51F5"],[12049,1,"\u5200"],[12050,1,"\u529B"],[12051,1,"\u52F9"],[12052,1,"\u5315"],[12053,1,"\u531A"],[12054,1,"\u5338"],[12055,1,"\u5341"],[12056,1,"\u535C"],[12057,1,"\u5369"],[12058,1,"\u5382"],[12059,1,"\u53B6"],[12060,1,"\u53C8"],[12061,1,"\u53E3"],[12062,1,"\u56D7"],[12063,1,"\u571F"],[12064,1,"\u58EB"],[12065,1,"\u5902"],[12066,1,"\u590A"],[12067,1,"\u5915"],[12068,1,"\u5927"],[12069,1,"\u5973"],[12070,1,"\u5B50"],[12071,1,"\u5B80"],[12072,1,"\u5BF8"],[12073,1,"\u5C0F"],[12074,1,"\u5C22"],[12075,1,"\u5C38"],[12076,1,"\u5C6E"],[12077,1,"\u5C71"],[12078,1,"\u5DDB"],[12079,1,"\u5DE5"],[12080,1,"\u5DF1"],[12081,1,"\u5DFE"],[12082,1,"\u5E72"],[12083,1,"\u5E7A"],[12084,1,"\u5E7F"],[12085,1,"\u5EF4"],[12086,1,"\u5EFE"],[12087,1,"\u5F0B"],[12088,1,"\u5F13"],[12089,1,"\u5F50"],[12090,1,"\u5F61"],[12091,1,"\u5F73"],[12092,1,"\u5FC3"],[12093,1,"\u6208"],[12094,1,"\u6236"],[12095,1,"\u624B"],[12096,1,"\u652F"],[12097,1,"\u6534"],[12098,1,"\u6587"],[12099,1,"\u6597"],[12100,1,"\u65A4"],[12101,1,"\u65B9"],[12102,1,"\u65E0"],[12103,1,"\u65E5"],[12104,1,"\u66F0"],[12105,1,"\u6708"],[12106,1,"\u6728"],[12107,1,"\u6B20"],[12108,1,"\u6B62"],[12109,1,"\u6B79"],[12110,1,"\u6BB3"],[12111,1,"\u6BCB"],[12112,1,"\u6BD4"],[12113,1,"\u6BDB"],[12114,1,"\u6C0F"],[12115,1,"\u6C14"],[12116,1,"\u6C34"],[12117,1,"\u706B"],[12118,1,"\u722A"],[12119,1,"\u7236"],[12120,1,"\u723B"],[12121,1,"\u723F"],[12122,1,"\u7247"],[12123,1,"\u7259"],[12124,1,"\u725B"],[12125,1,"\u72AC"],[12126,1,"\u7384"],[12127,1,"\u7389"],[12128,1,"\u74DC"],[12129,1,"\u74E6"],[12130,1,"\u7518"],[12131,1,"\u751F"],[12132,1,"\u7528"],[12133,1,"\u7530"],[12134,1,"\u758B"],[12135,1,"\u7592"],[12136,1,"\u7676"],[12137,1,"\u767D"],[12138,1,"\u76AE"],[12139,1,"\u76BF"],[12140,1,"\u76EE"],[12141,1,"\u77DB"],[12142,1,"\u77E2"],[12143,1,"\u77F3"],[12144,1,"\u793A"],[12145,1,"\u79B8"],[12146,1,"\u79BE"],[12147,1,"\u7A74"],[12148,1,"\u7ACB"],[12149,1,"\u7AF9"],[12150,1,"\u7C73"],[12151,1,"\u7CF8"],[12152,1,"\u7F36"],[12153,1,"\u7F51"],[12154,1,"\u7F8A"],[12155,1,"\u7FBD"],[12156,1,"\u8001"],[12157,1,"\u800C"],[12158,1,"\u8012"],[12159,1,"\u8033"],[12160,1,"\u807F"],[12161,1,"\u8089"],[12162,1,"\u81E3"],[12163,1,"\u81EA"],[12164,1,"\u81F3"],[12165,1,"\u81FC"],[12166,1,"\u820C"],[12167,1,"\u821B"],[12168,1,"\u821F"],[12169,1,"\u826E"],[12170,1,"\u8272"],[12171,1,"\u8278"],[12172,1,"\u864D"],[12173,1,"\u866B"],[12174,1,"\u8840"],[12175,1,"\u884C"],[12176,1,"\u8863"],[12177,1,"\u897E"],[12178,1,"\u898B"],[12179,1,"\u89D2"],[12180,1,"\u8A00"],[12181,1,"\u8C37"],[12182,1,"\u8C46"],[12183,1,"\u8C55"],[12184,1,"\u8C78"],[12185,1,"\u8C9D"],[12186,1,"\u8D64"],[12187,1,"\u8D70"],[12188,1,"\u8DB3"],[12189,1,"\u8EAB"],[12190,1,"\u8ECA"],[12191,1,"\u8F9B"],[12192,1,"\u8FB0"],[12193,1,"\u8FB5"],[12194,1,"\u9091"],[12195,1,"\u9149"],[12196,1,"\u91C6"],[12197,1,"\u91CC"],[12198,1,"\u91D1"],[12199,1,"\u9577"],[12200,1,"\u9580"],[12201,1,"\u961C"],[12202,1,"\u96B6"],[12203,1,"\u96B9"],[12204,1,"\u96E8"],[12205,1,"\u9751"],[12206,1,"\u975E"],[12207,1,"\u9762"],[12208,1,"\u9769"],[12209,1,"\u97CB"],[12210,1,"\u97ED"],[12211,1,"\u97F3"],[12212,1,"\u9801"],[12213,1,"\u98A8"],[12214,1,"\u98DB"],[12215,1,"\u98DF"],[12216,1,"\u9996"],[12217,1,"\u9999"],[12218,1,"\u99AC"],[12219,1,"\u9AA8"],[12220,1,"\u9AD8"],[12221,1,"\u9ADF"],[12222,1,"\u9B25"],[12223,1,"\u9B2F"],[12224,1,"\u9B32"],[12225,1,"\u9B3C"],[12226,1,"\u9B5A"],[12227,1,"\u9CE5"],[12228,1,"\u9E75"],[12229,1,"\u9E7F"],[12230,1,"\u9EA5"],[12231,1,"\u9EBB"],[12232,1,"\u9EC3"],[12233,1,"\u9ECD"],[12234,1,"\u9ED1"],[12235,1,"\u9EF9"],[12236,1,"\u9EFD"],[12237,1,"\u9F0E"],[12238,1,"\u9F13"],[12239,1,"\u9F20"],[12240,1,"\u9F3B"],[12241,1,"\u9F4A"],[12242,1,"\u9F52"],[12243,1,"\u9F8D"],[12244,1,"\u9F9C"],[12245,1,"\u9FA0"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,5," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"\u3012"],[12343,2],[12344,1,"\u5341"],[12345,1,"\u5344"],[12346,1,"\u5345"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,5," \u3099"],[12444,5," \u309A"],[[12445,12446],2],[12447,1,"\u3088\u308A"],[12448,2],[[12449,12542],2],[12543,1,"\u30B3\u30C8"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"\u1100"],[12594,1,"\u1101"],[12595,1,"\u11AA"],[12596,1,"\u1102"],[12597,1,"\u11AC"],[12598,1,"\u11AD"],[12599,1,"\u1103"],[12600,1,"\u1104"],[12601,1,"\u1105"],[12602,1,"\u11B0"],[12603,1,"\u11B1"],[12604,1,"\u11B2"],[12605,1,"\u11B3"],[12606,1,"\u11B4"],[12607,1,"\u11B5"],[12608,1,"\u111A"],[12609,1,"\u1106"],[12610,1,"\u1107"],[12611,1,"\u1108"],[12612,1,"\u1121"],[12613,1,"\u1109"],[12614,1,"\u110A"],[12615,1,"\u110B"],[12616,1,"\u110C"],[12617,1,"\u110D"],[12618,1,"\u110E"],[12619,1,"\u110F"],[12620,1,"\u1110"],[12621,1,"\u1111"],[12622,1,"\u1112"],[12623,1,"\u1161"],[12624,1,"\u1162"],[12625,1,"\u1163"],[12626,1,"\u1164"],[12627,1,"\u1165"],[12628,1,"\u1166"],[12629,1,"\u1167"],[12630,1,"\u1168"],[12631,1,"\u1169"],[12632,1,"\u116A"],[12633,1,"\u116B"],[12634,1,"\u116C"],[12635,1,"\u116D"],[12636,1,"\u116E"],[12637,1,"\u116F"],[12638,1,"\u1170"],[12639,1,"\u1171"],[12640,1,"\u1172"],[12641,1,"\u1173"],[12642,1,"\u1174"],[12643,1,"\u1175"],[12644,3],[12645,1,"\u1114"],[12646,1,"\u1115"],[12647,1,"\u11C7"],[12648,1,"\u11C8"],[12649,1,"\u11CC"],[12650,1,"\u11CE"],[12651,1,"\u11D3"],[12652,1,"\u11D7"],[12653,1,"\u11D9"],[12654,1,"\u111C"],[12655,1,"\u11DD"],[12656,1,"\u11DF"],[12657,1,"\u111D"],[12658,1,"\u111E"],[12659,1,"\u1120"],[12660,1,"\u1122"],[12661,1,"\u1123"],[12662,1,"\u1127"],[12663,1,"\u1129"],[12664,1,"\u112B"],[12665,1,"\u112C"],[12666,1,"\u112D"],[12667,1,"\u112E"],[12668,1,"\u112F"],[12669,1,"\u1132"],[12670,1,"\u1136"],[12671,1,"\u1140"],[12672,1,"\u1147"],[12673,1,"\u114C"],[12674,1,"\u11F1"],[12675,1,"\u11F2"],[12676,1,"\u1157"],[12677,1,"\u1158"],[12678,1,"\u1159"],[12679,1,"\u1184"],[12680,1,"\u1185"],[12681,1,"\u1188"],[12682,1,"\u1191"],[12683,1,"\u1192"],[12684,1,"\u1194"],[12685,1,"\u119E"],[12686,1,"\u11A1"],[12687,3],[[12688,12689],2],[12690,1,"\u4E00"],[12691,1,"\u4E8C"],[12692,1,"\u4E09"],[12693,1,"\u56DB"],[12694,1,"\u4E0A"],[12695,1,"\u4E2D"],[12696,1,"\u4E0B"],[12697,1,"\u7532"],[12698,1,"\u4E59"],[12699,1,"\u4E19"],[12700,1,"\u4E01"],[12701,1,"\u5929"],[12702,1,"\u5730"],[12703,1,"\u4EBA"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12783],3],[[12784,12799],2],[12800,5,"(\u1100)"],[12801,5,"(\u1102)"],[12802,5,"(\u1103)"],[12803,5,"(\u1105)"],[12804,5,"(\u1106)"],[12805,5,"(\u1107)"],[12806,5,"(\u1109)"],[12807,5,"(\u110B)"],[12808,5,"(\u110C)"],[12809,5,"(\u110E)"],[12810,5,"(\u110F)"],[12811,5,"(\u1110)"],[12812,5,"(\u1111)"],[12813,5,"(\u1112)"],[12814,5,"(\uAC00)"],[12815,5,"(\uB098)"],[12816,5,"(\uB2E4)"],[12817,5,"(\uB77C)"],[12818,5,"(\uB9C8)"],[12819,5,"(\uBC14)"],[12820,5,"(\uC0AC)"],[12821,5,"(\uC544)"],[12822,5,"(\uC790)"],[12823,5,"(\uCC28)"],[12824,5,"(\uCE74)"],[12825,5,"(\uD0C0)"],[12826,5,"(\uD30C)"],[12827,5,"(\uD558)"],[12828,5,"(\uC8FC)"],[12829,5,"(\uC624\uC804)"],[12830,5,"(\uC624\uD6C4)"],[12831,3],[12832,5,"(\u4E00)"],[12833,5,"(\u4E8C)"],[12834,5,"(\u4E09)"],[12835,5,"(\u56DB)"],[12836,5,"(\u4E94)"],[12837,5,"(\u516D)"],[12838,5,"(\u4E03)"],[12839,5,"(\u516B)"],[12840,5,"(\u4E5D)"],[12841,5,"(\u5341)"],[12842,5,"(\u6708)"],[12843,5,"(\u706B)"],[12844,5,"(\u6C34)"],[12845,5,"(\u6728)"],[12846,5,"(\u91D1)"],[12847,5,"(\u571F)"],[12848,5,"(\u65E5)"],[12849,5,"(\u682A)"],[12850,5,"(\u6709)"],[12851,5,"(\u793E)"],[12852,5,"(\u540D)"],[12853,5,"(\u7279)"],[12854,5,"(\u8CA1)"],[12855,5,"(\u795D)"],[12856,5,"(\u52B4)"],[12857,5,"(\u4EE3)"],[12858,5,"(\u547C)"],[12859,5,"(\u5B66)"],[12860,5,"(\u76E3)"],[12861,5,"(\u4F01)"],[12862,5,"(\u8CC7)"],[12863,5,"(\u5354)"],[12864,5,"(\u796D)"],[12865,5,"(\u4F11)"],[12866,5,"(\u81EA)"],[12867,5,"(\u81F3)"],[12868,1,"\u554F"],[12869,1,"\u5E7C"],[12870,1,"\u6587"],[12871,1,"\u7B8F"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"\u1100"],[12897,1,"\u1102"],[12898,1,"\u1103"],[12899,1,"\u1105"],[12900,1,"\u1106"],[12901,1,"\u1107"],[12902,1,"\u1109"],[12903,1,"\u110B"],[12904,1,"\u110C"],[12905,1,"\u110E"],[12906,1,"\u110F"],[12907,1,"\u1110"],[12908,1,"\u1111"],[12909,1,"\u1112"],[12910,1,"\uAC00"],[12911,1,"\uB098"],[12912,1,"\uB2E4"],[12913,1,"\uB77C"],[12914,1,"\uB9C8"],[12915,1,"\uBC14"],[12916,1,"\uC0AC"],[12917,1,"\uC544"],[12918,1,"\uC790"],[12919,1,"\uCC28"],[12920,1,"\uCE74"],[12921,1,"\uD0C0"],[12922,1,"\uD30C"],[12923,1,"\uD558"],[12924,1,"\uCC38\uACE0"],[12925,1,"\uC8FC\uC758"],[12926,1,"\uC6B0"],[12927,2],[12928,1,"\u4E00"],[12929,1,"\u4E8C"],[12930,1,"\u4E09"],[12931,1,"\u56DB"],[12932,1,"\u4E94"],[12933,1,"\u516D"],[12934,1,"\u4E03"],[12935,1,"\u516B"],[12936,1,"\u4E5D"],[12937,1,"\u5341"],[12938,1,"\u6708"],[12939,1,"\u706B"],[12940,1,"\u6C34"],[12941,1,"\u6728"],[12942,1,"\u91D1"],[12943,1,"\u571F"],[12944,1,"\u65E5"],[12945,1,"\u682A"],[12946,1,"\u6709"],[12947,1,"\u793E"],[12948,1,"\u540D"],[12949,1,"\u7279"],[12950,1,"\u8CA1"],[12951,1,"\u795D"],[12952,1,"\u52B4"],[12953,1,"\u79D8"],[12954,1,"\u7537"],[12955,1,"\u5973"],[12956,1,"\u9069"],[12957,1,"\u512A"],[12958,1,"\u5370"],[12959,1,"\u6CE8"],[12960,1,"\u9805"],[12961,1,"\u4F11"],[12962,1,"\u5199"],[12963,1,"\u6B63"],[12964,1,"\u4E0A"],[12965,1,"\u4E2D"],[12966,1,"\u4E0B"],[12967,1,"\u5DE6"],[12968,1,"\u53F3"],[12969,1,"\u533B"],[12970,1,"\u5B97"],[12971,1,"\u5B66"],[12972,1,"\u76E3"],[12973,1,"\u4F01"],[12974,1,"\u8CC7"],[12975,1,"\u5354"],[12976,1,"\u591C"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1\u6708"],[12993,1,"2\u6708"],[12994,1,"3\u6708"],[12995,1,"4\u6708"],[12996,1,"5\u6708"],[12997,1,"6\u6708"],[12998,1,"7\u6708"],[12999,1,"8\u6708"],[13000,1,"9\u6708"],[13001,1,"10\u6708"],[13002,1,"11\u6708"],[13003,1,"12\u6708"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"\u30A2"],[13009,1,"\u30A4"],[13010,1,"\u30A6"],[13011,1,"\u30A8"],[13012,1,"\u30AA"],[13013,1,"\u30AB"],[13014,1,"\u30AD"],[13015,1,"\u30AF"],[13016,1,"\u30B1"],[13017,1,"\u30B3"],[13018,1,"\u30B5"],[13019,1,"\u30B7"],[13020,1,"\u30B9"],[13021,1,"\u30BB"],[13022,1,"\u30BD"],[13023,1,"\u30BF"],[13024,1,"\u30C1"],[13025,1,"\u30C4"],[13026,1,"\u30C6"],[13027,1,"\u30C8"],[13028,1,"\u30CA"],[13029,1,"\u30CB"],[13030,1,"\u30CC"],[13031,1,"\u30CD"],[13032,1,"\u30CE"],[13033,1,"\u30CF"],[13034,1,"\u30D2"],[13035,1,"\u30D5"],[13036,1,"\u30D8"],[13037,1,"\u30DB"],[13038,1,"\u30DE"],[13039,1,"\u30DF"],[13040,1,"\u30E0"],[13041,1,"\u30E1"],[13042,1,"\u30E2"],[13043,1,"\u30E4"],[13044,1,"\u30E6"],[13045,1,"\u30E8"],[13046,1,"\u30E9"],[13047,1,"\u30EA"],[13048,1,"\u30EB"],[13049,1,"\u30EC"],[13050,1,"\u30ED"],[13051,1,"\u30EF"],[13052,1,"\u30F0"],[13053,1,"\u30F1"],[13054,1,"\u30F2"],[13055,1,"\u4EE4\u548C"],[13056,1,"\u30A2\u30D1\u30FC\u30C8"],[13057,1,"\u30A2\u30EB\u30D5\u30A1"],[13058,1,"\u30A2\u30F3\u30DA\u30A2"],[13059,1,"\u30A2\u30FC\u30EB"],[13060,1,"\u30A4\u30CB\u30F3\u30B0"],[13061,1,"\u30A4\u30F3\u30C1"],[13062,1,"\u30A6\u30A9\u30F3"],[13063,1,"\u30A8\u30B9\u30AF\u30FC\u30C9"],[13064,1,"\u30A8\u30FC\u30AB\u30FC"],[13065,1,"\u30AA\u30F3\u30B9"],[13066,1,"\u30AA\u30FC\u30E0"],[13067,1,"\u30AB\u30A4\u30EA"],[13068,1,"\u30AB\u30E9\u30C3\u30C8"],[13069,1,"\u30AB\u30ED\u30EA\u30FC"],[13070,1,"\u30AC\u30ED\u30F3"],[13071,1,"\u30AC\u30F3\u30DE"],[13072,1,"\u30AE\u30AC"],[13073,1,"\u30AE\u30CB\u30FC"],[13074,1,"\u30AD\u30E5\u30EA\u30FC"],[13075,1,"\u30AE\u30EB\u30C0\u30FC"],[13076,1,"\u30AD\u30ED"],[13077,1,"\u30AD\u30ED\u30B0\u30E9\u30E0"],[13078,1,"\u30AD\u30ED\u30E1\u30FC\u30C8\u30EB"],[13079,1,"\u30AD\u30ED\u30EF\u30C3\u30C8"],[13080,1,"\u30B0\u30E9\u30E0"],[13081,1,"\u30B0\u30E9\u30E0\u30C8\u30F3"],[13082,1,"\u30AF\u30EB\u30BC\u30A4\u30ED"],[13083,1,"\u30AF\u30ED\u30FC\u30CD"],[13084,1,"\u30B1\u30FC\u30B9"],[13085,1,"\u30B3\u30EB\u30CA"],[13086,1,"\u30B3\u30FC\u30DD"],[13087,1,"\u30B5\u30A4\u30AF\u30EB"],[13088,1,"\u30B5\u30F3\u30C1\u30FC\u30E0"],[13089,1,"\u30B7\u30EA\u30F3\u30B0"],[13090,1,"\u30BB\u30F3\u30C1"],[13091,1,"\u30BB\u30F3\u30C8"],[13092,1,"\u30C0\u30FC\u30B9"],[13093,1,"\u30C7\u30B7"],[13094,1,"\u30C9\u30EB"],[13095,1,"\u30C8\u30F3"],[13096,1,"\u30CA\u30CE"],[13097,1,"\u30CE\u30C3\u30C8"],[13098,1,"\u30CF\u30A4\u30C4"],[13099,1,"\u30D1\u30FC\u30BB\u30F3\u30C8"],[13100,1,"\u30D1\u30FC\u30C4"],[13101,1,"\u30D0\u30FC\u30EC\u30EB"],[13102,1,"\u30D4\u30A2\u30B9\u30C8\u30EB"],[13103,1,"\u30D4\u30AF\u30EB"],[13104,1,"\u30D4\u30B3"],[13105,1,"\u30D3\u30EB"],[13106,1,"\u30D5\u30A1\u30E9\u30C3\u30C9"],[13107,1,"\u30D5\u30A3\u30FC\u30C8"],[13108,1,"\u30D6\u30C3\u30B7\u30A7\u30EB"],[13109,1,"\u30D5\u30E9\u30F3"],[13110,1,"\u30D8\u30AF\u30BF\u30FC\u30EB"],[13111,1,"\u30DA\u30BD"],[13112,1,"\u30DA\u30CB\u30D2"],[13113,1,"\u30D8\u30EB\u30C4"],[13114,1,"\u30DA\u30F3\u30B9"],[13115,1,"\u30DA\u30FC\u30B8"],[13116,1,"\u30D9\u30FC\u30BF"],[13117,1,"\u30DD\u30A4\u30F3\u30C8"],[13118,1,"\u30DC\u30EB\u30C8"],[13119,1,"\u30DB\u30F3"],[13120,1,"\u30DD\u30F3\u30C9"],[13121,1,"\u30DB\u30FC\u30EB"],[13122,1,"\u30DB\u30FC\u30F3"],[13123,1,"\u30DE\u30A4\u30AF\u30ED"],[13124,1,"\u30DE\u30A4\u30EB"],[13125,1,"\u30DE\u30C3\u30CF"],[13126,1,"\u30DE\u30EB\u30AF"],[13127,1,"\u30DE\u30F3\u30B7\u30E7\u30F3"],[13128,1,"\u30DF\u30AF\u30ED\u30F3"],[13129,1,"\u30DF\u30EA"],[13130,1,"\u30DF\u30EA\u30D0\u30FC\u30EB"],[13131,1,"\u30E1\u30AC"],[13132,1,"\u30E1\u30AC\u30C8\u30F3"],[13133,1,"\u30E1\u30FC\u30C8\u30EB"],[13134,1,"\u30E4\u30FC\u30C9"],[13135,1,"\u30E4\u30FC\u30EB"],[13136,1,"\u30E6\u30A2\u30F3"],[13137,1,"\u30EA\u30C3\u30C8\u30EB"],[13138,1,"\u30EA\u30E9"],[13139,1,"\u30EB\u30D4\u30FC"],[13140,1,"\u30EB\u30FC\u30D6\u30EB"],[13141,1,"\u30EC\u30E0"],[13142,1,"\u30EC\u30F3\u30C8\u30B2\u30F3"],[13143,1,"\u30EF\u30C3\u30C8"],[13144,1,"0\u70B9"],[13145,1,"1\u70B9"],[13146,1,"2\u70B9"],[13147,1,"3\u70B9"],[13148,1,"4\u70B9"],[13149,1,"5\u70B9"],[13150,1,"6\u70B9"],[13151,1,"7\u70B9"],[13152,1,"8\u70B9"],[13153,1,"9\u70B9"],[13154,1,"10\u70B9"],[13155,1,"11\u70B9"],[13156,1,"12\u70B9"],[13157,1,"13\u70B9"],[13158,1,"14\u70B9"],[13159,1,"15\u70B9"],[13160,1,"16\u70B9"],[13161,1,"17\u70B9"],[13162,1,"18\u70B9"],[13163,1,"19\u70B9"],[13164,1,"20\u70B9"],[13165,1,"21\u70B9"],[13166,1,"22\u70B9"],[13167,1,"23\u70B9"],[13168,1,"24\u70B9"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"\u5E73\u6210"],[13180,1,"\u662D\u548C"],[13181,1,"\u5927\u6B63"],[13182,1,"\u660E\u6CBB"],[13183,1,"\u682A\u5F0F\u4F1A\u793E"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"\u03BCa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"\u03BCf"],[13197,1,"\u03BCg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"\u03BCl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"\u03BCm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m\u2215s"],[13224,1,"m\u2215s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad\u2215s"],[13231,1,"rad\u2215s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"\u03BCs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"\u03BCv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"\u03BCw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"k\u03C9"],[13249,1,"m\u03C9"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c\u2215kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v\u2215m"],[13279,1,"a\u2215m"],[13280,1,"1\u65E5"],[13281,1,"2\u65E5"],[13282,1,"3\u65E5"],[13283,1,"4\u65E5"],[13284,1,"5\u65E5"],[13285,1,"6\u65E5"],[13286,1,"7\u65E5"],[13287,1,"8\u65E5"],[13288,1,"9\u65E5"],[13289,1,"10\u65E5"],[13290,1,"11\u65E5"],[13291,1,"12\u65E5"],[13292,1,"13\u65E5"],[13293,1,"14\u65E5"],[13294,1,"15\u65E5"],[13295,1,"16\u65E5"],[13296,1,"17\u65E5"],[13297,1,"18\u65E5"],[13298,1,"19\u65E5"],[13299,1,"20\u65E5"],[13300,1,"21\u65E5"],[13301,1,"22\u65E5"],[13302,1,"23\u65E5"],[13303,1,"24\u65E5"],[13304,1,"25\u65E5"],[13305,1,"26\u65E5"],[13306,1,"27\u65E5"],[13307,1,"28\u65E5"],[13308,1,"29\u65E5"],[13309,1,"30\u65E5"],[13310,1,"31\u65E5"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"\uA641"],[42561,2],[42562,1,"\uA643"],[42563,2],[42564,1,"\uA645"],[42565,2],[42566,1,"\uA647"],[42567,2],[42568,1,"\uA649"],[42569,2],[42570,1,"\uA64B"],[42571,2],[42572,1,"\uA64D"],[42573,2],[42574,1,"\uA64F"],[42575,2],[42576,1,"\uA651"],[42577,2],[42578,1,"\uA653"],[42579,2],[42580,1,"\uA655"],[42581,2],[42582,1,"\uA657"],[42583,2],[42584,1,"\uA659"],[42585,2],[42586,1,"\uA65B"],[42587,2],[42588,1,"\uA65D"],[42589,2],[42590,1,"\uA65F"],[42591,2],[42592,1,"\uA661"],[42593,2],[42594,1,"\uA663"],[42595,2],[42596,1,"\uA665"],[42597,2],[42598,1,"\uA667"],[42599,2],[42600,1,"\uA669"],[42601,2],[42602,1,"\uA66B"],[42603,2],[42604,1,"\uA66D"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"\uA681"],[42625,2],[42626,1,"\uA683"],[42627,2],[42628,1,"\uA685"],[42629,2],[42630,1,"\uA687"],[42631,2],[42632,1,"\uA689"],[42633,2],[42634,1,"\uA68B"],[42635,2],[42636,1,"\uA68D"],[42637,2],[42638,1,"\uA68F"],[42639,2],[42640,1,"\uA691"],[42641,2],[42642,1,"\uA693"],[42643,2],[42644,1,"\uA695"],[42645,2],[42646,1,"\uA697"],[42647,2],[42648,1,"\uA699"],[42649,2],[42650,1,"\uA69B"],[42651,2],[42652,1,"\u044A"],[42653,1,"\u044C"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"\uA723"],[42787,2],[42788,1,"\uA725"],[42789,2],[42790,1,"\uA727"],[42791,2],[42792,1,"\uA729"],[42793,2],[42794,1,"\uA72B"],[42795,2],[42796,1,"\uA72D"],[42797,2],[42798,1,"\uA72F"],[[42799,42801],2],[42802,1,"\uA733"],[42803,2],[42804,1,"\uA735"],[42805,2],[42806,1,"\uA737"],[42807,2],[42808,1,"\uA739"],[42809,2],[42810,1,"\uA73B"],[42811,2],[42812,1,"\uA73D"],[42813,2],[42814,1,"\uA73F"],[42815,2],[42816,1,"\uA741"],[42817,2],[42818,1,"\uA743"],[42819,2],[42820,1,"\uA745"],[42821,2],[42822,1,"\uA747"],[42823,2],[42824,1,"\uA749"],[42825,2],[42826,1,"\uA74B"],[42827,2],[42828,1,"\uA74D"],[42829,2],[42830,1,"\uA74F"],[42831,2],[42832,1,"\uA751"],[42833,2],[42834,1,"\uA753"],[42835,2],[42836,1,"\uA755"],[42837,2],[42838,1,"\uA757"],[42839,2],[42840,1,"\uA759"],[42841,2],[42842,1,"\uA75B"],[42843,2],[42844,1,"\uA75D"],[42845,2],[42846,1,"\uA75F"],[42847,2],[42848,1,"\uA761"],[42849,2],[42850,1,"\uA763"],[42851,2],[42852,1,"\uA765"],[42853,2],[42854,1,"\uA767"],[42855,2],[42856,1,"\uA769"],[42857,2],[42858,1,"\uA76B"],[42859,2],[42860,1,"\uA76D"],[42861,2],[42862,1,"\uA76F"],[42863,2],[42864,1,"\uA76F"],[[42865,42872],2],[42873,1,"\uA77A"],[42874,2],[42875,1,"\uA77C"],[42876,2],[42877,1,"\u1D79"],[42878,1,"\uA77F"],[42879,2],[42880,1,"\uA781"],[42881,2],[42882,1,"\uA783"],[42883,2],[42884,1,"\uA785"],[42885,2],[42886,1,"\uA787"],[[42887,42888],2],[[42889,42890],2],[42891,1,"\uA78C"],[42892,2],[42893,1,"\u0265"],[42894,2],[42895,2],[42896,1,"\uA791"],[42897,2],[42898,1,"\uA793"],[42899,2],[[42900,42901],2],[42902,1,"\uA797"],[42903,2],[42904,1,"\uA799"],[42905,2],[42906,1,"\uA79B"],[42907,2],[42908,1,"\uA79D"],[42909,2],[42910,1,"\uA79F"],[42911,2],[42912,1,"\uA7A1"],[42913,2],[42914,1,"\uA7A3"],[42915,2],[42916,1,"\uA7A5"],[42917,2],[42918,1,"\uA7A7"],[42919,2],[42920,1,"\uA7A9"],[42921,2],[42922,1,"\u0266"],[42923,1,"\u025C"],[42924,1,"\u0261"],[42925,1,"\u026C"],[42926,1,"\u026A"],[42927,2],[42928,1,"\u029E"],[42929,1,"\u0287"],[42930,1,"\u029D"],[42931,1,"\uAB53"],[42932,1,"\uA7B5"],[42933,2],[42934,1,"\uA7B7"],[42935,2],[42936,1,"\uA7B9"],[42937,2],[42938,1,"\uA7BB"],[42939,2],[42940,1,"\uA7BD"],[42941,2],[42942,1,"\uA7BF"],[42943,2],[42944,1,"\uA7C1"],[42945,2],[42946,1,"\uA7C3"],[42947,2],[42948,1,"\uA794"],[42949,1,"\u0282"],[42950,1,"\u1D8E"],[42951,1,"\uA7C8"],[42952,2],[42953,1,"\uA7CA"],[42954,2],[[42955,42959],3],[42960,1,"\uA7D1"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"\uA7D7"],[42967,2],[42968,1,"\uA7D9"],[42969,2],[[42970,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"\uA7F6"],[42998,2],[42999,2],[43000,1,"\u0127"],[43001,1,"\u0153"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"\uA727"],[43869,1,"\uAB37"],[43870,1,"\u026B"],[43871,1,"\uAB52"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"\u028D"],[[43882,43883],2],[[43884,43887],3],[43888,1,"\u13A0"],[43889,1,"\u13A1"],[43890,1,"\u13A2"],[43891,1,"\u13A3"],[43892,1,"\u13A4"],[43893,1,"\u13A5"],[43894,1,"\u13A6"],[43895,1,"\u13A7"],[43896,1,"\u13A8"],[43897,1,"\u13A9"],[43898,1,"\u13AA"],[43899,1,"\u13AB"],[43900,1,"\u13AC"],[43901,1,"\u13AD"],[43902,1,"\u13AE"],[43903,1,"\u13AF"],[43904,1,"\u13B0"],[43905,1,"\u13B1"],[43906,1,"\u13B2"],[43907,1,"\u13B3"],[43908,1,"\u13B4"],[43909,1,"\u13B5"],[43910,1,"\u13B6"],[43911,1,"\u13B7"],[43912,1,"\u13B8"],[43913,1,"\u13B9"],[43914,1,"\u13BA"],[43915,1,"\u13BB"],[43916,1,"\u13BC"],[43917,1,"\u13BD"],[43918,1,"\u13BE"],[43919,1,"\u13BF"],[43920,1,"\u13C0"],[43921,1,"\u13C1"],[43922,1,"\u13C2"],[43923,1,"\u13C3"],[43924,1,"\u13C4"],[43925,1,"\u13C5"],[43926,1,"\u13C6"],[43927,1,"\u13C7"],[43928,1,"\u13C8"],[43929,1,"\u13C9"],[43930,1,"\u13CA"],[43931,1,"\u13CB"],[43932,1,"\u13CC"],[43933,1,"\u13CD"],[43934,1,"\u13CE"],[43935,1,"\u13CF"],[43936,1,"\u13D0"],[43937,1,"\u13D1"],[43938,1,"\u13D2"],[43939,1,"\u13D3"],[43940,1,"\u13D4"],[43941,1,"\u13D5"],[43942,1,"\u13D6"],[43943,1,"\u13D7"],[43944,1,"\u13D8"],[43945,1,"\u13D9"],[43946,1,"\u13DA"],[43947,1,"\u13DB"],[43948,1,"\u13DC"],[43949,1,"\u13DD"],[43950,1,"\u13DE"],[43951,1,"\u13DF"],[43952,1,"\u13E0"],[43953,1,"\u13E1"],[43954,1,"\u13E2"],[43955,1,"\u13E3"],[43956,1,"\u13E4"],[43957,1,"\u13E5"],[43958,1,"\u13E6"],[43959,1,"\u13E7"],[43960,1,"\u13E8"],[43961,1,"\u13E9"],[43962,1,"\u13EA"],[43963,1,"\u13EB"],[43964,1,"\u13EC"],[43965,1,"\u13ED"],[43966,1,"\u13EE"],[43967,1,"\u13EF"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"\u8C48"],[63745,1,"\u66F4"],[63746,1,"\u8ECA"],[63747,1,"\u8CC8"],[63748,1,"\u6ED1"],[63749,1,"\u4E32"],[63750,1,"\u53E5"],[[63751,63752],1,"\u9F9C"],[63753,1,"\u5951"],[63754,1,"\u91D1"],[63755,1,"\u5587"],[63756,1,"\u5948"],[63757,1,"\u61F6"],[63758,1,"\u7669"],[63759,1,"\u7F85"],[63760,1,"\u863F"],[63761,1,"\u87BA"],[63762,1,"\u88F8"],[63763,1,"\u908F"],[63764,1,"\u6A02"],[63765,1,"\u6D1B"],[63766,1,"\u70D9"],[63767,1,"\u73DE"],[63768,1,"\u843D"],[63769,1,"\u916A"],[63770,1,"\u99F1"],[63771,1,"\u4E82"],[63772,1,"\u5375"],[63773,1,"\u6B04"],[63774,1,"\u721B"],[63775,1,"\u862D"],[63776,1,"\u9E1E"],[63777,1,"\u5D50"],[63778,1,"\u6FEB"],[63779,1,"\u85CD"],[63780,1,"\u8964"],[63781,1,"\u62C9"],[63782,1,"\u81D8"],[63783,1,"\u881F"],[63784,1,"\u5ECA"],[63785,1,"\u6717"],[63786,1,"\u6D6A"],[63787,1,"\u72FC"],[63788,1,"\u90CE"],[63789,1,"\u4F86"],[63790,1,"\u51B7"],[63791,1,"\u52DE"],[63792,1,"\u64C4"],[63793,1,"\u6AD3"],[63794,1,"\u7210"],[63795,1,"\u76E7"],[63796,1,"\u8001"],[63797,1,"\u8606"],[63798,1,"\u865C"],[63799,1,"\u8DEF"],[63800,1,"\u9732"],[63801,1,"\u9B6F"],[63802,1,"\u9DFA"],[63803,1,"\u788C"],[63804,1,"\u797F"],[63805,1,"\u7DA0"],[63806,1,"\u83C9"],[63807,1,"\u9304"],[63808,1,"\u9E7F"],[63809,1,"\u8AD6"],[63810,1,"\u58DF"],[63811,1,"\u5F04"],[63812,1,"\u7C60"],[63813,1,"\u807E"],[63814,1,"\u7262"],[63815,1,"\u78CA"],[63816,1,"\u8CC2"],[63817,1,"\u96F7"],[63818,1,"\u58D8"],[63819,1,"\u5C62"],[63820,1,"\u6A13"],[63821,1,"\u6DDA"],[63822,1,"\u6F0F"],[63823,1,"\u7D2F"],[63824,1,"\u7E37"],[63825,1,"\u964B"],[63826,1,"\u52D2"],[63827,1,"\u808B"],[63828,1,"\u51DC"],[63829,1,"\u51CC"],[63830,1,"\u7A1C"],[63831,1,"\u7DBE"],[63832,1,"\u83F1"],[63833,1,"\u9675"],[63834,1,"\u8B80"],[63835,1,"\u62CF"],[63836,1,"\u6A02"],[63837,1,"\u8AFE"],[63838,1,"\u4E39"],[63839,1,"\u5BE7"],[63840,1,"\u6012"],[63841,1,"\u7387"],[63842,1,"\u7570"],[63843,1,"\u5317"],[63844,1,"\u78FB"],[63845,1,"\u4FBF"],[63846,1,"\u5FA9"],[63847,1,"\u4E0D"],[63848,1,"\u6CCC"],[63849,1,"\u6578"],[63850,1,"\u7D22"],[63851,1,"\u53C3"],[63852,1,"\u585E"],[63853,1,"\u7701"],[63854,1,"\u8449"],[63855,1,"\u8AAA"],[63856,1,"\u6BBA"],[63857,1,"\u8FB0"],[63858,1,"\u6C88"],[63859,1,"\u62FE"],[63860,1,"\u82E5"],[63861,1,"\u63A0"],[63862,1,"\u7565"],[63863,1,"\u4EAE"],[63864,1,"\u5169"],[63865,1,"\u51C9"],[63866,1,"\u6881"],[63867,1,"\u7CE7"],[63868,1,"\u826F"],[63869,1,"\u8AD2"],[63870,1,"\u91CF"],[63871,1,"\u52F5"],[63872,1,"\u5442"],[63873,1,"\u5973"],[63874,1,"\u5EEC"],[63875,1,"\u65C5"],[63876,1,"\u6FFE"],[63877,1,"\u792A"],[63878,1,"\u95AD"],[63879,1,"\u9A6A"],[63880,1,"\u9E97"],[63881,1,"\u9ECE"],[63882,1,"\u529B"],[63883,1,"\u66C6"],[63884,1,"\u6B77"],[63885,1,"\u8F62"],[63886,1,"\u5E74"],[63887,1,"\u6190"],[63888,1,"\u6200"],[63889,1,"\u649A"],[63890,1,"\u6F23"],[63891,1,"\u7149"],[63892,1,"\u7489"],[63893,1,"\u79CA"],[63894,1,"\u7DF4"],[63895,1,"\u806F"],[63896,1,"\u8F26"],[63897,1,"\u84EE"],[63898,1,"\u9023"],[63899,1,"\u934A"],[63900,1,"\u5217"],[63901,1,"\u52A3"],[63902,1,"\u54BD"],[63903,1,"\u70C8"],[63904,1,"\u88C2"],[63905,1,"\u8AAA"],[63906,1,"\u5EC9"],[63907,1,"\u5FF5"],[63908,1,"\u637B"],[63909,1,"\u6BAE"],[63910,1,"\u7C3E"],[63911,1,"\u7375"],[63912,1,"\u4EE4"],[63913,1,"\u56F9"],[63914,1,"\u5BE7"],[63915,1,"\u5DBA"],[63916,1,"\u601C"],[63917,1,"\u73B2"],[63918,1,"\u7469"],[63919,1,"\u7F9A"],[63920,1,"\u8046"],[63921,1,"\u9234"],[63922,1,"\u96F6"],[63923,1,"\u9748"],[63924,1,"\u9818"],[63925,1,"\u4F8B"],[63926,1,"\u79AE"],[63927,1,"\u91B4"],[63928,1,"\u96B8"],[63929,1,"\u60E1"],[63930,1,"\u4E86"],[63931,1,"\u50DA"],[63932,1,"\u5BEE"],[63933,1,"\u5C3F"],[63934,1,"\u6599"],[63935,1,"\u6A02"],[63936,1,"\u71CE"],[63937,1,"\u7642"],[63938,1,"\u84FC"],[63939,1,"\u907C"],[63940,1,"\u9F8D"],[63941,1,"\u6688"],[63942,1,"\u962E"],[63943,1,"\u5289"],[63944,1,"\u677B"],[63945,1,"\u67F3"],[63946,1,"\u6D41"],[63947,1,"\u6E9C"],[63948,1,"\u7409"],[63949,1,"\u7559"],[63950,1,"\u786B"],[63951,1,"\u7D10"],[63952,1,"\u985E"],[63953,1,"\u516D"],[63954,1,"\u622E"],[63955,1,"\u9678"],[63956,1,"\u502B"],[63957,1,"\u5D19"],[63958,1,"\u6DEA"],[63959,1,"\u8F2A"],[63960,1,"\u5F8B"],[63961,1,"\u6144"],[63962,1,"\u6817"],[63963,1,"\u7387"],[63964,1,"\u9686"],[63965,1,"\u5229"],[63966,1,"\u540F"],[63967,1,"\u5C65"],[63968,1,"\u6613"],[63969,1,"\u674E"],[63970,1,"\u68A8"],[63971,1,"\u6CE5"],[63972,1,"\u7406"],[63973,1,"\u75E2"],[63974,1,"\u7F79"],[63975,1,"\u88CF"],[63976,1,"\u88E1"],[63977,1,"\u91CC"],[63978,1,"\u96E2"],[63979,1,"\u533F"],[63980,1,"\u6EBA"],[63981,1,"\u541D"],[63982,1,"\u71D0"],[63983,1,"\u7498"],[63984,1,"\u85FA"],[63985,1,"\u96A3"],[63986,1,"\u9C57"],[63987,1,"\u9E9F"],[63988,1,"\u6797"],[63989,1,"\u6DCB"],[63990,1,"\u81E8"],[63991,1,"\u7ACB"],[63992,1,"\u7B20"],[63993,1,"\u7C92"],[63994,1,"\u72C0"],[63995,1,"\u7099"],[63996,1,"\u8B58"],[63997,1,"\u4EC0"],[63998,1,"\u8336"],[63999,1,"\u523A"],[64000,1,"\u5207"],[64001,1,"\u5EA6"],[64002,1,"\u62D3"],[64003,1,"\u7CD6"],[64004,1,"\u5B85"],[64005,1,"\u6D1E"],[64006,1,"\u66B4"],[64007,1,"\u8F3B"],[64008,1,"\u884C"],[64009,1,"\u964D"],[64010,1,"\u898B"],[64011,1,"\u5ED3"],[64012,1,"\u5140"],[64013,1,"\u55C0"],[[64014,64015],2],[64016,1,"\u585A"],[64017,2],[64018,1,"\u6674"],[[64019,64020],2],[64021,1,"\u51DE"],[64022,1,"\u732A"],[64023,1,"\u76CA"],[64024,1,"\u793C"],[64025,1,"\u795E"],[64026,1,"\u7965"],[64027,1,"\u798F"],[64028,1,"\u9756"],[64029,1,"\u7CBE"],[64030,1,"\u7FBD"],[64031,2],[64032,1,"\u8612"],[64033,2],[64034,1,"\u8AF8"],[[64035,64036],2],[64037,1,"\u9038"],[64038,1,"\u90FD"],[[64039,64041],2],[64042,1,"\u98EF"],[64043,1,"\u98FC"],[64044,1,"\u9928"],[64045,1,"\u9DB4"],[64046,1,"\u90DE"],[64047,1,"\u96B7"],[64048,1,"\u4FAE"],[64049,1,"\u50E7"],[64050,1,"\u514D"],[64051,1,"\u52C9"],[64052,1,"\u52E4"],[64053,1,"\u5351"],[64054,1,"\u559D"],[64055,1,"\u5606"],[64056,1,"\u5668"],[64057,1,"\u5840"],[64058,1,"\u58A8"],[64059,1,"\u5C64"],[64060,1,"\u5C6E"],[64061,1,"\u6094"],[64062,1,"\u6168"],[64063,1,"\u618E"],[64064,1,"\u61F2"],[64065,1,"\u654F"],[64066,1,"\u65E2"],[64067,1,"\u6691"],[64068,1,"\u6885"],[64069,1,"\u6D77"],[64070,1,"\u6E1A"],[64071,1,"\u6F22"],[64072,1,"\u716E"],[64073,1,"\u722B"],[64074,1,"\u7422"],[64075,1,"\u7891"],[64076,1,"\u793E"],[64077,1,"\u7949"],[64078,1,"\u7948"],[64079,1,"\u7950"],[64080,1,"\u7956"],[64081,1,"\u795D"],[64082,1,"\u798D"],[64083,1,"\u798E"],[64084,1,"\u7A40"],[64085,1,"\u7A81"],[64086,1,"\u7BC0"],[64087,1,"\u7DF4"],[64088,1,"\u7E09"],[64089,1,"\u7E41"],[64090,1,"\u7F72"],[64091,1,"\u8005"],[64092,1,"\u81ED"],[[64093,64094],1,"\u8279"],[64095,1,"\u8457"],[64096,1,"\u8910"],[64097,1,"\u8996"],[64098,1,"\u8B01"],[64099,1,"\u8B39"],[64100,1,"\u8CD3"],[64101,1,"\u8D08"],[64102,1,"\u8FB6"],[64103,1,"\u9038"],[64104,1,"\u96E3"],[64105,1,"\u97FF"],[64106,1,"\u983B"],[64107,1,"\u6075"],[64108,1,"\uD850\uDEEE"],[64109,1,"\u8218"],[[64110,64111],3],[64112,1,"\u4E26"],[64113,1,"\u51B5"],[64114,1,"\u5168"],[64115,1,"\u4F80"],[64116,1,"\u5145"],[64117,1,"\u5180"],[64118,1,"\u52C7"],[64119,1,"\u52FA"],[64120,1,"\u559D"],[64121,1,"\u5555"],[64122,1,"\u5599"],[64123,1,"\u55E2"],[64124,1,"\u585A"],[64125,1,"\u58B3"],[64126,1,"\u5944"],[64127,1,"\u5954"],[64128,1,"\u5A62"],[64129,1,"\u5B28"],[64130,1,"\u5ED2"],[64131,1,"\u5ED9"],[64132,1,"\u5F69"],[64133,1,"\u5FAD"],[64134,1,"\u60D8"],[64135,1,"\u614E"],[64136,1,"\u6108"],[64137,1,"\u618E"],[64138,1,"\u6160"],[64139,1,"\u61F2"],[64140,1,"\u6234"],[64141,1,"\u63C4"],[64142,1,"\u641C"],[64143,1,"\u6452"],[64144,1,"\u6556"],[64145,1,"\u6674"],[64146,1,"\u6717"],[64147,1,"\u671B"],[64148,1,"\u6756"],[64149,1,"\u6B79"],[64150,1,"\u6BBA"],[64151,1,"\u6D41"],[64152,1,"\u6EDB"],[64153,1,"\u6ECB"],[64154,1,"\u6F22"],[64155,1,"\u701E"],[64156,1,"\u716E"],[64157,1,"\u77A7"],[64158,1,"\u7235"],[64159,1,"\u72AF"],[64160,1,"\u732A"],[64161,1,"\u7471"],[64162,1,"\u7506"],[64163,1,"\u753B"],[64164,1,"\u761D"],[64165,1,"\u761F"],[64166,1,"\u76CA"],[64167,1,"\u76DB"],[64168,1,"\u76F4"],[64169,1,"\u774A"],[64170,1,"\u7740"],[64171,1,"\u78CC"],[64172,1,"\u7AB1"],[64173,1,"\u7BC0"],[64174,1,"\u7C7B"],[64175,1,"\u7D5B"],[64176,1,"\u7DF4"],[64177,1,"\u7F3E"],[64178,1,"\u8005"],[64179,1,"\u8352"],[64180,1,"\u83EF"],[64181,1,"\u8779"],[64182,1,"\u8941"],[64183,1,"\u8986"],[64184,1,"\u8996"],[64185,1,"\u8ABF"],[64186,1,"\u8AF8"],[64187,1,"\u8ACB"],[64188,1,"\u8B01"],[64189,1,"\u8AFE"],[64190,1,"\u8AED"],[64191,1,"\u8B39"],[64192,1,"\u8B8A"],[64193,1,"\u8D08"],[64194,1,"\u8F38"],[64195,1,"\u9072"],[64196,1,"\u9199"],[64197,1,"\u9276"],[64198,1,"\u967C"],[64199,1,"\u96E3"],[64200,1,"\u9756"],[64201,1,"\u97DB"],[64202,1,"\u97FF"],[64203,1,"\u980B"],[64204,1,"\u983B"],[64205,1,"\u9B12"],[64206,1,"\u9F9C"],[64207,1,"\uD84A\uDC4A"],[64208,1,"\uD84A\uDC44"],[64209,1,"\uD84C\uDFD5"],[64210,1,"\u3B9D"],[64211,1,"\u4018"],[64212,1,"\u4039"],[64213,1,"\uD854\uDE49"],[64214,1,"\uD857\uDCD0"],[64215,1,"\uD85F\uDED3"],[64216,1,"\u9F43"],[64217,1,"\u9F8E"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"\u0574\u0576"],[64276,1,"\u0574\u0565"],[64277,1,"\u0574\u056B"],[64278,1,"\u057E\u0576"],[64279,1,"\u0574\u056D"],[[64280,64284],3],[64285,1,"\u05D9\u05B4"],[64286,2],[64287,1,"\u05F2\u05B7"],[64288,1,"\u05E2"],[64289,1,"\u05D0"],[64290,1,"\u05D3"],[64291,1,"\u05D4"],[64292,1,"\u05DB"],[64293,1,"\u05DC"],[64294,1,"\u05DD"],[64295,1,"\u05E8"],[64296,1,"\u05EA"],[64297,5,"+"],[64298,1,"\u05E9\u05C1"],[64299,1,"\u05E9\u05C2"],[64300,1,"\u05E9\u05BC\u05C1"],[64301,1,"\u05E9\u05BC\u05C2"],[64302,1,"\u05D0\u05B7"],[64303,1,"\u05D0\u05B8"],[64304,1,"\u05D0\u05BC"],[64305,1,"\u05D1\u05BC"],[64306,1,"\u05D2\u05BC"],[64307,1,"\u05D3\u05BC"],[64308,1,"\u05D4\u05BC"],[64309,1,"\u05D5\u05BC"],[64310,1,"\u05D6\u05BC"],[64311,3],[64312,1,"\u05D8\u05BC"],[64313,1,"\u05D9\u05BC"],[64314,1,"\u05DA\u05BC"],[64315,1,"\u05DB\u05BC"],[64316,1,"\u05DC\u05BC"],[64317,3],[64318,1,"\u05DE\u05BC"],[64319,3],[64320,1,"\u05E0\u05BC"],[64321,1,"\u05E1\u05BC"],[64322,3],[64323,1,"\u05E3\u05BC"],[64324,1,"\u05E4\u05BC"],[64325,3],[64326,1,"\u05E6\u05BC"],[64327,1,"\u05E7\u05BC"],[64328,1,"\u05E8\u05BC"],[64329,1,"\u05E9\u05BC"],[64330,1,"\u05EA\u05BC"],[64331,1,"\u05D5\u05B9"],[64332,1,"\u05D1\u05BF"],[64333,1,"\u05DB\u05BF"],[64334,1,"\u05E4\u05BF"],[64335,1,"\u05D0\u05DC"],[[64336,64337],1,"\u0671"],[[64338,64341],1,"\u067B"],[[64342,64345],1,"\u067E"],[[64346,64349],1,"\u0680"],[[64350,64353],1,"\u067A"],[[64354,64357],1,"\u067F"],[[64358,64361],1,"\u0679"],[[64362,64365],1,"\u06A4"],[[64366,64369],1,"\u06A6"],[[64370,64373],1,"\u0684"],[[64374,64377],1,"\u0683"],[[64378,64381],1,"\u0686"],[[64382,64385],1,"\u0687"],[[64386,64387],1,"\u068D"],[[64388,64389],1,"\u068C"],[[64390,64391],1,"\u068E"],[[64392,64393],1,"\u0688"],[[64394,64395],1,"\u0698"],[[64396,64397],1,"\u0691"],[[64398,64401],1,"\u06A9"],[[64402,64405],1,"\u06AF"],[[64406,64409],1,"\u06B3"],[[64410,64413],1,"\u06B1"],[[64414,64415],1,"\u06BA"],[[64416,64419],1,"\u06BB"],[[64420,64421],1,"\u06C0"],[[64422,64425],1,"\u06C1"],[[64426,64429],1,"\u06BE"],[[64430,64431],1,"\u06D2"],[[64432,64433],1,"\u06D3"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"\u06AD"],[[64471,64472],1,"\u06C7"],[[64473,64474],1,"\u06C6"],[[64475,64476],1,"\u06C8"],[64477,1,"\u06C7\u0674"],[[64478,64479],1,"\u06CB"],[[64480,64481],1,"\u06C5"],[[64482,64483],1,"\u06C9"],[[64484,64487],1,"\u06D0"],[[64488,64489],1,"\u0649"],[[64490,64491],1,"\u0626\u0627"],[[64492,64493],1,"\u0626\u06D5"],[[64494,64495],1,"\u0626\u0648"],[[64496,64497],1,"\u0626\u06C7"],[[64498,64499],1,"\u0626\u06C6"],[[64500,64501],1,"\u0626\u06C8"],[[64502,64504],1,"\u0626\u06D0"],[[64505,64507],1,"\u0626\u0649"],[[64508,64511],1,"\u06CC"],[64512,1,"\u0626\u062C"],[64513,1,"\u0626\u062D"],[64514,1,"\u0626\u0645"],[64515,1,"\u0626\u0649"],[64516,1,"\u0626\u064A"],[64517,1,"\u0628\u062C"],[64518,1,"\u0628\u062D"],[64519,1,"\u0628\u062E"],[64520,1,"\u0628\u0645"],[64521,1,"\u0628\u0649"],[64522,1,"\u0628\u064A"],[64523,1,"\u062A\u062C"],[64524,1,"\u062A\u062D"],[64525,1,"\u062A\u062E"],[64526,1,"\u062A\u0645"],[64527,1,"\u062A\u0649"],[64528,1,"\u062A\u064A"],[64529,1,"\u062B\u062C"],[64530,1,"\u062B\u0645"],[64531,1,"\u062B\u0649"],[64532,1,"\u062B\u064A"],[64533,1,"\u062C\u062D"],[64534,1,"\u062C\u0645"],[64535,1,"\u062D\u062C"],[64536,1,"\u062D\u0645"],[64537,1,"\u062E\u062C"],[64538,1,"\u062E\u062D"],[64539,1,"\u062E\u0645"],[64540,1,"\u0633\u062C"],[64541,1,"\u0633\u062D"],[64542,1,"\u0633\u062E"],[64543,1,"\u0633\u0645"],[64544,1,"\u0635\u062D"],[64545,1,"\u0635\u0645"],[64546,1,"\u0636\u062C"],[64547,1,"\u0636\u062D"],[64548,1,"\u0636\u062E"],[64549,1,"\u0636\u0645"],[64550,1,"\u0637\u062D"],[64551,1,"\u0637\u0645"],[64552,1,"\u0638\u0645"],[64553,1,"\u0639\u062C"],[64554,1,"\u0639\u0645"],[64555,1,"\u063A\u062C"],[64556,1,"\u063A\u0645"],[64557,1,"\u0641\u062C"],[64558,1,"\u0641\u062D"],[64559,1,"\u0641\u062E"],[64560,1,"\u0641\u0645"],[64561,1,"\u0641\u0649"],[64562,1,"\u0641\u064A"],[64563,1,"\u0642\u062D"],[64564,1,"\u0642\u0645"],[64565,1,"\u0642\u0649"],[64566,1,"\u0642\u064A"],[64567,1,"\u0643\u0627"],[64568,1,"\u0643\u062C"],[64569,1,"\u0643\u062D"],[64570,1,"\u0643\u062E"],[64571,1,"\u0643\u0644"],[64572,1,"\u0643\u0645"],[64573,1,"\u0643\u0649"],[64574,1,"\u0643\u064A"],[64575,1,"\u0644\u062C"],[64576,1,"\u0644\u062D"],[64577,1,"\u0644\u062E"],[64578,1,"\u0644\u0645"],[64579,1,"\u0644\u0649"],[64580,1,"\u0644\u064A"],[64581,1,"\u0645\u062C"],[64582,1,"\u0645\u062D"],[64583,1,"\u0645\u062E"],[64584,1,"\u0645\u0645"],[64585,1,"\u0645\u0649"],[64586,1,"\u0645\u064A"],[64587,1,"\u0646\u062C"],[64588,1,"\u0646\u062D"],[64589,1,"\u0646\u062E"],[64590,1,"\u0646\u0645"],[64591,1,"\u0646\u0649"],[64592,1,"\u0646\u064A"],[64593,1,"\u0647\u062C"],[64594,1,"\u0647\u0645"],[64595,1,"\u0647\u0649"],[64596,1,"\u0647\u064A"],[64597,1,"\u064A\u062C"],[64598,1,"\u064A\u062D"],[64599,1,"\u064A\u062E"],[64600,1,"\u064A\u0645"],[64601,1,"\u064A\u0649"],[64602,1,"\u064A\u064A"],[64603,1,"\u0630\u0670"],[64604,1,"\u0631\u0670"],[64605,1,"\u0649\u0670"],[64606,5," \u064C\u0651"],[64607,5," \u064D\u0651"],[64608,5," \u064E\u0651"],[64609,5," \u064F\u0651"],[64610,5," \u0650\u0651"],[64611,5," \u0651\u0670"],[64612,1,"\u0626\u0631"],[64613,1,"\u0626\u0632"],[64614,1,"\u0626\u0645"],[64615,1,"\u0626\u0646"],[64616,1,"\u0626\u0649"],[64617,1,"\u0626\u064A"],[64618,1,"\u0628\u0631"],[64619,1,"\u0628\u0632"],[64620,1,"\u0628\u0645"],[64621,1,"\u0628\u0646"],[64622,1,"\u0628\u0649"],[64623,1,"\u0628\u064A"],[64624,1,"\u062A\u0631"],[64625,1,"\u062A\u0632"],[64626,1,"\u062A\u0645"],[64627,1,"\u062A\u0646"],[64628,1,"\u062A\u0649"],[64629,1,"\u062A\u064A"],[64630,1,"\u062B\u0631"],[64631,1,"\u062B\u0632"],[64632,1,"\u062B\u0645"],[64633,1,"\u062B\u0646"],[64634,1,"\u062B\u0649"],[64635,1,"\u062B\u064A"],[64636,1,"\u0641\u0649"],[64637,1,"\u0641\u064A"],[64638,1,"\u0642\u0649"],[64639,1,"\u0642\u064A"],[64640,1,"\u0643\u0627"],[64641,1,"\u0643\u0644"],[64642,1,"\u0643\u0645"],[64643,1,"\u0643\u0649"],[64644,1,"\u0643\u064A"],[64645,1,"\u0644\u0645"],[64646,1,"\u0644\u0649"],[64647,1,"\u0644\u064A"],[64648,1,"\u0645\u0627"],[64649,1,"\u0645\u0645"],[64650,1,"\u0646\u0631"],[64651,1,"\u0646\u0632"],[64652,1,"\u0646\u0645"],[64653,1,"\u0646\u0646"],[64654,1,"\u0646\u0649"],[64655,1,"\u0646\u064A"],[64656,1,"\u0649\u0670"],[64657,1,"\u064A\u0631"],[64658,1,"\u064A\u0632"],[64659,1,"\u064A\u0645"],[64660,1,"\u064A\u0646"],[64661,1,"\u064A\u0649"],[64662,1,"\u064A\u064A"],[64663,1,"\u0626\u062C"],[64664,1,"\u0626\u062D"],[64665,1,"\u0626\u062E"],[64666,1,"\u0626\u0645"],[64667,1,"\u0626\u0647"],[64668,1,"\u0628\u062C"],[64669,1,"\u0628\u062D"],[64670,1,"\u0628\u062E"],[64671,1,"\u0628\u0645"],[64672,1,"\u0628\u0647"],[64673,1,"\u062A\u062C"],[64674,1,"\u062A\u062D"],[64675,1,"\u062A\u062E"],[64676,1,"\u062A\u0645"],[64677,1,"\u062A\u0647"],[64678,1,"\u062B\u0645"],[64679,1,"\u062C\u062D"],[64680,1,"\u062C\u0645"],[64681,1,"\u062D\u062C"],[64682,1,"\u062D\u0645"],[64683,1,"\u062E\u062C"],[64684,1,"\u062E\u0645"],[64685,1,"\u0633\u062C"],[64686,1,"\u0633\u062D"],[64687,1,"\u0633\u062E"],[64688,1,"\u0633\u0645"],[64689,1,"\u0635\u062D"],[64690,1,"\u0635\u062E"],[64691,1,"\u0635\u0645"],[64692,1,"\u0636\u062C"],[64693,1,"\u0636\u062D"],[64694,1,"\u0636\u062E"],[64695,1,"\u0636\u0645"],[64696,1,"\u0637\u062D"],[64697,1,"\u0638\u0645"],[64698,1,"\u0639\u062C"],[64699,1,"\u0639\u0645"],[64700,1,"\u063A\u062C"],[64701,1,"\u063A\u0645"],[64702,1,"\u0641\u062C"],[64703,1,"\u0641\u062D"],[64704,1,"\u0641\u062E"],[64705,1,"\u0641\u0645"],[64706,1,"\u0642\u062D"],[64707,1,"\u0642\u0645"],[64708,1,"\u0643\u062C"],[64709,1,"\u0643\u062D"],[64710,1,"\u0643\u062E"],[64711,1,"\u0643\u0644"],[64712,1,"\u0643\u0645"],[64713,1,"\u0644\u062C"],[64714,1,"\u0644\u062D"],[64715,1,"\u0644\u062E"],[64716,1,"\u0644\u0645"],[64717,1,"\u0644\u0647"],[64718,1,"\u0645\u062C"],[64719,1,"\u0645\u062D"],[64720,1,"\u0645\u062E"],[64721,1,"\u0645\u0645"],[64722,1,"\u0646\u062C"],[64723,1,"\u0646\u062D"],[64724,1,"\u0646\u062E"],[64725,1,"\u0646\u0645"],[64726,1,"\u0646\u0647"],[64727,1,"\u0647\u062C"],[64728,1,"\u0647\u0645"],[64729,1,"\u0647\u0670"],[64730,1,"\u064A\u062C"],[64731,1,"\u064A\u062D"],[64732,1,"\u064A\u062E"],[64733,1,"\u064A\u0645"],[64734,1,"\u064A\u0647"],[64735,1,"\u0626\u0645"],[64736,1,"\u0626\u0647"],[64737,1,"\u0628\u0645"],[64738,1,"\u0628\u0647"],[64739,1,"\u062A\u0645"],[64740,1,"\u062A\u0647"],[64741,1,"\u062B\u0645"],[64742,1,"\u062B\u0647"],[64743,1,"\u0633\u0645"],[64744,1,"\u0633\u0647"],[64745,1,"\u0634\u0645"],[64746,1,"\u0634\u0647"],[64747,1,"\u0643\u0644"],[64748,1,"\u0643\u0645"],[64749,1,"\u0644\u0645"],[64750,1,"\u0646\u0645"],[64751,1,"\u0646\u0647"],[64752,1,"\u064A\u0645"],[64753,1,"\u064A\u0647"],[64754,1,"\u0640\u064E\u0651"],[64755,1,"\u0640\u064F\u0651"],[64756,1,"\u0640\u0650\u0651"],[64757,1,"\u0637\u0649"],[64758,1,"\u0637\u064A"],[64759,1,"\u0639\u0649"],[64760,1,"\u0639\u064A"],[64761,1,"\u063A\u0649"],[64762,1,"\u063A\u064A"],[64763,1,"\u0633\u0649"],[64764,1,"\u0633\u064A"],[64765,1,"\u0634\u0649"],[64766,1,"\u0634\u064A"],[64767,1,"\u062D\u0649"],[64768,1,"\u062D\u064A"],[64769,1,"\u062C\u0649"],[64770,1,"\u062C\u064A"],[64771,1,"\u062E\u0649"],[64772,1,"\u062E\u064A"],[64773,1,"\u0635\u0649"],[64774,1,"\u0635\u064A"],[64775,1,"\u0636\u0649"],[64776,1,"\u0636\u064A"],[64777,1,"\u0634\u062C"],[64778,1,"\u0634\u062D"],[64779,1,"\u0634\u062E"],[64780,1,"\u0634\u0645"],[64781,1,"\u0634\u0631"],[64782,1,"\u0633\u0631"],[64783,1,"\u0635\u0631"],[64784,1,"\u0636\u0631"],[64785,1,"\u0637\u0649"],[64786,1,"\u0637\u064A"],[64787,1,"\u0639\u0649"],[64788,1,"\u0639\u064A"],[64789,1,"\u063A\u0649"],[64790,1,"\u063A\u064A"],[64791,1,"\u0633\u0649"],[64792,1,"\u0633\u064A"],[64793,1,"\u0634\u0649"],[64794,1,"\u0634\u064A"],[64795,1,"\u062D\u0649"],[64796,1,"\u062D\u064A"],[64797,1,"\u062C\u0649"],[64798,1,"\u062C\u064A"],[64799,1,"\u062E\u0649"],[64800,1,"\u062E\u064A"],[64801,1,"\u0635\u0649"],[64802,1,"\u0635\u064A"],[64803,1,"\u0636\u0649"],[64804,1,"\u0636\u064A"],[64805,1,"\u0634\u062C"],[64806,1,"\u0634\u062D"],[64807,1,"\u0634\u062E"],[64808,1,"\u0634\u0645"],[64809,1,"\u0634\u0631"],[64810,1,"\u0633\u0631"],[64811,1,"\u0635\u0631"],[64812,1,"\u0636\u0631"],[64813,1,"\u0634\u062C"],[64814,1,"\u0634\u062D"],[64815,1,"\u0634\u062E"],[64816,1,"\u0634\u0645"],[64817,1,"\u0633\u0647"],[64818,1,"\u0634\u0647"],[64819,1,"\u0637\u0645"],[64820,1,"\u0633\u062C"],[64821,1,"\u0633\u062D"],[64822,1,"\u0633\u062E"],[64823,1,"\u0634\u062C"],[64824,1,"\u0634\u062D"],[64825,1,"\u0634\u062E"],[64826,1,"\u0637\u0645"],[64827,1,"\u0638\u0645"],[[64828,64829],1,"\u0627\u064B"],[[64830,64831],2],[[64832,64847],2],[64848,1,"\u062A\u062C\u0645"],[[64849,64850],1,"\u062A\u062D\u062C"],[64851,1,"\u062A\u062D\u0645"],[64852,1,"\u062A\u062E\u0645"],[64853,1,"\u062A\u0645\u062C"],[64854,1,"\u062A\u0645\u062D"],[64855,1,"\u062A\u0645\u062E"],[[64856,64857],1,"\u062C\u0645\u062D"],[64858,1,"\u062D\u0645\u064A"],[64859,1,"\u062D\u0645\u0649"],[64860,1,"\u0633\u062D\u062C"],[64861,1,"\u0633\u062C\u062D"],[64862,1,"\u0633\u062C\u0649"],[[64863,64864],1,"\u0633\u0645\u062D"],[64865,1,"\u0633\u0645\u062C"],[[64866,64867],1,"\u0633\u0645\u0645"],[[64868,64869],1,"\u0635\u062D\u062D"],[64870,1,"\u0635\u0645\u0645"],[[64871,64872],1,"\u0634\u062D\u0645"],[64873,1,"\u0634\u062C\u064A"],[[64874,64875],1,"\u0634\u0645\u062E"],[[64876,64877],1,"\u0634\u0645\u0645"],[64878,1,"\u0636\u062D\u0649"],[[64879,64880],1,"\u0636\u062E\u0645"],[[64881,64882],1,"\u0637\u0645\u062D"],[64883,1,"\u0637\u0645\u0645"],[64884,1,"\u0637\u0645\u064A"],[64885,1,"\u0639\u062C\u0645"],[[64886,64887],1,"\u0639\u0645\u0645"],[64888,1,"\u0639\u0645\u0649"],[64889,1,"\u063A\u0645\u0645"],[64890,1,"\u063A\u0645\u064A"],[64891,1,"\u063A\u0645\u0649"],[[64892,64893],1,"\u0641\u062E\u0645"],[64894,1,"\u0642\u0645\u062D"],[64895,1,"\u0642\u0645\u0645"],[64896,1,"\u0644\u062D\u0645"],[64897,1,"\u0644\u062D\u064A"],[64898,1,"\u0644\u062D\u0649"],[[64899,64900],1,"\u0644\u062C\u062C"],[[64901,64902],1,"\u0644\u062E\u0645"],[[64903,64904],1,"\u0644\u0645\u062D"],[64905,1,"\u0645\u062D\u062C"],[64906,1,"\u0645\u062D\u0645"],[64907,1,"\u0645\u062D\u064A"],[64908,1,"\u0645\u062C\u062D"],[64909,1,"\u0645\u062C\u0645"],[64910,1,"\u0645\u062E\u062C"],[64911,1,"\u0645\u062E\u0645"],[[64912,64913],3],[64914,1,"\u0645\u062C\u062E"],[64915,1,"\u0647\u0645\u062C"],[64916,1,"\u0647\u0645\u0645"],[64917,1,"\u0646\u062D\u0645"],[64918,1,"\u0646\u062D\u0649"],[[64919,64920],1,"\u0646\u062C\u0645"],[64921,1,"\u0646\u062C\u0649"],[64922,1,"\u0646\u0645\u064A"],[64923,1,"\u0646\u0645\u0649"],[[64924,64925],1,"\u064A\u0645\u0645"],[64926,1,"\u0628\u062E\u064A"],[64927,1,"\u062A\u062C\u064A"],[64928,1,"\u062A\u062C\u0649"],[64929,1,"\u062A\u062E\u064A"],[64930,1,"\u062A\u062E\u0649"],[64931,1,"\u062A\u0645\u064A"],[64932,1,"\u062A\u0645\u0649"],[64933,1,"\u062C\u0645\u064A"],[64934,1,"\u062C\u062D\u0649"],[64935,1,"\u062C\u0645\u0649"],[64936,1,"\u0633\u062E\u0649"],[64937,1,"\u0635\u062D\u064A"],[64938,1,"\u0634\u062D\u064A"],[64939,1,"\u0636\u062D\u064A"],[64940,1,"\u0644\u062C\u064A"],[64941,1,"\u0644\u0645\u064A"],[64942,1,"\u064A\u062D\u064A"],[64943,1,"\u064A\u062C\u064A"],[64944,1,"\u064A\u0645\u064A"],[64945,1,"\u0645\u0645\u064A"],[64946,1,"\u0642\u0645\u064A"],[64947,1,"\u0646\u062D\u064A"],[64948,1,"\u0642\u0645\u062D"],[64949,1,"\u0644\u062D\u0645"],[64950,1,"\u0639\u0645\u064A"],[64951,1,"\u0643\u0645\u064A"],[64952,1,"\u0646\u062C\u062D"],[64953,1,"\u0645\u062E\u064A"],[64954,1,"\u0644\u062C\u0645"],[64955,1,"\u0643\u0645\u0645"],[64956,1,"\u0644\u062C\u0645"],[64957,1,"\u0646\u062C\u062D"],[64958,1,"\u062C\u062D\u064A"],[64959,1,"\u062D\u062C\u064A"],[64960,1,"\u0645\u062C\u064A"],[64961,1,"\u0641\u0645\u064A"],[64962,1,"\u0628\u062D\u064A"],[64963,1,"\u0643\u0645\u0645"],[64964,1,"\u0639\u062C\u0645"],[64965,1,"\u0635\u0645\u0645"],[64966,1,"\u0633\u062E\u064A"],[64967,1,"\u0646\u062C\u064A"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"\u0635\u0644\u06D2"],[65009,1,"\u0642\u0644\u06D2"],[65010,1,"\u0627\u0644\u0644\u0647"],[65011,1,"\u0627\u0643\u0628\u0631"],[65012,1,"\u0645\u062D\u0645\u062F"],[65013,1,"\u0635\u0644\u0639\u0645"],[65014,1,"\u0631\u0633\u0648\u0644"],[65015,1,"\u0639\u0644\u064A\u0647"],[65016,1,"\u0648\u0633\u0644\u0645"],[65017,1,"\u0635\u0644\u0649"],[65018,5,"\u0635\u0644\u0649 \u0627\u0644\u0644\u0647 \u0639\u0644\u064A\u0647 \u0648\u0633\u0644\u0645"],[65019,5,"\u062C\u0644 \u062C\u0644\u0627\u0644\u0647"],[65020,1,"\u0631\u06CC\u0627\u0644"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,5,","],[65041,1,"\u3001"],[65042,3],[65043,5,":"],[65044,5,";"],[65045,5,"!"],[65046,5,"?"],[65047,1,"\u3016"],[65048,1,"\u3017"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"\u2014"],[65074,1,"\u2013"],[[65075,65076],5,"_"],[65077,5,"("],[65078,5,")"],[65079,5,"{"],[65080,5,"}"],[65081,1,"\u3014"],[65082,1,"\u3015"],[65083,1,"\u3010"],[65084,1,"\u3011"],[65085,1,"\u300A"],[65086,1,"\u300B"],[65087,1,"\u3008"],[65088,1,"\u3009"],[65089,1,"\u300C"],[65090,1,"\u300D"],[65091,1,"\u300E"],[65092,1,"\u300F"],[[65093,65094],2],[65095,5,"["],[65096,5,"]"],[[65097,65100],5," \u0305"],[[65101,65103],5,"_"],[65104,5,","],[65105,1,"\u3001"],[65106,3],[65107,3],[65108,5,";"],[65109,5,":"],[65110,5,"?"],[65111,5,"!"],[65112,1,"\u2014"],[65113,5,"("],[65114,5,")"],[65115,5,"{"],[65116,5,"}"],[65117,1,"\u3014"],[65118,1,"\u3015"],[65119,5,"#"],[65120,5,"&"],[65121,5,"*"],[65122,5,"+"],[65123,1,"-"],[65124,5,"<"],[65125,5,">"],[65126,5,"="],[65127,3],[65128,5,"\\"],[65129,5,"$"],[65130,5,"%"],[65131,5,"@"],[[65132,65135],3],[65136,5," \u064B"],[65137,1,"\u0640\u064B"],[65138,5," \u064C"],[65139,2],[65140,5," \u064D"],[65141,3],[65142,5," \u064E"],[65143,1,"\u0640\u064E"],[65144,5," \u064F"],[65145,1,"\u0640\u064F"],[65146,5," \u0650"],[65147,1,"\u0640\u0650"],[65148,5," \u0651"],[65149,1,"\u0640\u0651"],[65150,5," \u0652"],[65151,1,"\u0640\u0652"],[65152,1,"\u0621"],[[65153,65154],1,"\u0622"],[[65155,65156],1,"\u0623"],[[65157,65158],1,"\u0624"],[[65159,65160],1,"\u0625"],[[65161,65164],1,"\u0626"],[[65165,65166],1,"\u0627"],[[65167,65170],1,"\u0628"],[[65171,65172],1,"\u0629"],[[65173,65176],1,"\u062A"],[[65177,65180],1,"\u062B"],[[65181,65184],1,"\u062C"],[[65185,65188],1,"\u062D"],[[65189,65192],1,"\u062E"],[[65193,65194],1,"\u062F"],[[65195,65196],1,"\u0630"],[[65197,65198],1,"\u0631"],[[65199,65200],1,"\u0632"],[[65201,65204],1,"\u0633"],[[65205,65208],1,"\u0634"],[[65209,65212],1,"\u0635"],[[65213,65216],1,"\u0636"],[[65217,65220],1,"\u0637"],[[65221,65224],1,"\u0638"],[[65225,65228],1,"\u0639"],[[65229,65232],1,"\u063A"],[[65233,65236],1,"\u0641"],[[65237,65240],1,"\u0642"],[[65241,65244],1,"\u0643"],[[65245,65248],1,"\u0644"],[[65249,65252],1,"\u0645"],[[65253,65256],1,"\u0646"],[[65257,65260],1,"\u0647"],[[65261,65262],1,"\u0648"],[[65263,65264],1,"\u0649"],[[65265,65268],1,"\u064A"],[[65269,65270],1,"\u0644\u0622"],[[65271,65272],1,"\u0644\u0623"],[[65273,65274],1,"\u0644\u0625"],[[65275,65276],1,"\u0644\u0627"],[[65277,65278],3],[65279,7],[65280,3],[65281,5,"!"],[65282,5,'"'],[65283,5,"#"],[65284,5,"$"],[65285,5,"%"],[65286,5,"&"],[65287,5,"'"],[65288,5,"("],[65289,5,")"],[65290,5,"*"],[65291,5,"+"],[65292,5,","],[65293,1,"-"],[65294,1,"."],[65295,5,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,5,":"],[65307,5,";"],[65308,5,"<"],[65309,5,"="],[65310,5,">"],[65311,5,"?"],[65312,5,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,5,"["],[65340,5,"\\"],[65341,5,"]"],[65342,5,"^"],[65343,5,"_"],[65344,5,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,5,"{"],[65372,5,"|"],[65373,5,"}"],[65374,5,"~"],[65375,1,"\u2985"],[65376,1,"\u2986"],[65377,1,"."],[65378,1,"\u300C"],[65379,1,"\u300D"],[65380,1,"\u3001"],[65381,1,"\u30FB"],[65382,1,"\u30F2"],[65383,1,"\u30A1"],[65384,1,"\u30A3"],[65385,1,"\u30A5"],[65386,1,"\u30A7"],[65387,1,"\u30A9"],[65388,1,"\u30E3"],[65389,1,"\u30E5"],[65390,1,"\u30E7"],[65391,1,"\u30C3"],[65392,1,"\u30FC"],[65393,1,"\u30A2"],[65394,1,"\u30A4"],[65395,1,"\u30A6"],[65396,1,"\u30A8"],[65397,1,"\u30AA"],[65398,1,"\u30AB"],[65399,1,"\u30AD"],[65400,1,"\u30AF"],[65401,1,"\u30B1"],[65402,1,"\u30B3"],[65403,1,"\u30B5"],[65404,1,"\u30B7"],[65405,1,"\u30B9"],[65406,1,"\u30BB"],[65407,1,"\u30BD"],[65408,1,"\u30BF"],[65409,1,"\u30C1"],[65410,1,"\u30C4"],[65411,1,"\u30C6"],[65412,1,"\u30C8"],[65413,1,"\u30CA"],[65414,1,"\u30CB"],[65415,1,"\u30CC"],[65416,1,"\u30CD"],[65417,1,"\u30CE"],[65418,1,"\u30CF"],[65419,1,"\u30D2"],[65420,1,"\u30D5"],[65421,1,"\u30D8"],[65422,1,"\u30DB"],[65423,1,"\u30DE"],[65424,1,"\u30DF"],[65425,1,"\u30E0"],[65426,1,"\u30E1"],[65427,1,"\u30E2"],[65428,1,"\u30E4"],[65429,1,"\u30E6"],[65430,1,"\u30E8"],[65431,1,"\u30E9"],[65432,1,"\u30EA"],[65433,1,"\u30EB"],[65434,1,"\u30EC"],[65435,1,"\u30ED"],[65436,1,"\u30EF"],[65437,1,"\u30F3"],[65438,1,"\u3099"],[65439,1,"\u309A"],[65440,3],[65441,1,"\u1100"],[65442,1,"\u1101"],[65443,1,"\u11AA"],[65444,1,"\u1102"],[65445,1,"\u11AC"],[65446,1,"\u11AD"],[65447,1,"\u1103"],[65448,1,"\u1104"],[65449,1,"\u1105"],[65450,1,"\u11B0"],[65451,1,"\u11B1"],[65452,1,"\u11B2"],[65453,1,"\u11B3"],[65454,1,"\u11B4"],[65455,1,"\u11B5"],[65456,1,"\u111A"],[65457,1,"\u1106"],[65458,1,"\u1107"],[65459,1,"\u1108"],[65460,1,"\u1121"],[65461,1,"\u1109"],[65462,1,"\u110A"],[65463,1,"\u110B"],[65464,1,"\u110C"],[65465,1,"\u110D"],[65466,1,"\u110E"],[65467,1,"\u110F"],[65468,1,"\u1110"],[65469,1,"\u1111"],[65470,1,"\u1112"],[[65471,65473],3],[65474,1,"\u1161"],[65475,1,"\u1162"],[65476,1,"\u1163"],[65477,1,"\u1164"],[65478,1,"\u1165"],[65479,1,"\u1166"],[[65480,65481],3],[65482,1,"\u1167"],[65483,1,"\u1168"],[65484,1,"\u1169"],[65485,1,"\u116A"],[65486,1,"\u116B"],[65487,1,"\u116C"],[[65488,65489],3],[65490,1,"\u116D"],[65491,1,"\u116E"],[65492,1,"\u116F"],[65493,1,"\u1170"],[65494,1,"\u1171"],[65495,1,"\u1172"],[[65496,65497],3],[65498,1,"\u1173"],[65499,1,"\u1174"],[65500,1,"\u1175"],[[65501,65503],3],[65504,1,"\xA2"],[65505,1,"\xA3"],[65506,1,"\xAC"],[65507,5," \u0304"],[65508,1,"\xA6"],[65509,1,"\xA5"],[65510,1,"\u20A9"],[65511,3],[65512,1,"\u2502"],[65513,1,"\u2190"],[65514,1,"\u2191"],[65515,1,"\u2192"],[65516,1,"\u2193"],[65517,1,"\u25A0"],[65518,1,"\u25CB"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"\uD801\uDC28"],[66561,1,"\uD801\uDC29"],[66562,1,"\uD801\uDC2A"],[66563,1,"\uD801\uDC2B"],[66564,1,"\uD801\uDC2C"],[66565,1,"\uD801\uDC2D"],[66566,1,"\uD801\uDC2E"],[66567,1,"\uD801\uDC2F"],[66568,1,"\uD801\uDC30"],[66569,1,"\uD801\uDC31"],[66570,1,"\uD801\uDC32"],[66571,1,"\uD801\uDC33"],[66572,1,"\uD801\uDC34"],[66573,1,"\uD801\uDC35"],[66574,1,"\uD801\uDC36"],[66575,1,"\uD801\uDC37"],[66576,1,"\uD801\uDC38"],[66577,1,"\uD801\uDC39"],[66578,1,"\uD801\uDC3A"],[66579,1,"\uD801\uDC3B"],[66580,1,"\uD801\uDC3C"],[66581,1,"\uD801\uDC3D"],[66582,1,"\uD801\uDC3E"],[66583,1,"\uD801\uDC3F"],[66584,1,"\uD801\uDC40"],[66585,1,"\uD801\uDC41"],[66586,1,"\uD801\uDC42"],[66587,1,"\uD801\uDC43"],[66588,1,"\uD801\uDC44"],[66589,1,"\uD801\uDC45"],[66590,1,"\uD801\uDC46"],[66591,1,"\uD801\uDC47"],[66592,1,"\uD801\uDC48"],[66593,1,"\uD801\uDC49"],[66594,1,"\uD801\uDC4A"],[66595,1,"\uD801\uDC4B"],[66596,1,"\uD801\uDC4C"],[66597,1,"\uD801\uDC4D"],[66598,1,"\uD801\uDC4E"],[66599,1,"\uD801\uDC4F"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"\uD801\uDCD8"],[66737,1,"\uD801\uDCD9"],[66738,1,"\uD801\uDCDA"],[66739,1,"\uD801\uDCDB"],[66740,1,"\uD801\uDCDC"],[66741,1,"\uD801\uDCDD"],[66742,1,"\uD801\uDCDE"],[66743,1,"\uD801\uDCDF"],[66744,1,"\uD801\uDCE0"],[66745,1,"\uD801\uDCE1"],[66746,1,"\uD801\uDCE2"],[66747,1,"\uD801\uDCE3"],[66748,1,"\uD801\uDCE4"],[66749,1,"\uD801\uDCE5"],[66750,1,"\uD801\uDCE6"],[66751,1,"\uD801\uDCE7"],[66752,1,"\uD801\uDCE8"],[66753,1,"\uD801\uDCE9"],[66754,1,"\uD801\uDCEA"],[66755,1,"\uD801\uDCEB"],[66756,1,"\uD801\uDCEC"],[66757,1,"\uD801\uDCED"],[66758,1,"\uD801\uDCEE"],[66759,1,"\uD801\uDCEF"],[66760,1,"\uD801\uDCF0"],[66761,1,"\uD801\uDCF1"],[66762,1,"\uD801\uDCF2"],[66763,1,"\uD801\uDCF3"],[66764,1,"\uD801\uDCF4"],[66765,1,"\uD801\uDCF5"],[66766,1,"\uD801\uDCF6"],[66767,1,"\uD801\uDCF7"],[66768,1,"\uD801\uDCF8"],[66769,1,"\uD801\uDCF9"],[66770,1,"\uD801\uDCFA"],[66771,1,"\uD801\uDCFB"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"\uD801\uDD97"],[66929,1,"\uD801\uDD98"],[66930,1,"\uD801\uDD99"],[66931,1,"\uD801\uDD9A"],[66932,1,"\uD801\uDD9B"],[66933,1,"\uD801\uDD9C"],[66934,1,"\uD801\uDD9D"],[66935,1,"\uD801\uDD9E"],[66936,1,"\uD801\uDD9F"],[66937,1,"\uD801\uDDA0"],[66938,1,"\uD801\uDDA1"],[66939,3],[66940,1,"\uD801\uDDA3"],[66941,1,"\uD801\uDDA4"],[66942,1,"\uD801\uDDA5"],[66943,1,"\uD801\uDDA6"],[66944,1,"\uD801\uDDA7"],[66945,1,"\uD801\uDDA8"],[66946,1,"\uD801\uDDA9"],[66947,1,"\uD801\uDDAA"],[66948,1,"\uD801\uDDAB"],[66949,1,"\uD801\uDDAC"],[66950,1,"\uD801\uDDAD"],[66951,1,"\uD801\uDDAE"],[66952,1,"\uD801\uDDAF"],[66953,1,"\uD801\uDDB0"],[66954,1,"\uD801\uDDB1"],[66955,3],[66956,1,"\uD801\uDDB3"],[66957,1,"\uD801\uDDB4"],[66958,1,"\uD801\uDDB5"],[66959,1,"\uD801\uDDB6"],[66960,1,"\uD801\uDDB7"],[66961,1,"\uD801\uDDB8"],[66962,1,"\uD801\uDDB9"],[66963,3],[66964,1,"\uD801\uDDBB"],[66965,1,"\uD801\uDDBC"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"\u02D0"],[67458,1,"\u02D1"],[67459,1,"\xE6"],[67460,1,"\u0299"],[67461,1,"\u0253"],[67462,3],[67463,1,"\u02A3"],[67464,1,"\uAB66"],[67465,1,"\u02A5"],[67466,1,"\u02A4"],[67467,1,"\u0256"],[67468,1,"\u0257"],[67469,1,"\u1D91"],[67470,1,"\u0258"],[67471,1,"\u025E"],[67472,1,"\u02A9"],[67473,1,"\u0264"],[67474,1,"\u0262"],[67475,1,"\u0260"],[67476,1,"\u029B"],[67477,1,"\u0127"],[67478,1,"\u029C"],[67479,1,"\u0267"],[67480,1,"\u0284"],[67481,1,"\u02AA"],[67482,1,"\u02AB"],[67483,1,"\u026C"],[67484,1,"\uD837\uDF04"],[67485,1,"\uA78E"],[67486,1,"\u026E"],[67487,1,"\uD837\uDF05"],[67488,1,"\u028E"],[67489,1,"\uD837\uDF06"],[67490,1,"\xF8"],[67491,1,"\u0276"],[67492,1,"\u0277"],[67493,1,"q"],[67494,1,"\u027A"],[67495,1,"\uD837\uDF08"],[67496,1,"\u027D"],[67497,1,"\u027E"],[67498,1,"\u0280"],[67499,1,"\u02A8"],[67500,1,"\u02A6"],[67501,1,"\uAB67"],[67502,1,"\u02A7"],[67503,1,"\u0288"],[67504,1,"\u2C71"],[67505,3],[67506,1,"\u028F"],[67507,1,"\u02A1"],[67508,1,"\u02A2"],[67509,1,"\u0298"],[67510,1,"\u01C0"],[67511,1,"\u01C1"],[67512,1,"\u01C2"],[67513,1,"\uD837\uDF0A"],[67514,1,"\uD837\uDF1E"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"\uD803\uDCC0"],[68737,1,"\uD803\uDCC1"],[68738,1,"\uD803\uDCC2"],[68739,1,"\uD803\uDCC3"],[68740,1,"\uD803\uDCC4"],[68741,1,"\uD803\uDCC5"],[68742,1,"\uD803\uDCC6"],[68743,1,"\uD803\uDCC7"],[68744,1,"\uD803\uDCC8"],[68745,1,"\uD803\uDCC9"],[68746,1,"\uD803\uDCCA"],[68747,1,"\uD803\uDCCB"],[68748,1,"\uD803\uDCCC"],[68749,1,"\uD803\uDCCD"],[68750,1,"\uD803\uDCCE"],[68751,1,"\uD803\uDCCF"],[68752,1,"\uD803\uDCD0"],[68753,1,"\uD803\uDCD1"],[68754,1,"\uD803\uDCD2"],[68755,1,"\uD803\uDCD3"],[68756,1,"\uD803\uDCD4"],[68757,1,"\uD803\uDCD5"],[68758,1,"\uD803\uDCD6"],[68759,1,"\uD803\uDCD7"],[68760,1,"\uD803\uDCD8"],[68761,1,"\uD803\uDCD9"],[68762,1,"\uD803\uDCDA"],[68763,1,"\uD803\uDCDB"],[68764,1,"\uD803\uDCDC"],[68765,1,"\uD803\uDCDD"],[68766,1,"\uD803\uDCDE"],[68767,1,"\uD803\uDCDF"],[68768,1,"\uD803\uDCE0"],[68769,1,"\uD803\uDCE1"],[68770,1,"\uD803\uDCE2"],[68771,1,"\uD803\uDCE3"],[68772,1,"\uD803\uDCE4"],[68773,1,"\uD803\uDCE5"],[68774,1,"\uD803\uDCE6"],[68775,1,"\uD803\uDCE7"],[68776,1,"\uD803\uDCE8"],[68777,1,"\uD803\uDCE9"],[68778,1,"\uD803\uDCEA"],[68779,1,"\uD803\uDCEB"],[68780,1,"\uD803\uDCEC"],[68781,1,"\uD803\uDCED"],[68782,1,"\uD803\uDCEE"],[68783,1,"\uD803\uDCEF"],[68784,1,"\uD803\uDCF0"],[68785,1,"\uD803\uDCF1"],[68786,1,"\uD803\uDCF2"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69372],3],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"\uD806\uDCC0"],[71841,1,"\uD806\uDCC1"],[71842,1,"\uD806\uDCC2"],[71843,1,"\uD806\uDCC3"],[71844,1,"\uD806\uDCC4"],[71845,1,"\uD806\uDCC5"],[71846,1,"\uD806\uDCC6"],[71847,1,"\uD806\uDCC7"],[71848,1,"\uD806\uDCC8"],[71849,1,"\uD806\uDCC9"],[71850,1,"\uD806\uDCCA"],[71851,1,"\uD806\uDCCB"],[71852,1,"\uD806\uDCCC"],[71853,1,"\uD806\uDCCD"],[71854,1,"\uD806\uDCCE"],[71855,1,"\uD806\uDCCF"],[71856,1,"\uD806\uDCD0"],[71857,1,"\uD806\uDCD1"],[71858,1,"\uD806\uDCD2"],[71859,1,"\uD806\uDCD3"],[71860,1,"\uD806\uDCD4"],[71861,1,"\uD806\uDCD5"],[71862,1,"\uD806\uDCD6"],[71863,1,"\uD806\uDCD7"],[71864,1,"\uD806\uDCD8"],[71865,1,"\uD806\uDCD9"],[71866,1,"\uD806\uDCDA"],[71867,1,"\uD806\uDCDB"],[71868,1,"\uD806\uDCDC"],[71869,1,"\uD806\uDCDD"],[71870,1,"\uD806\uDCDE"],[71871,1,"\uD806\uDCDF"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[[73562,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,82943],3],[[82944,83526],2],[[83527,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93759],3],[93760,1,"\uD81B\uDE60"],[93761,1,"\uD81B\uDE61"],[93762,1,"\uD81B\uDE62"],[93763,1,"\uD81B\uDE63"],[93764,1,"\uD81B\uDE64"],[93765,1,"\uD81B\uDE65"],[93766,1,"\uD81B\uDE66"],[93767,1,"\uD81B\uDE67"],[93768,1,"\uD81B\uDE68"],[93769,1,"\uD81B\uDE69"],[93770,1,"\uD81B\uDE6A"],[93771,1,"\uD81B\uDE6B"],[93772,1,"\uD81B\uDE6C"],[93773,1,"\uD81B\uDE6D"],[93774,1,"\uD81B\uDE6E"],[93775,1,"\uD81B\uDE6F"],[93776,1,"\uD81B\uDE70"],[93777,1,"\uD81B\uDE71"],[93778,1,"\uD81B\uDE72"],[93779,1,"\uD81B\uDE73"],[93780,1,"\uD81B\uDE74"],[93781,1,"\uD81B\uDE75"],[93782,1,"\uD81B\uDE76"],[93783,1,"\uD81B\uDE77"],[93784,1,"\uD81B\uDE78"],[93785,1,"\uD81B\uDE79"],[93786,1,"\uD81B\uDE7A"],[93787,1,"\uD81B\uDE7B"],[93788,1,"\uD81B\uDE7C"],[93789,1,"\uD81B\uDE7D"],[93790,1,"\uD81B\uDE7E"],[93791,1,"\uD81B\uDE7F"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101631],3],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"\uD834\uDD57\uD834\uDD65"],[119135,1,"\uD834\uDD58\uD834\uDD65"],[119136,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD6E"],[119137,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD6F"],[119138,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD70"],[119139,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD71"],[119140,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD72"],[[119141,119154],2],[[119155,119162],3],[[119163,119226],2],[119227,1,"\uD834\uDDB9\uD834\uDD65"],[119228,1,"\uD834\uDDBA\uD834\uDD65"],[119229,1,"\uD834\uDDB9\uD834\uDD65\uD834\uDD6E"],[119230,1,"\uD834\uDDBA\uD834\uDD65\uD834\uDD6E"],[119231,1,"\uD834\uDDB9\uD834\uDD65\uD834\uDD6F"],[119232,1,"\uD834\uDDBA\uD834\uDD65\uD834\uDD6F"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"\u0131"],[120485,1,"\u0237"],[[120486,120487],3],[120488,1,"\u03B1"],[120489,1,"\u03B2"],[120490,1,"\u03B3"],[120491,1,"\u03B4"],[120492,1,"\u03B5"],[120493,1,"\u03B6"],[120494,1,"\u03B7"],[120495,1,"\u03B8"],[120496,1,"\u03B9"],[120497,1,"\u03BA"],[120498,1,"\u03BB"],[120499,1,"\u03BC"],[120500,1,"\u03BD"],[120501,1,"\u03BE"],[120502,1,"\u03BF"],[120503,1,"\u03C0"],[120504,1,"\u03C1"],[120505,1,"\u03B8"],[120506,1,"\u03C3"],[120507,1,"\u03C4"],[120508,1,"\u03C5"],[120509,1,"\u03C6"],[120510,1,"\u03C7"],[120511,1,"\u03C8"],[120512,1,"\u03C9"],[120513,1,"\u2207"],[120514,1,"\u03B1"],[120515,1,"\u03B2"],[120516,1,"\u03B3"],[120517,1,"\u03B4"],[120518,1,"\u03B5"],[120519,1,"\u03B6"],[120520,1,"\u03B7"],[120521,1,"\u03B8"],[120522,1,"\u03B9"],[120523,1,"\u03BA"],[120524,1,"\u03BB"],[120525,1,"\u03BC"],[120526,1,"\u03BD"],[120527,1,"\u03BE"],[120528,1,"\u03BF"],[120529,1,"\u03C0"],[120530,1,"\u03C1"],[[120531,120532],1,"\u03C3"],[120533,1,"\u03C4"],[120534,1,"\u03C5"],[120535,1,"\u03C6"],[120536,1,"\u03C7"],[120537,1,"\u03C8"],[120538,1,"\u03C9"],[120539,1,"\u2202"],[120540,1,"\u03B5"],[120541,1,"\u03B8"],[120542,1,"\u03BA"],[120543,1,"\u03C6"],[120544,1,"\u03C1"],[120545,1,"\u03C0"],[120546,1,"\u03B1"],[120547,1,"\u03B2"],[120548,1,"\u03B3"],[120549,1,"\u03B4"],[120550,1,"\u03B5"],[120551,1,"\u03B6"],[120552,1,"\u03B7"],[120553,1,"\u03B8"],[120554,1,"\u03B9"],[120555,1,"\u03BA"],[120556,1,"\u03BB"],[120557,1,"\u03BC"],[120558,1,"\u03BD"],[120559,1,"\u03BE"],[120560,1,"\u03BF"],[120561,1,"\u03C0"],[120562,1,"\u03C1"],[120563,1,"\u03B8"],[120564,1,"\u03C3"],[120565,1,"\u03C4"],[120566,1,"\u03C5"],[120567,1,"\u03C6"],[120568,1,"\u03C7"],[120569,1,"\u03C8"],[120570,1,"\u03C9"],[120571,1,"\u2207"],[120572,1,"\u03B1"],[120573,1,"\u03B2"],[120574,1,"\u03B3"],[120575,1,"\u03B4"],[120576,1,"\u03B5"],[120577,1,"\u03B6"],[120578,1,"\u03B7"],[120579,1,"\u03B8"],[120580,1,"\u03B9"],[120581,1,"\u03BA"],[120582,1,"\u03BB"],[120583,1,"\u03BC"],[120584,1,"\u03BD"],[120585,1,"\u03BE"],[120586,1,"\u03BF"],[120587,1,"\u03C0"],[120588,1,"\u03C1"],[[120589,120590],1,"\u03C3"],[120591,1,"\u03C4"],[120592,1,"\u03C5"],[120593,1,"\u03C6"],[120594,1,"\u03C7"],[120595,1,"\u03C8"],[120596,1,"\u03C9"],[120597,1,"\u2202"],[120598,1,"\u03B5"],[120599,1,"\u03B8"],[120600,1,"\u03BA"],[120601,1,"\u03C6"],[120602,1,"\u03C1"],[120603,1,"\u03C0"],[120604,1,"\u03B1"],[120605,1,"\u03B2"],[120606,1,"\u03B3"],[120607,1,"\u03B4"],[120608,1,"\u03B5"],[120609,1,"\u03B6"],[120610,1,"\u03B7"],[120611,1,"\u03B8"],[120612,1,"\u03B9"],[120613,1,"\u03BA"],[120614,1,"\u03BB"],[120615,1,"\u03BC"],[120616,1,"\u03BD"],[120617,1,"\u03BE"],[120618,1,"\u03BF"],[120619,1,"\u03C0"],[120620,1,"\u03C1"],[120621,1,"\u03B8"],[120622,1,"\u03C3"],[120623,1,"\u03C4"],[120624,1,"\u03C5"],[120625,1,"\u03C6"],[120626,1,"\u03C7"],[120627,1,"\u03C8"],[120628,1,"\u03C9"],[120629,1,"\u2207"],[120630,1,"\u03B1"],[120631,1,"\u03B2"],[120632,1,"\u03B3"],[120633,1,"\u03B4"],[120634,1,"\u03B5"],[120635,1,"\u03B6"],[120636,1,"\u03B7"],[120637,1,"\u03B8"],[120638,1,"\u03B9"],[120639,1,"\u03BA"],[120640,1,"\u03BB"],[120641,1,"\u03BC"],[120642,1,"\u03BD"],[120643,1,"\u03BE"],[120644,1,"\u03BF"],[120645,1,"\u03C0"],[120646,1,"\u03C1"],[[120647,120648],1,"\u03C3"],[120649,1,"\u03C4"],[120650,1,"\u03C5"],[120651,1,"\u03C6"],[120652,1,"\u03C7"],[120653,1,"\u03C8"],[120654,1,"\u03C9"],[120655,1,"\u2202"],[120656,1,"\u03B5"],[120657,1,"\u03B8"],[120658,1,"\u03BA"],[120659,1,"\u03C6"],[120660,1,"\u03C1"],[120661,1,"\u03C0"],[120662,1,"\u03B1"],[120663,1,"\u03B2"],[120664,1,"\u03B3"],[120665,1,"\u03B4"],[120666,1,"\u03B5"],[120667,1,"\u03B6"],[120668,1,"\u03B7"],[120669,1,"\u03B8"],[120670,1,"\u03B9"],[120671,1,"\u03BA"],[120672,1,"\u03BB"],[120673,1,"\u03BC"],[120674,1,"\u03BD"],[120675,1,"\u03BE"],[120676,1,"\u03BF"],[120677,1,"\u03C0"],[120678,1,"\u03C1"],[120679,1,"\u03B8"],[120680,1,"\u03C3"],[120681,1,"\u03C4"],[120682,1,"\u03C5"],[120683,1,"\u03C6"],[120684,1,"\u03C7"],[120685,1,"\u03C8"],[120686,1,"\u03C9"],[120687,1,"\u2207"],[120688,1,"\u03B1"],[120689,1,"\u03B2"],[120690,1,"\u03B3"],[120691,1,"\u03B4"],[120692,1,"\u03B5"],[120693,1,"\u03B6"],[120694,1,"\u03B7"],[120695,1,"\u03B8"],[120696,1,"\u03B9"],[120697,1,"\u03BA"],[120698,1,"\u03BB"],[120699,1,"\u03BC"],[120700,1,"\u03BD"],[120701,1,"\u03BE"],[120702,1,"\u03BF"],[120703,1,"\u03C0"],[120704,1,"\u03C1"],[[120705,120706],1,"\u03C3"],[120707,1,"\u03C4"],[120708,1,"\u03C5"],[120709,1,"\u03C6"],[120710,1,"\u03C7"],[120711,1,"\u03C8"],[120712,1,"\u03C9"],[120713,1,"\u2202"],[120714,1,"\u03B5"],[120715,1,"\u03B8"],[120716,1,"\u03BA"],[120717,1,"\u03C6"],[120718,1,"\u03C1"],[120719,1,"\u03C0"],[120720,1,"\u03B1"],[120721,1,"\u03B2"],[120722,1,"\u03B3"],[120723,1,"\u03B4"],[120724,1,"\u03B5"],[120725,1,"\u03B6"],[120726,1,"\u03B7"],[120727,1,"\u03B8"],[120728,1,"\u03B9"],[120729,1,"\u03BA"],[120730,1,"\u03BB"],[120731,1,"\u03BC"],[120732,1,"\u03BD"],[120733,1,"\u03BE"],[120734,1,"\u03BF"],[120735,1,"\u03C0"],[120736,1,"\u03C1"],[120737,1,"\u03B8"],[120738,1,"\u03C3"],[120739,1,"\u03C4"],[120740,1,"\u03C5"],[120741,1,"\u03C6"],[120742,1,"\u03C7"],[120743,1,"\u03C8"],[120744,1,"\u03C9"],[120745,1,"\u2207"],[120746,1,"\u03B1"],[120747,1,"\u03B2"],[120748,1,"\u03B3"],[120749,1,"\u03B4"],[120750,1,"\u03B5"],[120751,1,"\u03B6"],[120752,1,"\u03B7"],[120753,1,"\u03B8"],[120754,1,"\u03B9"],[120755,1,"\u03BA"],[120756,1,"\u03BB"],[120757,1,"\u03BC"],[120758,1,"\u03BD"],[120759,1,"\u03BE"],[120760,1,"\u03BF"],[120761,1,"\u03C0"],[120762,1,"\u03C1"],[[120763,120764],1,"\u03C3"],[120765,1,"\u03C4"],[120766,1,"\u03C5"],[120767,1,"\u03C6"],[120768,1,"\u03C7"],[120769,1,"\u03C8"],[120770,1,"\u03C9"],[120771,1,"\u2202"],[120772,1,"\u03B5"],[120773,1,"\u03B8"],[120774,1,"\u03BA"],[120775,1,"\u03C6"],[120776,1,"\u03C1"],[120777,1,"\u03C0"],[[120778,120779],1,"\u03DD"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"\u0430"],[122929,1,"\u0431"],[122930,1,"\u0432"],[122931,1,"\u0433"],[122932,1,"\u0434"],[122933,1,"\u0435"],[122934,1,"\u0436"],[122935,1,"\u0437"],[122936,1,"\u0438"],[122937,1,"\u043A"],[122938,1,"\u043B"],[122939,1,"\u043C"],[122940,1,"\u043E"],[122941,1,"\u043F"],[122942,1,"\u0440"],[122943,1,"\u0441"],[122944,1,"\u0442"],[122945,1,"\u0443"],[122946,1,"\u0444"],[122947,1,"\u0445"],[122948,1,"\u0446"],[122949,1,"\u0447"],[122950,1,"\u0448"],[122951,1,"\u044B"],[122952,1,"\u044D"],[122953,1,"\u044E"],[122954,1,"\uA689"],[122955,1,"\u04D9"],[122956,1,"\u0456"],[122957,1,"\u0458"],[122958,1,"\u04E9"],[122959,1,"\u04AF"],[122960,1,"\u04CF"],[122961,1,"\u0430"],[122962,1,"\u0431"],[122963,1,"\u0432"],[122964,1,"\u0433"],[122965,1,"\u0434"],[122966,1,"\u0435"],[122967,1,"\u0436"],[122968,1,"\u0437"],[122969,1,"\u0438"],[122970,1,"\u043A"],[122971,1,"\u043B"],[122972,1,"\u043E"],[122973,1,"\u043F"],[122974,1,"\u0441"],[122975,1,"\u0443"],[122976,1,"\u0444"],[122977,1,"\u0445"],[122978,1,"\u0446"],[122979,1,"\u0447"],[122980,1,"\u0448"],[122981,1,"\u044A"],[122982,1,"\u044B"],[122983,1,"\u0491"],[122984,1,"\u0456"],[122985,1,"\u0455"],[122986,1,"\u045F"],[122987,1,"\u04AB"],[122988,1,"\uA651"],[122989,1,"\u04B1"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"\uD83A\uDD22"],[125185,1,"\uD83A\uDD23"],[125186,1,"\uD83A\uDD24"],[125187,1,"\uD83A\uDD25"],[125188,1,"\uD83A\uDD26"],[125189,1,"\uD83A\uDD27"],[125190,1,"\uD83A\uDD28"],[125191,1,"\uD83A\uDD29"],[125192,1,"\uD83A\uDD2A"],[125193,1,"\uD83A\uDD2B"],[125194,1,"\uD83A\uDD2C"],[125195,1,"\uD83A\uDD2D"],[125196,1,"\uD83A\uDD2E"],[125197,1,"\uD83A\uDD2F"],[125198,1,"\uD83A\uDD30"],[125199,1,"\uD83A\uDD31"],[125200,1,"\uD83A\uDD32"],[125201,1,"\uD83A\uDD33"],[125202,1,"\uD83A\uDD34"],[125203,1,"\uD83A\uDD35"],[125204,1,"\uD83A\uDD36"],[125205,1,"\uD83A\uDD37"],[125206,1,"\uD83A\uDD38"],[125207,1,"\uD83A\uDD39"],[125208,1,"\uD83A\uDD3A"],[125209,1,"\uD83A\uDD3B"],[125210,1,"\uD83A\uDD3C"],[125211,1,"\uD83A\uDD3D"],[125212,1,"\uD83A\uDD3E"],[125213,1,"\uD83A\uDD3F"],[125214,1,"\uD83A\uDD40"],[125215,1,"\uD83A\uDD41"],[125216,1,"\uD83A\uDD42"],[125217,1,"\uD83A\uDD43"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"\u0627"],[126465,1,"\u0628"],[126466,1,"\u062C"],[126467,1,"\u062F"],[126468,3],[126469,1,"\u0648"],[126470,1,"\u0632"],[126471,1,"\u062D"],[126472,1,"\u0637"],[126473,1,"\u064A"],[126474,1,"\u0643"],[126475,1,"\u0644"],[126476,1,"\u0645"],[126477,1,"\u0646"],[126478,1,"\u0633"],[126479,1,"\u0639"],[126480,1,"\u0641"],[126481,1,"\u0635"],[126482,1,"\u0642"],[126483,1,"\u0631"],[126484,1,"\u0634"],[126485,1,"\u062A"],[126486,1,"\u062B"],[126487,1,"\u062E"],[126488,1,"\u0630"],[126489,1,"\u0636"],[126490,1,"\u0638"],[126491,1,"\u063A"],[126492,1,"\u066E"],[126493,1,"\u06BA"],[126494,1,"\u06A1"],[126495,1,"\u066F"],[126496,3],[126497,1,"\u0628"],[126498,1,"\u062C"],[126499,3],[126500,1,"\u0647"],[[126501,126502],3],[126503,1,"\u062D"],[126504,3],[126505,1,"\u064A"],[126506,1,"\u0643"],[126507,1,"\u0644"],[126508,1,"\u0645"],[126509,1,"\u0646"],[126510,1,"\u0633"],[126511,1,"\u0639"],[126512,1,"\u0641"],[126513,1,"\u0635"],[126514,1,"\u0642"],[126515,3],[126516,1,"\u0634"],[126517,1,"\u062A"],[126518,1,"\u062B"],[126519,1,"\u062E"],[126520,3],[126521,1,"\u0636"],[126522,3],[126523,1,"\u063A"],[[126524,126529],3],[126530,1,"\u062C"],[[126531,126534],3],[126535,1,"\u062D"],[126536,3],[126537,1,"\u064A"],[126538,3],[126539,1,"\u0644"],[126540,3],[126541,1,"\u0646"],[126542,1,"\u0633"],[126543,1,"\u0639"],[126544,3],[126545,1,"\u0635"],[126546,1,"\u0642"],[126547,3],[126548,1,"\u0634"],[[126549,126550],3],[126551,1,"\u062E"],[126552,3],[126553,1,"\u0636"],[126554,3],[126555,1,"\u063A"],[126556,3],[126557,1,"\u06BA"],[126558,3],[126559,1,"\u066F"],[126560,3],[126561,1,"\u0628"],[126562,1,"\u062C"],[126563,3],[126564,1,"\u0647"],[[126565,126566],3],[126567,1,"\u062D"],[126568,1,"\u0637"],[126569,1,"\u064A"],[126570,1,"\u0643"],[126571,3],[126572,1,"\u0645"],[126573,1,"\u0646"],[126574,1,"\u0633"],[126575,1,"\u0639"],[126576,1,"\u0641"],[126577,1,"\u0635"],[126578,1,"\u0642"],[126579,3],[126580,1,"\u0634"],[126581,1,"\u062A"],[126582,1,"\u062B"],[126583,1,"\u062E"],[126584,3],[126585,1,"\u0636"],[126586,1,"\u0638"],[126587,1,"\u063A"],[126588,1,"\u066E"],[126589,3],[126590,1,"\u06A1"],[126591,3],[126592,1,"\u0627"],[126593,1,"\u0628"],[126594,1,"\u062C"],[126595,1,"\u062F"],[126596,1,"\u0647"],[126597,1,"\u0648"],[126598,1,"\u0632"],[126599,1,"\u062D"],[126600,1,"\u0637"],[126601,1,"\u064A"],[126602,3],[126603,1,"\u0644"],[126604,1,"\u0645"],[126605,1,"\u0646"],[126606,1,"\u0633"],[126607,1,"\u0639"],[126608,1,"\u0641"],[126609,1,"\u0635"],[126610,1,"\u0642"],[126611,1,"\u0631"],[126612,1,"\u0634"],[126613,1,"\u062A"],[126614,1,"\u062B"],[126615,1,"\u062E"],[126616,1,"\u0630"],[126617,1,"\u0636"],[126618,1,"\u0638"],[126619,1,"\u063A"],[[126620,126624],3],[126625,1,"\u0628"],[126626,1,"\u062C"],[126627,1,"\u062F"],[126628,3],[126629,1,"\u0648"],[126630,1,"\u0632"],[126631,1,"\u062D"],[126632,1,"\u0637"],[126633,1,"\u064A"],[126634,3],[126635,1,"\u0644"],[126636,1,"\u0645"],[126637,1,"\u0646"],[126638,1,"\u0633"],[126639,1,"\u0639"],[126640,1,"\u0641"],[126641,1,"\u0635"],[126642,1,"\u0642"],[126643,1,"\u0631"],[126644,1,"\u0634"],[126645,1,"\u062A"],[126646,1,"\u062B"],[126647,1,"\u062E"],[126648,1,"\u0630"],[126649,1,"\u0636"],[126650,1,"\u0638"],[126651,1,"\u063A"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,5,"0,"],[127234,5,"1,"],[127235,5,"2,"],[127236,5,"3,"],[127237,5,"4,"],[127238,5,"5,"],[127239,5,"6,"],[127240,5,"7,"],[127241,5,"8,"],[127242,5,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,5,"(a)"],[127249,5,"(b)"],[127250,5,"(c)"],[127251,5,"(d)"],[127252,5,"(e)"],[127253,5,"(f)"],[127254,5,"(g)"],[127255,5,"(h)"],[127256,5,"(i)"],[127257,5,"(j)"],[127258,5,"(k)"],[127259,5,"(l)"],[127260,5,"(m)"],[127261,5,"(n)"],[127262,5,"(o)"],[127263,5,"(p)"],[127264,5,"(q)"],[127265,5,"(r)"],[127266,5,"(s)"],[127267,5,"(t)"],[127268,5,"(u)"],[127269,5,"(v)"],[127270,5,"(w)"],[127271,5,"(x)"],[127272,5,"(y)"],[127273,5,"(z)"],[127274,1,"\u3014s\u3015"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"\u307B\u304B"],[127489,1,"\u30B3\u30B3"],[127490,1,"\u30B5"],[[127491,127503],3],[127504,1,"\u624B"],[127505,1,"\u5B57"],[127506,1,"\u53CC"],[127507,1,"\u30C7"],[127508,1,"\u4E8C"],[127509,1,"\u591A"],[127510,1,"\u89E3"],[127511,1,"\u5929"],[127512,1,"\u4EA4"],[127513,1,"\u6620"],[127514,1,"\u7121"],[127515,1,"\u6599"],[127516,1,"\u524D"],[127517,1,"\u5F8C"],[127518,1,"\u518D"],[127519,1,"\u65B0"],[127520,1,"\u521D"],[127521,1,"\u7D42"],[127522,1,"\u751F"],[127523,1,"\u8CA9"],[127524,1,"\u58F0"],[127525,1,"\u5439"],[127526,1,"\u6F14"],[127527,1,"\u6295"],[127528,1,"\u6355"],[127529,1,"\u4E00"],[127530,1,"\u4E09"],[127531,1,"\u904A"],[127532,1,"\u5DE6"],[127533,1,"\u4E2D"],[127534,1,"\u53F3"],[127535,1,"\u6307"],[127536,1,"\u8D70"],[127537,1,"\u6253"],[127538,1,"\u7981"],[127539,1,"\u7A7A"],[127540,1,"\u5408"],[127541,1,"\u6E80"],[127542,1,"\u6709"],[127543,1,"\u6708"],[127544,1,"\u7533"],[127545,1,"\u5272"],[127546,1,"\u55B6"],[127547,1,"\u914D"],[[127548,127551],3],[127552,1,"\u3014\u672C\u3015"],[127553,1,"\u3014\u4E09\u3015"],[127554,1,"\u3014\u4E8C\u3015"],[127555,1,"\u3014\u5B89\u3015"],[127556,1,"\u3014\u70B9\u3015"],[127557,1,"\u3014\u6253\u3015"],[127558,1,"\u3014\u76D7\u3015"],[127559,1,"\u3014\u52DD\u3015"],[127560,1,"\u3014\u6557\u3015"],[[127561,127567],3],[127568,1,"\u5F97"],[127569,1,"\u53EF"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[[129673,129679],3],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,3],[129727,2],[[129728,129730],2],[[129731,129733],2],[[129734,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[[129756,129759],3],[[129760,129767],2],[129768,2],[[129769,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],3],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,194559],3],[194560,1,"\u4E3D"],[194561,1,"\u4E38"],[194562,1,"\u4E41"],[194563,1,"\uD840\uDD22"],[194564,1,"\u4F60"],[194565,1,"\u4FAE"],[194566,1,"\u4FBB"],[194567,1,"\u5002"],[194568,1,"\u507A"],[194569,1,"\u5099"],[194570,1,"\u50E7"],[194571,1,"\u50CF"],[194572,1,"\u349E"],[194573,1,"\uD841\uDE3A"],[194574,1,"\u514D"],[194575,1,"\u5154"],[194576,1,"\u5164"],[194577,1,"\u5177"],[194578,1,"\uD841\uDD1C"],[194579,1,"\u34B9"],[194580,1,"\u5167"],[194581,1,"\u518D"],[194582,1,"\uD841\uDD4B"],[194583,1,"\u5197"],[194584,1,"\u51A4"],[194585,1,"\u4ECC"],[194586,1,"\u51AC"],[194587,1,"\u51B5"],[194588,1,"\uD864\uDDDF"],[194589,1,"\u51F5"],[194590,1,"\u5203"],[194591,1,"\u34DF"],[194592,1,"\u523B"],[194593,1,"\u5246"],[194594,1,"\u5272"],[194595,1,"\u5277"],[194596,1,"\u3515"],[194597,1,"\u52C7"],[194598,1,"\u52C9"],[194599,1,"\u52E4"],[194600,1,"\u52FA"],[194601,1,"\u5305"],[194602,1,"\u5306"],[194603,1,"\u5317"],[194604,1,"\u5349"],[194605,1,"\u5351"],[194606,1,"\u535A"],[194607,1,"\u5373"],[194608,1,"\u537D"],[[194609,194611],1,"\u537F"],[194612,1,"\uD842\uDE2C"],[194613,1,"\u7070"],[194614,1,"\u53CA"],[194615,1,"\u53DF"],[194616,1,"\uD842\uDF63"],[194617,1,"\u53EB"],[194618,1,"\u53F1"],[194619,1,"\u5406"],[194620,1,"\u549E"],[194621,1,"\u5438"],[194622,1,"\u5448"],[194623,1,"\u5468"],[194624,1,"\u54A2"],[194625,1,"\u54F6"],[194626,1,"\u5510"],[194627,1,"\u5553"],[194628,1,"\u5563"],[[194629,194630],1,"\u5584"],[194631,1,"\u5599"],[194632,1,"\u55AB"],[194633,1,"\u55B3"],[194634,1,"\u55C2"],[194635,1,"\u5716"],[194636,1,"\u5606"],[194637,1,"\u5717"],[194638,1,"\u5651"],[194639,1,"\u5674"],[194640,1,"\u5207"],[194641,1,"\u58EE"],[194642,1,"\u57CE"],[194643,1,"\u57F4"],[194644,1,"\u580D"],[194645,1,"\u578B"],[194646,1,"\u5832"],[194647,1,"\u5831"],[194648,1,"\u58AC"],[194649,1,"\uD845\uDCE4"],[194650,1,"\u58F2"],[194651,1,"\u58F7"],[194652,1,"\u5906"],[194653,1,"\u591A"],[194654,1,"\u5922"],[194655,1,"\u5962"],[194656,1,"\uD845\uDEA8"],[194657,1,"\uD845\uDEEA"],[194658,1,"\u59EC"],[194659,1,"\u5A1B"],[194660,1,"\u5A27"],[194661,1,"\u59D8"],[194662,1,"\u5A66"],[194663,1,"\u36EE"],[194664,3],[194665,1,"\u5B08"],[[194666,194667],1,"\u5B3E"],[194668,1,"\uD846\uDDC8"],[194669,1,"\u5BC3"],[194670,1,"\u5BD8"],[194671,1,"\u5BE7"],[194672,1,"\u5BF3"],[194673,1,"\uD846\uDF18"],[194674,1,"\u5BFF"],[194675,1,"\u5C06"],[194676,3],[194677,1,"\u5C22"],[194678,1,"\u3781"],[194679,1,"\u5C60"],[194680,1,"\u5C6E"],[194681,1,"\u5CC0"],[194682,1,"\u5C8D"],[194683,1,"\uD847\uDDE4"],[194684,1,"\u5D43"],[194685,1,"\uD847\uDDE6"],[194686,1,"\u5D6E"],[194687,1,"\u5D6B"],[194688,1,"\u5D7C"],[194689,1,"\u5DE1"],[194690,1,"\u5DE2"],[194691,1,"\u382F"],[194692,1,"\u5DFD"],[194693,1,"\u5E28"],[194694,1,"\u5E3D"],[194695,1,"\u5E69"],[194696,1,"\u3862"],[194697,1,"\uD848\uDD83"],[194698,1,"\u387C"],[194699,1,"\u5EB0"],[194700,1,"\u5EB3"],[194701,1,"\u5EB6"],[194702,1,"\u5ECA"],[194703,1,"\uD868\uDF92"],[194704,1,"\u5EFE"],[[194705,194706],1,"\uD848\uDF31"],[194707,1,"\u8201"],[[194708,194709],1,"\u5F22"],[194710,1,"\u38C7"],[194711,1,"\uD84C\uDEB8"],[194712,1,"\uD858\uDDDA"],[194713,1,"\u5F62"],[194714,1,"\u5F6B"],[194715,1,"\u38E3"],[194716,1,"\u5F9A"],[194717,1,"\u5FCD"],[194718,1,"\u5FD7"],[194719,1,"\u5FF9"],[194720,1,"\u6081"],[194721,1,"\u393A"],[194722,1,"\u391C"],[194723,1,"\u6094"],[194724,1,"\uD849\uDED4"],[194725,1,"\u60C7"],[194726,1,"\u6148"],[194727,1,"\u614C"],[194728,1,"\u614E"],[194729,1,"\u614C"],[194730,1,"\u617A"],[194731,1,"\u618E"],[194732,1,"\u61B2"],[194733,1,"\u61A4"],[194734,1,"\u61AF"],[194735,1,"\u61DE"],[194736,1,"\u61F2"],[194737,1,"\u61F6"],[194738,1,"\u6210"],[194739,1,"\u621B"],[194740,1,"\u625D"],[194741,1,"\u62B1"],[194742,1,"\u62D4"],[194743,1,"\u6350"],[194744,1,"\uD84A\uDF0C"],[194745,1,"\u633D"],[194746,1,"\u62FC"],[194747,1,"\u6368"],[194748,1,"\u6383"],[194749,1,"\u63E4"],[194750,1,"\uD84A\uDFF1"],[194751,1,"\u6422"],[194752,1,"\u63C5"],[194753,1,"\u63A9"],[194754,1,"\u3A2E"],[194755,1,"\u6469"],[194756,1,"\u647E"],[194757,1,"\u649D"],[194758,1,"\u6477"],[194759,1,"\u3A6C"],[194760,1,"\u654F"],[194761,1,"\u656C"],[194762,1,"\uD84C\uDC0A"],[194763,1,"\u65E3"],[194764,1,"\u66F8"],[194765,1,"\u6649"],[194766,1,"\u3B19"],[194767,1,"\u6691"],[194768,1,"\u3B08"],[194769,1,"\u3AE4"],[194770,1,"\u5192"],[194771,1,"\u5195"],[194772,1,"\u6700"],[194773,1,"\u669C"],[194774,1,"\u80AD"],[194775,1,"\u43D9"],[194776,1,"\u6717"],[194777,1,"\u671B"],[194778,1,"\u6721"],[194779,1,"\u675E"],[194780,1,"\u6753"],[194781,1,"\uD84C\uDFC3"],[194782,1,"\u3B49"],[194783,1,"\u67FA"],[194784,1,"\u6785"],[194785,1,"\u6852"],[194786,1,"\u6885"],[194787,1,"\uD84D\uDC6D"],[194788,1,"\u688E"],[194789,1,"\u681F"],[194790,1,"\u6914"],[194791,1,"\u3B9D"],[194792,1,"\u6942"],[194793,1,"\u69A3"],[194794,1,"\u69EA"],[194795,1,"\u6AA8"],[194796,1,"\uD84D\uDEA3"],[194797,1,"\u6ADB"],[194798,1,"\u3C18"],[194799,1,"\u6B21"],[194800,1,"\uD84E\uDCA7"],[194801,1,"\u6B54"],[194802,1,"\u3C4E"],[194803,1,"\u6B72"],[194804,1,"\u6B9F"],[194805,1,"\u6BBA"],[194806,1,"\u6BBB"],[194807,1,"\uD84E\uDE8D"],[194808,1,"\uD847\uDD0B"],[194809,1,"\uD84E\uDEFA"],[194810,1,"\u6C4E"],[194811,1,"\uD84F\uDCBC"],[194812,1,"\u6CBF"],[194813,1,"\u6CCD"],[194814,1,"\u6C67"],[194815,1,"\u6D16"],[194816,1,"\u6D3E"],[194817,1,"\u6D77"],[194818,1,"\u6D41"],[194819,1,"\u6D69"],[194820,1,"\u6D78"],[194821,1,"\u6D85"],[194822,1,"\uD84F\uDD1E"],[194823,1,"\u6D34"],[194824,1,"\u6E2F"],[194825,1,"\u6E6E"],[194826,1,"\u3D33"],[194827,1,"\u6ECB"],[194828,1,"\u6EC7"],[194829,1,"\uD84F\uDED1"],[194830,1,"\u6DF9"],[194831,1,"\u6F6E"],[194832,1,"\uD84F\uDF5E"],[194833,1,"\uD84F\uDF8E"],[194834,1,"\u6FC6"],[194835,1,"\u7039"],[194836,1,"\u701E"],[194837,1,"\u701B"],[194838,1,"\u3D96"],[194839,1,"\u704A"],[194840,1,"\u707D"],[194841,1,"\u7077"],[194842,1,"\u70AD"],[194843,1,"\uD841\uDD25"],[194844,1,"\u7145"],[194845,1,"\uD850\uDE63"],[194846,1,"\u719C"],[194847,3],[194848,1,"\u7228"],[194849,1,"\u7235"],[194850,1,"\u7250"],[194851,1,"\uD851\uDE08"],[194852,1,"\u7280"],[194853,1,"\u7295"],[194854,1,"\uD851\uDF35"],[194855,1,"\uD852\uDC14"],[194856,1,"\u737A"],[194857,1,"\u738B"],[194858,1,"\u3EAC"],[194859,1,"\u73A5"],[[194860,194861],1,"\u3EB8"],[194862,1,"\u7447"],[194863,1,"\u745C"],[194864,1,"\u7471"],[194865,1,"\u7485"],[194866,1,"\u74CA"],[194867,1,"\u3F1B"],[194868,1,"\u7524"],[194869,1,"\uD853\uDC36"],[194870,1,"\u753E"],[194871,1,"\uD853\uDC92"],[194872,1,"\u7570"],[194873,1,"\uD848\uDD9F"],[194874,1,"\u7610"],[194875,1,"\uD853\uDFA1"],[194876,1,"\uD853\uDFB8"],[194877,1,"\uD854\uDC44"],[194878,1,"\u3FFC"],[194879,1,"\u4008"],[194880,1,"\u76F4"],[194881,1,"\uD854\uDCF3"],[194882,1,"\uD854\uDCF2"],[194883,1,"\uD854\uDD19"],[194884,1,"\uD854\uDD33"],[194885,1,"\u771E"],[[194886,194887],1,"\u771F"],[194888,1,"\u774A"],[194889,1,"\u4039"],[194890,1,"\u778B"],[194891,1,"\u4046"],[194892,1,"\u4096"],[194893,1,"\uD855\uDC1D"],[194894,1,"\u784E"],[194895,1,"\u788C"],[194896,1,"\u78CC"],[194897,1,"\u40E3"],[194898,1,"\uD855\uDE26"],[194899,1,"\u7956"],[194900,1,"\uD855\uDE9A"],[194901,1,"\uD855\uDEC5"],[194902,1,"\u798F"],[194903,1,"\u79EB"],[194904,1,"\u412F"],[194905,1,"\u7A40"],[194906,1,"\u7A4A"],[194907,1,"\u7A4F"],[194908,1,"\uD856\uDD7C"],[[194909,194910],1,"\uD856\uDEA7"],[194911,3],[194912,1,"\u4202"],[194913,1,"\uD856\uDFAB"],[194914,1,"\u7BC6"],[194915,1,"\u7BC9"],[194916,1,"\u4227"],[194917,1,"\uD857\uDC80"],[194918,1,"\u7CD2"],[194919,1,"\u42A0"],[194920,1,"\u7CE8"],[194921,1,"\u7CE3"],[194922,1,"\u7D00"],[194923,1,"\uD857\uDF86"],[194924,1,"\u7D63"],[194925,1,"\u4301"],[194926,1,"\u7DC7"],[194927,1,"\u7E02"],[194928,1,"\u7E45"],[194929,1,"\u4334"],[194930,1,"\uD858\uDE28"],[194931,1,"\uD858\uDE47"],[194932,1,"\u4359"],[194933,1,"\uD858\uDED9"],[194934,1,"\u7F7A"],[194935,1,"\uD858\uDF3E"],[194936,1,"\u7F95"],[194937,1,"\u7FFA"],[194938,1,"\u8005"],[194939,1,"\uD859\uDCDA"],[194940,1,"\uD859\uDD23"],[194941,1,"\u8060"],[194942,1,"\uD859\uDDA8"],[194943,1,"\u8070"],[194944,1,"\uD84C\uDF5F"],[194945,1,"\u43D5"],[194946,1,"\u80B2"],[194947,1,"\u8103"],[194948,1,"\u440B"],[194949,1,"\u813E"],[194950,1,"\u5AB5"],[194951,1,"\uD859\uDFA7"],[194952,1,"\uD859\uDFB5"],[194953,1,"\uD84C\uDF93"],[194954,1,"\uD84C\uDF9C"],[194955,1,"\u8201"],[194956,1,"\u8204"],[194957,1,"\u8F9E"],[194958,1,"\u446B"],[194959,1,"\u8291"],[194960,1,"\u828B"],[194961,1,"\u829D"],[194962,1,"\u52B3"],[194963,1,"\u82B1"],[194964,1,"\u82B3"],[194965,1,"\u82BD"],[194966,1,"\u82E6"],[194967,1,"\uD85A\uDF3C"],[194968,1,"\u82E5"],[194969,1,"\u831D"],[194970,1,"\u8363"],[194971,1,"\u83AD"],[194972,1,"\u8323"],[194973,1,"\u83BD"],[194974,1,"\u83E7"],[194975,1,"\u8457"],[194976,1,"\u8353"],[194977,1,"\u83CA"],[194978,1,"\u83CC"],[194979,1,"\u83DC"],[194980,1,"\uD85B\uDC36"],[194981,1,"\uD85B\uDD6B"],[194982,1,"\uD85B\uDCD5"],[194983,1,"\u452B"],[194984,1,"\u84F1"],[194985,1,"\u84F3"],[194986,1,"\u8516"],[194987,1,"\uD85C\uDFCA"],[194988,1,"\u8564"],[194989,1,"\uD85B\uDF2C"],[194990,1,"\u455D"],[194991,1,"\u4561"],[194992,1,"\uD85B\uDFB1"],[194993,1,"\uD85C\uDCD2"],[194994,1,"\u456B"],[194995,1,"\u8650"],[194996,1,"\u865C"],[194997,1,"\u8667"],[194998,1,"\u8669"],[194999,1,"\u86A9"],[195000,1,"\u8688"],[195001,1,"\u870E"],[195002,1,"\u86E2"],[195003,1,"\u8779"],[195004,1,"\u8728"],[195005,1,"\u876B"],[195006,1,"\u8786"],[195007,3],[195008,1,"\u87E1"],[195009,1,"\u8801"],[195010,1,"\u45F9"],[195011,1,"\u8860"],[195012,1,"\u8863"],[195013,1,"\uD85D\uDE67"],[195014,1,"\u88D7"],[195015,1,"\u88DE"],[195016,1,"\u4635"],[195017,1,"\u88FA"],[195018,1,"\u34BB"],[195019,1,"\uD85E\uDCAE"],[195020,1,"\uD85E\uDD66"],[195021,1,"\u46BE"],[195022,1,"\u46C7"],[195023,1,"\u8AA0"],[195024,1,"\u8AED"],[195025,1,"\u8B8A"],[195026,1,"\u8C55"],[195027,1,"\uD85F\uDCA8"],[195028,1,"\u8CAB"],[195029,1,"\u8CC1"],[195030,1,"\u8D1B"],[195031,1,"\u8D77"],[195032,1,"\uD85F\uDF2F"],[195033,1,"\uD842\uDC04"],[195034,1,"\u8DCB"],[195035,1,"\u8DBC"],[195036,1,"\u8DF0"],[195037,1,"\uD842\uDCDE"],[195038,1,"\u8ED4"],[195039,1,"\u8F38"],[195040,1,"\uD861\uDDD2"],[195041,1,"\uD861\uDDED"],[195042,1,"\u9094"],[195043,1,"\u90F1"],[195044,1,"\u9111"],[195045,1,"\uD861\uDF2E"],[195046,1,"\u911B"],[195047,1,"\u9238"],[195048,1,"\u92D7"],[195049,1,"\u92D8"],[195050,1,"\u927C"],[195051,1,"\u93F9"],[195052,1,"\u9415"],[195053,1,"\uD862\uDFFA"],[195054,1,"\u958B"],[195055,1,"\u4995"],[195056,1,"\u95B7"],[195057,1,"\uD863\uDD77"],[195058,1,"\u49E6"],[195059,1,"\u96C3"],[195060,1,"\u5DB2"],[195061,1,"\u9723"],[195062,1,"\uD864\uDD45"],[195063,1,"\uD864\uDE1A"],[195064,1,"\u4A6E"],[195065,1,"\u4A76"],[195066,1,"\u97E0"],[195067,1,"\uD865\uDC0A"],[195068,1,"\u4AB2"],[195069,1,"\uD865\uDC96"],[[195070,195071],1,"\u980B"],[195072,1,"\u9829"],[195073,1,"\uD865\uDDB6"],[195074,1,"\u98E2"],[195075,1,"\u4B33"],[195076,1,"\u9929"],[195077,1,"\u99A7"],[195078,1,"\u99C2"],[195079,1,"\u99FE"],[195080,1,"\u4BCE"],[195081,1,"\uD866\uDF30"],[195082,1,"\u9B12"],[195083,1,"\u9C40"],[195084,1,"\u9CFD"],[195085,1,"\u4CCE"],[195086,1,"\u4CED"],[195087,1,"\u9D67"],[195088,1,"\uD868\uDCCE"],[195089,1,"\u4CF8"],[195090,1,"\uD868\uDD05"],[195091,1,"\uD868\uDE0E"],[195092,1,"\uD868\uDE91"],[195093,1,"\u9EBB"],[195094,1,"\u4D56"],[195095,1,"\u9EF9"],[195096,1,"\u9EFE"],[195097,1,"\u9F05"],[195098,1,"\u9F0F"],[195099,1,"\u9F16"],[195100,1,"\u9F3B"],[195101,1,"\uD869\uDE00"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]});var kP=E(($61,TP)=>{$61.STATUS_MAPPING={mapped:1,valid:2,disallowed:3,disallowed_STD3_valid:4,disallowed_STD3_mapped:5,deviation:6,ignored:7}});var xP=E((Sw1,uP)=>{var PG=IP(),k6=NP(),OP=jP(),{STATUS_MAPPING:O2}=kP();function G61(F){return/[^\x00-\x7F]/u.test(F)}function SP(F,{useSTD3ASCIIRules:A}){let D=0,Z=OP.length-1;while(D<=Z){let J=Math.floor((D+Z)/2),X=OP[J],$=Array.isArray(X[0])?X[0][0]:X[0],G=Array.isArray(X[0])?X[0][1]:X[0];if($<=F&&G>=F){if(A&&(X[1]===O2.disallowed_STD3_valid||X[1]===O2.disallowed_STD3_mapped))return[O2.disallowed,...X.slice(2)];else if(X[1]===O2.disallowed_STD3_valid)return[O2.valid,...X.slice(2)];else if(X[1]===O2.disallowed_STD3_mapped)return[O2.mapped,...X.slice(2)];return X.slice(1)}else if($>F)Z=J-1;else D=J+1}return null}function B61(F,{useSTD3ASCIIRules:A,processingOption:D}){let Z=!1,J="";for(let X of F){let[$,G]=SP(X.codePointAt(0),{useSTD3ASCIIRules:A});switch($){case O2.disallowed:Z=!0,J+=X;break;case O2.ignored:break;case O2.mapped:J+=G;break;case O2.deviation:if(D==="transitional")J+=G;else J+=X;break;case O2.valid:J+=X;break}}return{string:J,error:Z}}function H61(F,{checkHyphens:A,checkBidi:D,checkJoiners:Z,processingOption:J,useSTD3ASCIIRules:X}){if(F.normalize("NFC")!==F)return!1;let $=Array.from(F);if(A){if($[2]==="-"&&$[3]==="-"||(F.startsWith("-")||F.endsWith("-")))return!1}if(F.includes(".")||$.length>0&&k6.combiningMarks.test($[0]))return!1;for(let G of $){let[Y]=SP(G.codePointAt(0),{useSTD3ASCIIRules:X});if(J==="transitional"&&Y!==O2.valid||J==="nontransitional"&&Y!==O2.valid&&Y!==O2.deviation)return!1}if(Z){let G=0;for(let[Y,B]of $.entries())if(B==="\u200C"||B==="\u200D"){if(Y>0){if(k6.combiningClassVirama.test($[Y-1]))continue;if(B==="\u200C"){let H=$.indexOf("\u200C",Y+1),q=H<0?$.slice(G):$.slice(G,H);if(k6.validZWNJ.test(q.join(""))){G=Y+1;continue}}}return!1}}if(D&&$.length>0){let G;if(k6.bidiS1LTR.test($[0]))G=!1;else if(k6.bidiS1RTL.test($[0]))G=!0;else return!1;if(G){if(!k6.bidiS2.test(F)||!k6.bidiS3.test(F)||k6.bidiS4EN.test(F)&&k6.bidiS4AN.test(F))return!1}else if(!k6.bidiS5.test(F)||!k6.bidiS6.test(F))return!1}return!0}function q61(F){let A=F.map((D)=>{if(D.startsWith("xn--"))try{return PG.decode(D.substring(4))}catch(Z){return""}return D}).join(".");return k6.bidiDomain.test(A)}function _P(F,A){let{processingOption:D}=A,{string:Z,error:J}=B61(F,A);Z=Z.normalize("NFC");let X=Z.split("."),$=q61(X);for(let[G,Y]of X.entries()){let B=Y,H=D;if(B.startsWith("xn--")){try{B=PG.decode(B.substring(4)),X[G]=B}catch(W){J=!0;continue}H="nontransitional"}if(J)continue;if(!H61(B,{...A,processingOption:H,checkBidi:A.checkBidi&&$}))J=!0}return{string:X.join("."),error:J}}function W61(F,{checkHyphens:A=!1,checkBidi:D=!1,checkJoiners:Z=!1,useSTD3ASCIIRules:J=!1,processingOption:X="nontransitional",verifyDNSLength:$=!1}={}){if(X!=="transitional"&&X!=="nontransitional")throw new RangeError("processingOption must be either transitional or nontransitional");let G=_P(F,{processingOption:X,checkHyphens:A,checkBidi:D,checkJoiners:Z,useSTD3ASCIIRules:J}),Y=G.string.split(".");if(Y=Y.map((B)=>{if(G61(B))try{return`xn--${PG.encode(B)}`}catch(H){G.error=!0}return B}),$){let B=Y.join(".").length;if(B>253||B===0)G.error=!0;for(let H=0;H<Y.length;++H)if(Y[H].length>63||Y[H].length===0){G.error=!0;break}}if(G.error)return null;return Y.join(".")}function C61(F,{checkHyphens:A=!1,checkBidi:D=!1,checkJoiners:Z=!1,useSTD3ASCIIRules:J=!1,processingOption:X="nontransitional"}={}){let $=_P(F,{processingOption:X,checkHyphens:A,checkBidi:D,checkJoiners:Z,useSTD3ASCIIRules:J});return{domain:$.string,error:$.error}}uP.exports={toASCII:W61,toUnicode:C61}});var MG=E((_w1,fP)=>{function IG(F){return F>=48&&F<=57}function gP(F){return F>=65&&F<=90||F>=97&&F<=122}function Q61(F){return gP(F)||IG(F)}function K61(F){return IG(F)||F>=65&&F<=70||F>=97&&F<=102}fP.exports={isASCIIDigit:IG,isASCIIAlpha:gP,isASCIIAlphanumeric:Q61,isASCIIHex:K61}});var OD=E((uw1,yP)=>{var E61=new TextEncoder,U61=new TextDecoder("utf-8",{ignoreBOM:!0});function z61(F){return E61.encode(F)}function V61(F){return U61.decode(F)}yP.exports={utf8Encode:z61,utf8DecodeWithoutBOM:V61}});var SD=E((xw1,lP)=>{var{isASCIIHex:bP}=MG(),{utf8Encode:hP}=OD();function T1(F){return F.codePointAt(0)}function L61(F){let A=F.toString(16).toUpperCase();if(A.length===1)A=`0${A}`;return`%${A}`}function vP(F){let A=new Uint8Array(F.byteLength),D=0;for(let Z=0;Z<F.byteLength;++Z){let J=F[Z];if(J!==37)A[D++]=J;else if(J===37&&(!bP(F[Z+1])||!bP(F[Z+2])))A[D++]=J;else{let X=parseInt(String.fromCodePoint(F[Z+1],F[Z+2]),16);A[D++]=X,Z+=2}}return A.slice(0,D)}function R61(F){let A=hP(F);return vP(A)}function NG(F){return F<=31||F>126}var w61=new Set([T1(" "),T1('"'),T1("<"),T1(">"),T1("`")]);function P61(F){return NG(F)||w61.has(F)}var I61=new Set([T1(" "),T1('"'),T1("#"),T1("<"),T1(">")]);function jG(F){return NG(F)||I61.has(F)}function M61(F){return jG(F)||F===T1("'")}var N61=new Set([T1("?"),T1("`"),T1("{"),T1("}")]);function mP(F){return jG(F)||N61.has(F)}var j61=new Set([T1("/"),T1(":"),T1(";"),T1("="),T1("@"),T1("["),T1("\\"),T1("]"),T1("^"),T1("|")]);function dP(F){return mP(F)||j61.has(F)}var T61=new Set([T1("$"),T1("%"),T1("&"),T1("+"),T1(",")]);function k61(F){return dP(F)||T61.has(F)}var O61=new Set([T1("!"),T1("'"),T1("("),T1(")"),T1("~")]);function S61(F){return k61(F)||O61.has(F)}function cP(F,A){let D=hP(F),Z="";for(let J of D)if(!A(J))Z+=String.fromCharCode(J);else Z+=L61(J);return Z}function _61(F,A){return cP(String.fromCodePoint(F),A)}function u61(F,A,D=!1){let Z="";for(let J of F)if(D&&J===" ")Z+="+";else Z+=cP(J,A);return Z}lP.exports={isC0ControlPercentEncode:NG,isFragmentPercentEncode:P61,isQueryPercentEncode:jG,isSpecialQueryPercentEncode:M61,isPathPercentEncode:mP,isUserinfoPercentEncode:dP,isURLEncodedPercentEncode:S61,percentDecodeString:R61,percentDecodeBytes:vP,utf8PercentEncodeString:u61,utf8PercentEncodeCodePoint:_61}});var uG=E(($31,S2)=>{var x61=xP(),n0=MG(),{utf8DecodeWithoutBOM:g61}=OD(),{percentDecodeString:f61,utf8PercentEncodeCodePoint:uD,utf8PercentEncodeString:xD,isC0ControlPercentEncode:sP,isFragmentPercentEncode:y61,isQueryPercentEncode:b61,isSpecialQueryPercentEncode:h61,isPathPercentEncode:v61,isUserinfoPercentEncode:OG}=SD();function a(F){return F.codePointAt(0)}var rP={ftp:21,file:null,http:80,https:443,ws:80,wss:443},E1=Symbol("failure");function pP(F){return[...F].length}function iP(F,A){let D=F[A];return isNaN(D)?void 0:String.fromCodePoint(D)}function aP(F){return F==="."||F.toLowerCase()==="%2e"}function m61(F){return F=F.toLowerCase(),F===".."||F==="%2e."||F===".%2e"||F==="%2e%2e"}function d61(F,A){return n0.isASCIIAlpha(F)&&(A===a(":")||A===a("|"))}function tP(F){return F.length===2&&n0.isASCIIAlpha(F.codePointAt(0))&&(F[1]===":"||F[1]==="|")}function c61(F){return F.length===2&&n0.isASCIIAlpha(F.codePointAt(0))&&F[1]===":"}function oP(F){return F.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)!==-1}function l61(F){return oP(F)||F.search(/[\u0000-\u001F]|%|\u007F/u)!==-1}function _D(F){return rP[F]!==void 0}function a0(F){return _D(F.scheme)}function TG(F){return!_D(F.scheme)}function eP(F){return rP[F]}function FI(F){if(F==="")return E1;let A=10;if(F.length>=2&&F.charAt(0)==="0"&&F.charAt(1).toLowerCase()==="x")F=F.substring(2),A=16;else if(F.length>=2&&F.charAt(0)==="0")F=F.substring(1),A=8;if(F==="")return 0;let D=/[^0-7]/u;if(A===10)D=/[^0-9]/u;if(A===16)D=/[^0-9A-Fa-f]/u;if(D.test(F))return E1;return parseInt(F,A)}function p61(F){let A=F.split(".");if(A[A.length-1]===""){if(A.length>1)A.pop()}if(A.length>4)return E1;let D=[];for(let X of A){let $=FI(X);if($===E1)return E1;D.push($)}for(let X=0;X<D.length-1;++X)if(D[X]>255)return E1;if(D[D.length-1]>=256**(5-D.length))return E1;let Z=D.pop(),J=0;for(let X of D)Z+=X*256**(3-J),++J;return Z}function i61(F){let A="",D=F;for(let Z=1;Z<=4;++Z){if(A=String(D%256)+A,Z!==4)A=`.${A}`;D=Math.floor(D/256)}return A}function a61(F){let A=[0,0,0,0,0,0,0,0],D=0,Z=null,J=0;if(F=Array.from(F,(X)=>X.codePointAt(0)),F[J]===a(":")){if(F[J+1]!==a(":"))return E1;J+=2,++D,Z=D}while(J<F.length){if(D===8)return E1;if(F[J]===a(":")){if(Z!==null)return E1;++J,++D,Z=D;continue}let X=0,$=0;while($<4&&n0.isASCIIHex(F[J]))X=X*16+parseInt(iP(F,J),16),++J,++$;if(F[J]===a(".")){if($===0)return E1;if(J-=$,D>6)return E1;let G=0;while(F[J]!==void 0){let Y=null;if(G>0)if(F[J]===a(".")&&G<4)++J;else return E1;if(!n0.isASCIIDigit(F[J]))return E1;while(n0.isASCIIDigit(F[J])){let B=parseInt(iP(F,J));if(Y===null)Y=B;else if(Y===0)return E1;else Y=Y*10+B;if(Y>255)return E1;++J}if(A[D]=A[D]*256+Y,++G,G===2||G===4)++D}if(G!==4)return E1;break}else if(F[J]===a(":")){if(++J,F[J]===void 0)return E1}else if(F[J]!==void 0)return E1;A[D]=X,++D}if(Z!==null){let X=D-Z;D=7;while(D!==0&&X>0){let $=A[Z+X-1];A[Z+X-1]=A[D],A[D]=$,--D,--X}}else if(Z===null&&D!==8)return E1;return A}function n61(F){let A="",D=t61(F),Z=!1;for(let J=0;J<=7;++J){if(Z&&F[J]===0)continue;else if(Z)Z=!1;if(D===J){A+=J===0?"::":":",Z=!0;continue}if(A+=F[J].toString(16),J!==7)A+=":"}return A}function kG(F,A=!1){if(F[0]==="["){if(F[F.length-1]!=="]")return E1;return a61(F.substring(1,F.length-1))}if(A)return r61(F);let D=g61(f61(F)),Z=o61(D);if(Z===E1)return E1;if(l61(Z))return E1;if(s61(Z))return p61(Z);return Z}function s61(F){let A=F.split(".");if(A[A.length-1]===""){if(A.length===1)return!1;A.pop()}let D=A[A.length-1];if(FI(D)!==E1)return!0;if(/^[0-9]+$/u.test(D))return!0;return!1}function r61(F){if(oP(F))return E1;return xD(F,sP)}function t61(F){let A=null,D=1,Z=null,J=0;for(let X=0;X<F.length;++X)if(F[X]!==0){if(J>D)A=Z,D=J;Z=null,J=0}else{if(Z===null)Z=X;++J}if(J>D)return Z;return A}function SG(F){if(typeof F==="number")return i61(F);if(F instanceof Array)return`[${n61(F)}]`;return F}function o61(F,A=!1){let D=x61.toASCII(F,{checkBidi:!0,checkHyphens:!1,checkJoiners:!0,useSTD3ASCIIRules:A,verifyDNSLength:A});if(D===null||D==="")return E1;return D}function e61(F){return F.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug,"")}function F31(F){return F.replace(/\u0009|\u000A|\u000D/ug,"")}function AI(F){let{path:A}=F;if(A.length===0)return;if(F.scheme==="file"&&A.length===1&&D31(A[0]))return;A.pop()}function DI(F){return F.username!==""||F.password!==""}function A31(F){return F.host===null||F.host===""||F.scheme==="file"}function f5(F){return typeof F.path==="string"}function D31(F){return/^[A-Za-z]:$/u.test(F)}function U0(F,A,D,Z,J){if(this.pointer=0,this.input=F,this.base=A||null,this.encodingOverride=D||"utf-8",this.stateOverride=J,this.url=Z,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};let $=e61(this.input);if($!==this.input)this.parseError=!0;this.input=$}let X=F31(this.input);if(X!==this.input)this.parseError=!0;this.input=X,this.state=J||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=Array.from(this.input,($)=>$.codePointAt(0));for(;this.pointer<=this.input.length;++this.pointer){let $=this.input[this.pointer],G=isNaN($)?void 0:String.fromCodePoint($),Y=this[`parse ${this.state}`]($,G);if(!Y)break;else if(Y===E1){this.failure=!0;break}}}U0.prototype["parse scheme start"]=function F(A,D){if(n0.isASCIIAlpha(A))this.buffer+=D.toLowerCase(),this.state="scheme";else if(!this.stateOverride)this.state="no scheme",--this.pointer;else return this.parseError=!0,E1;return!0};U0.prototype["parse scheme"]=function F(A,D){if(n0.isASCIIAlphanumeric(A)||A===a("+")||A===a("-")||A===a("."))this.buffer+=D.toLowerCase();else if(A===a(":")){if(this.stateOverride){if(a0(this.url)&&!_D(this.buffer))return!1;if(!a0(this.url)&&_D(this.buffer))return!1;if((DI(this.url)||this.url.port!==null)&&this.buffer==="file")return!1;if(this.url.scheme==="file"&&this.url.host==="")return!1}if(this.url.scheme=this.buffer,this.stateOverride){if(this.url.port===eP(this.url.scheme))this.url.port=null;return!1}if(this.buffer="",this.url.scheme==="file"){if(this.input[this.pointer+1]!==a("/")||this.input[this.pointer+2]!==a("/"))this.parseError=!0;this.state="file"}else if(a0(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme)this.state="special relative or authority";else if(a0(this.url))this.state="special authority slashes";else if(this.input[this.pointer+1]===a("/"))this.state="path or authority",++this.pointer;else this.url.path="",this.state="opaque path"}else if(!this.stateOverride)this.buffer="",this.state="no scheme",this.pointer=-1;else return this.parseError=!0,E1;return!0};U0.prototype["parse no scheme"]=function F(A){if(this.base===null||f5(this.base)&&A!==a("#"))return E1;else if(f5(this.base)&&A===a("#"))this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment";else if(this.base.scheme==="file")this.state="file",--this.pointer;else this.state="relative",--this.pointer;return!0};U0.prototype["parse special relative or authority"]=function F(A){if(A===a("/")&&this.input[this.pointer+1]===a("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="relative",--this.pointer;return!0};U0.prototype["parse path or authority"]=function F(A){if(A===a("/"))this.state="authority";else this.state="path",--this.pointer;return!0};U0.prototype["parse relative"]=function F(A){if(this.url.scheme=this.base.scheme,A===a("/"))this.state="relative slash";else if(a0(this.url)&&A===a("\\"))this.parseError=!0,this.state="relative slash";else if(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,A===a("?"))this.url.query="",this.state="query";else if(A===a("#"))this.url.fragment="",this.state="fragment";else if(!isNaN(A))this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer;return!0};U0.prototype["parse relative slash"]=function F(A){if(a0(this.url)&&(A===a("/")||A===a("\\"))){if(A===a("\\"))this.parseError=!0;this.state="special authority ignore slashes"}else if(A===a("/"))this.state="authority";else this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer;return!0};U0.prototype["parse special authority slashes"]=function F(A){if(A===a("/")&&this.input[this.pointer+1]===a("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="special authority ignore slashes",--this.pointer;return!0};U0.prototype["parse special authority ignore slashes"]=function F(A){if(A!==a("/")&&A!==a("\\"))this.state="authority",--this.pointer;else this.parseError=!0;return!0};U0.prototype["parse authority"]=function F(A,D){if(A===a("@")){if(this.parseError=!0,this.atFlag)this.buffer=`%40${this.buffer}`;this.atFlag=!0;let Z=pP(this.buffer);for(let J=0;J<Z;++J){let X=this.buffer.codePointAt(J);if(X===a(":")&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}let $=uD(X,OG);if(this.passwordTokenSeenFlag)this.url.password+=$;else this.url.username+=$}this.buffer=""}else if(isNaN(A)||A===a("/")||A===a("?")||A===a("#")||a0(this.url)&&A===a("\\")){if(this.atFlag&&this.buffer==="")return this.parseError=!0,E1;this.pointer-=pP(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=D;return!0};U0.prototype["parse hostname"]=U0.prototype["parse host"]=function F(A,D){if(this.stateOverride&&this.url.scheme==="file")--this.pointer,this.state="file host";else if(A===a(":")&&!this.arrFlag){if(this.buffer==="")return this.parseError=!0,E1;if(this.stateOverride==="hostname")return!1;let Z=kG(this.buffer,TG(this.url));if(Z===E1)return E1;this.url.host=Z,this.buffer="",this.state="port"}else if(isNaN(A)||A===a("/")||A===a("?")||A===a("#")||a0(this.url)&&A===a("\\")){if(--this.pointer,a0(this.url)&&this.buffer==="")return this.parseError=!0,E1;else if(this.stateOverride&&this.buffer===""&&(DI(this.url)||this.url.port!==null))return this.parseError=!0,!1;let Z=kG(this.buffer,TG(this.url));if(Z===E1)return E1;if(this.url.host=Z,this.buffer="",this.state="path start",this.stateOverride)return!1}else{if(A===a("["))this.arrFlag=!0;else if(A===a("]"))this.arrFlag=!1;this.buffer+=D}return!0};U0.prototype["parse port"]=function F(A,D){if(n0.isASCIIDigit(A))this.buffer+=D;else if(isNaN(A)||A===a("/")||A===a("?")||A===a("#")||a0(this.url)&&A===a("\\")||this.stateOverride){if(this.buffer!==""){let Z=parseInt(this.buffer);if(Z>65535)return this.parseError=!0,E1;this.url.port=Z===eP(this.url.scheme)?null:Z,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}else return this.parseError=!0,E1;return!0};var Z31=new Set([a("/"),a("\\"),a("?"),a("#")]);function ZI(F,A){let D=F.length-A;return D>=2&&d61(F[A],F[A+1])&&(D===2||Z31.has(F[A+2]))}U0.prototype["parse file"]=function F(A){if(this.url.scheme="file",this.url.host="",A===a("/")||A===a("\\")){if(A===a("\\"))this.parseError=!0;this.state="file slash"}else if(this.base!==null&&this.base.scheme==="file"){if(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,A===a("?"))this.url.query="",this.state="query";else if(A===a("#"))this.url.fragment="",this.state="fragment";else if(!isNaN(A)){if(this.url.query=null,!ZI(this.input,this.pointer))AI(this.url);else this.parseError=!0,this.url.path=[];this.state="path",--this.pointer}}else this.state="path",--this.pointer;return!0};U0.prototype["parse file slash"]=function F(A){if(A===a("/")||A===a("\\")){if(A===a("\\"))this.parseError=!0;this.state="file host"}else{if(this.base!==null&&this.base.scheme==="file"){if(!ZI(this.input,this.pointer)&&c61(this.base.path[0]))this.url.path.push(this.base.path[0]);this.url.host=this.base.host}this.state="path",--this.pointer}return!0};U0.prototype["parse file host"]=function F(A,D){if(isNaN(A)||A===a("/")||A===a("\\")||A===a("?")||A===a("#"))if(--this.pointer,!this.stateOverride&&tP(this.buffer))this.parseError=!0,this.state="path";else if(this.buffer===""){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let Z=kG(this.buffer,TG(this.url));if(Z===E1)return E1;if(Z==="localhost")Z="";if(this.url.host=Z,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=D;return!0};U0.prototype["parse path start"]=function F(A){if(a0(this.url)){if(A===a("\\"))this.parseError=!0;if(this.state="path",A!==a("/")&&A!==a("\\"))--this.pointer}else if(!this.stateOverride&&A===a("?"))this.url.query="",this.state="query";else if(!this.stateOverride&&A===a("#"))this.url.fragment="",this.state="fragment";else if(A!==void 0){if(this.state="path",A!==a("/"))--this.pointer}else if(this.stateOverride&&this.url.host===null)this.url.path.push("");return!0};U0.prototype["parse path"]=function F(A){if(isNaN(A)||A===a("/")||a0(this.url)&&A===a("\\")||!this.stateOverride&&(A===a("?")||A===a("#"))){if(a0(this.url)&&A===a("\\"))this.parseError=!0;if(m61(this.buffer)){if(AI(this.url),A!==a("/")&&!(a0(this.url)&&A===a("\\")))this.url.path.push("")}else if(aP(this.buffer)&&A!==a("/")&&!(a0(this.url)&&A===a("\\")))this.url.path.push("");else if(!aP(this.buffer)){if(this.url.scheme==="file"&&this.url.path.length===0&&tP(this.buffer))this.buffer=`${this.buffer[0]}:`;this.url.path.push(this.buffer)}if(this.buffer="",A===a("?"))this.url.query="",this.state="query";if(A===a("#"))this.url.fragment="",this.state="fragment"}else{if(A===a("%")&&(!n0.isASCIIHex(this.input[this.pointer+1])||!n0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=uD(A,v61)}return!0};U0.prototype["parse opaque path"]=function F(A){if(A===a("?"))this.url.query="",this.state="query";else if(A===a("#"))this.url.fragment="",this.state="fragment";else{if(!isNaN(A)&&A!==a("%"))this.parseError=!0;if(A===a("%")&&(!n0.isASCIIHex(this.input[this.pointer+1])||!n0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;if(!isNaN(A))this.url.path+=uD(A,sP)}return!0};U0.prototype["parse query"]=function F(A,D){if(!a0(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss")this.encodingOverride="utf-8";if(!this.stateOverride&&A===a("#")||isNaN(A)){let Z=a0(this.url)?h61:b61;if(this.url.query+=xD(this.buffer,Z),this.buffer="",A===a("#"))this.url.fragment="",this.state="fragment"}else if(!isNaN(A)){if(A===a("%")&&(!n0.isASCIIHex(this.input[this.pointer+1])||!n0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=D}return!0};U0.prototype["parse fragment"]=function F(A){if(!isNaN(A)){if(A===a("%")&&(!n0.isASCIIHex(this.input[this.pointer+1])||!n0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.url.fragment+=uD(A,y61)}return!0};function J31(F,A){let D=`${F.scheme}:`;if(F.host!==null){if(D+="//",F.username!==""||F.password!==""){if(D+=F.username,F.password!=="")D+=`:${F.password}`;D+="@"}if(D+=SG(F.host),F.port!==null)D+=`:${F.port}`}if(F.host===null&&!f5(F)&&F.path.length>1&&F.path[0]==="")D+="/.";if(D+=_G(F),F.query!==null)D+=`?${F.query}`;if(!A&&F.fragment!==null)D+=`#${F.fragment}`;return D}function X31(F){let A=`${F.scheme}://`;if(A+=SG(F.host),F.port!==null)A+=`:${F.port}`;return A}function _G(F){if(f5(F))return F.path;let A="";for(let D of F.path)A+=`/${D}`;return A}$31.serializeURL=J31;$31.serializePath=_G;$31.serializeURLOrigin=function(F){switch(F.scheme){case"blob":{let A=$31.parseURL(_G(F));if(A===null)return"null";if(A.scheme!=="http"&&A.scheme!=="https")return"null";return $31.serializeURLOrigin(A)}case"ftp":case"http":case"https":case"ws":case"wss":return X31({scheme:F.scheme,host:F.host,port:F.port});case"file":return"null";default:return"null"}};$31.basicURLParse=function(F,A){if(A===void 0)A={};let D=new U0(F,A.baseURL,A.encodingOverride,A.url,A.stateOverride);if(D.failure)return null;return D.url};$31.setTheUsername=function(F,A){F.username=xD(A,OG)};$31.setThePassword=function(F,A){F.password=xD(A,OG)};$31.serializeHost=SG;$31.cannotHaveAUsernamePasswordPort=A31;$31.hasAnOpaquePath=f5;$31.serializeInteger=function(F){return String(F)};$31.parseURL=function(F,A){if(A===void 0)A={};return $31.basicURLParse(F,{baseURL:A.baseURL,encodingOverride:A.encodingOverride})}});var xG=E((gw1,qI)=>{var{utf8Encode:E31,utf8DecodeWithoutBOM:XI}=OD(),{percentDecodeBytes:$I,utf8PercentEncodeString:YI,isURLEncodedPercentEncode:GI}=SD();function BI(F){return F.codePointAt(0)}function U31(F){let A=L31(F,BI("&")),D=[];for(let Z of A){if(Z.length===0)continue;let J,X,$=Z.indexOf(BI("="));if($>=0)J=Z.slice(0,$),X=Z.slice($+1);else J=Z,X=new Uint8Array(0);J=HI(J,43,32),X=HI(X,43,32);let G=XI($I(J)),Y=XI($I(X));D.push([G,Y])}return D}function z31(F){return U31(E31(F))}function V31(F,A=void 0){let D="utf-8";if(A!==void 0)D=A;let Z="";for(let[J,X]of F.entries()){let $=YI(X[0],GI,!0),G=X[1];if(X.length>2&&X[2]!==void 0){if(X[2]==="hidden"&&$==="_charset_")G=D;else if(X[2]==="file")G=G.name}if(G=YI(G,GI,!0),J!==0)Z+="&";Z+=`${$}=${G}`}return Z}function L31(F,A){let D=[],Z=0,J=F.indexOf(A);while(J>=0)D.push(F.slice(Z,J)),Z=J+1,J=F.indexOf(A,Z);if(Z!==F.length)D.push(F.slice(Z));return D}function HI(F,A,D){let Z=F.indexOf(A);while(Z>=0)F[Z]=D,Z=F.indexOf(A,Z+1);return F}qI.exports={parseUrlencodedString:z31,serializeUrlencoded:V31}});var CI=E((R31)=>{var WI=jD(),gD=kD();R31.convert=(F,A,{context:D="The provided value"}={})=>{if(typeof A!=="function")throw new F.TypeError(D+" is not a function");function Z(...J){let X=gD.tryWrapperForImpl(this),$;for(let G=0;G<J.length;G++)J[G]=gD.tryWrapperForImpl(J[G]);return $=Reflect.apply(A,X,J),$=WI.any($,{context:D,globals:F}),$}return Z.construct=(...J)=>{for(let $=0;$<J.length;$++)J[$]=gD.tryWrapperForImpl(J[$]);let X=Reflect.construct(A,J);return X=WI.any(X,{context:D,globals:F}),X},Z[gD.wrapperSymbol]=A,Z.objectReference=A,Z}});var QI=E((P31)=>{var gG=xG();P31.implementation=class F{constructor(A,D,{doNotStripQMark:Z=!1}){let J=D[0];if(this._list=[],this._url=null,!Z&&typeof J==="string"&&J[0]==="?")J=J.slice(1);if(Array.isArray(J))for(let X of J){if(X.length!==2)throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");this._list.push([X[0],X[1]])}else if(typeof J==="object"&&Object.getPrototypeOf(J)===null)for(let X of Object.keys(J)){let $=J[X];this._list.push([X,$])}else this._list=gG.parseUrlencodedString(J)}_updateSteps(){if(this._url!==null){let A=gG.serializeUrlencoded(this._list);if(A==="")A=null;if(this._url._url.query=A,A===null)this._url._potentiallyStripTrailingSpacesFromAnOpaquePath()}}get size(){return this._list.length}append(A,D){this._list.push([A,D]),this._updateSteps()}delete(A,D){let Z=0;while(Z<this._list.length)if(this._list[Z][0]===A&&(D===void 0||this._list[Z][1]===D))this._list.splice(Z,1);else Z++;this._updateSteps()}get(A){for(let D of this._list)if(D[0]===A)return D[1];return null}getAll(A){let D=[];for(let Z of this._list)if(Z[0]===A)D.push(Z[1]);return D}has(A,D){for(let Z of this._list)if(Z[0]===A&&(D===void 0||Z[1]===D))return!0;return!1}set(A,D){let Z=!1,J=0;while(J<this._list.length)if(this._list[J][0]===A)if(Z)this._list.splice(J,1);else Z=!0,this._list[J][1]=D,J++;else J++;if(!Z)this._list.push([A,D]);this._updateSteps()}sort(){this._list.sort((A,D)=>{if(A[0]<D[0])return-1;if(A[0]>D[0])return 1;return 0}),this._updateSteps()}[Symbol.iterator](){return this._list[Symbol.iterator]()}toString(){return gG.serializeUrlencoded(this._list)}}});var yG=E((j31)=>{var m2=jD(),a1=kD(),M31=CI(),KI=a1.newObjectInRealm,j0=a1.implSymbol,EI=a1.ctorRegistrySymbol;j31.is=(F)=>{return a1.isObject(F)&&a1.hasOwn(F,j0)&&F[j0]instanceof k4.implementation};j31.isImpl=(F)=>{return a1.isObject(F)&&F instanceof k4.implementation};j31.convert=(F,A,{context:D="The provided value"}={})=>{if(j31.is(A))return a1.implForWrapper(A);throw new F.TypeError(`${D} is not of type 'URLSearchParams'.`)};j31.createDefaultIterator=(F,A,D)=>{let J=F[EI]["URLSearchParams Iterator"],X=Object.create(J);return Object.defineProperty(X,a1.iterInternalSymbol,{value:{target:A,kind:D,index:0},configurable:!0}),X};function UI(F,A){let D;if(A!==void 0)D=A.prototype;if(!a1.isObject(D))D=F[EI].URLSearchParams.prototype;return Object.create(D)}j31.create=(F,A,D)=>{let Z=UI(F);return j31.setup(Z,F,A,D)};j31.createImpl=(F,A,D)=>{let Z=j31.create(F,A,D);return a1.implForWrapper(Z)};j31._internalSetup=(F,A)=>{};j31.setup=(F,A,D=[],Z={})=>{if(Z.wrapper=F,j31._internalSetup(F,A),Object.defineProperty(F,j0,{value:new k4.implementation(A,D,Z),configurable:!0}),F[j0][a1.wrapperSymbol]=F,k4.init)k4.init(F[j0]);return F};j31.new=(F,A)=>{let D=UI(F,A);if(j31._internalSetup(D,F),Object.defineProperty(D,j0,{value:Object.create(k4.implementation.prototype),configurable:!0}),D[j0][a1.wrapperSymbol]=D,k4.init)k4.init(D[j0]);return D[j0]};var N31=new Set(["Window","Worker"]);j31.install=(F,A)=>{if(!A.some((J)=>N31.has(J)))return;let D=a1.initCtorRegistry(F);class Z{constructor(){let J=[];{let X=arguments[0];if(X!==void 0)if(a1.isObject(X))if(X[Symbol.iterator]!==void 0)if(!a1.isObject(X))throw new F.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");else{let $=[],G=X;for(let Y of G){if(!a1.isObject(Y))throw new F.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");else{let B=[],H=Y;for(let q of H)q=m2.USVString(q,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:F}),B.push(q);Y=B}$.push(Y)}X=$}else if(!a1.isObject(X))throw new F.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");else{let $=Object.create(null);for(let G of Reflect.ownKeys(X)){let Y=Object.getOwnPropertyDescriptor(X,G);if(Y&&Y.enumerable){let B=G;B=m2.USVString(B,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:F});let H=X[G];H=m2.USVString(H,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:F}),$[B]=H}}X=$}else X=m2.USVString(X,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:F});else X="";J.push(X)}return j31.setup(Object.create(new.target.prototype),F,J)}append(J,X){let $=this!==null&&this!==void 0?this:F;if(!j31.is($))throw new F.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new F.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);let G=[];{let Y=arguments[0];Y=m2.USVString(Y,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:F}),G.push(Y)}{let Y=arguments[1];Y=m2.USVString(Y,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:F}),G.push(Y)}return a1.tryWrapperForImpl($[j0].append(...G))}delete(J){let X=this!==null&&this!==void 0?this:F;if(!j31.is(X))throw new F.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new F.TypeError(`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let $=[];{let G=arguments[0];G=m2.USVString(G,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:F}),$.push(G)}{let G=arguments[1];if(G!==void 0)G=m2.USVString(G,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:F});$.push(G)}return a1.tryWrapperForImpl(X[j0].delete(...$))}get(J){let X=this!==null&&this!==void 0?this:F;if(!j31.is(X))throw new F.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new F.TypeError(`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let $=[];{let G=arguments[0];G=m2.USVString(G,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:F}),$.push(G)}return X[j0].get(...$)}getAll(J){let X=this!==null&&this!==void 0?this:F;if(!j31.is(X))throw new F.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new F.TypeError(`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let $=[];{let G=arguments[0];G=m2.USVString(G,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:F}),$.push(G)}return a1.tryWrapperForImpl(X[j0].getAll(...$))}has(J){let X=this!==null&&this!==void 0?this:F;if(!j31.is(X))throw new F.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new F.TypeError(`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let $=[];{let G=arguments[0];G=m2.USVString(G,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:F}),$.push(G)}{let G=arguments[1];if(G!==void 0)G=m2.USVString(G,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:F});$.push(G)}return X[j0].has(...$)}set(J,X){let $=this!==null&&this!==void 0?this:F;if(!j31.is($))throw new F.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new F.TypeError(`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);let G=[];{let Y=arguments[0];Y=m2.USVString(Y,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:F}),G.push(Y)}{let Y=arguments[1];Y=m2.USVString(Y,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:F}),G.push(Y)}return a1.tryWrapperForImpl($[j0].set(...G))}sort(){let J=this!==null&&this!==void 0?this:F;if(!j31.is(J))throw new F.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return a1.tryWrapperForImpl(J[j0].sort())}toString(){let J=this!==null&&this!==void 0?this:F;if(!j31.is(J))throw new F.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return J[j0].toString()}keys(){if(!j31.is(this))throw new F.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return j31.createDefaultIterator(F,this,"key")}values(){if(!j31.is(this))throw new F.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return j31.createDefaultIterator(F,this,"value")}entries(){if(!j31.is(this))throw new F.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return j31.createDefaultIterator(F,this,"key+value")}forEach(J){if(!j31.is(this))throw new F.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new F.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");J=M31.convert(F,J,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});let X=arguments[1],$=Array.from(this[j0]),G=0;while(G<$.length){let[Y,B]=$[G].map(a1.tryWrapperForImpl);J.call(X,B,Y,this),$=Array.from(this[j0]),G++}}get size(){let J=this!==null&&this!==void 0?this:F;if(!j31.is(J))throw new F.TypeError("'get size' called on an object that is not a valid instance of URLSearchParams.");return J[j0].size}}Object.defineProperties(Z.prototype,{append:{enumerable:!0},delete:{enumerable:!0},get:{enumerable:!0},getAll:{enumerable:!0},has:{enumerable:!0},set:{enumerable:!0},sort:{enumerable:!0},toString:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0},forEach:{enumerable:!0},size:{enumerable:!0},[Symbol.toStringTag]:{value:"URLSearchParams",configurable:!0},[Symbol.iterator]:{value:Z.prototype.entries,configurable:!0,writable:!0}}),D.URLSearchParams=Z,D["URLSearchParams Iterator"]=Object.create(D["%IteratorPrototype%"],{[Symbol.toStringTag]:{configurable:!0,value:"URLSearchParams Iterator"}}),a1.define(D["URLSearchParams Iterator"],{next(){let J=this&&this[a1.iterInternalSymbol];if(!J)throw new F.TypeError("next() called on a value that is not a URLSearchParams iterator object");let{target:X,kind:$,index:G}=J,Y=Array.from(X[j0]),B=Y.length;if(G>=B)return KI(F,{value:void 0,done:!0});let H=Y[G];return J.index=G+1,KI(F,a1.iteratorResult(H.map(a1.tryWrapperForImpl),$))}}),Object.defineProperty(F,"URLSearchParams",{configurable:!0,writable:!0,value:Z})};var k4=QI()});var RI=E((x31)=>{var m1=uG(),LI=xG(),u31=yG();x31.implementation=class F{constructor(A,D){let Z=D[0],J=D[1],X=null;if(J!==void 0){if(X=m1.basicURLParse(J),X===null)throw new TypeError(`Invalid base URL: ${J}`)}let $=m1.basicURLParse(Z,{baseURL:X});if($===null)throw new TypeError(`Invalid URL: ${Z}`);let G=$.query!==null?$.query:"";this._url=$,this._query=u31.createImpl(A,[G],{doNotStripQMark:!0}),this._query._url=this}static canParse(A,D){let Z=null;if(D!==void 0){if(Z=m1.basicURLParse(D),Z===null)return!1}if(m1.basicURLParse(A,{baseURL:Z})===null)return!1;return!0}get href(){return m1.serializeURL(this._url)}set href(A){let D=m1.basicURLParse(A);if(D===null)throw new TypeError(`Invalid URL: ${A}`);this._url=D,this._query._list.splice(0);let{query:Z}=D;if(Z!==null)this._query._list=LI.parseUrlencodedString(Z)}get origin(){return m1.serializeURLOrigin(this._url)}get protocol(){return`${this._url.scheme}:`}set protocol(A){m1.basicURLParse(`${A}:`,{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(A){if(m1.cannotHaveAUsernamePasswordPort(this._url))return;m1.setTheUsername(this._url,A)}get password(){return this._url.password}set password(A){if(m1.cannotHaveAUsernamePasswordPort(this._url))return;m1.setThePassword(this._url,A)}get host(){let A=this._url;if(A.host===null)return"";if(A.port===null)return m1.serializeHost(A.host);return`${m1.serializeHost(A.host)}:${m1.serializeInteger(A.port)}`}set host(A){if(m1.hasAnOpaquePath(this._url))return;m1.basicURLParse(A,{url:this._url,stateOverride:"host"})}get hostname(){if(this._url.host===null)return"";return m1.serializeHost(this._url.host)}set hostname(A){if(m1.hasAnOpaquePath(this._url))return;m1.basicURLParse(A,{url:this._url,stateOverride:"hostname"})}get port(){if(this._url.port===null)return"";return m1.serializeInteger(this._url.port)}set port(A){if(m1.cannotHaveAUsernamePasswordPort(this._url))return;if(A==="")this._url.port=null;else m1.basicURLParse(A,{url:this._url,stateOverride:"port"})}get pathname(){return m1.serializePath(this._url)}set pathname(A){if(m1.hasAnOpaquePath(this._url))return;this._url.path=[],m1.basicURLParse(A,{url:this._url,stateOverride:"path start"})}get search(){if(this._url.query===null||this._url.query==="")return"";return`?${this._url.query}`}set search(A){let D=this._url;if(A===""){D.query=null,this._query._list=[],this._potentiallyStripTrailingSpacesFromAnOpaquePath();return}let Z=A[0]==="?"?A.substring(1):A;D.query="",m1.basicURLParse(Z,{url:D,stateOverride:"query"}),this._query._list=LI.parseUrlencodedString(Z)}get searchParams(){return this._query}get hash(){if(this._url.fragment===null||this._url.fragment==="")return"";return`#${this._url.fragment}`}set hash(A){if(A===""){this._url.fragment=null,this._potentiallyStripTrailingSpacesFromAnOpaquePath();return}let D=A[0]==="#"?A.substring(1):A;this._url.fragment="",m1.basicURLParse(D,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}_potentiallyStripTrailingSpacesFromAnOpaquePath(){if(!m1.hasAnOpaquePath(this._url))return;if(this._url.fragment!==null)return;if(this._url.query!==null)return;this._url.path=this._url.path.replace(/\u0020+$/u,"")}}});var MI=E((b31)=>{var d2=jD(),q6=kD(),u1=q6.implSymbol,f31=q6.ctorRegistrySymbol;b31.is=(F)=>{return q6.isObject(F)&&q6.hasOwn(F,u1)&&F[u1]instanceof v3.implementation};b31.isImpl=(F)=>{return q6.isObject(F)&&F instanceof v3.implementation};b31.convert=(F,A,{context:D="The provided value"}={})=>{if(b31.is(A))return q6.implForWrapper(A);throw new F.TypeError(`${D} is not of type 'URL'.`)};function wI(F,A){let D;if(A!==void 0)D=A.prototype;if(!q6.isObject(D))D=F[f31].URL.prototype;return Object.create(D)}b31.create=(F,A,D)=>{let Z=wI(F);return b31.setup(Z,F,A,D)};b31.createImpl=(F,A,D)=>{let Z=b31.create(F,A,D);return q6.implForWrapper(Z)};b31._internalSetup=(F,A)=>{};b31.setup=(F,A,D=[],Z={})=>{if(Z.wrapper=F,b31._internalSetup(F,A),Object.defineProperty(F,u1,{value:new v3.implementation(A,D,Z),configurable:!0}),F[u1][q6.wrapperSymbol]=F,v3.init)v3.init(F[u1]);return F};b31.new=(F,A)=>{let D=wI(F,A);if(b31._internalSetup(D,F),Object.defineProperty(D,u1,{value:Object.create(v3.implementation.prototype),configurable:!0}),D[u1][q6.wrapperSymbol]=D,v3.init)v3.init(D[u1]);return D[u1]};var y31=new Set(["Window","Worker"]);b31.install=(F,A)=>{if(!A.some((J)=>y31.has(J)))return;let D=q6.initCtorRegistry(F);class Z{constructor(J){if(arguments.length<1)throw new F.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);let X=[];{let $=arguments[0];$=d2.USVString($,{context:"Failed to construct 'URL': parameter 1",globals:F}),X.push($)}{let $=arguments[1];if($!==void 0)$=d2.USVString($,{context:"Failed to construct 'URL': parameter 2",globals:F});X.push($)}return b31.setup(Object.create(new.target.prototype),F,X)}toJSON(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return J[u1].toJSON()}get href(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get href' called on an object that is not a valid instance of URL.");return J[u1].href}set href(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set href' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:F}),X[u1].href=J}toString(){let J=this;if(!b31.is(J))throw new F.TypeError("'toString' called on an object that is not a valid instance of URL.");return J[u1].href}get origin(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get origin' called on an object that is not a valid instance of URL.");return J[u1].origin}get protocol(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return J[u1].protocol}set protocol(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set protocol' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:F}),X[u1].protocol=J}get username(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get username' called on an object that is not a valid instance of URL.");return J[u1].username}set username(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set username' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:F}),X[u1].username=J}get password(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get password' called on an object that is not a valid instance of URL.");return J[u1].password}set password(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set password' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:F}),X[u1].password=J}get host(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get host' called on an object that is not a valid instance of URL.");return J[u1].host}set host(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set host' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:F}),X[u1].host=J}get hostname(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return J[u1].hostname}set hostname(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set hostname' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:F}),X[u1].hostname=J}get port(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get port' called on an object that is not a valid instance of URL.");return J[u1].port}set port(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set port' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:F}),X[u1].port=J}get pathname(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return J[u1].pathname}set pathname(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set pathname' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:F}),X[u1].pathname=J}get search(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get search' called on an object that is not a valid instance of URL.");return J[u1].search}set search(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set search' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:F}),X[u1].search=J}get searchParams(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return q6.getSameObject(this,"searchParams",()=>{return q6.tryWrapperForImpl(J[u1].searchParams)})}get hash(){let J=this!==null&&this!==void 0?this:F;if(!b31.is(J))throw new F.TypeError("'get hash' called on an object that is not a valid instance of URL.");return J[u1].hash}set hash(J){let X=this!==null&&this!==void 0?this:F;if(!b31.is(X))throw new F.TypeError("'set hash' called on an object that is not a valid instance of URL.");J=d2.USVString(J,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:F}),X[u1].hash=J}static canParse(J){if(arguments.length<1)throw new F.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);let X=[];{let $=arguments[0];$=d2.USVString($,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:F}),X.push($)}{let $=arguments[1];if($!==void 0)$=d2.USVString($,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:F});X.push($)}return v3.implementation.canParse(...X)}}if(Object.defineProperties(Z.prototype,{toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0},[Symbol.toStringTag]:{value:"URL",configurable:!0}}),Object.defineProperties(Z,{canParse:{enumerable:!0}}),D.URL=Z,Object.defineProperty(F,"URL",{configurable:!0,writable:!0,value:Z}),A.includes("Window"))Object.defineProperty(F,"webkitURL",{configurable:!0,writable:!0,value:Z})};var v3=RI()});var NI=E((i31)=>{var l31=MI(),p31=yG();i31.URL=l31;i31.URLSearchParams=p31});var TI=E((t31)=>{var{URL:s31,URLSearchParams:r31}=NI(),A3=uG(),jI=SD(),yD={Array,Object,Promise,String,TypeError};s31.install(yD,["Window"]);r31.install(yD,["Window"]);t31.URL=yD.URL;t31.URLSearchParams=yD.URLSearchParams;t31.parseURL=A3.parseURL;t31.basicURLParse=A3.basicURLParse;t31.serializeURL=A3.serializeURL;t31.serializePath=A3.serializePath;t31.serializeHost=A3.serializeHost;t31.serializeInteger=A3.serializeInteger;t31.serializeURLOrigin=A3.serializeURLOrigin;t31.setTheUsername=A3.setTheUsername;t31.setThePassword=A3.setThePassword;t31.cannotHaveAUsernamePasswordPort=A3.cannotHaveAUsernamePasswordPort;t31.hasAnOpaquePath=A3.hasAnOpaquePath;t31.percentDecodeString=jI.percentDecodeString;t31.percentDecodeBytes=jI.percentDecodeBytes});var OI=E((O6)=>{var C41=O6&&O6.__createBinding||(Object.create?function(F,A,D,Z){if(Z===void 0)Z=D;var J=Object.getOwnPropertyDescriptor(A,D);if(!J||("get"in J?!A.__esModule:J.writable||J.configurable))J={enumerable:!0,get:function(){return A[D]}};Object.defineProperty(F,Z,J)}:function(F,A,D,Z){if(Z===void 0)Z=D;F[Z]=A[D]}),Q41=O6&&O6.__setModuleDefault||(Object.create?function(F,A){Object.defineProperty(F,"default",{enumerable:!0,value:A})}:function(F,A){F.default=A}),K41=O6&&O6.__importStar||function(F){if(F&&F.__esModule)return F;var A={};if(F!=null){for(var D in F)if(D!=="default"&&Object.prototype.hasOwnProperty.call(F,D))C41(A,F,D)}return Q41(A,F),A};Object.defineProperty(O6,"__esModule",{value:!0});O6.redactConnectionString=O6.redactValidConnectionString=void 0;var kI=K41(hG());function E41(F,A){var D,Z;let J=F.clone(),X=(D=A===null||A===void 0?void 0:A.replacementString)!==null&&D!==void 0?D:"_credentials_",$=(Z=A===null||A===void 0?void 0:A.redactUsernames)!==null&&Z!==void 0?Z:!0;if((J.username||J.password)&&$)J.username=X,J.password="";else if(J.password)J.password=X;if(J.searchParams.has("authMechanismProperties")){let G=new kI.CommaAndColonSeparatedRecord(J.searchParams.get("authMechanismProperties"));if(G.get("AWS_SESSION_TOKEN"))G.set("AWS_SESSION_TOKEN",X),J.searchParams.set("authMechanismProperties",G.toString())}if(J.searchParams.has("tlsCertificateKeyFilePassword"))J.searchParams.set("tlsCertificateKeyFilePassword",X);if(J.searchParams.has("proxyUsername")&&$)J.searchParams.set("proxyUsername",X);if(J.searchParams.has("proxyPassword"))J.searchParams.set("proxyPassword",X);return J}O6.redactValidConnectionString=E41;function U41(F,A){var D,Z;let J=(D=A===null||A===void 0?void 0:A.replacementString)!==null&&D!==void 0?D:"<credentials>",X=(Z=A===null||A===void 0?void 0:A.redactUsernames)!==null&&Z!==void 0?Z:!0,$;try{$=new kI.default(F)}catch(B){}if($)return A={...A,replacementString:"___credentials___"},$.redact(A).toString().replace(/___credentials___/g,J);let G=J,Y=[(B)=>B.replace(X?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${G}$3`),(B)=>B.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${G}`),(B)=>B.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${G}`),(B)=>X?B.replace(/(proxyUsername=)([^&]+)/gi,`$1${G}`):B,(B)=>B.replace(/(proxyPassword=)([^&]+)/gi,`$1${G}`)];for(let B of Y)F=B(F);return F}O6.redactConnectionString=U41});var hG=E((mG)=>{Object.defineProperty(mG,"__esModule",{value:!0});mG.CommaAndColonSeparatedRecord=mG.ConnectionString=mG.redactConnectionString=void 0;var z41=TI(),SI=OI();Object.defineProperty(mG,"redactConnectionString",{enumerable:!0,get:function(){return SI.redactConnectionString}});var y5="__this_is_a_placeholder__";function V41(F){return F.startsWith("mongodb://")||F.startsWith("mongodb+srv://")}var L41=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class vG extends Map{delete(F){return super.delete(this._normalizeKey(F))}get(F){return super.get(this._normalizeKey(F))}has(F){return super.has(this._normalizeKey(F))}set(F,A){return super.set(this._normalizeKey(F),A)}_normalizeKey(F){F=`${F}`;for(let A of this.keys())if(A.toLowerCase()===F.toLowerCase()){F=A;break}return F}}function R41(F){return class A extends F{append(D,Z){return super.append(this._normalizeKey(D),Z)}delete(D){return super.delete(this._normalizeKey(D))}get(D){return super.get(this._normalizeKey(D))}getAll(D){return super.getAll(this._normalizeKey(D))}has(D){return super.has(this._normalizeKey(D))}set(D,Z){return super.set(this._normalizeKey(D),Z)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(D){return vG.prototype._normalizeKey.call(this,D)}}}class _I extends z41.URL{}class R3 extends Error{get name(){return"MongoParseError"}}class b5 extends _I{constructor(F,A={}){var D;let{looseValidation:Z}=A;if(!Z&&!V41(F))throw new R3('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');let J=F.match(L41);if(!J)throw new R3(`Invalid connection string "${F}"`);let{protocol:X,username:$,password:G,hosts:Y,rest:B}=(D=J.groups)!==null&&D!==void 0?D:{};if(!Z){if(!X||!Y)throw new R3(`Protocol and host list are required in "${F}"`);try{decodeURIComponent($!==null&&$!==void 0?$:""),decodeURIComponent(G!==null&&G!==void 0?G:"")}catch(W){throw new R3(W.message)}let q=/[:/?#[\]@]/gi;if($===null||$===void 0?void 0:$.match(q))throw new R3(`Username contains unescaped characters ${$}`);if(!$||!G){let W=F.replace(`${X}://`,"");if(W.startsWith("@")||W.startsWith(":"))throw new R3("URI contained empty userinfo section")}if(G===null||G===void 0?void 0:G.match(q))throw new R3("Password contains unescaped characters")}let H="";if(typeof $==="string")H+=$;if(typeof G==="string")H+=`:${G}`;if(H)H+="@";try{super(`${X.toLowerCase()}://${H}${y5}${B}`)}catch(q){if(Z)new b5(F,{...A,looseValidation:!1});if(typeof q.message==="string")q.message=q.message.replace(y5,Y);throw q}if(this._hosts=Y.split(","),!Z){if(this.isSRV&&this.hosts.length!==1)throw new R3("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((q)=>q.includes(":")))throw new R3("mongodb+srv URI cannot have port number")}if(!this.pathname)this.pathname="/";Object.setPrototypeOf(this.searchParams,R41(this.searchParams.constructor).prototype)}get host(){return y5}set host(F){throw new Error("No single host for connection string")}get hostname(){return y5}set hostname(F){throw new Error("No single host for connection string")}get port(){return""}set port(F){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(F){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(F){this._hosts=F}toString(){return super.toString().replace(y5,this.hosts.join(","))}clone(){return new b5(this.toString(),{looseValidation:!0})}redact(F){return SI.redactValidConnectionString(this,F)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){let{href:F,origin:A,protocol:D,username:Z,password:J,hosts:X,pathname:$,search:G,searchParams:Y,hash:B}=this;return{href:F,origin:A,protocol:D,username:Z,password:J,hosts:X,pathname:$,search:G,searchParams:Y,hash:B}}}mG.ConnectionString=b5;class uI extends vG{constructor(F){super();for(let A of(F!==null&&F!==void 0?F:"").split(",")){if(!A)continue;let D=A.indexOf(":");if(D===-1)this.set(A,"");else this.set(A.slice(0,D),A.slice(D+1))}}toString(){return[...this].map((F)=>F.join(":")).join(",")}}mG.CommaAndColonSeparatedRecord=uI;mG.default=b5});var gI=E((iw1,I41)=>{I41.exports={name:"mongodb",version:"6.15.0",description:"The official MongoDB driver for Node.js",main:"lib/index.js",files:["lib","src","etc/prepare.js","mongodb.d.ts","tsconfig.json"],types:"mongodb.d.ts",repository:{type:"git",url:"git@github.com:mongodb/node-mongodb-native.git"},keywords:["mongodb","driver","official"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},dependencies:{"@mongodb-js/saslprep":"^1.1.9",bson:"^6.10.3","mongodb-connection-string-url":"^3.0.0"},peerDependencies:{"@aws-sdk/credential-providers":"^3.188.0","@mongodb-js/zstd":"^1.1.0 || ^2.0.0","gcp-metadata":"^5.2.0",kerberos:"^2.0.1","mongodb-client-encryption":">=6.0.0 <7",snappy:"^7.2.2",socks:"^2.7.1"},peerDependenciesMeta:{"@aws-sdk/credential-providers":{optional:!0},"@mongodb-js/zstd":{optional:!0},kerberos:{optional:!0},snappy:{optional:!0},"mongodb-client-encryption":{optional:!0},"gcp-metadata":{optional:!0},socks:{optional:!0}},devDependencies:{"@aws-sdk/credential-providers":"^3.632.0","@iarna/toml":"^2.2.5","@istanbuljs/nyc-config-typescript":"^1.0.2","@microsoft/api-extractor":"^7.49.2","@microsoft/tsdoc-config":"^0.17.1","@mongodb-js/zstd":"^2.0.0","@types/chai":"^4.3.17","@types/chai-subset":"^1.3.5","@types/express":"^4.17.21","@types/kerberos":"^1.1.5","@types/mocha":"^10.0.9","@types/node":"^22.13.0","@types/saslprep":"^1.0.3","@types/semver":"^7.5.8","@types/sinon":"^17.0.3","@types/sinon-chai":"^3.2.12","@types/whatwg-url":"^11.0.5","@typescript-eslint/eslint-plugin":"8.4.0","@typescript-eslint/parser":"8.4.0",chai:"^4.4.1","chai-subset":"^1.6.0",chalk:"^4.1.2",eslint:"9.9.0","eslint-config-prettier":"^9.1.0","eslint-plugin-mocha":"^10.4.1","eslint-plugin-prettier":"^5.2.3","eslint-plugin-simple-import-sort":"^12.1.1","eslint-plugin-tsdoc":"^0.4.0","eslint-plugin-unused-imports":"^4.1.4",express:"^4.21.2","gcp-metadata":"^5.3.0","js-yaml":"^4.1.0",mocha:"^10.8.2","mocha-sinon":"^2.1.2","mongodb-client-encryption":"^6.3.0","mongodb-legacy":"^6.1.3",nyc:"^15.1.0",prettier:"^3.4.2",semver:"^7.7.0",sinon:"^18.0.0","sinon-chai":"^3.7.0",snappy:"^7.2.2",socks:"^2.8.1","source-map-support":"^0.5.21","ts-node":"^10.9.2",tsd:"^0.31.2",typescript:"5.5","typescript-cached-transpile":"^0.0.6","v8-heapsnapshot":"^1.3.1",yargs:"^17.7.2"},license:"Apache-2.0",engines:{node:">=16.20.1"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},homepage:"https://github.com/mongodb/node-mongodb-native",scripts:{"build:evergreen":"node .evergreen/generate_evergreen_tasks.js","build:ts":"node ./node_modules/typescript/bin/tsc","build:dts":"npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts lib/beta.d.ts","build:docs":"./etc/docs/build.ts","build:typedoc":"typedoc","build:nightly":"node ./.github/scripts/nightly.mjs","check:bench":"npm --prefix test/benchmarks/driver_bench start","check:coverage":"nyc npm run test:all","check:integration-coverage":"nyc npm run check:test","check:lambda":"mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js","check:lambda:aws":"mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js","check:lint":"npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd","check:eslint":"npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test","check:tsd":"tsd --version && tsd","check:dependencies":"mocha test/action/dependency.test.ts","check:dts":"node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd","check:search-indexes":"nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts","check:test":"mocha --config test/mocha_mongodb.js test/integration","check:unit":"mocha test/unit","check:ts":"node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit","check:atlas":"mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts","check:resource-management":"mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts","check:drivers-atlas-testing":"mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts","check:adl":"mocha --config test/mocha_mongodb.js test/manual/atlas-data-lake-testing","check:aws":"nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts","check:oidc-auth":"mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts","check:oidc-test":"mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts","check:oidc-azure":"mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_azure.prose.05.test.ts","check:oidc-gcp":"mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts","check:oidc-k8s":"mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts","check:kerberos":"nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts","check:tls":"mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts","check:ldap":"nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts","check:socks5":"mocha --config test/manual/mocharc.js test/manual/socks5.test.ts","check:csfle":"mocha --config test/mocha_mongodb.js test/integration/client-side-encryption","check:snappy":"mocha test/unit/assorted/snappy.test.js","check:x509":"mocha test/manual/x509_auth.test.ts","fix:eslint":"npm run check:eslint -- --fix",prepare:"node etc/prepare.js","preview:docs":"ts-node etc/docs/preview.ts",test:"npm run check:lint && npm run test:all","test:all":"npm run check:unit && npm run check:test","update:docs":"npm run build:docs -- --yes"},tsd:{directory:"test/types",compilerOptions:{strict:!0,target:"esnext",module:"commonjs",moduleResolution:"node"}}}});var dG=E((vI)=>{Object.defineProperty(vI,"__esModule",{value:!0});vI.LimitedSizeDocument=void 0;vI.makeClientMetadata=N41;vI.addContainerMetadata=T41;vI.getFAASEnv=hI;var h5=i("node:os"),v5=i("node:process"),y7=k1(),fI=n(),M41=e(),yI=gI().version;class bD{constructor(F){this.maxSize=F,this.document=new Map,this.documentSize=5}ifItFitsItSits(F,A){let D=y7.BSON.serialize(new Map().set(F,A)).byteLength-5;if(D+this.documentSize>this.maxSize)return!1;return this.documentSize+=D,this.document.set(F,A),!0}toObject(){return y7.BSON.deserialize(y7.BSON.serialize(this.document),{promoteLongs:!1,promoteBuffers:!1,promoteValues:!1,useBigInt64:!1})}}vI.LimitedSizeDocument=bD;function N41(F){let A=new bD(512),{appName:D=""}=F;if(D.length>0){let H=Buffer.byteLength(D,"utf8")<=128?F.appName:Buffer.from(D,"utf8").subarray(0,128).toString("utf8");A.ifItFitsItSits("application",{name:H})}let{name:Z="",version:J="",platform:X=""}=F.driverInfo,$={name:Z.length>0?`nodejs|${Z}`:"nodejs",version:J.length>0?`${yI}|${J}`:yI};if(!A.ifItFitsItSits("driver",$))throw new fI.MongoInvalidArgumentError("Unable to include driverInfo name and version, metadata cannot exceed 512 bytes");let G=k41();if(X.length>0)G=`${G}|${X}`;if(!A.ifItFitsItSits("platform",G))throw new fI.MongoInvalidArgumentError("Unable to include driverInfo platform, metadata cannot exceed 512 bytes");let Y=new Map().set("name",v5.platform).set("architecture",v5.arch).set("version",h5.release()).set("type",h5.type());if(!A.ifItFitsItSits("os",Y))for(let H of Y.keys()){if(Y.delete(H),Y.size===0)break;if(A.ifItFitsItSits("os",Y))break}let B=hI();if(B!=null){if(!A.ifItFitsItSits("env",B))for(let H of B.keys()){if(B.delete(H),B.size===0)break;if(A.ifItFitsItSits("env",B))break}}return A.toObject()}var bI;async function j41(){let F={};bI??=M41.fileIsAccessible("/.dockerenv");let A=await bI,{KUBERNETES_SERVICE_HOST:D=""}=v5.env,Z=D.length>0?!0:!1;if(A)F.runtime="docker";if(Z)F.orchestrator="kubernetes";return F}async function T41(F){let A=await j41();if(Object.keys(A).length===0)return F;let D=new bD(512),Z={...F?.env,container:A};for(let[J,X]of Object.entries(F))if(J!=="env")D.ifItFitsItSits(J,X);else if(!D.ifItFitsItSits("env",Z))D.ifItFitsItSits("env",X);if(!("env"in F))D.ifItFitsItSits("env",Z);return D.toObject()}function hI(){let{AWS_EXECUTION_ENV:F="",AWS_LAMBDA_RUNTIME_API:A="",FUNCTIONS_WORKER_RUNTIME:D="",K_SERVICE:Z="",FUNCTION_NAME:J="",VERCEL:X="",AWS_LAMBDA_FUNCTION_MEMORY_SIZE:$="",AWS_REGION:G="",FUNCTION_MEMORY_MB:Y="",FUNCTION_REGION:B="",FUNCTION_TIMEOUT_SEC:H="",VERCEL_REGION:q=""}=v5.env,W=F.startsWith("AWS_Lambda_")||A.length>0,C=D.length>0,Q=Z.length>0||J.length>0,K=X.length>0,U=new Map;if(K&&!(C||Q)){if(q.length>0)U.set("region",q);return U.set("name","vercel"),U}if(W&&!(C||Q||K)){if(G.length>0)U.set("region",G);if($.length>0&&Number.isInteger(+$))U.set("memory_mb",new y7.Int32($));return U.set("name","aws.lambda"),U}if(C&&!(Q||W||K))return U.set("name","azure.func"),U;if(Q&&!(C||W||K)){if(B.length>0)U.set("region",B);if(Y.length>0&&Number.isInteger(+Y))U.set("memory_mb",new y7.Int32(Y));if(H.length>0&&Number.isInteger(+H))U.set("timeout_sec",new y7.Int32(H));return U.set("name","gcp.func"),U}return null}function k41(){if("Deno"in globalThis)return`Deno v${typeof Deno?.version?.deno==="string"?Deno?.version?.deno:"0.0.0-unknown"}, ${h5.endianness()}`;if("Bun"in globalThis)return`Bun v${typeof Bun?.version==="string"?Bun?.version:"0.0.0-unknown"}, ${h5.endianness()}`;return`Node.js ${v5.version}, ${h5.endianness()}`}});var d5=E((sI)=>{Object.defineProperty(sI,"__esModule",{value:!0});sI.OpCompressedRequest=sI.OpMsgResponse=sI.OpMsgRequest=sI.DocumentSequence=sI.OpReply=sI.OpQueryRequest=void 0;var v7=k1(),m5=n(),cG=c5(),b7=W9(),h7=0,u41=2,x41=4,g41=8,f41=16,y41=32,b41=64,h41=128,v41=1,m41=2,d41=4,c41=8,l41=v7.BSON.onDemand.ByteUtils.encodeUTF8Into;class pG{constructor(F,A,D){this.databaseName=F,this.query=A,this.moreToCome=!1;let Z=`${F}.$cmd`;if(typeof F!=="string")throw new m5.MongoRuntimeError("Database name must be a string for a query");if(A==null)throw new m5.MongoRuntimeError("A query document must be specified for query");if(Z.indexOf("\x00")!==-1)throw new m5.MongoRuntimeError("Namespace cannot contain a null character");this.ns=Z,this.numberToSkip=D.numberToSkip||0,this.numberToReturn=D.numberToReturn||0,this.returnFieldSelector=D.returnFieldSelector||void 0,this.requestId=D.requestId??pG.getRequestId(),this.pre32Limit=D.pre32Limit,this.serializeFunctions=typeof D.serializeFunctions==="boolean"?D.serializeFunctions:!1,this.ignoreUndefined=typeof D.ignoreUndefined==="boolean"?D.ignoreUndefined:!1,this.maxBsonSize=D.maxBsonSize||16777216,this.checkKeys=typeof D.checkKeys==="boolean"?D.checkKeys:!1,this.batchSize=this.numberToReturn,this.tailable=!1,this.secondaryOk=typeof D.secondaryOk==="boolean"?D.secondaryOk:!1,this.oplogReplay=!1,this.noCursorTimeout=!1,this.awaitData=!1,this.exhaust=!1,this.partial=!1}incRequestId(){this.requestId=h7++}nextRequestId(){return h7+1}static getRequestId(){return++h7}toBin(){let F=[],A=null,D=0;if(this.tailable)D|=u41;if(this.secondaryOk)D|=x41;if(this.oplogReplay)D|=g41;if(this.noCursorTimeout)D|=f41;if(this.awaitData)D|=y41;if(this.exhaust)D|=b41;if(this.partial)D|=h41;if(this.batchSize!==this.numberToReturn)this.numberToReturn=this.batchSize;let Z=Buffer.alloc(20+Buffer.byteLength(this.ns)+1+4+4);F.push(Z);let J=v7.serialize(this.query,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined});if(F.push(J),this.returnFieldSelector&&Object.keys(this.returnFieldSelector).length>0)A=v7.serialize(this.returnFieldSelector,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined}),F.push(A);let X=Z.length+J.length+(A?A.length:0),$=4;return Z[3]=X>>24&255,Z[2]=X>>16&255,Z[1]=X>>8&255,Z[0]=X&255,Z[$+3]=this.requestId>>24&255,Z[$+2]=this.requestId>>16&255,Z[$+1]=this.requestId>>8&255,Z[$]=this.requestId&255,$=$+4,Z[$+3]=0,Z[$+2]=0,Z[$+1]=0,Z[$]=0,$=$+4,Z[$+3]=b7.OP_QUERY>>24&255,Z[$+2]=b7.OP_QUERY>>16&255,Z[$+1]=b7.OP_QUERY>>8&255,Z[$]=b7.OP_QUERY&255,$=$+4,Z[$+3]=D>>24&255,Z[$+2]=D>>16&255,Z[$+1]=D>>8&255,Z[$]=D&255,$=$+4,$=$+Z.write(this.ns,$,"utf8")+1,Z[$-1]=0,Z[$+3]=this.numberToSkip>>24&255,Z[$+2]=this.numberToSkip>>16&255,Z[$+1]=this.numberToSkip>>8&255,Z[$]=this.numberToSkip&255,$=$+4,Z[$+3]=this.numberToReturn>>24&255,Z[$+2]=this.numberToReturn>>16&255,Z[$+1]=this.numberToReturn>>8&255,Z[$]=this.numberToReturn&255,$=$+4,F}}sI.OpQueryRequest=pG;class cI{constructor(F,A,D,Z){this.index=0,this.sections=[],this.moreToCome=!1,this.parsed=!1,this.raw=F,this.data=D,this.opts=Z??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=A.length,this.requestId=A.requestId,this.responseTo=A.responseTo,this.opCode=A.opCode,this.fromCompressed=A.fromCompressed,this.useBigInt64=typeof this.opts.useBigInt64==="boolean"?this.opts.useBigInt64:!1,this.promoteLongs=typeof this.opts.promoteLongs==="boolean"?this.opts.promoteLongs:!0,this.promoteValues=typeof this.opts.promoteValues==="boolean"?this.opts.promoteValues:!0,this.promoteBuffers=typeof this.opts.promoteBuffers==="boolean"?this.opts.promoteBuffers:!1,this.bsonRegExp=typeof this.opts.bsonRegExp==="boolean"?this.opts.bsonRegExp:!1}isParsed(){return this.parsed}parse(){if(this.parsed)return this.sections[0];if(this.index=20,this.responseFlags=this.data.readInt32LE(0),this.cursorId=new v7.Long(this.data.readInt32LE(4),this.data.readInt32LE(8)),this.startingFrom=this.data.readInt32LE(12),this.numberReturned=this.data.readInt32LE(16),this.numberReturned<0||this.numberReturned>4294967295)throw new RangeError(`OP_REPLY numberReturned is an invalid array length ${this.numberReturned}`);this.cursorNotFound=(this.responseFlags&v41)!==0,this.queryFailure=(this.responseFlags&m41)!==0,this.shardConfigStale=(this.responseFlags&d41)!==0,this.awaitCapable=(this.responseFlags&c41)!==0;for(let F=0;F<this.numberReturned;F++){let A=this.data[this.index]|this.data[this.index+1]<<8|this.data[this.index+2]<<16|this.data[this.index+3]<<24,D=this.data.subarray(this.index,this.index+A);this.sections.push(D),this.index=this.index+A}return this.parsed=!0,this.sections[0]}}sI.OpReply=cI;var lI=1,pI=2,iI=65536;class iG{constructor(F,A){this.field=F,this.documents=[],this.chunks=[],this.serializedDocumentsLength=0;let D=Buffer.allocUnsafe(5+this.field.length+1);if(D[0]=1,l41(D,`${this.field}\x00`,5),this.chunks.push(D),this.header=D,A)for(let Z of A)this.push(Z,v7.serialize(Z))}push(F,A){return this.serializedDocumentsLength+=A.length,this.documents.push(F),this.chunks.push(A),this.header?.writeInt32LE(4+this.field.length+1+this.serializedDocumentsLength,1),this.serializedDocumentsLength+this.header.length}toBin(){return Buffer.concat(this.chunks)}}sI.DocumentSequence=iG;class hD{constructor(F,A,D){if(this.databaseName=F,this.command=A,this.options=D,A==null)throw new m5.MongoInvalidArgumentError("Query document must be specified for query");this.command.$db=F,this.options=D??{},this.requestId=D.requestId?D.requestId:hD.getRequestId(),this.serializeFunctions=typeof D.serializeFunctions==="boolean"?D.serializeFunctions:!1,this.ignoreUndefined=typeof D.ignoreUndefined==="boolean"?D.ignoreUndefined:!1,this.checkKeys=typeof D.checkKeys==="boolean"?D.checkKeys:!1,this.maxBsonSize=D.maxBsonSize||16777216,this.checksumPresent=!1,this.moreToCome=D.moreToCome??A.writeConcern?.w===0,this.exhaustAllowed=typeof D.exhaustAllowed==="boolean"?D.exhaustAllowed:!1}toBin(){let F=[],A=0;if(this.checksumPresent)A|=lI;if(this.moreToCome)A|=pI;if(this.exhaustAllowed)A|=iI;let D=Buffer.alloc(20);F.push(D);let Z=D.length,J=this.command;return Z+=this.makeSections(F,J),D.writeInt32LE(Z,0),D.writeInt32LE(this.requestId,4),D.writeInt32LE(0,8),D.writeInt32LE(b7.OP_MSG,12),D.writeUInt32LE(A,16),F}makeSections(F,A){let D=this.extractDocumentSequences(A),Z=Buffer.allocUnsafe(1);Z[0]=0;let J=this.serializeBson(A);return F.push(Z),F.push(J),F.push(D),Z.length+J.length+D.length}extractDocumentSequences(F){let A=[];for(let[D,Z]of Object.entries(F))if(Z instanceof iG)A.push(Z.toBin()),delete F[D];if(A.length>0)return Buffer.concat(A);return Buffer.alloc(0)}serializeBson(F){return v7.serialize(F,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined})}static getRequestId(){return h7=h7+1&2147483647,h7}}sI.OpMsgRequest=hD;class aI{constructor(F,A,D,Z){this.index=0,this.sections=[],this.parsed=!1,this.raw=F,this.data=D,this.opts=Z??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=A.length,this.requestId=A.requestId,this.responseTo=A.responseTo,this.opCode=A.opCode,this.fromCompressed=A.fromCompressed,this.responseFlags=D.readInt32LE(0),this.checksumPresent=(this.responseFlags&lI)!==0,this.moreToCome=(this.responseFlags&pI)!==0,this.exhaustAllowed=(this.responseFlags&iI)!==0,this.useBigInt64=typeof this.opts.useBigInt64==="boolean"?this.opts.useBigInt64:!1,this.promoteLongs=typeof this.opts.promoteLongs==="boolean"?this.opts.promoteLongs:!0,this.promoteValues=typeof this.opts.promoteValues==="boolean"?this.opts.promoteValues:!0,this.promoteBuffers=typeof this.opts.promoteBuffers==="boolean"?this.opts.promoteBuffers:!1,this.bsonRegExp=typeof this.opts.bsonRegExp==="boolean"?this.opts.bsonRegExp:!1}isParsed(){return this.parsed}parse(){if(this.parsed)return this.sections[0];this.index=4;while(this.index<this.data.length){let F=this.data.readUInt8(this.index++);if(F===0){let A=this.data.readUInt32LE(this.index),D=this.data.subarray(this.index,this.index+A);this.sections.push(D),this.index+=A}else if(F===1)throw new m5.MongoRuntimeError("OP_MSG Payload Type 1 detected unsupported protocol")}return this.parsed=!0,this.sections[0]}}sI.OpMsgResponse=aI;var lG=16,dI=9;class nI{constructor(F,A){this.command=F,this.options=A}static canCompress(F){let A=F instanceof hD?F.command:F.query,D=Object.keys(A)[0];return!cG.uncompressibleCommands.has(D)}async toBin(){let F=Buffer.concat(this.command.toBin()),A=F.slice(lG),D=F.readInt32LE(12),Z=await cG.compress(this.options,A),J=Buffer.alloc(lG);J.writeInt32LE(lG+dI+Z.length,0),J.writeInt32LE(this.command.requestId,4),J.writeInt32LE(0,8),J.writeInt32LE(b7.OP_COMPRESSED,12);let X=Buffer.alloc(dI);return X.writeInt32LE(D,0),X.writeInt32LE(A.length,4),X.writeUInt8(cG.Compressor[this.options.agreedCompressor],8),[J,X,Z]}}sI.OpCompressedRequest=nI});var c5=E((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});DM.uncompressibleCommands=DM.Compressor=void 0;DM.compress=F91;DM.decompress=FM;DM.compressCommand=A91;DM.decompressResponse=D91;var tI=i("node:util"),vD=i("node:zlib"),r41=N0(),oI=F3(),nG=n(),m7=d5(),aG=W9();DM.Compressor=Object.freeze({none:0,snappy:1,zlib:2,zstd:3});DM.uncompressibleCommands=new Set([r41.LEGACY_HELLO_COMMAND,"saslStart","saslContinue","getnonce","authenticate","createUser","updateUser","copydbSaslStart","copydbgetnonce","copydb"]);var t41=3,o41=tI.promisify(vD.inflate.bind(vD)),e41=tI.promisify(vD.deflate.bind(vD)),S4,I9=null;function eI(){if(I9==null){let F=oI.getSnappy();if("kModuleError"in F)throw F.kModuleError;I9=F}return I9}async function F91(F,A){let D={};switch(F.agreedCompressor){case"snappy":return I9??=eI(),await I9.compress(A);case"zstd":{if(AM(),"kModuleError"in S4)throw S4.kModuleError;return await S4.compress(A,t41)}case"zlib":{if(F.zlibCompressionLevel)D.level=F.zlibCompressionLevel;return await e41(A,D)}default:throw new nG.MongoInvalidArgumentError(`Unknown compressor ${F.agreedCompressor} failed to compress`)}}async function FM(F,A){if(F!==DM.Compressor.snappy&&F!==DM.Compressor.zstd&&F!==DM.Compressor.zlib&&F!==DM.Compressor.none)throw new nG.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${F})`);switch(F){case DM.Compressor.snappy:return I9??=eI(),await I9.uncompress(A,{asBuffer:!0});case DM.Compressor.zstd:{if(AM(),"kModuleError"in S4)throw S4.kModuleError;return await S4.decompress(A)}case DM.Compressor.zlib:return await o41(A);default:return A}}function AM(){if(!S4)S4=oI.getZstdLibrary()}var l5=16;async function A91(F,A){let Z=await(A.agreedCompressor==="none"||!m7.OpCompressedRequest.canCompress(F)?F:new m7.OpCompressedRequest(F,{agreedCompressor:A.agreedCompressor??"none",zlibCompressionLevel:A.zlibCompressionLevel??0})).toBin();return Buffer.concat(Z)}async function D91(F){let A={length:F.readInt32LE(0),requestId:F.readInt32LE(4),responseTo:F.readInt32LE(8),opCode:F.readInt32LE(12)};if(A.opCode!==aG.OP_COMPRESSED){let G=A.opCode===aG.OP_MSG?m7.OpMsgResponse:m7.OpReply,Y=F.subarray(l5);return new G(F,A,Y)}let D={...A,fromCompressed:!0,opCode:F.readInt32LE(l5),length:F.readInt32LE(l5+4)},Z=F[l5+8],J=F.slice(l5+9),X=D.opCode===aG.OP_MSG?m7.OpMsgResponse:m7.OpReply,$=await FM(Z,J);if($.length!==D.length)throw new nG.MongoDecompressionError("Message body and message header must be the same length");return new X(F,D,$)}});var rG=E((JM)=>{Object.defineProperty(JM,"__esModule",{value:!0});JM.hmacSha256Hook=JM.hmacSha512Hook=JM.aes256CtrDecryptHook=JM.aes256CtrEncryptHook=JM.aes256CbcDecryptHook=JM.aes256CbcEncryptHook=void 0;JM.makeAES256Hook=i5;JM.randomHook=Y91;JM.sha256Hook=G91;JM.makeHmacHook=sG;JM.signRsaSha256Hook=B91;var p5=i("node:crypto");function i5(F,A){return function(D,Z,J,X){let $;try{let G=p5[F](A,D,Z);G.setAutoPadding(!1),$=G.update(J);let Y=G.final();if(Y.length>0)$=Buffer.concat([$,Y])}catch(G){return G}return $.copy(X),$.length}}function Y91(F,A){try{p5.randomFillSync(F,0,A)}catch(D){return D}return A}function G91(F,A){let D;try{D=p5.createHash("sha256").update(F).digest()}catch(Z){return Z}return D.copy(A),D.length}function sG(F){return(A,D,Z)=>{let J;try{J=p5.createHmac(F,A).update(D).digest()}catch(X){return X}return J.copy(Z),J.length}}function B91(F,A,D){let Z;try{let J=p5.createSign("sha256WithRSAEncryption"),X=Buffer.from(`-----BEGIN PRIVATE KEY-----
10
+ ${F.toString("base64")}
11
+ -----END PRIVATE KEY-----
12
+ `);Z=J.update(A).end().sign(X)}catch(J){return J}return Z.copy(D),Z.length}JM.aes256CbcEncryptHook=i5("createCipheriv","aes-256-cbc");JM.aes256CbcDecryptHook=i5("createDecipheriv","aes-256-cbc");JM.aes256CtrEncryptHook=i5("createCipheriv","aes-256-ctr");JM.aes256CtrDecryptHook=i5("createDecipheriv","aes-256-ctr");JM.hmacSha512Hook=sG("sha512");JM.hmacSha256Hook=sG("sha256")});var d7=E((qM)=>{Object.defineProperty(qM,"__esModule",{value:!0});qM.MongoCryptKMSRequestNetworkTimeoutError=qM.MongoCryptAzureKMSRequestError=qM.MongoCryptCreateEncryptedCollectionError=qM.MongoCryptCreateDataKeyError=qM.MongoCryptInvalidArgumentError=qM.MongoCryptError=void 0;var L91=n();class M9 extends L91.MongoError{constructor(F,A={}){super(F,A)}get name(){return"MongoCryptError"}}qM.MongoCryptError=M9;class $M extends M9{constructor(F){super(F)}get name(){return"MongoCryptInvalidArgumentError"}}qM.MongoCryptInvalidArgumentError=$M;class YM extends M9{constructor(F,{cause:A}){super(`Unable to complete creating data keys: ${A.message}`,{cause:A});this.encryptedFields=F}get name(){return"MongoCryptCreateDataKeyError"}}qM.MongoCryptCreateDataKeyError=YM;class GM extends M9{constructor(F,{cause:A}){super(`Unable to create collection: ${A.message}`,{cause:A});this.encryptedFields=F}get name(){return"MongoCryptCreateEncryptedCollectionError"}}qM.MongoCryptCreateEncryptedCollectionError=GM;class BM extends M9{constructor(F,A){super(F);this.body=A}get name(){return"MongoCryptAzureKMSRequestError"}}qM.MongoCryptAzureKMSRequestError=BM;class HM extends M9{get name(){return"MongoCryptKMSRequestNetworkTimeoutError"}}qM.MongoCryptKMSRequestNetworkTimeoutError=HM});var oG=E((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});EM.LegacyAWSTemporaryCredentialProvider=EM.AWSSDKCredentialProvider=EM.AWSTemporaryCredentialProvider=void 0;var N91=F3(),j91=n(),mD=e(),T91="http://169.254.170.2",tG="http://169.254.169.254",CM="/latest/meta-data/iam/security-credentials";class D3{static get awsSDK(){return D3._awsSDK??=N91.getAwsCredentialProvider(),D3._awsSDK}static get isAWSSDKInstalled(){return!("kModuleError"in D3.awsSDK)}}EM.AWSTemporaryCredentialProvider=D3;class QM extends D3{constructor(F){super();if(F)this._provider=F}get provider(){if("kModuleError"in D3.awsSDK)throw D3.awsSDK.kModuleError;if(this._provider)return this._provider;let{AWS_STS_REGIONAL_ENDPOINTS:F="",AWS_REGION:A=""}=process.env;F=F.toLowerCase(),A=A.toLowerCase();let D=A.length!==0&&F.length!==0,J=F==="regional"||F==="legacy"&&!new Set(["ap-northeast-1","ap-south-1","ap-southeast-1","ap-southeast-2","aws-global","ca-central-1","eu-central-1","eu-north-1","eu-west-1","eu-west-2","eu-west-3","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]).has(A);return this._provider=D&&J?D3.awsSDK.fromNodeProviderChain({clientConfig:{region:A}}):D3.awsSDK.fromNodeProviderChain(),this._provider}async getCredentials(){try{let F=await this.provider();return{AccessKeyId:F.accessKeyId,SecretAccessKey:F.secretAccessKey,Token:F.sessionToken,Expiration:F.expiration}}catch(F){throw new j91.MongoAWSError(F.message,{cause:F})}}}EM.AWSSDKCredentialProvider=QM;class KM extends D3{async getCredentials(){if(process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI)return await mD.request(`${T91}${process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}`);let F=await mD.request(`${tG}/latest/api/token`,{method:"PUT",json:!1,headers:{"X-aws-ec2-metadata-token-ttl-seconds":30}}),A=await mD.request(`${tG}/${CM}`,{json:!1,headers:{"X-aws-ec2-metadata-token":F}});return await mD.request(`${tG}/${CM}/${A}`,{headers:{"X-aws-ec2-metadata-token":F}})}}EM.LegacyAWSTemporaryCredentialProvider=KM});var VM=E((zM)=>{Object.defineProperty(zM,"__esModule",{value:!0});zM.loadAWSCredentials=_91;var S91=oG();async function _91(F,A){let D=new S91.AWSSDKCredentialProvider(A),{SecretAccessKey:Z="",AccessKeyId:J="",Token:X}=await D.getCredentials(),$={secretAccessKey:Z,accessKeyId:J};return X!=null&&($.sessionToken=X),{...F,aws:$}}});var AB=E((PM)=>{Object.defineProperty(PM,"__esModule",{value:!0});PM.tokenCache=PM.AzureCredentialCache=PM.AZURE_BASE_URL=void 0;PM.addAzureParams=LM;PM.prepareRequest=RM;PM.fetchAzureKMSToken=wM;PM.loadAzureCredentials=b91;var x91=n(),g91=e(),c7=d7(),f91=6000;PM.AZURE_BASE_URL="http://169.254.169.254/metadata/identity/oauth2/token?";class eG{constructor(){this.cachedToken=null}async getToken(){if(this.cachedToken==null||this.needsRefresh(this.cachedToken))this.cachedToken=await this._getToken();return{accessToken:this.cachedToken.accessToken}}needsRefresh(F){return F.expiresOnTimestamp-Date.now()<=f91}resetCache(){this.cachedToken=null}_getToken(){return wM()}}PM.AzureCredentialCache=eG;PM.tokenCache=new eG;async function y91(F){let{status:A,body:D}=F,Z=(()=>{try{return JSON.parse(D)}catch{throw new c7.MongoCryptAzureKMSRequestError("Malformed JSON body in GET request.")}})();if(A!==200)throw new c7.MongoCryptAzureKMSRequestError("Unable to complete request.",Z);if(!Z.access_token)throw new c7.MongoCryptAzureKMSRequestError("Malformed response body - missing field `access_token`.");if(!Z.expires_in)throw new c7.MongoCryptAzureKMSRequestError("Malformed response body - missing field `expires_in`.");let J=Number(Z.expires_in)*1000;if(Number.isNaN(J))throw new c7.MongoCryptAzureKMSRequestError("Malformed response body - unable to parse int from `expires_in` field.");return{accessToken:Z.access_token,expiresOnTimestamp:Date.now()+J}}function LM(F,A,D){if(F.searchParams.append("api-version","2018-02-01"),F.searchParams.append("resource",A),D)F.searchParams.append("client_id",D);return F}function RM(F){let A=new URL(F.url?.toString()??PM.AZURE_BASE_URL);return LM(A,"https://vault.azure.net"),{headers:{...F.headers,"Content-Type":"application/json",Metadata:!0},url:A}}async function wM(F={}){let{headers:A,url:D}=RM(F);try{let Z=await g91.get(D,{headers:A});return await y91(Z)}catch(Z){if(Z instanceof x91.MongoNetworkTimeoutError)throw new c7.MongoCryptAzureKMSRequestError(`[Azure KMS] ${Z.message}`);throw Z}}async function b91(F){let A=await PM.tokenCache.getToken();return{...F,azure:A}}});var NM=E((MM)=>{Object.defineProperty(MM,"__esModule",{value:!0});MM.loadGCPCredentials=p91;var l91=F3();async function p91(F){let A=l91.getGcpMetadata();if("kModuleError"in A)return F;let{access_token:D}=await A.instance({property:"service-accounts/default/token"});return{...F,gcp:{accessToken:D}}}});var DB=E((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});jM.isEmptyCredentials=dD;jM.refreshKMSCredentials=r91;var a91=VM(),n91=AB(),s91=NM();function dD(F,A){let D=A[F];if(D==null)return!1;return typeof D==="object"&&Object.keys(D).length===0}async function r91(F,A){let D=F;if(dD("aws",F))D=await a91.loadAWSCredentials(D,A?.aws);if(dD("gcp",F))D=await s91.loadGCPCredentials(D);if(dD("azure",F))D=await n91.loadAzureCredentials(D);return D}});var ZB=E((vM)=>{Object.defineProperty(vM,"__esModule",{value:!0});vM.StateMachine=void 0;var TM=i("node:fs/promises"),e91=i("node:net"),F71=i("node:tls"),m3=k1(),kM=q2(),A71=F3(),D71=n(),OM=G2(),_4=e(),Z71=cD(),u4=d7(),a5=null;function J71(){if(a5==null){let F=A71.getSocks();if("kModuleError"in F)throw F.kModuleError;a5=F}return a5}var N9=0,_M=1,uM=2,xM=3,gM=7,fM=4,yM=5,bM=6,X71=443,$71=new Map([[N9,"MONGOCRYPT_CTX_ERROR"],[_M,"MONGOCRYPT_CTX_NEED_MONGO_COLLINFO"],[uM,"MONGOCRYPT_CTX_NEED_MONGO_MARKINGS"],[xM,"MONGOCRYPT_CTX_NEED_MONGO_KEYS"],[gM,"MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS"],[fM,"MONGOCRYPT_CTX_NEED_KMS"],[yM,"MONGOCRYPT_CTX_READY"],[bM,"MONGOCRYPT_CTX_DONE"]]),Y71=["tlsInsecure","tlsAllowInvalidCertificates","tlsAllowInvalidHostnames","tlsDisableOCSPEndpointCheck","tlsDisableCertificateRevocationCheck"];function SM(F){if(process.env.MONGODB_CRYPT_DEBUG)console.error(F)}var G71;class hM{constructor(F,A=m3.pluckBSONSerializeOptions(F)){this.options=F,this.bsonOptions=A}async execute(F,A,D){let{_keyVaultNamespace:Z,_keyVaultClient:J,_metaDataClient:X,_mongocryptdClient:$,_mongocryptdManager:G}=F,Y=null,B=()=>A.status,H=()=>A.state;while(H()!==bM&&H()!==N9)switch(D.signal?.throwIfAborted(),SM(`[context#${A.id}] ${$71.get(H())||H()}`),H()){case _M:{let q=m3.deserialize(A.nextMongoOperation());if(!X)throw new u4.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined");let W=this.fetchCollectionInfo(X,A.ns,q,D);for await(let C of W)if(A.addMongoOperationResponse(m3.serialize(C)),H()===N9)break;if(H()===N9)break;A.finishMongoOperation();break}case uM:{let q=A.nextMongoOperation();if(H()===N9)break;if(!$)throw new u4.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined");let W=G?await G.withRespawn(this.markCommand.bind(this,$,A.ns,q,D)):await this.markCommand($,A.ns,q,D);A.addMongoOperationResponse(W),A.finishMongoOperation();break}case xM:{let q=A.nextMongoOperation(),W=await this.fetchKeys(J,Z,q,D);if(W.length===0)Y=G71??=m3.serialize({v:[]});for await(let C of W)A.addMongoOperationResponse(m3.serialize(C));A.finishMongoOperation();break}case gM:{let q=await F.askForKMSCredentials();A.provideKMSProviders(m3.serialize(q));break}case fM:{await Promise.all(this.requests(A,D)),A.finishKMSRequests();break}case yM:{let q=A.finalize();if(H()===N9){let W=B().message||"Finalization error";throw new u4.MongoCryptError(W)}Y=q;break}default:throw new u4.MongoCryptError(`Unknown state: ${H()}`)}if(H()===N9||Y==null){let q=B().message;if(!q)SM("unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.");throw new u4.MongoCryptError(q??"unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.")}return Y}async kmsRequest(F,A){let D=F.endpoint.split(":"),Z=D[1]!=null?Number.parseInt(D[1],10):X71,J={host:D[0],servername:D[0],port:Z,...Z71.autoSelectSocketOptions(this.options.socketOptions||{})},X=F.message,$=new _4.BufferPool,G,Y;function B(){for(let Q of[Y,G])if(Q)Q.destroy()}function H(Q){return new u4.MongoCryptError("KMS request failed",{cause:Q})}function q(){return new u4.MongoCryptError("KMS request closed")}let W=this.options.tlsOptions;if(W){let Q=F.kmsProvider,K=W[Q];if(K){let U=this.validateTlsOptions(Q,K);if(U)throw U;try{await this.setTlsOptions(K,J)}catch(z){throw H(z)}}}let C;try{if(this.options.proxyOptions&&this.options.proxyOptions.proxyHost){G=new e91.Socket;let{promise:z,reject:L,resolve:V}=_4.promiseWithResolvers();G.once("error",(I)=>L(H(I))).once("close",()=>L(q())).once("connect",()=>V());let P={...J,host:this.options.proxyOptions.proxyHost,port:this.options.proxyOptions.proxyPort||1080};G.connect(P),await z;try{a5??=J71(),J.socket=(await a5.SocksClient.createConnection({existing_socket:G,command:"connect",destination:{host:J.host,port:J.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:this.options.proxyOptions.proxyUsername,password:this.options.proxyOptions.proxyPassword}})).socket}catch(I){throw H(I)}}Y=F71.connect(J,()=>{Y.write(X)});let{promise:Q,reject:K,resolve:U}=_4.promiseWithResolvers();C=_4.addAbortListener(A?.signal,function(){B(),K(this.reason)}),Y.once("error",(z)=>K(H(z))).once("close",()=>K(q())).on("data",(z)=>{$.append(z);while(F.bytesNeeded>0&&$.length){let L=Math.min(F.bytesNeeded,$.length);F.addResponse($.read(L))}if(F.bytesNeeded<=0)U()}),await(A?.timeoutContext?.csotEnabled()?Promise.all([Q,OM.Timeout.expires(A.timeoutContext?.remainingTimeMS)]):Q)}catch(Q){if(Q instanceof OM.TimeoutError)throw new D71.MongoOperationTimeoutError("KMS request timed out");throw Q}finally{B(),C?.[_4.kDispose]()}}*requests(F,A){for(let D=F.nextKMSRequest();D!=null;D=F.nextKMSRequest())yield this.kmsRequest(D,A)}validateTlsOptions(F,A){let D=Object.keys(A);for(let Z of Y71)if(D.includes(Z))return new u4.MongoCryptError(`Insecure TLS options prohibited for ${F}: ${Z}`)}async setTlsOptions(F,A){if(F.tlsCertificateKeyFile){let D=await TM.readFile(F.tlsCertificateKeyFile);A.cert=A.key=D}if(F.tlsCAFile)A.ca=await TM.readFile(F.tlsCAFile);if(F.tlsCertificateKeyFilePassword)A.passphrase=F.tlsCertificateKeyFilePassword}fetchCollectionInfo(F,A,D,Z){let{db:J}=_4.MongoDBCollectionNamespace.fromString(A);return F.db(J).listCollections(D,{promoteLongs:!1,promoteValues:!1,timeoutContext:Z?.timeoutContext&&new kM.CursorTimeoutContext(Z?.timeoutContext,Symbol()),signal:Z?.signal,nameOnly:!1})}async markCommand(F,A,D,Z){let{db:J}=_4.MongoDBCollectionNamespace.fromString(A),X={promoteLongs:!1,promoteValues:!1},$=m3.deserialize(D,X),G={timeoutMS:void 0,signal:void 0};if(Z?.timeoutContext?.csotEnabled())G.timeoutMS=Z.timeoutContext.remainingTimeMS;if(Z?.signal)G.signal=Z.signal;let Y=await F.db(J).command($,{...X,...G});return m3.serialize(Y,this.bsonOptions)}fetchKeys(F,A,D,Z){let{db:J,collection:X}=_4.MongoDBCollectionNamespace.fromString(A),$={timeoutContext:void 0,signal:void 0};if(Z?.timeoutContext!=null)$.timeoutContext=new kM.CursorTimeoutContext(Z.timeoutContext,Symbol());if(Z?.signal!=null)$.signal=Z.signal;return F.db(J).collection(X,{readConcern:{level:"majority"}}).find(m3.deserialize(D),$).toArray()}}vM.StateMachine=hM});var cD=E((cM)=>{Object.defineProperty(cM,"__esModule",{value:!0});cM.ClientEncryption=void 0;cM.autoSelectSocketOptions=s5;var c2=k1(),B71=F3(),n5=G2(),l2=e(),H71=rG(),x4=d7(),dM=DB(),lD=ZB();class pD{static getMongoCrypt(){let F=B71.getMongoDBClientEncryption();if("kModuleError"in F)throw F.kModuleError;return F.MongoCrypt}constructor(F,A){this._client=F,this._proxyOptions=A.proxyOptions??{},this._tlsOptions=A.tlsOptions??{},this._kmsProviders=A.kmsProviders||{};let{timeoutMS:D}=l2.resolveTimeoutOptions(F,A);if(this._timeoutMS=D,this._credentialProviders=A.credentialProviders,A.credentialProviders?.aws&&!dM.isEmptyCredentials("aws",this._kmsProviders))throw new x4.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");if(A.keyVaultNamespace==null)throw new x4.MongoCryptInvalidArgumentError("Missing required option `keyVaultNamespace`");let Z={...A,cryptoCallbacks:H71,kmsProviders:!Buffer.isBuffer(this._kmsProviders)?c2.serialize(this._kmsProviders):this._kmsProviders};this._keyVaultNamespace=A.keyVaultNamespace,this._keyVaultClient=A.keyVaultClient||F;let J=pD.getMongoCrypt();this._mongoCrypt=new J(Z)}async createDataKey(F,A={}){if(A.keyAltNames&&!Array.isArray(A.keyAltNames))throw new x4.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof A.keyAltNames}.`);let D=void 0;if(A.keyAltNames&&A.keyAltNames.length>0)D=A.keyAltNames.map((W,C)=>{if(typeof W!=="string")throw new x4.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${C} was of type ${typeof W}`);return c2.serialize({keyAltName:W})});let Z=void 0;if(A.keyMaterial)Z=c2.serialize({keyMaterial:A.keyMaterial});let J=c2.serialize({provider:F,...A.masterKey}),X=this._mongoCrypt.makeDataKeyContext(J,{keyAltNames:D,keyMaterial:Z}),$=new lD.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s5(this._client.s.options)}),G=A?.timeoutContext??n5.TimeoutContext.create(l2.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})),Y=c2.deserialize(await $.execute(this,X,{timeoutContext:G})),{db:B,collection:H}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),{insertedId:q}=await this._keyVaultClient.db(B).collection(H).insertOne(Y,{writeConcern:{w:"majority"},timeoutMS:G?.csotEnabled()?G?.getRemainingTimeMSOrThrow():void 0});return q}async rewrapManyDataKey(F,A){let D=void 0;if(A){let W=Object.assign({provider:A.provider},A.masterKey);D=c2.serialize(W)}let Z=c2.serialize(F),J=this._mongoCrypt.makeRewrapManyDataKeyContext(Z,D),X=new lD.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s5(this._client.s.options)}),$=n5.TimeoutContext.create(l2.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})),{v:G}=c2.deserialize(await X.execute(this,J,{timeoutContext:$}));if(G.length===0)return{};let{db:Y,collection:B}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),H=G.map((W)=>({updateOne:{filter:{_id:W._id},update:{$set:{masterKey:W.masterKey,keyMaterial:W.keyMaterial},$currentDate:{updateDate:!0}}}}));return{bulkWriteResult:await this._keyVaultClient.db(Y).collection(B).bulkWrite(H,{writeConcern:{w:"majority"},timeoutMS:$.csotEnabled()?$?.remainingTimeMS:void 0})}}async deleteKey(F){let{db:A,collection:D}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(A).collection(D).deleteOne({_id:F},{writeConcern:{w:"majority"},timeoutMS:this._timeoutMS})}getKeys(){let{db:F,collection:A}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return this._keyVaultClient.db(F).collection(A).find({},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKey(F){let{db:A,collection:D}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(A).collection(D).findOne({_id:F},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKeyByAltName(F){let{db:A,collection:D}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(A).collection(D).findOne({keyAltNames:F},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async addKeyAltName(F,A){let{db:D,collection:Z}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(D).collection(Z).findOneAndUpdate({_id:F},{$addToSet:{keyAltNames:A}},{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async removeKeyAltName(F,A){let{db:D,collection:Z}=l2.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),J=[{$set:{keyAltNames:{$cond:[{$eq:["$keyAltNames",[A]]},"$$REMOVE",{$filter:{input:"$keyAltNames",cond:{$ne:["$$this",A]}}}]}}}];return await this._keyVaultClient.db(D).collection(Z).findOneAndUpdate({_id:F},J,{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async createEncryptedCollection(F,A,D){let{provider:Z,masterKey:J,createCollectionOptions:{encryptedFields:{...X},...$}}=D,G=this._timeoutMS!=null?n5.TimeoutContext.create(l2.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0;if(Array.isArray(X.fields)){let Y=X.fields.map(async(q)=>q==null||typeof q!=="object"||q.keyId!=null?q:{...q,keyId:await this.createDataKey(Z,{masterKey:J,timeoutContext:G?.csotEnabled()?G?.clone():void 0})}),B=await Promise.allSettled(Y);X.fields=B.map((q,W)=>q.status==="fulfilled"?q.value:X.fields[W]);let H=B.find((q)=>q.status==="rejected");if(H!=null)throw new x4.MongoCryptCreateDataKeyError(X,{cause:H.reason})}try{return{collection:await F.createCollection(A,{...$,encryptedFields:X,timeoutMS:G?.csotEnabled()?G?.getRemainingTimeMSOrThrow():void 0}),encryptedFields:X}}catch(Y){throw new x4.MongoCryptCreateEncryptedCollectionError(X,{cause:Y})}}async encrypt(F,A){return await this._encrypt(F,!1,A)}async encryptExpression(F,A){return await this._encrypt(F,!0,A)}async decrypt(F){let A=c2.serialize({v:F}),D=this._mongoCrypt.makeExplicitDecryptionContext(A),Z=new lD.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s5(this._client.s.options)}),J=this._timeoutMS!=null?n5.TimeoutContext.create(l2.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:X}=c2.deserialize(await Z.execute(this,D,{timeoutContext:J}));return X}async askForKMSCredentials(){return await dM.refreshKMSCredentials(this._kmsProviders,this._credentialProviders)}static get libmongocryptVersion(){return pD.getMongoCrypt().libmongocryptVersion}async _encrypt(F,A,D){let{algorithm:Z,keyId:J,keyAltName:X,contentionFactor:$,queryType:G,rangeOptions:Y}=D,B={expressionMode:A,algorithm:Z};if(J)B.keyId=J.buffer;if(X){if(J)throw new x4.MongoCryptInvalidArgumentError('"options" cannot contain both "keyId" and "keyAltName"');if(typeof X!=="string")throw new x4.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof X}`);B.keyAltName=c2.serialize({keyAltName:X})}if(typeof $==="number"||typeof $==="bigint")B.contentionFactor=$;if(typeof G==="string")B.queryType=G;if(typeof Y==="object")B.rangeOptions=c2.serialize(Y);let H=c2.serialize({v:F}),q=new lD.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s5(this._client.s.options)}),W=this._mongoCrypt.makeExplicitEncryptionContext(H,B),C=this._timeoutMS!=null?n5.TimeoutContext.create(l2.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:Q}=c2.deserialize(await q.execute(this,W,{timeoutContext:C}));return Q}}cM.ClientEncryption=pD;function s5(F){let A={autoSelectFamily:!0};if("autoSelectFamily"in F)A.autoSelectFamily=F.autoSelectFamily;if("autoSelectFamilyAttemptTimeout"in F)A.autoSelectFamilyAttemptTimeout=F.autoSelectFamilyAttemptTimeout;return A}});var aM=E((pM)=>{Object.defineProperty(pM,"__esModule",{value:!0});pM.MongocryptdManager=void 0;var W71=n();class iD{constructor(F={}){if(this.spawnPath="",this.spawnArgs=[],this.uri=typeof F.mongocryptdURI==="string"&&F.mongocryptdURI.length>0?F.mongocryptdURI:iD.DEFAULT_MONGOCRYPTD_URI,this.bypassSpawn=!!F.mongocryptdBypassSpawn,Object.hasOwn(F,"mongocryptdSpawnPath")&&F.mongocryptdSpawnPath)this.spawnPath=F.mongocryptdSpawnPath;if(Object.hasOwn(F,"mongocryptdSpawnArgs")&&Array.isArray(F.mongocryptdSpawnArgs))this.spawnArgs=this.spawnArgs.concat(F.mongocryptdSpawnArgs);if(this.spawnArgs.filter((A)=>typeof A==="string").every((A)=>A.indexOf("--idleShutdownTimeoutSecs")<0))this.spawnArgs.push("--idleShutdownTimeoutSecs","60")}async spawn(){let F=this.spawnPath||"mongocryptd",{spawn:A}=i("node:child_process");this._child=A(F,this.spawnArgs,{stdio:"ignore",detached:!0}),this._child.on("error",()=>{}),this._child.unref()}async withRespawn(F){try{return await F()}catch(D){if(!(D instanceof W71.MongoNetworkTimeoutError&&!this.bypassSpawn))throw D}return await this.spawn(),await F()}}pM.MongocryptdManager=iD;iD.DEFAULT_MONGOCRYPTD_URI="mongodb://localhost:27020"});var $B=E((eM)=>{var oM;Object.defineProperty(eM,"__esModule",{value:!0});eM.AutoEncrypter=eM.AutoEncryptionLoggerLevel=void 0;var nM=i("node:net"),r5=k1(),C71=N0(),Q71=F3(),JB=n(),K71=M4(),E71=e(),XB=cD(),U71=rG(),sM=d7(),z71=aM(),rM=DB(),tM=ZB();eM.AutoEncryptionLoggerLevel=Object.freeze({FatalError:0,Error:1,Warning:2,Info:3,Trace:4});class aD{static getMongoCrypt(){let F=Q71.getMongoDBClientEncryption();if("kModuleError"in F)throw F.kModuleError;return F.MongoCrypt}constructor(F,A){if(this[oM]=!1,this._client=F,this._bypassEncryption=A.bypassAutoEncryption===!0,this._keyVaultNamespace=A.keyVaultNamespace||"admin.datakeys",this._keyVaultClient=A.keyVaultClient||F,this._metaDataClient=A.metadataClient||F,this._proxyOptions=A.proxyOptions||{},this._tlsOptions=A.tlsOptions||{},this._kmsProviders=A.kmsProviders||{},this._credentialProviders=A.credentialProviders,A.credentialProviders?.aws&&!rM.isEmptyCredentials("aws",this._kmsProviders))throw new sM.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");let D={enableMultipleCollinfo:!0,cryptoCallbacks:U71};if(A.schemaMap)D.schemaMap=Buffer.isBuffer(A.schemaMap)?A.schemaMap:r5.serialize(A.schemaMap);if(A.encryptedFieldsMap)D.encryptedFieldsMap=Buffer.isBuffer(A.encryptedFieldsMap)?A.encryptedFieldsMap:r5.serialize(A.encryptedFieldsMap);if(D.kmsProviders=!Buffer.isBuffer(this._kmsProviders)?r5.serialize(this._kmsProviders):this._kmsProviders,A.options?.logger)D.logger=A.options.logger;if(A.extraOptions&&A.extraOptions.cryptSharedLibPath)D.cryptSharedLibPath=A.extraOptions.cryptSharedLibPath;if(A.bypassQueryAnalysis)D.bypassQueryAnalysis=A.bypassQueryAnalysis;if(this._bypassMongocryptdAndCryptShared=this._bypassEncryption||!!A.bypassQueryAnalysis,A.extraOptions&&A.extraOptions.cryptSharedLibSearchPaths)D.cryptSharedLibSearchPaths=A.extraOptions.cryptSharedLibSearchPaths;else if(!this._bypassMongocryptdAndCryptShared)D.cryptSharedLibSearchPaths=["$SYSTEM"];let Z=aD.getMongoCrypt();if(this._mongocrypt=new Z(D),this._contextCounter=0,A.extraOptions&&A.extraOptions.cryptSharedLibRequired&&!this.cryptSharedLibVersionInfo)throw new sM.MongoCryptInvalidArgumentError("`cryptSharedLibRequired` set but no crypt_shared library loaded");if(!this._bypassMongocryptdAndCryptShared&&!this.cryptSharedLibVersionInfo){this._mongocryptdManager=new z71.MongocryptdManager(A.extraOptions);let J={serverSelectionTimeoutMS:1e4};if((A.extraOptions==null||typeof A.extraOptions.mongocryptdURI!=="string")&&!nM.getDefaultAutoSelectFamily)J.family=4;if(nM.getDefaultAutoSelectFamily)Object.assign(J,XB.autoSelectSocketOptions(this._client.s?.options??{}));this._mongocryptdClient=new K71.MongoClient(this._mongocryptdManager.uri,J)}}async init(){if(this._bypassMongocryptdAndCryptShared||this.cryptSharedLibVersionInfo)return;if(!this._mongocryptdManager)throw new JB.MongoRuntimeError("Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdClient)throw new JB.MongoRuntimeError("Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdManager.bypassSpawn)await this._mongocryptdManager.spawn();try{return await this._mongocryptdClient.connect()}catch(F){let{message:A}=F;if(A&&(A.match(/timed out after/)||A.match(/ENOTFOUND/)))throw new JB.MongoRuntimeError("Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn",{cause:F});throw F}}async teardown(F){await this._mongocryptdClient?.close(F)}async encrypt(F,A,D={}){if(D.signal?.throwIfAborted(),this._bypassEncryption)return A;let Z=Buffer.isBuffer(A)?A:r5.serialize(A,D),J=this._mongocrypt.makeEncryptionContext(E71.MongoDBCollectionNamespace.fromString(F).db,Z);J.id=this._contextCounter++,J.ns=F,J.document=A;let X=new tM.StateMachine({promoteValues:!1,promoteLongs:!1,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:XB.autoSelectSocketOptions(this._client.s.options)});return r5.deserialize(await X.execute(this,J,D),{promoteValues:!1,promoteLongs:!1})}async decrypt(F,A={}){A.signal?.throwIfAborted();let D=this._mongocrypt.makeDecryptionContext(F);return D.id=this._contextCounter++,await new tM.StateMachine({...A,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:XB.autoSelectSocketOptions(this._client.s.options)}).execute(this,D,A)}async askForKMSCredentials(){return await rM.refreshKMSCredentials(this._kmsProviders,this._credentialProviders)}get cryptSharedLibVersionInfo(){return this._mongocrypt.cryptSharedLibVersionInfo}static get libmongocryptVersion(){return aD.getMongoCrypt().libmongocryptVersion}}eM.AutoEncrypter=aD;oM=C71.kDecorateResult});var XN=E((ZN)=>{Object.defineProperty(ZN,"__esModule",{value:!0});ZN.Encrypter=void 0;var L71=i("node:util"),R71=$B(),w71=N0(),P71=F3(),AN=n(),I71=M4();class DN{constructor(F,A,D){if(typeof D.autoEncryption!=="object")throw new AN.MongoInvalidArgumentError('Option "autoEncryption" must be specified');if(this.internalClient=null,this.bypassAutoEncryption=!!D.autoEncryption.bypassAutoEncryption,this.needsConnecting=!1,D.maxPoolSize===0&&D.autoEncryption.keyVaultClient==null)D.autoEncryption.keyVaultClient=F;else if(D.autoEncryption.keyVaultClient==null)D.autoEncryption.keyVaultClient=this.getInternalClient(F,A,D);if(this.bypassAutoEncryption)D.autoEncryption.metadataClient=void 0;else if(D.maxPoolSize===0)D.autoEncryption.metadataClient=F;else D.autoEncryption.metadataClient=this.getInternalClient(F,A,D);if(D.proxyHost)D.autoEncryption.proxyOptions={proxyHost:D.proxyHost,proxyPort:D.proxyPort,proxyUsername:D.proxyUsername,proxyPassword:D.proxyPassword};this.autoEncrypter=new R71.AutoEncrypter(F,D.autoEncryption)}getInternalClient(F,A,D){let Z=this.internalClient;if(Z==null){let J={};for(let X of[...Object.getOwnPropertyNames(D),...Object.getOwnPropertySymbols(D)]){if(["autoEncryption","minPoolSize","servers","caseTranslate","dbName"].includes(X))continue;Reflect.set(J,X,Reflect.get(D,X))}J.minPoolSize=0,Z=new I71.MongoClient(A,J),this.internalClient=Z;for(let X of w71.MONGO_CLIENT_EVENTS)for(let $ of F.listeners(X))Z.on(X,$);F.on("newListener",(X,$)=>{Z?.on(X,$)}),this.needsConnecting=!0}return Z}async connectInternalClient(){let F=this.internalClient;if(this.needsConnecting&&F!=null)this.needsConnecting=!1,await F.connect()}closeCallback(F,A,D){L71.callbackify(this.close.bind(this))(F,A,D)}async close(F,A){let D;try{await this.autoEncrypter.teardown(A)}catch(J){D=J}let Z=this.internalClient;if(Z!=null&&F!==Z)return await Z.close(A);if(D!=null)throw D}static checkForMongoCrypt(){let F=P71.getMongoDBClientEncryption();if("kModuleError"in F)throw new AN.MongoMissingDependencyError("Auto-encryption requested, but the module is not installed. Please add `mongodb-client-encryption` as a dependency of your project",{cause:F.kModuleError,dependencyName:"mongodb-client-encryption"})}}ZN.Encrypter=DN});var YB=E(($N)=>{Object.defineProperty($N,"__esModule",{value:!0});$N.ConnectionPoolMetrics=void 0;class d3{constructor(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}markPinned(F){if(F===d3.TXN)this.txnConnections+=1;else if(F===d3.CURSOR)this.cursorConnections+=1;else this.otherConnections+=1}markUnpinned(F){if(F===d3.TXN)this.txnConnections-=1;else if(F===d3.CURSOR)this.cursorConnections-=1;else this.otherConnections-=1}info(F){return`Timed out while checking out a connection from connection pool: maxPoolSize: ${F}, connections in use by cursors: ${this.cursorConnections}, connections in use by transactions: ${this.txnConnections}, connections in use by other operations: ${this.otherConnections}`}reset(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}}$N.ConnectionPoolMetrics=d3;d3.TXN="txn";d3.CURSOR="cursor";d3.OTHER="other"});var t5=E((qN)=>{Object.defineProperty(qN,"__esModule",{value:!0});qN.ServerDescription=void 0;qN.parseServerType=BN;qN.compareTopologyVersion=HN;var l7=k1(),M71=n(),p7=e(),S0=$6(),N71=new Set([S0.ServerType.RSPrimary,S0.ServerType.Standalone,S0.ServerType.Mongos,S0.ServerType.LoadBalancer]),j71=new Set([S0.ServerType.RSPrimary,S0.ServerType.RSSecondary,S0.ServerType.Mongos,S0.ServerType.Standalone,S0.ServerType.LoadBalancer]);class GN{constructor(F,A,D={}){if(F==null||F==="")throw new M71.MongoRuntimeError("ServerDescription must be provided with a non-empty address");this.address=typeof F==="string"?p7.HostAddress.fromString(F).toString():F.toString(),this.type=BN(A,D),this.hosts=A?.hosts?.map((Z)=>Z.toLowerCase())??[],this.passives=A?.passives?.map((Z)=>Z.toLowerCase())??[],this.arbiters=A?.arbiters?.map((Z)=>Z.toLowerCase())??[],this.tags=A?.tags??{},this.minWireVersion=A?.minWireVersion??0,this.maxWireVersion=A?.maxWireVersion??0,this.roundTripTime=D?.roundTripTime??-1,this.minRoundTripTime=D?.minRoundTripTime??0,this.lastUpdateTime=p7.now(),this.lastWriteDate=A?.lastWrite?.lastWriteDate??0,this.error=D.error??null,this.error?.stack,this.topologyVersion=this.error?.topologyVersion??A?.topologyVersion??null,this.setName=A?.setName??null,this.setVersion=A?.setVersion??null,this.electionId=A?.electionId??null,this.logicalSessionTimeoutMinutes=A?.logicalSessionTimeoutMinutes??null,this.maxMessageSizeBytes=A?.maxMessageSizeBytes??null,this.maxWriteBatchSize=A?.maxWriteBatchSize??null,this.maxBsonObjectSize=A?.maxBsonObjectSize??null,this.primary=A?.primary??null,this.me=A?.me?.toLowerCase()??null,this.$clusterTime=A?.$clusterTime??null,this.iscryptd=Boolean(A?.iscryptd)}get hostAddress(){return p7.HostAddress.fromString(this.address)}get allHosts(){return this.hosts.concat(this.arbiters).concat(this.passives)}get isReadable(){return this.type===S0.ServerType.RSSecondary||this.isWritable}get isDataBearing(){return j71.has(this.type)}get isWritable(){return N71.has(this.type)}get host(){let F=`:${this.port}`.length;return this.address.slice(0,-F)}get port(){let F=this.address.split(":").pop();return F?Number.parseInt(F,10):27017}equals(F){let A=this.topologyVersion===F?.topologyVersion||HN(this.topologyVersion,F?.topologyVersion)===0,D=this.electionId!=null&&F?.electionId!=null?p7.compareObjectId(this.electionId,F.electionId)===0:this.electionId===F?.electionId;return F!=null&&F.iscryptd===this.iscryptd&&p7.errorStrictEqual(this.error,F.error)&&this.type===F.type&&this.minWireVersion===F.minWireVersion&&p7.arrayStrictEqual(this.hosts,F.hosts)&&T71(this.tags,F.tags)&&this.setName===F.setName&&this.setVersion===F.setVersion&&D&&this.primary===F.primary&&this.logicalSessionTimeoutMinutes===F.logicalSessionTimeoutMinutes&&A}}qN.ServerDescription=GN;function BN(F,A){if(A?.loadBalanced)return S0.ServerType.LoadBalancer;if(!F||!F.ok)return S0.ServerType.Unknown;if(F.isreplicaset)return S0.ServerType.RSGhost;if(F.msg&&F.msg==="isdbgrid")return S0.ServerType.Mongos;if(F.setName)if(F.hidden)return S0.ServerType.RSOther;else if(F.isWritablePrimary)return S0.ServerType.RSPrimary;else if(F.secondary)return S0.ServerType.RSSecondary;else if(F.arbiterOnly)return S0.ServerType.RSArbiter;else return S0.ServerType.RSOther;return S0.ServerType.Standalone}function T71(F,A){let D=Object.keys(F),Z=Object.keys(A);return D.length===Z.length&&D.every((J)=>A[J]===F[J])}function HN(F,A){if(F==null||A==null)return-1;if(!F.processId.equals(A.processId))return-1;let D=typeof F.counter==="bigint"?l7.Long.fromBigInt(F.counter):l7.Long.isLong(F.counter)?F.counter:l7.Long.fromNumber(F.counter),Z=typeof A.counter==="bigint"?l7.Long.fromBigInt(A.counter):l7.Long.isLong(A.counter)?A.counter:l7.Long.fromNumber(A.counter);return D.compare(Z)}});var BB=E((zN)=>{Object.defineProperty(zN,"__esModule",{value:!0});zN.TopologyDescription=void 0;var S71=k1(),sD=W9(),nD=n(),GB=e(),j1=$6(),g4=t5(),_71=sD.MIN_SUPPORTED_SERVER_VERSION,u71=sD.MAX_SUPPORTED_SERVER_VERSION,CN=sD.MIN_SUPPORTED_WIRE_VERSION,QN=sD.MAX_SUPPORTED_WIRE_VERSION,x71=new Set([j1.ServerType.Mongos,j1.ServerType.Unknown]),KN=new Set([j1.ServerType.Mongos,j1.ServerType.Standalone]),EN=new Set([j1.ServerType.RSSecondary,j1.ServerType.RSArbiter,j1.ServerType.RSOther]);class o5{constructor(F,A=null,D=null,Z=null,J=null,X=null,$=null){$=$??{},this.type=F??j1.TopologyType.Unknown,this.servers=A??new Map,this.stale=!1,this.compatible=!0,this.heartbeatFrequencyMS=$.heartbeatFrequencyMS??0,this.localThresholdMS=$.localThresholdMS??15,this.setName=D??null,this.maxElectionId=J??null,this.maxSetVersion=Z??null,this.commonWireVersion=X??0;for(let G of this.servers.values()){if(G.type===j1.ServerType.Unknown||G.type===j1.ServerType.LoadBalancer)continue;if(G.minWireVersion>QN)this.compatible=!1,this.compatibilityError=`Server at ${G.address} requires wire version ${G.minWireVersion}, but this version of the driver only supports up to ${QN} (MongoDB ${u71})`;if(G.maxWireVersion<CN){this.compatible=!1,this.compatibilityError=`Server at ${G.address} reports wire version ${G.maxWireVersion}, but this version of the driver requires at least ${CN} (MongoDB ${_71}).`;break}}this.logicalSessionTimeoutMinutes=null;for(let[,G]of this.servers)if(G.isReadable){if(G.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=null;break}if(this.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=G.logicalSessionTimeoutMinutes;continue}this.logicalSessionTimeoutMinutes=Math.min(this.logicalSessionTimeoutMinutes,G.logicalSessionTimeoutMinutes)}}updateFromSrvPollingEvent(F,A=0){let D=F.hostnames(),Z=new Set(this.servers.keys()),J=new Set(D),X=new Set;for(let G of Z)if(J.delete(G),!D.has(G))X.add(G);if(J.size===0&&X.size===0)return this;let $=new Map(this.servers);for(let G of X)$.delete(G);if(J.size>0){if(A===0)for(let G of J)$.set(G,new g4.ServerDescription(G));else if($.size<A){let G=GB.shuffle(J,A-$.size);for(let Y of G)$.set(Y,new g4.ServerDescription(Y))}}return new o5(this.type,$,this.setName,this.maxSetVersion,this.maxElectionId,this.commonWireVersion,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}update(F){let A=F.address,{type:D,setName:Z,maxSetVersion:J,maxElectionId:X,commonWireVersion:$}=this,G=F.type,Y=new Map(this.servers);if(F.maxWireVersion!==0)if($==null)$=F.maxWireVersion;else $=Math.min($,F.maxWireVersion);if(typeof F.setName==="string"&&typeof Z==="string"&&F.setName!==Z)if(D===j1.TopologyType.Single)F=new g4.ServerDescription(A);else Y.delete(A);if(Y.set(A,F),D===j1.TopologyType.Single)return new o5(j1.TopologyType.Single,Y,Z,J,X,$,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS});if(D===j1.TopologyType.Unknown)if(G===j1.ServerType.Standalone&&this.servers.size!==1)Y.delete(A);else D=g71(G);if(D===j1.TopologyType.Sharded){if(!x71.has(G))Y.delete(A)}if(D===j1.TopologyType.ReplicaSetNoPrimary){if(KN.has(G))Y.delete(A);if(G===j1.ServerType.RSPrimary){let B=UN(Y,F,Z,J,X);D=B[0],Z=B[1],J=B[2],X=B[3]}else if(EN.has(G)){let B=y71(Y,F,Z);D=B[0],Z=B[1]}}if(D===j1.TopologyType.ReplicaSetWithPrimary)if(KN.has(G))Y.delete(A),D=j9(Y);else if(G===j1.ServerType.RSPrimary){let B=UN(Y,F,Z,J,X);D=B[0],Z=B[1],J=B[2],X=B[3]}else if(EN.has(G))D=f71(Y,F,Z);else D=j9(Y);return new o5(D,Y,Z,J,X,$,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}get error(){let F=Array.from(this.servers.values()).filter((A)=>A.error);if(F.length>0)return F[0].error;return null}get hasKnownServers(){return Array.from(this.servers.values()).some((F)=>F.type!==j1.ServerType.Unknown)}get hasDataBearingServers(){return Array.from(this.servers.values()).some((F)=>F.isDataBearing)}hasServer(F){return this.servers.has(F)}toJSON(){return S71.EJSON.serialize(this)}}zN.TopologyDescription=o5;function g71(F){switch(F){case j1.ServerType.Standalone:return j1.TopologyType.Single;case j1.ServerType.Mongos:return j1.TopologyType.Sharded;case j1.ServerType.RSPrimary:return j1.TopologyType.ReplicaSetWithPrimary;case j1.ServerType.RSOther:case j1.ServerType.RSSecondary:return j1.TopologyType.ReplicaSetNoPrimary;default:return j1.TopologyType.Unknown}}function UN(F,A,D=null,Z=null,J=null){let X=(Y,B,H)=>{return`primary marked stale due to electionId/setVersion mismatch: server setVersion: ${Y.setVersion}, server electionId: ${Y.electionId}, topology setVersion: ${B}, topology electionId: ${H}`};if(D=D||A.setName,D!==A.setName)return F.delete(A.address),[j9(F),D,Z,J];if(A.maxWireVersion>=17){let Y=GB.compareObjectId(J,A.electionId),B=Y===0,H=Y===-1,q=(Z??-1)<=(A.setVersion??-1);if(H||B&&q)J=A.electionId,Z=A.setVersion;else return F.set(A.address,new g4.ServerDescription(A.address,void 0,{error:new nD.MongoStalePrimaryError(X(A,Z,J))})),[j9(F),D,Z,J]}else{let Y=A.electionId?A.electionId:null;if(A.setVersion&&Y){if(Z&&J){if(Z>A.setVersion||GB.compareObjectId(J,Y)>0)return F.set(A.address,new g4.ServerDescription(A.address,void 0,{error:new nD.MongoStalePrimaryError(X(A,Z,J))})),[j9(F),D,Z,J]}J=A.electionId}if(A.setVersion!=null&&(Z==null||A.setVersion>Z))Z=A.setVersion}for(let[Y,B]of F)if(B.type===j1.ServerType.RSPrimary&&B.address!==A.address){F.set(Y,new g4.ServerDescription(B.address,void 0,{error:new nD.MongoStalePrimaryError("primary marked stale due to discovery of newer primary")}));break}A.allHosts.forEach((Y)=>{if(!F.has(Y))F.set(Y,new g4.ServerDescription(Y))});let $=Array.from(F.keys()),G=A.allHosts;return $.filter((Y)=>G.indexOf(Y)===-1).forEach((Y)=>{F.delete(Y)}),[j9(F),D,Z,J]}function f71(F,A,D=null){if(D==null)throw new nD.MongoRuntimeError('Argument "setName" is required if connected to a replica set');if(D!==A.setName||A.me&&A.address!==A.me)F.delete(A.address);return j9(F)}function y71(F,A,D=null){let Z=j1.TopologyType.ReplicaSetNoPrimary;if(D=D??A.setName,D!==A.setName)return F.delete(A.address),[Z,D];if(A.allHosts.forEach((J)=>{if(!F.has(J))F.set(J,new g4.ServerDescription(J))}),A.me&&A.address!==A.me)F.delete(A.address);return[Z,D]}function j9(F){for(let A of F.values())if(A.type===j1.ServerType.RSPrimary)return j1.TopologyType.ReplicaSetWithPrimary;return j1.TopologyType.ReplicaSetNoPrimary}});var qB=E((RN)=>{Object.defineProperty(RN,"__esModule",{value:!0});RN.getReadPreference=v71;RN.isSharded=m71;var b71=n(),HB=y0(),LN=$6(),h71=BB();function v71(F){let A=F?.readPreference??HB.ReadPreference.primary;if(typeof A==="string")A=HB.ReadPreference.fromString(A);if(!(A instanceof HB.ReadPreference))throw new b71.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance');return A}function m71(F){if(F==null)return!1;if(F.description&&F.description.type===LN.ServerType.Mongos)return!0;if(F.description&&F.description instanceof h71.TopologyDescription)return Array.from(F.description.servers.values()).some((D)=>D.type===LN.ServerType.Mongos);return!1}});var WB=E((IN)=>{Object.defineProperty(IN,"__esModule",{value:!0});IN.Transaction=IN.TxnState=void 0;IN.isTransactionCommand=r71;var wN=n(),l71=M6(),p71=y0(),i71=Y2();IN.TxnState=Object.freeze({NO_TRANSACTION:"NO_TRANSACTION",STARTING_TRANSACTION:"STARTING_TRANSACTION",TRANSACTION_IN_PROGRESS:"TRANSACTION_IN_PROGRESS",TRANSACTION_COMMITTED:"TRANSACTION_COMMITTED",TRANSACTION_COMMITTED_EMPTY:"TRANSACTION_COMMITTED_EMPTY",TRANSACTION_ABORTED:"TRANSACTION_ABORTED"});var a71={[IN.TxnState.NO_TRANSACTION]:[IN.TxnState.NO_TRANSACTION,IN.TxnState.STARTING_TRANSACTION],[IN.TxnState.STARTING_TRANSACTION]:[IN.TxnState.TRANSACTION_IN_PROGRESS,IN.TxnState.TRANSACTION_COMMITTED,IN.TxnState.TRANSACTION_COMMITTED_EMPTY,IN.TxnState.TRANSACTION_ABORTED],[IN.TxnState.TRANSACTION_IN_PROGRESS]:[IN.TxnState.TRANSACTION_IN_PROGRESS,IN.TxnState.TRANSACTION_COMMITTED,IN.TxnState.TRANSACTION_ABORTED],[IN.TxnState.TRANSACTION_COMMITTED]:[IN.TxnState.TRANSACTION_COMMITTED,IN.TxnState.TRANSACTION_COMMITTED_EMPTY,IN.TxnState.STARTING_TRANSACTION,IN.TxnState.NO_TRANSACTION],[IN.TxnState.TRANSACTION_ABORTED]:[IN.TxnState.STARTING_TRANSACTION,IN.TxnState.NO_TRANSACTION],[IN.TxnState.TRANSACTION_COMMITTED_EMPTY]:[IN.TxnState.TRANSACTION_COMMITTED_EMPTY,IN.TxnState.NO_TRANSACTION]},n71=new Set([IN.TxnState.STARTING_TRANSACTION,IN.TxnState.TRANSACTION_IN_PROGRESS]),s71=new Set([IN.TxnState.TRANSACTION_COMMITTED,IN.TxnState.TRANSACTION_COMMITTED_EMPTY,IN.TxnState.TRANSACTION_ABORTED]);class PN{constructor(F){F=F??{},this.state=IN.TxnState.NO_TRANSACTION,this.options={};let A=i71.WriteConcern.fromOptions(F);if(A){if(A.w===0)throw new wN.MongoTransactionError("Transactions do not support unacknowledged write concern");this.options.writeConcern=A}if(F.readConcern)this.options.readConcern=l71.ReadConcern.fromOptions(F);if(F.readPreference)this.options.readPreference=p71.ReadPreference.fromOptions(F);if(F.maxCommitTimeMS)this.options.maxTimeMS=F.maxCommitTimeMS;this._pinnedServer=void 0,this._recoveryToken=void 0}get server(){return this._pinnedServer}get recoveryToken(){return this._recoveryToken}get isPinned(){return!!this.server}get isStarting(){return this.state===IN.TxnState.STARTING_TRANSACTION}get isActive(){return n71.has(this.state)}get isCommitted(){return s71.has(this.state)}transition(F){let A=a71[this.state];if(A&&A.includes(F)){if(this.state=F,this.state===IN.TxnState.NO_TRANSACTION||this.state===IN.TxnState.STARTING_TRANSACTION||this.state===IN.TxnState.TRANSACTION_ABORTED)this.unpinServer();return}throw new wN.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${F}]`)}pinServer(F){if(this.isActive)this._pinnedServer=F}unpinServer(){this._pinnedServer=void 0}}IN.Transaction=PN;function r71(F){return!!(F.commitTransaction||F.abortTransaction)}});var a7=E((ON)=>{Object.defineProperty(ON,"__esModule",{value:!0});ON.ServerSessionPool=ON.ServerSession=ON.ClientSession=void 0;ON.maybeClearPinnedConnection=oD;ON.applySession=J81;ON.updateSessionFromResponse=X81;var tD=k1(),eD=YB(),o71=qB(),TN=N0(),H1=n(),e71=G6(),rD=H2(),CB=k7(),F81=M6(),QB=y0(),A81=S7(),EB=$6(),KB=G2(),l1=WB(),u2=e(),i7=Y2(),D81=8;class FZ extends e71.TypedEventEmitter{constructor(F,A,D,Z){super();if(this.timeoutContext=null,this.on("error",u2.noop),F==null)throw new H1.MongoRuntimeError("ClientSession requires a MongoClient");if(A==null||!(A instanceof UB))throw new H1.MongoRuntimeError("ClientSession requires a ServerSessionPool");if(D=D??{},this.snapshotEnabled=D.snapshot===!0,D.causalConsistency===!0&&this.snapshotEnabled)throw new H1.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive');this.client=F,this.sessionPool=A,this.hasEnded=!1,this.clientOptions=Z,this.timeoutMS=D.defaultTimeoutMS??F.s.options?.timeoutMS,this.explicit=!!D.explicit,this._serverSession=this.explicit?this.sessionPool.acquire():null,this.txnNumberIncrement=0;let J=this.explicit&&D.snapshot!==!0;this.supports={causalConsistency:D.causalConsistency??J},this.clusterTime=D.initialClusterTime,this.operationTime=void 0,this.owner=D.owner,this.defaultTransactionOptions={...D.defaultTransactionOptions},this.transaction=new l1.Transaction}get id(){return this.serverSession?.id}get serverSession(){let F=this._serverSession;if(F==null){if(this.explicit)throw new H1.MongoRuntimeError("Unexpected null serverSession for an explicit session");if(this.hasEnded)throw new H1.MongoRuntimeError("Unexpected null serverSession for an ended implicit session");F=this.sessionPool.acquire(),this._serverSession=F}return F}get loadBalanced(){return this.client.topology?.description.type===EB.TopologyType.LoadBalanced}pin(F){if(this.pinnedConnection)throw TypeError("Cannot pin multiple connections to the same session");this.pinnedConnection=F,F.emit(TN.PINNED,this.inTransaction()?eD.ConnectionPoolMetrics.TXN:eD.ConnectionPoolMetrics.CURSOR)}unpin(F){if(this.loadBalanced)return oD(this,F);this.transaction.unpinServer()}get isPinned(){return this.loadBalanced?!!this.pinnedConnection:this.transaction.isPinned}async endSession(F){try{if(this.inTransaction())await this.abortTransaction({...F,throwTimeout:!0})}catch(A){if(A.name==="MongoOperationTimeoutError")throw A;u2.squashError(A)}finally{if(!this.hasEnded){let A=this.serverSession;if(A!=null)this.sessionPool.release(A),this._serverSession=new DZ(A);this.hasEnded=!0,this.emit("ended",this)}oD(this,{force:!0,...F})}}async asyncDispose(){await this.endSession({force:!0})}advanceOperationTime(F){if(this.operationTime==null){this.operationTime=F;return}if(F.greaterThan(this.operationTime))this.operationTime=F}advanceClusterTime(F){if(!F||typeof F!=="object")throw new H1.MongoInvalidArgumentError("input cluster time must be an object");if(!F.clusterTime||F.clusterTime._bsontype!=="Timestamp")throw new H1.MongoInvalidArgumentError('input cluster time "clusterTime" property must be a valid BSON Timestamp');if(!F.signature||F.signature.hash?._bsontype!=="Binary"||typeof F.signature.keyId!=="bigint"&&typeof F.signature.keyId!=="number"&&F.signature.keyId?._bsontype!=="Long")throw new H1.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId');EB._advanceClusterTime(this,F)}equals(F){if(!(F instanceof FZ))return!1;if(this.id==null||F.id==null)return!1;return u2.ByteUtils.equals(this.id.id.buffer,F.id.id.buffer)}incrementTransactionNumber(){this.txnNumberIncrement+=1}inTransaction(){return this.transaction.isActive}startTransaction(F){if(this.snapshotEnabled)throw new H1.MongoCompatibilityError("Transactions are not supported in snapshot sessions");if(this.inTransaction())throw new H1.MongoTransactionError("Transaction already in progress");if(this.isPinned&&this.transaction.isCommitted)this.unpin();let A=u2.maxWireVersion(this.client.topology);if(o71.isSharded(this.client.topology)&&A!=null&&A<D81)throw new H1.MongoCompatibilityError("Transactions are not supported on sharded clusters in MongoDB < 4.2.");this.commitAttempted=!1,this.incrementTransactionNumber(),this.transaction=new l1.Transaction({readConcern:F?.readConcern??this.defaultTransactionOptions.readConcern??this.clientOptions?.readConcern,writeConcern:F?.writeConcern??this.defaultTransactionOptions.writeConcern??this.clientOptions?.writeConcern,readPreference:F?.readPreference??this.defaultTransactionOptions.readPreference??this.clientOptions?.readPreference,maxCommitTimeMS:F?.maxCommitTimeMS??this.defaultTransactionOptions.maxCommitTimeMS}),this.transaction.transition(l1.TxnState.STARTING_TRANSACTION)}async commitTransaction(F){if(this.transaction.state===l1.TxnState.NO_TRANSACTION)throw new H1.MongoTransactionError("No transaction started");if(this.transaction.state===l1.TxnState.STARTING_TRANSACTION||this.transaction.state===l1.TxnState.TRANSACTION_COMMITTED_EMPTY){this.transaction.transition(l1.TxnState.TRANSACTION_COMMITTED_EMPTY);return}if(this.transaction.state===l1.TxnState.TRANSACTION_ABORTED)throw new H1.MongoTransactionError("Cannot call commitTransaction after calling abortTransaction");let A={commitTransaction:1},D=typeof F?.timeoutMS==="number"?F.timeoutMS:typeof this.timeoutMS==="number"?this.timeoutMS:null,Z=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(Z!=null)if(D==null&&this.timeoutContext==null)i7.WriteConcern.apply(A,{wtimeoutMS:1e4,w:"majority",...Z});else{let $=Object.keys(Z);if($.length>2||!$.includes("wtimeoutMS")&&!$.includes("wTimeoutMS"))i7.WriteConcern.apply(A,{...Z,wtimeoutMS:void 0})}if(this.transaction.state===l1.TxnState.TRANSACTION_COMMITTED||this.commitAttempted)if(D==null&&this.timeoutContext==null)i7.WriteConcern.apply(A,{wtimeoutMS:1e4,...Z,w:"majority"});else i7.WriteConcern.apply(A,{w:"majority",...Z,wtimeoutMS:void 0});if(typeof this.transaction.options.maxTimeMS==="number")A.maxTimeMS=this.transaction.options.maxTimeMS;if(this.transaction.recoveryToken)A.recoveryToken=this.transaction.recoveryToken;let J=new CB.RunAdminCommandOperation(A,{session:this,readPreference:QB.ReadPreference.primary,bypassPinningCheck:!0}),X=this.timeoutContext??(typeof D==="number"?KB.TimeoutContext.create({serverSelectionTimeoutMS:this.clientOptions.serverSelectionTimeoutMS,socketTimeoutMS:this.clientOptions.socketTimeoutMS,timeoutMS:D}):null);try{await rD.executeOperation(this.client,J,X),this.commitAttempted=void 0;return}catch($){if(this.commitAttempted=!0,$ instanceof H1.MongoError&&H1.isRetryableWriteError($)){i7.WriteConcern.apply(A,{wtimeoutMS:1e4,...Z,w:"majority"}),this.unpin({force:!0});try{await rD.executeOperation(this.client,new CB.RunAdminCommandOperation(A,{session:this,readPreference:QB.ReadPreference.primary,bypassPinningCheck:!0}),X);return}catch(G){if(jN(G))G.addErrorLabel(H1.MongoErrorLabel.UnknownTransactionCommitResult);if(NN(G))this.unpin({error:G});throw G}}if(jN($))$.addErrorLabel(H1.MongoErrorLabel.UnknownTransactionCommitResult);if(NN($))this.unpin({error:$});throw $}finally{this.transaction.transition(l1.TxnState.TRANSACTION_COMMITTED)}}async abortTransaction(F){if(this.transaction.state===l1.TxnState.NO_TRANSACTION)throw new H1.MongoTransactionError("No transaction started");if(this.transaction.state===l1.TxnState.STARTING_TRANSACTION){this.transaction.transition(l1.TxnState.TRANSACTION_ABORTED);return}if(this.transaction.state===l1.TxnState.TRANSACTION_ABORTED)throw new H1.MongoTransactionError("Cannot call abortTransaction twice");if(this.transaction.state===l1.TxnState.TRANSACTION_COMMITTED||this.transaction.state===l1.TxnState.TRANSACTION_COMMITTED_EMPTY)throw new H1.MongoTransactionError("Cannot call abortTransaction after calling commitTransaction");let A={abortTransaction:1},D=typeof F?.timeoutMS==="number"?F.timeoutMS:this.timeoutContext?.csotEnabled()?this.timeoutContext.timeoutMS:typeof this.timeoutMS==="number"?this.timeoutMS:null,Z=D!=null?KB.TimeoutContext.create({timeoutMS:D,serverSelectionTimeoutMS:this.clientOptions.serverSelectionTimeoutMS,socketTimeoutMS:this.clientOptions.socketTimeoutMS}):null,J=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(J!=null&&D==null)i7.WriteConcern.apply(A,{wtimeoutMS:1e4,w:"majority",...J});if(this.transaction.recoveryToken)A.recoveryToken=this.transaction.recoveryToken;let X=new CB.RunAdminCommandOperation(A,{session:this,readPreference:QB.ReadPreference.primary,bypassPinningCheck:!0});try{await rD.executeOperation(this.client,X,Z),this.unpin();return}catch($){if(this.unpin(),$.name==="MongoRuntimeError")throw $;if(F?.throwTimeout&&$.name==="MongoOperationTimeoutError")throw $;if($ instanceof H1.MongoError&&H1.isRetryableWriteError($))try{await rD.executeOperation(this.client,X,Z);return}catch(G){if(G.name==="MongoRuntimeError")throw G;if(F?.throwTimeout&&G.name==="MongoOperationTimeoutError")throw G}}finally{if(this.transaction.transition(l1.TxnState.TRANSACTION_ABORTED),this.loadBalanced)oD(this,{force:!1})}}toBSON(){throw new H1.MongoRuntimeError("ClientSession cannot be serialized to BSON.")}async withTransaction(F,A){let Z=A?.timeoutMS??this.timeoutMS??null;this.timeoutContext=Z!=null?KB.TimeoutContext.create({timeoutMS:Z,serverSelectionTimeoutMS:this.clientOptions.serverSelectionTimeoutMS,socketTimeoutMS:this.clientOptions.socketTimeoutMS}):null;let J=this.timeoutContext?.csotEnabled()?this.timeoutContext.start:u2.now(),X=!1,$;try{while(!X){this.startTransaction(A);try{let G=F(this);if(!u2.isPromiseLike(G))throw new H1.MongoInvalidArgumentError("Function provided to `withTransaction` must return a Promise");if($=await G,this.transaction.state===l1.TxnState.NO_TRANSACTION||this.transaction.state===l1.TxnState.TRANSACTION_COMMITTED||this.transaction.state===l1.TxnState.TRANSACTION_ABORTED)return $}catch(G){if(!(G instanceof H1.MongoError)||G instanceof H1.MongoInvalidArgumentError)throw await this.abortTransaction(),G;if(this.transaction.state===l1.TxnState.STARTING_TRANSACTION||this.transaction.state===l1.TxnState.TRANSACTION_IN_PROGRESS)await this.abortTransaction();if(G.hasErrorLabel(H1.MongoErrorLabel.TransientTransactionError)&&(this.timeoutContext!=null||u2.now()-J<120000))continue;throw G}while(!X)try{await this.commitTransaction(),X=!0}catch(G){if(!AZ(G)&&G.hasErrorLabel(H1.MongoErrorLabel.UnknownTransactionCommitResult)&&(this.timeoutContext!=null||u2.now()-J<120000))continue;if(G.hasErrorLabel(H1.MongoErrorLabel.TransientTransactionError)&&(this.timeoutContext!=null||u2.now()-J<120000))break;throw G}}return $}finally{this.timeoutContext=null}}}ON.ClientSession=FZ;A81.configureResourceManagement(FZ.prototype);var Z81=new Set(["CannotSatisfyWriteConcern","UnknownReplWriteConcern","UnsatisfiableWriteConcern"]);function NN(F){if(F instanceof H1.MongoError){if(H1.isRetryableWriteError(F)||F instanceof H1.MongoWriteConcernError||AZ(F)){if(kN(F))return!0}else if(F.hasErrorLabel(H1.MongoErrorLabel.TransientTransactionError))return!0}return!1}function jN(F){let A=H1.isRetryableWriteError(F);return A||=F instanceof H1.MongoWriteConcernError,A||=AZ(F),A&&=kN(F),A}function kN(F){let A=F instanceof H1.MongoServerError&&F.codeName&&Z81.has(F.codeName);return AZ(F)||!A&&F.code!==H1.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern&&F.code!==H1.MONGODB_ERROR_CODES.UnknownReplWriteConcern}function oD(F,A){let D=F.pinnedConnection,Z=A?.error;if(F.inTransaction()&&Z&&Z instanceof H1.MongoError&&Z.hasErrorLabel(H1.MongoErrorLabel.TransientTransactionError))return;let J=F.client.topology;if(D&&J!=null){let $=Array.from(J.s.servers.values())[0];if(A?.error==null||A?.force){if($.pool.checkIn(D),F.pinnedConnection=void 0,D.emit(TN.UNPINNED,F.transaction.state!==l1.TxnState.NO_TRANSACTION?eD.ConnectionPoolMetrics.TXN:eD.ConnectionPoolMetrics.CURSOR),A?.forceClear)$.pool.clear({serviceId:D.serviceId})}}}function AZ(F){if(F==null||!(F instanceof H1.MongoServerError))return!1;return F.code===H1.MONGODB_ERROR_CODES.MaxTimeMSExpired||F.writeConcernError?.code===H1.MONGODB_ERROR_CODES.MaxTimeMSExpired}class DZ{constructor(F){if(F!=null){let A=Buffer.allocUnsafe(16);A.set(F.id.id.buffer),this.id={id:new tD.Binary(A,F.id.id.sub_type)},this.lastUse=F.lastUse,this.txnNumber=F.txnNumber,this.isDirty=F.isDirty;return}this.id={id:new tD.Binary(u2.uuidV4(),tD.Binary.SUBTYPE_UUID)},this.lastUse=u2.now(),this.txnNumber=0,this.isDirty=!1}hasTimedOut(F){return Math.round(u2.calculateDurationInMs(this.lastUse)%86400000%3600000/60000)>F-1}}ON.ServerSession=DZ;class UB{constructor(F){if(F==null)throw new H1.MongoRuntimeError("ServerSessionPool requires a MongoClient");this.client=F,this.sessions=new u2.List}acquire(){let F=this.client.topology?.logicalSessionTimeoutMinutes??10,A=null;while(this.sessions.length>0){let D=this.sessions.shift();if(D!=null&&(!!this.client.topology?.loadBalanced||!D.hasTimedOut(F))){A=D;break}}if(A==null)A=new DZ;return A}release(F){let A=this.client.topology?.logicalSessionTimeoutMinutes??10;if(this.client.topology?.loadBalanced&&!A)this.sessions.unshift(F);if(!A)return;if(this.sessions.prune((D)=>D.hasTimedOut(A)),!F.hasTimedOut(A)){if(F.isDirty)return;this.sessions.unshift(F)}}}ON.ServerSessionPool=UB;function J81(F,A,D){if(F.hasEnded)return new H1.MongoExpiredSessionError;let Z=F.serverSession;if(Z==null)return new H1.MongoRuntimeError("Unable to acquire server session");if(D.writeConcern?.w===0){if(F&&F.explicit)return new H1.MongoAPIError("Cannot have explicit session with unacknowledged writes");return}Z.lastUse=u2.now(),A.lsid=Z.id;let J=F.inTransaction()||l1.isTransactionCommand(A);if(!!D.willRetryWrite||J)Z.txnNumber+=F.txnNumberIncrement,F.txnNumberIncrement=0,A.txnNumber=tD.Long.fromNumber(Z.txnNumber);if(!J){if(F.transaction.state!==l1.TxnState.NO_TRANSACTION)F.transaction.transition(l1.TxnState.NO_TRANSACTION);if(F.supports.causalConsistency&&F.operationTime&&u2.commandSupportsReadConcern(A))A.readConcern=A.readConcern||{},Object.assign(A.readConcern,{afterClusterTime:F.operationTime});else if(F.snapshotEnabled){if(A.readConcern=A.readConcern||{level:F81.ReadConcernLevel.snapshot},F.snapshotTime!=null)Object.assign(A.readConcern,{atClusterTime:F.snapshotTime})}return}if(A.autocommit=!1,F.transaction.state===l1.TxnState.STARTING_TRANSACTION){F.transaction.transition(l1.TxnState.TRANSACTION_IN_PROGRESS),A.startTransaction=!0;let $=F.transaction.options.readConcern||F?.clientOptions?.readConcern;if($)A.readConcern=$;if(F.supports.causalConsistency&&F.operationTime)A.readConcern=A.readConcern||{},Object.assign(A.readConcern,{afterClusterTime:F.operationTime})}return}function X81(F,A){if(A.$clusterTime)EB._advanceClusterTime(F,A.$clusterTime);if(A.operationTime&&F&&F.supports.causalConsistency)F.advanceOperationTime(A.operationTime);if(A.recoveryToken&&F&&F.inTransaction())F.transaction._recoveryToken=A.recoveryToken;if(F?.snapshotEnabled&&F.snapshotTime==null){let D=A.atClusterTime;if(D)F.snapshotTime=D}}});var PB=E((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});bN.SENSITIVE_COMMANDS=bN.CommandFailedEvent=bN.CommandSucceededEvent=bN.CommandStartedEvent=void 0;var e5=N0(),xN=e(),zB=d5();class gN{constructor(F,A,D){this.name=e5.COMMAND_STARTED;let Z=RB(A),J=VB(Z),{address:X,connectionId:$,serviceId:G}=wB(F);if(bN.SENSITIVE_COMMANDS.has(J))this.commandObj={},this.commandObj[J]=!0;this.address=X,this.connectionId=$,this.serviceId=G,this.requestId=A.requestId,this.databaseName=A.databaseName,this.commandName=J,this.command=LB(J,Z,Z),this.serverConnectionId=D}get hasServiceId(){return!!this.serviceId}}bN.CommandStartedEvent=gN;class fN{constructor(F,A,D,Z,J){this.name=e5.COMMAND_SUCCEEDED;let X=RB(A),$=VB(X),{address:G,connectionId:Y,serviceId:B}=wB(F);this.address=G,this.connectionId=Y,this.serviceId=B,this.requestId=A.requestId,this.commandName=$,this.duration=xN.calculateDurationInMs(Z),this.reply=LB($,X,C81(D)),this.serverConnectionId=J}get hasServiceId(){return!!this.serviceId}}bN.CommandSucceededEvent=fN;class yN{constructor(F,A,D,Z,J){this.name=e5.COMMAND_FAILED;let X=RB(A),$=VB(X),{address:G,connectionId:Y,serviceId:B}=wB(F);this.address=G,this.connectionId=Y,this.serviceId=B,this.requestId=A.requestId,this.commandName=$,this.duration=xN.calculateDurationInMs(Z),this.failure=LB($,X,D),this.serverConnectionId=J}get hasServiceId(){return!!this.serviceId}}bN.CommandFailedEvent=yN;bN.SENSITIVE_COMMANDS=new Set(["authenticate","saslStart","saslContinue","getnonce","createUser","updateUser","copydbgetnonce","copydbsaslstart","copydb"]);var q81=new Set(["hello",e5.LEGACY_HELLO_COMMAND,e5.LEGACY_HELLO_COMMAND_CAMEL_CASE]),VB=(F)=>Object.keys(F)[0],W81=(F)=>F.ns.split(".")[1],LB=(F,A,D)=>bN.SENSITIVE_COMMANDS.has(F)||q81.has(F)&&A.speculativeAuthenticate?{}:D,_N={$query:"filter",$orderby:"sort",$hint:"hint",$comment:"comment",$maxScan:"maxScan",$max:"max",$min:"min",$returnKey:"returnKey",$showDiskLoc:"showRecordId",$maxTimeMS:"maxTimeMS",$snapshot:"snapshot"},uN={numberToSkip:"skip",numberToReturn:"batchSize",returnFieldSelector:"projection"};function RB(F){if(F instanceof zB.OpMsgRequest){let Z={...F.command};if(Z.ops instanceof zB.DocumentSequence)Z.ops=Z.ops.documents;if(Z.nsInfo instanceof zB.DocumentSequence)Z.nsInfo=Z.nsInfo.documents;return Z}if(F.query?.$query){let Z;if(F.ns==="admin.$cmd")Z=Object.assign({},F.query.$query);else Z={find:W81(F)},Object.keys(_N).forEach((J)=>{if(F.query[J]!=null)Z[_N[J]]={...F.query[J]}});return Object.keys(uN).forEach((J)=>{let X=J;if(F[X]!=null)Z[uN[X]]=F[X]}),Z}let A={},D={...F};if(F.query)A={...F.query},D.query=A;return F.query?A:D}function C81(F){if(!F)return F;return F.result?F.result:F}function wB(F){let A;if("id"in F)A=F.id;return{address:F.address,serviceId:F.serviceId,connectionId:A}}});var dN=E((vN)=>{Object.defineProperty(vN,"__esModule",{value:!0});vN.StreamDescription=void 0;var U81=k1(),z81=$6(),V81=t5(),L81=["minWireVersion","maxWireVersion","maxBsonObjectSize","maxMessageSizeBytes","maxWriteBatchSize","logicalSessionTimeoutMinutes"];class hN{constructor(F,A){this.hello=null,this.address=F,this.type=z81.ServerType.Unknown,this.minWireVersion=void 0,this.maxWireVersion=void 0,this.maxBsonObjectSize=16777216,this.maxMessageSizeBytes=48000000,this.maxWriteBatchSize=1e5,this.logicalSessionTimeoutMinutes=A?.logicalSessionTimeoutMinutes,this.loadBalanced=!!A?.loadBalanced,this.compressors=A&&A.compressors&&Array.isArray(A.compressors)?A.compressors:[],this.serverConnectionId=null}receiveResponse(F){if(F==null)return;if(this.hello=F,this.type=V81.parseServerType(F),"connectionId"in F)this.serverConnectionId=this.parseServerConnectionID(F.connectionId);else this.serverConnectionId=null;for(let A of L81){if(F[A]!=null)this[A]=F[A];if("__nodejs_mock_server__"in F)this.__nodejs_mock_server__=F.__nodejs_mock_server__}if(F.compression)this.compressor=this.compressors.filter((A)=>F.compression?.includes(A))[0]}parseServerConnectionID(F){return U81.Long.isLong(F)?F.toBigInt():BigInt(F)}}vN.StreamDescription=hN});var lN=E((cN)=>{Object.defineProperty(cN,"__esModule",{value:!0});cN.onData=R81;var FF=e();function R81(F,{timeoutContext:A,signal:D}){D?.throwIfAborted();let Z=new FF.List,J=new FF.List,X=null,$=!1,G={next(){let C=Z.shift();if(C!=null)return Promise.resolve({value:C,done:!1});if(X!=null){let z=Promise.reject(X);return X=null,z}if($)return W();let{promise:Q,resolve:K,reject:U}=FF.promiseWithResolvers();return J.push({resolve:K,reject:U}),Q},return(){return W()},throw(C){return q(C),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this}};F.on("data",H),F.on("error",q);let Y=FF.addAbortListener(D,function(){q(this.reason)}),B=A?.timeoutForSocketRead;return B?.throwIfExpired(),B?.then(void 0,q),G;function H(C){let Q=J.shift();if(Q!=null)Q.resolve({value:C,done:!1});else Z.push(C)}function q(C){let Q=J.shift();if(Q!=null)Q.reject(C);else X=C;W()}function W(){F.off("data",H),F.off("error",q),Y?.[FF.kDispose](),$=!0,B?.clear();let C={value:void 0,done:$};for(let Q of J)Q.resolve(C);return Promise.resolve(C)}}});var XZ=E((rN)=>{Object.defineProperty(rN,"__esModule",{value:!0});rN.CryptoConnection=rN.SizedMessageTransform=rN.Connection=void 0;rN.hasSessionSupport=S81;var P81=i("node:stream"),nN=i("node:timers"),I81=k1(),f4=N0(),z0=n(),pN=R4(),M81=G6(),N81=y0(),j81=$6(),iN=a7(),aN=G2(),W6=e(),IB=PB(),JZ=d5(),T81=dN(),k81=c5(),O81=lN(),AF=t6(),MB=qB();function S81(F){return F.description.logicalSessionTimeoutMinutes!=null}function _81(F,A){if(A.proxyHost)return A.hostAddress.toString();let{remoteAddress:D,remotePort:Z}=F;if(typeof D==="string"&&typeof Z==="number")return W6.HostAddress.fromHostPort(D,Z).toString();return W6.uuidV4().toString("hex")}class s0 extends M81.TypedEventEmitter{constructor(F,A){super();this.lastHelloMS=-1,this.helloOk=!1,this.delayedTimeoutId=null,this.closed=!1,this.clusterTime=null,this.error=null,this.dataEvents=null,this.on("error",W6.noop),this.socket=F,this.id=A.id,this.address=_81(F,A),this.socketTimeoutMS=A.socketTimeoutMS??0,this.monitorCommands=A.monitorCommands,this.serverApi=A.serverApi,this.mongoLogger=A.mongoLogger,this.established=!1,this.description=new T81.StreamDescription(this.address,A),this.generation=A.generation,this.lastUseTime=W6.now(),this.messageStream=this.socket.on("error",this.onError.bind(this)).pipe(new NB({connection:this})).on("error",this.onError.bind(this)),this.socket.on("close",this.onClose.bind(this)),this.socket.on("timeout",this.onTimeout.bind(this)),this.messageStream.pause()}get hello(){return this.description.hello}set hello(F){this.description.receiveResponse(F),Object.freeze(this.description)}get serviceId(){return this.hello?.serviceId}get loadBalanced(){return this.description.loadBalanced}get idleTime(){return W6.calculateDurationInMs(this.lastUseTime)}get hasSessionSupport(){return this.description.logicalSessionTimeoutMinutes!=null}get supportsOpMsg(){return this.description!=null&&W6.maxWireVersion(this)>=6&&!this.description.__nodejs_mock_server__}get shouldEmitAndLogCommand(){return(this.monitorCommands||this.established&&!this.authContext?.reauthenticating&&this.mongoLogger?.willLog(pN.MongoLoggableComponent.COMMAND,pN.SeverityLevel.DEBUG))??!1}markAvailable(){this.lastUseTime=W6.now()}onError(F){this.cleanup(F)}onClose(){let F=`connection ${this.id} to ${this.address} closed`;this.cleanup(new z0.MongoNetworkError(F))}onTimeout(){this.delayedTimeoutId=nN.setTimeout(()=>{let F=`connection ${this.id} to ${this.address} timed out`,A=this.hello==null;this.cleanup(new z0.MongoNetworkTimeoutError(F,{beforeHandshake:A}))},1).unref()}destroy(){if(this.closed)return;this.removeAllListeners(s0.PINNED),this.removeAllListeners(s0.UNPINNED);let F=`connection ${this.id} to ${this.address} closed`;this.cleanup(new z0.MongoNetworkError(F))}cleanup(F){if(this.closed)return;this.socket.destroy(),this.error=F,this.dataEvents?.throw(F).then(void 0,W6.squashError),this.closed=!0,this.emit(s0.CLOSE)}prepareCommand(F,A,D){let Z={...A},J=MB.getReadPreference(D),X=D?.session,$=this.clusterTime;if(this.serverApi){let{version:B,strict:H,deprecationErrors:q}=this.serverApi;if(Z.apiVersion=B,H!=null)Z.apiStrict=H;if(q!=null)Z.apiDeprecationErrors=q}if(this.hasSessionSupport&&X){if(X.clusterTime&&$&&X.clusterTime.clusterTime.greaterThan($.clusterTime))$=X.clusterTime;let B=iN.applySession(X,Z,D);if(B)throw B}else if(X?.explicit)throw new z0.MongoCompatibilityError("Current topology does not support sessions");if($)Z.$clusterTime=$;if(this.description.type!==j81.ServerType.Standalone){if(!MB.isSharded(this)&&!this.description.loadBalanced&&this.supportsOpMsg&&D.directConnection===!0&&J?.mode==="primary")Z.$readPreference=N81.ReadPreference.primaryPreferred.toJSON();else if(MB.isSharded(this)&&!this.supportsOpMsg&&J?.mode!=="primary")Z={$query:Z,$readPreference:J.toJSON()};else if(J?.mode!=="primary")Z.$readPreference=J.toJSON()}let G={numberToSkip:0,numberToReturn:-1,checkKeys:!1,secondaryOk:J.secondaryOk(),...D};return D.timeoutContext?.addMaxTimeMSToCommand(Z,D),this.supportsOpMsg?new JZ.OpMsgRequest(F,Z,G):new JZ.OpQueryRequest(F,Z,G)}async*sendWire(F,A,D){this.throwIfAborted();let Z=A.socketTimeoutMS??A?.timeoutContext?.getSocketTimeoutMS()??this.socketTimeoutMS;this.socket.setTimeout(Z);try{if(await this.writeCommand(F,{agreedCompressor:this.description.compressor??"none",zlibCompressionLevel:this.description.zlibCompressionLevel,timeoutContext:A.timeoutContext,signal:A.signal}),A.noResponse||F.moreToCome){yield AF.MongoDBResponse.empty;return}if(this.throwIfAborted(),A.timeoutContext?.csotEnabled()&&A.timeoutContext.minRoundTripTime!=null&&A.timeoutContext.remainingTimeMS<A.timeoutContext.minRoundTripTime)throw new z0.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining");for await(let J of this.readMany(A)){this.socket.setTimeout(0);let X=J.parse();yield(D??AF.MongoDBResponse).make(X),this.throwIfAborted(),this.socket.setTimeout(Z)}}finally{this.socket.setTimeout(0)}}async*sendCommand(F,A,D,Z){D?.signal?.throwIfAborted();let J=this.prepareCommand(F.db,A,D),X=0;if(this.shouldEmitAndLogCommand)X=W6.now(),this.emitAndLogCommand(this.monitorCommands,s0.COMMAND_STARTED,J.databaseName,this.established,new IB.CommandStartedEvent(this,J,this.description.serverConnectionId));let $=D.documentsReturnedIn==null||!D.raw?D:{...D,raw:!1,fieldsAsRaw:{[D.documentsReturnedIn]:!0}},G=void 0,Y=void 0;try{this.throwIfAborted();for await(G of this.sendWire(J,D,Z)){if(Y=void 0,D.session!=null)iN.updateSessionFromResponse(D.session,G);if(G.$clusterTime)this.clusterTime=G.$clusterTime,this.emit(s0.CLUSTER_TIME_RECEIVED,G.$clusterTime);if(G.ok===0){if(D.timeoutContext?.csotEnabled()&&G.isMaxTimeExpiredError)throw new z0.MongoOperationTimeoutError("Server reported a timeout error",{cause:new z0.MongoServerError(Y??=G.toObject($))});throw new z0.MongoServerError(Y??=G.toObject($))}if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,s0.COMMAND_SUCCEEDED,J.databaseName,this.established,new IB.CommandSucceededEvent(this,J,D.noResponse?void 0:J.moreToCome?{ok:1}:Y??=G.toObject($),X,this.description.serverConnectionId));if(Z==null)yield Y??=G.toObject($);else yield G;this.throwIfAborted()}}catch(B){if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,s0.COMMAND_FAILED,J.databaseName,this.established,new IB.CommandFailedEvent(this,J,B,X,this.description.serverConnectionId));throw B}}async command(F,A,D={},Z){this.throwIfAborted(),D.signal?.throwIfAborted();for await(let J of this.sendCommand(F,A,D,Z)){if(D.timeoutContext?.csotEnabled()){if(AF.MongoDBResponse.is(J)){if(J.isMaxTimeExpiredError)throw new z0.MongoOperationTimeoutError("Server reported a timeout error",{cause:new z0.MongoServerError(J.toObject())})}else if(Array.isArray(J?.writeErrors)&&J.writeErrors.some((X)=>X?.code===z0.MONGODB_ERROR_CODES.MaxTimeMSExpired)||J?.writeConcernError?.code===z0.MONGODB_ERROR_CODES.MaxTimeMSExpired)throw new z0.MongoOperationTimeoutError("Server reported a timeout error",{cause:new z0.MongoServerError(J)})}return J}throw new z0.MongoUnexpectedServerResponseError("Unable to get response from server")}exhaustCommand(F,A,D,Z){(async()=>{this.throwIfAborted();for await(let X of this.sendCommand(F,A,D))Z(void 0,X),this.throwIfAborted();throw new z0.MongoUnexpectedServerResponseError("Server ended moreToCome unexpectedly")})().then(void 0,Z)}throwIfAborted(){if(this.error)throw this.error}async writeCommand(F,A){let D=A.agreedCompressor==="none"||!JZ.OpCompressedRequest.canCompress(F)?F:new JZ.OpCompressedRequest(F,{agreedCompressor:A.agreedCompressor??"none",zlibCompressionLevel:A.zlibCompressionLevel??0}),Z=Buffer.concat(await D.toBin());if(A.timeoutContext?.csotEnabled()){if(A.timeoutContext.minRoundTripTime!=null&&A.timeoutContext.remainingTimeMS<A.timeoutContext.minRoundTripTime)throw new z0.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining")}if(this.socket.write(Z))return;let J=W6.once(this.socket,"drain",A),X=A?.timeoutContext?.timeoutForSocketWrite,$=X?Promise.race([J,X]):J;try{return await $}catch(G){if(aN.TimeoutError.is(G)){let Y=new z0.MongoOperationTimeoutError("Timed out at socket write");throw this.onError(Y),Y}else if(G===A.signal?.reason)this.onError(G);throw G}finally{X?.clear()}}async*readMany(F){try{this.dataEvents=O81.onData(this.messageStream,F),this.messageStream.resume();for await(let A of this.dataEvents){let D=await k81.decompressResponse(A);if(yield D,!D.moreToCome)return}}catch(A){if(aN.TimeoutError.is(A)){let D=new z0.MongoOperationTimeoutError(`Timed out during socket read (${A.duration}ms)`);throw this.dataEvents=null,this.onError(D),D}else if(A===F.signal?.reason)this.onError(A);throw A}finally{this.dataEvents=null,this.messageStream.pause(),this.throwIfAborted()}}}rN.Connection=s0;s0.COMMAND_STARTED=f4.COMMAND_STARTED;s0.COMMAND_SUCCEEDED=f4.COMMAND_SUCCEEDED;s0.COMMAND_FAILED=f4.COMMAND_FAILED;s0.CLUSTER_TIME_RECEIVED=f4.CLUSTER_TIME_RECEIVED;s0.CLOSE=f4.CLOSE;s0.PINNED=f4.PINNED;s0.UNPINNED=f4.UNPINNED;class NB extends P81.Transform{constructor({connection:F}){super({writableObjectMode:!1,readableObjectMode:!0});this.bufferPool=new W6.BufferPool,this.connection=F}_transform(F,A,D){if(this.connection.delayedTimeoutId!=null)nN.clearTimeout(this.connection.delayedTimeoutId),this.connection.delayedTimeoutId=null;this.bufferPool.append(F);let Z=this.bufferPool.getInt32();if(Z==null)return D();if(Z<0)return D(new z0.MongoParseError(`Invalid message size: ${Z}, too small`));if(Z>this.bufferPool.length)return D();let J=this.bufferPool.read(Z);return D(null,J)}}rN.SizedMessageTransform=NB;class sN extends s0{constructor(F,A){super(F,A);this.autoEncrypter=A.autoEncrypter}async command(F,A,D,Z){let{autoEncrypter:J}=this;if(!J)throw new z0.MongoMissingDependencyError("No AutoEncrypter available for encryption",{dependencyName:"n/a"});let X=W6.maxWireVersion(this);if(X===0)return await super.command(F,A,D,Z);if(X<8)throw new z0.MongoCompatibilityError("Auto-encryption requires a minimum MongoDB version of 4.2");let $=A.find||A.findAndModify?A.sort:null,G=A.createIndexes?A.indexes.map((W)=>W.key):null,Y=await J.encrypt(F.toString(),A,D);if($!=null&&(A.find||A.findAndModify))Y.sort=$;if(G!=null&&A.createIndexes)for(let[W,C]of G.entries())Y.indexes[W].key=C;let B=await super.command(F,Y,D,Z??AF.MongoDBResponse),H=await J.decrypt(B.toBytes(),D),q=Z?.make(H)??I81.deserialize(H,D);if(J[f4.kDecorateResult]){if(Z==null)W6.decorateDecryptionResult(q,B.toObject(),!0);else if(q instanceof AF.CursorResponse)q.encryptedResponse=B}return q}}rN.CryptoConnection=sN});var OB=E((Jj)=>{Object.defineProperty(Jj,"__esModule",{value:!0});Jj.LEGAL_TCP_SOCKET_OPTIONS=Jj.LEGAL_TLS_SOCKET_OPTIONS=void 0;Jj.connect=h81;Jj.makeConnection=Aj;Jj.performInitialHandshake=Dj;Jj.prepareHandshakeDocument=Zj;Jj.makeSocket=YZ;var eN=i("node:net"),f81=i("node:tls"),Fj=N0(),y81=F3(),Q0=n(),jB=e(),b81=j4(),$Z=V3(),oN=XZ(),n7=W9();async function h81(F){let A=null;try{let D=await YZ(F);return A=Aj(F,D),await Dj(A,F),A}catch(D){throw A?.destroy(),D}}function Aj(F,A){let D=F.connectionType??oN.Connection;if(F.autoEncrypter)D=oN.CryptoConnection;return new D(A,F)}function v81(F,A){let D=Number(F.maxWireVersion),Z=Number(F.minWireVersion),J=!Number.isNaN(D)&&D>=n7.MIN_SUPPORTED_WIRE_VERSION,X=!Number.isNaN(Z)&&Z<=n7.MAX_SUPPORTED_WIRE_VERSION;if(J){if(X)return null;let G=`Server at ${A.hostAddress} reports minimum wire version ${JSON.stringify(F.minWireVersion)}, but this version of the Node.js Driver requires at most ${n7.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${n7.MAX_SUPPORTED_SERVER_VERSION})`;return new Q0.MongoCompatibilityError(G)}let $=`Server at ${A.hostAddress} reports maximum wire version ${JSON.stringify(F.maxWireVersion)??0}, but this version of the Node.js Driver requires at least ${n7.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${n7.MIN_SUPPORTED_SERVER_VERSION})`;return new Q0.MongoCompatibilityError($)}async function Dj(F,A){let D=A.credentials;if(D){if(D.mechanism!==$Z.AuthMechanism.MONGODB_DEFAULT&&!A.authProviders.getOrCreateProvider(D.mechanism,D.mechanismProperties))throw new Q0.MongoInvalidArgumentError(`AuthMechanism '${D.mechanism}' not supported`)}let Z=new b81.AuthContext(F,D,A);F.authContext=Z;let J=await Zj(Z),X={...A,raw:!1};if(typeof A.connectTimeoutMS==="number")X.socketTimeoutMS=A.connectTimeoutMS;let $=new Date().getTime(),G=await B(J,X);if(!("isWritablePrimary"in G))G.isWritablePrimary=G[Fj.LEGACY_HELLO_COMMAND];if(G.helloOk)F.helloOk=!0;let Y=v81(G,A);if(Y)throw Y;if(A.loadBalanced){if(!G.serviceId)throw new Q0.MongoCompatibilityError("Driver attempted to initialize in load balancing mode, but the server does not support this mode.")}if(F.hello=G,F.lastHelloMS=new Date().getTime()-$,!G.arbiterOnly&&D){Z.response=G;let H=D.resolveAuthMechanism(G),q=A.authProviders.getOrCreateProvider(H.mechanism,H.mechanismProperties);if(!q)throw new Q0.MongoInvalidArgumentError(`No AuthProvider for ${H.mechanism} defined.`);try{await q.auth(Z)}catch(W){if(W instanceof Q0.MongoError){if(W.addErrorLabel(Q0.MongoErrorLabel.HandshakeError),Q0.needsRetryableWriteLabel(W,G.maxWireVersion,F.description.type))W.addErrorLabel(Q0.MongoErrorLabel.RetryableWriteError)}throw W}}F.established=!0;async function B(H,q){try{return await F.command(jB.ns("admin.$cmd"),H,q)}catch(W){if(W instanceof Q0.MongoError)W.addErrorLabel(Q0.MongoErrorLabel.HandshakeError);throw W}}}async function Zj(F){let A=F.options,D=A.compressors?A.compressors:[],{serverApi:Z}=F.connection,J=await A.extendedMetadata,X={[Z?.version||A.loadBalanced===!0?"hello":Fj.LEGACY_HELLO_COMMAND]:1,helloOk:!0,client:J,compression:D};if(A.loadBalanced===!0)X.loadBalanced=!0;let $=F.credentials;if($){if($.mechanism===$Z.AuthMechanism.MONGODB_DEFAULT&&$.username){X.saslSupportedMechs=`${$.source}.${$.username}`;let Y=F.options.authProviders.getOrCreateProvider($Z.AuthMechanism.MONGODB_SCRAM_SHA256,$.mechanismProperties);if(!Y)throw new Q0.MongoInvalidArgumentError(`No AuthProvider for ${$Z.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`);return await Y.prepare(X,F)}let G=F.options.authProviders.getOrCreateProvider($.mechanism,$.mechanismProperties);if(!G)throw new Q0.MongoInvalidArgumentError(`No AuthProvider for ${$.mechanism} defined.`);return await G.prepare(X,F)}return X}Jj.LEGAL_TLS_SOCKET_OPTIONS=["allowPartialTrustChain","ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","ecdhCurve","key","minDHSize","passphrase","pfx","rejectUnauthorized","secureContext","secureProtocol","servername","session"];Jj.LEGAL_TCP_SOCKET_OPTIONS=["autoSelectFamily","autoSelectFamilyAttemptTimeout","family","hints","localAddress","localPort","lookup"];function TB(F){let A=F.hostAddress;if(!A)throw new Q0.MongoInvalidArgumentError('Option "hostAddress" is required');let D={};for(let Z of Jj.LEGAL_TCP_SOCKET_OPTIONS)if(F[Z]!=null)D[Z]=F[Z];if(typeof A.socketPath==="string")return D.path=A.socketPath,D;else if(typeof A.host==="string")return D.host=A.host,D.port=A.port,D;else throw new Q0.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(A)}`)}function m81(F){let A=TB(F);for(let D of Jj.LEGAL_TLS_SOCKET_OPTIONS)if(F[D]!=null)A[D]=F[D];if(F.existingSocket)A.socket=F.existingSocket;if(A.servername==null&&A.host&&!eN.isIP(A.host))A.servername=A.host;return A}async function YZ(F){let A=F.tls??!1,D=F.noDelay??!0,Z=F.connectTimeoutMS??30000,J=F.existingSocket,X;if(F.proxyHost!=null)return await c81({...F,connectTimeoutMS:Z});if(A){let H=f81.connect(m81(F));if(typeof H.disableRenegotiation==="function")H.disableRenegotiation();X=H}else if(J)X=J;else X=eN.createConnection(TB(F));X.setKeepAlive(!0,300000),X.setTimeout(Z),X.setNoDelay(D);let $=null,{promise:G,resolve:Y,reject:B}=jB.promiseWithResolvers();if(J)Y(X);else{let H=performance.now(),q=A?"secureConnect":"connect";if(X.once(q,()=>Y(X)).once("error",(W)=>B(new Q0.MongoNetworkError(Q0.MongoError.buildErrorMessage(W),{cause:W}))).once("timeout",()=>{B(new Q0.MongoNetworkTimeoutError(`Socket '${q}' timed out after ${performance.now()-H|0}ms (connectTimeoutMS: ${Z})`))}).once("close",()=>B(new Q0.MongoNetworkError(`Socket closed after ${performance.now()-H|0} during connection establishment`))),F.cancellationToken!=null)$=()=>B(new Q0.MongoNetworkError(`Socket connection establishment was cancelled after ${performance.now()-H|0}`)),F.cancellationToken.once("cancel",$)}try{return X=await G,X}catch(H){throw X.destroy(),H}finally{if(X.setTimeout(0),$!=null)F.cancellationToken?.removeListener("cancel",$)}}var DF=null;function d81(){if(DF==null){let F=y81.getSocks();if("kModuleError"in F)throw F.kModuleError;DF=F}return DF}async function c81(F){let A=jB.HostAddress.fromHostPort(F.proxyHost??"",F.proxyPort??1080),D=await YZ({...F,hostAddress:A,tls:!1,proxyHost:void 0}),Z=TB(F);if(typeof Z.host!=="string"||typeof Z.port!=="number")throw new Q0.MongoInvalidArgumentError("Can only make Socks5 connections to TCP hosts");DF??=d81();let J;try{J=(await DF.SocksClient.createConnection({existing_socket:D,timeout:F.connectTimeoutMS,command:"connect",destination:{host:Z.host,port:Z.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:F.proxyUsername||void 0,password:F.proxyPassword||void 0}})).socket}catch(X){throw new Q0.MongoNetworkError(Q0.MongoError.buildErrorMessage(X),{cause:X})}return await YZ({...F,existingSocket:J,proxyHost:void 0})}});var GZ=E((Kj)=>{Object.defineProperty(Kj,"__esModule",{value:!0});Kj.ServerHeartbeatFailedEvent=Kj.ServerHeartbeatSucceededEvent=Kj.ServerHeartbeatStartedEvent=Kj.TopologyClosedEvent=Kj.TopologyOpeningEvent=Kj.TopologyDescriptionChangedEvent=Kj.ServerClosedEvent=Kj.ServerOpeningEvent=Kj.ServerDescriptionChangedEvent=void 0;var c3=N0();class $j{constructor(F,A,D,Z){this.name=c3.SERVER_DESCRIPTION_CHANGED,this.topologyId=F,this.address=A,this.previousDescription=D,this.newDescription=Z}}Kj.ServerDescriptionChangedEvent=$j;class Yj{constructor(F,A){this.name=c3.SERVER_OPENING,this.topologyId=F,this.address=A}}Kj.ServerOpeningEvent=Yj;class Gj{constructor(F,A){this.name=c3.SERVER_CLOSED,this.topologyId=F,this.address=A}}Kj.ServerClosedEvent=Gj;class Bj{constructor(F,A,D){this.name=c3.TOPOLOGY_DESCRIPTION_CHANGED,this.topologyId=F,this.previousDescription=A,this.newDescription=D}}Kj.TopologyDescriptionChangedEvent=Bj;class Hj{constructor(F){this.name=c3.TOPOLOGY_OPENING,this.topologyId=F}}Kj.TopologyOpeningEvent=Hj;class qj{constructor(F){this.name=c3.TOPOLOGY_CLOSED,this.topologyId=F}}Kj.TopologyClosedEvent=qj;class Wj{constructor(F,A){this.name=c3.SERVER_HEARTBEAT_STARTED,this.connectionId=F,this.awaited=A}}Kj.ServerHeartbeatStartedEvent=Wj;class Cj{constructor(F,A,D,Z){this.name=c3.SERVER_HEARTBEAT_SUCCEEDED,this.connectionId=F,this.duration=A,this.reply=D??{},this.awaited=Z}}Kj.ServerHeartbeatSucceededEvent=Cj;class Qj{constructor(F,A,D,Z){this.name=c3.SERVER_HEARTBEAT_FAILED,this.connectionId=F,this.duration=A,this.failure=D,this.awaited=Z}}Kj.ServerHeartbeatFailedEvent=Qj});var _B=E((Tj)=>{Object.defineProperty(Tj,"__esModule",{value:!0});Tj.ConnectionPoolClearedEvent=Tj.ConnectionCheckedInEvent=Tj.ConnectionCheckedOutEvent=Tj.ConnectionCheckOutFailedEvent=Tj.ConnectionCheckOutStartedEvent=Tj.ConnectionClosedEvent=Tj.ConnectionReadyEvent=Tj.ConnectionCreatedEvent=Tj.ConnectionPoolClosedEvent=Tj.ConnectionPoolReadyEvent=Tj.ConnectionPoolCreatedEvent=Tj.ConnectionPoolMonitoringEvent=void 0;var Z3=N0(),SB=e();class C6{constructor(F){this.time=new Date,this.address=F.address}}Tj.ConnectionPoolMonitoringEvent=C6;class Uj extends C6{constructor(F){super(F);this.name=Z3.CONNECTION_POOL_CREATED;let{maxConnecting:A,maxPoolSize:D,minPoolSize:Z,maxIdleTimeMS:J,waitQueueTimeoutMS:X}=F.options;this.options={maxConnecting:A,maxPoolSize:D,minPoolSize:Z,maxIdleTimeMS:J,waitQueueTimeoutMS:X}}}Tj.ConnectionPoolCreatedEvent=Uj;class zj extends C6{constructor(F){super(F);this.name=Z3.CONNECTION_POOL_READY}}Tj.ConnectionPoolReadyEvent=zj;class Vj extends C6{constructor(F){super(F);this.name=Z3.CONNECTION_POOL_CLOSED}}Tj.ConnectionPoolClosedEvent=Vj;class Lj extends C6{constructor(F,A){super(F);this.name=Z3.CONNECTION_CREATED,this.connectionId=A.id}}Tj.ConnectionCreatedEvent=Lj;class Rj extends C6{constructor(F,A,D){super(F);this.name=Z3.CONNECTION_READY,this.durationMS=SB.now()-D,this.connectionId=A.id}}Tj.ConnectionReadyEvent=Rj;class wj extends C6{constructor(F,A,D,Z){super(F);this.name=Z3.CONNECTION_CLOSED,this.connectionId=A.id,this.reason=D,this.serviceId=A.serviceId,this.error=Z??null}}Tj.ConnectionClosedEvent=wj;class Pj extends C6{constructor(F){super(F);this.name=Z3.CONNECTION_CHECK_OUT_STARTED}}Tj.ConnectionCheckOutStartedEvent=Pj;class Ij extends C6{constructor(F,A,D,Z){super(F);this.name=Z3.CONNECTION_CHECK_OUT_FAILED,this.durationMS=SB.now()-D,this.reason=A,this.error=Z}}Tj.ConnectionCheckOutFailedEvent=Ij;class Mj extends C6{constructor(F,A,D){super(F);this.name=Z3.CONNECTION_CHECKED_OUT,this.durationMS=SB.now()-D,this.connectionId=A.id}}Tj.ConnectionCheckedOutEvent=Mj;class Nj extends C6{constructor(F,A){super(F);this.name=Z3.CONNECTION_CHECKED_IN,this.connectionId=A.id}}Tj.ConnectionCheckedInEvent=Nj;class jj extends C6{constructor(F,A={}){super(F);this.name=Z3.CONNECTION_POOL_CLEARED,this.serviceId=A.serviceId,this.interruptInUseConnections=A.interruptInUseConnections}}Tj.ConnectionPoolClearedEvent=jj});var xB=E((uj)=>{Object.defineProperty(uj,"__esModule",{value:!0});uj.WaitQueueTimeoutError=uj.PoolClearedOnNetworkError=uj.PoolClearedError=uj.PoolClosedError=void 0;var BZ=n();class Oj extends BZ.MongoDriverError{constructor(F){super("Attempted to check out a connection from closed connection pool");this.address=F.address}get name(){return"MongoPoolClosedError"}}uj.PoolClosedError=Oj;class uB extends BZ.MongoNetworkError{constructor(F,A){let D=A?A:`Connection pool for ${F.address} was cleared because another operation failed with: "${F.serverError?.message}"`;super(D,F.serverError?{cause:F.serverError}:void 0);this.address=F.address,this.addErrorLabel(BZ.MongoErrorLabel.PoolRequstedRetry)}get name(){return"MongoPoolClearedError"}}uj.PoolClearedError=uB;class Sj extends uB{constructor(F){super(F,`Connection to ${F.address} interrupted due to server monitor timeout`)}get name(){return"PoolClearedOnNetworkError"}}uj.PoolClearedOnNetworkError=Sj;class _j extends BZ.MongoDriverError{constructor(F,A){super(F);this.address=A}get name(){return"MongoWaitQueueTimeoutError"}}uj.WaitQueueTimeoutError=_j});var bj=E((fj)=>{Object.defineProperty(fj,"__esModule",{value:!0});fj.ConnectionPool=fj.PoolState=void 0;var s7=i("node:timers"),_6=N0(),w3=n(),gj=G6(),U51=G2(),l3=e(),z51=OB(),HZ=XZ(),r0=_B(),r7=xB(),V51=YB();fj.PoolState=Object.freeze({paused:"paused",ready:"ready",closed:"closed"});class h1 extends gj.TypedEventEmitter{constructor(F,A){super();if(this.on("error",l3.noop),this.options=Object.freeze({connectionType:HZ.Connection,...A,maxPoolSize:A.maxPoolSize??100,minPoolSize:A.minPoolSize??0,maxConnecting:A.maxConnecting??2,maxIdleTimeMS:A.maxIdleTimeMS??0,waitQueueTimeoutMS:A.waitQueueTimeoutMS??0,minPoolSizeCheckFrequencyMS:A.minPoolSizeCheckFrequencyMS??100,autoEncrypter:A.autoEncrypter}),this.options.minPoolSize>this.options.maxPoolSize)throw new w3.MongoInvalidArgumentError("Connection pool minimum size must not be greater than maximum pool size");this.poolState=fj.PoolState.paused,this.server=F,this.connections=new l3.List,this.pending=0,this.checkedOut=new Set,this.minPoolSizeTimer=void 0,this.generation=0,this.serviceGenerations=new Map,this.connectionCounter=l3.makeCounter(1),this.cancellationToken=new gj.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.waitQueue=new l3.List,this.metrics=new V51.ConnectionPoolMetrics,this.processingWaitQueue=!1,this.mongoLogger=this.server.topology.client?.mongoLogger,this.component="connection",process.nextTick(()=>{this.emitAndLog(h1.CONNECTION_POOL_CREATED,new r0.ConnectionPoolCreatedEvent(this))})}get address(){return this.options.hostAddress.toString()}get closed(){return this.poolState===fj.PoolState.closed}get totalConnectionCount(){return this.availableConnectionCount+this.pendingConnectionCount+this.currentCheckedOutCount}get availableConnectionCount(){return this.connections.length}get pendingConnectionCount(){return this.pending}get currentCheckedOutCount(){return this.checkedOut.size}get waitQueueSize(){return this.waitQueue.length}get loadBalanced(){return this.options.loadBalanced}get serverError(){return this.server.description.error}get checkedOutConnections(){return this.checkedOut}waitQueueErrorMetrics(){return this.metrics.info(this.options.maxPoolSize)}ready(){if(this.poolState!==fj.PoolState.paused)return;this.poolState=fj.PoolState.ready,this.emitAndLog(h1.CONNECTION_POOL_READY,new r0.ConnectionPoolReadyEvent(this)),s7.clearTimeout(this.minPoolSizeTimer),this.ensureMinPoolSize()}async checkOut(F){let A=l3.now();this.emitAndLog(h1.CONNECTION_CHECK_OUT_STARTED,new r0.ConnectionCheckOutStartedEvent(this));let{promise:D,resolve:Z,reject:J}=l3.promiseWithResolvers(),X=F.timeoutContext.connectionCheckoutTimeout,$={resolve:Z,reject:J,cancelled:!1,checkoutTime:A},G=l3.addAbortListener(F.signal,function(){$.cancelled=!0,J(this.reason)});this.waitQueue.push($),process.nextTick(()=>this.processWaitQueue());try{return X?.throwIfExpired(),await(X?Promise.race([D,X]):D)}catch(Y){if(U51.TimeoutError.is(Y)){X?.clear(),$.cancelled=!0,this.emitAndLog(h1.CONNECTION_CHECK_OUT_FAILED,new r0.ConnectionCheckOutFailedEvent(this,"timeout",$.checkoutTime));let B=new r7.WaitQueueTimeoutError(this.loadBalanced?this.waitQueueErrorMetrics():"Timed out while checking out a connection from connection pool",this.address);if(F.timeoutContext.csotEnabled())throw new w3.MongoOperationTimeoutError("Timed out during connection checkout",{cause:B});throw B}throw Y}finally{G?.[l3.kDispose](),X?.clear()}}checkIn(F){if(!this.checkedOut.has(F))return;let A=this.closed,D=this.connectionIsStale(F),Z=!!(A||D||F.closed);if(!Z)F.markAvailable(),this.connections.unshift(F);if(this.checkedOut.delete(F),this.emitAndLog(h1.CONNECTION_CHECKED_IN,new r0.ConnectionCheckedInEvent(this,F)),Z){let J=F.closed?"error":A?"poolClosed":"stale";this.destroyConnection(F,J)}process.nextTick(()=>this.processWaitQueue())}clear(F={}){if(this.closed)return;if(this.loadBalanced){let{serviceId:J}=F;if(!J)throw new w3.MongoRuntimeError("ConnectionPool.clear() called in load balanced mode with no serviceId.");let X=J.toHexString(),$=this.serviceGenerations.get(X);if($==null)throw new w3.MongoRuntimeError("Service generations are required in load balancer mode.");else this.serviceGenerations.set(X,$+1);this.emitAndLog(h1.CONNECTION_POOL_CLEARED,new r0.ConnectionPoolClearedEvent(this,{serviceId:J}));return}let A=F.interruptInUseConnections??!1,D=this.generation;this.generation+=1;let Z=this.poolState===fj.PoolState.paused;if(this.poolState=fj.PoolState.paused,this.clearMinPoolSizeTimer(),!Z)this.emitAndLog(h1.CONNECTION_POOL_CLEARED,new r0.ConnectionPoolClearedEvent(this,{interruptInUseConnections:A}));if(A)process.nextTick(()=>this.interruptInUseConnections(D));this.processWaitQueue()}interruptInUseConnections(F){for(let A of this.checkedOut)if(A.generation<=F)A.onError(new r7.PoolClearedOnNetworkError(this)),this.checkIn(A)}close(){if(this.closed)return;if(this.cancellationToken.emit("cancel"),typeof this.connectionCounter.return==="function")this.connectionCounter.return(void 0);this.poolState=fj.PoolState.closed,this.clearMinPoolSizeTimer(),this.processWaitQueue();for(let F of this.connections)this.emitAndLog(h1.CONNECTION_CLOSED,new r0.ConnectionClosedEvent(this,F,"poolClosed")),F.destroy();this.connections.clear(),this.emitAndLog(h1.CONNECTION_POOL_CLOSED,new r0.ConnectionPoolClosedEvent(this))}async reauthenticate(F){let A=F.authContext;if(!A)throw new w3.MongoRuntimeError("No auth context found on connection.");let D=A.credentials;if(!D)throw new w3.MongoMissingCredentialsError("Connection is missing credentials when asked to reauthenticate");let Z=D.resolveAuthMechanism(F.hello),J=this.server.topology.client.s.authProviders.getOrCreateProvider(Z.mechanism,Z.mechanismProperties);if(!J)throw new w3.MongoMissingCredentialsError(`Reauthenticate failed due to no auth provider for ${D.mechanism}`);await J.reauth(A);return}clearMinPoolSizeTimer(){let F=this.minPoolSizeTimer;if(F)s7.clearTimeout(F)}destroyConnection(F,A){this.emitAndLog(h1.CONNECTION_CLOSED,new r0.ConnectionClosedEvent(this,F,A)),F.destroy()}connectionIsStale(F){let A=F.serviceId;if(this.loadBalanced&&A){let D=A.toHexString(),Z=this.serviceGenerations.get(D);return F.generation!==Z}return F.generation!==this.generation}connectionIsIdle(F){return!!(this.options.maxIdleTimeMS&&F.idleTime>this.options.maxIdleTimeMS)}destroyConnectionIfPerished(F){let A=this.connectionIsStale(F),D=this.connectionIsIdle(F);if(!A&&!D&&!F.closed)return!1;let Z=F.closed?"error":A?"stale":"idle";return this.destroyConnection(F,Z),!0}createConnection(F){let A={...this.options,id:this.connectionCounter.next().value,generation:this.generation,cancellationToken:this.cancellationToken,mongoLogger:this.mongoLogger,authProviders:this.server.topology.client.s.authProviders};this.pending++;let D=l3.now();this.emitAndLog(h1.CONNECTION_CREATED,new r0.ConnectionCreatedEvent(this,{id:A.id})),z51.connect(A).then((Z)=>{if(this.poolState!==fj.PoolState.ready){this.pending--,Z.destroy(),F(this.closed?new r7.PoolClosedError(this):new r7.PoolClearedError(this));return}for(let J of[..._6.APM_EVENTS,HZ.Connection.CLUSTER_TIME_RECEIVED])Z.on(J,(X)=>this.emit(J,X));if(this.loadBalanced){Z.on(HZ.Connection.PINNED,(X)=>this.metrics.markPinned(X)),Z.on(HZ.Connection.UNPINNED,(X)=>this.metrics.markUnpinned(X));let J=Z.serviceId;if(J){let X,$=J.toHexString();if(X=this.serviceGenerations.get($))Z.generation=X;else this.serviceGenerations.set($,0),Z.generation=0}}Z.markAvailable(),this.emitAndLog(h1.CONNECTION_READY,new r0.ConnectionReadyEvent(this,Z,D)),this.pending--,F(void 0,Z)},(Z)=>{if(this.pending--,this.server.handleError(Z),this.emitAndLog(h1.CONNECTION_CLOSED,new r0.ConnectionClosedEvent(this,{id:A.id,serviceId:void 0},"error",Z)),Z instanceof w3.MongoNetworkError||Z instanceof w3.MongoServerError)Z.connectionGeneration=A.generation;F(Z??new w3.MongoRuntimeError("Connection creation failed without error"))})}ensureMinPoolSize(){let F=this.options.minPoolSize;if(this.poolState!==fj.PoolState.ready||F===0)return;if(this.connections.prune((A)=>this.destroyConnectionIfPerished(A)),this.totalConnectionCount<F&&this.pendingConnectionCount<this.options.maxConnecting)this.createConnection((A,D)=>{if(!A&&D)this.connections.push(D),process.nextTick(()=>this.processWaitQueue());if(this.poolState===fj.PoolState.ready)s7.clearTimeout(this.minPoolSizeTimer),this.minPoolSizeTimer=s7.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)});else s7.clearTimeout(this.minPoolSizeTimer),this.minPoolSizeTimer=s7.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)}processWaitQueue(){if(this.processingWaitQueue)return;this.processingWaitQueue=!0;while(this.waitQueueSize){let D=this.waitQueue.first();if(!D){this.waitQueue.shift();continue}if(D.cancelled){this.waitQueue.shift();continue}if(this.poolState!==fj.PoolState.ready){let J=this.closed?"poolClosed":"connectionError",X=this.closed?new r7.PoolClosedError(this):new r7.PoolClearedError(this);this.emitAndLog(h1.CONNECTION_CHECK_OUT_FAILED,new r0.ConnectionCheckOutFailedEvent(this,J,D.checkoutTime,X)),this.waitQueue.shift(),D.reject(X);continue}if(!this.availableConnectionCount)break;let Z=this.connections.shift();if(!Z)break;if(!this.destroyConnectionIfPerished(Z))this.checkedOut.add(Z),this.emitAndLog(h1.CONNECTION_CHECKED_OUT,new r0.ConnectionCheckedOutEvent(this,Z,D.checkoutTime)),this.waitQueue.shift(),D.resolve(Z)}let{maxPoolSize:F,maxConnecting:A}=this.options;while(this.waitQueueSize>0&&this.pendingConnectionCount<A&&(F===0||this.totalConnectionCount<F)){let D=this.waitQueue.shift();if(!D||D.cancelled)continue;this.createConnection((Z,J)=>{if(D.cancelled){if(!Z&&J)this.connections.push(J)}else if(Z)this.emitAndLog(h1.CONNECTION_CHECK_OUT_FAILED,new r0.ConnectionCheckOutFailedEvent(this,"connectionError",D.checkoutTime,Z)),D.reject(Z);else if(J)this.checkedOut.add(J),this.emitAndLog(h1.CONNECTION_CHECKED_OUT,new r0.ConnectionCheckedOutEvent(this,J,D.checkoutTime)),D.resolve(J);process.nextTick(()=>this.processWaitQueue())})}this.processingWaitQueue=!1}}fj.ConnectionPool=h1;h1.CONNECTION_POOL_CREATED=_6.CONNECTION_POOL_CREATED;h1.CONNECTION_POOL_CLOSED=_6.CONNECTION_POOL_CLOSED;h1.CONNECTION_POOL_CLEARED=_6.CONNECTION_POOL_CLEARED;h1.CONNECTION_POOL_READY=_6.CONNECTION_POOL_READY;h1.CONNECTION_CREATED=_6.CONNECTION_CREATED;h1.CONNECTION_READY=_6.CONNECTION_READY;h1.CONNECTION_CLOSED=_6.CONNECTION_CLOSED;h1.CONNECTION_CHECK_OUT_STARTED=_6.CONNECTION_CHECK_OUT_STARTED;h1.CONNECTION_CHECK_OUT_FAILED=_6.CONNECTION_CHECK_OUT_FAILED;h1.CONNECTION_CHECKED_OUT=_6.CONNECTION_CHECKED_OUT;h1.CONNECTION_CHECKED_IN=_6.CONNECTION_CHECKED_IN});var hB=E((mj)=>{Object.defineProperty(mj,"__esModule",{value:!0});mj.Server=void 0;var L51=XZ(),R51=bj(),w51=xB(),P3=N0(),Y0=n(),P51=G6(),yB=WB(),T9=e(),hj=Y2(),n1=$6(),I51=vB(),bB=t5(),ZF=T9.makeStateMachine({[n1.STATE_CLOSED]:[n1.STATE_CLOSED,n1.STATE_CONNECTING],[n1.STATE_CONNECTING]:[n1.STATE_CONNECTING,n1.STATE_CLOSING,n1.STATE_CONNECTED,n1.STATE_CLOSED],[n1.STATE_CONNECTED]:[n1.STATE_CONNECTED,n1.STATE_CLOSING,n1.STATE_CLOSED],[n1.STATE_CLOSING]:[n1.STATE_CLOSING,n1.STATE_CLOSED]});class p2 extends P51.TypedEventEmitter{constructor(F,A,D){super();this.on("error",T9.noop),this.serverApi=D.serverApi;let Z={hostAddress:A.hostAddress,...D};this.topology=F,this.pool=new R51.ConnectionPool(this,Z),this.s={description:A,options:D,state:n1.STATE_CLOSED,operationCount:0};for(let J of[...P3.CMAP_EVENTS,...P3.APM_EVENTS])this.pool.on(J,(X)=>this.emit(J,X));if(this.pool.on(L51.Connection.CLUSTER_TIME_RECEIVED,(J)=>{this.clusterTime=J}),this.loadBalanced){this.monitor=null;return}this.monitor=new I51.Monitor(this,this.s.options);for(let J of P3.HEARTBEAT_EVENTS)this.monitor.on(J,(X)=>this.emit(J,X));this.monitor.on("resetServer",(J)=>gB(this,J)),this.monitor.on(p2.SERVER_HEARTBEAT_SUCCEEDED,(J)=>{if(this.emit(p2.DESCRIPTION_RECEIVED,new bB.ServerDescription(this.description.hostAddress,J.reply,{roundTripTime:this.monitor?.roundTripTime,minRoundTripTime:this.monitor?.minRoundTripTime})),this.s.state===n1.STATE_CONNECTING)ZF(this,n1.STATE_CONNECTED),this.emit(p2.CONNECT,this)})}get clusterTime(){return this.topology.clusterTime}set clusterTime(F){this.topology.clusterTime=F}get description(){return this.s.description}get name(){return this.s.description.address}get autoEncrypter(){if(this.s.options&&this.s.options.autoEncrypter)return this.s.options.autoEncrypter;return}get loadBalanced(){return this.topology.description.type===n1.TopologyType.LoadBalanced}connect(){if(this.s.state!==n1.STATE_CLOSED)return;if(ZF(this,n1.STATE_CONNECTING),!this.loadBalanced)this.monitor?.connect();else ZF(this,n1.STATE_CONNECTED),this.emit(p2.CONNECT,this)}destroy(){if(this.s.state===n1.STATE_CLOSED)return;if(ZF(this,n1.STATE_CLOSING),!this.loadBalanced)this.monitor?.close();this.pool.close(),ZF(this,n1.STATE_CLOSED),this.emit("closed")}requestCheck(){if(!this.loadBalanced)this.monitor?.requestCheck()}async command(F,A,{...D},Z){if(F.db==null||typeof F==="string")throw new Y0.MongoInvalidArgumentError("Namespace must not be a string");if(this.s.state===n1.STATE_CLOSING||this.s.state===n1.STATE_CLOSED)throw new Y0.MongoServerClosedError;if(D.directConnection=this.topology.s.options.directConnection,D.omitReadPreference)delete D.readPreference;if(this.description.iscryptd)D.omitMaxTimeMS=!0;let J=D.session,X=J?.pinnedConnection;if(this.incrementOperationCount(),X==null)try{if(X=await this.pool.checkOut(D),this.loadBalanced&&M51(A,J))J?.pin(X)}catch(G){if(this.decrementOperationCount(),!(G instanceof w51.PoolClearedError))this.handleError(G);throw G}let $=null;try{try{let G=await X.command(F,A,D,Z);return hj.throwIfWriteConcernError(G),G}catch(G){throw this.decorateCommandError(X,A,D,G)}}catch(G){if(G instanceof Y0.MongoError&&G.code===Y0.MONGODB_ERROR_CODES.Reauthenticate){$=this.pool.reauthenticate(X),$.then(void 0,(Y)=>{$=null,T9.squashError(Y)}),await T9.abortable($,D),$=null;try{let Y=await X.command(F,A,D,Z);return hj.throwIfWriteConcernError(Y),Y}catch(Y){throw this.decorateCommandError(X,A,D,Y)}}else throw G}finally{if(this.decrementOperationCount(),J?.pinnedConnection!==X)if($!=null){let G=()=>{this.pool.checkIn(X)};$.then(G,G)}else this.pool.checkIn(X)}}handleError(F,A){if(!(F instanceof Y0.MongoError))return;if(F.connectionGeneration&&F.connectionGeneration<this.pool.generation)return;let Z=F instanceof Y0.MongoNetworkError&&!(F instanceof Y0.MongoNetworkTimeoutError),J=F instanceof Y0.MongoNetworkError&&F.beforeHandshake,X=F.hasErrorLabel(Y0.MongoErrorLabel.HandshakeError);if(Z||J||X){if(!this.loadBalanced)F.addErrorLabel(Y0.MongoErrorLabel.ResetPool),gB(this,F);else if(A)this.pool.clear({serviceId:A.serviceId})}else if(Y0.isSDAMUnrecoverableError(F)){if(j51(this,F)){let $=T9.maxWireVersion(this)<=7||Y0.isNodeShuttingDownError(F);if(this.loadBalanced&&A&&$)this.pool.clear({serviceId:A.serviceId});if(!this.loadBalanced){if($)F.addErrorLabel(Y0.MongoErrorLabel.ResetPool);gB(this,F),process.nextTick(()=>this.requestCheck())}}}}decorateCommandError(F,A,D,Z){if(typeof Z!=="object"||Z==null||!("name"in Z))throw new Y0.MongoRuntimeError("An unexpected error type: "+typeof Z);if(Z.name==="AbortError"&&"cause"in Z&&Z.cause instanceof Y0.MongoError)Z=Z.cause;if(!(Z instanceof Y0.MongoError))return Z;if(N51(this.pool,F))return Z;let J=D?.session;if(Z instanceof Y0.MongoNetworkError){if(J&&!J.hasEnded&&J.serverSession)J.serverSession.isDirty=!0;if(fB(J,A)&&!Z.hasErrorLabel(Y0.MongoErrorLabel.TransientTransactionError))Z.addErrorLabel(Y0.MongoErrorLabel.TransientTransactionError);if((vj(this.topology)||yB.isTransactionCommand(A))&&T9.supportsRetryableWrites(this)&&!fB(J,A))Z.addErrorLabel(Y0.MongoErrorLabel.RetryableWriteError)}else if((vj(this.topology)||yB.isTransactionCommand(A))&&Y0.needsRetryableWriteLabel(Z,T9.maxWireVersion(this),this.description.type)&&!fB(J,A))Z.addErrorLabel(Y0.MongoErrorLabel.RetryableWriteError);if(J&&J.isPinned&&Z.hasErrorLabel(Y0.MongoErrorLabel.TransientTransactionError))J.unpin({force:!0});return this.handleError(Z,F),Z}decrementOperationCount(){return this.s.operationCount-=1}incrementOperationCount(){return this.s.operationCount+=1}}mj.Server=p2;p2.SERVER_HEARTBEAT_STARTED=P3.SERVER_HEARTBEAT_STARTED;p2.SERVER_HEARTBEAT_SUCCEEDED=P3.SERVER_HEARTBEAT_SUCCEEDED;p2.SERVER_HEARTBEAT_FAILED=P3.SERVER_HEARTBEAT_FAILED;p2.CONNECT=P3.CONNECT;p2.DESCRIPTION_RECEIVED=P3.DESCRIPTION_RECEIVED;p2.CLOSED=P3.CLOSED;p2.ENDED=P3.ENDED;function gB(F,A){if(F.loadBalanced)return;if(A instanceof Y0.MongoNetworkError&&!(A instanceof Y0.MongoNetworkTimeoutError))F.monitor?.reset();F.emit(p2.DESCRIPTION_RECEIVED,new bB.ServerDescription(F.description.hostAddress,void 0,{error:A}))}function M51(F,A){if(A)return A.inTransaction()||A.transaction.isCommitted&&"commitTransaction"in F||"aggregate"in F||"find"in F||"getMore"in F||"listCollections"in F||"listIndexes"in F||"bulkWrite"in F;return!1}function N51(F,A){if(A.serviceId)return A.generation!==F.serviceGenerations.get(A.serviceId.toHexString());return A.generation!==F.generation}function j51(F,A){let D=A.topologyVersion,Z=F.description.topologyVersion;return bB.compareTopologyVersion(Z,D)<0}function fB(F,A){return F&&F.inTransaction()&&!yB.isTransactionCommand(A)}function vj(F){return F.s.options.retryWrites!==!1}});var vB=E((nj)=>{Object.defineProperty(nj,"__esModule",{value:!0});nj.RTTSampler=nj.MonitorInterval=nj.RTTPinger=nj.Monitor=nj.ServerMonitoringMode=void 0;var y4=i("node:timers"),cj=k1(),qZ=OB(),T51=dG(),mB=N0(),t7=n(),k51=R4(),lj=G6(),t0=e(),o0=$6(),JF=GZ(),XF=hB(),o7="idle",k9="monitoring",e7=t0.makeStateMachine({[o0.STATE_CLOSING]:[o0.STATE_CLOSING,o7,o0.STATE_CLOSED],[o0.STATE_CLOSED]:[o0.STATE_CLOSED,k9],[o7]:[o7,k9,o0.STATE_CLOSING],[k9]:[k9,o7,o0.STATE_CLOSING]}),O51=new Set([o0.STATE_CLOSING,o0.STATE_CLOSED,k9]);function $F(F){return F.s.state===o0.STATE_CLOSED||F.s.state===o0.STATE_CLOSING}nj.ServerMonitoringMode=Object.freeze({auto:"auto",poll:"poll",stream:"stream"});class aj extends lj.TypedEventEmitter{constructor(F,A){super();this.component=k51.MongoLoggableComponent.TOPOLOGY,this.on("error",t0.noop),this.server=F,this.connection=null,this.cancellationToken=new lj.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.monitorId=void 0,this.s={state:o0.STATE_CLOSED},this.address=F.description.address,this.options=Object.freeze({connectTimeoutMS:A.connectTimeoutMS??1e4,heartbeatFrequencyMS:A.heartbeatFrequencyMS??1e4,minHeartbeatFrequencyMS:A.minHeartbeatFrequencyMS??500,serverMonitoringMode:A.serverMonitoringMode}),this.isRunningInFaasEnv=T51.getFAASEnv()!=null,this.mongoLogger=this.server.topology.client?.mongoLogger,this.rttSampler=new pB(10);let D=this.cancellationToken,Z={id:"<monitor>",generation:F.pool.generation,cancellationToken:D,hostAddress:F.description.hostAddress,...A,raw:!1,useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!0};if(delete Z.credentials,Z.autoEncrypter)delete Z.autoEncrypter;this.connectOptions=Object.freeze(Z)}connect(){if(this.s.state!==o0.STATE_CLOSED)return;let F=this.options.heartbeatFrequencyMS,A=this.options.minHeartbeatFrequencyMS;this.monitorId=new WZ(ij(this),{heartbeatFrequencyMS:F,minHeartbeatFrequencyMS:A,immediate:!0})}requestCheck(){if(O51.has(this.s.state))return;this.monitorId?.wake()}reset(){let F=this.server.description.topologyVersion;if($F(this)||F==null)return;e7(this,o0.STATE_CLOSING),pj(this),e7(this,o7);let A=this.options.heartbeatFrequencyMS,D=this.options.minHeartbeatFrequencyMS;this.monitorId=new WZ(ij(this),{heartbeatFrequencyMS:A,minHeartbeatFrequencyMS:D})}close(){if($F(this))return;e7(this,o0.STATE_CLOSING),pj(this),this.emit("close"),e7(this,o0.STATE_CLOSED)}get roundTripTime(){return this.rttSampler.average()}get minRoundTripTime(){return this.rttSampler.min()}get latestRtt(){return this.rttSampler.last}addRttSample(F){this.rttSampler.addSample(F)}clearRttSamples(){this.rttSampler.clear()}}nj.Monitor=aj;function pj(F){F.monitorId?.stop(),F.monitorId=void 0,F.rttPinger?.close(),F.rttPinger=void 0,F.cancellationToken.emit("cancel"),F.connection?.destroy(),F.connection=null,F.clearRttSamples()}function dB(F,A){if(A==null)return!1;let D=F.options.serverMonitoringMode;if(D===nj.ServerMonitoringMode.poll)return!1;if(D===nj.ServerMonitoringMode.stream)return!0;if(F.isRunningInFaasEnv)return!1;return!0}function S51(F,A){let D,Z,J=F.server.description.topologyVersion,X=dB(F,J);F.emitAndLogHeartbeat(XF.Server.SERVER_HEARTBEAT_STARTED,F.server.topology.s.id,void 0,new JF.ServerHeartbeatStartedEvent(F.address,X));function $(B){F.connection?.destroy(),F.connection=null,F.emitAndLogHeartbeat(XF.Server.SERVER_HEARTBEAT_FAILED,F.server.topology.s.id,void 0,new JF.ServerHeartbeatFailedEvent(F.address,t0.calculateDurationInMs(D),B,Z));let H=!(B instanceof t7.MongoError)?new t7.MongoError(t7.MongoError.buildErrorMessage(B),{cause:B}):B;if(H.addErrorLabel(t7.MongoErrorLabel.ResetPool),H instanceof t7.MongoNetworkTimeoutError)H.addErrorLabel(t7.MongoErrorLabel.InterruptInUseConnections);F.emit("resetServer",H),A(B)}function G(B){if(!("isWritablePrimary"in B))B.isWritablePrimary=B[mB.LEGACY_HELLO_COMMAND];let H=X&&F.rttPinger?F.rttPinger.latestRtt??t0.calculateDurationInMs(D):t0.calculateDurationInMs(D);if(F.addRttSample(H),F.emitAndLogHeartbeat(XF.Server.SERVER_HEARTBEAT_SUCCEEDED,F.server.topology.s.id,B.connectionId,new JF.ServerHeartbeatSucceededEvent(F.address,H,B,X)),X)F.emitAndLogHeartbeat(XF.Server.SERVER_HEARTBEAT_STARTED,F.server.topology.s.id,void 0,new JF.ServerHeartbeatStartedEvent(F.address,!0)),D=t0.now();else F.rttPinger?.close(),F.rttPinger=void 0,A(void 0,B)}let{connection:Y}=F;if(Y&&!Y.closed){let{serverApi:B,helloOk:H}=Y,q=F.options.connectTimeoutMS,W=F.options.heartbeatFrequencyMS,C={[B?.version||H?"hello":mB.LEGACY_HELLO_COMMAND]:1,...X&&J?{maxAwaitTimeMS:W,topologyVersion:_51(J)}:{}},Q=X?{socketTimeoutMS:q?q+W:0,exhaustAllowed:!0}:{socketTimeoutMS:q};if(X&&F.rttPinger==null)F.rttPinger=new lB(F);if(D=t0.now(),X)return Z=!0,Y.exhaustCommand(t0.ns("admin.$cmd"),C,Q,(K,U)=>{if(K)return $(K);return G(U)});Z=!1,Y.command(t0.ns("admin.$cmd"),C,Q).then(G,$);return}(async()=>{let B=await qZ.makeSocket(F.connectOptions),H=qZ.makeConnection(F.connectOptions,B);D=t0.now();try{return await qZ.performInitialHandshake(H,F.connectOptions),H}catch(q){throw H.destroy(),q}})().then((B)=>{if($F(F)){B.destroy();return}let H=t0.calculateDurationInMs(D);F.addRttSample(H),F.connection=B,F.emitAndLogHeartbeat(XF.Server.SERVER_HEARTBEAT_SUCCEEDED,F.server.topology.s.id,B.hello?.connectionId,new JF.ServerHeartbeatSucceededEvent(F.address,H,B.hello,dB(F,B.hello?.topologyVersion))),A(void 0,B.hello)},(B)=>{F.connection=null,Z=!1,$(B)})}function ij(F){return(A)=>{if(F.s.state===k9){process.nextTick(A);return}e7(F,k9);function D(){if(!$F(F))e7(F,o7);A()}S51(F,(Z,J)=>{if(Z){if(F.server.description.type===o0.ServerType.Unknown)return D()}if(dB(F,J?.topologyVersion))y4.setTimeout(()=>{if(!$F(F))F.monitorId?.wake()},0);D()})}}function _51(F){return{processId:F.processId,counter:cj.Long.isLong(F.counter)?F.counter:cj.Long.fromNumber(F.counter)}}class lB{constructor(F){this.connection=void 0,this.cancellationToken=F.cancellationToken,this.closed=!1,this.monitor=F,this.latestRtt=F.latestRtt??void 0;let A=F.options.heartbeatFrequencyMS;this.monitorId=y4.setTimeout(()=>this.measureRoundTripTime(),A)}get roundTripTime(){return this.monitor.roundTripTime}get minRoundTripTime(){return this.monitor.minRoundTripTime}close(){this.closed=!0,y4.clearTimeout(this.monitorId),this.connection?.destroy(),this.connection=void 0}measureAndReschedule(F,A){if(this.closed){A?.destroy();return}if(this.connection==null)this.connection=A;this.latestRtt=t0.calculateDurationInMs(F),this.monitorId=y4.setTimeout(()=>this.measureRoundTripTime(),this.monitor.options.heartbeatFrequencyMS)}measureRoundTripTime(){let F=t0.now();if(this.closed)return;let A=this.connection;if(A==null){qZ.connect(this.monitor.connectOptions).then((Z)=>{this.measureAndReschedule(F,Z)},()=>{this.connection=void 0});return}let D=A.serverApi?.version||A.helloOk?"hello":mB.LEGACY_HELLO_COMMAND;A.command(t0.ns("admin.$cmd"),{[D]:1},void 0).then(()=>this.measureAndReschedule(F),()=>{this.connection?.destroy(),this.connection=void 0;return})}}nj.RTTPinger=lB;class WZ{constructor(F,A={}){if(this.isExpeditedCallToFnScheduled=!1,this.stopped=!1,this.isExecutionInProgress=!1,this.hasExecutedOnce=!1,this._executeAndReschedule=()=>{if(this.stopped)return;if(this.timerId)y4.clearTimeout(this.timerId);this.isExpeditedCallToFnScheduled=!1,this.isExecutionInProgress=!0,this.fn(()=>{this.lastExecutionEnded=t0.now(),this.isExecutionInProgress=!1,this._reschedule(this.heartbeatFrequencyMS)})},this.fn=F,this.lastExecutionEnded=-1/0,this.heartbeatFrequencyMS=A.heartbeatFrequencyMS??1000,this.minHeartbeatFrequencyMS=A.minHeartbeatFrequencyMS??500,A.immediate)this._executeAndReschedule();else this._reschedule(void 0)}wake(){let A=t0.now()-this.lastExecutionEnded;if(A<0)return this._executeAndReschedule();if(this.isExecutionInProgress)return;if(this.isExpeditedCallToFnScheduled)return;if(A<this.minHeartbeatFrequencyMS){this.isExpeditedCallToFnScheduled=!0,this._reschedule(this.minHeartbeatFrequencyMS-A);return}this._executeAndReschedule()}stop(){if(this.stopped=!0,this.timerId)y4.clearTimeout(this.timerId),this.timerId=void 0;this.lastExecutionEnded=-1/0,this.isExpeditedCallToFnScheduled=!1}toString(){return JSON.stringify(this)}toJSON(){let F=t0.now(),A=F-this.lastExecutionEnded;return{timerId:this.timerId!=null?"set":"cleared",lastCallTime:this.lastExecutionEnded,isExpeditedCheckScheduled:this.isExpeditedCallToFnScheduled,stopped:this.stopped,heartbeatFrequencyMS:this.heartbeatFrequencyMS,minHeartbeatFrequencyMS:this.minHeartbeatFrequencyMS,currentTime:F,timeSinceLastCall:A}}_reschedule(F){if(this.stopped)return;if(this.timerId)y4.clearTimeout(this.timerId);this.timerId=y4.setTimeout(this._executeAndReschedule,F||this.heartbeatFrequencyMS)}}nj.MonitorInterval=WZ;class pB{constructor(F=10){this.rttSamples=new Float64Array(F),this.length=0,this.writeIndex=0}addSample(F){if(this.rttSamples[this.writeIndex++]=F,this.length<this.rttSamples.length)this.length++;this.writeIndex%=this.rttSamples.length}min(){if(this.length<2)return 0;let F=this.rttSamples[0];for(let A=1;A<this.length;A++)if(this.rttSamples[A]<F)F=this.rttSamples[A];return F}average(){if(this.length===0)return 0;let F=0;for(let A=0;A<this.length;A++)F+=this.rttSamples[A];return F/this.length}get last(){if(this.length===0)return null;return this.rttSamples[this.writeIndex===0?this.length-1:this.writeIndex-1]}clear(){this.length=0,this.writeIndex=0}}nj.RTTSampler=pB});var oB=E((DT)=>{Object.defineProperty(DT,"__esModule",{value:!0});DT.DEFAULT_OPTIONS=DT.OPTIONS=void 0;DT.resolveSRVRecord=l51;DT.parseOptions=i51;var iB=i("node:dns"),f51=hG(),y51=i("node:url"),F8=MD(),I3=V3(),rj=dG(),tj=c5(),oj=XN(),F1=n(),CZ=M4(),sB=R4(),aB=M6(),b4=y0(),b51=vB(),e0=e(),p3=Y2(),nB=["authSource","replicaSet","loadBalanced"],h51="loadBalanced option only supported with a single host in the URI",v51="loadBalanced option not supported with a replicaSet option",m51="loadBalanced option not supported when directConnection is provided";function AT(F){return async function A(D){try{return await iB.promises[F](D)}catch(Z){if(Z.code===iB.TIMEOUT)return await iB.promises[F](D);else throw Z}}}var d51=AT("resolveSrv"),c51=AT("resolveTxt");async function l51(F){if(typeof F.srvHost!=="string")throw new F1.MongoAPIError('Option "srvHost" must not be empty');let A=F.srvHost,D=c51(A);D.then(void 0,e0.squashError);let Z=`_${F.srvServiceName}._tcp.${A}`,J=await d51(Z);if(J.length===0)throw new F1.MongoAPIError("No addresses found at host");for(let{name:W}of J)e0.checkParentDomainMatch(W,A);let X=J.map((W)=>e0.HostAddress.fromString(`${W.name}:${W.port??27017}`));rB(X,F,!0);let $;try{$=await D}catch(W){if(W.code!=="ENODATA"&&W.code!=="ENOTFOUND")throw W;return X}if($.length>1)throw new F1.MongoParseError("Multiple text records not allowed");let G=new y51.URLSearchParams($[0].join(""));if([...G.keys()].some((W)=>!nB.includes(W)))throw new F1.MongoParseError(`Text record may only set any of: ${nB.join(", ")}`);if(nB.some((W)=>G.get(W)===""))throw new F1.MongoParseError("Cannot have empty URI params in DNS TXT Record");let B=G.get("authSource")??void 0,H=G.get("replicaSet")??void 0,q=G.get("loadBalanced")??void 0;if(!F.userSpecifiedAuthSource&&B&&F.credentials&&!I3.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(F.credentials.mechanism))F.credentials=F8.MongoCredentials.merge(F.credentials,{source:B});if(!F.userSpecifiedReplicaSet&&H)F.replicaSet=H;if(q==="true")F.loadBalanced=!0;if(F.replicaSet&&F.srvMaxHosts>0)throw new F1.MongoParseError("Cannot combine replicaSet option with srvMaxHosts");return rB(X,F,!0),X}function p51(F){if(!F)return;let A=(D,Z)=>{if(F.has(D)&&F.has(Z))throw new F1.MongoAPIError(`The '${D}' option cannot be used with the '${Z}' option`)};A("tlsInsecure","tlsAllowInvalidCertificates"),A("tlsInsecure","tlsAllowInvalidHostnames"),A("tlsInsecure","tlsDisableCertificateRevocationCheck"),A("tlsInsecure","tlsDisableOCSPEndpointCheck"),A("tlsAllowInvalidCertificates","tlsDisableCertificateRevocationCheck"),A("tlsAllowInvalidCertificates","tlsDisableOCSPEndpointCheck"),A("tlsDisableCertificateRevocationCheck","tlsDisableOCSPEndpointCheck")}function i3(F,A){if(typeof A==="boolean")return A;switch(A){case"true":return!0;case"false":return!1;default:throw new F1.MongoParseError(`${F} must be either "true" or "false"`)}}function tB(F,A){let D=e0.parseInteger(A);if(D!=null)return D;throw new F1.MongoParseError(`Expected ${F} to be stringified int value, got: ${A}`)}function YF(F,A){let D=tB(F,A);if(D<0)throw new F1.MongoParseError(`${F} can only be a positive int value, got: ${A}`);return D}function*ej(F){if(F==="")return;let A=F.split(",");for(let D of A){let[Z,J]=D.split(/:(.*)/);if(J==null)throw new F1.MongoParseError("Cannot have undefined values in key value pairs");yield[Z,J]}}class GF extends Map{constructor(F=[]){super(F.map(([A,D])=>[A.toLowerCase(),D]))}has(F){return super.has(F.toLowerCase())}get(F){return super.get(F.toLowerCase())}set(F,A){return super.set(F.toLowerCase(),A)}delete(F){return super.delete(F.toLowerCase())}}function i51(F,A=void 0,D={}){if(A!=null&&!(A instanceof CZ.MongoClient))D=A,A=void 0;if(D.useBigInt64&&typeof D.promoteLongs==="boolean"&&!D.promoteLongs)throw new F1.MongoAPIError("Must request either bigint or Long for int64 deserialization");if(D.useBigInt64&&typeof D.promoteValues==="boolean"&&!D.promoteValues)throw new F1.MongoAPIError("Must request either bigint or Long for int64 deserialization");let Z=new f51.default(F),{hosts:J,isSRV:X}=Z,$=Object.create(null);$.hosts=X?[]:J.map(e0.HostAddress.fromString);let G=new GF;if(Z.pathname!=="/"&&Z.pathname!==""){let Q=decodeURIComponent(Z.pathname[0]==="/"?Z.pathname.slice(1):Z.pathname);if(Q)G.set("dbName",[Q])}if(Z.username!==""){let Q={username:decodeURIComponent(Z.username)};if(typeof Z.password==="string")Q.password=decodeURIComponent(Z.password);G.set("auth",[Q])}for(let Q of Z.searchParams.keys()){let K=Z.searchParams.getAll(Q),U=/readPreferenceTags/i.test(Q);if(!U&&K.length>1)throw new F1.MongoInvalidArgumentError(`URI option "${Q}" cannot appear more than once in the connection string`);if(!U&&K.includes(""))throw new F1.MongoAPIError(`URI option "${Q}" cannot be specified with no value`);if(!G.has(Q))G.set(Q,K)}let Y=new GF(Object.entries(D).filter(([,Q])=>Q!=null));if(G.has("serverApi"))throw new F1.MongoParseError("URI cannot contain `serverApi`, it can only be passed to the client");let B=G.get("authMechanismProperties");if(B){for(let Q of B)if(/(^|,)ALLOWED_HOSTS:/.test(Q))throw new F1.MongoParseError("Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string.")}if(Y.has("loadBalanced"))throw new F1.MongoParseError("loadBalanced is only a valid option in the URI");let H=new GF,q=new Set([...G.keys(),...Y.keys()]);for(let Q of q){let K=[],U=Y.get(Q);if(U!=null)K.push(U);let z=G.get(Q)??[];K.push(...z),H.set(Q,K)}if(H.has("tls")||H.has("ssl")){let Q=(H.get("tls")||[]).concat(H.get("ssl")||[]).map(i3.bind(null,"tls/ssl"));if(new Set(Q).size!==1)throw new F1.MongoParseError("All values of tls/ssl must be the same.")}p51(H);let W=e0.setDifference(q,Array.from(Object.keys(DT.OPTIONS)).map((Q)=>Q.toLowerCase()));if(W.size!==0){let Q=W.size>1?"options":"option",K=W.size>1?"are":"is";throw new F1.MongoParseError(`${Q} ${Array.from(W).join(", ")} ${K} not supported`)}for(let[Q,K]of Object.entries(DT.OPTIONS)){let U=H.get(Q);if(!U||U.length===0){if(DT.DEFAULT_OPTIONS.has(Q))FT($,Q,K,[DT.DEFAULT_OPTIONS.get(Q)])}else{let{deprecated:z}=K;if(z){let L=typeof z==="string"?`: ${z}`:"";e0.emitWarning(`${Q} is a deprecated option${L}`)}FT($,Q,K,U)}}if($.credentials){let Q=$.credentials.mechanism===I3.AuthMechanism.MONGODB_GSSAPI,K=$.credentials.mechanism===I3.AuthMechanism.MONGODB_X509,U=$.credentials.mechanism===I3.AuthMechanism.MONGODB_AWS,z=$.credentials.mechanism===I3.AuthMechanism.MONGODB_OIDC;if((Q||K)&&H.has("authSource")&&$.credentials.source!=="$external")throw new F1.MongoParseError(`authMechanism ${$.credentials.mechanism} requires an authSource of '$external'`);if(!(Q||K||U||z)&&$.dbName&&!H.has("authSource"))$.credentials=F8.MongoCredentials.merge($.credentials,{source:$.dbName});if(U&&$.credentials.username&&!$.credentials.password)throw new F1.MongoMissingCredentialsError(`When using ${$.credentials.mechanism} password must be set when a username is specified`);if($.credentials.validate(),$.credentials.password===""&&$.credentials.username===""&&$.credentials.mechanism===I3.AuthMechanism.MONGODB_DEFAULT&&Object.keys($.credentials.mechanismProperties).length===0)delete $.credentials}if(!$.dbName)$.dbName="test";if(rB(J,$,X),A&&$.autoEncryption)oj.Encrypter.checkForMongoCrypt(),$.encrypter=new oj.Encrypter(A,F,D),$.autoEncrypter=$.encrypter.autoEncrypter;if($.userSpecifiedAuthSource=Y.has("authSource")||G.has("authSource"),$.userSpecifiedReplicaSet=Y.has("replicaSet")||G.has("replicaSet"),X){if($.srvHost=J[0],$.directConnection)throw new F1.MongoAPIError("SRV URI does not support directConnection");if($.srvMaxHosts>0&&typeof $.replicaSet==="string")throw new F1.MongoParseError("Cannot use srvMaxHosts option with replicaSet");let Q=!Y.has("tls")&&!G.has("tls"),K=!Y.has("ssl")&&!G.has("ssl");if(Q&&K)$.tls=!0}else if(G.has("srvMaxHosts")||Y.has("srvMaxHosts")||G.has("srvServiceName")||Y.has("srvServiceName"))throw new F1.MongoParseError("Cannot use srvMaxHosts or srvServiceName with a non-srv connection string");if($.directConnection&&$.hosts.length!==1)throw new F1.MongoParseError("directConnection option requires exactly one host");if(!$.proxyHost&&($.proxyPort||$.proxyUsername||$.proxyPassword))throw new F1.MongoParseError("Must specify proxyHost if other proxy options are passed");if($.proxyUsername&&!$.proxyPassword||!$.proxyUsername&&$.proxyPassword)throw new F1.MongoParseError("Can only specify both of proxy username/password or neither");if(["proxyHost","proxyPort","proxyUsername","proxyPassword"].map((Q)=>G.get(Q)??[]).some((Q)=>Q.length>1))throw new F1.MongoParseError("Proxy options cannot be specified multiple times in the connection string");return $.mongoLoggerOptions=sB.MongoLogger.resolveOptions({MONGODB_LOG_COMMAND:process.env.MONGODB_LOG_COMMAND,MONGODB_LOG_TOPOLOGY:process.env.MONGODB_LOG_TOPOLOGY,MONGODB_LOG_SERVER_SELECTION:process.env.MONGODB_LOG_SERVER_SELECTION,MONGODB_LOG_CONNECTION:process.env.MONGODB_LOG_CONNECTION,MONGODB_LOG_CLIENT:process.env.MONGODB_LOG_CLIENT,MONGODB_LOG_ALL:process.env.MONGODB_LOG_ALL,MONGODB_LOG_MAX_DOCUMENT_LENGTH:process.env.MONGODB_LOG_MAX_DOCUMENT_LENGTH,MONGODB_LOG_PATH:process.env.MONGODB_LOG_PATH},{mongodbLogPath:$.mongodbLogPath,mongodbLogComponentSeverities:$.mongodbLogComponentSeverities,mongodbLogMaxDocumentLength:$.mongodbLogMaxDocumentLength}),$.metadata=rj.makeClientMetadata($),$.extendedMetadata=rj.addContainerMetadata($.metadata).then(void 0,e0.squashError),$}function rB(F,A,D){if(A.loadBalanced){if(F.length>1)throw new F1.MongoParseError(h51);if(A.replicaSet)throw new F1.MongoParseError(v51);if(A.directConnection)throw new F1.MongoParseError(m51);if(D&&A.srvMaxHosts>0)throw new F1.MongoParseError("Cannot limit srv hosts with loadBalanced enabled")}return}function FT(F,A,D,Z){let{target:J,type:X,transform:$}=D,G=J??A;switch(X){case"boolean":F[G]=i3(G,Z[0]);break;case"int":F[G]=tB(G,Z[0]);break;case"uint":F[G]=YF(G,Z[0]);break;case"string":if(Z[0]==null)break;F[G]=String(Z[0]);break;case"record":if(!e0.isRecord(Z[0]))throw new F1.MongoParseError(`${G} must be an object`);F[G]=Z[0];break;case"any":F[G]=Z[0];break;default:{if(!$)throw new F1.MongoParseError("Descriptors missing a type must define a transform");let Y=$({name:G,options:F,values:Z});F[G]=Y;break}}}DT.OPTIONS={appName:{type:"string"},auth:{target:"credentials",transform({name:F,options:A,values:[D]}){if(!e0.isRecord(D,["username","password"]))throw new F1.MongoParseError(`${F} must be an object with 'username' and 'password' properties`);return F8.MongoCredentials.merge(A.credentials,{username:D.username,password:D.password})}},authMechanism:{target:"credentials",transform({options:F,values:[A]}){let D=Object.values(I3.AuthMechanism),[Z]=D.filter(($)=>$.match(RegExp(String.raw`\b${A}\b`,"i")));if(!Z)throw new F1.MongoParseError(`authMechanism one of ${D}, got ${A}`);let J=F.credentials?.source;if(Z===I3.AuthMechanism.MONGODB_PLAIN||I3.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(Z))J="$external";let X=F.credentials?.password;if(Z===I3.AuthMechanism.MONGODB_X509&&X==="")X=void 0;return F8.MongoCredentials.merge(F.credentials,{mechanism:Z,source:J,password:X})}},authMechanismProperties:{target:"credentials",transform({options:F,values:A}){let D=Object.create(null);for(let Z of A)if(typeof Z==="string")for(let[J,X]of ej(Z))try{D[J]=i3(J,X)}catch{D[J]=X}else{if(!e0.isRecord(Z))throw new F1.MongoParseError("AuthMechanismProperties must be an object");D={...Z}}return F8.MongoCredentials.merge(F.credentials,{mechanismProperties:D})}},authSource:{target:"credentials",transform({options:F,values:[A]}){let D=String(A);return F8.MongoCredentials.merge(F.credentials,{source:D})}},autoEncryption:{type:"record"},autoSelectFamily:{type:"boolean",default:!0},autoSelectFamilyAttemptTimeout:{type:"uint"},bsonRegExp:{type:"boolean"},serverApi:{target:"serverApi",transform({values:[F]}){let A=typeof F==="string"?{version:F}:F,D=A&&A.version;if(!D)throw new F1.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(CZ.ServerApiVersion).join('", "')}"]`);if(!Object.values(CZ.ServerApiVersion).some((Z)=>Z===D))throw new F1.MongoParseError(`Invalid server API version=${D}; must be in the following enum: ["${Object.values(CZ.ServerApiVersion).join('", "')}"]`);return A}},checkKeys:{type:"boolean"},compressors:{default:"none",target:"compressors",transform({values:F}){let A=new Set;for(let D of F){let Z=typeof D==="string"?D.split(","):D;if(!Array.isArray(Z))throw new F1.MongoInvalidArgumentError("compressors must be an array or a comma-delimited list of strings");for(let J of Z)if(Object.keys(tj.Compressor).includes(String(J)))A.add(String(J));else throw new F1.MongoInvalidArgumentError(`${J} is not a valid compression mechanism. Must be one of: ${Object.keys(tj.Compressor)}.`)}return[...A]}},connectTimeoutMS:{default:30000,type:"uint"},dbName:{type:"string"},directConnection:{default:!1,type:"boolean"},driverInfo:{default:{},type:"record"},enableUtf8Validation:{type:"boolean",default:!0},family:{transform({name:F,values:[A]}){let D=tB(F,A);if(D===4||D===6)return D;throw new F1.MongoParseError(`Option 'family' must be 4 or 6 got ${D}.`)}},fieldsAsRaw:{type:"record"},forceServerObjectId:{default:!1,type:"boolean"},fsync:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:F,options:A,values:[D]}){let Z=p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,fsync:i3(F,D)}});if(!Z)throw new F1.MongoParseError(`Unable to make a writeConcern from fsync=${D}`);return Z}},heartbeatFrequencyMS:{default:1e4,type:"uint"},ignoreUndefined:{type:"boolean"},j:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:F,options:A,values:[D]}){let Z=p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,journal:i3(F,D)}});if(!Z)throw new F1.MongoParseError(`Unable to make a writeConcern from journal=${D}`);return Z}},journal:{target:"writeConcern",transform({name:F,options:A,values:[D]}){let Z=p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,journal:i3(F,D)}});if(!Z)throw new F1.MongoParseError(`Unable to make a writeConcern from journal=${D}`);return Z}},loadBalanced:{default:!1,type:"boolean"},localThresholdMS:{default:15,type:"uint"},maxConnecting:{default:2,transform({name:F,values:[A]}){let D=YF(F,A);if(D===0)throw new F1.MongoInvalidArgumentError("maxConnecting must be > 0 if specified");return D}},maxIdleTimeMS:{default:0,type:"uint"},maxPoolSize:{default:100,type:"uint"},maxStalenessSeconds:{target:"readPreference",transform({name:F,options:A,values:[D]}){let Z=YF(F,D);if(A.readPreference)return b4.ReadPreference.fromOptions({readPreference:{...A.readPreference,maxStalenessSeconds:Z}});else return new b4.ReadPreference("secondary",void 0,{maxStalenessSeconds:Z})}},minInternalBufferSize:{type:"uint"},minPoolSize:{default:0,type:"uint"},minHeartbeatFrequencyMS:{default:500,type:"uint"},monitorCommands:{default:!1,type:"boolean"},name:{target:"driverInfo",transform({values:[F],options:A}){return{...A.driverInfo,name:String(F)}}},noDelay:{default:!0,type:"boolean"},pkFactory:{default:e0.DEFAULT_PK_FACTORY,transform({values:[F]}){if(e0.isRecord(F,["createPk"])&&typeof F.createPk==="function")return F;throw new F1.MongoParseError(`Option pkFactory must be an object with a createPk function, got ${F}`)}},promoteBuffers:{type:"boolean"},promoteLongs:{type:"boolean"},promoteValues:{type:"boolean"},useBigInt64:{type:"boolean"},proxyHost:{type:"string"},proxyPassword:{type:"string"},proxyPort:{type:"uint"},proxyUsername:{type:"string"},raw:{default:!1,type:"boolean"},readConcern:{transform({values:[F],options:A}){if(F instanceof aB.ReadConcern||e0.isRecord(F,["level"]))return aB.ReadConcern.fromOptions({...A.readConcern,...F});throw new F1.MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(F)}`)}},readConcernLevel:{target:"readConcern",transform({values:[F],options:A}){return aB.ReadConcern.fromOptions({...A.readConcern,level:F})}},readPreference:{default:b4.ReadPreference.primary,transform({values:[F],options:A}){if(F instanceof b4.ReadPreference)return b4.ReadPreference.fromOptions({readPreference:{...A.readPreference,...F},...F});if(e0.isRecord(F,["mode"])){let D=b4.ReadPreference.fromOptions({readPreference:{...A.readPreference,...F},...F});if(D)return D;else throw new F1.MongoParseError(`Cannot make read preference from ${JSON.stringify(F)}`)}if(typeof F==="string"){let D={hedge:A.readPreference?.hedge,maxStalenessSeconds:A.readPreference?.maxStalenessSeconds};return new b4.ReadPreference(F,A.readPreference?.tags,D)}throw new F1.MongoParseError(`Unknown ReadPreference value: ${F}`)}},readPreferenceTags:{target:"readPreference",transform({values:F,options:A}){let D=Array.isArray(F[0])?F[0]:F,Z=[];for(let J of D){let X=Object.create(null);if(typeof J==="string")for(let[$,G]of ej(J))X[$]=G;if(e0.isRecord(J))for(let[$,G]of Object.entries(J))X[$]=G;Z.push(X)}return b4.ReadPreference.fromOptions({readPreference:A.readPreference,readPreferenceTags:Z})}},replicaSet:{type:"string"},retryReads:{default:!0,type:"boolean"},retryWrites:{default:!0,type:"boolean"},serializeFunctions:{type:"boolean"},serverMonitoringMode:{default:"auto",transform({values:[F]}){if(!Object.values(b51.ServerMonitoringMode).includes(F))throw new F1.MongoParseError("serverMonitoringMode must be one of `auto`, `poll`, or `stream`");return F}},serverSelectionTimeoutMS:{default:30000,type:"uint"},servername:{type:"string"},socketTimeoutMS:{default:0,type:"uint"},srvMaxHosts:{type:"uint",default:0},srvServiceName:{type:"string",default:"mongodb"},ssl:{target:"tls",type:"boolean"},timeoutMS:{type:"uint"},tls:{type:"boolean"},tlsAllowInvalidCertificates:{target:"rejectUnauthorized",transform({name:F,values:[A]}){return!i3(F,A)}},tlsAllowInvalidHostnames:{target:"checkServerIdentity",transform({name:F,values:[A]}){return i3(F,A)?()=>{return}:void 0}},tlsCAFile:{type:"string"},tlsCRLFile:{type:"string"},tlsCertificateKeyFile:{type:"string"},tlsCertificateKeyFilePassword:{target:"passphrase",type:"any"},tlsInsecure:{transform({name:F,options:A,values:[D]}){let Z=i3(F,D);if(Z)A.checkServerIdentity=()=>{return},A.rejectUnauthorized=!1;else A.checkServerIdentity=A.tlsAllowInvalidHostnames?()=>{return}:void 0,A.rejectUnauthorized=A.tlsAllowInvalidCertificates?!1:!0;return Z}},w:{target:"writeConcern",transform({values:[F],options:A}){return p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,w:F}})}},waitQueueTimeoutMS:{default:0,type:"uint"},writeConcern:{target:"writeConcern",transform({values:[F],options:A}){if(e0.isRecord(F)||F instanceof p3.WriteConcern)return p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,...F}});else if(F==="majority"||typeof F==="number")return p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,w:F}});throw new F1.MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(F)}`)}},wtimeout:{deprecated:"Please use wtimeoutMS instead",target:"writeConcern",transform({values:[F],options:A}){let D=p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,wtimeout:YF("wtimeout",F)}});if(D)return D;throw new F1.MongoParseError("Cannot make WriteConcern from wtimeout")}},wtimeoutMS:{target:"writeConcern",transform({values:[F],options:A}){let D=p3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,wtimeoutMS:YF("wtimeoutMS",F)}});if(D)return D;throw new F1.MongoParseError("Cannot make WriteConcern from wtimeout")}},zlibCompressionLevel:{default:0,type:"int"},mongodbLogPath:{transform({values:[F]}){if(!(typeof F==="string"&&["stderr","stdout"].includes(F)||F&&typeof F==="object"&&("write"in F)&&typeof F.write==="function"))throw new F1.MongoAPIError("Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable");return F}},mongodbLogComponentSeverities:{transform({values:[F]}){if(typeof F!=="object"||!F)throw new F1.MongoAPIError("Option 'mongodbLogComponentSeverities' must be a non-null object");for(let[A,D]of Object.entries(F)){if(typeof D!=="string"||typeof A!=="string")throw new F1.MongoAPIError("User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value");if(!Object.values(sB.MongoLoggableComponent).some((Z)=>Z===A)&&A!=="default")throw new F1.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' contains invalid key: ${A}`);if(!Object.values(sB.SeverityLevel).some((Z)=>Z===D))throw new F1.MongoAPIError(`Option 'mongodbLogComponentSeverities' does not support ${D} as a value for ${A}`)}return F}},mongodbLogMaxDocumentLength:{type:"uint"},connectionType:{type:"any"},srvPoller:{type:"any"},allowPartialTrustChain:{type:"any"},minDHSize:{type:"any"},pskCallback:{type:"any"},secureContext:{type:"any"},enableTrace:{type:"any"},requestCert:{type:"any"},rejectUnauthorized:{type:"any"},checkServerIdentity:{type:"any"},ALPNProtocols:{type:"any"},SNICallback:{type:"any"},session:{type:"any"},requestOCSP:{type:"any"},localAddress:{type:"any"},localPort:{type:"any"},hints:{type:"any"},lookup:{type:"any"},ca:{type:"any"},cert:{type:"any"},ciphers:{type:"any"},crl:{type:"any"},ecdhCurve:{type:"any"},key:{type:"any"},passphrase:{type:"any"},pfx:{type:"any"},secureProtocol:{type:"any"},index:{type:"any"},useNewUrlParser:{type:"boolean",deprecated:"useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version"},useUnifiedTopology:{type:"boolean",deprecated:"useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version"},__skipPingOnConnect:{type:"boolean"}};DT.DEFAULT_OPTIONS=new GF(Object.entries(DT.OPTIONS).filter(([,F])=>F.default!=null).map(([F,A])=>[F,A.default]))});var $T=E((JT)=>{Object.defineProperty(JT,"__esModule",{value:!0});JT.MongoDBAWS=void 0;var eB=k1(),FH=F3(),D8=n(),A8=e(),s51=j4(),AH=oG(),r51=MD(),t51=V3(),o51=110,DH={useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1};class ZT extends s51.AuthProvider{constructor(F){super();this.credentialProvider=F,this.credentialFetcher=AH.AWSTemporaryCredentialProvider.isAWSSDKInstalled?new AH.AWSSDKCredentialProvider(F):new AH.LegacyAWSTemporaryCredentialProvider}async auth(F){let{connection:A}=F;if(!F.credentials)throw new D8.MongoMissingCredentialsError("AuthContext must provide credentials.");if("kModuleError"in FH.aws4)throw FH.aws4.kModuleError;let{sign:D}=FH.aws4;if(A8.maxWireVersion(A)<9)throw new D8.MongoCompatibilityError("MONGODB-AWS authentication requires MongoDB version 4.4 or later");if(!F.credentials.username)F.credentials=await e51(F.credentials,this.credentialFetcher);let{credentials:Z}=F,J=Z.username,X=Z.password,$=Z.mechanismProperties.AWS_SESSION_TOKEN,G=J&&X&&$?{accessKeyId:J,secretAccessKey:X,sessionToken:$}:J&&X?{accessKeyId:J,secretAccessKey:X}:void 0,Y=Z.source,B=await A8.randomBytes(32),H={saslStart:1,mechanism:"MONGODB-AWS",payload:eB.serialize({r:B,p:o51},DH)},q=await A.command(A8.ns(`${Y}.$cmd`),H,void 0),W=eB.deserialize(q.payload.buffer,DH),C=W.h,Q=W.s.buffer;if(Q.length!==64)throw new D8.MongoRuntimeError(`Invalid server nonce length ${Q.length}, expected 64`);if(!A8.ByteUtils.equals(Q.subarray(0,B.byteLength),B))throw new D8.MongoRuntimeError("Server nonce does not begin with client nonce");if(C.length<1||C.length>255||C.indexOf("..")!==-1)throw new D8.MongoRuntimeError(`Server returned an invalid host: "${C}"`);let K="Action=GetCallerIdentity&Version=2011-06-15",U=D({method:"POST",host:C,region:FF1(W.h),service:"sts",headers:{"Content-Type":"application/x-www-form-urlencoded","Content-Length":K.length,"X-MongoDB-Server-Nonce":A8.ByteUtils.toBase64(Q),"X-MongoDB-GS2-CB-Flag":"n"},path:"/",body:K},G),z={a:U.headers.Authorization,d:U.headers["X-Amz-Date"]};if($)z.t=$;let L={saslContinue:1,conversationId:q.conversationId,payload:eB.serialize(z,DH)};await A.command(A8.ns(`${Y}.$cmd`),L,void 0)}}JT.MongoDBAWS=ZT;async function e51(F,A){function D(J){if(!J.AccessKeyId||!J.SecretAccessKey)throw new D8.MongoMissingCredentialsError("Could not obtain temporary MONGODB-AWS credentials");return new r51.MongoCredentials({username:J.AccessKeyId,password:J.SecretAccessKey,source:F.source,mechanism:t51.AuthMechanism.MONGODB_AWS,mechanismProperties:{AWS_SESSION_TOKEN:J.Token}})}let Z=await A.getCredentials();return D(Z)}function FF1(F){let A=F.split(".");if(A.length===1||A[1]==="amazonaws")return"us-east-1";return A[1]}});var ZH=E((GT)=>{Object.defineProperty(GT,"__esModule",{value:!0});GT.finishCommandDocument=AF1;GT.startCommandDocument=DF1;var Z8=k1(),YT=V3();function AF1(F,A){if(A!=null)return{saslContinue:1,conversationId:A,payload:new Z8.Binary(Z8.BSON.serialize({jwt:F}))};return{saslStart:1,mechanism:YT.AuthMechanism.MONGODB_OIDC,payload:new Z8.Binary(Z8.BSON.serialize({jwt:F}))}}function DF1(F){let A={};if(F.username)A.n=F.username;return{saslStart:1,autoAuthorize:1,mechanism:YT.AuthMechanism.MONGODB_OIDC,payload:new Z8.Binary(Z8.BSON.serialize(A))}}});var BF=E((qT)=>{Object.defineProperty(qT,"__esModule",{value:!0});qT.MachineWorkflow=void 0;var XF1=i("node:timers/promises"),$F1=e(),BT=ZH(),JH=100;class HT{constructor(F){this.cache=F,this.callback=this.withLock(this.getToken.bind(this)),this.lastExecutionTime=Date.now()-JH}async execute(F,A){let D=await this.getTokenFromCacheOrEnv(F,A),Z=BT.finishCommandDocument(D);await F.command($F1.ns(A.source),Z,void 0)}async reauthenticate(F,A){if(this.cache.hasAccessToken)if(F.accessToken===this.cache.getAccessToken())this.cache.removeAccessToken(),delete F.accessToken;else F.accessToken=this.cache.getAccessToken();await this.execute(F,A)}async speculativeAuth(F,A){if(!this.cache.hasAccessToken)return{};let D=await this.getTokenFromCacheOrEnv(F,A),Z=BT.finishCommandDocument(D);return Z.db=A.source,{speculativeAuthenticate:Z}}async getTokenFromCacheOrEnv(F,A){if(this.cache.hasAccessToken){let D=this.cache.getAccessToken();if(!F.accessToken)F.accessToken=D;return D}else{let D=await this.callback(A);return this.cache.put({accessToken:D.access_token,expiresInSeconds:D.expires_in}),F.accessToken=D.access_token,D.access_token}}withLock(F){let A=Promise.resolve();return async(D)=>{return await A,A=A.catch(()=>null).then(async()=>{let Z=Date.now()-this.lastExecutionTime;if(Z<=JH)await XF1.setTimeout(JH-Z);return this.lastExecutionTime=Date.now(),await F(D)}),await A}}}qT.MachineWorkflow=HT});var UT=E((KT)=>{Object.defineProperty(KT,"__esModule",{value:!0});KT.AzureMachineWorkflow=void 0;var CT=AB(),XH=n(),YF1=e(),GF1=BF(),BF1=Object.freeze({Metadata:"true",Accept:"application/json"}),HF1="Azure endpoint did not return a value with only access_token and expires_in properties",qF1="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.";class QT extends GF1.MachineWorkflow{constructor(F){super(F)}async getToken(F){let A=F?.mechanismProperties.TOKEN_RESOURCE,D=F?.username;if(!A)throw new XH.MongoAzureError(qF1);let Z=await WF1(A,D);if(!CF1(Z))throw new XH.MongoAzureError(HF1);return Z}}KT.AzureMachineWorkflow=QT;async function WF1(F,A){let D=new URL(CT.AZURE_BASE_URL);CT.addAzureParams(D,F,A);let Z=await YF1.get(D,{headers:BF1});if(Z.status!==200)throw new XH.MongoAzureError(`Status code ${Z.status} returned from the Azure endpoint. Response body: ${Z.body}`);let J=JSON.parse(Z.body);return{access_token:J.access_token,expires_in:Number(J.expires_in)}}function CF1(F){if(F==null||typeof F!=="object")return!1;return"access_token"in F&&typeof F.access_token==="string"&&"expires_in"in F&&typeof F.expires_in==="number"}});var wT=E((LT)=>{Object.defineProperty(LT,"__esModule",{value:!0});LT.GCPMachineWorkflow=void 0;var zT=n(),QF1=e(),KF1=BF(),EF1="http://metadata/computeMetadata/v1/instance/service-accounts/default/identity",UF1=Object.freeze({"Metadata-Flavor":"Google"}),zF1="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp.";class VT extends KF1.MachineWorkflow{constructor(F){super(F)}async getToken(F){let A=F?.mechanismProperties.TOKEN_RESOURCE;if(!A)throw new zT.MongoGCPError(zF1);return await VF1(A)}}LT.GCPMachineWorkflow=VT;async function VF1(F){let A=new URL(EF1);A.searchParams.append("audience",F);let D=await QF1.get(A,{headers:UF1});if(D.status!==200)throw new zT.MongoGCPError(`Status code ${D.status} returned from the GCP endpoint. Response body: ${D.body}`);return{access_token:D.body}}});var TT=E((NT)=>{Object.defineProperty(NT,"__esModule",{value:!0});NT.K8SMachineWorkflow=void 0;var LF1=i("node:fs/promises"),RF1=BF(),wF1="/var/run/secrets/kubernetes.io/serviceaccount/token",PT="AZURE_FEDERATED_TOKEN_FILE",IT="AWS_WEB_IDENTITY_TOKEN_FILE";class MT extends RF1.MachineWorkflow{constructor(F){super(F)}async getToken(){let F;if(process.env[PT])F=process.env[PT];else if(process.env[IT])F=process.env[IT];else F=wF1;return{access_token:await LF1.readFile(F,"utf8")}}}NT.K8SMachineWorkflow=MT});var $H=E((OT)=>{Object.defineProperty(OT,"__esModule",{value:!0});OT.TokenCache=void 0;var PF1=n();class EZ extends PF1.MongoDriverError{}class kT{get hasAccessToken(){return!!this.accessToken}get hasRefreshToken(){return!!this.refreshToken}get hasIdpInfo(){return!!this.idpInfo}getAccessToken(){if(!this.accessToken)throw new EZ("Attempted to get an access token when none exists.");return this.accessToken}getRefreshToken(){if(!this.refreshToken)throw new EZ("Attempted to get a refresh token when none exists.");return this.refreshToken}getIdpInfo(){if(!this.idpInfo)throw new EZ("Attempted to get IDP information when none exists.");return this.idpInfo}put(F,A){if(this.accessToken=F.accessToken,this.refreshToken=F.refreshToken,this.expiresInSeconds=F.expiresInSeconds,A)this.idpInfo=A}removeAccessToken(){this.accessToken=void 0}removeRefreshToken(){this.refreshToken=void 0}}OT.TokenCache=kT});var gT=E((uT)=>{Object.defineProperty(uT,"__esModule",{value:!0});uT.TokenMachineWorkflow=void 0;var IF1=i("node:fs"),MF1=n(),NF1=BF(),jF1="OIDC_TOKEN_FILE must be set in the environment.";class _T extends NF1.MachineWorkflow{constructor(F){super(F)}async getToken(){let F=process.env.OIDC_TOKEN_FILE;if(!F)throw new MF1.MongoAWSError(jF1);return{access_token:await IF1.promises.readFile(F,"utf8")}}}uT.TokenMachineWorkflow=_T});var zZ=E((hT)=>{Object.defineProperty(hT,"__esModule",{value:!0});hT.MongoDBOIDC=hT.OIDC_WORKFLOWS=hT.OIDC_VERSION=void 0;var yT=n(),TF1=j4(),kF1=UT(),OF1=wT(),SF1=TT(),UZ=$H(),_F1=gT(),uF1="AuthContext must provide credentials.";hT.OIDC_VERSION=1;hT.OIDC_WORKFLOWS=new Map;hT.OIDC_WORKFLOWS.set("test",()=>new _F1.TokenMachineWorkflow(new UZ.TokenCache));hT.OIDC_WORKFLOWS.set("azure",()=>new kF1.AzureMachineWorkflow(new UZ.TokenCache));hT.OIDC_WORKFLOWS.set("gcp",()=>new OF1.GCPMachineWorkflow(new UZ.TokenCache));hT.OIDC_WORKFLOWS.set("k8s",()=>new SF1.K8SMachineWorkflow(new UZ.TokenCache));class bT extends TF1.AuthProvider{constructor(F){super();if(!F)throw new yT.MongoInvalidArgumentError("No workflow provided to the OIDC auth provider.");this.workflow=F}async auth(F){let{connection:A,reauthenticating:D,response:Z}=F;if(Z?.speculativeAuthenticate?.done&&!D)return;let J=fT(F);if(D)await this.workflow.reauthenticate(A,J);else await this.workflow.execute(A,J,Z)}async prepare(F,A){let{connection:D}=A,Z=fT(A),J=await this.workflow.speculativeAuth(D,Z);return{...F,...J}}}hT.MongoDBOIDC=bT;function fT(F){let{credentials:A}=F;if(!A)throw new yT.MongoMissingCredentialsError(uF1);return A}});var BH=E((cT)=>{Object.defineProperty(cT,"__esModule",{value:!0});cT.CallbackWorkflow=cT.AUTOMATED_TIMEOUT_MS=cT.HUMAN_TIMEOUT_MS=void 0;var gF1=i("node:timers/promises"),fF1=n(),mT=e(),YH=ZH();cT.HUMAN_TIMEOUT_MS=300000;cT.AUTOMATED_TIMEOUT_MS=60000;var yF1=["accessToken","expiresInSeconds","refreshToken"],bF1="User provided OIDC callbacks must return a valid object with an accessToken.",GH=100;class dT{constructor(F,A){this.cache=F,this.callback=this.withLock(A),this.lastExecutionTime=Date.now()-GH}async speculativeAuth(F,A){if(this.cache.hasAccessToken){let D=this.cache.getAccessToken();F.accessToken=D;let Z=YH.finishCommandDocument(D);return Z.db=A.source,{speculativeAuthenticate:Z}}return{}}async reauthenticate(F,A){if(this.cache.hasAccessToken)if(F.accessToken===this.cache.getAccessToken())this.cache.removeAccessToken(),delete F.accessToken;else F.accessToken=this.cache.getAccessToken();await this.execute(F,A)}async startAuthentication(F,A,D){let Z;if(D?.speculativeAuthenticate)Z=D.speculativeAuthenticate;else Z=await F.command(mT.ns(A.source),YH.startCommandDocument(A),void 0);return Z}async finishAuthentication(F,A,D,Z){await F.command(mT.ns(A.source),YH.finishCommandDocument(D,Z),void 0)}async executeAndValidateCallback(F){let A=await this.callback(F);if(hF1(A))throw new fF1.MongoMissingCredentialsError(bF1);return A}withLock(F){let A=Promise.resolve();return async(D)=>{return await A,A=A.catch(()=>null).then(async()=>{let Z=Date.now()-this.lastExecutionTime;if(Z<=GH)await gF1.setTimeout(GH-Z,{signal:D.timeoutContext});return this.lastExecutionTime=Date.now(),await F(D)}),await A}}}cT.CallbackWorkflow=dT;function hF1(F){if(F==null||typeof F!=="object")return!0;if(!("accessToken"in F))return!0;return!Object.getOwnPropertyNames(F).every((A)=>yF1.includes(A))}});var sT=E((aT)=>{Object.defineProperty(aT,"__esModule",{value:!0});aT.AutomatedCallbackWorkflow=void 0;var HH=n(),pT=G2(),dF1=zZ(),qH=BH();class iT extends qH.CallbackWorkflow{constructor(F,A){super(F,A)}async execute(F,A){if(this.cache.hasAccessToken){let Z=this.cache.getAccessToken();try{return await this.finishAuthentication(F,A,Z)}catch(J){if(J instanceof HH.MongoError&&J.code===HH.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),await this.execute(F,A);else throw J}}let D=await this.fetchAccessToken(A);this.cache.put(D),F.accessToken=D.accessToken,await this.finishAuthentication(F,A,D.accessToken)}async fetchAccessToken(F){let A=new AbortController,D={timeoutContext:A.signal,version:dF1.OIDC_VERSION};if(F.username)D.username=F.username;let Z=pT.Timeout.expires(qH.AUTOMATED_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(D),Z])}catch(J){if(pT.TimeoutError.is(J))throw A.abort(),new HH.MongoOIDCError(`OIDC callback timed out after ${qH.AUTOMATED_TIMEOUT_MS}ms.`);throw J}finally{Z.clear()}}}aT.AutomatedCallbackWorkflow=iT});var Fk=E((oT)=>{Object.defineProperty(oT,"__esModule",{value:!0});oT.HumanCallbackWorkflow=void 0;var cF1=k1(),qF=n(),rT=G2(),lF1=zZ(),WH=BH();class tT extends WH.CallbackWorkflow{constructor(F,A){super(F,A)}async execute(F,A){if(this.cache.hasAccessToken){let $=this.cache.getAccessToken();F.accessToken=$;try{return await this.finishAuthentication(F,A,$)}catch(G){if(G instanceof qF.MongoError&&G.code===qF.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),delete F.accessToken,await this.execute(F,A);else throw G}}if(this.cache.hasRefreshToken){let $=this.cache.getRefreshToken(),G=await this.fetchAccessToken(this.cache.getIdpInfo(),A,$);this.cache.put(G),F.accessToken=G.accessToken;try{return await this.finishAuthentication(F,A,G.accessToken)}catch(Y){if(Y instanceof qF.MongoError&&Y.code===qF.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeRefreshToken(),delete F.accessToken,await this.execute(F,A);else throw Y}}let D=await this.startAuthentication(F,A),Z=D.conversationId,J=cF1.BSON.deserialize(D.payload.buffer),X=await this.fetchAccessToken(J,A);return this.cache.put(X,J),F.accessToken=X.accessToken,await this.finishAuthentication(F,A,X.accessToken,Z)}async fetchAccessToken(F,A,D){let Z=new AbortController,J={timeoutContext:Z.signal,version:lF1.OIDC_VERSION,idpInfo:F};if(A.username)J.username=A.username;if(D)J.refreshToken=D;let X=rT.Timeout.expires(WH.HUMAN_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(J),X])}catch($){if(rT.TimeoutError.is($))throw Z.abort(),new qF.MongoOIDCError(`OIDC callback timed out after ${WH.HUMAN_TIMEOUT_MS}ms.`);throw $}finally{X.clear()}}}oT.HumanCallbackWorkflow=tT});var Jk=E((Dk)=>{Object.defineProperty(Dk,"__esModule",{value:!0});Dk.Plain=void 0;var pF1=k1(),iF1=n(),aF1=e(),nF1=j4();class Ak extends nF1.AuthProvider{async auth(F){let{connection:A,credentials:D}=F;if(!D)throw new iF1.MongoMissingCredentialsError("AuthContext must provide credentials.");let{username:Z,password:J}=D,$={saslStart:1,mechanism:"PLAIN",payload:new pF1.Binary(Buffer.from(`\x00${Z}\x00${J}`)),autoAuthorize:1};await A.command(aF1.ns("$external.$cmd"),$,void 0)}}Dk.Plain=Ak});var Gk=E((hP1,Yk)=>{var Xk=(F)=>F.codePointAt(0),sF1=(F)=>F[0],rF1=(F)=>F[F.length-1];function $k(F){let A=[],D=F.length;for(let Z=0;Z<D;Z+=1){let J=F.charCodeAt(Z);if(J>=55296&&J<=56319&&D>Z+1){let X=F.charCodeAt(Z+1);if(X>=56320&&X<=57343){A.push((J-55296)*1024+X-56320+65536),Z+=1;continue}}A.push(J)}return A}function WF({unassigned_code_points:F,commonly_mapped_to_nothing:A,non_ASCII_space_characters:D,prohibited_characters:Z,bidirectional_r_al:J,bidirectional_l:X},$,G={}){let Y=D,B=A;if(typeof $!=="string")throw new TypeError("Expected string.");if($.length===0)return"";let H=$k($).map((L)=>Y.get(L)?32:L).filter((L)=>!B.get(L)),q=String.fromCodePoint.apply(null,H).normalize("NFKC"),W=$k(q);if(W.some((L)=>Z.get(L)))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(G.allowUnassigned!==!0){if(W.some((V)=>F.get(V)))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}let Q=W.some((L)=>J.get(L)),K=W.some((L)=>X.get(L));if(Q&&K)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");let U=J.get(Xk(sF1(q))),z=J.get(Xk(rF1(q)));if(Q&&!(U&&z))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return q}WF.saslprep=WF;WF.default=WF;Yk.exports=WF});var qk=E((vP1,Hk)=>{Hk.exports=a3;function a3(F,A){if(!(this instanceof a3))return new a3(F,A);this.length=0,this.updates=[],this.path=new Uint16Array(4),this.pages=new Array(32768),this.maxPages=this.pages.length,this.level=0,this.pageSize=F||1024,this.deduplicate=A?A.deduplicate:null,this.zeros=this.deduplicate?VZ(this.deduplicate.length):null}a3.prototype.updated=function(F){while(this.deduplicate&&F.buffer[F.deduplicate]===this.deduplicate[F.deduplicate])if(F.deduplicate++,F.deduplicate===this.deduplicate.length){if(F.deduplicate=0,F.buffer.equals&&F.buffer.equals(this.deduplicate))F.buffer=this.deduplicate;break}if(F.updated||!this.updates)return;F.updated=!0,this.updates.push(F)};a3.prototype.lastUpdate=function(){if(!this.updates||!this.updates.length)return null;var F=this.updates.pop();return F.updated=!1,F};a3.prototype._array=function(F,A){if(F>=this.maxPages){if(A)return;tF1(this,F)}FA1(F,this.path);var D=this.pages;for(var Z=this.level;Z>0;Z--){var J=this.path[Z],X=D[J];if(!X){if(A)return;X=D[J]=new Array(32768)}D=X}return D};a3.prototype.get=function(F,A){var D=this._array(F,A),Z=this.path[0],J=D&&D[Z];if(!J&&!A){if(J=D[Z]=new Bk(F,VZ(this.pageSize)),F>=this.length)this.length=F+1}if(J&&J.buffer===this.deduplicate&&this.deduplicate&&!A)J.buffer=eF1(J.buffer),J.deduplicate=0;return J};a3.prototype.set=function(F,A){var D=this._array(F,!1),Z=this.path[0];if(F>=this.length)this.length=F+1;if(!A||this.zeros&&A.equals&&A.equals(this.zeros)){D[Z]=void 0;return}if(this.deduplicate&&A.equals&&A.equals(this.deduplicate))A=this.deduplicate;var J=D[Z],X=oF1(A,this.pageSize);if(J)J.buffer=X;else D[Z]=new Bk(F,X)};a3.prototype.toBuffer=function(){var F=new Array(this.length),A=VZ(this.pageSize),D=0;while(D<F.length){var Z=this._array(D,!0);for(var J=0;J<32768&&D<F.length;J++)F[D++]=Z&&Z[J]?Z[J].buffer:A}return Buffer.concat(F)};function tF1(F,A){while(F.maxPages<A){var D=F.pages;F.pages=new Array(32768),F.pages[0]=D,F.level++,F.maxPages*=32768}}function oF1(F,A){if(F.length===A)return F;if(F.length>A)return F.slice(0,A);var D=VZ(A);return F.copy(D),D}function VZ(F){if(Buffer.alloc)return Buffer.alloc(F);var A=new Buffer(F);return A.fill(0),A}function eF1(F){var A=Buffer.allocUnsafe?Buffer.allocUnsafe(F.length):new Buffer(F.length);return F.copy(A),A}function Bk(F,A){this.offset=F*A.length,this.buffer=A,this.updated=!1,this.deduplicate=0}function FA1(F,A){F=(F-(A[0]=F&32767))/32768,F=(F-(A[1]=F&32767))/32768,A[3]=(F-(A[2]=F&32767))/32768&32767}});var Ck=E((mP1,Wk)=>{var AA1=qk();Wk.exports=h4;function h4(F){if(!(this instanceof h4))return new h4(F);if(!F)F={};if(Buffer.isBuffer(F))F={buffer:F};if(this.pageOffset=F.pageOffset||0,this.pageSize=F.pageSize||1024,this.pages=F.pages||AA1(this.pageSize),this.byteLength=this.pages.length*this.pageSize,this.length=8*this.byteLength,!ZA1(this.pageSize))throw new Error("The page size should be a power of two");if(this._trackUpdates=!!F.trackUpdates,this._pageMask=this.pageSize-1,F.buffer){for(var A=0;A<F.buffer.length;A+=this.pageSize)this.pages.set(A/this.pageSize,F.buffer.slice(A,A+this.pageSize));this.byteLength=F.buffer.length,this.length=8*this.byteLength}}h4.prototype.get=function(F){var A=F&7,D=(F-A)/8;return!!(this.getByte(D)&128>>A)};h4.prototype.getByte=function(F){var A=F&this._pageMask,D=(F-A)/this.pageSize,Z=this.pages.get(D,!0);return Z?Z.buffer[A+this.pageOffset]:0};h4.prototype.set=function(F,A){var D=F&7,Z=(F-D)/8,J=this.getByte(Z);return this.setByte(Z,A?J|128>>D:J&(255^128>>D))};h4.prototype.toBuffer=function(){var F=DA1(this.pages.length*this.pageSize);for(var A=0;A<this.pages.length;A++){var D=this.pages.get(A,!0),Z=A*this.pageSize;if(D)D.buffer.copy(F,Z,this.pageOffset,this.pageOffset+this.pageSize)}return F};h4.prototype.setByte=function(F,A){var D=F&this._pageMask,Z=(F-D)/this.pageSize,J=this.pages.get(Z,!1);if(D+=this.pageOffset,J.buffer[D]===A)return!1;if(J.buffer[D]=A,F>=this.byteLength)this.byteLength=F+1,this.length=this.byteLength*8;if(this._trackUpdates)this.pages.updated(J);return!0};function DA1(F){if(Buffer.alloc)return Buffer.alloc(F);var A=new Buffer(F);return A.fill(0),A}function ZA1(F){return!(F&F-1)}});var Qk=E((J8)=>{var JA1=J8&&J8.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(J8,"__esModule",{value:!0});J8.createMemoryCodePoints=void 0;var XA1=JA1(Ck());function $A1(F){let A=0;function D(){let B=F.readUInt32BE(A);A+=4;let H=F.slice(A,A+B);return A+=B,XA1.default({buffer:H})}let Z=D(),J=D(),X=D(),$=D(),G=D(),Y=D();return{unassigned_code_points:Z,commonly_mapped_to_nothing:J,non_ASCII_space_characters:X,prohibited_characters:$,bidirectional_r_al:G,bidirectional_l:Y}}J8.createMemoryCodePoints=$A1});var Ek=E((Kk)=>{Object.defineProperty(Kk,"__esModule",{value:!0});var YA1=i("node:zlib");Kk.default=YA1.gunzipSync(Buffer.from("H4sIAAAAAAACA+3dTYgcaRkA4LemO9Mhxm0FITnE9Cwr4jHgwgZ22B6YywqCJ0HQg5CL4sGTuOjCtGSF4CkHEW856MlTQHD3EJnWkU0Owh5VxE3LHlYQdNxd2U6mU59UV/d09fw4M2EySSXPAzNdP1/9fX/99bzVNZEN4jisRDulVFnQmLxm1aXF9Id/2/xMxNJ4XZlg576yuYlGt9gupV6xoFf8jhu9YvulVrFlp5XSx+lfvYhORGPXvqIRWSxERKtIm8bKFd10WNfKDS5Fo9jJWrq2+M2IlW+8uHgl/+BsROfPF4v5L7148Ur68Sha6dqZpYiVVy8tvLCWXo80Sf/lS89dGX2wHGvpzoXVn75/YWH5wmqe8uika82ViJXTy83Ve2k5Urozm38wm4/ls6t5uT6yfsTSJ7J3T0VKt8c5ExEXI8aFkH729c3eT+7EC6ca8cVULZUiYacX0R5PNWNxlh9L1y90q5kyzrpyy+9WcvOV6URntqw7La9sNVstXyczWVaWYbaaTYqzOHpr7pyiNT3/YzKuT63Z/FqKZlFTiuXtFM2vVOtIq7jiyKJbWZaOWD0euz0yoV2Z7kY0xq2x0YhfzVpmM5px9nTEH7JZ0ot5u39p0ma75Z472/s/H+2yr2inYyuq7fMvJivH2rM72N/Z3lyL31F2b1ya1P0zn816k2KP6JU9UzseucdQH5YqVeH/lFajSN2udg+TLJ9rksNxlvV2lki19rXKI43TPLejFu4ov7k3nMbhyhfY3Xb37f8BAGCf0eMTOH5szf154KmnNgKcnLb+Fzi2AfXktbN7fJelwTAiO/W5uQ2KINXRYu+znqo/WTAdLadURHmy3qciazd3bra4T3w16/f7t7Ms9U5gfJu10955sx1r3vmhBAAAAAAAgId20J1iZbDowNvIjuH427Gr5l/eiC+8OplZON8sVjx/qr9y+Pj+YRItT+NqAM+kkZs3AAAAAID6yfx1FwCAI97/dCh1/ub6SA0AAAAAAAAAgNoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hutp5SiQpYAAAAAAAAAQO2MIpZiT804flnAE2fhwjOeAZXr76kOAAAAAAAA8FjNf4N/l0NE3U/vuVQskLpSd4/Yh2xu9xTu0tFeeNYsLI2f/VMdNxTzj6Je9E/+6pp6Nn3awW3A54goe4Bss6v+PGsjQGMAAAAAAOBp5XEgwH6e7J7rwEQHRb/XvAMAAAAAAAA8yzoDeQDwVGjIAgAAAAAAAACoPfF/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqL/GSkSkClkCAAAAAAAAALXTSAAAAAAAAABA3Y1kAQAAAAAAAADUX8RSXZ9dsHC9+M8Fg2Ex/em1lAZpEBGttcrVjZqLEa+k0XpKw9mG4zWx4ukPUMhkAQAAAAAAABzBqbSe3//rXOS9HxGdo4TqR2XkutCdBu+LaPZw/lBbO7cbHnh2C7N7AIo4evEznllqLqWUp/LnYOtpM2bnOH66wI1+9GO4sOuISwv/TOlumu56FDv3NZhc4mR9v7zYIrafr40j/Cccvj9Xns3t3mu99E7qxUv3bqS0/ouNH/08++RGemfQ+nsx/5uNXsQPGulynPvv3ZTW37zd+1ovrqaYpP/122X6Xpx779Z3zr/3YOPKW1lkaRDf31pPaf3j/msRsVGkL+d/f+/m4sJsPm1cfSsr16e8m9Ldj/KsnyIuR3nXw83Is3EhxLd/2V773ks3m/cj/THKUummdP9qKhIOImuOU0Xjwb3y+oqt735rpTetVbF9n8R4x9crRfO77TKqVOZpDclv5bfK18lMnk+q0K18UpxF/RrGXE0Zxtqx3tWSj+vxbL4XaasfKb0dRbtLW73JsfPGg177H+OmGKlfvS1msllt7JEJm9XOJqXR+Fkfo1H66uy5H1v3Xx5+uJmGLw9jro2u7Loj4PnuR6+f+e3d261+eazNhzrL7X83MohoHpS4PddV8ki1it61//pw1g7z6p1U/26Nm2llST57B5rUvuG0XqSU/rPd7jYrqWcbd+beJQ77BgPMDwn37/8BAGCf0eMTOH4cPlufv9VGgJOzqf8Fjm1APXkd7B7f5dF57GPMaWy/MTvjvNvtXj6h8W2+GXvnzXaseeeHEgAAAAAAAB7aQXeKlcGiadBoEOeLb2dtpGOL2MyOtf391a3P/zD96c3JzIP3t4oV797vrh8+vn+YRL5bBuj/AQAAAABqJvfHXQAAHkX82zfXAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACeAgkAAAAAAAAAqLuRLAAAAAAAAACA2hv9D1iu/VAYaAYA","base64"))});var Vk=E((CH,zk)=>{var Uk=CH&&CH.__importDefault||function(F){return F&&F.__esModule?F:{default:F}},BA1=Uk(Gk()),HA1=Qk(),qA1=Uk(Ek()),WA1=HA1.createMemoryCodePoints(qA1.default);function CF(F,A){return BA1.default(WA1,F,A)}CF.saslprep=CF;CF.default=CF;zk.exports=CF});var Ok=E((Tk)=>{Object.defineProperty(Tk,"__esModule",{value:!0});Tk.ScramSHA256=Tk.ScramSHA1=void 0;var CA1=Vk(),O9=i("node:crypto"),QH=k1(),J3=n(),wZ=e(),QA1=j4(),Lk=V3();class EH extends QA1.AuthProvider{constructor(F){super();this.cryptoMethod=F||"sha1"}async prepare(F,A){let D=this.cryptoMethod,Z=A.credentials;if(!Z)throw new J3.MongoMissingCredentialsError("AuthContext must provide credentials.");let J=await wZ.randomBytes(24);return A.nonce=J,{...F,speculativeAuthenticate:{...Ik(D,Z,J),db:Z.source}}}async auth(F){let{reauthenticating:A,response:D}=F;if(D?.speculativeAuthenticate&&!A)return await Mk(this.cryptoMethod,D.speculativeAuthenticate,F);return await KA1(this.cryptoMethod,F)}}function wk(F){return F.replace("=","=3D").replace(",","=2C")}function Pk(F,A){return Buffer.concat([Buffer.from("n=","utf8"),Buffer.from(F,"utf8"),Buffer.from(",r=","utf8"),Buffer.from(A.toString("base64"),"utf8")])}function Ik(F,A,D){let Z=wk(A.username);return{saslStart:1,mechanism:F==="sha1"?Lk.AuthMechanism.MONGODB_SCRAM_SHA1:Lk.AuthMechanism.MONGODB_SCRAM_SHA256,payload:new QH.Binary(Buffer.concat([Buffer.from("n,,","utf8"),Pk(Z,D)])),autoAuthorize:1,options:{skipEmptyExchange:!0}}}async function KA1(F,A){let{connection:D,credentials:Z}=A;if(!Z)throw new J3.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!A.nonce)throw new J3.MongoInvalidArgumentError("AuthContext must contain a valid nonce property");let J=A.nonce,X=Z.source,$=Ik(F,Z,J),G=await D.command(wZ.ns(`${X}.$cmd`),$,void 0);await Mk(F,G,A)}async function Mk(F,A,D){let{connection:Z,credentials:J}=D;if(!J)throw new J3.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!D.nonce)throw new J3.MongoInvalidArgumentError("Unable to continue SCRAM without valid nonce");let X=D.nonce,$=J.source,G=wk(J.username),Y=J.password,B=F==="sha256"?CA1.saslprep(Y):EA1(G,Y),H=Buffer.isBuffer(A.payload)?new QH.Binary(A.payload):A.payload,q=Rk(H),W=parseInt(q.i,10);if(W&&W<4096)throw new J3.MongoRuntimeError(`Server returned an invalid iteration count ${W}`);let{s:C,r:Q}=q;if(Q.startsWith("nonce"))throw new J3.MongoRuntimeError(`Server returned an invalid nonce: ${Q}`);let K=`c=biws,r=${Q}`,U=RA1(B,Buffer.from(C,"base64"),W,F),z=LZ(F,U,"Client Key"),L=LZ(F,U,"Server Key"),V=zA1(F,z),P=[Pk(G,X),H.toString("utf8"),K].join(","),I=LZ(F,V,P),M=`p=${UA1(z,I)}`,x=[K,M].join(","),_=LZ(F,L,P),O={saslContinue:1,conversationId:A.conversationId,payload:new QH.Binary(Buffer.from(x))},R=await Z.command(wZ.ns(`${$}.$cmd`),O,void 0),S=Rk(R.payload);if(!wA1(Buffer.from(S.v,"base64"),_))throw new J3.MongoRuntimeError("Server returned an invalid signature");if(R.done!==!1)return;let u={saslContinue:1,conversationId:R.conversationId,payload:Buffer.alloc(0)};await Z.command(wZ.ns(`${$}.$cmd`),u,void 0)}function Rk(F){let A=F.toString("utf8"),D={},Z=A.split(",");for(let J=0;J<Z.length;J++){let X=(Z[J].match(/^([^=]*)=(.*)$/)??[]).slice(1);D[X[0]]=X[1]}return D}function EA1(F,A){if(typeof F!=="string")throw new J3.MongoInvalidArgumentError("Username must be a string");if(typeof A!=="string")throw new J3.MongoInvalidArgumentError("Password must be a string");if(A.length===0)throw new J3.MongoInvalidArgumentError("Password cannot be empty");let D;try{D=O9.createHash("md5")}catch(Z){if(O9.getFips())throw new Error("Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode");throw Z}return D.update(`${F}:mongo:${A}`,"utf8"),D.digest("hex")}function UA1(F,A){if(!Buffer.isBuffer(F))F=Buffer.from(F);if(!Buffer.isBuffer(A))A=Buffer.from(A);let D=Math.max(F.length,A.length),Z=[];for(let J=0;J<D;J+=1)Z.push(F[J]^A[J]);return Buffer.from(Z).toString("base64")}function zA1(F,A){return O9.createHash(F).update(A).digest()}function LZ(F,A,D){return O9.createHmac(F,A).update(D).digest()}var RZ={},KH=0;function VA1(){RZ={},KH=0}var LA1={sha256:32,sha1:20};function RA1(F,A,D,Z){let J=[F,A.toString("base64"),D].join("_");if(RZ[J]!=null)return RZ[J];let X=O9.pbkdf2Sync(F,A,D,LA1[Z],Z);if(KH>=200)VA1();return RZ[J]=X,KH+=1,X}function wA1(F,A){if(F.length!==A.length)return!1;if(typeof O9.timingSafeEqual==="function")return O9.timingSafeEqual(F,A);let D=0;for(let Z=0;Z<F.length;Z++)D|=F[Z]^A[Z];return D===0}class Nk extends EH{constructor(){super("sha1")}}Tk.ScramSHA1=Nk;class jk extends EH{constructor(){super("sha256")}}Tk.ScramSHA256=jk});var fk=E((xk)=>{Object.defineProperty(xk,"__esModule",{value:!0});xk.X509=void 0;var Sk=n(),IA1=e(),MA1=j4();class uk extends MA1.AuthProvider{async prepare(F,A){let{credentials:D}=A;if(!D)throw new Sk.MongoMissingCredentialsError("AuthContext must provide credentials.");return{...F,speculativeAuthenticate:_k(D)}}async auth(F){let{connection:A,credentials:D}=F;if(!D)throw new Sk.MongoMissingCredentialsError("AuthContext must provide credentials.");if(F.response?.speculativeAuthenticate)return;await A.command(IA1.ns("$external.$cmd"),_k(D),void 0)}}xk.X509=uk;function _k(F){let A={authenticate:1,mechanism:"MONGODB-X509"};if(F.username)A.user=F.username;return A}});var zH=E((mk)=>{Object.defineProperty(mk,"__esModule",{value:!0});mk.MongoClientAuthProviders=void 0;var NA1=PD(),jA1=$T(),hk=zZ(),TA1=sT(),kA1=Fk(),yk=$H(),OA1=Jk(),v4=V3(),bk=Ok(),SA1=fk(),UH=n(),_A1=new Map([[v4.AuthMechanism.MONGODB_AWS,({AWS_CREDENTIAL_PROVIDER:F})=>new jA1.MongoDBAWS(F)],[v4.AuthMechanism.MONGODB_CR,()=>{throw new UH.MongoInvalidArgumentError("MONGODB-CR is no longer a supported auth mechanism in MongoDB 4.0+")}],[v4.AuthMechanism.MONGODB_GSSAPI,()=>new NA1.GSSAPI],[v4.AuthMechanism.MONGODB_OIDC,(F)=>new hk.MongoDBOIDC(uA1(F))],[v4.AuthMechanism.MONGODB_PLAIN,()=>new OA1.Plain],[v4.AuthMechanism.MONGODB_SCRAM_SHA1,()=>new bk.ScramSHA1],[v4.AuthMechanism.MONGODB_SCRAM_SHA256,()=>new bk.ScramSHA256],[v4.AuthMechanism.MONGODB_X509,()=>new SA1.X509]]);class vk{constructor(){this.existingProviders=new Map}getOrCreateProvider(F,A){let D=this.existingProviders.get(F);if(D)return D;let Z=_A1.get(F);if(!Z)throw new UH.MongoInvalidArgumentError(`authMechanism ${F} not supported`);let J=Z(A);return this.existingProviders.set(F,J),J}}mk.MongoClientAuthProviders=vk;function uA1(F){if(F.OIDC_HUMAN_CALLBACK)return new kA1.HumanCallbackWorkflow(new yk.TokenCache,F.OIDC_HUMAN_CALLBACK);else if(F.OIDC_CALLBACK)return new TA1.AutomatedCallbackWorkflow(new yk.TokenCache,F.OIDC_CALLBACK);else{let A=F.ENVIRONMENT,D=hk.OIDC_WORKFLOWS.get(A)?.();if(!D)throw new UH.MongoInvalidArgumentError(`Could not load workflow for environment ${F.ENVIRONMENT}`);return D}}});var VH=E((lk)=>{Object.defineProperty(lk,"__esModule",{value:!0});lk.GridFSBucketReadStream=void 0;var xA1=i("node:stream"),gA1=q2(),Q6=n(),fA1=G2();class PZ extends xA1.Readable{constructor(F,A,D,Z,J){super({emitClose:!0});this.s={bytesToTrim:0,bytesToSkip:0,bytesRead:0,chunks:F,expected:0,files:A,filter:Z,init:!1,expectedEnd:0,options:{start:0,end:0,...J},readPreference:D,timeoutContext:J?.timeoutMS!=null?new fA1.CSOTTimeoutContext({timeoutMS:J.timeoutMS,serverSelectionTimeoutMS:0}):void 0}}_read(){if(this.destroyed)return;hA1(this,()=>yA1(this))}start(F=0){return ck(this),this.s.options.start=F,this}end(F=0){return ck(this),this.s.options.end=F,this}async abort(){this.push(null),this.destroy();let F=this.s.timeoutContext?.getRemainingTimeMSOrThrow();await this.s.cursor?.close({timeoutMS:F})}}lk.GridFSBucketReadStream=PZ;PZ.FILE="file";function ck(F){if(F.s.init)throw new Q6.MongoGridFSStreamError("Options cannot be changed after the stream is initialized")}function yA1(F){if(F.destroyed)return;if(!F.s.cursor)return;if(!F.s.file)return;let A=(D)=>{if(F.destroyed)return;if(!D){F.push(null),F.s.cursor?.close().then(void 0,(q)=>F.destroy(q));return}if(!F.s.file)return;let Z=F.s.file.length-F.s.bytesRead,J=F.s.expected++,X=Math.min(F.s.file.chunkSize,Z);if(D.n>J)return F.destroy(new Q6.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${D.n}, expected: ${J}`));if(D.n<J)return F.destroy(new Q6.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${D.n}, expected: ${J}`));let $=Buffer.isBuffer(D.data)?D.data:D.data.buffer;if($.byteLength!==X){if(Z<=0)return F.destroy(new Q6.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${D.n}, expected file length ${F.s.file.length} bytes but already read ${F.s.bytesRead} bytes`));return F.destroy(new Q6.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${$.byteLength}, expected: ${X}`))}if(F.s.bytesRead+=$.byteLength,$.byteLength===0)return F.push(null);let G=null,Y=null;if(F.s.bytesToSkip!=null)G=F.s.bytesToSkip,F.s.bytesToSkip=0;let B=J===F.s.expectedEnd-1,H=F.s.options.end-F.s.bytesToSkip;if(B&&F.s.bytesToTrim!=null)Y=F.s.file.chunkSize-F.s.bytesToTrim;else if(F.s.options.end&&H<D.data.byteLength)Y=H;if(G!=null||Y!=null)$=$.slice(G||0,Y||$.byteLength);F.push($);return};F.s.cursor.next().then(A,(D)=>{if(F.destroyed)return;F.destroy(D)})}function bA1(F){let A={};if(F.s.readPreference)A.readPreference=F.s.readPreference;if(F.s.options&&F.s.options.sort)A.sort=F.s.options.sort;if(F.s.options&&F.s.options.skip)A.skip=F.s.options.skip;let D=(J)=>{if(F.destroyed)return;if(!J){let Y=`FileNotFound: file ${F.s.filter._id?F.s.filter._id.toString():F.s.filter.filename} was not found`,B=new Q6.MongoRuntimeError(Y);return B.code="ENOENT",F.destroy(B)}if(J.length<=0){F.push(null);return}if(F.destroyed){F.destroy();return}try{F.s.bytesToSkip=vA1(F,J,F.s.options)}catch(G){return F.destroy(G)}let X={files_id:J._id};if(F.s.options&&F.s.options.start!=null){let G=Math.floor(F.s.options.start/J.chunkSize);if(G>0)X.n={$gte:G}}let $;try{$=F.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${F.s.timeoutContext?.timeoutMS}ms`)}catch(G){return F.destroy(G)}if(F.s.cursor=F.s.chunks.find(X,{timeoutMode:F.s.options.timeoutMS!=null?gA1.CursorTimeoutMode.LIFETIME:void 0,timeoutMS:$}).sort({n:1}),F.s.readPreference)F.s.cursor.withReadPreference(F.s.readPreference);F.s.expectedEnd=Math.ceil(J.length/J.chunkSize),F.s.file=J;try{F.s.bytesToTrim=mA1(F,J,F.s.cursor,F.s.options)}catch(G){return F.destroy(G)}F.emit(PZ.FILE,J);return},Z;try{Z=F.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${F.s.timeoutContext?.timeoutMS}ms`)}catch(J){if(!F.destroyed)F.destroy(J);return}A.timeoutMS=Z,F.s.files.findOne(F.s.filter,A).then(D,(J)=>{if(F.destroyed)return;F.destroy(J)})}function hA1(F,A){if(F.s.file)return A();if(!F.s.init)bA1(F),F.s.init=!0;F.once("file",()=>{A()})}function vA1(F,A,D){if(D&&D.start!=null){if(D.start>A.length)throw new Q6.MongoInvalidArgumentError(`Stream start (${D.start}) must not be more than the length of the file (${A.length})`);if(D.start<0)throw new Q6.MongoInvalidArgumentError(`Stream start (${D.start}) must not be negative`);if(D.end!=null&&D.end<D.start)throw new Q6.MongoInvalidArgumentError(`Stream start (${D.start}) must not be greater than stream end (${D.end})`);return F.s.bytesRead=Math.floor(D.start/A.chunkSize)*A.chunkSize,F.s.expected=Math.floor(D.start/A.chunkSize),D.start-F.s.bytesRead}throw new Q6.MongoInvalidArgumentError("Start option must be defined")}function mA1(F,A,D,Z){if(Z&&Z.end!=null){if(Z.end>A.length)throw new Q6.MongoInvalidArgumentError(`Stream end (${Z.end}) must not be more than the length of the file (${A.length})`);if(Z.start==null||Z.start<0)throw new Q6.MongoInvalidArgumentError(`Stream end (${Z.end}) must not be negative`);let J=Z.start!=null?Math.floor(Z.start/A.chunkSize):0;return D.limit(Math.ceil(Z.end/A.chunkSize)-J),F.s.expectedEnd=Math.ceil(Z.end/A.chunkSize),Math.ceil(Z.end/A.chunkSize)*A.chunkSize-Z.end}throw new Q6.MongoInvalidArgumentError("End option must be defined")}});var RH=E((tk)=>{Object.defineProperty(tk,"__esModule",{value:!0});tk.GridFSBucketWriteStream=void 0;var dA1=i("node:stream"),ak=k1(),nk=q2(),X3=n(),cA1=G2(),ik=e(),lA1=Y2();class sk extends dA1.Writable{constructor(F,A,D){super();if(this.gridFSFile=null,D=D??{},this.bucket=F,this.chunks=F.s._chunksCollection,this.filename=A,this.files=F.s._filesCollection,this.options=D,this.writeConcern=lA1.WriteConcern.fromOptions(D)||F.s.options.writeConcern,this.done=!1,this.id=D.id?D.id:new ak.ObjectId,this.chunkSizeBytes=D.chunkSizeBytes||this.bucket.s.options.chunkSizeBytes,this.bufToStore=Buffer.alloc(this.chunkSizeBytes),this.length=0,this.n=0,this.pos=0,this.state={streamEnd:!1,outstandingRequests:0,errored:!1,aborted:!1},D.timeoutMS!=null)this.timeoutContext=new cA1.CSOTTimeoutContext({timeoutMS:D.timeoutMS,serverSelectionTimeoutMS:ik.resolveTimeoutOptions(this.bucket.s.db.client,{}).serverSelectionTimeoutMS})}_construct(F){if(!this.bucket.s.calledOpenUploadStream)this.bucket.s.calledOpenUploadStream=!0,iA1(this).then(()=>{this.bucket.s.checkedIndexes=!0,this.bucket.emit("index"),F()},(A)=>{if(A instanceof X3.MongoOperationTimeoutError)return S9(this,A,F);ik.squashError(A),F()});else return process.nextTick(F)}_write(F,A,D){nA1(this,F,A,D)}_final(F){if(this.state.streamEnd)return process.nextTick(F);this.state.streamEnd=!0,sA1(this,F)}async abort(){if(this.state.streamEnd)throw new X3.MongoAPIError("Cannot abort a stream that has already completed");if(this.state.aborted)throw new X3.MongoAPIError("Cannot call abort() on a stream twice");this.state.aborted=!0;let F=this.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${this.timeoutContext?.timeoutMS}ms`);await this.chunks.deleteMany({files_id:this.id},{timeoutMS:F})}}tk.GridFSBucketWriteStream=sk;function S9(F,A,D){if(F.state.errored){process.nextTick(D);return}F.state.errored=!0,process.nextTick(D,A)}function rk(F,A,D){return{_id:new ak.ObjectId,files_id:F,n:A,data:D}}async function pA1(F){let A={files_id:1,n:1},D;D=F.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`);let Z;try{Z=await F.chunks.listIndexes({timeoutMode:D!=null?nk.CursorTimeoutMode.LIFETIME:void 0,timeoutMS:D}).toArray()}catch(X){if(X instanceof X3.MongoError&&X.code===X3.MONGODB_ERROR_CODES.NamespaceNotFound)Z=[];else throw X}if(!Z.find((X)=>{if(Object.keys(X.key).length===2&&X.key.files_id===1&&X.key.n===1)return!0;return!1}))D=F.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`),await F.chunks.createIndex(A,{...F.writeConcern,background:!0,unique:!0,timeoutMS:D})}function LH(F,A){if(F.done)return process.nextTick(A);if(F.state.streamEnd&&F.state.outstandingRequests===0&&!F.state.errored){F.done=!0;let D=aA1(F.id,F.length,F.chunkSizeBytes,F.filename,F.options.contentType,F.options.aliases,F.options.metadata);if(IZ(F,A))return;let Z=F.timeoutContext?.remainingTimeMS;if(Z!=null&&Z<=0)return S9(F,new X3.MongoOperationTimeoutError(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`),A);F.files.insertOne(D,{writeConcern:F.writeConcern,timeoutMS:Z}).then(()=>{F.gridFSFile=D,A()},(J)=>{return S9(F,J,A)});return}process.nextTick(A)}async function iA1(F){let A=F.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`);if(await F.files.findOne({},{projection:{_id:1},timeoutMS:A})!=null)return;let Z={filename:1,uploadDate:1},J;A=F.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`);let X={timeoutMode:A!=null?nk.CursorTimeoutMode.LIFETIME:void 0,timeoutMS:A};try{J=await F.files.listIndexes(X).toArray()}catch(G){if(G instanceof X3.MongoError&&G.code===X3.MONGODB_ERROR_CODES.NamespaceNotFound)J=[];else throw G}if(!J.find((G)=>{if(Object.keys(G.key).length===2&&G.key.filename===1&&G.key.uploadDate===1)return!0;return!1}))A=F.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`),await F.files.createIndex(Z,{background:!1,timeoutMS:A});await pA1(F)}function aA1(F,A,D,Z,J,X,$){let G={_id:F,length:A,chunkSize:D,uploadDate:new Date,filename:Z};if(J)G.contentType=J;if(X)G.aliases=X;if($)G.metadata=$;return G}function nA1(F,A,D,Z){if(IZ(F,Z))return;let J=Buffer.isBuffer(A)?A:Buffer.from(A,D);if(F.length+=J.length,F.pos+J.length<F.chunkSizeBytes){J.copy(F.bufToStore,F.pos),F.pos+=J.length,process.nextTick(Z);return}let X=J.length,$=F.chunkSizeBytes-F.pos,G=Math.min($,J.length),Y=0;while(X>0){let B=J.length-X;J.copy(F.bufToStore,F.pos,B,B+G),F.pos+=G,$-=G;let H;if($===0){H=rk(F.id,F.n,Buffer.from(F.bufToStore));let q=F.timeoutContext?.remainingTimeMS;if(q!=null&&q<=0)return S9(F,new X3.MongoOperationTimeoutError(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`),Z);if(++F.state.outstandingRequests,++Y,IZ(F,Z))return;F.chunks.insertOne(H,{writeConcern:F.writeConcern,timeoutMS:q}).then(()=>{if(--F.state.outstandingRequests,--Y,!Y)LH(F,Z)},(W)=>{return S9(F,W,Z)}),$=F.chunkSizeBytes,F.pos=0,++F.n}X-=G,G=Math.min($,X)}}function sA1(F,A){if(F.pos===0)return LH(F,A);let D=Buffer.alloc(F.pos);F.bufToStore.copy(D,0,0,F.pos);let Z=rk(F.id,F.n,D);if(IZ(F,A))return;let J=F.timeoutContext?.remainingTimeMS;if(J!=null&&J<=0)return S9(F,new X3.MongoOperationTimeoutError(`Upload timed out after ${F.timeoutContext?.timeoutMS}ms`),A);++F.state.outstandingRequests,F.chunks.insertOne(Z,{writeConcern:F.writeConcern,timeoutMS:J}).then(()=>{--F.state.outstandingRequests,LH(F,A)},(X)=>{return S9(F,X,A)})}function IZ(F,A){if(F.state.aborted)return process.nextTick(A,new X3.MongoAPIError("Stream has been aborted")),!0;return!1}});var JO=E((DO)=>{Object.defineProperty(DO,"__esModule",{value:!0});DO.GridFSBucket=void 0;var wH=n(),rA1=G6(),ek=G2(),MZ=e(),tA1=Y2(),FO=VH(),AO=RH(),oA1={bucketName:"fs",chunkSizeBytes:261120};class PH extends rA1.TypedEventEmitter{constructor(F,A){super();this.on("error",MZ.noop),this.setMaxListeners(0);let D=MZ.resolveOptions(F,{...oA1,...A,writeConcern:tA1.WriteConcern.fromOptions(A)});this.s={db:F,options:D,_chunksCollection:F.collection(D.bucketName+".chunks"),_filesCollection:F.collection(D.bucketName+".files"),checkedIndexes:!1,calledOpenUploadStream:!1}}openUploadStream(F,A){return new AO.GridFSBucketWriteStream(this,F,{timeoutMS:this.s.options.timeoutMS,...A})}openUploadStreamWithId(F,A,D){return new AO.GridFSBucketWriteStream(this,A,{timeoutMS:this.s.options.timeoutMS,...D,id:F})}openDownloadStream(F,A){return new FO.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{_id:F},{timeoutMS:this.s.options.timeoutMS,...A})}async delete(F,A){let{timeoutMS:D}=MZ.resolveOptions(this.s.db,A),Z=void 0;if(D)Z=new ek.CSOTTimeoutContext({timeoutMS:D,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS});let{deletedCount:J}=await this.s._filesCollection.deleteOne({_id:F},{timeoutMS:Z?.remainingTimeMS}),X=Z?.remainingTimeMS;if(X!=null&&X<=0)throw new wH.MongoOperationTimeoutError(`Timed out after ${D}ms`);if(await this.s._chunksCollection.deleteMany({files_id:F},{timeoutMS:X}),J===0)throw new wH.MongoRuntimeError(`File not found for id ${F}`)}find(F={},A={}){return this.s._filesCollection.find(F,A)}openDownloadStreamByName(F,A){let D={uploadDate:-1},Z=void 0;if(A&&A.revision!=null)if(A.revision>=0)D={uploadDate:1},Z=A.revision;else Z=-A.revision-1;return new FO.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{filename:F},{timeoutMS:this.s.options.timeoutMS,...A,sort:D,skip:Z})}async rename(F,A,D){let Z={_id:F},J={$set:{filename:A}},{matchedCount:X}=await this.s._filesCollection.updateOne(Z,J,D);if(X===0)throw new wH.MongoRuntimeError(`File with id ${F} not found`)}async drop(F){let{timeoutMS:A}=MZ.resolveOptions(this.s.db,F),D=void 0;if(A)D=new ek.CSOTTimeoutContext({timeoutMS:A,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS});if(D){await this.s._filesCollection.drop({timeoutMS:D.remainingTimeMS});let Z=D.getRemainingTimeMSOrThrow(`Timed out after ${A}ms`);await this.s._chunksCollection.drop({timeoutMS:Z})}else await this.s._filesCollection.drop(),await this.s._chunksCollection.drop()}}DO.GridFSBucket=PH;PH.INDEX="index"});var IH=E((BO)=>{Object.defineProperty(BO,"__esModule",{value:!0});BO.WaitingForSuitableServerEvent=BO.ServerSelectionSucceededEvent=BO.ServerSelectionFailedEvent=BO.ServerSelectionStartedEvent=BO.ServerSelectionEvent=void 0;var eA1=e(),NZ=N0();class X8{constructor(F,A,D){this.selector=F,this.operation=D,this.topologyDescription=A}}BO.ServerSelectionEvent=X8;class XO extends X8{constructor(F,A,D){super(F,A,D);this.name=NZ.SERVER_SELECTION_STARTED,this.message="Server selection started"}}BO.ServerSelectionStartedEvent=XO;class $O extends X8{constructor(F,A,D,Z){super(F,A,Z);this.name=NZ.SERVER_SELECTION_FAILED,this.message="Server selection failed",this.failure=D}}BO.ServerSelectionFailedEvent=$O;class YO extends X8{constructor(F,A,D,Z){super(F,A,Z);this.name=NZ.SERVER_SELECTION_SUCCEEDED,this.message="Server selection succeeded";let{host:J,port:X}=eA1.HostAddress.fromString(D).toHostPort();this.serverHost=J,this.serverPort=X}}BO.ServerSelectionSucceededEvent=YO;class GO extends X8{constructor(F,A,D,Z){super(F,A,Z);this.name=NZ.WAITING_FOR_SUITABLE_SERVER,this.message="Waiting for suitable server to become available",this.remainingTimeMS=D}}BO.WaitingForSuitableServerEvent=GO});var jH=E((qO)=>{Object.defineProperty(qO,"__esModule",{value:!0});qO.SrvPoller=qO.SrvPollingEvent=void 0;var JD1=i("node:dns"),MH=i("node:timers"),XD1=n(),$D1=G6(),QF=e();class NH{constructor(F){this.srvRecords=F}hostnames(){return new Set(this.srvRecords.map((F)=>QF.HostAddress.fromSrvRecord(F).toString()))}}qO.SrvPollingEvent=NH;class jZ extends $D1.TypedEventEmitter{constructor(F){super();if(this.on("error",QF.noop),!F||!F.srvHost)throw new XD1.MongoRuntimeError("Options for SrvPoller must exist and include srvHost");this.srvHost=F.srvHost,this.srvMaxHosts=F.srvMaxHosts??0,this.srvServiceName=F.srvServiceName??"mongodb",this.rescanSrvIntervalMS=60000,this.heartbeatFrequencyMS=F.heartbeatFrequencyMS??1e4,this.haMode=!1,this.generation=0,this._timeout=void 0}get srvAddress(){return`_${this.srvServiceName}._tcp.${this.srvHost}`}get intervalMS(){return this.haMode?this.heartbeatFrequencyMS:this.rescanSrvIntervalMS}start(){if(!this._timeout)this.schedule()}stop(){if(this._timeout)MH.clearTimeout(this._timeout),this.generation+=1,this._timeout=void 0}schedule(){if(this._timeout)MH.clearTimeout(this._timeout);this._timeout=MH.setTimeout(()=>{this._poll().then(void 0,QF.squashError)},this.intervalMS)}success(F){this.haMode=!1,this.schedule(),this.emit(jZ.SRV_RECORD_DISCOVERY,new NH(F))}failure(){this.haMode=!0,this.schedule()}async _poll(){let F=this.generation,A;try{A=await JD1.promises.resolveSrv(this.srvAddress)}catch{this.failure();return}if(F!==this.generation)return;let D=[];for(let Z of A)try{QF.checkParentDomainMatch(Z.name,this.srvHost),D.push(Z)}catch(J){QF.squashError(J)}if(!D.length){this.failure();return}this.success(D)}}qO.SrvPoller=jZ;jZ.SRV_RECORD_DISCOVERY="srvRecordDiscovery"});var Y8=E((g)=>{Object.defineProperty(g,"__esModule",{value:!0});g.MongoServerError=g.MongoServerClosedError=g.MongoRuntimeError=g.MongoParseError=g.MongoOperationTimeoutError=g.MongoOIDCError=g.MongoNotConnectedError=g.MongoNetworkTimeoutError=g.MongoNetworkError=g.MongoMissingDependencyError=g.MongoMissingCredentialsError=g.MongoKerberosError=g.MongoInvalidArgumentError=g.MongoGridFSStreamError=g.MongoGridFSChunkError=g.MongoGCPError=g.MongoExpiredSessionError=g.MongoError=g.MongoDriverError=g.MongoDecompressionError=g.MongoCursorInUseError=g.MongoCursorExhaustedError=g.MongoCompatibilityError=g.MongoClientBulkWriteExecutionError=g.MongoClientBulkWriteError=g.MongoClientBulkWriteCursorError=g.MongoChangeStreamError=g.MongoBatchReExecutionError=g.MongoAzureError=g.MongoAWSError=g.MongoAPIError=g.ChangeStreamCursor=g.ClientEncryption=g.MongoBulkWriteError=g.UUID=g.Timestamp=g.ObjectId=g.MinKey=g.MaxKey=g.Long=g.Int32=g.Double=g.Decimal128=g.DBRef=g.Code=g.BSONType=g.BSONSymbol=g.BSONRegExp=g.Binary=g.BSON=void 0;g.CommandStartedEvent=g.CommandFailedEvent=g.WriteConcern=g.ReadPreference=g.ReadConcern=g.TopologyType=g.ServerType=g.ReadPreferenceMode=g.ReadConcernLevel=g.ProfilingLevel=g.ReturnDocument=g.SeverityLevel=g.MongoLoggableComponent=g.ServerApiVersion=g.ExplainVerbosity=g.MongoErrorLabel=g.CursorTimeoutMode=g.CURSOR_FLAGS=g.Compressor=g.AuthMechanism=g.GSSAPICanonicalizationValue=g.AutoEncryptionLoggerLevel=g.BatchType=g.UnorderedBulkOperation=g.OrderedBulkOperation=g.MongoClient=g.ListIndexesCursor=g.ListCollectionsCursor=g.GridFSBucketWriteStream=g.GridFSBucketReadStream=g.GridFSBucket=g.FindCursor=g.ExplainableCursor=g.Db=g.Collection=g.ClientSession=g.ChangeStream=g.CancellationToken=g.AggregationCursor=g.Admin=g.AbstractCursor=g.configureExplicitResourceManagement=g.MongoWriteConcernError=g.MongoUnexpectedServerResponseError=g.MongoTransactionError=g.MongoTopologyClosedError=g.MongoTailableCursorError=g.MongoSystemError=g.MongoStalePrimaryError=g.MongoServerSelectionError=void 0;g.MongoClientAuthProviders=g.MongoCryptKMSRequestNetworkTimeoutError=g.MongoCryptInvalidArgumentError=g.MongoCryptError=g.MongoCryptCreateEncryptedCollectionError=g.MongoCryptCreateDataKeyError=g.MongoCryptAzureKMSRequestError=g.SrvPollingEvent=g.WaitingForSuitableServerEvent=g.ServerSelectionSucceededEvent=g.ServerSelectionStartedEvent=g.ServerSelectionFailedEvent=g.ServerSelectionEvent=g.TopologyOpeningEvent=g.TopologyDescriptionChangedEvent=g.TopologyClosedEvent=g.ServerOpeningEvent=g.ServerHeartbeatSucceededEvent=g.ServerHeartbeatStartedEvent=g.ServerHeartbeatFailedEvent=g.ServerDescriptionChangedEvent=g.ServerClosedEvent=g.ConnectionReadyEvent=g.ConnectionPoolReadyEvent=g.ConnectionPoolMonitoringEvent=g.ConnectionPoolCreatedEvent=g.ConnectionPoolClosedEvent=g.ConnectionPoolClearedEvent=g.ConnectionCreatedEvent=g.ConnectionClosedEvent=g.ConnectionCheckOutStartedEvent=g.ConnectionCheckOutFailedEvent=g.ConnectionCheckedOutEvent=g.ConnectionCheckedInEvent=g.CommandSucceededEvent=void 0;var GD1=qG();Object.defineProperty(g,"Admin",{enumerable:!0,get:function(){return GD1.Admin}});var BD1=HY();Object.defineProperty(g,"OrderedBulkOperation",{enumerable:!0,get:function(){return BD1.OrderedBulkOperation}});var HD1=qY();Object.defineProperty(g,"UnorderedBulkOperation",{enumerable:!0,get:function(){return HD1.UnorderedBulkOperation}});var qD1=w9();Object.defineProperty(g,"ChangeStream",{enumerable:!0,get:function(){return qD1.ChangeStream}});var WD1=R9();Object.defineProperty(g,"Collection",{enumerable:!0,get:function(){return WD1.Collection}});var CD1=q2();Object.defineProperty(g,"AbstractCursor",{enumerable:!0,get:function(){return CD1.AbstractCursor}});var QD1=N5();Object.defineProperty(g,"AggregationCursor",{enumerable:!0,get:function(){return QD1.AggregationCursor}});var KD1=NY();Object.defineProperty(g,"FindCursor",{enumerable:!0,get:function(){return KD1.FindCursor}});var ED1=QG();Object.defineProperty(g,"ListCollectionsCursor",{enumerable:!0,get:function(){return ED1.ListCollectionsCursor}});var UD1=_Y();Object.defineProperty(g,"ListIndexesCursor",{enumerable:!0,get:function(){return UD1.ListIndexesCursor}});var zD1=LD();Object.defineProperty(g,"Db",{enumerable:!0,get:function(){return zD1.Db}});var VD1=L9();Object.defineProperty(g,"ExplainableCursor",{enumerable:!0,get:function(){return VD1.ExplainableCursor}});var LD1=JO();Object.defineProperty(g,"GridFSBucket",{enumerable:!0,get:function(){return LD1.GridFSBucket}});var RD1=VH();Object.defineProperty(g,"GridFSBucketReadStream",{enumerable:!0,get:function(){return RD1.GridFSBucketReadStream}});var wD1=RH();Object.defineProperty(g,"GridFSBucketWriteStream",{enumerable:!0,get:function(){return wD1.GridFSBucketWriteStream}});var PD1=M4();Object.defineProperty(g,"MongoClient",{enumerable:!0,get:function(){return PD1.MongoClient}});var ID1=G6();Object.defineProperty(g,"CancellationToken",{enumerable:!0,get:function(){return ID1.CancellationToken}});var MD1=a7();Object.defineProperty(g,"ClientSession",{enumerable:!0,get:function(){return MD1.ClientSession}});var ND1=k1();Object.defineProperty(g,"BSON",{enumerable:!0,get:function(){return ND1.BSON}});var x2=k1();Object.defineProperty(g,"Binary",{enumerable:!0,get:function(){return x2.Binary}});Object.defineProperty(g,"BSONRegExp",{enumerable:!0,get:function(){return x2.BSONRegExp}});Object.defineProperty(g,"BSONSymbol",{enumerable:!0,get:function(){return x2.BSONSymbol}});Object.defineProperty(g,"BSONType",{enumerable:!0,get:function(){return x2.BSONType}});Object.defineProperty(g,"Code",{enumerable:!0,get:function(){return x2.Code}});Object.defineProperty(g,"DBRef",{enumerable:!0,get:function(){return x2.DBRef}});Object.defineProperty(g,"Decimal128",{enumerable:!0,get:function(){return x2.Decimal128}});Object.defineProperty(g,"Double",{enumerable:!0,get:function(){return x2.Double}});Object.defineProperty(g,"Int32",{enumerable:!0,get:function(){return x2.Int32}});Object.defineProperty(g,"Long",{enumerable:!0,get:function(){return x2.Long}});Object.defineProperty(g,"MaxKey",{enumerable:!0,get:function(){return x2.MaxKey}});Object.defineProperty(g,"MinKey",{enumerable:!0,get:function(){return x2.MinKey}});Object.defineProperty(g,"ObjectId",{enumerable:!0,get:function(){return x2.ObjectId}});Object.defineProperty(g,"Timestamp",{enumerable:!0,get:function(){return x2.Timestamp}});Object.defineProperty(g,"UUID",{enumerable:!0,get:function(){return x2.UUID}});var jD1=M7();Object.defineProperty(g,"MongoBulkWriteError",{enumerable:!0,get:function(){return jD1.MongoBulkWriteError}});var TD1=cD();Object.defineProperty(g,"ClientEncryption",{enumerable:!0,get:function(){return TD1.ClientEncryption}});var kD1=XG();Object.defineProperty(g,"ChangeStreamCursor",{enumerable:!0,get:function(){return kD1.ChangeStreamCursor}});var R1=n();Object.defineProperty(g,"MongoAPIError",{enumerable:!0,get:function(){return R1.MongoAPIError}});Object.defineProperty(g,"MongoAWSError",{enumerable:!0,get:function(){return R1.MongoAWSError}});Object.defineProperty(g,"MongoAzureError",{enumerable:!0,get:function(){return R1.MongoAzureError}});Object.defineProperty(g,"MongoBatchReExecutionError",{enumerable:!0,get:function(){return R1.MongoBatchReExecutionError}});Object.defineProperty(g,"MongoChangeStreamError",{enumerable:!0,get:function(){return R1.MongoChangeStreamError}});Object.defineProperty(g,"MongoClientBulkWriteCursorError",{enumerable:!0,get:function(){return R1.MongoClientBulkWriteCursorError}});Object.defineProperty(g,"MongoClientBulkWriteError",{enumerable:!0,get:function(){return R1.MongoClientBulkWriteError}});Object.defineProperty(g,"MongoClientBulkWriteExecutionError",{enumerable:!0,get:function(){return R1.MongoClientBulkWriteExecutionError}});Object.defineProperty(g,"MongoCompatibilityError",{enumerable:!0,get:function(){return R1.MongoCompatibilityError}});Object.defineProperty(g,"MongoCursorExhaustedError",{enumerable:!0,get:function(){return R1.MongoCursorExhaustedError}});Object.defineProperty(g,"MongoCursorInUseError",{enumerable:!0,get:function(){return R1.MongoCursorInUseError}});Object.defineProperty(g,"MongoDecompressionError",{enumerable:!0,get:function(){return R1.MongoDecompressionError}});Object.defineProperty(g,"MongoDriverError",{enumerable:!0,get:function(){return R1.MongoDriverError}});Object.defineProperty(g,"MongoError",{enumerable:!0,get:function(){return R1.MongoError}});Object.defineProperty(g,"MongoExpiredSessionError",{enumerable:!0,get:function(){return R1.MongoExpiredSessionError}});Object.defineProperty(g,"MongoGCPError",{enumerable:!0,get:function(){return R1.MongoGCPError}});Object.defineProperty(g,"MongoGridFSChunkError",{enumerable:!0,get:function(){return R1.MongoGridFSChunkError}});Object.defineProperty(g,"MongoGridFSStreamError",{enumerable:!0,get:function(){return R1.MongoGridFSStreamError}});Object.defineProperty(g,"MongoInvalidArgumentError",{enumerable:!0,get:function(){return R1.MongoInvalidArgumentError}});Object.defineProperty(g,"MongoKerberosError",{enumerable:!0,get:function(){return R1.MongoKerberosError}});Object.defineProperty(g,"MongoMissingCredentialsError",{enumerable:!0,get:function(){return R1.MongoMissingCredentialsError}});Object.defineProperty(g,"MongoMissingDependencyError",{enumerable:!0,get:function(){return R1.MongoMissingDependencyError}});Object.defineProperty(g,"MongoNetworkError",{enumerable:!0,get:function(){return R1.MongoNetworkError}});Object.defineProperty(g,"MongoNetworkTimeoutError",{enumerable:!0,get:function(){return R1.MongoNetworkTimeoutError}});Object.defineProperty(g,"MongoNotConnectedError",{enumerable:!0,get:function(){return R1.MongoNotConnectedError}});Object.defineProperty(g,"MongoOIDCError",{enumerable:!0,get:function(){return R1.MongoOIDCError}});Object.defineProperty(g,"MongoOperationTimeoutError",{enumerable:!0,get:function(){return R1.MongoOperationTimeoutError}});Object.defineProperty(g,"MongoParseError",{enumerable:!0,get:function(){return R1.MongoParseError}});Object.defineProperty(g,"MongoRuntimeError",{enumerable:!0,get:function(){return R1.MongoRuntimeError}});Object.defineProperty(g,"MongoServerClosedError",{enumerable:!0,get:function(){return R1.MongoServerClosedError}});Object.defineProperty(g,"MongoServerError",{enumerable:!0,get:function(){return R1.MongoServerError}});Object.defineProperty(g,"MongoServerSelectionError",{enumerable:!0,get:function(){return R1.MongoServerSelectionError}});Object.defineProperty(g,"MongoStalePrimaryError",{enumerable:!0,get:function(){return R1.MongoStalePrimaryError}});Object.defineProperty(g,"MongoSystemError",{enumerable:!0,get:function(){return R1.MongoSystemError}});Object.defineProperty(g,"MongoTailableCursorError",{enumerable:!0,get:function(){return R1.MongoTailableCursorError}});Object.defineProperty(g,"MongoTopologyClosedError",{enumerable:!0,get:function(){return R1.MongoTopologyClosedError}});Object.defineProperty(g,"MongoTransactionError",{enumerable:!0,get:function(){return R1.MongoTransactionError}});Object.defineProperty(g,"MongoUnexpectedServerResponseError",{enumerable:!0,get:function(){return R1.MongoUnexpectedServerResponseError}});Object.defineProperty(g,"MongoWriteConcernError",{enumerable:!0,get:function(){return R1.MongoWriteConcernError}});var OD1=S7();Object.defineProperty(g,"configureExplicitResourceManagement",{enumerable:!0,get:function(){return OD1.configureExplicitResourceManagement}});var SD1=M7();Object.defineProperty(g,"BatchType",{enumerable:!0,get:function(){return SD1.BatchType}});var _D1=$B();Object.defineProperty(g,"AutoEncryptionLoggerLevel",{enumerable:!0,get:function(){return _D1.AutoEncryptionLoggerLevel}});var uD1=PD();Object.defineProperty(g,"GSSAPICanonicalizationValue",{enumerable:!0,get:function(){return uD1.GSSAPICanonicalizationValue}});var xD1=V3();Object.defineProperty(g,"AuthMechanism",{enumerable:!0,get:function(){return xD1.AuthMechanism}});var gD1=c5();Object.defineProperty(g,"Compressor",{enumerable:!0,get:function(){return gD1.Compressor}});var CO=q2();Object.defineProperty(g,"CURSOR_FLAGS",{enumerable:!0,get:function(){return CO.CURSOR_FLAGS}});Object.defineProperty(g,"CursorTimeoutMode",{enumerable:!0,get:function(){return CO.CursorTimeoutMode}});var fD1=n();Object.defineProperty(g,"MongoErrorLabel",{enumerable:!0,get:function(){return fD1.MongoErrorLabel}});var yD1=L9();Object.defineProperty(g,"ExplainVerbosity",{enumerable:!0,get:function(){return yD1.ExplainVerbosity}});var bD1=M4();Object.defineProperty(g,"ServerApiVersion",{enumerable:!0,get:function(){return bD1.ServerApiVersion}});var QO=R4();Object.defineProperty(g,"MongoLoggableComponent",{enumerable:!0,get:function(){return QO.MongoLoggableComponent}});Object.defineProperty(g,"SeverityLevel",{enumerable:!0,get:function(){return QO.SeverityLevel}});var hD1=vY();Object.defineProperty(g,"ReturnDocument",{enumerable:!0,get:function(){return hD1.ReturnDocument}});var vD1=KG();Object.defineProperty(g,"ProfilingLevel",{enumerable:!0,get:function(){return vD1.ProfilingLevel}});var mD1=M6();Object.defineProperty(g,"ReadConcernLevel",{enumerable:!0,get:function(){return mD1.ReadConcernLevel}});var dD1=y0();Object.defineProperty(g,"ReadPreferenceMode",{enumerable:!0,get:function(){return dD1.ReadPreferenceMode}});var KO=$6();Object.defineProperty(g,"ServerType",{enumerable:!0,get:function(){return KO.ServerType}});Object.defineProperty(g,"TopologyType",{enumerable:!0,get:function(){return KO.TopologyType}});var cD1=M6();Object.defineProperty(g,"ReadConcern",{enumerable:!0,get:function(){return cD1.ReadConcern}});var lD1=y0();Object.defineProperty(g,"ReadPreference",{enumerable:!0,get:function(){return lD1.ReadPreference}});var pD1=Y2();Object.defineProperty(g,"WriteConcern",{enumerable:!0,get:function(){return pD1.WriteConcern}});var TH=PB();Object.defineProperty(g,"CommandFailedEvent",{enumerable:!0,get:function(){return TH.CommandFailedEvent}});Object.defineProperty(g,"CommandStartedEvent",{enumerable:!0,get:function(){return TH.CommandStartedEvent}});Object.defineProperty(g,"CommandSucceededEvent",{enumerable:!0,get:function(){return TH.CommandSucceededEvent}});var u6=_B();Object.defineProperty(g,"ConnectionCheckedInEvent",{enumerable:!0,get:function(){return u6.ConnectionCheckedInEvent}});Object.defineProperty(g,"ConnectionCheckedOutEvent",{enumerable:!0,get:function(){return u6.ConnectionCheckedOutEvent}});Object.defineProperty(g,"ConnectionCheckOutFailedEvent",{enumerable:!0,get:function(){return u6.ConnectionCheckOutFailedEvent}});Object.defineProperty(g,"ConnectionCheckOutStartedEvent",{enumerable:!0,get:function(){return u6.ConnectionCheckOutStartedEvent}});Object.defineProperty(g,"ConnectionClosedEvent",{enumerable:!0,get:function(){return u6.ConnectionClosedEvent}});Object.defineProperty(g,"ConnectionCreatedEvent",{enumerable:!0,get:function(){return u6.ConnectionCreatedEvent}});Object.defineProperty(g,"ConnectionPoolClearedEvent",{enumerable:!0,get:function(){return u6.ConnectionPoolClearedEvent}});Object.defineProperty(g,"ConnectionPoolClosedEvent",{enumerable:!0,get:function(){return u6.ConnectionPoolClosedEvent}});Object.defineProperty(g,"ConnectionPoolCreatedEvent",{enumerable:!0,get:function(){return u6.ConnectionPoolCreatedEvent}});Object.defineProperty(g,"ConnectionPoolMonitoringEvent",{enumerable:!0,get:function(){return u6.ConnectionPoolMonitoringEvent}});Object.defineProperty(g,"ConnectionPoolReadyEvent",{enumerable:!0,get:function(){return u6.ConnectionPoolReadyEvent}});Object.defineProperty(g,"ConnectionReadyEvent",{enumerable:!0,get:function(){return u6.ConnectionReadyEvent}});var n3=GZ();Object.defineProperty(g,"ServerClosedEvent",{enumerable:!0,get:function(){return n3.ServerClosedEvent}});Object.defineProperty(g,"ServerDescriptionChangedEvent",{enumerable:!0,get:function(){return n3.ServerDescriptionChangedEvent}});Object.defineProperty(g,"ServerHeartbeatFailedEvent",{enumerable:!0,get:function(){return n3.ServerHeartbeatFailedEvent}});Object.defineProperty(g,"ServerHeartbeatStartedEvent",{enumerable:!0,get:function(){return n3.ServerHeartbeatStartedEvent}});Object.defineProperty(g,"ServerHeartbeatSucceededEvent",{enumerable:!0,get:function(){return n3.ServerHeartbeatSucceededEvent}});Object.defineProperty(g,"ServerOpeningEvent",{enumerable:!0,get:function(){return n3.ServerOpeningEvent}});Object.defineProperty(g,"TopologyClosedEvent",{enumerable:!0,get:function(){return n3.TopologyClosedEvent}});Object.defineProperty(g,"TopologyDescriptionChangedEvent",{enumerable:!0,get:function(){return n3.TopologyDescriptionChangedEvent}});Object.defineProperty(g,"TopologyOpeningEvent",{enumerable:!0,get:function(){return n3.TopologyOpeningEvent}});var KF=IH();Object.defineProperty(g,"ServerSelectionEvent",{enumerable:!0,get:function(){return KF.ServerSelectionEvent}});Object.defineProperty(g,"ServerSelectionFailedEvent",{enumerable:!0,get:function(){return KF.ServerSelectionFailedEvent}});Object.defineProperty(g,"ServerSelectionStartedEvent",{enumerable:!0,get:function(){return KF.ServerSelectionStartedEvent}});Object.defineProperty(g,"ServerSelectionSucceededEvent",{enumerable:!0,get:function(){return KF.ServerSelectionSucceededEvent}});Object.defineProperty(g,"WaitingForSuitableServerEvent",{enumerable:!0,get:function(){return KF.WaitingForSuitableServerEvent}});var iD1=jH();Object.defineProperty(g,"SrvPollingEvent",{enumerable:!0,get:function(){return iD1.SrvPollingEvent}});var $8=d7();Object.defineProperty(g,"MongoCryptAzureKMSRequestError",{enumerable:!0,get:function(){return $8.MongoCryptAzureKMSRequestError}});Object.defineProperty(g,"MongoCryptCreateDataKeyError",{enumerable:!0,get:function(){return $8.MongoCryptCreateDataKeyError}});Object.defineProperty(g,"MongoCryptCreateEncryptedCollectionError",{enumerable:!0,get:function(){return $8.MongoCryptCreateEncryptedCollectionError}});Object.defineProperty(g,"MongoCryptError",{enumerable:!0,get:function(){return $8.MongoCryptError}});Object.defineProperty(g,"MongoCryptInvalidArgumentError",{enumerable:!0,get:function(){return $8.MongoCryptInvalidArgumentError}});Object.defineProperty(g,"MongoCryptKMSRequestNetworkTimeoutError",{enumerable:!0,get:function(){return $8.MongoCryptKMSRequestNetworkTimeoutError}});var aD1=zH();Object.defineProperty(g,"MongoClientAuthProviders",{enumerable:!0,get:function(){return aD1.MongoClientAuthProviders}})});var EO=E((TZ)=>{Object.defineProperty(TZ,"__esModule",{value:!0});tD1(Y8(),TZ);function tD1(F){for(let A of Object.keys(F))Object.defineProperty(TZ,A,{enumerable:!0,get:function(){return F[A]}})}});var SH=E((UO)=>{Object.defineProperty(UO,"__esModule",{value:!0});UO.ClientBulkWriteOperation=void 0;var kH=EO(),oD1=t6(),eD1=e(),FZ1=E0(),G8=y1();class OH extends FZ1.CommandOperation{get commandName(){return"bulkWrite"}constructor(F,A){super(void 0,A);this.commandBuilder=F,this.options=A,this.ns=new eD1.MongoDBNamespace("admin","$cmd")}resetBatch(){return this.commandBuilder.resetBatch()}get canRetryWrite(){return this.commandBuilder.isBatchRetryable}async execute(F,A,D){let Z;if(F.description.type===kH.ServerType.LoadBalancer)if(A){let J;if(!A.pinnedConnection)J=await F.pool.checkOut({timeoutContext:D}),A.pin(J);else J=A.pinnedConnection;Z=this.commandBuilder.buildBatch(J.hello?.maxMessageSizeBytes,J.hello?.maxWriteBatchSize,J.hello?.maxBsonObjectSize)}else throw new kH.MongoClientBulkWriteExecutionError("Session provided to the client bulk write operation must be present.");else{if(!F.description.maxWriteBatchSize||!F.description.maxMessageSizeBytes||!F.description.maxBsonObjectSize)throw new kH.MongoClientBulkWriteExecutionError("In order to execute a client bulk write, both maxWriteBatchSize, maxMessageSizeBytes and maxBsonObjectSize must be provided by the servers hello response.");Z=this.commandBuilder.buildBatch(F.description.maxMessageSizeBytes,F.description.maxWriteBatchSize,F.description.maxBsonObjectSize)}if(!this.canRetryWrite)this.options.willRetryWrite=!1;return await super.executeCommand(F,A,Z,D,oD1.ClientBulkWriteCursorResponse)}}UO.ClientBulkWriteOperation=OH;G8.defineAspects(OH,[G8.Aspect.WRITE_OPERATION,G8.Aspect.SKIP_COLLATION,G8.Aspect.CURSOR_CREATING,G8.Aspect.RETRYABLE,G8.Aspect.COMMAND_BATCHING])});var wO=E((LO)=>{Object.defineProperty(LO,"__esModule",{value:!0});LO.ClientBulkWriteCursor=void 0;var AZ1=SH(),DZ1=H2(),VO=e(),ZZ1=q2();class _H extends ZZ1.AbstractCursor{constructor(F,A,D={}){super(F,new VO.MongoDBNamespace("admin","$cmd"),D);this.commandBuilder=A,this.clientBulkWriteOptions=D}get response(){if(this.cursorResponse)return this.cursorResponse;return null}get operations(){return this.commandBuilder.lastOperations}clone(){let F=VO.mergeOptions({},this.clientBulkWriteOptions);return delete F.session,new _H(this.client,this.commandBuilder,{...F})}async _initialize(F){let A=new AZ1.ClientBulkWriteOperation(this.commandBuilder,{...this.clientBulkWriteOptions,...this.cursorOptions,session:F}),D=await DZ1.executeOperation(this.client,A,this.timeoutContext);return this.cursorResponse=D,{server:A.server,session:F,response:D}}}LO.ClientBulkWriteCursor=_H});var xO=E((TO)=>{Object.defineProperty(TO,"__esModule",{value:!0});TO.buildReplaceOneOperation=TO.buildUpdateManyOperation=TO.buildUpdateOneOperation=TO.buildDeleteManyOperation=TO.buildDeleteOneOperation=TO.buildInsertOneOperation=TO.ClientBulkWriteCommandBuilder=void 0;TO.buildOperation=gH;var uH=k1(),PO=d5(),EF=n(),fH=e(),IO=1000;class MO{constructor(F,A,D){this.models=F,this.options=A,this.pkFactory=D??fH.DEFAULT_PK_FACTORY,this.currentModelIndex=0,this.previousModelIndex=0,this.lastOperations=[],this.isBatchRetryable=!0}get errorsOnly(){if("verboseResults"in this.options)return!this.options.verboseResults;return!0}hasNextBatch(){return this.currentModelIndex<this.models.length}resetBatch(){return this.currentModelIndex=this.previousModelIndex,!0}buildBatch(F,A,D){this.isBatchRetryable=!0;let Z=0,J=0,X=this.baseCommand(),$=new Map;this.previousModelIndex=this.currentModelIndex;while(this.currentModelIndex<this.models.length){let G=this.models[this.currentModelIndex],Y=G.namespace,B=$.get(Y);if(G.name==="deleteMany"||G.name==="updateMany")this.isBatchRetryable=!1;if(B!=null){let H=gH(G,B,this.pkFactory),q;try{q=uH.BSON.serialize(H)}catch(W){throw new EF.MongoInvalidArgumentError("Could not serialize operation to BSON",{cause:W})}if(xH("ops",q,D),Z+q.length<F&&X.ops.documents.length<A)Z=IO+X.ops.push(H,q),this.currentModelIndex++;else break}else{$.set(Y,J);let H={ns:Y},q=gH(G,J,this.pkFactory),W,C;try{W=uH.BSON.serialize(H),C=uH.BSON.serialize(q)}catch(Q){throw new EF.MongoInvalidArgumentError("Could not serialize ns info to BSON",{cause:Q})}if(xH("nsInfo",W,D),xH("ops",C,D),Z+W.length+C.length<F&&X.ops.documents.length<A)Z=IO+X.nsInfo.push(H,W)+X.ops.push(q,C),J++,this.currentModelIndex++;else break}}return this.lastOperations=X.ops.documents,X}baseCommand(){let F={bulkWrite:1,errorsOnly:this.errorsOnly,ordered:this.options.ordered??!0,ops:new PO.DocumentSequence("ops"),nsInfo:new PO.DocumentSequence("nsInfo")};if(this.options.bypassDocumentValidation!=null)F.bypassDocumentValidation=this.options.bypassDocumentValidation;if(this.options.let)F.let=this.options.let;if(this.options.comment!==void 0)F.comment=this.options.comment;return F}}TO.ClientBulkWriteCommandBuilder=MO;function xH(F,A,D){if(A.length>D)throw new EF.MongoInvalidArgumentError(`Client bulk write operation ${F} of length ${A.length} exceeds the max bson object size of ${D}`)}var JZ1=(F,A,D)=>{let Z={insert:A,document:F.document};return Z.document._id=F.document._id??D.createPk(),Z};TO.buildInsertOneOperation=JZ1;var XZ1=(F,A)=>{return NO(F,A,!1)};TO.buildDeleteOneOperation=XZ1;var $Z1=(F,A)=>{return NO(F,A,!0)};TO.buildDeleteManyOperation=$Z1;function NO(F,A,D){let Z={delete:A,multi:D,filter:F.filter};if(F.hint)Z.hint=F.hint;if(F.collation)Z.collation=F.collation;return Z}var YZ1=(F,A)=>{return jO(F,A,!1)};TO.buildUpdateOneOperation=YZ1;var GZ1=(F,A)=>{return jO(F,A,!0)};TO.buildUpdateManyOperation=GZ1;function BZ1(F){if(!fH.hasAtomicOperators(F))throw new EF.MongoAPIError("Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty.")}function jO(F,A,D){BZ1(F.update);let Z={update:A,multi:D,filter:F.filter,updateMods:F.update};if(F.hint)Z.hint=F.hint;if(F.upsert)Z.upsert=F.upsert;if(F.arrayFilters)Z.arrayFilters=F.arrayFilters;if(F.collation)Z.collation=F.collation;return Z}var HZ1=(F,A)=>{if(fH.hasAtomicOperators(F.replacement))throw new EF.MongoAPIError("Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty.");let D={update:A,multi:!1,filter:F.filter,updateMods:F.replacement};if(F.hint)D.hint=F.hint;if(F.upsert)D.upsert=F.upsert;if(F.collation)D.collation=F.collation;return D};TO.buildReplaceOneOperation=HZ1;function gH(F,A,D){switch(F.name){case"insertOne":return TO.buildInsertOneOperation(F,A,D);case"deleteOne":return TO.buildDeleteOneOperation(F,A);case"deleteMany":return TO.buildDeleteManyOperation(F,A);case"updateOne":return TO.buildUpdateOneOperation(F,A);case"updateMany":return TO.buildUpdateManyOperation(F,A);case"replaceOne":return TO.buildReplaceOneOperation(F,A)}}});var bO=E((fO)=>{Object.defineProperty(fO,"__esModule",{value:!0});fO.ClientBulkWriteResultsMerger=void 0;var CZ1=Y8(),QZ1=n(),KZ1={acknowledged:!1,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0};class gO{static unacknowledged(){return KZ1}constructor(F){if(this.options=F,this.currentBatchOffset=0,this.writeConcernErrors=[],this.writeErrors=new Map,this.result={acknowledged:!0,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0},F.verboseResults)this.result.insertResults=new Map,this.result.updateResults=new Map,this.result.deleteResults=new Map}get bulkWriteResult(){return{acknowledged:this.result.acknowledged,insertedCount:this.result.insertedCount,upsertedCount:this.result.upsertedCount,matchedCount:this.result.matchedCount,modifiedCount:this.result.modifiedCount,deletedCount:this.result.deletedCount,insertResults:this.result.insertResults,updateResults:this.result.updateResults,deleteResults:this.result.deleteResults}}async merge(F){let A;try{for await(let D of F)if(D.ok===1){if(this.options.verboseResults)this.processDocument(F,D)}else if(this.options.ordered){let Z=new QZ1.MongoClientBulkWriteError({message:"Mongo client ordered bulk write encountered a write error."});throw Z.writeErrors.set(D.idx+this.currentBatchOffset,{code:D.code,message:D.errmsg}),Z.partialResult=this.result,Z}else this.writeErrors.set(D.idx+this.currentBatchOffset,{code:D.code,message:D.errmsg})}catch(D){if(D instanceof CZ1.MongoWriteConcernError){let Z=D.result;if(A={insertedCount:Z.nInserted,upsertedCount:Z.nUpserted,matchedCount:Z.nMatched,modifiedCount:Z.nModified,deletedCount:Z.nDeleted,writeConcernError:Z.writeConcernError},this.options.verboseResults&&Z.cursor.firstBatch){for(let J of Z.cursor.firstBatch)if(J.ok===1)this.processDocument(F,J)}}else throw D}finally{if(F.response){let D=F.response;this.incrementCounts(D)}this.currentBatchOffset+=F.operations.length}if(A){let D=A.writeConcernError;this.incrementCounts(A),this.writeConcernErrors.push({code:D.code,message:D.errmsg})}return this.result}processDocument(F,A){let D=F.operations[A.idx];if("insert"in D)this.result.insertResults?.set(A.idx+this.currentBatchOffset,{insertedId:D.document._id});if("update"in D){let Z={matchedCount:A.n,modifiedCount:A.nModified??0,didUpsert:A.upserted!=null};if(A.upserted)Z.upsertedId=A.upserted._id;this.result.updateResults?.set(A.idx+this.currentBatchOffset,Z)}if("delete"in D)this.result.deleteResults?.set(A.idx+this.currentBatchOffset,{deletedCount:A.n})}incrementCounts(F){this.result.insertedCount+=F.insertedCount,this.result.upsertedCount+=F.upsertedCount,this.result.matchedCount+=F.matchedCount,this.result.modifiedCount+=F.modifiedCount,this.result.deletedCount+=F.deletedCount}}fO.ClientBulkWriteResultsMerger=gO});var lO=E((dO)=>{Object.defineProperty(dO,"__esModule",{value:!0});dO.ClientBulkWriteExecutor=void 0;var hO=q2(),EZ1=wO(),_9=n(),UZ1=G2(),zZ1=e(),VZ1=Y2(),LZ1=H2(),RZ1=SH(),wZ1=xO(),vO=bO();class mO{constructor(F,A,D){if(A.length===0)throw new _9.MongoClientBulkWriteExecutionError("No client bulk write models were provided.");if(this.client=F,this.operations=A,this.options={ordered:!0,bypassDocumentValidation:!1,verboseResults:!1,...D},!this.options.writeConcern)this.options.writeConcern=VZ1.WriteConcern.fromOptions(this.client.s.options);if(this.options.writeConcern?.w===0){if(this.options.verboseResults)throw new _9.MongoInvalidArgumentError("Cannot request unacknowledged write concern and verbose results");if(this.options.ordered)throw new _9.MongoInvalidArgumentError("Cannot request unacknowledged write concern and ordered writes")}}async execute(){let F=this.client.s.options.pkFactory,A=new wZ1.ClientBulkWriteCommandBuilder(this.operations,this.options,F),D=zZ1.resolveTimeoutOptions(this.client,this.options),Z=UZ1.TimeoutContext.create(D);if(this.options.writeConcern?.w===0){while(A.hasNextBatch()){let J=new RZ1.ClientBulkWriteOperation(A,this.options);await LZ1.executeOperation(this.client,J,Z)}return vO.ClientBulkWriteResultsMerger.unacknowledged()}else{let J=new vO.ClientBulkWriteResultsMerger(this.options);while(A.hasNextBatch()){let X=new hO.CursorTimeoutContext(Z,Symbol()),$={...this.options,timeoutContext:X,...D.timeoutMS!=null&&{timeoutMode:hO.CursorTimeoutMode.LIFETIME}},G=new EZ1.ClientBulkWriteCursor(this.client,A,$);try{await J.merge(G)}catch(Y){if(Y instanceof _9.MongoServerError&&!(Y instanceof _9.MongoClientBulkWriteError)){let B=new _9.MongoClientBulkWriteError({message:"Mongo client bulk write encountered an error during execution"});throw B.cause=Y,B.partialResult=J.bulkWriteResult,B}else throw Y}}if(J.writeConcernErrors.length>0||J.writeErrors.size>0){let X=new _9.MongoClientBulkWriteError({message:"Mongo client bulk write encountered errors during execution."});throw X.writeConcernErrors=J.writeConcernErrors,X.writeErrors=J.writeErrors,X.partialResult=J.bulkWriteResult,X}return J.bulkWriteResult}}}dO.ClientBulkWriteExecutor=mO});var FS=E((oO)=>{Object.defineProperty(oO,"__esModule",{value:!0});oO.ServerCapabilities=oO.Topology=void 0;var PZ1=oB(),i2=N0(),M3=n(),q0=R4(),IZ1=G6(),UF=y0(),bH=G2(),g2=e(),V1=$6(),m4=GZ(),pO=hB(),vH=t5(),hH=P5(),d4=IH(),kZ=jH(),iO=BB(),MZ1=0,zF=g2.makeStateMachine({[V1.STATE_CLOSED]:[V1.STATE_CLOSED,V1.STATE_CONNECTING],[V1.STATE_CONNECTING]:[V1.STATE_CONNECTING,V1.STATE_CLOSING,V1.STATE_CONNECTED,V1.STATE_CLOSED],[V1.STATE_CONNECTED]:[V1.STATE_CONNECTED,V1.STATE_CLOSING,V1.STATE_CLOSED],[V1.STATE_CLOSING]:[V1.STATE_CLOSING,V1.STATE_CLOSED]});class p1 extends IZ1.TypedEventEmitter{constructor(F,A,D){super();if(this.on("error",g2.noop),this.client=F,D=D??{hosts:[g2.HostAddress.fromString("localhost:27017")],...Object.fromEntries(PZ1.DEFAULT_OPTIONS.entries())},typeof A==="string")A=[g2.HostAddress.fromString(A)];else if(!Array.isArray(A))A=[A];let Z=[];for(let Y of A)if(typeof Y==="string")Z.push(g2.HostAddress.fromString(Y));else if(Y instanceof g2.HostAddress)Z.push(Y);else throw new M3.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(Y)}`);let J=NZ1(D),X=MZ1++,$=D.srvMaxHosts==null||D.srvMaxHosts===0||D.srvMaxHosts>=Z.length?Z:g2.shuffle(Z,D.srvMaxHosts),G=new Map;for(let Y of $)G.set(Y.toString(),new vH.ServerDescription(Y));if(this.waitQueue=new g2.List,this.s={id:X,options:D,seedlist:Z,state:V1.STATE_CLOSED,description:new iO.TopologyDescription(J,G,D.replicaSet,void 0,void 0,void 0,D),serverSelectionTimeoutMS:D.serverSelectionTimeoutMS,heartbeatFrequencyMS:D.heartbeatFrequencyMS,minHeartbeatFrequencyMS:D.minHeartbeatFrequencyMS,servers:new Map,credentials:D?.credentials,clusterTime:void 0,detectShardedTopology:(Y)=>this.detectShardedTopology(Y),detectSrvRecords:(Y)=>this.detectSrvRecords(Y)},this.mongoLogger=F.mongoLogger,this.component="topology",D.srvHost&&!D.loadBalanced)this.s.srvPoller=D.srvPoller??new kZ.SrvPoller({heartbeatFrequencyMS:this.s.heartbeatFrequencyMS,srvHost:D.srvHost,srvMaxHosts:D.srvMaxHosts,srvServiceName:D.srvServiceName}),this.on(p1.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology);this.connectionLock=void 0}detectShardedTopology(F){let A=F.previousDescription.type,D=F.newDescription.type,Z=A!==V1.TopologyType.Sharded&&D===V1.TopologyType.Sharded,X=!!this.s.srvPoller?.listeners(kZ.SrvPoller.SRV_RECORD_DISCOVERY)?.includes(this.s.detectSrvRecords);if(Z&&!X)this.s.srvPoller?.on(kZ.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords),this.s.srvPoller?.start()}detectSrvRecords(F){let A=this.s.description;if(this.s.description=this.s.description.updateFromSrvPollingEvent(F,this.s.options.srvMaxHosts),this.s.description===A)return;aO(this),this.emitAndLog(p1.TOPOLOGY_DESCRIPTION_CHANGED,new m4.TopologyDescriptionChangedEvent(this.s.id,A,this.s.description))}get description(){return this.s.description}get loadBalanced(){return this.s.options.loadBalanced}get serverApi(){return this.s.options.serverApi}get capabilities(){return new mH(this.lastHello())}async connect(F){this.connectionLock??=this._connect(F);try{return await this.connectionLock,this}finally{this.connectionLock=void 0}}async _connect(F){if(F=F??{},this.s.state===V1.STATE_CONNECTED)return this;zF(this,V1.STATE_CONNECTING),this.emitAndLog(p1.TOPOLOGY_OPENING,new m4.TopologyOpeningEvent(this.s.id)),this.emitAndLog(p1.TOPOLOGY_DESCRIPTION_CHANGED,new m4.TopologyDescriptionChangedEvent(this.s.id,new iO.TopologyDescription(V1.TopologyType.Unknown),this.s.description));let A=Array.from(this.s.description.servers.values());if(this.s.servers=new Map(A.map(($)=>[$.address,rO(this,$)])),this.s.options.loadBalanced)for(let $ of A){let G=new vH.ServerDescription($.hostAddress,void 0,{loadBalanced:this.s.options.loadBalanced});this.serverUpdateHandler(G)}let D=this.client.s.options.serverSelectionTimeoutMS,Z=F.readPreference??UF.ReadPreference.primary,J=bH.TimeoutContext.create({timeoutMS:void 0,serverSelectionTimeoutMS:D,waitQueueTimeoutMS:this.client.s.options.waitQueueTimeoutMS}),X={operationName:"ping",...F,timeoutContext:J};try{let $=await this.selectServer(hH.readPreferenceServerSelector(Z),X);if(this.s.options.__skipPingOnConnect!==!0&&this.s.credentials)return await $.command(g2.ns("admin.$cmd"),{ping:1},{timeoutContext:J}),zF(this,V1.STATE_CONNECTED),this.emit(p1.OPEN,this),this.emit(p1.CONNECT,this),this;return zF(this,V1.STATE_CONNECTED),this.emit(p1.OPEN,this),this.emit(p1.CONNECT,this),this}catch($){throw this.close(),$}}close(){if(this.s.state===V1.STATE_CLOSED||this.s.state===V1.STATE_CLOSING)return;for(let F of this.s.servers.values())sO(F,this);if(this.s.servers.clear(),zF(this,V1.STATE_CLOSING),tO(this.waitQueue,new M3.MongoTopologyClosedError),this.s.srvPoller)this.s.srvPoller.stop(),this.s.srvPoller.removeListener(kZ.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords);this.removeListener(p1.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology),zF(this,V1.STATE_CLOSED),this.emitAndLog(p1.TOPOLOGY_CLOSED,new m4.TopologyClosedEvent(this.s.id))}async selectServer(F,A){let D;if(typeof F!=="function")if(typeof F==="string")D=hH.readPreferenceServerSelector(UF.ReadPreference.fromString(F));else{let W;if(F instanceof UF.ReadPreference)W=F;else UF.ReadPreference.translate(A),W=A.readPreference||UF.ReadPreference.primary;D=hH.readPreferenceServerSelector(W)}else D=F;if(A={serverSelectionTimeoutMS:this.s.serverSelectionTimeoutMS,...A},this.client.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.ServerSelectionStartedEvent(F,this.description,A.operationName));let Z;if(A.timeoutContext)Z=A.timeoutContext.serverSelectionTimeout;else Z=bH.Timeout.expires(A.serverSelectionTimeoutMS??0);let J=this.description.type===V1.TopologyType.Sharded,X=A.session,$=X&&X.transaction;if(J&&$&&$.server){if(this.client.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.ServerSelectionSucceededEvent(F,this.description,$.server.pool.address,A.operationName));if(A.timeoutContext?.clearServerSelectionTimeout)Z?.clear();return $.server}let{promise:G,resolve:Y,reject:B}=g2.promiseWithResolvers(),H={serverSelector:D,topologyDescription:this.description,mongoLogger:this.client.mongoLogger,transaction:$,resolve:Y,reject:B,cancelled:!1,startTime:g2.now(),operationName:A.operationName,waitingLogged:!1,previousServer:A.previousServer},q=g2.addAbortListener(A.signal,function(){H.cancelled=!0,B(this.reason)});this.waitQueue.push(H),nO(this);try{Z?.throwIfExpired();let W=await(Z?Promise.race([G,Z]):G);if(A.timeoutContext?.csotEnabled()&&W.description.minRoundTripTime!==0)A.timeoutContext.minRoundTripTime=W.description.minRoundTripTime;return W}catch(W){if(bH.TimeoutError.is(W)){H.cancelled=!0;let C=new M3.MongoServerSelectionError(`Server selection timed out after ${Z?.duration} ms`,this.description);if(this.client.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.ServerSelectionFailedEvent(F,this.description,C,A.operationName));if(A.timeoutContext?.csotEnabled())throw new M3.MongoOperationTimeoutError("Timed out during server selection",{cause:C});throw C}throw W}finally{if(q?.[g2.kDispose](),A.timeoutContext?.clearServerSelectionTimeout)Z?.clear()}}serverUpdateHandler(F){if(!this.s.description.hasServer(F.address))return;if(jZ1(this.s.description,F))return;let A=this.s.description,D=this.s.description.servers.get(F.address);if(!D)return;let Z=F.$clusterTime;if(Z)V1._advanceClusterTime(this,Z);let J=D&&D.equals(F);if(this.s.description=this.s.description.update(F),this.s.description.compatibilityError){this.emit(p1.ERROR,new M3.MongoCompatibilityError(this.s.description.compatibilityError));return}if(!J){let X=this.s.description.servers.get(F.address);if(X)this.emit(p1.SERVER_DESCRIPTION_CHANGED,new m4.ServerDescriptionChangedEvent(this.s.id,F.address,D,X))}if(aO(this,F),this.waitQueue.length>0)nO(this);if(!J)this.emitAndLog(p1.TOPOLOGY_DESCRIPTION_CHANGED,new m4.TopologyDescriptionChangedEvent(this.s.id,A,this.s.description))}auth(F,A){if(typeof F==="function")A=F,F=void 0;if(typeof A==="function")A(void 0,!0)}get clientMetadata(){return this.s.options.metadata}isConnected(){return this.s.state===V1.STATE_CONNECTED}isDestroyed(){return this.s.state===V1.STATE_CLOSED}lastHello(){let F=Array.from(this.description.servers.values());if(F.length===0)return{};return F.filter((Z)=>Z.type!==V1.ServerType.Unknown)[0]||{maxWireVersion:this.description.commonWireVersion}}get commonWireVersion(){return this.description.commonWireVersion}get logicalSessionTimeoutMinutes(){return this.description.logicalSessionTimeoutMinutes}get clusterTime(){return this.s.clusterTime}set clusterTime(F){this.s.clusterTime=F}}oO.Topology=p1;p1.SERVER_OPENING=i2.SERVER_OPENING;p1.SERVER_CLOSED=i2.SERVER_CLOSED;p1.SERVER_DESCRIPTION_CHANGED=i2.SERVER_DESCRIPTION_CHANGED;p1.TOPOLOGY_OPENING=i2.TOPOLOGY_OPENING;p1.TOPOLOGY_CLOSED=i2.TOPOLOGY_CLOSED;p1.TOPOLOGY_DESCRIPTION_CHANGED=i2.TOPOLOGY_DESCRIPTION_CHANGED;p1.ERROR=i2.ERROR;p1.OPEN=i2.OPEN;p1.CONNECT=i2.CONNECT;p1.CLOSE=i2.CLOSE;p1.TIMEOUT=i2.TIMEOUT;function sO(F,A){for(let D of i2.LOCAL_SERVER_EVENTS)F.removeAllListeners(D);F.destroy(),A.emitAndLog(p1.SERVER_CLOSED,new m4.ServerClosedEvent(A.s.id,F.description.address));for(let D of i2.SERVER_RELAY_EVENTS)F.removeAllListeners(D)}function NZ1(F){if(F?.directConnection)return V1.TopologyType.Single;if(F?.replicaSet)return V1.TopologyType.ReplicaSetNoPrimary;if(F?.loadBalanced)return V1.TopologyType.LoadBalanced;return V1.TopologyType.Unknown}function rO(F,A){F.emitAndLog(p1.SERVER_OPENING,new m4.ServerOpeningEvent(F.s.id,A.address));let D=new pO.Server(F,A,F.s.options);for(let Z of i2.SERVER_RELAY_EVENTS)D.on(Z,(J)=>F.emit(Z,J));return D.on(pO.Server.DESCRIPTION_RECEIVED,(Z)=>F.serverUpdateHandler(Z)),D.connect(),D}function aO(F,A){if(A&&F.s.servers.has(A.address)){let D=F.s.servers.get(A.address);if(D){if(D.s.description=A,A.error instanceof M3.MongoError&&A.error.hasErrorLabel(M3.MongoErrorLabel.ResetPool)){let Z=A.error.hasErrorLabel(M3.MongoErrorLabel.InterruptInUseConnections);D.pool.clear({interruptInUseConnections:Z})}else if(A.error==null){let Z=F.s.description.type;if(A.isDataBearing||A.type!==V1.ServerType.Unknown&&Z===V1.TopologyType.Single)D.pool.ready()}}}for(let D of F.description.servers.values())if(!F.s.servers.has(D.address)){let Z=rO(F,D);F.s.servers.set(D.address,Z)}for(let D of F.s.servers){let Z=D[0];if(F.description.hasServer(Z))continue;if(!F.s.servers.has(Z))continue;let J=F.s.servers.get(Z);if(F.s.servers.delete(Z),J)sO(J,F)}}function tO(F,A){while(F.length){let D=F.shift();if(!D)continue;if(!D.cancelled){if(D.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.DEBUG))D.mongoLogger?.debug(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.ServerSelectionFailedEvent(D.serverSelector,D.topologyDescription,A,D.operationName));D.reject(A)}}}function nO(F){if(F.s.state===V1.STATE_CLOSED){tO(F.waitQueue,new M3.MongoTopologyClosedError);return}let A=F.description.type===V1.TopologyType.Sharded,D=Array.from(F.description.servers.values()),Z=F.waitQueue.length;for(let J=0;J<Z;++J){let X=F.waitQueue.shift();if(!X)continue;if(X.cancelled)continue;let $;try{let{serverSelector:B,previousServer:H}=X;$=B?B(F.description,D,H?[H]:[]):D}catch(B){if(F.client.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.DEBUG))F.client.mongoLogger?.debug(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.ServerSelectionFailedEvent(X.serverSelector,F.description,B,X.operationName));X.reject(B);continue}let G;if($.length===0){if(!X.waitingLogged){if(F.client.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.INFORMATIONAL))F.client.mongoLogger?.info(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.WaitingForSuitableServerEvent(X.serverSelector,F.description,F.s.serverSelectionTimeoutMS!==0?F.s.serverSelectionTimeoutMS-(g2.now()-X.startTime):-1,X.operationName));X.waitingLogged=!0}F.waitQueue.push(X);continue}else if($.length===1)G=F.s.servers.get($[0].address);else{let B=g2.shuffle($,2),H=F.s.servers.get(B[0].address),q=F.s.servers.get(B[1].address);G=H&&q&&H.s.operationCount<q.s.operationCount?H:q}if(!G){let B=new M3.MongoServerSelectionError("server selection returned a server description but the server was not found in the topology",F.description);if(F.client.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.DEBUG))F.client.mongoLogger?.debug(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.ServerSelectionFailedEvent(X.serverSelector,F.description,B,X.operationName));X.reject(B);return}let Y=X.transaction;if(A&&Y&&Y.isActive&&G)Y.pinServer(G);if(F.client.mongoLogger?.willLog(q0.MongoLoggableComponent.SERVER_SELECTION,q0.SeverityLevel.DEBUG))F.client.mongoLogger?.debug(q0.MongoLoggableComponent.SERVER_SELECTION,new d4.ServerSelectionSucceededEvent(X.serverSelector,X.topologyDescription,G.pool.address,X.operationName));X.resolve(G)}if(F.waitQueue.length>0)for(let[,J]of F.s.servers)process.nextTick(function X(){return J.requestCheck()})}function jZ1(F,A){let Z=F.servers.get(A.address)?.topologyVersion;return vH.compareTopologyVersion(Z,A.topologyVersion)>0}class mH{constructor(F){this.minWireVersion=F.minWireVersion||0,this.maxWireVersion=F.maxWireVersion||0}get hasAggregationCursor(){return this.maxWireVersion>=1}get hasWriteCommands(){return this.maxWireVersion>=2}get hasTextSearch(){return this.minWireVersion>=0}get hasAuthCommands(){return this.maxWireVersion>=1}get hasListCollectionsCommand(){return this.maxWireVersion>=3}get hasListIndexesCommand(){return this.maxWireVersion>=3}get supportsSnapshotReads(){return this.maxWireVersion>=13}get commandsTakeWriteConcern(){return this.maxWireVersion>=5}get commandsTakeCollation(){return this.maxWireVersion>=5}}oO.ServerCapabilities=mH});var M4=E(($S)=>{Object.defineProperty($S,"__esModule",{value:!0});$S.MongoClient=$S.ServerApiVersion=void 0;var dH=i("node:fs"),kZ1=k1(),OZ1=w9(),SZ1=MD(),_Z1=V3(),AS=oB(),uZ1=N0(),xZ1=LD(),cH=n(),gZ1=zH(),DS=R4(),fZ1=G6(),yZ1=lO(),bZ1=H2(),hZ1=k7(),ZS=y0(),vZ1=S7(),mZ1=P5(),JS=FS(),XS=a7(),F2=e();$S.ServerApiVersion=Object.freeze({v1:"1"});class lH extends fZ1.TypedEventEmitter{constructor(F,A){super();this.on("error",F2.noop),this.options=AS.parseOptions(F,this,A);let D=Object.values(this.options.mongoLoggerOptions.componentSeverities).some((J)=>J!==DS.SeverityLevel.OFF);this.mongoLogger=D?new DS.MongoLogger(this.options.mongoLoggerOptions):void 0;let Z=this;this.s={url:F,bsonOptions:kZ1.resolveBSONOptions(this.options),namespace:F2.ns("admin"),hasBeenClosed:!1,sessionPool:new XS.ServerSessionPool(this),activeSessions:new Set,activeCursors:new Set,authProviders:new gZ1.MongoClientAuthProviders,get options(){return Z.options},get readConcern(){return Z.options.readConcern},get writeConcern(){return Z.options.writeConcern},get readPreference(){return Z.options.readPreference},get isMongoClient(){return!0}},this.checkForNonGenuineHosts()}async asyncDispose(){await this.close()}checkForNonGenuineHosts(){let F=this.options.hosts.filter((J)=>F2.isHostMatch(F2.DOCUMENT_DB_CHECK,J.host)),A=F2.isHostMatch(F2.DOCUMENT_DB_CHECK,this.options.srvHost),D=this.options.hosts.filter((J)=>F2.isHostMatch(F2.COSMOS_DB_CHECK,J.host)),Z=F2.isHostMatch(F2.COSMOS_DB_CHECK,this.options.srvHost);if(F.length!==0||A)this.mongoLogger?.info("client",F2.DOCUMENT_DB_MSG);else if(D.length!==0||Z)this.mongoLogger?.info("client",F2.COSMOS_DB_MSG)}get serverApi(){return this.options.serverApi&&Object.freeze({...this.options.serverApi})}get monitorCommands(){return this.options.monitorCommands}set monitorCommands(F){this.options.monitorCommands=F}get autoEncrypter(){return this.options.autoEncrypter}get readConcern(){return this.s.readConcern}get writeConcern(){return this.s.writeConcern}get readPreference(){return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get timeoutMS(){return this.s.options.timeoutMS}async bulkWrite(F,A){if(this.autoEncrypter)throw new cH.MongoInvalidArgumentError("MongoClient bulkWrite does not currently support automatic encryption.");return await new yZ1.ClientBulkWriteExecutor(this,F,F2.resolveOptions(this,A)).execute()}async connect(){if(this.connectionLock)return await this.connectionLock;try{this.connectionLock=this._connect(),await this.connectionLock}finally{this.connectionLock=void 0}return this}async _connect(){if(this.topology&&this.topology.isConnected())return this;let F=this.options;if(F.tls){if(typeof F.tlsCAFile==="string")F.ca??=await dH.promises.readFile(F.tlsCAFile);if(typeof F.tlsCRLFile==="string")F.crl??=await dH.promises.readFile(F.tlsCRLFile);if(typeof F.tlsCertificateKeyFile==="string"){if(!F.key||!F.cert){let D=await dH.promises.readFile(F.tlsCertificateKeyFile);F.key??=D,F.cert??=D}}}if(typeof F.srvHost==="string"){let D=await AS.resolveSRVRecord(F);for(let[Z,J]of D.entries())F.hosts[Z]=J}if(F.credentials?.mechanism===_Z1.AuthMechanism.MONGODB_OIDC){let D=F.credentials?.mechanismProperties?.ALLOWED_HOSTS||SZ1.DEFAULT_ALLOWED_HOSTS;if(!F.credentials?.mechanismProperties?.ENVIRONMENT){for(let J of F.hosts)if(!F2.hostMatchesWildcards(J.toHostPort().host,D))throw new cH.MongoInvalidArgumentError(`Host '${J}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${D.join(",")}'`)}}this.topology=new JS.Topology(this,F.hosts,F),this.topology.once(JS.Topology.OPEN,()=>this.emit("open",this));for(let D of uZ1.MONGO_CLIENT_EVENTS)this.topology.on(D,(...Z)=>this.emit(D,...Z));let A=async()=>{try{await this.topology?.connect(F)}catch(D){throw this.topology?.close(),D}};if(this.autoEncrypter)await this.autoEncrypter?.init(),await A(),await F.encrypter.connectInternalClient();else await A();return this}async close(F=!1){if(this.closeLock)return await this.closeLock;try{this.closeLock=this._close(F),await this.closeLock}finally{this.closeLock=void 0}}async _close(F=!1){Object.defineProperty(this.s,"hasBeenClosed",{value:!0,enumerable:!0,configurable:!1,writable:!1});let A=Array.from(this.s.activeCursors,(B)=>B.close());this.s.activeCursors.clear(),await Promise.all(A);let D=Array.from(this.s.activeSessions,(B)=>B.endSession());if(this.s.activeSessions.clear(),await Promise.all(D),this.topology==null)return;let Z=mZ1.readPreferenceServerSelector(ZS.ReadPreference.primaryPreferred),J=this.topology.description,X=Array.from(J.servers.values());if(Z(J,X).length!==0){let B=Array.from(this.s.sessionPool.sessions,({id:H})=>H);if(B.length!==0)try{await bZ1.executeOperation(this,new hZ1.RunAdminCommandOperation({endSessions:B},{readPreference:ZS.ReadPreference.primaryPreferred,noResponse:!0}))}catch(H){F2.squashError(H)}}let G=this.topology;this.topology=void 0,G.close();let{encrypter:Y}=this.options;if(Y)await Y.close(this,F)}db(F,A){if(A=A??{},!F)F=this.s.options.dbName;let D=Object.assign({},this.options,A);return new xZ1.Db(this,F,D)}static async connect(F,A){return await new this(F,A).connect()}startSession(F){let A=new XS.ClientSession(this,this.s.sessionPool,{explicit:!0,...F},this.options);return this.s.activeSessions.add(A),A.once("ended",()=>{this.s.activeSessions.delete(A)}),A}async withSession(F,A){let D={owner:Symbol(),...typeof F==="object"?F:{}},Z=typeof F==="function"?F:A;if(Z==null)throw new cH.MongoInvalidArgumentError("Missing required callback parameter");let J=this.startSession(D);try{return await Z(J)}finally{try{await J.endSession()}catch(X){F2.squashError(X)}}}watch(F=[],A={}){if(!Array.isArray(F))A=F,F=[];return new OZ1.ChangeStream(this,F,F2.resolveOptions(this,A))}}$S.MongoClient=lH;vZ1.configureResourceManagement(lH.prototype)});var S7=E((GS)=>{Object.defineProperty(GS,"__esModule",{value:!0});GS.configureResourceManagement=VF;GS.configureExplicitResourceManagement=cZ1;function VF(F){Symbol.asyncDispose&&Object.defineProperty(F,Symbol.asyncDispose,{value:async function A(){await this.asyncDispose()},enumerable:!1,configurable:!0,writable:!0})}function cZ1(){let{MongoClient:F}=M4(),{ClientSession:A}=a7(),{AbstractCursor:D}=q2(),{ChangeStream:Z}=w9();VF(F.prototype),VF(A.prototype),VF(D.prototype),VF(Z.prototype)}});var q2=E((KS)=>{Object.defineProperty(KS,"__esModule",{value:!0});KS.CursorTimeoutContext=KS.AbstractCursor=KS.CursorTimeoutMode=KS.CURSOR_FLAGS=void 0;var CS=i("node:stream"),B8=k1(),v0=n(),iZ1=G6(),BS=H2(),aZ1=YY(),nZ1=nV(),HS=M6(),OZ=y0(),sZ1=S7(),qS=a7(),pH=G2(),K6=e();KS.CURSOR_FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];function WS(){this.client.s.activeCursors.delete(this)}KS.CursorTimeoutMode=Object.freeze({ITERATION:"iteration",LIFETIME:"cursorLifetime"});class SZ extends iZ1.TypedEventEmitter{constructor(F,A,D={}){super();if(this.documents=null,this.hasEmittedClose=!1,this.on("error",K6.noop),!F.s.isMongoClient)throw new v0.MongoRuntimeError("Cursor must be constructed with MongoClient");if(this.cursorClient=F,this.cursorNamespace=A,this.cursorId=null,this.initialized=!1,this.isClosed=!1,this.isKilled=!1,this.cursorOptions={readPreference:D.readPreference&&D.readPreference instanceof OZ.ReadPreference?D.readPreference:OZ.ReadPreference.primary,...B8.pluckBSONSerializeOptions(D),timeoutMS:D?.timeoutContext?.csotEnabled()?D.timeoutContext.timeoutMS:D.timeoutMS,tailable:D.tailable,awaitData:D.awaitData},this.cursorOptions.timeoutMS!=null)if(D.timeoutMode==null)if(D.tailable){if(D.awaitData){if(D.maxAwaitTimeMS!=null&&D.maxAwaitTimeMS>=this.cursorOptions.timeoutMS)throw new v0.MongoInvalidArgumentError("Cannot specify maxAwaitTimeMS >= timeoutMS for a tailable awaitData cursor")}this.cursorOptions.timeoutMode=KS.CursorTimeoutMode.ITERATION}else this.cursorOptions.timeoutMode=KS.CursorTimeoutMode.LIFETIME;else{if(D.tailable&&D.timeoutMode===KS.CursorTimeoutMode.LIFETIME)throw new v0.MongoInvalidArgumentError("Cannot set tailable cursor's timeoutMode to LIFETIME");this.cursorOptions.timeoutMode=D.timeoutMode}else if(D.timeoutMode!=null)throw new v0.MongoInvalidArgumentError("Cannot set timeoutMode without setting timeoutMS");this.cursorOptions.omitMaxTimeMS=this.cursorOptions.timeoutMS!=null&&(this.cursorOptions.timeoutMode===KS.CursorTimeoutMode.ITERATION&&!this.cursorOptions.tailable||this.cursorOptions.tailable&&!this.cursorOptions.awaitData);let Z=HS.ReadConcern.fromOptions(D);if(Z)this.cursorOptions.readConcern=Z;if(typeof D.batchSize==="number")this.cursorOptions.batchSize=D.batchSize;if(D.comment!==void 0)this.cursorOptions.comment=D.comment;if(typeof D.maxTimeMS==="number")this.cursorOptions.maxTimeMS=D.maxTimeMS;if(typeof D.maxAwaitTimeMS==="number")this.cursorOptions.maxAwaitTimeMS=D.maxAwaitTimeMS;if(D.session instanceof qS.ClientSession)this.cursorSession=D.session;else this.cursorSession=this.cursorClient.startSession({owner:this,explicit:!1});this.deserializationOptions={...this.cursorOptions,validation:{utf8:D?.enableUtf8Validation===!1?!1:!0}},this.timeoutContext=D.timeoutContext,this.signal=D.signal,this.abortListener=K6.addAbortListener(this.signal,()=>void this.close().then(void 0,K6.squashError)),this.trackCursor()}get id(){return this.cursorId??void 0}get isDead(){return(this.cursorId?.isZero()??!1)||this.isClosed||this.isKilled}get client(){return this.cursorClient}get server(){return this.selectedServer}get namespace(){return this.cursorNamespace}get readPreference(){return this.cursorOptions.readPreference}get readConcern(){return this.cursorOptions.readConcern}get session(){return this.cursorSession}set session(F){this.cursorSession=F}get closed(){return this.isClosed&&(this.documents?.length??0)===0}get killed(){return this.isKilled}get loadBalanced(){return!!this.cursorClient.topology?.loadBalanced}async asyncDispose(){await this.close()}trackCursor(){if(this.cursorClient.s.activeCursors.add(this),!this.listeners("close").includes(WS))this.once("close",WS)}bufferedCount(){return this.documents?.length??0}readBufferedDocuments(F){let A=[],D=Math.min(F??this.documents?.length??0,this.documents?.length??0);for(let Z=0;Z<D;Z++){let J=this.documents?.shift(this.deserializationOptions);if(J!=null)A.push(J)}return A}async*[Symbol.asyncIterator](){if(this.signal?.throwIfAborted(),this.closed)return;try{while(!0){if(this.isKilled)return;if(this.closed)return;if(this.cursorId!=null&&this.isDead&&(this.documents?.length??0)===0)return;let F=await this.next();if(F===null)return;yield F,this.signal?.throwIfAborted()}}finally{if(!this.isClosed)try{await this.close()}catch(F){K6.squashError(F)}}}stream(F){let A=new QS(this),D=K6.addAbortListener(this.signal,function(){A.destroy(this.reason)});if(A.once("end",()=>{D?.[K6.kDispose]()}),F?.transform){let Z=F.transform,J=A.pipe(new CS.Transform({objectMode:!0,highWaterMark:1,transform(X,$,G){try{let Y=Z(X);G(void 0,Y)}catch(Y){G(Y)}}}));return A.on("error",(X)=>J.emit("error",X)),J}return A}async hasNext(){if(this.signal?.throwIfAborted(),this.cursorId===B8.Long.ZERO)return!1;if(this.cursorOptions.timeoutMode===KS.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{do{if((this.documents?.length??0)!==0)return!0;await this.fetchBatch()}while(!this.isDead||(this.documents?.length??0)!==0)}finally{if(this.cursorOptions.timeoutMode===KS.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return!1}async next(){if(this.signal?.throwIfAborted(),this.cursorId===B8.Long.ZERO)throw new v0.MongoCursorExhaustedError;if(this.cursorOptions.timeoutMode===KS.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{do{let F=this.documents?.shift(this.deserializationOptions);if(F!=null){if(this.transform!=null)return await this.transformDocument(F);return F}await this.fetchBatch()}while(!this.isDead||(this.documents?.length??0)!==0)}finally{if(this.cursorOptions.timeoutMode===KS.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return null}async tryNext(){if(this.signal?.throwIfAborted(),this.cursorId===B8.Long.ZERO)throw new v0.MongoCursorExhaustedError;if(this.cursorOptions.timeoutMode===KS.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{let F=this.documents?.shift(this.deserializationOptions);if(F!=null){if(this.transform!=null)return await this.transformDocument(F);return F}if(await this.fetchBatch(),F=this.documents?.shift(this.deserializationOptions),F!=null){if(this.transform!=null)return await this.transformDocument(F);return F}}finally{if(this.cursorOptions.timeoutMode===KS.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return null}async forEach(F){if(this.signal?.throwIfAborted(),typeof F!=="function")throw new v0.MongoInvalidArgumentError('Argument "iterator" must be a function');for await(let A of this)if(F(A)===!1)break}async close(F){await this.cleanup(F?.timeoutMS)}async toArray(){this.signal?.throwIfAborted();let F=[];for await(let A of this){F.push(A);let D=this.readBufferedDocuments();if(this.transform!=null)for(let Z of D)F.push(await this.transformDocument(Z));else F.push(...D)}return F}addCursorFlag(F,A){if(this.throwIfInitialized(),!KS.CURSOR_FLAGS.includes(F))throw new v0.MongoInvalidArgumentError(`Flag ${F} is not one of ${KS.CURSOR_FLAGS}`);if(typeof A!=="boolean")throw new v0.MongoInvalidArgumentError(`Flag ${F} must be a boolean value`);return this.cursorOptions[F]=A,this}map(F){this.throwIfInitialized();let A=this.transform;if(A)this.transform=(D)=>{return F(A(D))};else this.transform=F;return this}withReadPreference(F){if(this.throwIfInitialized(),F instanceof OZ.ReadPreference)this.cursorOptions.readPreference=F;else if(typeof F==="string")this.cursorOptions.readPreference=OZ.ReadPreference.fromString(F);else throw new v0.MongoInvalidArgumentError(`Invalid read preference: ${F}`);return this}withReadConcern(F){this.throwIfInitialized();let A=HS.ReadConcern.fromOptions({readConcern:F});if(A)this.cursorOptions.readConcern=A;return this}maxTimeMS(F){if(this.throwIfInitialized(),typeof F!=="number")throw new v0.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.cursorOptions.maxTimeMS=F,this}batchSize(F){if(this.throwIfInitialized(),this.cursorOptions.tailable)throw new v0.MongoTailableCursorError("Tailable cursor does not support batchSize");if(typeof F!=="number")throw new v0.MongoInvalidArgumentError('Operation "batchSize" requires an integer');return this.cursorOptions.batchSize=F,this}rewind(){if(this.timeoutContext&&this.timeoutContext.owner!==this)throw new v0.MongoAPIError("Cannot rewind cursor that does not own its timeout context.");if(!this.initialized)return;if(this.cursorId=null,this.documents?.clear(),this.timeoutContext?.clear(),this.timeoutContext=void 0,this.isClosed=!1,this.isKilled=!1,this.initialized=!1,this.hasEmittedClose=!1,this.trackCursor(),this.cursorSession.explicit===!1){if(!this.cursorSession.hasEnded)this.cursorSession.endSession().then(void 0,K6.squashError);this.cursorSession=this.cursorClient.startSession({owner:this,explicit:!1})}}async getMore(F){if(this.cursorId==null)throw new v0.MongoRuntimeError("Unexpected null cursor id. A cursor creating command should have set this");if(this.selectedServer==null)throw new v0.MongoRuntimeError("Unexpected null selectedServer. A cursor creating command should have set this");let A={...this.cursorOptions,session:this.cursorSession,batchSize:F},D=new aZ1.GetMoreOperation(this.cursorNamespace,this.cursorId,this.selectedServer,A);return await BS.executeOperation(this.cursorClient,D,this.timeoutContext)}async cursorInit(){if(this.cursorOptions.timeoutMS!=null)this.timeoutContext??=new LF(pH.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:this.cursorOptions.timeoutMS}),this);try{let F=await this._initialize(this.cursorSession);this.cursorOptions.omitMaxTimeMS=this.cursorOptions.timeoutMS!=null;let A=F.response;this.selectedServer=F.server,this.cursorId=A.id,this.cursorNamespace=A.ns??this.namespace,this.documents=A,this.initialized=!0}catch(F){throw this.initialized=!0,await this.cleanup(void 0,F),F}if(this.isDead)await this.cleanup();return}async fetchBatch(){if(this.isClosed)return;if(this.isDead){await this.cleanup();return}if(this.cursorId==null){if(await this.cursorInit(),(this.documents?.length??0)!==0||this.isDead)return}let F=this.cursorOptions.batchSize||1000;try{let A=await this.getMore(F);this.cursorId=A.id,this.documents=A}catch(A){try{await this.cleanup(void 0,A)}catch(D){K6.squashError(D)}throw A}if(this.isDead)await this.cleanup()}async cleanup(F,A){this.abortListener?.[K6.kDispose](),this.isClosed=!0;let D=()=>{if(F!=null)return this.timeoutContext?.clear(),new LF(pH.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:F}),this);else return this.timeoutContext?.refreshed()};try{if(!this.isKilled&&this.cursorId&&!this.cursorId.isZero()&&this.cursorNamespace&&this.selectedServer&&!this.cursorSession.hasEnded){this.isKilled=!0;let Z=this.cursorId;this.cursorId=B8.Long.ZERO,await BS.executeOperation(this.cursorClient,new nZ1.KillCursorsOperation(Z,this.cursorNamespace,this.selectedServer,{session:this.cursorSession}),D())}}catch(Z){K6.squashError(Z)}finally{try{if(this.cursorSession?.owner===this)await this.cursorSession.endSession({error:A});if(!this.cursorSession?.inTransaction())qS.maybeClearPinnedConnection(this.cursorSession,{error:A})}finally{this.emitClose()}}}emitClose(){try{if(!this.hasEmittedClose&&((this.documents?.length??0)===0||this.isClosed))this.emit("close")}finally{this.hasEmittedClose=!0}}async transformDocument(F){if(this.transform==null)return F;try{let A=this.transform(F);if(A===null)throw new v0.MongoAPIError("Cursor returned a `null` document, but the cursor is not exhausted. Mapping documents to `null` is not supported in the cursor transform.");return A}catch(A){try{await this.close()}catch(D){K6.squashError(D)}throw A}}throwIfInitialized(){if(this.initialized)throw new v0.MongoCursorInUseError}}KS.AbstractCursor=SZ;SZ.CLOSE="close";class QS extends CS.Readable{constructor(F){super({objectMode:!0,autoDestroy:!1,highWaterMark:1});this._readInProgress=!1,this._cursor=F}_read(F){if(!this._readInProgress)this._readInProgress=!0,this._readNext()}_destroy(F,A){this._cursor.close().then(()=>A(F),(D)=>A(D))}_readNext(){if(this._cursor.id===B8.Long.ZERO){this.push(null);return}this._cursor.next().then((F)=>{if(F==null)this.push(null);else if(this.destroyed)this._cursor.close().then(void 0,K6.squashError);else{if(this.push(F))return this._readNext();this._readInProgress=!1}},(F)=>{if(F.message.match(/server is closed/))return this._cursor.close().then(void 0,K6.squashError),this.push(null);if(F.message.match(/operation was interrupted/))return this.push(null);return this.destroy(F)}).catch((F)=>{this._readInProgress=!1,this.destroy(F)})}}sZ1.configureResourceManagement(SZ.prototype);class LF extends pH.TimeoutContext{constructor(F,A){super();this.timeoutContext=F,this.owner=A}get serverSelectionTimeout(){return this.timeoutContext.serverSelectionTimeout}get connectionCheckoutTimeout(){return this.timeoutContext.connectionCheckoutTimeout}get clearServerSelectionTimeout(){return this.timeoutContext.clearServerSelectionTimeout}get timeoutForSocketWrite(){return this.timeoutContext.timeoutForSocketWrite}get timeoutForSocketRead(){return this.timeoutContext.timeoutForSocketRead}csotEnabled(){return this.timeoutContext.csotEnabled()}refresh(){if(typeof this.owner!=="symbol")return this.timeoutContext.refresh()}clear(){if(typeof this.owner!=="symbol")return this.timeoutContext.clear()}get maxTimeMS(){return this.timeoutContext.maxTimeMS}get timeoutMS(){return this.timeoutContext.csotEnabled()?this.timeoutContext.timeoutMS:null}refreshed(){return new LF(this.timeoutContext.refreshed(),this.owner)}addMaxTimeMSToCommand(F,A){this.timeoutContext.addMaxTimeMSToCommand(F,A)}getSocketTimeoutMS(){return this.timeoutContext.getSocketTimeoutMS()}}KS.CursorTimeoutContext=LF});var L9=E((zS)=>{Object.defineProperty(zS,"__esModule",{value:!0});zS.ExplainableCursor=zS.Explain=zS.ExplainVerbosity=void 0;zS.validateExplainTimeoutOptions=eZ1;zS.decorateWithExplain=FJ1;var tZ1=q2(),oZ1=n();zS.ExplainVerbosity=Object.freeze({queryPlanner:"queryPlanner",queryPlannerExtended:"queryPlannerExtended",executionStats:"executionStats",allPlansExecution:"allPlansExecution"});class _Z{constructor(F,A){if(typeof F==="boolean")this.verbosity=F?zS.ExplainVerbosity.allPlansExecution:zS.ExplainVerbosity.queryPlanner;else this.verbosity=F;this.maxTimeMS=A}static fromOptions({explain:F}={}){if(F==null)return;if(typeof F==="boolean"||typeof F==="string")return new _Z(F);let{verbosity:A,maxTimeMS:D}=F;return new _Z(A,D)}}zS.Explain=_Z;function eZ1(F,A){let{maxTimeMS:D,timeoutMS:Z}=F;if(Z!=null&&(D!=null||A?.maxTimeMS!=null))throw new oZ1.MongoAPIError("Cannot use maxTimeMS with timeoutMS for explain commands.")}function FJ1(F,A){let{verbosity:D,maxTimeMS:Z}=A,J={explain:F,verbosity:D};if(typeof Z==="number")J.maxTimeMS=Z;return J}class US extends tZ1.AbstractCursor{resolveExplainTimeoutOptions(F,A){let D,Z;if(F==null&&A==null)D=void 0,Z=void 0;else if(F!=null&&A==null)D=typeof F!=="object"?F:("verbosity"in F)?F:void 0,Z=typeof F==="object"&&"timeoutMS"in F?F:void 0;else D=F,Z=A;return{timeout:Z,explain:D}}}zS.ExplainableCursor=US});var E0=E((wS)=>{Object.defineProperty(wS,"__esModule",{value:!0});wS.CommandOperation=void 0;var JJ1=n(),nH=L9(),XJ1=M6(),$J1=P5(),uZ=e(),LS=Y2(),H8=y1();class RS extends H8.AbstractOperation{constructor(F,A){super(A);this.options=A??{};let D=A?.dbName||A?.authdb;if(D)this.ns=new uZ.MongoDBNamespace(D,"$cmd");else this.ns=F?F.s.namespace.withCollection("$cmd"):new uZ.MongoDBNamespace("admin","$cmd");if(this.readConcern=XJ1.ReadConcern.fromOptions(A),this.writeConcern=LS.WriteConcern.fromOptions(A),this.hasAspect(H8.Aspect.EXPLAINABLE)){if(this.explain=nH.Explain.fromOptions(A),this.explain)nH.validateExplainTimeoutOptions(this.options,this.explain)}else if(A?.explain!=null)throw new JJ1.MongoInvalidArgumentError('Option "explain" is not supported on this command')}get canRetryWrite(){if(this.hasAspect(H8.Aspect.EXPLAINABLE))return this.explain==null;return super.canRetryWrite}async executeCommand(F,A,D,Z,J){this.server=F;let X={...this.options,...this.bsonOptions,timeoutContext:Z,readPreference:this.readPreference,session:A},$=uZ.maxWireVersion(F),G=this.session&&this.session.inTransaction();if(this.readConcern&&uZ.commandSupportsReadConcern(D)&&!G)Object.assign(D,{readConcern:this.readConcern});if(this.trySecondaryWrite&&$<$J1.MIN_SECONDARY_WRITE_WIRE_VERSION)X.omitReadPreference=!0;if(this.writeConcern&&this.hasAspect(H8.Aspect.WRITE_OPERATION)&&!G)LS.WriteConcern.apply(D,this.writeConcern);if(X.collation&&typeof X.collation==="object"&&!this.hasAspect(H8.Aspect.SKIP_COLLATION))Object.assign(D,{collation:X.collation});if(typeof X.maxTimeMS==="number")D.maxTimeMS=X.maxTimeMS;if(this.hasAspect(H8.Aspect.EXPLAINABLE)&&this.explain)D=nH.decorateWithExplain(D,this.explain);return await F.command(this.ns,D,X,J)}}wS.CommandOperation=RS});var AG=E((IS)=>{Object.defineProperty(IS,"__esModule",{value:!0});IS.DeleteManyOperation=IS.DeleteOneOperation=IS.DeleteOperation=void 0;IS.makeDeleteStatement=tH;var RF=n(),YJ1=E0(),x6=y1();class wF extends YJ1.CommandOperation{constructor(F,A,D){super(void 0,D);this.options=D,this.ns=F,this.statements=A}get commandName(){return"delete"}get canRetryWrite(){if(super.canRetryWrite===!1)return!1;return this.statements.every((F)=>F.limit!=null?F.limit>0:!0)}async execute(F,A,D){let Z=this.options??{},J=typeof Z.ordered==="boolean"?Z.ordered:!0,X={delete:this.ns.collection,deletes:this.statements,ordered:J};if(Z.let)X.let=Z.let;if(Z.comment!==void 0)X.comment=Z.comment;if(this.writeConcern&&this.writeConcern.w===0){if(this.statements.find((Y)=>Y.hint))throw new RF.MongoCompatibilityError("hint is not supported with unacknowledged writes")}return await super.executeCommand(F,A,X,D)}}IS.DeleteOperation=wF;class sH extends wF{constructor(F,A,D){super(F.s.namespace,[tH(A,{...D,limit:1})],D)}async execute(F,A,D){let Z=await super.execute(F,A,D);if(this.explain)return Z;if(Z.code)throw new RF.MongoServerError(Z);if(Z.writeErrors)throw new RF.MongoServerError(Z.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:Z.n}}}IS.DeleteOneOperation=sH;class rH extends wF{constructor(F,A,D){super(F.s.namespace,[tH(A,D)],D)}async execute(F,A,D){let Z=await super.execute(F,A,D);if(this.explain)return Z;if(Z.code)throw new RF.MongoServerError(Z);if(Z.writeErrors)throw new RF.MongoServerError(Z.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:Z.n}}}IS.DeleteManyOperation=rH;function tH(F,A){let D={q:F,limit:typeof A.limit==="number"?A.limit:0};if(A.collation)D.collation=A.collation;if(A.hint)D.hint=A.hint;return D}x6.defineAspects(wF,[x6.Aspect.RETRYABLE,x6.Aspect.WRITE_OPERATION]);x6.defineAspects(sH,[x6.Aspect.RETRYABLE,x6.Aspect.WRITE_OPERATION,x6.Aspect.EXPLAINABLE,x6.Aspect.SKIP_COLLATION]);x6.defineAspects(rH,[x6.Aspect.WRITE_OPERATION,x6.Aspect.EXPLAINABLE,x6.Aspect.SKIP_COLLATION])});var M7=E((_S)=>{Object.defineProperty(_S,"__esModule",{value:!0});_S.BulkOperationBase=_S.BulkWriteShimOperation=_S.FindOperators=_S.MongoBulkWriteError=_S.WriteError=_S.WriteConcernError=_S.BulkWriteResult=_S.Batch=_S.BatchType=void 0;_S.mergeBatchResults=oH;var jS=k1(),g0=n(),IF=AG(),TS=H2(),qJ1=cY(),WJ1=y1(),u9=rY(),N3=e(),NS=Y2();_S.BatchType=Object.freeze({INSERT:1,UPDATE:2,DELETE:3});class kS{constructor(F,A){this.originalZeroIndex=A,this.currentIndex=0,this.originalIndexes=[],this.batchType=F,this.operations=[],this.size=0,this.sizeBytes=0}}_S.Batch=kS;class s3{static generateIdMap(F){let A={};for(let D of F)A[D.index]=D._id;return A}constructor(F,A){this.result=F,this.insertedCount=this.result.nInserted??0,this.matchedCount=this.result.nMatched??0,this.modifiedCount=this.result.nModified??0,this.deletedCount=this.result.nRemoved??0,this.upsertedCount=this.result.upserted.length??0,this.upsertedIds=s3.generateIdMap(this.result.upserted),this.insertedIds=s3.generateIdMap(this.getSuccessfullyInsertedIds(F,A)),Object.defineProperty(this,"result",{value:this.result,enumerable:!1})}get ok(){return this.result.ok}getSuccessfullyInsertedIds(F,A){if(F.writeErrors.length===0)return F.insertedIds;if(A)return F.insertedIds.slice(0,F.writeErrors[0].index);return F.insertedIds.filter(({index:D})=>!F.writeErrors.some((Z)=>D===Z.index))}getUpsertedIdAt(F){return this.result.upserted[F]}getRawResponse(){return this.result}hasWriteErrors(){return this.result.writeErrors.length>0}getWriteErrorCount(){return this.result.writeErrors.length}getWriteErrorAt(F){return F<this.result.writeErrors.length?this.result.writeErrors[F]:void 0}getWriteErrors(){return this.result.writeErrors}getWriteConcernError(){if(this.result.writeConcernErrors.length===0)return;else if(this.result.writeConcernErrors.length===1)return this.result.writeConcernErrors[0];else{let F="";for(let A=0;A<this.result.writeConcernErrors.length;A++){let D=this.result.writeConcernErrors[A];if(F=F+D.errmsg,A===0)F=F+" and "}return new MF({errmsg:F,code:g0.MONGODB_ERROR_CODES.WriteConcernFailed})}}toString(){return`BulkWriteResult(${jS.EJSON.stringify(this.result)})`}isOk(){return this.result.ok===1}}_S.BulkWriteResult=s3;class MF{constructor(F){this.serverError=F}get code(){return this.serverError.code}get errmsg(){return this.serverError.errmsg}get errInfo(){return this.serverError.errInfo}toJSON(){return this.serverError}toString(){return`WriteConcernError(${this.errmsg})`}}_S.WriteConcernError=MF;class xZ{constructor(F){this.err=F}get code(){return this.err.code}get index(){return this.err.index}get errmsg(){return this.err.errmsg}get errInfo(){return this.err.errInfo}getOperation(){return this.err.op}toJSON(){return{code:this.err.code,index:this.err.index,errmsg:this.err.errmsg,op:this.err.op}}toString(){return`WriteError(${JSON.stringify(this.toJSON())})`}}_S.WriteError=xZ;function oH(F,A,D,Z){if(D)Z=D;else if(Z&&Z.result)Z=Z.result;if(Z==null)return;if(Z.ok===0&&A.ok===1){A.ok=0;let X={index:0,code:Z.code||0,errmsg:Z.message,errInfo:Z.errInfo,op:F.operations[0]};A.writeErrors.push(new xZ(X));return}else if(Z.ok===0&&A.ok===0)return;if(SS(F)&&Z.n)A.nInserted=A.nInserted+Z.n;if(Fq(F)&&Z.n)A.nRemoved=A.nRemoved+Z.n;let J=0;if(Array.isArray(Z.upserted)){J=Z.upserted.length;for(let X=0;X<Z.upserted.length;X++)A.upserted.push({index:Z.upserted[X].index+F.originalZeroIndex,_id:Z.upserted[X]._id})}else if(Z.upserted)J=1,A.upserted.push({index:F.originalZeroIndex,_id:Z.upserted});if(eH(F)&&Z.n){let X=Z.nModified;if(A.nUpserted=A.nUpserted+J,A.nMatched=A.nMatched+(Z.n-J),typeof X==="number")A.nModified=A.nModified+X;else A.nModified=0}if(Array.isArray(Z.writeErrors))for(let X=0;X<Z.writeErrors.length;X++){let $={index:F.originalIndexes[Z.writeErrors[X].index],code:Z.writeErrors[X].code,errmsg:Z.writeErrors[X].errmsg,errInfo:Z.writeErrors[X].errInfo,op:F.operations[Z.writeErrors[X].index]};A.writeErrors.push(new xZ($))}if(Z.writeConcernError)A.writeConcernErrors.push(new MF(Z.writeConcernError))}async function CJ1(F,A){if(F.s.batches.length===0)return new s3(F.s.bulkResult,F.isOrdered);for(let Z of F.s.batches){let J=N3.resolveOptions(F,{...A,ordered:F.isOrdered});if(J.bypassDocumentValidation!==!0)delete J.bypassDocumentValidation;if(F.s.bypassDocumentValidation===!0)J.bypassDocumentValidation=!0;if(F.s.checkKeys===!1)J.checkKeys=!1;if(J.retryWrites){if(eH(Z))J.retryWrites=J.retryWrites&&!Z.operations.some((B)=>B.multi);if(Fq(Z))J.retryWrites=J.retryWrites&&!Z.operations.some((B)=>B.limit===0)}let X=SS(Z)?new qJ1.InsertOperation(F.s.namespace,Z.operations,J):eH(Z)?new u9.UpdateOperation(F.s.namespace,Z.operations,J):Fq(Z)?new IF.DeleteOperation(F.s.namespace,Z.operations,J):null;if(X==null)throw new g0.MongoRuntimeError(`Unknown batchType: ${Z.batchType}`);let $=null,G;try{G=await TS.executeOperation(F.s.collection.client,X,J.timeoutContext)}catch(B){$=B}if($!=null)if($ instanceof g0.MongoWriteConcernError){oH(Z,F.s.bulkResult,$,G);let B=new s3(F.s.bulkResult,F.isOrdered);throw new q8({message:$.result.writeConcernError.errmsg,code:$.result.writeConcernError.code},B)}else throw new q8($,new s3(F.s.bulkResult,F.isOrdered));oH(Z,F.s.bulkResult,$,G);let Y=new s3(F.s.bulkResult,F.isOrdered);F.handleWriteError(Y)}F.s.batches.length=0;let D=new s3(F.s.bulkResult,F.isOrdered);return F.handleWriteError(D),D}class q8 extends g0.MongoServerError{constructor(F,A){super(F);if(this.writeErrors=[],F instanceof MF)this.err=F;else if(!(F instanceof Error))this.message=F.message,this.code=F.code,this.writeErrors=F.writeErrors??[];this.result=A,Object.assign(this,F)}get name(){return"MongoBulkWriteError"}get insertedCount(){return this.result.insertedCount}get matchedCount(){return this.result.matchedCount}get modifiedCount(){return this.result.modifiedCount}get deletedCount(){return this.result.deletedCount}get upsertedCount(){return this.result.upsertedCount}get insertedIds(){return this.result.insertedIds}get upsertedIds(){return this.result.upsertedIds}}_S.MongoBulkWriteError=q8;class Aq{constructor(F){this.bulkOperation=F}update(F){let A=PF(this.bulkOperation);return this.bulkOperation.addToOperationsList(_S.BatchType.UPDATE,u9.makeUpdateStatement(A.selector,F,{...A,multi:!0}))}updateOne(F){if(!N3.hasAtomicOperators(F))throw new g0.MongoInvalidArgumentError("Update document requires atomic operators");let A=PF(this.bulkOperation);return this.bulkOperation.addToOperationsList(_S.BatchType.UPDATE,u9.makeUpdateStatement(A.selector,F,{...A,multi:!1}))}replaceOne(F){if(N3.hasAtomicOperators(F))throw new g0.MongoInvalidArgumentError("Replacement document must not use atomic operators");let A=PF(this.bulkOperation);return this.bulkOperation.addToOperationsList(_S.BatchType.UPDATE,u9.makeUpdateStatement(A.selector,F,{...A,multi:!1}))}deleteOne(){let F=PF(this.bulkOperation);return this.bulkOperation.addToOperationsList(_S.BatchType.DELETE,IF.makeDeleteStatement(F.selector,{...F,limit:1}))}delete(){let F=PF(this.bulkOperation);return this.bulkOperation.addToOperationsList(_S.BatchType.DELETE,IF.makeDeleteStatement(F.selector,{...F,limit:0}))}upsert(){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.upsert=!0,this}collation(F){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.collation=F,this}arrayFilters(F){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.arrayFilters=F,this}hint(F){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.hint=F,this}}_S.FindOperators=Aq;class Dq extends WJ1.AbstractOperation{constructor(F,A){super(A);this.bulkOperation=F}get commandName(){return"bulkWrite"}async execute(F,A,D){if(this.options.session==null)this.options.session=A;return await CJ1(this.bulkOperation,{...this.options,timeoutContext:D})}}_S.BulkWriteShimOperation=Dq;class OS{constructor(F,A,D){this.collection=F,this.isOrdered=D;let Z=N3.getTopology(F);A=A==null?{}:A;let J=F.s.namespace,X=!1,$=void 0,G=Z.lastHello(),Y=!!(Z.s.options&&Z.s.options.autoEncrypter),B=G&&G.maxBsonObjectSize?G.maxBsonObjectSize:16777216,H=Y?2097152:B,q=G&&G.maxWriteBatchSize?G.maxWriteBatchSize:1000,W=(q-1).toString(10).length+2,C=Object.assign({},A);C=N3.applyRetryableWrites(C,F.s.db);let Q={ok:1,writeErrors:[],writeConcernErrors:[],insertedIds:[],nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[]};if(this.s={bulkResult:Q,currentBatch:void 0,currentIndex:0,currentBatchSize:0,currentBatchSizeBytes:0,currentInsertBatch:void 0,currentUpdateBatch:void 0,currentRemoveBatch:void 0,batches:[],writeConcern:NS.WriteConcern.fromOptions(A),maxBsonObjectSize:B,maxBatchSizeBytes:H,maxWriteBatchSize:q,maxKeySize:W,namespace:J,topology:Z,options:C,bsonOptions:jS.resolveBSONOptions(A),currentOp:$,executed:X,collection:F,err:void 0,checkKeys:typeof A.checkKeys==="boolean"?A.checkKeys:!1},A.bypassDocumentValidation===!0)this.s.bypassDocumentValidation=!0}insert(F){return N3.maybeAddIdToDocuments(this.collection,F,{forceServerObjectId:this.shouldForceServerObjectId()}),this.addToOperationsList(_S.BatchType.INSERT,F)}find(F){if(!F)throw new g0.MongoInvalidArgumentError("Bulk find operation must specify a selector");return this.s.currentOp={selector:F},new Aq(this)}raw(F){if(F==null||typeof F!=="object")throw new g0.MongoInvalidArgumentError("Operation must be an object with an operation key");if("insertOne"in F){let A=this.shouldForceServerObjectId(),D=F.insertOne&&F.insertOne.document==null?F.insertOne:F.insertOne.document;return N3.maybeAddIdToDocuments(this.collection,D,{forceServerObjectId:A}),this.addToOperationsList(_S.BatchType.INSERT,D)}if("replaceOne"in F||"updateOne"in F||"updateMany"in F){if("replaceOne"in F){if("q"in F.replaceOne)throw new g0.MongoInvalidArgumentError("Raw operations are not allowed");let A=u9.makeUpdateStatement(F.replaceOne.filter,F.replaceOne.replacement,{...F.replaceOne,multi:!1});if(N3.hasAtomicOperators(A.u))throw new g0.MongoInvalidArgumentError("Replacement document must not use atomic operators");return this.addToOperationsList(_S.BatchType.UPDATE,A)}if("updateOne"in F){if("q"in F.updateOne)throw new g0.MongoInvalidArgumentError("Raw operations are not allowed");let A=u9.makeUpdateStatement(F.updateOne.filter,F.updateOne.update,{...F.updateOne,multi:!1});if(!N3.hasAtomicOperators(A.u))throw new g0.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(_S.BatchType.UPDATE,A)}if("updateMany"in F){if("q"in F.updateMany)throw new g0.MongoInvalidArgumentError("Raw operations are not allowed");let A=u9.makeUpdateStatement(F.updateMany.filter,F.updateMany.update,{...F.updateMany,multi:!0});if(!N3.hasAtomicOperators(A.u))throw new g0.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(_S.BatchType.UPDATE,A)}}if("deleteOne"in F){if("q"in F.deleteOne)throw new g0.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(_S.BatchType.DELETE,IF.makeDeleteStatement(F.deleteOne.filter,{...F.deleteOne,limit:1}))}if("deleteMany"in F){if("q"in F.deleteMany)throw new g0.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(_S.BatchType.DELETE,IF.makeDeleteStatement(F.deleteMany.filter,{...F.deleteMany,limit:0}))}throw new g0.MongoInvalidArgumentError("bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany")}get length(){return this.s.currentIndex}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern}get batches(){let F=[...this.s.batches];if(this.isOrdered){if(this.s.currentBatch)F.push(this.s.currentBatch)}else{if(this.s.currentInsertBatch)F.push(this.s.currentInsertBatch);if(this.s.currentUpdateBatch)F.push(this.s.currentUpdateBatch);if(this.s.currentRemoveBatch)F.push(this.s.currentRemoveBatch)}return F}async execute(F={}){if(this.s.executed)throw new g0.MongoBatchReExecutionError;let A=NS.WriteConcern.fromOptions(F);if(A)this.s.writeConcern=A;if(this.isOrdered){if(this.s.currentBatch)this.s.batches.push(this.s.currentBatch)}else{if(this.s.currentInsertBatch)this.s.batches.push(this.s.currentInsertBatch);if(this.s.currentUpdateBatch)this.s.batches.push(this.s.currentUpdateBatch);if(this.s.currentRemoveBatch)this.s.batches.push(this.s.currentRemoveBatch)}if(this.s.batches.length===0)throw new g0.MongoInvalidArgumentError("Invalid BulkOperation, Batch cannot be empty");this.s.executed=!0;let D={...this.s.options,...F},Z=new Dq(this,D);return await TS.executeOperation(this.s.collection.client,Z,D.timeoutContext)}handleWriteError(F){if(this.s.bulkResult.writeErrors.length>0){let D=this.s.bulkResult.writeErrors[0].errmsg?this.s.bulkResult.writeErrors[0].errmsg:"write operation failed";throw new q8({message:D,code:this.s.bulkResult.writeErrors[0].code,writeErrors:this.s.bulkResult.writeErrors},F)}let A=F.getWriteConcernError();if(A)throw new q8(A,F)}shouldForceServerObjectId(){return this.s.options.forceServerObjectId===!0||this.s.collection.s.db.options?.forceServerObjectId===!0}}_S.BulkOperationBase=OS;function SS(F){return F.batchType===_S.BatchType.INSERT}function eH(F){return F.batchType===_S.BatchType.UPDATE}function Fq(F){return F.batchType===_S.BatchType.DELETE}function PF(F){let{currentOp:A}=F.s;if(F.s.currentOp=void 0,!A)A={};return A}});var gS=E((yN1,xS)=>{var wJ1=M7().BulkWriteResult;xS.exports=wJ1});var NF=E((fS,yS)=>{/*!
13
+ * Connection states
14
+ */var f2=yS.exports=fS=Object.create(null);f2[0]="disconnected";f2[1]="connected";f2[2]="connecting";f2[3]="disconnecting";f2[99]="uninitialized";f2.disconnected=0;f2.connected=1;f2.connecting=2;f2.disconnecting=3;f2.uninitialized=99});var g6=E((bN1,bS)=>{/*!
15
+ * Centralize this so we can more easily work around issues with people
16
+ * stubbing out `process.nextTick()` in tests using sinon:
17
+ * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time
18
+ * See gh-6074
19
+ */var PJ1=typeof process!=="undefined"&&typeof process.nextTick==="function"?process.nextTick.bind(process):(F)=>setTimeout(F,0);bS.exports=function F(A){return PJ1(A)}});var mS=E((hN1,vS)=>{/*!
20
+ * Module dependencies.
21
+ */var IJ1=i("node:events").EventEmitter,MJ1=NF(),hS=g6();function d1(F,A,D){if(D===void 0)D={};if(this.opts=D,this.name=F,this.collectionName=F,this.conn=A,this.queue=[],this.buffer=!A?._hasOpened,this.emitter=new IJ1,MJ1.connected===this.conn.readyState)this.onOpen()}d1.prototype.name;d1.prototype.collectionName;d1.prototype.conn;d1.prototype.onOpen=function(){this.buffer=!1,hS(()=>this.doQueue())};d1.prototype.onClose=function(){};d1.prototype.addQueue=function(F,A){return this.queue.push([F,A]),this};d1.prototype.removeQueue=function(F,A){let D=this.queue.findIndex((Z)=>Z[0]===F&&Z[1]===A);if(D===-1)return!1;return this.queue.splice(D,1),!0};d1.prototype.doQueue=function(){for(let A of this.queue)if(typeof A[0]==="function")A[0].apply(this,A[1]);else this[A[0]].apply(this,A[1]);this.queue=[];let F=this;return hS(function(){F.emitter.emit("queue")}),this};d1.prototype.ensureIndex=function(){throw new Error("Collection#ensureIndex unimplemented by driver")};d1.prototype.createIndex=function(){throw new Error("Collection#createIndex unimplemented by driver")};d1.prototype.findAndModify=function(){throw new Error("Collection#findAndModify unimplemented by driver")};d1.prototype.findOneAndUpdate=function(){throw new Error("Collection#findOneAndUpdate unimplemented by driver")};d1.prototype.findOneAndDelete=function(){throw new Error("Collection#findOneAndDelete unimplemented by driver")};d1.prototype.findOneAndReplace=function(){throw new Error("Collection#findOneAndReplace unimplemented by driver")};d1.prototype.findOne=function(){throw new Error("Collection#findOne unimplemented by driver")};d1.prototype.find=function(){throw new Error("Collection#find unimplemented by driver")};d1.prototype.insert=function(){throw new Error("Collection#insert unimplemented by driver")};d1.prototype.insertOne=function(){throw new Error("Collection#insertOne unimplemented by driver")};d1.prototype.insertMany=function(){throw new Error("Collection#insertMany unimplemented by driver")};d1.prototype.save=function(){throw new Error("Collection#save unimplemented by driver")};d1.prototype.updateOne=function(){throw new Error("Collection#updateOne unimplemented by driver")};d1.prototype.updateMany=function(){throw new Error("Collection#updateMany unimplemented by driver")};d1.prototype.deleteOne=function(){throw new Error("Collection#deleteOne unimplemented by driver")};d1.prototype.deleteMany=function(){throw new Error("Collection#deleteMany unimplemented by driver")};d1.prototype.getIndexes=function(){throw new Error("Collection#getIndexes unimplemented by driver")};d1.prototype.watch=function(){throw new Error("Collection#watch unimplemented by driver")};/*!
22
+ * ignore
23
+ */d1.prototype._shouldBufferCommands=function F(){let A=this.opts;if(A.bufferCommands!=null)return A.bufferCommands;if(A&&A.schemaUserProvidedOptions!=null&&A.schemaUserProvidedOptions.bufferCommands!=null)return A.schemaUserProvidedOptions.bufferCommands;return this.conn._shouldBufferCommands()};/*!
24
+ * ignore
25
+ */d1.prototype._getBufferTimeoutMS=function F(){let A=this.conn,D=this.opts;if(D.bufferTimeoutMS!=null)return D.bufferTimeoutMS;if(D&&D.schemaUserProvidedOptions!=null&&D.schemaUserProvidedOptions.bufferTimeoutMS!=null)return D.schemaUserProvidedOptions.bufferTimeoutMS;return A._getBufferTimeoutMS()};/*!
26
+ * Module exports.
27
+ */vS.exports=d1});var w1=E((vN1,dS)=>{/*!
28
+ * ignore
29
+ */class Zq extends Error{}Object.defineProperty(Zq.prototype,"name",{value:"MongooseError"});dS.exports=Zq});var B3=E((KX1)=>{var NJ1=(()=>{let F=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get;return(A)=>F.call(A)})();function Q8(F){return NJ1(F)==="Uint8Array"}function kq(F){return typeof F==="object"&&F!=null&&Symbol.toStringTag in F&&(F[Symbol.toStringTag]==="ArrayBuffer"||F[Symbol.toStringTag]==="SharedArrayBuffer")}function K8(F){return F instanceof RegExp||Object.prototype.toString.call(F)==="[object RegExp]"}function Oq(F){return typeof F==="object"&&F!=null&&Symbol.toStringTag in F&&F[Symbol.toStringTag]==="Map"}function E8(F){return F instanceof Date||Object.prototype.toString.call(F)==="[object Date]"}function E6(F,A){return JSON.stringify(F,(D,Z)=>{if(typeof Z==="bigint")return{$numberLong:`${Z}`};else if(Oq(Z))return Object.fromEntries(Z);return Z})}function jJ1(F){if(F!=null&&typeof F==="object"&&"stylize"in F&&typeof F.stylize==="function")return F.stylize}var g9=6,V8=Symbol.for("@@mdb.bson.version"),_F=2147483647,uF=-2147483648,J_=Math.pow(2,63)-1,X_=-Math.pow(2,63),$_=Math.pow(2,53),Y_=-Math.pow(2,53),Sq=1,G_=2,_q=3,B_=4,uq=5,TJ1=6,H_=7,q_=8,W_=9,xq=10,yZ=11,kJ1=12,gq=13,C_=14,Q_=15,kF=16,K_=17,fq=18,E_=19,U_=255,z_=127,OJ1=0,yq=4,V_=Object.freeze({double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:-1,maxKey:127});class v extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(F,A){super(F,A)}static isBSONError(F){return F!=null&&typeof F==="object"&&"bsonError"in F&&F.bsonError===!0&&"name"in F&&"message"in F&&"stack"in F}}class l4 extends v{get name(){return"BSONVersionError"}constructor(){super(`Unsupported BSON version, bson types must be from bson ${g9}.x.x`)}}class OF extends v{get name(){return"BSONRuntimeError"}constructor(F){super(F)}}class G3 extends v{get name(){return"BSONOffsetError"}constructor(F,A,D){super(`${F}. offset: ${A}`,D);this.offset=A}}var cS,lS;function L_(F,A,D,Z){if(Z){cS??=new TextDecoder("utf8",{fatal:!0});try{return cS.decode(F.subarray(A,D))}catch(J){throw new v("Invalid UTF-8 string in BSON document",{cause:J})}}return lS??=new TextDecoder("utf8",{fatal:!1}),lS.decode(F.subarray(A,D))}function R_(F,A,D){if(F.length===0)return"";let Z=D-A;if(Z===0)return"";if(Z>20)return null;if(Z===1&&F[A]<128)return String.fromCharCode(F[A]);if(Z===2&&F[A]<128&&F[A+1]<128)return String.fromCharCode(F[A])+String.fromCharCode(F[A+1]);if(Z===3&&F[A]<128&&F[A+1]<128&&F[A+2]<128)return String.fromCharCode(F[A])+String.fromCharCode(F[A+1])+String.fromCharCode(F[A+2]);let J=[];for(let X=A;X<D;X++){let $=F[X];if($>127)return null;J.push($)}return String.fromCharCode(...J)}function SJ1(F,A,D){if(A.length===0)return 0;if(A.length>25)return null;if(F.length-D<A.length)return null;for(let Z=0,J=D;Z<A.length;Z++,J++){let X=A.charCodeAt(Z);if(X>127)return null;F[J]=X}return A.length}function _J1(F){return r3.fromNumberArray(Array.from({length:F},()=>Math.floor(Math.random()*256)))}var uJ1=(()=>{try{return i("node:crypto").randomBytes}catch{return _J1}})(),r3={toLocalBufferType(F){if(Buffer.isBuffer(F))return F;if(ArrayBuffer.isView(F))return Buffer.from(F.buffer,F.byteOffset,F.byteLength);let A=F?.[Symbol.toStringTag]??Object.prototype.toString.call(F);if(A==="ArrayBuffer"||A==="SharedArrayBuffer"||A==="[object ArrayBuffer]"||A==="[object SharedArrayBuffer]")return Buffer.from(F);throw new v("Cannot create Buffer from the passed potentialBuffer.")},allocate(F){return Buffer.alloc(F)},allocateUnsafe(F){return Buffer.allocUnsafe(F)},equals(F,A){return r3.toLocalBufferType(F).equals(A)},fromNumberArray(F){return Buffer.from(F)},fromBase64(F){return Buffer.from(F,"base64")},toBase64(F){return r3.toLocalBufferType(F).toString("base64")},fromISO88591(F){return Buffer.from(F,"binary")},toISO88591(F){return r3.toLocalBufferType(F).toString("binary")},fromHex(F){return Buffer.from(F,"hex")},toHex(F){return r3.toLocalBufferType(F).toString("hex")},toUTF8(F,A,D,Z){let J=D-A<=20?R_(F,A,D):null;if(J!=null)return J;let X=r3.toLocalBufferType(F).toString("utf8",A,D);if(Z){for(let $=0;$<X.length;$++)if(X.charCodeAt($)===65533){L_(F,A,D,!0);break}}return X},utf8ByteLength(F){return Buffer.byteLength(F,"utf8")},encodeUTF8Into(F,A,D){let Z=SJ1(F,A,D);if(Z!=null)return Z;return r3.toLocalBufferType(F).write(A,D,void 0,"utf8")},randomBytes:uJ1,swap32(F){return r3.toLocalBufferType(F).swap32()}};function xJ1(){let{navigator:F}=globalThis;return typeof F==="object"&&F.product==="ReactNative"}function gJ1(F){if(F<0)throw new RangeError(`The argument 'byteLength' is invalid. Received ${F}`);return SF.fromNumberArray(Array.from({length:F},()=>Math.floor(Math.random()*256)))}var fJ1=(()=>{let{crypto:F}=globalThis;if(F!=null&&typeof F.getRandomValues==="function")return(A)=>{return F.getRandomValues(SF.allocate(A))};else{if(xJ1()){let{console:A}=globalThis;A?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return gJ1}})(),pS=/(\d|[a-f])/i,SF={toLocalBufferType(F){let A=F?.[Symbol.toStringTag]??Object.prototype.toString.call(F);if(A==="Uint8Array")return F;if(ArrayBuffer.isView(F))return new Uint8Array(F.buffer.slice(F.byteOffset,F.byteOffset+F.byteLength));if(A==="ArrayBuffer"||A==="SharedArrayBuffer"||A==="[object ArrayBuffer]"||A==="[object SharedArrayBuffer]")return new Uint8Array(F);throw new v("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(F){if(typeof F!=="number")throw new TypeError(`The "size" argument must be of type number. Received ${String(F)}`);return new Uint8Array(F)},allocateUnsafe(F){return SF.allocate(F)},equals(F,A){if(F.byteLength!==A.byteLength)return!1;for(let D=0;D<F.byteLength;D++)if(F[D]!==A[D])return!1;return!0},fromNumberArray(F){return Uint8Array.from(F)},fromBase64(F){return Uint8Array.from(atob(F),(A)=>A.charCodeAt(0))},toBase64(F){return btoa(SF.toISO88591(F))},fromISO88591(F){return Uint8Array.from(F,(A)=>A.charCodeAt(0)&255)},toISO88591(F){return Array.from(Uint16Array.from(F),(A)=>String.fromCharCode(A)).join("")},fromHex(F){let A=F.length%2===0?F:F.slice(0,F.length-1),D=[];for(let Z=0;Z<A.length;Z+=2){let J=A[Z],X=A[Z+1];if(!pS.test(J))break;if(!pS.test(X))break;let $=Number.parseInt(`${J}${X}`,16);D.push($)}return Uint8Array.from(D)},toHex(F){return Array.from(F,(A)=>A.toString(16).padStart(2,"0")).join("")},toUTF8(F,A,D,Z){let J=D-A<=20?R_(F,A,D):null;if(J!=null)return J;return L_(F,A,D,Z)},utf8ByteLength(F){return new TextEncoder().encode(F).byteLength},encodeUTF8Into(F,A,D){let Z=new TextEncoder().encode(A);return F.set(Z,D),Z.byteLength},randomBytes:fJ1,swap32(F){if(F.length%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<F.length;A+=4){let D=F[A],Z=F[A+1],J=F[A+2],X=F[A+3];F[A]=X,F[A+1]=J,F[A+2]=Z,F[A+3]=D}return F}},yJ1=typeof Buffer==="function"&&Buffer.prototype?._isBuffer!==!0,y=yJ1?r3:SF;class y2{get[V8](){return g9}[Symbol.for("nodejs.util.inspect.custom")](F,A,D){return this.inspect(F,A,D)}}var U8=new Float64Array(1),x1=new Uint8Array(U8.buffer,0,8);U8[0]=-1;var Jq=x1[7]===0,Y1={isBigEndian:Jq,getNonnegativeInt32LE(F,A){if(F[A+3]>127)throw new RangeError(`Size cannot be negative at offset: ${A}`);return F[A]|F[A+1]<<8|F[A+2]<<16|F[A+3]<<24},getInt32LE(F,A){return F[A]|F[A+1]<<8|F[A+2]<<16|F[A+3]<<24},getUint32LE(F,A){return F[A]+F[A+1]*256+F[A+2]*65536+F[A+3]*16777216},getUint32BE(F,A){return F[A+3]+F[A+2]*256+F[A+1]*65536+F[A]*16777216},getBigInt64LE(F,A){let D=BigInt(F[A+4]+F[A+5]*256+F[A+6]*65536+(F[A+7]<<24)),Z=BigInt(F[A]+F[A+1]*256+F[A+2]*65536+F[A+3]*16777216);return(D<<BigInt(32))+Z},getFloat64LE:Jq?(F,A)=>{return x1[7]=F[A],x1[6]=F[A+1],x1[5]=F[A+2],x1[4]=F[A+3],x1[3]=F[A+4],x1[2]=F[A+5],x1[1]=F[A+6],x1[0]=F[A+7],U8[0]}:(F,A)=>{return x1[0]=F[A],x1[1]=F[A+1],x1[2]=F[A+2],x1[3]=F[A+3],x1[4]=F[A+4],x1[5]=F[A+5],x1[6]=F[A+6],x1[7]=F[A+7],U8[0]},setInt32BE(F,A,D){return F[A+3]=D,D>>>=8,F[A+2]=D,D>>>=8,F[A+1]=D,D>>>=8,F[A]=D,4},setInt32LE(F,A,D){return F[A]=D,D>>>=8,F[A+1]=D,D>>>=8,F[A+2]=D,D>>>=8,F[A+3]=D,4},setBigInt64LE(F,A,D){let Z=BigInt(4294967295),J=Number(D&Z);F[A]=J,J>>=8,F[A+1]=J,J>>=8,F[A+2]=J,J>>=8,F[A+3]=J;let X=Number(D>>BigInt(32)&Z);return F[A+4]=X,X>>=8,F[A+5]=X,X>>=8,F[A+6]=X,X>>=8,F[A+7]=X,8},setFloat64LE:Jq?(F,A,D)=>{return U8[0]=D,F[A]=x1[7],F[A+1]=x1[6],F[A+2]=x1[5],F[A+3]=x1[4],F[A+4]=x1[3],F[A+5]=x1[2],F[A+6]=x1[1],F[A+7]=x1[0],8}:(F,A,D)=>{return U8[0]=D,F[A]=x1[0],F[A+1]=x1[1],F[A+2]=x1[2],F[A+3]=x1[3],F[A+4]=x1[4],F[A+5]=x1[5],F[A+6]=x1[6],F[A+7]=x1[7],8}};class J1 extends y2{get _bsontype(){return"Binary"}constructor(F,A){super();if(F!=null&&typeof F==="string"&&!ArrayBuffer.isView(F)&&!kq(F)&&!Array.isArray(F))throw new v("Binary can only be constructed from Uint8Array or number[]");if(this.sub_type=A??J1.BSON_BINARY_SUBTYPE_DEFAULT,F==null)this.buffer=y.allocate(J1.BUFFER_SIZE),this.position=0;else this.buffer=Array.isArray(F)?y.fromNumberArray(F):y.toLocalBufferType(F),this.position=this.buffer.byteLength}put(F){if(typeof F==="string"&&F.length!==1)throw new v("only accepts single character String");else if(typeof F!=="number"&&F.length!==1)throw new v("only accepts single character Uint8Array or Array");let A;if(typeof F==="string")A=F.charCodeAt(0);else if(typeof F==="number")A=F;else A=F[0];if(A<0||A>255)throw new v("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=A;else{let D=y.allocate(J1.BUFFER_SIZE+this.buffer.length);D.set(this.buffer,0),this.buffer=D,this.buffer[this.position++]=A}}write(F,A){if(A=typeof A==="number"?A:this.position,this.buffer.byteLength<A+F.length){let D=y.allocate(this.buffer.byteLength+F.length);D.set(this.buffer,0),this.buffer=D}if(ArrayBuffer.isView(F))this.buffer.set(y.toLocalBufferType(F),A),this.position=A+F.byteLength>this.position?A+F.length:this.position;else if(typeof F==="string")throw new v("input cannot be string")}read(F,A){A=A&&A>0?A:this.position;let D=F+A;return this.buffer.subarray(F,D>this.position?this.position:D)}value(){return this.buffer.length===this.position?this.buffer:this.buffer.subarray(0,this.position)}length(){return this.position}toJSON(){return y.toBase64(this.buffer.subarray(0,this.position))}toString(F){if(F==="hex")return y.toHex(this.buffer.subarray(0,this.position));if(F==="base64")return y.toBase64(this.buffer.subarray(0,this.position));if(F==="utf8"||F==="utf-8")return y.toUTF8(this.buffer,0,this.position,!1);return y.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(F){if(F=F||{},this.sub_type===J1.SUBTYPE_VECTOR)w_(this);let A=y.toBase64(this.buffer),D=Number(this.sub_type).toString(16);if(F.legacy)return{$binary:A,$type:D.length===1?"0"+D:D};return{$binary:{base64:A,subType:D.length===1?"0"+D:D}}}toUUID(){if(this.sub_type===J1.SUBTYPE_UUID)return new A2(this.buffer.subarray(0,this.position));throw new v(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${J1.SUBTYPE_UUID}" is currently supported.`)}static createFromHexString(F,A){return new J1(y.fromHex(F),A)}static createFromBase64(F,A){return new J1(y.fromBase64(F),A)}static fromExtendedJSON(F,A){A=A||{};let D,Z;if("$binary"in F){if(A.legacy&&typeof F.$binary==="string"&&"$type"in F)Z=F.$type?parseInt(F.$type,16):0,D=y.fromBase64(F.$binary);else if(typeof F.$binary!=="string")Z=F.$binary.subType?parseInt(F.$binary.subType,16):0,D=y.fromBase64(F.$binary.base64)}else if("$uuid"in F)Z=4,D=A2.bytesFromString(F.$uuid);if(!D)throw new v(`Unexpected Binary Extended JSON format ${JSON.stringify(F)}`);return Z===yq?new A2(D):new J1(D,Z)}inspect(F,A,D){D??=E6;let Z=y.toBase64(this.buffer.subarray(0,this.position)),J=D(Z,A),X=D(this.sub_type,A);return`Binary.createFromBase64(${J}, ${X})`}toInt8Array(){if(this.sub_type!==J1.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==J1.VECTOR_TYPE.Int8)throw new v("Binary datatype field is not Int8");return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==J1.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==J1.VECTOR_TYPE.Float32)throw new v("Binary datatype field is not Float32");let F=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));if(Y1.isBigEndian)y.swap32(F);return new Float32Array(F.buffer)}toPackedBits(){if(this.sub_type!==J1.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==J1.VECTOR_TYPE.PackedBit)throw new v("Binary datatype field is not packed bit");return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==J1.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==J1.VECTOR_TYPE.PackedBit)throw new v("Binary datatype field is not packed bit");let A=(this.length()-2)*8-this.buffer[1],D=new Int8Array(A);for(let Z=0;Z<D.length;Z++){let J=Z/8|0,X=this.buffer[J+2],$=7-Z%8,G=X>>$&1;D[Z]=G}return D}static fromInt8Array(F){let A=y.allocate(F.byteLength+2);A[0]=J1.VECTOR_TYPE.Int8,A[1]=0;let D=new Uint8Array(F.buffer,F.byteOffset,F.byteLength);return A.set(D,2),new this(A,this.SUBTYPE_VECTOR)}static fromFloat32Array(F){let A=y.allocate(F.byteLength+2);A[0]=J1.VECTOR_TYPE.Float32,A[1]=0;let D=new Uint8Array(F.buffer,F.byteOffset,F.byteLength);if(A.set(D,2),Y1.isBigEndian)y.swap32(new Uint8Array(A.buffer,2));return new this(A,this.SUBTYPE_VECTOR)}static fromPackedBits(F,A=0){let D=y.allocate(F.byteLength+2);return D[0]=J1.VECTOR_TYPE.PackedBit,D[1]=A,D.set(F,2),new this(D,this.SUBTYPE_VECTOR)}static fromBits(F){let A=F.length+7>>>3,D=new Uint8Array(A+2);D[0]=J1.VECTOR_TYPE.PackedBit;let Z=F.length%8;D[1]=Z===0?0:8-Z;for(let J=0;J<F.length;J++){let X=J>>>3,$=F[J];if($!==0&&$!==1)throw new v(`Invalid bit value at ${J}: must be 0 or 1, found ${F[J]}`);if($===0)continue;let G=7-J%8;D[X+2]|=$<<G}return new this(D,J1.SUBTYPE_VECTOR)}}J1.BSON_BINARY_SUBTYPE_DEFAULT=0;J1.BUFFER_SIZE=256;J1.SUBTYPE_DEFAULT=0;J1.SUBTYPE_FUNCTION=1;J1.SUBTYPE_BYTE_ARRAY=2;J1.SUBTYPE_UUID_OLD=3;J1.SUBTYPE_UUID=4;J1.SUBTYPE_MD5=5;J1.SUBTYPE_ENCRYPTED=6;J1.SUBTYPE_COLUMN=7;J1.SUBTYPE_SENSITIVE=8;J1.SUBTYPE_VECTOR=9;J1.SUBTYPE_USER_DEFINED=128;J1.VECTOR_TYPE=Object.freeze({Int8:3,Float32:39,PackedBit:16});function w_(F){if(F.sub_type!==J1.SUBTYPE_VECTOR)return;let A=F.position,D=F.buffer[0],Z=F.buffer[1];if((D===J1.VECTOR_TYPE.Float32||D===J1.VECTOR_TYPE.Int8)&&Z!==0)throw new v("Invalid Vector: padding must be zero for int8 and float32 vectors");if(D===J1.VECTOR_TYPE.PackedBit&&Z!==0&&A===2)throw new v("Invalid Vector: padding must be zero for packed bit vectors that are empty");if(D===J1.VECTOR_TYPE.PackedBit&&Z>7)throw new v(`Invalid Vector: padding must be a value between 0 and 7. found: ${Z}`)}var Xq=16,bJ1=/^[0-9A-F]{32}$/i,hJ1=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class A2 extends J1{constructor(F){let A;if(F==null)A=A2.generate();else if(F instanceof A2)A=y.toLocalBufferType(new Uint8Array(F.buffer));else if(ArrayBuffer.isView(F)&&F.byteLength===Xq)A=y.toLocalBufferType(F);else if(typeof F==="string")A=A2.bytesFromString(F);else throw new v("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");super(A,yq)}get id(){return this.buffer}set id(F){this.buffer=F}toHexString(F=!0){if(F)return[y.toHex(this.buffer.subarray(0,4)),y.toHex(this.buffer.subarray(4,6)),y.toHex(this.buffer.subarray(6,8)),y.toHex(this.buffer.subarray(8,10)),y.toHex(this.buffer.subarray(10,16))].join("-");return y.toHex(this.buffer)}toString(F){if(F==="hex")return y.toHex(this.id);if(F==="base64")return y.toBase64(this.id);return this.toHexString()}toJSON(){return this.toHexString()}equals(F){if(!F)return!1;if(F instanceof A2)return y.equals(F.id,this.id);try{return y.equals(new A2(F).id,this.id)}catch{return!1}}toBinary(){return new J1(this.id,J1.SUBTYPE_UUID)}static generate(){let F=y.randomBytes(Xq);return F[6]=F[6]&15|64,F[8]=F[8]&63|128,F}static isValid(F){if(!F)return!1;if(typeof F==="string")return A2.isValidUUIDString(F);if(Q8(F))return F.byteLength===Xq;return F._bsontype==="Binary"&&F.sub_type===this.SUBTYPE_UUID&&F.buffer.byteLength===16}static createFromHexString(F){let A=A2.bytesFromString(F);return new A2(A)}static createFromBase64(F){return new A2(y.fromBase64(F))}static bytesFromString(F){if(!A2.isValidUUIDString(F))throw new v("UUID string representation must be 32 hex digits or canonical hyphenated representation");return y.fromHex(F.replace(/-/g,""))}static isValidUUIDString(F){return bJ1.test(F)||hJ1.test(F)}inspect(F,A,D){return D??=E6,`new UUID(${D(this.toHexString(),A)})`}}class o3 extends y2{get _bsontype(){return"Code"}constructor(F,A){super();this.code=F.toString(),this.scope=A??null}toJSON(){if(this.scope!=null)return{code:this.code,scope:this.scope};return{code:this.code}}toExtendedJSON(){if(this.scope)return{$code:this.code,$scope:this.scope};return{$code:this.code}}static fromExtendedJSON(F){return new o3(F.$code,F.$scope)}inspect(F,A,D){D??=E6;let Z=D(this.code,A),J=Z.includes(`
30
+ `);if(this.scope!=null)Z+=`,${J?`
31
+ `:" "}${D(this.scope,A)}`;let X=J&&this.scope===null;return`new Code(${J?`
32
+ `:""}${Z}${X?`
33
+ `:""})`}}function P_(F){return F!=null&&typeof F==="object"&&"$id"in F&&F.$id!=null&&"$ref"in F&&typeof F.$ref==="string"&&(!("$db"in F)||("$db"in F)&&typeof F.$db==="string")}class j3 extends y2{get _bsontype(){return"DBRef"}constructor(F,A,D,Z){super();let J=F.split(".");if(J.length===2)D=J.shift(),F=J.shift();this.collection=F,this.oid=A,this.db=D,this.fields=Z||{}}get namespace(){return this.collection}set namespace(F){this.collection=F}toJSON(){let F=Object.assign({$ref:this.collection,$id:this.oid},this.fields);if(this.db!=null)F.$db=this.db;return F}toExtendedJSON(F){F=F||{};let A={$ref:this.collection,$id:this.oid};if(F.legacy)return A;if(this.db)A.$db=this.db;return A=Object.assign(A,this.fields),A}static fromExtendedJSON(F){let A=Object.assign({},F);return delete A.$ref,delete A.$id,delete A.$db,new j3(F.$ref,F.$id,F.$db,A)}inspect(F,A,D){D??=E6;let Z=[D(this.namespace,A),D(this.oid,A),...this.db?[D(this.db,A)]:[],...Object.keys(this.fields).length>0?[D(this.fields,A)]:[]];return Z[1]=D===E6?`new ObjectId(${Z[1]})`:Z[1],`new DBRef(${Z.join(", ")})`}}function I_(F){if(F==="")return F;let A=0,D=F[A]==="-",Z=F[A]==="+";if(Z||D)A+=1;let J=!1;for(;A<F.length&&F[A]==="0";++A)J=!0;if(!J)return Z?F.slice(1):F;return`${D?"-":""}${F.length===A?"0":F.slice(A)}`}function vJ1(F,A){A=A??10;let D="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,A);return new RegExp(`[^-+${D}]`,"i").test(F)?!1:F}var f6=void 0;try{f6=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{}var iS=65536,mJ1=16777216,z8=iS*iS,M_=z8*z8,dJ1=M_/2,aS={},nS={},cJ1=20,lJ1=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class T extends y2{get _bsontype(){return"Long"}get __isLong__(){return!0}constructor(F=0,A,D){super();let Z=typeof A==="boolean"?A:Boolean(D),J=typeof A==="number"?A:0,X=typeof F==="string"?T.fromString(F,Z):typeof F==="bigint"?T.fromBigInt(F,Z):{low:F|0,high:J|0,unsigned:Z};this.low=X.low,this.high=X.high,this.unsigned=X.unsigned}static fromBits(F,A,D){return new T(F,A,D)}static fromInt(F,A){let D,Z,J;if(A){if(F>>>=0,J=0<=F&&F<256){if(Z=nS[F],Z)return Z}if(D=T.fromBits(F,(F|0)<0?-1:0,!0),J)nS[F]=D;return D}else{if(F|=0,J=-128<=F&&F<128){if(Z=aS[F],Z)return Z}if(D=T.fromBits(F,F<0?-1:0,!1),J)aS[F]=D;return D}}static fromNumber(F,A){if(isNaN(F))return A?T.UZERO:T.ZERO;if(A){if(F<0)return T.UZERO;if(F>=M_)return T.MAX_UNSIGNED_VALUE}else{if(F<=-9223372036854776000)return T.MIN_VALUE;if(F+1>=dJ1)return T.MAX_VALUE}if(F<0)return T.fromNumber(-F,A).neg();return T.fromBits(F%z8|0,F/z8|0,A)}static fromBigInt(F,A){let D=BigInt(4294967295),Z=BigInt(32);return new T(Number(F&D),Number(F>>Z&D),A)}static _fromString(F,A,D){if(F.length===0)throw new v("empty string");if(D<2||36<D)throw new v("radix");let Z;if((Z=F.indexOf("-"))>0)throw new v("interior hyphen");else if(Z===0)return T._fromString(F.substring(1),A,D).neg();let J=T.fromNumber(Math.pow(D,8)),X=T.ZERO;for(let $=0;$<F.length;$+=8){let G=Math.min(8,F.length-$),Y=parseInt(F.substring($,$+G),D);if(G<8){let B=T.fromNumber(Math.pow(D,G));X=X.mul(B).add(T.fromNumber(Y))}else X=X.mul(J),X=X.add(T.fromNumber(Y))}return X.unsigned=A,X}static fromStringStrict(F,A,D){let Z=!1;if(typeof A==="number")D=A,A=!1;else Z=!!A;if(D??=10,F.trim()!==F)throw new v(`Input: '${F}' contains leading and/or trailing whitespace`);if(!vJ1(F,D))throw new v(`Input: '${F}' contains invalid characters for radix: ${D}`);let J=I_(F),X=T._fromString(J,Z,D);if(X.toString(D).toLowerCase()!==J.toLowerCase())throw new v(`Input: ${F} is not representable as ${X.unsigned?"an unsigned":"a signed"} 64-bit Long ${D!=null?`with radix: ${D}`:""}`);return X}static fromString(F,A,D){let Z=!1;if(typeof A==="number")D=A,A=!1;else Z=!!A;if(D??=10,F==="NaN"&&D<24)return T.ZERO;else if((F==="Infinity"||F==="+Infinity"||F==="-Infinity")&&D<35)return T.ZERO;return T._fromString(F,Z,D)}static fromBytes(F,A,D){return D?T.fromBytesLE(F,A):T.fromBytesBE(F,A)}static fromBytesLE(F,A){return new T(F[0]|F[1]<<8|F[2]<<16|F[3]<<24,F[4]|F[5]<<8|F[6]<<16|F[7]<<24,A)}static fromBytesBE(F,A){return new T(F[4]<<24|F[5]<<16|F[6]<<8|F[7],F[0]<<24|F[1]<<16|F[2]<<8|F[3],A)}static isLong(F){return F!=null&&typeof F==="object"&&"__isLong__"in F&&F.__isLong__===!0}static fromValue(F,A){if(typeof F==="number")return T.fromNumber(F,A);if(typeof F==="string")return T.fromString(F,A);return T.fromBits(F.low,F.high,typeof A==="boolean"?A:F.unsigned)}add(F){if(!T.isLong(F))F=T.fromValue(F);let A=this.high>>>16,D=this.high&65535,Z=this.low>>>16,J=this.low&65535,X=F.high>>>16,$=F.high&65535,G=F.low>>>16,Y=F.low&65535,B=0,H=0,q=0,W=0;return W+=J+Y,q+=W>>>16,W&=65535,q+=Z+G,H+=q>>>16,q&=65535,H+=D+$,B+=H>>>16,H&=65535,B+=A+X,B&=65535,T.fromBits(q<<16|W,B<<16|H,this.unsigned)}and(F){if(!T.isLong(F))F=T.fromValue(F);return T.fromBits(this.low&F.low,this.high&F.high,this.unsigned)}compare(F){if(!T.isLong(F))F=T.fromValue(F);if(this.eq(F))return 0;let A=this.isNegative(),D=F.isNegative();if(A&&!D)return-1;if(!A&&D)return 1;if(!this.unsigned)return this.sub(F).isNegative()?-1:1;return F.high>>>0>this.high>>>0||F.high===this.high&&F.low>>>0>this.low>>>0?-1:1}comp(F){return this.compare(F)}divide(F){if(!T.isLong(F))F=T.fromValue(F);if(F.isZero())throw new v("division by zero");if(f6){if(!this.unsigned&&this.high===-2147483648&&F.low===-1&&F.high===-1)return this;let J=(this.unsigned?f6.div_u:f6.div_s)(this.low,this.high,F.low,F.high);return T.fromBits(J,f6.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?T.UZERO:T.ZERO;let A,D,Z;if(!this.unsigned){if(this.eq(T.MIN_VALUE))if(F.eq(T.ONE)||F.eq(T.NEG_ONE))return T.MIN_VALUE;else if(F.eq(T.MIN_VALUE))return T.ONE;else if(A=this.shr(1).div(F).shl(1),A.eq(T.ZERO))return F.isNegative()?T.ONE:T.NEG_ONE;else return D=this.sub(F.mul(A)),Z=A.add(D.div(F)),Z;else if(F.eq(T.MIN_VALUE))return this.unsigned?T.UZERO:T.ZERO;if(this.isNegative()){if(F.isNegative())return this.neg().div(F.neg());return this.neg().div(F).neg()}else if(F.isNegative())return this.div(F.neg()).neg();Z=T.ZERO}else{if(!F.unsigned)F=F.toUnsigned();if(F.gt(this))return T.UZERO;if(F.gt(this.shru(1)))return T.UONE;Z=T.UZERO}D=this;while(D.gte(F)){A=Math.max(1,Math.floor(D.toNumber()/F.toNumber()));let J=Math.ceil(Math.log(A)/Math.LN2),X=J<=48?1:Math.pow(2,J-48),$=T.fromNumber(A),G=$.mul(F);while(G.isNegative()||G.gt(D))A-=X,$=T.fromNumber(A,this.unsigned),G=$.mul(F);if($.isZero())$=T.ONE;Z=Z.add($),D=D.sub(G)}return Z}div(F){return this.divide(F)}equals(F){if(!T.isLong(F))F=T.fromValue(F);if(this.unsigned!==F.unsigned&&this.high>>>31===1&&F.high>>>31===1)return!1;return this.high===F.high&&this.low===F.low}eq(F){return this.equals(F)}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(T.MIN_VALUE)?64:this.neg().getNumBitsAbs();let F=this.high!==0?this.high:this.low,A;for(A=31;A>0;A--)if((F&1<<A)!==0)break;return this.high!==0?A+33:A+1}greaterThan(F){return this.comp(F)>0}gt(F){return this.greaterThan(F)}greaterThanOrEqual(F){return this.comp(F)>=0}gte(F){return this.greaterThanOrEqual(F)}ge(F){return this.greaterThanOrEqual(F)}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(F){return this.comp(F)<0}lt(F){return this.lessThan(F)}lessThanOrEqual(F){return this.comp(F)<=0}lte(F){return this.lessThanOrEqual(F)}modulo(F){if(!T.isLong(F))F=T.fromValue(F);if(f6){let A=(this.unsigned?f6.rem_u:f6.rem_s)(this.low,this.high,F.low,F.high);return T.fromBits(A,f6.get_high(),this.unsigned)}return this.sub(this.div(F).mul(F))}mod(F){return this.modulo(F)}rem(F){return this.modulo(F)}multiply(F){if(this.isZero())return T.ZERO;if(!T.isLong(F))F=T.fromValue(F);if(f6){let C=f6.mul(this.low,this.high,F.low,F.high);return T.fromBits(C,f6.get_high(),this.unsigned)}if(F.isZero())return T.ZERO;if(this.eq(T.MIN_VALUE))return F.isOdd()?T.MIN_VALUE:T.ZERO;if(F.eq(T.MIN_VALUE))return this.isOdd()?T.MIN_VALUE:T.ZERO;if(this.isNegative())if(F.isNegative())return this.neg().mul(F.neg());else return this.neg().mul(F).neg();else if(F.isNegative())return this.mul(F.neg()).neg();if(this.lt(T.TWO_PWR_24)&&F.lt(T.TWO_PWR_24))return T.fromNumber(this.toNumber()*F.toNumber(),this.unsigned);let A=this.high>>>16,D=this.high&65535,Z=this.low>>>16,J=this.low&65535,X=F.high>>>16,$=F.high&65535,G=F.low>>>16,Y=F.low&65535,B=0,H=0,q=0,W=0;return W+=J*Y,q+=W>>>16,W&=65535,q+=Z*Y,H+=q>>>16,q&=65535,q+=J*G,H+=q>>>16,q&=65535,H+=D*Y,B+=H>>>16,H&=65535,H+=Z*G,B+=H>>>16,H&=65535,H+=J*$,B+=H>>>16,H&=65535,B+=A*Y+D*G+Z*$+J*X,B&=65535,T.fromBits(q<<16|W,B<<16|H,this.unsigned)}mul(F){return this.multiply(F)}negate(){if(!this.unsigned&&this.eq(T.MIN_VALUE))return T.MIN_VALUE;return this.not().add(T.ONE)}neg(){return this.negate()}not(){return T.fromBits(~this.low,~this.high,this.unsigned)}notEquals(F){return!this.equals(F)}neq(F){return this.notEquals(F)}ne(F){return this.notEquals(F)}or(F){if(!T.isLong(F))F=T.fromValue(F);return T.fromBits(this.low|F.low,this.high|F.high,this.unsigned)}shiftLeft(F){if(T.isLong(F))F=F.toInt();if((F&=63)===0)return this;else if(F<32)return T.fromBits(this.low<<F,this.high<<F|this.low>>>32-F,this.unsigned);else return T.fromBits(0,this.low<<F-32,this.unsigned)}shl(F){return this.shiftLeft(F)}shiftRight(F){if(T.isLong(F))F=F.toInt();if((F&=63)===0)return this;else if(F<32)return T.fromBits(this.low>>>F|this.high<<32-F,this.high>>F,this.unsigned);else return T.fromBits(this.high>>F-32,this.high>=0?0:-1,this.unsigned)}shr(F){return this.shiftRight(F)}shiftRightUnsigned(F){if(T.isLong(F))F=F.toInt();if(F&=63,F===0)return this;else{let A=this.high;if(F<32){let D=this.low;return T.fromBits(D>>>F|A<<32-F,A>>>F,this.unsigned)}else if(F===32)return T.fromBits(A,0,this.unsigned);else return T.fromBits(A>>>F-32,0,this.unsigned)}}shr_u(F){return this.shiftRightUnsigned(F)}shru(F){return this.shiftRightUnsigned(F)}subtract(F){if(!T.isLong(F))F=T.fromValue(F);return this.add(F.neg())}sub(F){return this.subtract(F)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){if(this.unsigned)return(this.high>>>0)*z8+(this.low>>>0);return this.high*z8+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(F){return F?this.toBytesLE():this.toBytesBE()}toBytesLE(){let F=this.high,A=this.low;return[A&255,A>>>8&255,A>>>16&255,A>>>24,F&255,F>>>8&255,F>>>16&255,F>>>24]}toBytesBE(){let F=this.high,A=this.low;return[F>>>24,F>>>16&255,F>>>8&255,F&255,A>>>24,A>>>16&255,A>>>8&255,A&255]}toSigned(){if(!this.unsigned)return this;return T.fromBits(this.low,this.high,!1)}toString(F){if(F=F||10,F<2||36<F)throw new v("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(T.MIN_VALUE)){let J=T.fromNumber(F),X=this.div(J),$=X.mul(J).sub(this);return X.toString(F)+$.toInt().toString(F)}else return"-"+this.neg().toString(F);let A=T.fromNumber(Math.pow(F,6),this.unsigned),D=this,Z="";while(!0){let J=D.div(A),$=(D.sub(J.mul(A)).toInt()>>>0).toString(F);if(D=J,D.isZero())return $+Z;else{while($.length<6)$="0"+$;Z=""+$+Z}}}toUnsigned(){if(this.unsigned)return this;return T.fromBits(this.low,this.high,!0)}xor(F){if(!T.isLong(F))F=T.fromValue(F);return T.fromBits(this.low^F.low,this.high^F.high,this.unsigned)}eqz(){return this.isZero()}le(F){return this.lessThanOrEqual(F)}toExtendedJSON(F){if(F&&F.relaxed)return this.toNumber();return{$numberLong:this.toString()}}static fromExtendedJSON(F,A){let{useBigInt64:D=!1,relaxed:Z=!0}={...A};if(F.$numberLong.length>cJ1)throw new v("$numberLong string is too long");if(!lJ1.test(F.$numberLong))throw new v(`$numberLong string "${F.$numberLong}" is in an invalid format`);if(D){let X=BigInt(F.$numberLong);return BigInt.asIntN(64,X)}let J=T.fromString(F.$numberLong);if(Z)return J.toNumber();return J}inspect(F,A,D){D??=E6;let Z=D(this.toString(),A),J=this.unsigned?`, ${D(this.unsigned,A)}`:"";return`new Long(${Z}${J})`}}T.TWO_PWR_24=T.fromInt(mJ1);T.MAX_UNSIGNED_VALUE=T.fromBits(-1,-1,!0);T.ZERO=T.fromInt(0);T.UZERO=T.fromInt(0,!0);T.ONE=T.fromInt(1);T.UONE=T.fromInt(1,!0);T.NEG_ONE=T.fromInt(-1);T.MAX_VALUE=T.fromBits(-1,2147483647,!1);T.MIN_VALUE=T.fromBits(0,-2147483648,!1);var pJ1=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,iJ1=/^(\+|-)?(Infinity|inf)$/i,aJ1=/^(\+|-)?NaN$/i,W8=6111,jF=-6176,sS=6176,rS=34,$q=y.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),tS=y.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),oS=y.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),nJ1=/^([-+])?(\d+)?$/,sJ1=31,eS=16383,rJ1=30,tJ1=31;function F_(F){return!isNaN(parseInt(F,10))}function oJ1(F){let A=T.fromNumber(1e9),D=T.fromNumber(0);if(!F.parts[0]&&!F.parts[1]&&!F.parts[2]&&!F.parts[3])return{quotient:F,rem:D};for(let Z=0;Z<=3;Z++)D=D.shiftLeft(32),D=D.add(new T(F.parts[Z],0)),F.parts[Z]=D.div(A).low,D=D.modulo(A);return{quotient:F,rem:D}}function eJ1(F,A){if(!F&&!A)return{high:T.fromNumber(0),low:T.fromNumber(0)};let D=F.shiftRightUnsigned(32),Z=new T(F.getLowBits(),0),J=A.shiftRightUnsigned(32),X=new T(A.getLowBits(),0),$=D.multiply(J),G=D.multiply(X),Y=Z.multiply(J),B=Z.multiply(X);return $=$.add(G.shiftRightUnsigned(32)),G=new T(G.getLowBits(),0).add(Y).add(B.shiftRightUnsigned(32)),$=$.add(G.shiftRightUnsigned(32)),B=G.shiftLeft(32).add(new T(B.getLowBits(),0)),{high:$,low:B}}function FX1(F,A){let D=F.high>>>0,Z=A.high>>>0;if(D<Z)return!0;else if(D===Z){let J=F.low>>>0,X=A.low>>>0;if(J<X)return!0}return!1}function Y3(F,A){throw new v(`"${F}" is not a valid Decimal128 string - ${A}`)}class Q2 extends y2{get _bsontype(){return"Decimal128"}constructor(F){super();if(typeof F==="string")this.bytes=Q2.fromString(F).bytes;else if(F instanceof Uint8Array||Q8(F)){if(F.byteLength!==16)throw new v("Decimal128 must take a Buffer of 16 bytes");this.bytes=F}else throw new v("Decimal128 must take a Buffer or string")}static fromString(F){return Q2._fromString(F,{allowRounding:!1})}static fromStringWithRounding(F){return Q2._fromString(F,{allowRounding:!0})}static _fromString(F,A){let D=!1,Z=!1,J=!1,X=!1,$=0,G=0,Y=0,B=0,H=0,q=[0],W=0,C=0,Q=0,K=0,U=new T(0,0),z=new T(0,0),L=0,V=0;if(F.length>=7000)throw new v(""+F+" not a valid Decimal128 string");let P=F.match(pJ1),I=F.match(iJ1),M=F.match(aJ1);if(!P&&!I&&!M||F.length===0)throw new v(""+F+" not a valid Decimal128 string");if(P){let R=P[2],S=P[4],u=P[5],c=P[6];if(S&&c===void 0)Y3(F,"missing exponent power");if(S&&R===void 0)Y3(F,"missing exponent base");if(S===void 0&&(u||c))Y3(F,"missing e before exponent")}if(F[V]==="+"||F[V]==="-")Z=!0,D=F[V++]==="-";if(!F_(F[V])&&F[V]!=="."){if(F[V]==="i"||F[V]==="I")return new Q2(D?tS:oS);else if(F[V]==="N")return new Q2($q)}while(F_(F[V])||F[V]==="."){if(F[V]==="."){if(J)Y3(F,"contains multiple periods");J=!0,V=V+1;continue}if(W<rS){if(F[V]!=="0"||X){if(!X)H=G;X=!0,q[C++]=parseInt(F[V],10),W=W+1}}if(X)Y=Y+1;if(J)B=B+1;G=G+1,V=V+1}if(J&&!G)throw new v(""+F+" not a valid Decimal128 string");if(F[V]==="e"||F[V]==="E"){let R=F.substr(++V).match(nJ1);if(!R||!R[2])return new Q2($q);K=parseInt(R[0],10),V=V+R[0].length}if(F[V])return new Q2($q);if(!W)q[0]=0,Y=1,W=1,$=0;else if(Q=W-1,$=Y,$!==1)while(F[H+$-1+Number(Z)+Number(J)]==="0")$=$-1;if(K<=B&&B>K+16384)K=jF;else K=K-B;while(K>W8){if(Q=Q+1,Q>=rS){if($===0){K=W8;break}Y3(F,"overflow")}K=K-1}if(A.allowRounding){while(K<jF||W<Y){if(Q===0&&$<W){K=jF,$=0;break}if(W<Y)Y=Y-1;else Q=Q-1;if(K<W8)K=K+1;else{if(q.join("").match(/^0+$/)){K=W8;break}Y3(F,"overflow")}}if(Q+1<$){let R=G;if(J)H=H+1,R=R+1;if(Z)H=H+1,R=R+1;let S=parseInt(F[H+Q+1],10),u=0;if(S>=5){if(u=1,S===5){u=q[Q]%2===1?1:0;for(let c=H+Q+2;c<R;c++)if(parseInt(F[c],10)){u=1;break}}}if(u){let c=Q;for(;c>=0;c--)if(++q[c]>9){if(q[c]=0,c===0)if(K<W8)K=K+1,q[c]=1;else return new Q2(D?tS:oS)}else break}}}else{while(K<jF||W<Y){if(Q===0){if($===0){K=jF;break}Y3(F,"exponent underflow")}if(W<Y){if(F[Y-1+Number(Z)+Number(J)]!=="0"&&$!==0)Y3(F,"inexact rounding");Y=Y-1}else{if(q[Q]!==0)Y3(F,"inexact rounding");Q=Q-1}if(K<W8)K=K+1;else Y3(F,"overflow")}if(Q+1<$){if(J)H=H+1;if(Z)H=H+1;if(parseInt(F[H+Q+1],10)!==0)Y3(F,"inexact rounding")}}if(U=T.fromNumber(0),z=T.fromNumber(0),$===0)U=T.fromNumber(0),z=T.fromNumber(0);else if(Q<17){let R=0;z=T.fromNumber(q[R++]),U=new T(0,0);for(;R<=Q;R++)z=z.multiply(T.fromNumber(10)),z=z.add(T.fromNumber(q[R]))}else{let R=0;U=T.fromNumber(q[R++]);for(;R<=Q-17;R++)U=U.multiply(T.fromNumber(10)),U=U.add(T.fromNumber(q[R]));z=T.fromNumber(q[R++]);for(;R<=Q;R++)z=z.multiply(T.fromNumber(10)),z=z.add(T.fromNumber(q[R]))}let x=eJ1(U,T.fromString("100000000000000000"));if(x.low=x.low.add(z),FX1(x.low,z))x.high=x.high.add(T.fromNumber(1));L=K+sS;let _={low:T.fromNumber(0),high:T.fromNumber(0)};if(x.high.shiftRightUnsigned(49).and(T.fromNumber(1)).equals(T.fromNumber(1)))_.high=_.high.or(T.fromNumber(3).shiftLeft(61)),_.high=_.high.or(T.fromNumber(L).and(T.fromNumber(16383).shiftLeft(47))),_.high=_.high.or(x.high.and(T.fromNumber(140737488355327)));else _.high=_.high.or(T.fromNumber(L&16383).shiftLeft(49)),_.high=_.high.or(x.high.and(T.fromNumber(562949953421311)));if(_.low=x.low,D)_.high=_.high.or(T.fromString("9223372036854775808"));let O=y.allocateUnsafe(16);return V=0,O[V++]=_.low.low&255,O[V++]=_.low.low>>8&255,O[V++]=_.low.low>>16&255,O[V++]=_.low.low>>24&255,O[V++]=_.low.high&255,O[V++]=_.low.high>>8&255,O[V++]=_.low.high>>16&255,O[V++]=_.low.high>>24&255,O[V++]=_.high.low&255,O[V++]=_.high.low>>8&255,O[V++]=_.high.low>>16&255,O[V++]=_.high.low>>24&255,O[V++]=_.high.high&255,O[V++]=_.high.high>>8&255,O[V++]=_.high.high>>16&255,O[V++]=_.high.high>>24&255,new Q2(O)}toString(){let F,A=0,D=new Array(36);for(let V=0;V<D.length;V++)D[V]=0;let Z=0,J=!1,X,$={parts:[0,0,0,0]},G,Y,B=[];Z=0;let H=this.bytes,q=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24,W=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24,C=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24,Q=H[Z++]|H[Z++]<<8|H[Z++]<<16|H[Z++]<<24;if(Z=0,{low:new T(q,W),high:new T(C,Q)}.high.lessThan(T.ZERO))B.push("-");let U=Q>>26&sJ1;if(U>>3===3)if(U===rJ1)return B.join("")+"Infinity";else if(U===tJ1)return"NaN";else F=Q>>15&eS,X=8+(Q>>14&1);else X=Q>>14&7,F=Q>>17&eS;let z=F-sS;if($.parts[0]=(Q&16383)+((X&15)<<14),$.parts[1]=C,$.parts[2]=W,$.parts[3]=q,$.parts[0]===0&&$.parts[1]===0&&$.parts[2]===0&&$.parts[3]===0)J=!0;else for(Y=3;Y>=0;Y--){let V=0,P=oJ1($);if($=P.quotient,V=P.rem.low,!V)continue;for(G=8;G>=0;G--)D[Y*9+G]=V%10,V=Math.floor(V/10)}if(J)A=1,D[Z]=0;else{A=36;while(!D[Z])A=A-1,Z=Z+1}let L=A-1+z;if(L>=34||L<=-7||z>0){if(A>34){if(B.push("0"),z>0)B.push(`E+${z}`);else if(z<0)B.push(`E${z}`);return B.join("")}if(B.push(`${D[Z++]}`),A=A-1,A)B.push(".");for(let V=0;V<A;V++)B.push(`${D[Z++]}`);if(B.push("E"),L>0)B.push(`+${L}`);else B.push(`${L}`)}else if(z>=0)for(let V=0;V<A;V++)B.push(`${D[Z++]}`);else{let V=A+z;if(V>0)for(let P=0;P<V;P++)B.push(`${D[Z++]}`);else B.push("0");B.push(".");while(V++<0)B.push("0");for(let P=0;P<A-Math.max(V-1,0);P++)B.push(`${D[Z++]}`)}return B.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(F){return Q2.fromString(F.$numberDecimal)}inspect(F,A,D){return D??=E6,`new Decimal128(${D(this.toString(),A)})`}}class y6 extends y2{get _bsontype(){return"Double"}constructor(F){super();if(F instanceof Number)F=F.valueOf();this.value=+F}static fromString(F){let A=Number(F);if(F==="NaN")return new y6(NaN);if(F==="Infinity")return new y6(1/0);if(F==="-Infinity")return new y6(-1/0);if(!Number.isFinite(A))throw new v(`Input: ${F} is not representable as a Double`);if(F.trim()!==F)throw new v(`Input: '${F}' contains whitespace`);if(F==="")throw new v("Input is an empty string");if(/[^-0-9.+eE]/.test(F))throw new v(`Input: '${F}' is not in decimal or exponential notation`);return new y6(A)}valueOf(){return this.value}toJSON(){return this.value}toString(F){return this.value.toString(F)}toExtendedJSON(F){if(F&&(F.legacy||F.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:"-0.0"};return{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(F,A){let D=parseFloat(F.$numberDouble);return A&&A.relaxed?D:new y6(D)}inspect(F,A,D){return D??=E6,`new Double(${D(this.value,A)})`}}class e3 extends y2{get _bsontype(){return"Int32"}constructor(F){super();if(F instanceof Number)F=F.valueOf();this.value=+F|0}static fromString(F){let A=I_(F),D=Number(F);if(_F<D)throw new v(`Input: '${F}' is larger than the maximum value for Int32`);else if(uF>D)throw new v(`Input: '${F}' is smaller than the minimum value for Int32`);else if(!Number.isSafeInteger(D))throw new v(`Input: '${F}' is not a safe integer`);else if(D.toString()!==A)throw new v(`Input: '${F}' is not a valid Int32 string`);return new e3(D)}valueOf(){return this.value}toString(F){return this.value.toString(F)}toJSON(){return this.value}toExtendedJSON(F){if(F&&(F.relaxed||F.legacy))return this.value;return{$numberInt:this.value.toString()}}static fromExtendedJSON(F,A){return A&&A.relaxed?parseInt(F.$numberInt,10):new e3(F.$numberInt)}inspect(F,A,D){return D??=E6,`new Int32(${D(this.value,A)})`}}class f9 extends y2{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new f9}inspect(){return"new MaxKey()"}}class y9 extends y2{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new y9}inspect(){return"new MinKey()"}}var x9=null,TF=new WeakMap;class A0 extends y2{get _bsontype(){return"ObjectId"}constructor(F){super();let A;if(typeof F==="object"&&F&&"id"in F){if(typeof F.id!=="string"&&!ArrayBuffer.isView(F.id))throw new v("Argument passed in must have an id that is of type string or Buffer");if("toHexString"in F&&typeof F.toHexString==="function")A=y.fromHex(F.toHexString());else A=F.id}else A=F;if(A==null||typeof A==="number")this.buffer=A0.generate(typeof A==="number"?A:void 0);else if(ArrayBuffer.isView(A)&&A.byteLength===12)this.buffer=y.toLocalBufferType(A);else if(typeof A==="string")if(A0.validateHexString(A)){if(this.buffer=y.fromHex(A),A0.cacheHexString)TF.set(this,A)}else throw new v("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");else throw new v("Argument passed in does not match the accepted types")}get id(){return this.buffer}set id(F){if(this.buffer=F,A0.cacheHexString)TF.set(this,y.toHex(F))}static validateHexString(F){if(F?.length!==24)return!1;for(let A=0;A<24;A++){let D=F.charCodeAt(A);if(D>=48&&D<=57||D>=97&&D<=102||D>=65&&D<=70)continue;return!1}return!0}toHexString(){if(A0.cacheHexString){let A=TF.get(this);if(A)return A}let F=y.toHex(this.id);if(A0.cacheHexString)TF.set(this,F);return F}static getInc(){return A0.index=(A0.index+1)%16777215}static generate(F){if(typeof F!=="number")F=Math.floor(Date.now()/1000);let A=A0.getInc(),D=y.allocateUnsafe(12);if(Y1.setInt32BE(D,0,F),x9===null)x9=y.randomBytes(5);return D[4]=x9[0],D[5]=x9[1],D[6]=x9[2],D[7]=x9[3],D[8]=x9[4],D[11]=A&255,D[10]=A>>8&255,D[9]=A>>16&255,D}toString(F){if(F==="base64")return y.toBase64(this.id);if(F==="hex")return this.toHexString();return this.toHexString()}toJSON(){return this.toHexString()}static is(F){return F!=null&&typeof F==="object"&&"_bsontype"in F&&F._bsontype==="ObjectId"}equals(F){if(F===void 0||F===null)return!1;if(A0.is(F))return this.buffer[11]===F.buffer[11]&&y.equals(this.buffer,F.buffer);if(typeof F==="string")return F.toLowerCase()===this.toHexString();if(typeof F==="object"&&typeof F.toHexString==="function"){let A=F.toHexString(),D=this.toHexString();return typeof A==="string"&&A.toLowerCase()===D}return!1}getTimestamp(){let F=new Date,A=Y1.getUint32BE(this.buffer,0);return F.setTime(Math.floor(A)*1000),F}static createPk(){return new A0}serializeInto(F,A){return F[A]=this.buffer[0],F[A+1]=this.buffer[1],F[A+2]=this.buffer[2],F[A+3]=this.buffer[3],F[A+4]=this.buffer[4],F[A+5]=this.buffer[5],F[A+6]=this.buffer[6],F[A+7]=this.buffer[7],F[A+8]=this.buffer[8],F[A+9]=this.buffer[9],F[A+10]=this.buffer[10],F[A+11]=this.buffer[11],12}static createFromTime(F){let A=y.allocate(12);for(let D=11;D>=4;D--)A[D]=0;return Y1.setInt32BE(A,0,F),new A0(A)}static createFromHexString(F){if(F?.length!==24)throw new v("hex string must be 24 characters");return new A0(y.fromHex(F))}static createFromBase64(F){if(F?.length!==16)throw new v("base64 string must be 16 characters");return new A0(y.fromBase64(F))}static isValid(F){if(F==null)return!1;if(typeof F==="string")return A0.validateHexString(F);try{return new A0(F),!0}catch{return!1}}toExtendedJSON(){if(this.toHexString)return{$oid:this.toHexString()};return{$oid:this.toString("hex")}}static fromExtendedJSON(F){return new A0(F.$oid)}isCached(){return A0.cacheHexString&&TF.has(this)}inspect(F,A,D){return D??=E6,`new ObjectId(${D(this.toHexString(),A)})`}}A0.index=Math.floor(Math.random()*16777215);function gZ(F,A,D){let Z=5;if(Array.isArray(F))for(let J=0;J<F.length;J++)Z+=A_(J.toString(),F[J],A,!0,D);else{if(typeof F?.toBSON==="function")F=F.toBSON();for(let J of Object.keys(F))Z+=A_(J,F[J],A,!1,D)}return Z}function A_(F,A,D=!1,Z=!1,J=!1){if(typeof A?.toBSON==="function")A=A.toBSON();switch(typeof A){case"string":return 1+y.utf8ByteLength(F)+1+4+y.utf8ByteLength(A)+1;case"number":if(Math.floor(A)===A&&A>=Y_&&A<=$_)if(A>=uF&&A<=_F)return(F!=null?y.utf8ByteLength(F)+1:0)+5;else return(F!=null?y.utf8ByteLength(F)+1:0)+9;else return(F!=null?y.utf8ByteLength(F)+1:0)+9;case"undefined":if(Z||!J)return(F!=null?y.utf8ByteLength(F)+1:0)+1;return 0;case"boolean":return(F!=null?y.utf8ByteLength(F)+1:0)+2;case"object":if(A!=null&&typeof A._bsontype==="string"&&A[V8]!==g9)throw new l4;else if(A==null||A._bsontype==="MinKey"||A._bsontype==="MaxKey")return(F!=null?y.utf8ByteLength(F)+1:0)+1;else if(A._bsontype==="ObjectId")return(F!=null?y.utf8ByteLength(F)+1:0)+13;else if(A instanceof Date||E8(A))return(F!=null?y.utf8ByteLength(F)+1:0)+9;else if(ArrayBuffer.isView(A)||A instanceof ArrayBuffer||kq(A))return(F!=null?y.utf8ByteLength(F)+1:0)+6+A.byteLength;else if(A._bsontype==="Long"||A._bsontype==="Double"||A._bsontype==="Timestamp")return(F!=null?y.utf8ByteLength(F)+1:0)+9;else if(A._bsontype==="Decimal128")return(F!=null?y.utf8ByteLength(F)+1:0)+17;else if(A._bsontype==="Code")if(A.scope!=null&&Object.keys(A.scope).length>0)return(F!=null?y.utf8ByteLength(F)+1:0)+1+4+4+y.utf8ByteLength(A.code.toString())+1+gZ(A.scope,D,J);else return(F!=null?y.utf8ByteLength(F)+1:0)+1+4+y.utf8ByteLength(A.code.toString())+1;else if(A._bsontype==="Binary"){let X=A;if(X.sub_type===J1.SUBTYPE_BYTE_ARRAY)return(F!=null?y.utf8ByteLength(F)+1:0)+(X.position+1+4+1+4);else return(F!=null?y.utf8ByteLength(F)+1:0)+(X.position+1+4+1)}else if(A._bsontype==="Symbol")return(F!=null?y.utf8ByteLength(F)+1:0)+y.utf8ByteLength(A.value)+4+1+1;else if(A._bsontype==="DBRef"){let X=Object.assign({$ref:A.collection,$id:A.oid},A.fields);if(A.db!=null)X.$db=A.db;return(F!=null?y.utf8ByteLength(F)+1:0)+1+gZ(X,D,J)}else if(A instanceof RegExp||K8(A))return(F!=null?y.utf8ByteLength(F)+1:0)+1+y.utf8ByteLength(A.source)+1+(A.global?1:0)+(A.ignoreCase?1:0)+(A.multiline?1:0)+1;else if(A._bsontype==="BSONRegExp")return(F!=null?y.utf8ByteLength(F)+1:0)+1+y.utf8ByteLength(A.pattern)+1+y.utf8ByteLength(A.options)+1;else return(F!=null?y.utf8ByteLength(F)+1:0)+gZ(A,D,J)+1;case"function":if(D)return(F!=null?y.utf8ByteLength(F)+1:0)+1+4+y.utf8ByteLength(A.toString())+1;return 0;case"bigint":return(F!=null?y.utf8ByteLength(F)+1:0)+9;case"symbol":return 0;default:throw new v(`Unrecognized JS type: ${typeof A}`)}}function AX1(F){return F.split("").sort().join("")}class h6 extends y2{get _bsontype(){return"BSONRegExp"}constructor(F,A){super();if(this.pattern=F,this.options=AX1(A??""),this.pattern.indexOf("\x00")!==-1)throw new v(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(this.options.indexOf("\x00")!==-1)throw new v(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let D=0;D<this.options.length;D++)if(!(this.options[D]==="i"||this.options[D]==="m"||this.options[D]==="x"||this.options[D]==="l"||this.options[D]==="s"||this.options[D]==="u"))throw new v(`The regular expression option [${this.options[D]}] is not supported`)}static parseOptions(F){return F?F.split("").sort().join(""):""}toExtendedJSON(F){if(F=F||{},F.legacy)return{$regex:this.pattern,$options:this.options};return{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(F){if("$regex"in F)if(typeof F.$regex!=="string"){if(F.$regex._bsontype==="BSONRegExp")return F}else return new h6(F.$regex,h6.parseOptions(F.$options));if("$regularExpression"in F)return new h6(F.$regularExpression.pattern,h6.parseOptions(F.$regularExpression.options));throw new v(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(F)}`)}inspect(F,A,D){let Z=jJ1(A)??(($)=>$);D??=E6;let J=Z(D(this.pattern),"regexp"),X=Z(D(this.options),"regexp");return`new BSONRegExp(${J}, ${X})`}}class b9 extends y2{get _bsontype(){return"BSONSymbol"}constructor(F){super();this.value=F}valueOf(){return this.value}toString(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(F){return new b9(F.$symbol)}inspect(F,A,D){return D??=E6,`new BSONSymbol(${D(this.value,A)})`}}var DX1=T;class b6 extends DX1{get _bsontype(){return"Timestamp"}get i(){return this.low>>>0}get t(){return this.high>>>0}constructor(F){if(F==null)super(0,0,!0);else if(typeof F==="bigint")super(F,!0);else if(T.isLong(F))super(F.low,F.high,!0);else if(typeof F==="object"&&"t"in F&&"i"in F){if(typeof F.t!=="number"&&(typeof F.t!=="object"||F.t._bsontype!=="Int32"))throw new v("Timestamp constructed from { t, i } must provide t as a number");if(typeof F.i!=="number"&&(typeof F.i!=="object"||F.i._bsontype!=="Int32"))throw new v("Timestamp constructed from { t, i } must provide i as a number");let A=Number(F.t),D=Number(F.i);if(A<0||Number.isNaN(A))throw new v("Timestamp constructed from { t, i } must provide a positive t");if(D<0||Number.isNaN(D))throw new v("Timestamp constructed from { t, i } must provide a positive i");if(A>4294967295)throw new v("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(D>4294967295)throw new v("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(D,A,!0)}else throw new v("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }")}toJSON(){return{$timestamp:this.toString()}}static fromInt(F){return new b6(T.fromInt(F,!0))}static fromNumber(F){return new b6(T.fromNumber(F,!0))}static fromBits(F,A){return new b6({i:F,t:A})}static fromString(F,A){return new b6(T.fromString(F,!0,A))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(F){let A=T.isLong(F.$timestamp.i)?F.$timestamp.i.getLowBitsUnsigned():F.$timestamp.i,D=T.isLong(F.$timestamp.t)?F.$timestamp.t.getLowBitsUnsigned():F.$timestamp.t;return new b6({t:D,i:A})}inspect(F,A,D){D??=E6;let Z=D(this.t,A),J=D(this.i,A);return`new Timestamp({ t: ${Z}, i: ${J} })`}}b6.MAX_VALUE=T.MAX_UNSIGNED_VALUE;var ZX1=T.fromNumber($_),JX1=T.fromNumber(Y_);function N_(F,A,D){A=A==null?{}:A;let Z=A&&A.index?A.index:0,J=Y1.getInt32LE(F,Z);if(J<5)throw new v(`bson size must be >= 5, is ${J}`);if(A.allowObjectSmallerThanBufferSize&&F.length<J)throw new v(`buffer length ${F.length} must be >= bson size ${J}`);if(!A.allowObjectSmallerThanBufferSize&&F.length!==J)throw new v(`buffer length ${F.length} must === bson size ${J}`);if(J+Z>F.byteLength)throw new v(`(bson size ${J} + options.index ${Z} must be <= buffer length ${F.byteLength})`);if(F[Z+J-1]!==0)throw new v("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return fZ(F,Z,A,D)}var XX1=/^\$ref$|^\$id$|^\$db$/;function fZ(F,A,D,Z=!1){let J=D.fieldsAsRaw==null?null:D.fieldsAsRaw,X=D.raw==null?!1:D.raw,$=typeof D.bsonRegExp==="boolean"?D.bsonRegExp:!1,G=D.promoteBuffers??!1,Y=D.promoteLongs??!0,B=D.promoteValues??!0,H=D.useBigInt64??!1;if(H&&!B)throw new v("Must either request bigint or Long for int64 deserialization");if(H&&!Y)throw new v("Must either request bigint or Long for int64 deserialization");let q=D.validation==null?{utf8:!0}:D.validation,W=!0,C,Q,K=q.utf8;if(typeof K==="boolean")C=K;else{W=!1;let I=Object.keys(K).map(function(M){return K[M]});if(I.length===0)throw new v("UTF-8 validation setting cannot be empty");if(typeof I[0]!=="boolean")throw new v("Invalid UTF-8 validation option, must specify boolean values");if(C=I[0],!I.every((M)=>M===C))throw new v("Invalid UTF-8 validation option - keys must be all true or all false")}if(!W){Q=new Set;for(let I of Object.keys(K))Q.add(I)}let U=A;if(F.length<5)throw new v("corrupt bson message < 5 bytes long");let z=Y1.getInt32LE(F,A);if(A+=4,z<5||z>F.length)throw new v("corrupt bson message");let L=Z?[]:{},V=0,P=Z?!1:null;while(!0){let I=F[A++];if(I===0)break;let M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.byteLength)throw new v("Bad BSON Document: illegal CString");let x=Z?V++:y.toUTF8(F,A,M,!1),_=!0;if(W||Q?.has(x))_=C;else _=!C;if(P!==!1&&x[0]==="$")P=XX1.test(x);let O;if(A=M+1,I===G_){let R=Y1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new v("bad string length in bson");O=y.toUTF8(F,A,A+R-1,_),A=A+R}else if(I===H_){let R=y.allocateUnsafe(12);for(let S=0;S<12;S++)R[S]=F[A+S];O=new A0(R),A=A+12}else if(I===kF&&B===!1)O=new e3(Y1.getInt32LE(F,A)),A+=4;else if(I===kF)O=Y1.getInt32LE(F,A),A+=4;else if(I===Sq){if(O=Y1.getFloat64LE(F,A),A+=8,B===!1)O=new y6(O)}else if(I===W_){let R=Y1.getInt32LE(F,A),S=Y1.getInt32LE(F,A+4);A+=8,O=new Date(new T(R,S).toNumber())}else if(I===q_){if(F[A]!==0&&F[A]!==1)throw new v("illegal boolean type value");O=F[A++]===1}else if(I===_q){let R=A,S=Y1.getInt32LE(F,A);if(S<=0||S>F.length-A)throw new v("bad embedded document length in bson");if(X)O=F.subarray(A,A+S);else{let u=D;if(!W)u={...D,validation:{utf8:_}};O=fZ(F,R,u,!1)}A=A+S}else if(I===B_){let R=A,S=Y1.getInt32LE(F,A),u=D,c=A+S;if(J&&J[x])u={...D,raw:!0};if(!W)u={...u,validation:{utf8:_}};if(O=fZ(F,R,u,!0),A=A+S,F[A-1]!==0)throw new v("invalid array terminator byte");if(A!==c)throw new v("corrupted array bson")}else if(I===TJ1)O=void 0;else if(I===xq)O=null;else if(I===fq)if(H)O=Y1.getBigInt64LE(F,A),A+=8;else{let R=Y1.getInt32LE(F,A),S=Y1.getInt32LE(F,A+4);A+=8;let u=new T(R,S);if(Y&&B===!0)O=u.lessThanOrEqual(ZX1)&&u.greaterThanOrEqual(JX1)?u.toNumber():u;else O=u}else if(I===E_){let R=y.allocateUnsafe(16);for(let S=0;S<16;S++)R[S]=F[A+S];A=A+16,O=new Q2(R)}else if(I===uq){let R=Y1.getInt32LE(F,A);A+=4;let S=R,u=F[A++];if(R<0)throw new v("Negative binary type element size found");if(R>F.byteLength)throw new v("Binary type size larger than document size");if(u===J1.SUBTYPE_BYTE_ARRAY){if(R=Y1.getInt32LE(F,A),A+=4,R<0)throw new v("Negative binary type element size found for subtype 0x02");if(R>S-4)throw new v("Binary type with subtype 0x02 contains too long binary size");if(R<S-4)throw new v("Binary type with subtype 0x02 contains too short binary size")}if(G&&B)O=y.toLocalBufferType(F.subarray(A,A+R));else if(O=new J1(F.subarray(A,A+R),u),u===yq&&A2.isValid(O))O=O.toUUID();A=A+R}else if(I===yZ&&$===!1){M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new v("Bad BSON Document: illegal CString");let R=y.toUTF8(F,A,M,!1);A=M+1,M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new v("Bad BSON Document: illegal CString");let S=y.toUTF8(F,A,M,!1);A=M+1;let u=new Array(S.length);for(M=0;M<S.length;M++)switch(S[M]){case"m":u[M]="m";break;case"s":u[M]="g";break;case"i":u[M]="i";break}O=new RegExp(R,u.join(""))}else if(I===yZ&&$===!0){M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new v("Bad BSON Document: illegal CString");let R=y.toUTF8(F,A,M,!1);A=M+1,M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new v("Bad BSON Document: illegal CString");let S=y.toUTF8(F,A,M,!1);A=M+1,O=new h6(R,S)}else if(I===C_){let R=Y1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new v("bad string length in bson");let S=y.toUTF8(F,A,A+R-1,_);O=B?S:new b9(S),A=A+R}else if(I===K_)O=new b6({i:Y1.getUint32LE(F,A),t:Y1.getUint32LE(F,A+4)}),A+=8;else if(I===U_)O=new y9;else if(I===z_)O=new f9;else if(I===gq){let R=Y1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new v("bad string length in bson");let S=y.toUTF8(F,A,A+R-1,_);O=new o3(S),A=A+R}else if(I===Q_){let R=Y1.getInt32LE(F,A);if(A+=4,R<13)throw new v("code_w_scope total size shorter minimum expected length");let S=Y1.getInt32LE(F,A);if(A+=4,S<=0||S>F.length-A||F[A+S-1]!==0)throw new v("bad string length in bson");let u=y.toUTF8(F,A,A+S-1,_);A=A+S;let c=A,r=Y1.getInt32LE(F,A),J0=fZ(F,c,D,!1);if(A=A+r,R<8+r+S)throw new v("code_w_scope total size is too short, truncating scope");if(R>8+r+S)throw new v("code_w_scope total size is too long, clips outer document");O=new o3(u,J0)}else if(I===kJ1){let R=Y1.getInt32LE(F,A);if(A+=4,R<=0||R>F.length-A||F[A+R-1]!==0)throw new v("bad string length in bson");let S=y.toUTF8(F,A,A+R-1,_);A=A+R;let u=y.allocateUnsafe(12);for(let r=0;r<12;r++)u[r]=F[A+r];let c=new A0(u);A=A+12,O=new j3(S,c)}else throw new v(`Detected unknown BSON type ${I.toString(16)} for fieldname "${x}"`);if(x==="__proto__")Object.defineProperty(L,x,{value:O,writable:!0,enumerable:!0,configurable:!0});else L[x]=O}if(z!==A-U){if(Z)throw new v("corrupt array bson");throw new v("corrupt object bson")}if(!P)return L;if(P_(L)){let I=Object.assign({},L);return delete I.$ref,delete I.$id,delete I.$db,new j3(L.$ref,L.$id,L.$db,I)}return L}var bZ=/\x00/,D_=new Set(["$db","$ref","$id","$clusterTime"]);function Yq(F,A,D,Z){F[Z++]=G_;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J+1,F[Z-1]=0;let X=y.encodeUTF8Into(F,D,Z+4);return Y1.setInt32LE(F,Z,X+1),Z=Z+4+X,F[Z++]=0,Z}function Gq(F,A,D,Z){let X=!Object.is(D,-0)&&Number.isSafeInteger(D)&&D<=_F&&D>=uF?kF:Sq;F[Z++]=X;let $=y.encodeUTF8Into(F,A,Z);if(Z=Z+$,F[Z++]=0,X===kF)Z+=Y1.setInt32LE(F,Z,D);else Z+=Y1.setFloat64LE(F,Z,D);return Z}function Bq(F,A,D,Z){F[Z++]=fq;let J=y.encodeUTF8Into(F,A,Z);return Z+=J,F[Z++]=0,Z+=Y1.setBigInt64LE(F,Z,D),Z}function C8(F,A,D,Z){F[Z++]=xq;let J=y.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z}function Hq(F,A,D,Z){F[Z++]=q_;let J=y.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,F[Z++]=D?1:0,Z}function qq(F,A,D,Z){F[Z++]=W_;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=T.fromNumber(D.getTime()),$=X.getLowBits(),G=X.getHighBits();return Z+=Y1.setInt32LE(F,Z,$),Z+=Y1.setInt32LE(F,Z,G),Z}function Wq(F,A,D,Z){F[Z++]=yZ;let J=y.encodeUTF8Into(F,A,Z);if(Z=Z+J,F[Z++]=0,D.source&&D.source.match(bZ)!=null)throw new v("value "+D.source+" must not contain null bytes");if(Z=Z+y.encodeUTF8Into(F,D.source,Z),F[Z++]=0,D.ignoreCase)F[Z++]=105;if(D.global)F[Z++]=115;if(D.multiline)F[Z++]=109;return F[Z++]=0,Z}function Cq(F,A,D,Z){F[Z++]=yZ;let J=y.encodeUTF8Into(F,A,Z);if(Z=Z+J,F[Z++]=0,D.pattern.match(bZ)!=null)throw new v("pattern "+D.pattern+" must not contain null bytes");Z=Z+y.encodeUTF8Into(F,D.pattern,Z),F[Z++]=0;let X=D.options.split("").sort().join("");return Z=Z+y.encodeUTF8Into(F,X,Z),F[Z++]=0,Z}function Qq(F,A,D,Z){if(D===null)F[Z++]=xq;else if(D._bsontype==="MinKey")F[Z++]=U_;else F[Z++]=z_;let J=y.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z}function Kq(F,A,D,Z){F[Z++]=H_;let J=y.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z+=D.serializeInto(F,Z),Z}function Eq(F,A,D,Z){F[Z++]=uq;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=D.length;if(Z+=Y1.setInt32LE(F,Z,X),F[Z++]=OJ1,X<=16)for(let $=0;$<X;$++)F[Z+$]=D[$];else F.set(D,Z);return Z=Z+X,Z}function Uq(F,A,D,Z,J,X,$,G,Y){if(Y.has(D))throw new v("Cannot convert circular structure to BSON");Y.add(D),F[Z++]=Array.isArray(D)?B_:_q;let B=y.encodeUTF8Into(F,A,Z);Z=Z+B,F[Z++]=0;let H=xF(F,D,J,Z,X+1,$,G,Y);return Y.delete(D),H}function zq(F,A,D,Z){F[Z++]=E_;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;for(let X=0;X<16;X++)F[Z+X]=D.bytes[X];return Z+16}function Vq(F,A,D,Z){F[Z++]=D._bsontype==="Long"?fq:K_;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=D.getLowBits(),$=D.getHighBits();return Z+=Y1.setInt32LE(F,Z,X),Z+=Y1.setInt32LE(F,Z,$),Z}function Lq(F,A,D,Z){D=D.valueOf(),F[Z++]=kF;let J=y.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z+=Y1.setInt32LE(F,Z,D),Z}function Rq(F,A,D,Z){F[Z++]=Sq;let J=y.encodeUTF8Into(F,A,Z);return Z=Z+J,F[Z++]=0,Z+=Y1.setFloat64LE(F,Z,D.value),Z}function wq(F,A,D,Z){F[Z++]=gq;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=D.toString(),$=y.encodeUTF8Into(F,X,Z+4)+1;return Y1.setInt32LE(F,Z,$),Z=Z+4+$-1,F[Z++]=0,Z}function Pq(F,A,D,Z,J=!1,X=0,$=!1,G=!0,Y){if(D.scope&&typeof D.scope==="object"){F[Z++]=Q_;let B=y.encodeUTF8Into(F,A,Z);Z=Z+B,F[Z++]=0;let H=Z,q=D.code;Z=Z+4;let W=y.encodeUTF8Into(F,q,Z+4)+1;Y1.setInt32LE(F,Z,W),F[Z+4+W-1]=0,Z=Z+W+4;let C=xF(F,D.scope,J,Z,X+1,$,G,Y);Z=C-1;let Q=C-H;H+=Y1.setInt32LE(F,H,Q),F[Z++]=0}else{F[Z++]=gq;let B=y.encodeUTF8Into(F,A,Z);Z=Z+B,F[Z++]=0;let H=D.code.toString(),q=y.encodeUTF8Into(F,H,Z+4)+1;Y1.setInt32LE(F,Z,q),Z=Z+4+q-1,F[Z++]=0}return Z}function Iq(F,A,D,Z){F[Z++]=uq;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let{buffer:X,position:$}=D;if(D.sub_type===J1.SUBTYPE_BYTE_ARRAY)$=$+4;if(Z+=Y1.setInt32LE(F,Z,$),F[Z++]=D.sub_type,D.sub_type===J1.SUBTYPE_BYTE_ARRAY)$=$-4,Z+=Y1.setInt32LE(F,Z,$);if(D.sub_type===J1.SUBTYPE_VECTOR)w_(D);if($<=16)for(let G=0;G<$;G++)F[Z+G]=X[G];else F.set(X,Z);return Z=Z+D.position,Z}function Mq(F,A,D,Z){F[Z++]=C_;let J=y.encodeUTF8Into(F,A,Z);Z=Z+J,F[Z++]=0;let X=y.encodeUTF8Into(F,D.value,Z+4)+1;return Y1.setInt32LE(F,Z,X),Z=Z+4+X-1,F[Z++]=0,Z}function Nq(F,A,D,Z,J,X,$){F[Z++]=_q;let G=y.encodeUTF8Into(F,A,Z);Z=Z+G,F[Z++]=0;let Y=Z,B={$ref:D.collection||D.namespace,$id:D.oid};if(D.db!=null)B.$db=D.db;B=Object.assign(B,D.fields);let H=xF(F,B,!1,Z,J+1,X,!0,$),q=H-Y;return Y+=Y1.setInt32LE(F,Z,q),H}function xF(F,A,D,Z,J,X,$,G){if(G==null){if(A==null)return F[0]=5,F[1]=0,F[2]=0,F[3]=0,F[4]=0,5;if(Array.isArray(A))throw new v("serialize does not support an array as the root input");if(typeof A!=="object")throw new v("serialize does not support non-object as the root input");else if("_bsontype"in A&&typeof A._bsontype==="string")throw new v("BSON types cannot be serialized as a document");else if(E8(A)||K8(A)||Q8(A)||kq(A))throw new v("date, regexp, typedarray, and arraybuffer cannot be BSON documents");G=new Set}G.add(A);let Y=Z+4;if(Array.isArray(A))for(let H=0;H<A.length;H++){let q=`${H}`,W=A[H];if(typeof W?.toBSON==="function")W=W.toBSON();let C=typeof W;if(W===void 0)Y=C8(F,q,W,Y);else if(W===null)Y=C8(F,q,W,Y);else if(C==="string")Y=Yq(F,q,W,Y);else if(C==="number")Y=Gq(F,q,W,Y);else if(C==="bigint")Y=Bq(F,q,W,Y);else if(C==="boolean")Y=Hq(F,q,W,Y);else if(C==="object"&&W._bsontype==null)if(W instanceof Date||E8(W))Y=qq(F,q,W,Y);else if(W instanceof Uint8Array||Q8(W))Y=Eq(F,q,W,Y);else if(W instanceof RegExp||K8(W))Y=Wq(F,q,W,Y);else Y=Uq(F,q,W,Y,D,J,X,$,G);else if(C==="object"){if(W[V8]!==g9)throw new l4;else if(W._bsontype==="ObjectId")Y=Kq(F,q,W,Y);else if(W._bsontype==="Decimal128")Y=zq(F,q,W,Y);else if(W._bsontype==="Long"||W._bsontype==="Timestamp")Y=Vq(F,q,W,Y);else if(W._bsontype==="Double")Y=Rq(F,q,W,Y);else if(W._bsontype==="Code")Y=Pq(F,q,W,Y,D,J,X,$,G);else if(W._bsontype==="Binary")Y=Iq(F,q,W,Y);else if(W._bsontype==="BSONSymbol")Y=Mq(F,q,W,Y);else if(W._bsontype==="DBRef")Y=Nq(F,q,W,Y,J,X,G);else if(W._bsontype==="BSONRegExp")Y=Cq(F,q,W,Y);else if(W._bsontype==="Int32")Y=Lq(F,q,W,Y);else if(W._bsontype==="MinKey"||W._bsontype==="MaxKey")Y=Qq(F,q,W,Y);else if(typeof W._bsontype!=="undefined")throw new v(`Unrecognized or invalid _bsontype: ${String(W._bsontype)}`)}else if(C==="function"&&X)Y=wq(F,q,W,Y)}else if(A instanceof Map||Oq(A)){let H=A.entries(),q=!1;while(!q){let W=H.next();if(q=!!W.done,q)continue;let C=W.value?W.value[0]:void 0,Q=W.value?W.value[1]:void 0;if(typeof Q?.toBSON==="function")Q=Q.toBSON();let K=typeof Q;if(typeof C==="string"&&!D_.has(C)){if(C.match(bZ)!=null)throw new v("key "+C+" must not contain null bytes");if(D){if(C[0]==="$")throw new v("key "+C+" must not start with '$'");else if(C.includes("."))throw new v("key "+C+" must not contain '.'")}}if(Q===void 0){if($===!1)Y=C8(F,C,Q,Y)}else if(Q===null)Y=C8(F,C,Q,Y);else if(K==="string")Y=Yq(F,C,Q,Y);else if(K==="number")Y=Gq(F,C,Q,Y);else if(K==="bigint")Y=Bq(F,C,Q,Y);else if(K==="boolean")Y=Hq(F,C,Q,Y);else if(K==="object"&&Q._bsontype==null)if(Q instanceof Date||E8(Q))Y=qq(F,C,Q,Y);else if(Q instanceof Uint8Array||Q8(Q))Y=Eq(F,C,Q,Y);else if(Q instanceof RegExp||K8(Q))Y=Wq(F,C,Q,Y);else Y=Uq(F,C,Q,Y,D,J,X,$,G);else if(K==="object"){if(Q[V8]!==g9)throw new l4;else if(Q._bsontype==="ObjectId")Y=Kq(F,C,Q,Y);else if(Q._bsontype==="Decimal128")Y=zq(F,C,Q,Y);else if(Q._bsontype==="Long"||Q._bsontype==="Timestamp")Y=Vq(F,C,Q,Y);else if(Q._bsontype==="Double")Y=Rq(F,C,Q,Y);else if(Q._bsontype==="Code")Y=Pq(F,C,Q,Y,D,J,X,$,G);else if(Q._bsontype==="Binary")Y=Iq(F,C,Q,Y);else if(Q._bsontype==="BSONSymbol")Y=Mq(F,C,Q,Y);else if(Q._bsontype==="DBRef")Y=Nq(F,C,Q,Y,J,X,G);else if(Q._bsontype==="BSONRegExp")Y=Cq(F,C,Q,Y);else if(Q._bsontype==="Int32")Y=Lq(F,C,Q,Y);else if(Q._bsontype==="MinKey"||Q._bsontype==="MaxKey")Y=Qq(F,C,Q,Y);else if(typeof Q._bsontype!=="undefined")throw new v(`Unrecognized or invalid _bsontype: ${String(Q._bsontype)}`)}else if(K==="function"&&X)Y=wq(F,C,Q,Y)}}else{if(typeof A?.toBSON==="function"){if(A=A.toBSON(),A!=null&&typeof A!=="object")throw new v("toBSON function did not return an object")}for(let H of Object.keys(A)){let q=A[H];if(typeof q?.toBSON==="function")q=q.toBSON();let W=typeof q;if(typeof H==="string"&&!D_.has(H)){if(H.match(bZ)!=null)throw new v("key "+H+" must not contain null bytes");if(D){if(H[0]==="$")throw new v("key "+H+" must not start with '$'");else if(H.includes("."))throw new v("key "+H+" must not contain '.'")}}if(q===void 0){if($===!1)Y=C8(F,H,q,Y)}else if(q===null)Y=C8(F,H,q,Y);else if(W==="string")Y=Yq(F,H,q,Y);else if(W==="number")Y=Gq(F,H,q,Y);else if(W==="bigint")Y=Bq(F,H,q,Y);else if(W==="boolean")Y=Hq(F,H,q,Y);else if(W==="object"&&q._bsontype==null)if(q instanceof Date||E8(q))Y=qq(F,H,q,Y);else if(q instanceof Uint8Array||Q8(q))Y=Eq(F,H,q,Y);else if(q instanceof RegExp||K8(q))Y=Wq(F,H,q,Y);else Y=Uq(F,H,q,Y,D,J,X,$,G);else if(W==="object"){if(q[V8]!==g9)throw new l4;else if(q._bsontype==="ObjectId")Y=Kq(F,H,q,Y);else if(q._bsontype==="Decimal128")Y=zq(F,H,q,Y);else if(q._bsontype==="Long"||q._bsontype==="Timestamp")Y=Vq(F,H,q,Y);else if(q._bsontype==="Double")Y=Rq(F,H,q,Y);else if(q._bsontype==="Code")Y=Pq(F,H,q,Y,D,J,X,$,G);else if(q._bsontype==="Binary")Y=Iq(F,H,q,Y);else if(q._bsontype==="BSONSymbol")Y=Mq(F,H,q,Y);else if(q._bsontype==="DBRef")Y=Nq(F,H,q,Y,J,X,G);else if(q._bsontype==="BSONRegExp")Y=Cq(F,H,q,Y);else if(q._bsontype==="Int32")Y=Lq(F,H,q,Y);else if(q._bsontype==="MinKey"||q._bsontype==="MaxKey")Y=Qq(F,H,q,Y);else if(typeof q._bsontype!=="undefined")throw new v(`Unrecognized or invalid _bsontype: ${String(q._bsontype)}`)}else if(W==="function"&&X)Y=wq(F,H,q,Y)}}G.delete(A),F[Y++]=0;let B=Y-Z;return Z+=Y1.setInt32LE(F,Z,B),Y}function $X1(F){return F!=null&&typeof F==="object"&&"_bsontype"in F&&typeof F._bsontype==="string"}var YX1={$oid:A0,$binary:J1,$uuid:J1,$symbol:b9,$numberInt:e3,$numberDecimal:Q2,$numberDouble:y6,$numberLong:T,$minKey:y9,$maxKey:f9,$regex:h6,$regularExpression:h6,$timestamp:b6};function j_(F,A={}){if(typeof F==="number"){let Z=F<=_F&&F>=uF,J=F<=J_&&F>=X_;if(A.relaxed||A.legacy)return F;if(Number.isInteger(F)&&!Object.is(F,-0)){if(Z)return new e3(F);if(J){if(A.useBigInt64)return BigInt(F);return T.fromNumber(F)}}return new y6(F)}if(F==null||typeof F!=="object")return F;if(F.$undefined)return null;let D=Object.keys(F).filter((Z)=>Z.startsWith("$")&&F[Z]!=null);for(let Z=0;Z<D.length;Z++){let J=YX1[D[Z]];if(J)return J.fromExtendedJSON(F,A)}if(F.$date!=null){let Z=F.$date,J=new Date;if(A.legacy)if(typeof Z==="number")J.setTime(Z);else if(typeof Z==="string")J.setTime(Date.parse(Z));else if(typeof Z==="bigint")J.setTime(Number(Z));else throw new OF(`Unrecognized type for EJSON date: ${typeof Z}`);else if(typeof Z==="string")J.setTime(Date.parse(Z));else if(T.isLong(Z))J.setTime(Z.toNumber());else if(typeof Z==="number"&&A.relaxed)J.setTime(Z);else if(typeof Z==="bigint")J.setTime(Number(Z));else throw new OF(`Unrecognized type for EJSON date: ${typeof Z}`);return J}if(F.$code!=null){let Z=Object.assign({},F);if(F.$scope)Z.$scope=j_(F.$scope);return o3.fromExtendedJSON(F)}if(P_(F)||F.$dbPointer){let Z=F.$ref?F:F.$dbPointer;if(Z instanceof j3)return Z;let J=Object.keys(Z).filter(($)=>$.startsWith("$")),X=!0;if(J.forEach(($)=>{if(["$ref","$id","$db"].indexOf($)===-1)X=!1}),X)return j3.fromExtendedJSON(Z)}return F}function GX1(F,A){return F.map((D,Z)=>{A.seenObjects.push({propertyName:`index ${Z}`,obj:null});try{return t3(D,A)}finally{A.seenObjects.pop()}})}function Z_(F){let A=F.toISOString();return F.getUTCMilliseconds()!==0?A:A.slice(0,-5)+"Z"}function t3(F,A){if(F instanceof Map||Oq(F)){let D=Object.create(null);for(let[Z,J]of F){if(typeof Z!=="string")throw new v("Can only serialize maps with string keys");D[Z]=J}return t3(D,A)}if((typeof F==="object"||typeof F==="function")&&F!==null){let D=A.seenObjects.findIndex((Z)=>Z.obj===F);if(D!==-1){let Z=A.seenObjects.map((H)=>H.propertyName),J=Z.slice(0,D).map((H)=>`${H} -> `).join(""),X=Z[D],$=" -> "+Z.slice(D+1,Z.length-1).map((H)=>`${H} -> `).join(""),G=Z[Z.length-1],Y=" ".repeat(J.length+X.length/2),B="-".repeat($.length+(X.length+G.length)/2-1);throw new v(`Converting circular structure to EJSON:
34
+ ${J}${X}${$}${G}
35
+ ${Y}\\${B}/`)}A.seenObjects[A.seenObjects.length-1].obj=F}if(Array.isArray(F))return GX1(F,A);if(F===void 0)return null;if(F instanceof Date||E8(F)){let D=F.getTime(),Z=D>-1&&D<253402318800000;if(A.legacy)return A.relaxed&&Z?{$date:F.getTime()}:{$date:Z_(F)};return A.relaxed&&Z?{$date:Z_(F)}:{$date:{$numberLong:F.getTime().toString()}}}if(typeof F==="number"&&(!A.relaxed||!isFinite(F))){if(Number.isInteger(F)&&!Object.is(F,-0)){if(F>=uF&&F<=_F)return{$numberInt:F.toString()};if(F>=X_&&F<=J_)return{$numberLong:F.toString()}}return{$numberDouble:Object.is(F,-0)?"-0.0":F.toString()}}if(typeof F==="bigint"){if(!A.relaxed)return{$numberLong:BigInt.asIntN(64,F).toString()};return Number(BigInt.asIntN(64,F))}if(F instanceof RegExp||K8(F)){let D=F.flags;if(D===void 0){let J=F.toString().match(/[gimuy]*$/);if(J)D=J[0]}return new h6(F.source,D).toExtendedJSON(A)}if(F!=null&&typeof F==="object")return HX1(F,A);return F}var BX1={Binary:(F)=>new J1(F.value(),F.sub_type),Code:(F)=>new o3(F.code,F.scope),DBRef:(F)=>new j3(F.collection||F.namespace,F.oid,F.db,F.fields),Decimal128:(F)=>new Q2(F.bytes),Double:(F)=>new y6(F.value),Int32:(F)=>new e3(F.value),Long:(F)=>T.fromBits(F.low!=null?F.low:F.low_,F.low!=null?F.high:F.high_,F.low!=null?F.unsigned:F.unsigned_),MaxKey:()=>new f9,MinKey:()=>new y9,ObjectId:(F)=>new A0(F),BSONRegExp:(F)=>new h6(F.pattern,F.options),BSONSymbol:(F)=>new b9(F.value),Timestamp:(F)=>b6.fromBits(F.low,F.high)};function HX1(F,A){if(F==null||typeof F!=="object")throw new v("not an object instance");let D=F._bsontype;if(typeof D==="undefined"){let Z={};for(let J of Object.keys(F)){A.seenObjects.push({propertyName:J,obj:null});try{let X=t3(F[J],A);if(J==="__proto__")Object.defineProperty(Z,J,{value:X,writable:!0,enumerable:!0,configurable:!0});else Z[J]=X}finally{A.seenObjects.pop()}}return Z}else if(F!=null&&typeof F==="object"&&typeof F._bsontype==="string"&&F[V8]!==g9)throw new l4;else if($X1(F)){let Z=F;if(typeof Z.toExtendedJSON!=="function"){let J=BX1[F._bsontype];if(!J)throw new v("Unrecognized or invalid _bsontype: "+F._bsontype);Z=J(Z)}if(D==="Code"&&Z.scope)Z=new o3(Z.code,t3(Z.scope,A));else if(D==="DBRef"&&Z.oid)Z=new j3(t3(Z.collection,A),t3(Z.oid,A),t3(Z.db,A),t3(Z.fields,A));return Z.toExtendedJSON(A)}else throw new v("_bsontype must be a string, but was: "+typeof D)}function T_(F,A){let D={useBigInt64:A?.useBigInt64??!1,relaxed:A?.relaxed??!0,legacy:A?.legacy??!1};return JSON.parse(F,(Z,J)=>{if(Z.indexOf("\x00")!==-1)throw new v(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(Z)}`);return j_(J,D)})}function k_(F,A,D,Z){if(D!=null&&typeof D==="object")Z=D,D=0;if(A!=null&&typeof A==="object"&&!Array.isArray(A))Z=A,A=void 0,D=0;let J=Object.assign({relaxed:!0,legacy:!1},Z,{seenObjects:[{propertyName:"(root)",obj:null}]}),X=t3(F,J);return JSON.stringify(X,A,D)}function qX1(F,A){return A=A||{},JSON.parse(k_(F,A))}function WX1(F,A){return A=A||{},T_(JSON.stringify(F),A)}var h9=Object.create(null);h9.parse=T_;h9.stringify=k_;h9.serialize=qX1;h9.deserialize=WX1;Object.freeze(h9);function jq(F,A){try{return Y1.getNonnegativeInt32LE(F,A)}catch(D){throw new G3("BSON size cannot be negative",A,{cause:D})}}function Tq(F,A){let D=A;for(;F[D]!==0;D++);if(D===F.length-1)throw new G3("Null terminator not found",A);return D}function CX1(F,A=0){if(A??=0,F.length<5)throw new G3(`Input must be at least 5 bytes, got ${F.length} bytes`,A);let D=jq(F,A);if(D>F.length-A)throw new G3(`Parsed documentSize (${D} bytes) does not match input length (${F.length} bytes)`,A);if(F[A+D-1]!==0)throw new G3("BSON documents must end in 0x00",A+D);let Z=[],J=A+4;while(J<=D+A){let X=F[J];if(J+=1,X===0){if(J-A!==D)throw new G3("Invalid 0x00 type byte",J);break}let $=J,G=Tq(F,J)-$;J+=G+1;let Y;if(X===1||X===18||X===9||X===17)Y=8;else if(X===16)Y=4;else if(X===7)Y=12;else if(X===19)Y=16;else if(X===8)Y=1;else if(X===10||X===6||X===127||X===255)Y=0;else if(X===11)Y=Tq(F,Tq(F,J)+1)+1-J;else if(X===3||X===4||X===15)Y=jq(F,J);else if(X===2||X===5||X===12||X===13||X===14){if(Y=jq(F,J)+4,X===5)Y+=1;if(X===12)Y+=12}else throw new G3(`Invalid 0x${X.toString(16).padStart(2,"0")} type byte`,J);if(Y>D)throw new G3("value reports length larger than document",J);Z.push([X,$,G,J,Y]),J+=Y}return Z}var L8=Object.create(null);L8.parseToElements=CX1;L8.ByteUtils=y;L8.NumberUtils=Y1;Object.freeze(L8);var O_=17825792,c4=y.allocate(O_);function S_(F){if(c4.length<F)c4=y.allocate(F)}function __(F,A={}){let D=typeof A.checkKeys==="boolean"?A.checkKeys:!1,Z=typeof A.serializeFunctions==="boolean"?A.serializeFunctions:!1,J=typeof A.ignoreUndefined==="boolean"?A.ignoreUndefined:!0,X=typeof A.minInternalBufferSize==="number"?A.minInternalBufferSize:O_;if(c4.length<X)c4=y.allocate(X);let $=xF(c4,F,D,0,0,Z,J,null),G=y.allocateUnsafe($);return G.set(c4.subarray(0,$),0),G}function u_(F,A,D={}){let Z=typeof D.checkKeys==="boolean"?D.checkKeys:!1,J=typeof D.serializeFunctions==="boolean"?D.serializeFunctions:!1,X=typeof D.ignoreUndefined==="boolean"?D.ignoreUndefined:!0,$=typeof D.index==="number"?D.index:0,G=xF(c4,F,Z,0,0,J,X,null);return A.set(c4.subarray(0,G),$),$+G-1}function x_(F,A={}){return N_(y.toLocalBufferType(F),A)}function g_(F,A={}){A=A||{};let D=typeof A.serializeFunctions==="boolean"?A.serializeFunctions:!1,Z=typeof A.ignoreUndefined==="boolean"?A.ignoreUndefined:!0;return gZ(F,D,Z)}function f_(F,A,D,Z,J,X){let $=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},X),G=y.toLocalBufferType(F),Y=A;for(let B=0;B<D;B++){let H=Y1.getInt32LE(G,Y);$.index=Y,Z[J+B]=N_(G,$),Y=Y+H}return Y}var QX1=Object.freeze({__proto__:null,BSONError:v,BSONOffsetError:G3,BSONRegExp:h6,BSONRuntimeError:OF,BSONSymbol:b9,BSONType:V_,BSONValue:y2,BSONVersionError:l4,Binary:J1,Code:o3,DBRef:j3,Decimal128:Q2,Double:y6,EJSON:h9,Int32:e3,Long:T,MaxKey:f9,MinKey:y9,ObjectId:A0,Timestamp:b6,UUID:A2,calculateObjectSize:g_,deserialize:x_,deserializeStream:f_,onDemand:L8,serialize:__,serializeWithBufferAndIndex:u_,setInternalBufferSize:S_});KX1.BSON=QX1;KX1.BSONError=v;KX1.BSONOffsetError=G3;KX1.BSONRegExp=h6;KX1.BSONRuntimeError=OF;KX1.BSONSymbol=b9;KX1.BSONType=V_;KX1.BSONValue=y2;KX1.BSONVersionError=l4;KX1.Binary=J1;KX1.Code=o3;KX1.DBRef=j3;KX1.Decimal128=Q2;KX1.Double=y6;KX1.EJSON=h9;KX1.Int32=e3;KX1.Long=T;KX1.MaxKey=f9;KX1.MinKey=y9;KX1.ObjectId=A0;KX1.Timestamp=b6;KX1.UUID=A2;KX1.calculateObjectSize=g_;KX1.deserialize=x_;KX1.deserializeStream=f_;KX1.onDemand=L8;KX1.serialize=__;KX1.serializeWithBufferAndIndex=u_;KX1.setInternalBufferSize=S_});var A1=E((pX1)=>{pX1.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup");pX1.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics");pX1.arrayParentSymbol=Symbol("mongoose#Array#_parent");pX1.arrayPathSymbol=Symbol("mongoose#Array#_path");pX1.arraySchemaSymbol=Symbol("mongoose#Array#_schema");pX1.documentArrayParent=Symbol("mongoose#documentArrayParent");pX1.documentIsSelected=Symbol("mongoose#Document#isSelected");pX1.documentIsModified=Symbol("mongoose#Document#isModified");pX1.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths");pX1.documentSchemaSymbol=Symbol("mongoose#Document#schema");pX1.getSymbol=Symbol("mongoose#Document#get");pX1.modelSymbol=Symbol("mongoose#Model");pX1.objectIdSymbol=Symbol("mongoose#ObjectId");pX1.populateModelSymbol=Symbol("mongoose#PopulateOptions#Model");pX1.schemaTypeSymbol=Symbol("mongoose#schemaType");pX1.sessionNewDocuments=Symbol("mongoose#ClientSession#newDocuments");pX1.scopeSymbol=Symbol("mongoose#Document#scope");pX1.validatorErrorSymbol=Symbol("mongoose#validatorError")});var F4=E((cN1,y_)=>{var gF=B3().ObjectId,H$1=A1().objectIdSymbol;Object.defineProperty(gF.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});/*!
36
+ * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299
37
+ */if(!gF.prototype.hasOwnProperty("valueOf"))gF.prototype.valueOf=function F(){return this.toString()};gF.prototype[H$1]=!0;y_.exports=gF});var b2=E((lN1,b_)=>{b_.exports=function F(A){if(A==null)return;if(typeof A.constructor!=="function")return;return A.constructor.name}});var H3=E((q$1)=>{/*!
38
+ * ignore
39
+ */q$1.internalToObjectOptions={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1,versionKey:!0,flattenObjectIds:!1}});var hZ=E((iN1,h_)=>{h_.exports=B3().Decimal128});var v9=E((aN1,v_)=>{v_.exports=new Set(["__proto__","constructor","prototype"])});var vZ=E((C$1)=>{C$1.isMongooseArray=function(F){return Array.isArray(F)&&F.isMongooseArray}});var fF=E((sN1,m_)=>{var K$1=vZ().isMongooseArray;m_.exports=function(F){return F!=null&&(K$1(F)||F.$__!=null||F.isMongooseBuffer||F.$isMongooseMap)}});var bq=E((rN1,d_)=>{var E$1=/^function\s*([^\s(]+)/;d_.exports=function(F){return F.name||(F.toString().trim().match(E$1)||[])[1]}});var D2=E((tN1,c_)=>{function U$1(F,A){return F!=null&&F._bsontype===A}c_.exports=U$1});var p4=E((oN1,l_)=>{l_.exports=function(F){return Buffer.isBuffer(F)||Object.prototype.toString.call(F)==="[object Object]"}});var R8=E((eN1,p_)=>{p_.exports=function F(A){if(A==null||typeof A!=="object")return!1;let D=Object.getPrototypeOf(A);return!D||D.constructor.name==="Object"}});var w8=E((z$1)=>{var i_=Symbol("mongoose#trustedSymbol");z$1.trustedSymbol=i_;z$1.trusted=function F(A){if(A==null||typeof A!=="object")return A;return A[i_]=!0,A}});var K0=E((Aj1,a_)=>{var R$1=hZ(),w$1=F4(),P$1=v9(),I$1=fF(),M$1=bq(),hq=D2(),N$1=vZ().isMongooseArray,j$1=p4(),T$1=R8(),k$1=A1(),vq=w8().trustedSymbol,O$1=B3();function dq(F,A,D){if(F==null)return F;if(hq(F,"Double"))return new O$1.Double(F.value);if(typeof F==="number"||typeof F==="string"||typeof F==="boolean"||typeof F==="bigint")return F;if(Array.isArray(F))return S$1(N$1(F)?F.__array:F,A);if(I$1(F)){if(A){if(A.retainDocuments&&F.$__!=null){let $=F.$clone();if(F.__index!=null)$.__index=F.__index;if(F.__parentArray!=null)$.__parentArray=F.__parentArray;return $.$__parent=F.$__parent,$}}let J=F.$isSingleNested;if(T$1(F)&&F.$__!=null&&F._doc!=null)return F._doc;let X;if(A&&A.json&&typeof F.toJSON==="function")X=F.toJSON(A);else X=F.toObject(A);if(A&&A.minimize&&!F.constructor.$__required&&J&&Object.keys(X).length===0)return;return X}let Z=F.constructor;if(Z)switch(M$1(Z)){case"Object":return mq(F,A,D);case"Date":return new Z(+F);case"RegExp":return _$1(F);default:break}if(hq(F,"ObjectId")){if(A&&A.flattenObjectIds)return F.toJSON();return new w$1(F.id)}if(hq(F,"Decimal128")){if(A&&A.flattenDecimals)return F.toJSON();return R$1.fromString(F.toString())}if(!Z&&j$1(F))return mq(F,A,D);if(typeof F==="object"&&F[k$1.schemaTypeSymbol])return F.clone();if(A&&A.bson&&typeof F.toBSON==="function")return F;if(typeof F.valueOf==="function")return F.valueOf();return mq(F,A,D)}a_.exports=dq;/*!
40
+ * ignore
41
+ */function mq(F,A,D){let Z=A&&A.minimize,J=A&&A.omitUndefined,X=A&&A._seen,$={},G;if(X&&X.has(F))return X.get(F);else if(X)X.set(F,$);if(vq in F&&A?.copyTrustedSymbol!==!1)$[vq]=F[vq];let Y=Object.keys(F),B=Y.length;for(let H=0;H<B;++H){let q=Y[H];if(P$1.has(q))continue;let W=dq(F[q],A,!1);if((Z===!1||J)&&typeof W==="undefined")delete $[q];else if(Z!==!0||typeof W!=="undefined")G||(G=!0),$[q]=W}return Z&&!D?G&&$:$}function S$1(F,A){let D=0,Z=F.length,J=new Array(Z);for(D=0;D<Z;++D)J[D]=dq(F[D],A,!0);return J}function _$1(F){let A=new RegExp(F.source,F.flags);if(A.lastIndex!==F.lastIndex)A.lastIndex=F.lastIndex;return A}});var r_=E((Dj1,s_)=>{/*!
42
+ * Module dependencies.
43
+ */var mZ=mS(),cq=w1(),lq=Y8().Collection,u$1=F4(),n_=b2(),x$1=H3().internalToObjectOptions,g$1=i("node:stream"),pq=i("node:util"),f$1=Object.freeze({...x$1,copyTrustedSymbol:!1});function q3(F,A,D){this.collection=null,this.Promise=D.Promise||Promise,this.modelName=D.modelName,delete D.modelName,this._closed=!1,mZ.apply(this,arguments)}/*!
44
+ * Inherit from abstract Collection.
45
+ */Object.setPrototypeOf(q3.prototype,mZ.prototype);q3.prototype.onOpen=function(){return this.collection=this.conn.db.collection(this.name),mZ.prototype.onOpen.call(this),this.collection};q3.prototype.onClose=function(F){mZ.prototype.onClose.call(this,F)};q3.prototype._getCollection=function F(){if(this.collection)return this.collection;if(this.conn.db!=null)return this.collection=this.conn.db.collection(this.name),this.collection;return null};/*!
46
+ * ignore
47
+ */var yF={watch:!0,find:!0,aggregate:!0};function y$1(F){q3.prototype[F]=function(){let A=this._getCollection(),D=Array.from(arguments),Z=this,J=Z&&Z.conn&&Z.conn.base&&Z.conn.base.options&&Z.conn.base.options.debug,X=Z&&Z.conn&&Z.conn.options&&Z.conn.options.debug,$=X==null?J:X,G=arguments[arguments.length-1],Y=new u$1;if(this.conn.$wasForceClosed){let q=new cq("Connection was force closed");if(D.length>0&&typeof D[D.length-1]==="function"){D[D.length-1](q);return}else throw q}let B=D,H=null;if(this._shouldBufferCommands()&&this.buffer){this.conn.emit("buffer",{_id:Y,modelName:Z.modelName,collectionName:Z.name,method:F,args:D});let q,W=D,C=null,Q=null;if(yF[F]&&typeof G==="function")this.addQueue(F,W),q=G;else if(yF[F])C=new this.Promise((U,z)=>{q=function L(V,P){if(Q!=null)clearTimeout(Q);if(V!=null)return z(V);U(P)},W=D.concat([q]),this.addQueue(F,W)});else if(typeof G==="function")q=function U(){if(Q!=null)clearTimeout(Q);return G.apply(this,arguments)},W=D.slice(0,D.length-1).concat([q]);else C=new Promise((U,z)=>{q=function L(V,P){if(Q!=null)clearTimeout(Q);if(V!=null)return z(V);U(P)},W=D.concat([q]),this.addQueue(F,W)});let K=this._getBufferTimeoutMS();if(Q=setTimeout(()=>{if(this.removeQueue(F,W)){let z="Operation `"+this.name+"."+F+"()` buffering timed out after "+K+"ms",L=new cq(z);this.conn.emit("buffer-end",{_id:Y,modelName:Z.modelName,collectionName:Z.name,method:F,error:L}),q(L)}},K),!yF[F]&&typeof G==="function"){this.addQueue(F,W);return}return C}else if(!yF[F]&&typeof G==="function")H=function q(W,C){if(W!=null)Z.conn.emit("operation-end",{_id:Y,modelName:Z.modelName,collectionName:Z.name,method:F,error:W});else Z.conn.emit("operation-end",{_id:Y,modelName:Z.modelName,collectionName:Z.name,method:F,result:C});return G.apply(this,arguments)},B=D.slice(0,D.length-1).concat([H]);if($)if(typeof $==="function"){let q=null;if(typeof D[D.length-1]=="function")q=D.slice(0,D.length-1);else q=D;$.apply(Z,[Z.name,F].concat(q))}else if($ instanceof g$1.Writable)this.$printToStream(Z.name,F,D,$);else{let q=$.color==null?!0:$.color,W=$.shell==null?!1:$.shell;this.$print(Z.name,F,D,q,W)}this.conn.emit("operation-start",{_id:Y,modelName:Z.modelName,collectionName:this.name,method:F,params:B});try{if(A==null){let W="Cannot call `"+this.name+"."+F+"()` before initial connection is complete if `bufferCommands = false`. Make sure you `await mongoose.connect()` if you have `bufferCommands = false`.";throw new cq(W)}if(yF[F]&&typeof G==="function"){let W=A[F].apply(A,B.slice(0,B.length-1));return this.conn.emit("operation-end",{_id:Y,modelName:Z.modelName,collectionName:this.name,method:F,result:W}),G.call(this,null,W)}let q=A[F].apply(A,B);if(q!=null&&typeof q.then==="function")return q.then((W)=>{if(typeof G==="function")G(null,W);else this.conn.emit("operation-end",{_id:Y,modelName:Z.modelName,collectionName:this.name,method:F,result:W});return W},(W)=>{if(typeof G==="function"){G(W);return}else this.conn.emit("operation-end",{_id:Y,modelName:Z.modelName,collectionName:this.name,method:F,error:W});throw W});return q}catch(q){if(typeof G==="function")return G(q);else throw this.conn.emit("operation-end",{_id:Y,modelName:Z.modelName,collectionName:this.name,method:F,error:q}),q}}}for(let F of Object.getOwnPropertyNames(lq.prototype)){if(Object.getOwnPropertyDescriptor(lq.prototype,F).get!==void 0)continue;if(typeof lq.prototype[F]!=="function")continue;y$1(F)}q3.prototype.$print=function(F,A,D,Z,J){let X=Z?"\x1B[0;36mMongoose:\x1B[0m ":"Mongoose: ",$=[F,A].join("."),G=[];for(let B=D.length-1;B>=0;--B)if(this.$format(D[B])||G.length)G.unshift(this.$format(D[B],Z,J));let Y="("+G.join(", ")+")";console.info(X+$+Y)};q3.prototype.$printToStream=function(F,A,D,Z){let J=[F,A].join("."),X=[];for(let G=D.length-1;G>=0;--G)if(this.$format(D[G])||X.length)X.unshift(this.$format(D[G]));let $="("+X.join(", ")+")";Z.write(J+$,"utf8")};q3.prototype.$format=function(F,A,D){let Z=typeof F;if(Z==="function"||Z==="undefined")return"";return iq(F,!1,A,D)};function P8(F){let A={inspect:function(){return F}};if(pq.inspect.custom)A[pq.inspect.custom]=A.inspect;return A}function b$1(F){return iq(F,!0)}function h$1(F,A){F[A]=P8('ObjectId("'+F[A].toHexString()+'")')}function v$1(F,A,D){if(D)F[A]=P8('ISODate("'+F[A].toUTCString()+'")');else F[A]=P8('new Date("'+F[A].toUTCString()+'")')}function iq(F,A,D,Z){if(F&&typeof F.toBSON==="function")F=F.toBSON();if(F==null)return F;let J=K0(),X=A?F:J(F,f$1),$=n_(X);if($==="Binary")X="BinData("+X.sub_type+', "'+X.toString("base64")+'")';else if($==="ObjectId")X=P8('ObjectId("'+X.toHexString()+'")');else if($==="Date")X=P8('new Date("'+X.toUTCString()+'")');else if($==="Object"){let G=Object.keys(X),Y=G.length,B;for(let H=0;H<Y;++H)if(B=G[H],X[B]){let q;if(typeof X[B].toBSON==="function")try{X[B]=X[B].toBSON()}catch(C){q=C}let W=n_(X[B]);if(W==="Binary")X[B]="BinData("+X[B].sub_type+', "'+X[B].buffer.toString("base64")+'")';else if(W==="Object")X[B]=iq(X[B],!0);else if(W==="ObjectId")h$1(X,B);else if(W==="Date")v$1(X,B,Z);else if(W==="ClientSession")X[B]=P8('ClientSession("'+(X[B]&&X[B].id&&X[B].id.id&&X[B].id.id.buffer||"").toString("hex")+'")');else if(Array.isArray(X[B]))X[B]=X[B].map(b$1);else if(q!=null)throw q}}if(A)return X;return pq.inspect(X,!1,10,D).replace(/\n/g,"").replace(/\s{2,}/g," ")}q3.prototype.getIndexes=q3.prototype.indexInformation;/*!
48
+ * Module exports.
49
+ */s_.exports=q3});var aq=E((Zj1,e_)=>{/*!
50
+ * Module dependencies.
51
+ */var m$1=i("node:events").EventEmitter,bF=w1();/*!
52
+ * ignore
53
+ */var t_=["close","change","end","error","resumeTokenChanged"];/*!
54
+ * ignore
55
+ */class o_ extends m$1{constructor(F,A,D){super();if(this.driverChangeStream=null,this.closed=!1,this.bindedEvents=!1,this.pipeline=A,this.options=D,this.errored=!1,D&&D.hydrate&&!D.model)throw new Error("Cannot create change stream with `hydrate: true` unless calling `Model.watch()`");let Z=null;if(this.$driverChangeStreamPromise=new Promise((J,X)=>{try{F(($,G)=>{if($!=null)return this.errored=!0,this.emit("error",$),X($);this.driverChangeStream=G,this.emit("ready"),J()})}catch($){Z=$,this.errored=!0,this.emit("error",$),X($)}}),Z!=null)throw Z}_bindEvents(){if(this.bindedEvents)return;if(this.bindedEvents=!0,this.driverChangeStream==null){this.$driverChangeStreamPromise.then(()=>{this.driverChangeStream.on("close",()=>{this.closed=!0}),t_.forEach((F)=>{this.driverChangeStream.on(F,(A)=>{if(A!=null&&A.fullDocument!=null&&this.options&&this.options.hydrate)A.fullDocument=this.options.model.hydrate(A.fullDocument);this.emit(F,A)})})},()=>{});return}this.driverChangeStream.on("close",()=>{this.closed=!0}),t_.forEach((F)=>{this.driverChangeStream.on(F,(A)=>{if(A!=null&&A.fullDocument!=null&&this.options&&this.options.hydrate)A.fullDocument=this.options.model.hydrate(A.fullDocument);this.emit(F,A)})})}hasNext(F){if(this.errored)throw new bF("Cannot call hasNext() on errored ChangeStream");return this.driverChangeStream.hasNext(F)}next(F){if(this.errored)throw new bF("Cannot call next() on errored ChangeStream");if(this.options&&this.options.hydrate){if(F!=null){let D=F;F=(Z,J)=>{if(Z!=null)return D(Z);if(J.fullDocument!=null)J.fullDocument=this.options.model.hydrate(J.fullDocument);return D(null,J)}}let A=this.driverChangeStream.next(F);if(A&&typeof A.then==="function")A=A.then((D)=>{if(D.fullDocument!=null)D.fullDocument=this.options.model.hydrate(D.fullDocument);return D});return A}return this.driverChangeStream.next(F)}addListener(F,A){if(this.errored)throw new bF("Cannot call addListener() on errored ChangeStream");return this._bindEvents(),super.addListener(F,A)}on(F,A){if(this.errored)throw new bF("Cannot call on() on errored ChangeStream");return this._bindEvents(),super.on(F,A)}once(F,A){if(this.errored)throw new bF("Cannot call once() on errored ChangeStream");return this._bindEvents(),super.once(F,A)}_queue(F){this.once("ready",()=>F())}close(){if(this.closed=!0,this.driverChangeStream)return this.driverChangeStream.close();else return this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.close(),()=>{})}}/*!
56
+ * ignore
57
+ */e_.exports=o_});var m9=E((Jj1,Du)=>{function v1(){this._pres=new Map,this._posts=new Map}v1.skipWrappedFunction=function F(){if(!(this instanceof v1.skipWrappedFunction))return new v1.skipWrappedFunction(...arguments);this.args=[...arguments]};v1.overwriteResult=function F(){if(!(this instanceof v1.overwriteResult))return new v1.overwriteResult(...arguments);this.args=[...arguments]};v1.prototype.execPre=function(F,A,D,Z){if(arguments.length===3)Z=D,D=[];let J=this._pres.get(F)||[],X=J.length,$=J.numAsync||0,G=0,Y=$,B=!1,H=D,q=null;if(!X)return vF(function(){Z(null)});function W(){if(G>=X)return;let Q=J[G];if(Q.isAsync){let K=[hF(C),hF(function(U){if(U){if(B)return;if(U instanceof v1.skipWrappedFunction)q=U;else return B=!0,Z(U)}if(--Y===0&&G>=X)return Z(q)})];dZ(Q.fn,A,K,K[0])}else if(Q.fn.length>0){let K=[hF(C)],U=arguments.length>=2?arguments:[null].concat(H);for(let z=1;z<U.length;++z){if(z===U.length-1&&typeof U[z]==="function")continue;K.push(U[z])}dZ(Q.fn,A,K,K[0])}else{let K=null;try{K=Q.fn.call(A)}catch(U){if(U!=null)return Z(U)}if(cZ(K))K.then(()=>C(),(U)=>C(U));else{if(++G>=X)if(Y>0)return;else return vF(function(){Z(q)});W()}}}W.apply(null,[null].concat(D));function C(Q){if(Q){if(B)return;if(Q instanceof v1.skipWrappedFunction)q=Q;else return B=!0,Z(Q)}if(++G>=X)if(Y>0)return;else return Z(q);W.apply(A,arguments)}};v1.prototype.execPreSync=function(F,A,D){let Z=this._pres.get(F)||[],J=Z.length;for(let X=0;X<J;++X)Z[X].fn.apply(A,D||[])};v1.prototype.execPost=function(F,A,D,Z,J){if(arguments.length<5)J=Z,Z=null;let X=this._posts.get(F)||[],$=X.length,G=0,Y=null;if(Z&&Z.error)Y=Z.error;if(!$)return vF(function(){J.apply(null,[Y].concat(D))});function B(){let H=X[G].fn,q=0,W=D.length,C=[];for(let Q=0;Q<W;++Q)if(q+=D[Q]&&D[Q]._kareemIgnore?0:1,!D[Q]||!D[Q]._kareemIgnore)C.push(D[Q]);if(Y)if(Au(X[G],q)){let Q=hF(function(K){if(K){if(K instanceof v1.overwriteResult){if(D=K.args,++G>=$)return J.call(null,Y);return B()}Y=K}if(++G>=$)return J.call(null,Y);B()});dZ(H,A,[Y].concat(C).concat([Q]),Q)}else{if(++G>=$)return J.call(null,Y);B()}else{let Q=hF(function(K){if(K){if(K instanceof v1.overwriteResult){if(D=K.args,++G>=$)return J.apply(null,[null].concat(D));return B()}return Y=K,B()}if(++G>=$)return J.apply(null,[null].concat(D));B()});if(Au(X[G],q)){if(++G>=$)return J.apply(null,[null].concat(D));return B()}if(H.length===q+1)dZ(H,A,C.concat([Q]),Q);else{let K,U;try{U=H.apply(A,C)}catch(z){K=z,Y=z}if(cZ(U))return U.then((z)=>{Q(z instanceof v1.overwriteResult?z:null)},(z)=>Q(z));if(U instanceof v1.overwriteResult)D=U.args;if(++G>=$)return J.apply(null,[K].concat(D));B()}}}B()};v1.prototype.execPostSync=function(F,A,D){let Z=this._posts.get(F)||[],J=Z.length;for(let X=0;X<J;++X){let $=Z[X].fn.apply(A,D||[]);if($ instanceof v1.overwriteResult)D=$.args}return D};v1.prototype.createWrapperSync=function(F,A){let D=this;return function Z(){D.execPreSync(F,this,arguments);let J=A.apply(this,arguments);return D.execPostSync(F,this,[J])[0]}};function Fu(F,A,D,Z,J,X,$){if(X.useErrorHandlers)return F.execPost(D,Z,J,{error:A},function(G){return typeof $==="function"&&$(G)});else return typeof $==="function"&&$(A)}v1.prototype.wrap=function(F,A,D,Z,J){let X=Z.length>0?Z[Z.length-1]:null,$=Array.from(Z);typeof X==="function"&&$.pop();let G=this;J=J||{};let Y=J.checkForPromise;this.execPre(F,D,Z,function(B){if(B&&!(B instanceof v1.skipWrappedFunction)){let C=J.numCallbackParams||0,Q=J.contextParameter?[D]:[];for(let K=Q.length;K<C;++K)Q.push(null);return Fu(G,B,F,D,Q,J,X)}let H=A.length,q;if(B instanceof v1.skipWrappedFunction)return q=B.args[0],W(null,...B.args);else try{q=A.apply(D,$.concat(W))}catch(C){return W(C)}if(Y){if(cZ(q))return q.then((C)=>W(null,C),(C)=>W(C));if(H<$.length+1)return W(null,q)}function W(){let C=Array.from(arguments);if(C.shift(),J.nullResultByDefault&&C.length===0)C.push(null);if(arguments[0])return Fu(G,arguments[0],F,D,C,J,X);else G.execPost(F,D,C,function(){if(X===null)return;arguments[0]?X(arguments[0]):X.apply(D,arguments)})}})};v1.prototype.filter=function(F){let A=this.clone(),D=Array.from(A._pres.keys());for(let J of D){let X=this._pres.get(J).map(($)=>Object.assign({},$,{name:J})).filter(F);if(X.length===0){A._pres.delete(J);continue}X.numAsync=X.filter(($)=>$.isAsync).length,A._pres.set(J,X)}let Z=Array.from(A._posts.keys());for(let J of Z){let X=this._posts.get(J).map(($)=>Object.assign({},$,{name:J})).filter(F);if(X.length===0){A._posts.delete(J);continue}A._posts.set(J,X)}return A};v1.prototype.hasHooks=function(F){return this._pres.has(F)||this._posts.has(F)};v1.prototype.createWrapper=function(F,A,D,Z){let J=this;if(!this.hasHooks(F))return function(){vF(()=>A.apply(this,arguments))};return function(){let X=D||this;J.wrap(F,A,X,Array.from(arguments),Z)}};v1.prototype.pre=function(F,A,D,Z,J){let X={};if(typeof A==="object"&&A!==null)X=A,A=X.isAsync;else if(typeof arguments[1]!=="boolean")D=A,A=!1;let $=this._pres.get(F)||[];if(this._pres.set(F,$),A)$.numAsync=$.numAsync||0,++$.numAsync;if(typeof D!=="function")throw new Error('pre() requires a function, got "'+typeof D+'"');if(J)$.unshift(Object.assign({},X,{fn:D,isAsync:A}));else $.push(Object.assign({},X,{fn:D,isAsync:A}));return this};v1.prototype.post=function(F,A,D,Z){let J=this._posts.get(F)||[];if(typeof A==="function")Z=!!D,D=A,A={};if(typeof D!=="function")throw new Error('post() requires a function, got "'+typeof D+'"');if(Z)J.unshift(Object.assign({},A,{fn:D}));else J.push(Object.assign({},A,{fn:D}));return this._posts.set(F,J),this};v1.prototype.clone=function(){let F=new v1;for(let A of this._pres.keys()){let D=this._pres.get(A).slice();D.numAsync=this._pres.get(A).numAsync,F._pres.set(A,D)}for(let A of this._posts.keys())F._posts.set(A,this._posts.get(A).slice());return F};v1.prototype.merge=function(F,A){A=arguments.length===1?!0:A;let D=A?this.clone():this;for(let Z of F._pres.keys()){let J=D._pres.get(Z)||[],X=F._pres.get(Z).filter((G)=>J.map((Y)=>Y.fn).indexOf(G.fn)===-1),$=J.concat(X);$.numAsync=J.numAsync||0,$.numAsync+=X.filter((G)=>G.isAsync).length,D._pres.set(Z,$)}for(let Z of F._posts.keys()){let J=D._posts.get(Z)||[],X=F._posts.get(Z).filter(($)=>J.indexOf($)===-1);D._posts.set(Z,J.concat(X))}return D};function dZ(F,A,D,Z){let J;try{J=F.apply(A,D)}catch(X){return Z(X)}if(cZ(J))J.then(()=>Z(),(X)=>Z(X))}function cZ(F){return typeof F==="object"&&F!==null&&typeof F.then==="function"}function hF(F){let A=!1,D=this;return function(){if(A)return;return A=!0,vF(()=>F.apply(D,arguments))}}var vF=typeof process==="object"&&process!==null&&process.nextTick||function F(A){setTimeout(A,0)};function Au(F,A){if(F.errorHandler)return!0;return F.fn.length===A+2}Du.exports=v1});var Xu=E((Zu,Ju)=>{var K2=Ju.exports=Zu={};K2.DocumentNotFoundError=null;K2.general={};K2.general.default="Validator failed for path `{PATH}` with value `{VALUE}`";K2.general.required="Path `{PATH}` is required.";K2.Number={};K2.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).";K2.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).";K2.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";K2.Date={};K2.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).";K2.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).";K2.String={};K2.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";K2.String.match="Path `{PATH}` is invalid ({VALUE}).";K2.String.minlength="Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).";K2.String.maxlength="Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH})."});var lZ=E((Xj1,Yu)=>{/*!
58
+ * Module dependencies.
59
+ */var $u=w1(),d$1=i("node:util");class nq extends $u{constructor(F,A,D,Z){let J,X=$u.messages;if(X.DocumentNotFoundError!=null)J=typeof X.DocumentNotFoundError==="function"?X.DocumentNotFoundError(F,A):X.DocumentNotFoundError;else J='No document found for query "'+d$1.inspect(F)+'" on model "'+A+'"';super(J);this.result=Z,this.numAffected=D,this.filter=F,this.query=F}}Object.defineProperty(nq.prototype,"name",{value:"DocumentNotFoundError"});/*!
60
+ * exports
61
+ */Yu.exports=nq});var E2=E(($j1,Hu)=>{/*!
62
+ * Module dependencies.
63
+ */var c$1=w1(),l$1=i("node:util");class tq extends c$1{constructor(F,A,D,Z,J){if(arguments.length>0){let X=Gu(A),$=Bu(J),G=sq(null,F,A,D,$,X,Z);super(G);this.init(F,A,D,Z,J)}else super(sq())}toJSON(){return{stringValue:this.stringValue,valueType:this.valueType,kind:this.kind,value:this.value,path:this.path,reason:this.reason,name:this.name,message:this.message}}init(F,A,D,Z,J){/*!
64
+ * ignore
65
+ */this.stringValue=rq(A),this.messageFormat=Bu(J),this.kind=F,this.value=A,this.path=D,this.reason=Z,this.valueType=Gu(A)}copy(F){this.messageFormat=F.messageFormat,this.stringValue=F.stringValue,this.kind=F.kind,this.value=F.value,this.path=F.path,this.reason=F.reason,this.message=F.message,this.valueType=F.valueType}setModel(F){/*!
66
+ * ignore
67
+ */this.message=sq(F,this.kind,this.value,this.path,this.messageFormat,this.valueType)}}Object.defineProperty(tq.prototype,"name",{value:"CastError"});function rq(F){let A=l$1.inspect(F);if(A=A.replace(/^'|'$/g,'"'),!A.startsWith('"'))A='"'+A+'"';return A}function Gu(F){if(F==null)return""+F;let A=typeof F;if(A!=="object")return A;if(typeof F.constructor!=="function")return A;return F.constructor.name}function Bu(F){let A=F&&F._castErrorMessage||null;if(typeof A==="string"||typeof A==="function")return A}/*!
68
+ * ignore
69
+ */function sq(F,A,D,Z,J,X,$){if(typeof J==="string"){let G=rq(D),Y=J.replace("{KIND}",A).replace("{VALUE}",G).replace("{PATH}",Z);if(F!=null)Y=Y.replace("{MODEL}",F.modelName);return Y}else if(typeof J==="function")return J(D,Z,F,A);else{let G=rq(D),Y=X?" (type "+X+")":"",B="Cast to "+A+" failed for value "+G+Y+' at path "'+Z+'"';if(F!=null)B+=' for model "'+F.modelName+'"';if($!=null&&typeof $.constructor==="function"&&$.constructor.name!=="AssertionError"&&$.constructor.name!=="Error")B+=' because of "'+$.constructor.name+'"';return B}}/*!
70
+ * exports
71
+ */Hu.exports=tq});var oq=E((Yj1,qu)=>{/*!
72
+ * ignore
73
+ */qu.exports=function F(A){let D=Object.keys(A.errors||{}),Z=D.length,J=[],X;for(let $=0;$<Z;++$){if(X=D[$],A===A.errors[X])continue;J.push(X+": "+A.errors[X].message)}return J.join(", ")}});var c9=E((Gj1,Qu)=>{/*!
74
+ * Module requirements
75
+ */var p$1=w1(),i$1=b2(),Wu=i("node:util"),Cu=oq();class d9 extends p$1{constructor(F){let A;if(i$1(F)==="model")A=F.constructor.modelName+" validation failed";else A="Validation failed";super(A);if(this.errors={},this._message=A,F)F.$errors=this.errors}toString(){return this.name+": "+Cu(this)}inspect(){return Object.assign(new Error(this.message),this)}addError(F,A){if(A instanceof d9){let{errors:D}=A;for(let Z of Object.keys(D))this.addError(`${F}.${Z}`,D[Z]);return}this.errors[F]=A,this.message=this._message+": "+Cu(this)}}if(Wu.inspect.custom)d9.prototype[Wu.inspect.custom]=d9.prototype.inspect;Object.defineProperty(d9.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(d9.prototype,"name",{value:"ValidationError"});/*!
76
+ * Module exports
77
+ */Qu.exports=d9});var eq=E((Bj1,Uu)=>{/*!
78
+ * Module dependencies.
79
+ */var Ku=w1();class mF extends Ku{constructor(F,A){let D=F.message;if(!D)D=Ku.messages.general.default;let Z=Eu(D,F,A);super(Z);F=Object.assign({},F,{message:Z}),this.properties=F,this.kind=F.type,this.path=F.path,this.value=F.value,this.reason=F.reason}toString(){return this.message}toJSON(){return Object.assign({name:this.name,message:this.message},this)}}Object.defineProperty(mF.prototype,"name",{value:"ValidatorError"});Object.defineProperty(mF.prototype,"properties",{enumerable:!1,writable:!0,value:null});mF.prototype.formatMessage=Eu;function Eu(F,A,D){if(typeof F==="function")return F(A,D);let Z=Object.keys(A);for(let J of Z){if(J==="message")continue;F=F.replace("{"+J.toUpperCase()+"}",A[J])}return F}/*!
80
+ * exports
81
+ */Uu.exports=mF});var AW=E((Hj1,zu)=>{/*!
82
+ * Module dependencies.
83
+ */var a$1=w1();class FW extends a$1{constructor(F,A,D){let Z=D.join(", ");super('No matching document found for id "'+F._doc._id+'" version '+A+' modifiedPaths "'+Z+'"');this.version=A,this.modifiedPaths=D}}Object.defineProperty(FW.prototype,"name",{value:"VersionError"});/*!
84
+ * exports
85
+ */zu.exports=FW});var ZW=E((qj1,Vu)=>{/*!
86
+ * Module dependencies.
87
+ */var n$1=w1();class DW extends n$1{constructor(F){super("Can't save() the same doc multiple times in parallel. Document: "+F._doc._id)}}Object.defineProperty(DW.prototype,"name",{value:"ParallelSaveError"});/*!
88
+ * exports
89
+ */Vu.exports=DW});var XW=E((Wj1,Lu)=>{/*!
90
+ * Module dependencies.
91
+ */var s$1=w1();class JW extends s$1{constructor(F){super("Cannot overwrite `"+F+"` model once compiled.")}}Object.defineProperty(JW.prototype,"name",{value:"OverwriteModelError"});/*!
92
+ * exports
93
+ */Lu.exports=JW});var wu=E((Cj1,Ru)=>{/*!
94
+ * Module dependencies.
95
+ */var r$1=w1();class $W extends r$1{constructor(F){let A=`Schema hasn't been registered for model "`+F+`".
96
+ Use mongoose.model(name, schema)`;super(A)}}Object.defineProperty($W.prototype,"name",{value:"MissingSchemaError"});/*!
97
+ * exports
98
+ */Ru.exports=$W});var Iu=E((Qj1,Pu)=>{var t$1=b2();Pu.exports=function F(A){if(t$1(A)!=="TopologyDescription")return!1;let D=Array.from(A.servers.values());return D.length>0&&D.every((Z)=>Z.type==="Unknown")}});var Nu=E((Kj1,Mu)=>{var o$1=b2();Mu.exports=function F(A){if(o$1(A)!=="TopologyDescription")return!1;if(A.servers.size===0)return!1;for(let D of A.servers.values())if(D.host.endsWith(".mongodb.net")===!1||D.port!==27017)return!1;return!0}});var Tu=E((Ej1,ju)=>{var e$1=b2(),FY1="Client network socket disconnected before secure TLS connection was established";ju.exports=function F(A){if(e$1(A)!=="TopologyDescription")return!1;let D=Array.from(A.servers.values());return D.length>0&&D.every((Z)=>Z.error&&Z.error.message.indexOf(FY1)!==-1)}});var GW=E((Uj1,ku)=>{/*!
99
+ * Module dependencies.
100
+ */var AY1=w1(),DY1=Iu(),ZY1=Nu(),JY1=Tu();/*!
101
+ * ignore
102
+ */var XY1="Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/",$Y1="Mongoose is connecting with SSL enabled, but the server is not accepting SSL connections. Please ensure that the MongoDB server you are connecting to is configured to accept SSL connections. Learn more: https://mongoosejs.com/docs/tutorials/ssl.html";class YW extends AY1{assimilateError(F){let A=F.reason;if(ZY1(A)&&DY1(A)&&F.message.indexOf("bad auth")===-1&&F.message.indexOf("Authentication failed")===-1)this.message=XY1;else if(JY1(A))this.message=$Y1;else this.message=F.message;for(let Z in F)if(Z!=="name")this[Z]=F[Z];return this}}Object.defineProperty(YW.prototype,"name",{value:"MongooseServerSelectionError"});ku.exports=YW});var HW=E((zj1,Ou)=>{/*!
103
+ * Module dependencies.
104
+ */var YY1=w1();class BW extends YY1{constructor(F){let A="For your own good, using `document.save()` to update an array which was selected using an $elemMatch projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n "+F.join(`
105
+ `)+`
106
+ Use Model.updateOne() to update these arrays instead.`;super(A)}}Object.defineProperty(BW.prototype,"name",{value:"DivergentArrayError"});/*!
107
+ * exports
108
+ */Ou.exports=BW});var i4=E((Vj1,Su)=>{/*!
109
+ * Module dependencies.
110
+ */var GY1=w1();class qW extends GY1{constructor(F,A,D){A=A||"Field `"+F+"` is not in schema and strict mode is set to throw.";super(A);this.isImmutableError=!!D,this.path=F}}Object.defineProperty(qW.prototype,"name",{value:"StrictModeError"});Su.exports=qW});var CW=E((Lj1,_u)=>{/*!
111
+ * Module dependencies.
112
+ */var BY1=w1();class WW extends BY1{constructor(F,A){A=A||"Cannot populate path `"+F+"` because it is not in your schema. Set the `strictPopulate` option to false to override.";super(A);this.path=F}}Object.defineProperty(WW.prototype,"name",{value:"StrictPopulateError"});_u.exports=WW});var a2=E((uu,xu)=>{var U2=w1();/*!
113
+ * Module exports.
114
+ */xu.exports=uu=U2;U2.messages=Xu();U2.Messages=U2.messages;U2.DocumentNotFoundError=lZ();U2.CastError=E2();U2.ValidationError=c9();U2.ValidatorError=eq();U2.VersionError=AW();U2.ParallelSaveError=ZW();U2.OverwriteModelError=XW();U2.MissingSchemaError=wu();U2.MongooseServerSelectionError=GW();U2.DivergentArrayError=HW();U2.StrictModeError=i4();U2.StrictPopulateError=CW()});var v6=E((Rj1,gu)=>{gu.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})});var U6=E((wj1,fu)=>{var HY1=K0();class z2{constructor(F){if(F==null)return this;Object.assign(this,HY1(F))}}var n2=v6();Object.defineProperty(z2.prototype,"type",n2);Object.defineProperty(z2.prototype,"validate",n2);Object.defineProperty(z2.prototype,"cast",n2);Object.defineProperty(z2.prototype,"required",n2);Object.defineProperty(z2.prototype,"default",n2);Object.defineProperty(z2.prototype,"ref",n2);Object.defineProperty(z2.prototype,"refPath",n2);Object.defineProperty(z2.prototype,"select",n2);Object.defineProperty(z2.prototype,"index",n2);Object.defineProperty(z2.prototype,"unique",n2);Object.defineProperty(z2.prototype,"immutable",n2);Object.defineProperty(z2.prototype,"sparse",n2);Object.defineProperty(z2.prototype,"text",n2);Object.defineProperty(z2.prototype,"transform",n2);fu.exports=z2});var pZ=E((Pj1,I8)=>{var qY1=E2();I8.exports=function F(A,D){if(I8.exports.convertToTrue.has(A))return!0;if(I8.exports.convertToFalse.has(A))return!1;if(A==null)return A;throw new qY1("boolean",A,D)};I8.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]);I8.exports.convertToFalse=new Set([!1,"false",0,"0","no"])});var iZ=E((Ij1,yu)=>{var WY1=pZ();/*!
115
+ * ignore
116
+ */yu.exports=function(F){let A=this!=null?this.path:null;return WY1(F,A)}});var QW=E((Mj1,bu)=>{/*!
117
+ * ignore
118
+ */bu.exports=function(F){if(Array.isArray(F)){if(!F.every((A)=>typeof A==="number"||typeof A==="string"))throw new Error("$type array values must be strings or numbers");return F}if(typeof F!=="number"&&typeof F!=="string")throw new Error("$type parameter must be number, string, or array of numbers and strings");return F}});var vu=E((Nj1,hu)=>{var CY1=i4();/*!
119
+ * ignore
120
+ */hu.exports=function(F){if(F.$immutable)F.$immutableSetter=QY1(F.path,F.options.immutable),F.set(F.$immutableSetter);else if(F.$immutableSetter)F.setters=F.setters.filter((A)=>A!==F.$immutableSetter),delete F.$immutableSetter};function QY1(F,A){return function D(Z,J,X,$){if(this==null||this.$__==null)return Z;if(this.isNew)return Z;if($&&$.overwriteImmutable)return Z;if(!(typeof A==="function"?A.call(this,this):A))return Z;let Y=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(F):this.$__getValue(F);if(this.$__.strictMode==="throw"&&Z!==Y)throw new CY1(F,"Path `"+F+"` is immutable and strict mode is set to throw.",!0);return Y}}});var du=E((jj1,mu)=>{mu.exports=function F(A){return typeof A==="function"&&A.constructor&&A.constructor.name==="AsyncFunction"}});var lu=E((Tj1,cu)=>{cu.exports=function F(A){let D=Object.keys(A),Z=!0;for(let J=0,X=D.length;J<X;++J)if(typeof A[D[J]]==="object"&&A[D[J]]!==null){Z=!1;break}return Z}});var iu=E((kj1,pu)=>{var M8=1000,N8=M8*60,j8=N8*60,l9=j8*24,KY1=l9*7,EY1=l9*365.25;pu.exports=function(F,A){A=A||{};var D=typeof F;if(D==="string"&&F.length>0)return UY1(F);else if(D==="number"&&isFinite(F))return A.long?VY1(F):zY1(F);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(F))};function UY1(F){if(F=String(F),F.length>100)return;var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(F);if(!A)return;var D=parseFloat(A[1]),Z=(A[2]||"ms").toLowerCase();switch(Z){case"years":case"year":case"yrs":case"yr":case"y":return D*EY1;case"weeks":case"week":case"w":return D*KY1;case"days":case"day":case"d":return D*l9;case"hours":case"hour":case"hrs":case"hr":case"h":return D*j8;case"minutes":case"minute":case"mins":case"min":case"m":return D*N8;case"seconds":case"second":case"secs":case"sec":case"s":return D*M8;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return D;default:return}}function zY1(F){var A=Math.abs(F);if(A>=l9)return Math.round(F/l9)+"d";if(A>=j8)return Math.round(F/j8)+"h";if(A>=N8)return Math.round(F/N8)+"m";if(A>=M8)return Math.round(F/M8)+"s";return F+"ms"}function VY1(F){var A=Math.abs(F);if(A>=l9)return aZ(F,A,l9,"day");if(A>=j8)return aZ(F,A,j8,"hour");if(A>=N8)return aZ(F,A,N8,"minute");if(A>=M8)return aZ(F,A,M8,"second");return F+" ms"}function aZ(F,A,D,Z){var J=A>=D*1.5;return Math.round(F/D)+" "+Z+(J?"s":"")}});var nu=E((Oj1,au)=>{au.exports=function F(A){let D=[],Z="",J="DEFAULT";for(let X=0;X<A.length;++X){if(J==="IN_SQUARE_BRACKETS"&&!/\d/.test(A[X])&&A[X]!=="]")J="DEFAULT",Z=D[D.length-1]+"["+Z,D.splice(D.length-1,1);if(A[X]==="["){if(J!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")D.push(Z),Z="";J="IN_SQUARE_BRACKETS"}else if(A[X]==="]")if(J==="IN_SQUARE_BRACKETS")J="IMMEDIATELY_AFTER_SQUARE_BRACKETS",D.push(Z),Z="";else J="DEFAULT",Z+=A[X];else if(A[X]==="."){if(J!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")D.push(Z),Z="";J="DEFAULT"}else Z+=A[X]}if(J!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")D.push(Z);return D}});var eu=E((LY1)=>{var dF=nu(),ru=["__proto__","constructor","prototype"];LY1.get=function(F,A,D,Z){var J;if(typeof D=="function")if(D.length<2)Z=D,D=void 0;else J=D,D=void 0;Z||(Z=ou);var X=typeof F=="string"?dF(F):F;if(!Array.isArray(X))throw new TypeError("Invalid `path`. Must be either string or array");var $=A,G;for(var Y=0;Y<X.length;++Y){if(G=X[Y],typeof X[Y]!=="string"&&typeof X[Y]!=="number")throw new TypeError("Each segment of path to `get()` must be a string or number, got "+typeof X[Y]);if(Array.isArray($)&&!/^\d+$/.test(G)){var B=X.slice(Y);return[].concat($).map(function(q){return q?LY1.get(B,q,D||J,Z):Z(void 0)})}if(J)$=J($,G);else{var H=D&&$[D]?$[D]:$;$=H instanceof Map?H.get(G):H[G]}if(!$)return Z($)}return Z($)};LY1.has=function(F,A){var D=typeof F==="string"?dF(F):F;if(!Array.isArray(D))throw new TypeError("Invalid `path`. Must be either string or array");var Z=D.length,J=A;for(var X=0;X<Z;++X){if(typeof D[X]!=="string"&&typeof D[X]!=="number")throw new TypeError("Each segment of path to `has()` must be a string or number, got "+typeof D[X]);if(J==null||typeof J!=="object"||!(D[X]in J))return!1;J=J[D[X]]}return!0};LY1.unset=function(F,A){var D=typeof F==="string"?dF(F):F;if(!Array.isArray(D))throw new TypeError("Invalid `path`. Must be either string or array");var Z=D.length,J=A;for(var X=0;X<Z;++X){if(J==null||typeof J!=="object"||!(D[X]in J))return!1;if(typeof D[X]!=="string"&&typeof D[X]!=="number")throw new TypeError("Each segment of path to `unset()` must be a string or number, got "+typeof D[X]);if(ru.indexOf(D[X])!==-1)return!1;if(X===Z-1)return delete J[D[X]],!0;J=J instanceof Map?J.get(D[X]):J[D[X]]}return!0};LY1.set=function(F,A,D,Z,J,X){var $;if(typeof Z=="function")if(Z.length<2)J=Z,Z=void 0;else $=Z,Z=void 0;J||(J=ou);var G=typeof F=="string"?dF(F):F;if(!Array.isArray(G))throw new TypeError("Invalid `path`. Must be either string or array");if(D==null)return;for(var Y=0;Y<G.length;++Y){if(typeof G[Y]!=="string"&&typeof G[Y]!=="number")throw new TypeError("Each segment of path to `set()` must be a string or number, got "+typeof G[Y]);if(ru.indexOf(G[Y])!==-1)return}var B=X||/\$/.test(F)&&X!==!1,H=D,q;for(var Y=0,W=G.length-1;Y<W;++Y){if(q=G[Y],q=="$")if(Y==W-1)break;else continue;if(Array.isArray(H)&&!/^\d+$/.test(q)){var C=G.slice(Y);if(!B&&Array.isArray(A))for(var Q=0;Q<H.length&&Q<A.length;++Q)LY1.set(C,A[Q],H[Q],Z||$,J,B);else for(var Q=0;Q<H.length;++Q)LY1.set(C,A,H[Q],Z||$,J,B);return}if($)H=$(H,q);else{var K=Z&&H[Z]?H[Z]:H;H=K instanceof Map?K.get(q):K[q]}if(!H)return}if(q=G[W],Z&&H[Z])H=H[Z];if(Array.isArray(H)&&!/^\d+$/.test(q))if(!B&&Array.isArray(A))tu(H,A,q,$,Z,J);else for(var Q=0;Q<H.length;++Q){var U=H[Q];if(U)if($)$(U,q,J(A));else{if(U[Z])U=U[Z];U[q]=J(A)}}else if($)$(H,q,J(A));else if(H instanceof Map)H.set(q,J(A));else H[q]=J(A)};/*!
121
+ * Split a string path into components delimited by '.' or
122
+ * '[\d+]'
123
+ *
124
+ * #### Example:
125
+ * stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1']
126
+ */LY1.stringToParts=dF;/*!
127
+ * Recursively set nested arrays
128
+ */function tu(F,A,D,Z,J,X){for(var $,G=0;G<F.length&&G<A.length;++G)if($=F[G],Array.isArray($)&&Array.isArray(A[G]))tu($,A[G],D,Z,J,X);else if($)if(Z)Z($,D,X(A[G]));else{if($[J])$=$[J];$[D]=X(A[G])}}/*!
129
+ * Returns the value passed to it.
130
+ */function ou(F){return F}});var z6=E((Fx,Ax)=>{Ax.exports=Fx=eu()});var EW=E((_j1,Zx)=>{var IY1=K0();class Dx{constructor(F){if(this._docs={},this._childDocs=[],F==null)return;if(F=IY1(F),Object.assign(this,F),typeof F.subPopulate==="object")this.populate=F.subPopulate;if(F.perDocumentLimit!=null&&F.limit!=null)throw new Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+F.path+"`.")}}Zx.exports=Dx});var Jx=E((MY1)=>{MY1.isMongooseDocumentArray=function(F){return Array.isArray(F)&&F.isMongooseDocumentArray}});var nZ=E((xj1,Xx)=>{var jY1=g6(),T8=Symbol("mongoose#emitted");Xx.exports=function F(A,D,Z,J){if(typeof A==="function")try{return D(function(X){if(X!=null){if(Z!=null&&Z.listeners!=null&&Z.listeners("error").length>0&&!X[T8])X[T8]=!0,Z.emit("error",X);try{A(X)}catch($){return jY1(()=>{throw $})}return}A.apply(this,arguments)})}catch(X){if(Z!=null&&Z.listeners!=null&&Z.listeners("error").length>0&&!X[T8])X[T8]=!0,Z.emit("error",X);return A(X)}return J=J||global.Promise,new J((X,$)=>{D(function(G,Y){if(G!=null){if(Z!=null&&Z.listeners!=null&&Z.listeners("error").length>0&&!G[T8])G[T8]=!0,Z.emit("error",G);return $(G)}if(arguments.length>2)return X(Array.prototype.slice.call(arguments,1));X(Y)})})}});var sZ=E((gj1,$x)=>{$x.exports=function F(A,D,Z){let J=Object.keys(D.tree),X={};for(let $ of J){if(Z&&(A.paths[$]||A.nested[$]||A.singleNestedPaths[$]))continue;X[$]=D.tree[$]}A.options._isMerging=!0,A.add(X,null),delete A.options._isMerging,A.callQueue=A.callQueue.concat(D.callQueue),A.method(D.methods),A.static(D.statics);for(let[$,G]of Object.entries(D._userProvidedOptions))if(!($ in A._userProvidedOptions))A.set($,G);for(let $ in D.query)A.query[$]=D.query[$];for(let $ in D.virtuals)A.virtuals[$]=D.virtuals[$].clone();A._indexes=A._indexes.concat(D._indexes||[]),A.s.hooks.merge(D.s.hooks,!1)}});var Bx=E((Yx,Gx)=>{/*!
131
+ * Module dependencies.
132
+ */var fj1=q1(),m6=Gx.exports=Yx=function F(){};m6.ctor=function(){let F=[...arguments],A=function(){m6.apply(this,arguments),this.paths={},this.states={}};return A.prototype=new m6,A.prototype.constructor=A,A.prototype.stateNames=F,F.forEach(function(D){A.prototype[D]=function(Z){this._changeState(Z,D)}}),A};m6.prototype._changeState=function F(A,D){let Z=this.paths[A];if(Z===D)return;let J=this.states[Z];if(J)delete J[A];this.paths[A]=D,this.states[D]=this.states[D]||{},this.states[D][A]=!0};/*!
133
+ * ignore
134
+ */m6.prototype.clear=function F(A){if(this.states[A]==null)return;let D=Object.keys(this.states[A]),Z=D.length,J;while(Z--)J=D[Z],delete this.states[A][J],delete this.paths[J]};/*!
135
+ * ignore
136
+ */m6.prototype.clearPath=function F(A){let D=this.paths[A];if(!D)return;delete this.paths[A],delete this.states[D][A]};m6.prototype.getStatePaths=function F(A){if(this.states[A]!=null)return this.states[A];return{}};m6.prototype.some=function F(){let A=this,D=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(D,function(Z){if(A.states[Z]==null)return!1;return Object.keys(A.states[Z]).length})};m6.prototype._iter=function F(A){return function(){let D=[...arguments],Z=D.pop();if(!D.length)D=this.stateNames;let J=this;return D.reduce(function($,G){if(J.states[G]==null)return $;return $.concat(Object.keys(J.states[G]))},[])[A](function($,G,Y){return Z($,G,Y)})}};m6.prototype.forEach=function F(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)};m6.prototype.map=function F(){return this.map=this._iter("map"),this.map.apply(this,arguments)};m6.prototype.clone=function F(){let A=new this.constructor;A.paths={...this.paths};for(let D of this.stateNames){if(!(D in this.states))continue;A.states[D]=this.states[D]==null?this.states[D]:{...this.states[D]}}return A}});var Wx=E((Hx,qx)=>{/*!
137
+ * Dependencies
138
+ */var TY1=Bx(),kY1=TY1.ctor("require","modify","init","default","ignore");qx.exports=Hx=V0;function V0(){this.activePaths=new kY1}V0.prototype.strictMode=!0;V0.prototype.fullPath=void 0;V0.prototype.selected=void 0;V0.prototype.shardval=void 0;V0.prototype.saveError=void 0;V0.prototype.validationError=void 0;V0.prototype.adhocPaths=void 0;V0.prototype.removing=void 0;V0.prototype.inserting=void 0;V0.prototype.saving=void 0;V0.prototype.version=void 0;V0.prototype._id=void 0;V0.prototype.ownerDocument=void 0;V0.prototype.populate=void 0;V0.prototype.populated=void 0;V0.prototype.primitiveAtomics=void 0;V0.prototype.wasPopulated=!1;V0.prototype.scope=void 0;V0.prototype.session=null;V0.prototype.pathsToScopes=null;V0.prototype.cachedRequired=null});var k8=E((yj1,Kx)=>{/*!
139
+ * Module dependencies.
140
+ */var UW=B3().Binary,Cx=q1();function s2(F,A,D){let Z=F;if(F==null)Z=0;let J,X,$;if(Array.isArray(A))X=A[0],$=A[1];else J=A;let G;if(typeof Z==="number"||Z instanceof Number)G=Buffer.alloc(Z);else G=Buffer.from(Z,J,D);return Cx.decorate(G,s2.mixin),G.isMongooseBuffer=!0,G[s2.pathSymbol]=X,G[Qx]=$,G._subtype=0,G}var OY1=Symbol.for("mongoose#Buffer#_path"),Qx=Symbol.for("mongoose#Buffer#_parent");s2.pathSymbol=OY1;/*!
141
+ * Inherit from Buffer.
142
+ */s2.mixin={_subtype:void 0,_markModified:function(){let F=this[Qx];if(F)F.markModified(this[s2.pathSymbol]);return this},write:function(){let F=Buffer.prototype.write.apply(this,arguments);if(F>0)this._markModified();return F},copy:function(F){let A=Buffer.prototype.copy.apply(this,arguments);if(F&&F.isMongooseBuffer)F._markModified();return A}};/*!
143
+ * Compile other Buffer methods marking this buffer as modified.
144
+ */Cx.each(["writeUInt8","writeUInt16","writeUInt32","writeInt8","writeInt16","writeInt32","writeFloat","writeDouble","fill","utf8Write","binaryWrite","asciiWrite","set","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE"],function(F){if(!Buffer.prototype[F])return;s2.mixin[F]=function(){let A=Buffer.prototype[F].apply(this,arguments);return this._markModified(),A}});s2.mixin.toObject=function(F){let A=typeof F==="number"?F:this._subtype||0;return new UW(Buffer.from(this),A)};s2.mixin.$toObject=s2.mixin.toObject;s2.mixin.toBSON=function(){return new UW(this,this._subtype||0)};s2.mixin.equals=function(F){if(!Buffer.isBuffer(F))return!1;if(this.length!==F.length)return!1;for(let A=0;A<this.length;++A)if(this[A]!==F[A])return!1;return!0};s2.mixin.subtype=function(F){if(typeof F!=="number")throw new TypeError("Invalid subtype. Expected a number");if(this._subtype!==F)this._markModified();this._subtype=F};/*!
145
+ * Module exports.
146
+ */s2.Binary=UW;Kx.exports=s2});var p9=E((SY1)=>{SY1.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed");SY1.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")});var i9=E((hj1,Ex)=>{/*!
147
+ * Module dependencies.
148
+ */var rZ=_0(),xY1=p9(),gY1=p4(),fY1=q1();function W3(F,A){if(A&&A.default){let D=A.default;if(Array.isArray(D)&&D.length===0)A.default=Array;else if(!A.shared&&gY1(D)&&Object.keys(D).length===0)A.default=function(){return{}}}rZ.call(this,F,A,"Mixed"),this[xY1.schemaMixedSymbol]=!0}W3.schemaName="Mixed";W3.defaultOptions={};/*!
149
+ * Inherits from SchemaType.
150
+ */W3.prototype=Object.create(rZ.prototype);W3.prototype.constructor=W3;W3.get=rZ.get;W3.set=rZ.set;W3.setters=[];W3.prototype.cast=function(F){if(F instanceof Error)return fY1.errorToPOJO(F);return F};W3.prototype.castForQuery=function(F,A){return A};/*!
151
+ * Module exports.
152
+ */Ex.exports=W3});var zx=E((vj1,Ux)=>{Ux.exports=class F{constructor(A,D,Z){this.subdocSnapshot=A,this.activePaths=D,this.version=Z}}});var tZ=E((mj1,Vx)=>{/*!
153
+ * Module dependencies.
154
+ */var yY1=w1();class zW extends yY1{constructor(F,A){let D=Array.isArray(A)?"array":"primitive value";super("Tried to set nested object field `"+F+`\` to ${D} \``+A+"`");this.path=F}}Object.defineProperty(zW.prototype,"name",{value:"ObjectExpectedError"});Vx.exports=zW});var oZ=E((dj1,Lx)=>{/*!
155
+ * Module dependencies.
156
+ */var bY1=w1();class VW extends bY1{constructor(F,A,D){super('Parameter "'+A+'" to '+D+'() must be an object, got "'+F.toString()+'" (type '+typeof F+")")}}Object.defineProperty(VW.prototype,"name",{value:"ObjectParameterError"});Lx.exports=VW});var wx=E((cj1,Rx)=>{/*!
157
+ * Module dependencies.
158
+ */var hY1=w1();class LW extends hY1{constructor(F){super("Can't validate() the same doc multiple times in parallel. Document: "+F._doc._id)}}Object.defineProperty(LW.prototype,"name",{value:"ParallelValidateError"});/*!
159
+ * exports
160
+ */Rx.exports=LW});var RW=E((lj1,Px)=>{Px.exports=function F(A){let D={},Z=Object.keys(A);for(let J of Z){if(J.indexOf(".")===-1){D[J]=1;continue}let X=J.split("."),$=X[0];for(let G=0;G<X.length;++G)if(D[$]=1,G+1<X.length)$=$+"."+X[G+1]}return D}});var Mx=E((pj1,Ix)=>{Ix.exports=function F(A){if(A==null||typeof A!=="object")return!1;return A.$slice==null&&A.$elemMatch==null&&A.$meta==null&&A.$==null}});var eZ=E((ij1,Nx)=>{var vY1=Mx();Nx.exports=function F(A,D,Z,J,X,$,G){let Y=Object.keys(A.$__schema.paths),B=Y.length,H=G&&G.skipParentChangeTracking;for(let q=0;q<B;++q){let W,C="",Q=Y[q];if(Q==="_id"&&A.$__.skipId)continue;let K=A.$__schema.paths[Q],U=K.splitPath(),z=U.length;if(U[z-1]==="$*")continue;let L=!1,V=A._doc;for(let P=0;P<z;++P){if(V==null)break;let I=U[P];if(C+=(!C.length?"":".")+I,Z===!0){if(C in D)break}else if(Z===!1&&D&&!L){let M=K.$isSingleNested||K.$isMongooseDocumentArray;if(C in D&&!vY1(D[C])||P===z-1&&M&&J!=null&&J[C])L=!0;else if(J!=null&&!J[C])break}if(P===z-1){if(V[I]!==void 0)break;if(X!=null){if(typeof K.defaultValue==="function"){if(!K.defaultValue.$runBeforeSetters&&X)break;if(K.defaultValue.$runBeforeSetters&&!X)break}else if(!X)continue}if($&&$[C])break;if(D&&Z!==null){if(Z===!0){if(Q in D)continue;try{W=K.getDefault(A,!1)}catch(M){A.invalidate(Q,M);break}if(typeof W!=="undefined")V[I]=W,wW(A,Q,H)}else if(L){try{W=K.getDefault(A,!1)}catch(M){A.invalidate(Q,M);break}if(typeof W!=="undefined")V[I]=W,wW(A,Q,H)}}else{try{W=K.getDefault(A,!1)}catch(M){A.invalidate(Q,M);break}if(typeof W!=="undefined")V[I]=W,wW(A,Q,H)}}else V=V[I]}}};/*!
161
+ * ignore
162
+ */function wW(F,A,D){if(F.$__.activePaths.default(A),!D&&F.$isSubdocument&&F.$isSingleNested&&F.$parent()!=null)F.$parent().$__.activePaths.default(F.$__pathRelativeToParent(A))}});var FJ=E((aj1,Tx)=>{/*!
163
+ * ignore
164
+ */Tx.exports=function F(A,D,Z){Z=Z||{};let J=Z.skipDocArrays,X=0;if(!A)return X;for(let $ of Object.keys(A.$__.activePaths.getStatePaths("modify"))){if(J){let G=A.$__schema.path($);if(G&&G.$isMongooseDocumentArray)continue}if($.startsWith(D+".")){if(A.$__.activePaths.clearPath($),++X,A.$isSubdocument)jx(A,$)}}return X};function jx(F,A,D=new Set){if(D.has(F))throw new Error("Infinite subdocument loop: subdoc with _id "+F._id+" is a parent of itself");let Z=F.$parent(),J=F.$__pathRelativeToParent(void 0,!1)+"."+A;if(Z.$__.activePaths.clearPath(J),Z.$isSubdocument)jx(Z,J,D)}});var DJ=E((sY1)=>{var mY1=K0(),dY1=A1().documentSchemaSymbol,cY1=H3().internalToObjectOptions,lY1=q1(),O8,pY1=A1().getSymbol,AJ=A1().scopeSymbol,kx=lY1.isPOJO;/*!
165
+ * exports
166
+ */sY1.compile=Ox;sY1.defineKey=Sx;var iY1=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),aY1=Object.freeze({noDottedPath:!0});function Ox(F,A,D,Z){O8=O8||r2();let J=Z.typeKey;for(let X of Object.keys(F)){let $=F[X],Y=kx($)&&Object.keys($).length>0&&(!$[J]||J==="type"&&kx($.type)&&$.type.type)?$:null;Sx({prop:X,subprops:Y,prototype:A,prefix:D,options:Z})}}function Sx({prop:F,subprops:A,prototype:D,prefix:Z,options:J}){O8=O8||r2();let X=(Z?Z+".":"")+F;Z=Z||"";let $=Z?Object.freeze({}):aY1;if(A)Object.defineProperty(D,F,{enumerable:!0,configurable:!0,get:function(){let G=this;if(!this.$__.getters)this.$__.getters={};if(!this.$__.getters[X]){let Y=Object.create(O8.prototype,nY1(this));if(!Z)Y.$__[AJ]=this;Y.$__.nestedPath=X,Object.defineProperty(Y,"schema",{enumerable:!1,configurable:!0,writable:!1,value:D.schema}),Object.defineProperty(Y,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:D.schema}),Object.defineProperty(Y,dY1,{enumerable:!1,configurable:!0,writable:!1,value:D.schema}),Object.defineProperty(Y,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return mY1(G.get(X,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(Y,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return G.get(X,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null})}}),Object.defineProperty(Y,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return G.get(X,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toJSON&&this.schema.options.toJSON.virtuals||null})}}),Object.defineProperty(Y,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(Y,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Object.keys(this.get(X,null,iY1)||{}).length===0}}),Object.defineProperty(Y,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),Ox(A,Y,X,J),this.$__.getters[X]=Y}return this.$__.getters[X]},set:function(G){if(G!=null&&G.$__isNested)G=G.$__get();else if(G instanceof O8&&!G.$__isNested)G=G.$toObject(cY1);(this.$__[AJ]||this).$set(X,G)}});else Object.defineProperty(D,F,{enumerable:!0,configurable:!0,get:function(){return this[pY1].call(this.$__[AJ]||this,X,null,$)},set:function(G){this.$set.call(this.$__[AJ]||this,X,G)}})}function nY1(F){let A={};return Object.getOwnPropertyNames(F).forEach(function(D){if(["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(D)===-1)return;A[D]=Object.getOwnPropertyDescriptor(F,D),A[D].enumerable=!1}),A}});var ux=E((sj1,_x)=>{_x.exports=function F(A){if(A==null)return null;return Object.keys(A)[0]}});var S8=E((AG1)=>{/*!
167
+ * Module dependencies.
168
+ */var oY1=B3().Binary,xx=D2(),gx=fF(),eY1=a2(),FG1=i("node:util");AG1.flatten=fx;AG1.modifiedPaths=yx;/*!
169
+ * ignore
170
+ */function fx(F,A,D,Z){let J;if(F&&gx(F)&&!Buffer.isBuffer(F))J=Object.keys(F.toObject({transform:!1,virtuals:!1})||{});else J=Object.keys(F||{});let X=J.length,$={};A=A?A+".":"";for(let G=0;G<X;++G){let Y=J[G],B=F[Y];$[A+Y]=B;let H=Z&&Z.path&&Z.path(A+Y),q=Z&&Z.nested&&Z.nested[A+Y];if(H&&H.instance==="Mixed")continue;if(bx(B)){if(D&&D.skipArrays&&Array.isArray(B))continue;let W=fx(B,A+Y,D,Z);for(let C in W)$[C]=W[C];if(Array.isArray(B))$[A+Y]=B}if(q){let W=Object.keys(Z.paths);for(let C of W)if(C.startsWith(A+Y+".")&&!$.hasOwnProperty(C))$[C]=void 0}}return $}/*!
171
+ * ignore
172
+ */function yx(F,A,D,Z=null){if(F==null||typeof F!=="object")return;if(Z==null)Z={raw:{update:F,path:A},trace:new WeakSet};if(Z.trace.has(F))throw new eY1(`a circular reference in the update value, updateValue:
173
+ ${FG1.inspect(Z.raw.update,{showHidden:!1,depth:1})}
174
+ updatePath: '${Z.raw.path}'`);Z.trace.add(F);let J=Object.keys(F||{}),X=J.length;D=D||{},A=A?A+".":"";for(let $=0;$<X;++$){let G=J[$],Y=F[G],B=A+G;if(D[B]=!0,!Buffer.isBuffer(Y)&&gx(Y))Y=Y.toObject({transform:!1,virtuals:!1});if(bx(Y))yx(Y,A+G,D,Z)}return Z.trace.delete(F),D}/*!
175
+ * ignore
176
+ */function bx(F){return F&&typeof F==="object"&&!(F instanceof Date)&&!xx(F,"ObjectId")&&(!Array.isArray(F)||F.length!==0)&&!(F instanceof Buffer)&&!xx(F,"Decimal128")&&!(F instanceof oY1)}});var L0=E((tj1,hx)=>{hx.exports=function F(A,D,Z){let J,X=!1;if(typeof D==="string"){if(D.indexOf(".")===-1){let Y=PW(A,D);if(Y==null)return Z;return Y}J=D.split(".")}else if(X=!0,J=D,J.length===1){let Y=PW(A,J[0]);if(Y==null)return Z;return Y}let $=D,G=A;for(let Y of J){if(G==null)return Z;if(!X&&G[$]!=null)return G[$];if(G=PW(G,Y),!X)$=$.substr(Y.length+1)}return G==null?Z:G};function PW(F,A){if(F==null)return F;if(F instanceof Map)return F.get(A);return F[A]}});var IW=E((oj1,mx)=>{var vx=D2();mx.exports=function F(A,D){if(typeof A==="string"&&typeof D==="string")return A===D;if(typeof A==="number"&&typeof D==="number")return A===D;if(vx(A,"ObjectId")&&vx(D,"ObjectId"))return A.toString()===D.toString();return!1}});var ZJ=E((ej1,dx)=>{var JG1=IW();dx.exports=function F(A,D){if(A==null||A.discriminators==null)return null;for(let Z of Object.keys(A.discriminators)){let J=A.discriminators[Z];if(J.discriminatorMapping==null)continue;if(JG1(J.discriminatorMapping.value,D))return J}return null}});var lx=E((FT1,cx)=>{var XG1=L0(),$G1=ZJ();cx.exports=function F(A,D,Z){Z=Z||{};let J=Z.typeOnly,X=Array.isArray(D)?D:D.indexOf(".")===-1?[D]:D.split("."),$=null,G="adhocOrUndefined",Y=$G1(A.schema,A.get(A.schema.options.discriminatorKey))||A.schema;for(let B=0;B<X.length;++B){let H=X.slice(0,B+1).join(".");if($=Y.path(H),$==null){G="adhocOrUndefined";continue}if($.instance==="Mixed")return J?"real":$;if(G=Y.pathType(H),($.$isSingleNested||$.$isMongooseDocumentArrayElement)&&$.schema.discriminators!=null){let q=$.schema.discriminators,W=A.get(H+"."+XG1($,"schema.options.discriminatorKey"));if(W==null||q[W]==null)continue;let C=X.slice(B+1).join(".");return F(A.get(H),C,Z)}}return J?G:$}});var ix=E((AT1,px)=>{var YG1=L0();px.exports=function F(A,D,Z){let J=Z!=null?Object.keys(YG1(A.tree,Z,{})):Object.keys(A.tree),X=new Set(Object.keys(D)),$;if(X.size>1){$=new Set;for(let G of J)if(X.has(G))$.add(G);for(let G of X)if(!$.has(G))$.add(G);$=Array.from($)}else $=Array.from(X);return $}});var nx=E((DT1,ax)=>{ax.exports=function F(A,D){if(D.length===1)return;let Z=D[0],J=void 0;for(let X=0;X<D.length-1;++X){let $=A.path(Z);if($&&$.schema)J=$.schema.options.strict,A=$.schema,Z=$.$isMongooseDocumentArray&&!isNaN(D[X+1])?"":D[X+1];else Z+=Z.length?"."+D[X+1]:D[X+1]}return J}});var JJ=E((ZT1,sx)=>{var GG1=q1(),BG1=new Set(["__index","__parentArray","_doc"]);sx.exports=function F(A,D){if(GG1.isPOJO(A)&&A.$__!=null&&A._doc!=null){if(D){let Z={};for(let J of Object.keys(A)){if(typeof J==="symbol")continue;if(J[0]==="$")continue;if(BG1.has(J))continue;Z[J]=A[J]}return{...A._doc,...Z}}return A._doc}return A}});var _8=E((JT1,rx)=>{/*!
177
+ * ignore
178
+ */rx.exports=function F(A){if(A==null)return!0;if(typeof A==="object")return!("$meta"in A)&&!("$slice"in A);return!0}});var u8=E((XT1,tx)=>{var HG1=_8(),qG1=R8();/*!
179
+ * ignore
180
+ */tx.exports=function F(A){if(A==null)return null;let D=Object.keys(A),Z=null;if(D.length===1&&D[0]==="_id")Z=!A._id;else for(let J=0;J<D.length;++J){let X=D[J];if(X!=="_id"&&HG1(A[X])){if(Z=qG1(A[X])?F(A[X])??Z:!A[X],Z!=null)break}}return Z}});var MW=E(($T1,ox)=>{var WG1=_8();ox.exports=function F(A,D){if(A==null)return!1;if(D==="_id")return A._id===0;let Z=Object.keys(A),J=null;for(let X of Z)if(WG1(A[X])){J=A[D]===1?"inclusive":"exclusive";break}if(J==="inclusive")return A[D]!==1;if(J==="exclusive")return A[D]===0;return!1}});var NW=E((YT1,ex)=>{var CG1=q1();ex.exports=function F(A,D){if(A._doc._id==null||D==null||D.length===0)return;let Z=String(A._doc._id);for(let J of D){if(J.isVirtual)continue;let $=J.path.split(".");for(let G=0;G<$.length-1;++G){let Y=$.slice(0,G+1).join("."),B=$.slice(G+1).join("."),H=A.get(Y);if(H==null)continue;if(CG1.isMongooseDocumentArray(H)){for(let q=0;q<H.length;++q)if(H[q])H[q].populated(B,J._docs[Z]==null?void 0:J._docs[Z][q],J);break}}}}});var jW=E((GT1,Ag)=>{var{isPOJO:QG1}=q1();Ag.exports=Fg;function Fg(F){let A=Object.keys(F),D=A.length,Z,J,X;while(D--){if(J=A[D],X=F[J],QG1(X))F[J]=Fg(X);if(F[J]===void 0){delete F[J];continue}Z=!0}return Z?F:void 0}});var TW=E((BT1,Dg)=>{var KG1=/\./g;Dg.exports=function F(A){if(A.indexOf(".")===-1)return[A];let D=A.split(KG1),Z=D.length,J=new Array(Z),X="";for(let $=0;$<Z;++$)X+=X.length!==0?"."+D[$]:D[$],J[$]=X;return J}});var Jg=E((HT1,Zg)=>{Zg.exports=function F(A,D,Z,J,X){let $=Object.keys(A).reduce((Y,B)=>Y||B.startsWith(D+"."),!1),G=D+"."+Z.options.discriminatorKey;if(!$&&X.length===1&&X[0]===G)J.splice(J.indexOf(G),1)}});var d6=E((qT1,Xg)=>{var EG1=IW();Xg.exports=function F(A,D){if(A==null)return null;for(let Z of Object.keys(A)){let J=A[Z];if(J.schema&&J.schema.discriminatorMapping&&EG1(J.schema.discriminatorMapping.value,D))return J}return null}});var XJ=E((WT1,$g)=>{/*!
181
+ * ignore
182
+ */$g.exports=function F(A,D){let Z=D.split("."),J="",X,$,G;for(let Y=0;Y<Z.length;++Y)if(J+=J.length?".":""+Z[Y],A[J]){$=Object.keys(A),G=$.length;for(X=0;X<G;++X)if($[Y].indexOf(J+".")===0&&$[Y].indexOf(D)!==0)continue;return!0}return!1}});var cF=E((PG1)=>{/*!
183
+ * Module dependencies
184
+ */var Yg=EW(),UG1=Jg(),Gg=L0(),zG1=d6(),VG1=_8(),LG1=K0(),RG1=XJ();PG1.preparePopulationOptionsMQ=function F(A,D){let Z=A._mongooseOptions.populate,J=Object.keys(Z).reduce((G,Y)=>G.concat([Z[Y]]),[]);if(D.lean!=null)J.filter((G)=>(G&&G.options&&G.options.lean)==null).forEach(wG1(D.lean));let X=A&&A.options&&A.options.session||null;if(X!=null)J.forEach((G)=>{if(G.options==null){G.options={session:X};return}if(!("session"in G.options))G.options.session=X});let $=A._fieldsForExec();for(let G=0;G<J.length;++G)if(J[G]instanceof Yg)J[G]=new Yg({...J[G],_queryProjection:$,_localModel:A.model});else J[G]._queryProjection=$,J[G]._localModel=A.model;return J};PG1.createModel=function F(A,D,Z,J,X){A.hooks.execPreSync("createModel",D);let $=A.schema?A.schema.discriminatorMapping:null,G=$&&$.isRoot?$.key:null,Y=D[G];if(G&&Y&&A.discriminators){let H=A.discriminators[Y]||zG1(A.discriminators,Y);if(H){let q=LG1(J);return PG1.applyPaths(q,H.schema),new H(void 0,q,!0)}}let B={skipId:!0,isNew:!1,willInit:!0};if(X!=null&&"defaults"in X)B.defaults=X.defaults;return new A(void 0,Z,B)};/*!
185
+ * ignore
186
+ */PG1.createModelAndInit=function F(A,D,Z,J,X,$,G){let Y=$?{populated:$}:void 0,B=PG1.createModel(A,D,Z,J,X);try{B.$init(D,Y,G)}catch(H){G(H,B)}};/*!
187
+ * ignore
188
+ */PG1.applyPaths=function F(A,D,Z){let J,X,$=new Set;if(A){X=Object.keys(A);let W=[];for(let C=0;C<X.length;++C){let Q=X[C];if(X[C][0]!=="-")continue;if(delete A[Q],Q==="-_id")A._id=0;else W.push(Q.slice(1))}X=Object.keys(A);for(let C=0;C<X.length;++C){if(X[C][0]==="+")continue;let Q=A[X[C]];if(!VG1(Q))continue;if(X[C]==="_id"&&X.length>1)continue;if(X[C]===D.options.discriminatorKey&&X.length>1&&Q!=null&&!Q)continue;J=!Q;break}for(let C of W){let Q=D.path(C);if(!Q||!Q.selected||J!==!1)A[C]=0,J=!0;else if(Q&&Q.selected&&J===!1)$.add(C)}}let G=[],Y=[],B=[];switch(H(D),J){case!0:for(let W of Y)A[W]=0;break;case!1:if(D&&D.paths._id&&D.paths._id.options&&D.paths._id.options.select===!1)A._id=0;for(let W of G){if($.has(W))continue;if(RG1(A,W))continue;A[W]=A[W]||1}break;case void 0:if(A==null)break;for(let W of Object.keys(A||{}))if(W.startsWith("+"))delete A[W];for(let W of Y){if(A[W]!=null)continue;A[W]=0}break}function H(W,C){if(C||(C=""),B.indexOf(W)!==-1)return[];B.push(W);let Q=[];return W.eachPath(function(K,U){if(C)K=C+"."+K;if(U.$isSchemaMap||K.endsWith(".$*")){let L="+"+K,V=A&&L in A;if(U.options&&U.options.select===!1&&!V)Y.push(K);return}let z=q(K,U);if(z==null&&!Array.isArray(U)&&U.$isMongooseArray&&!U.$isMongooseDocumentArray)z=q(K,U.caster);if(z!=null)Q.push(z);if(U.schema){let L=H(U.schema,K);if(J===!1)UG1(A,K,U.schema,G,L)}}),B.pop(),Q}function q(W,C){if(A==null)return;if(typeof C.selected!=="boolean")return;if(C.selected===!1&&A[W]){if(Z)A[W]=0;return}if(!J&&C.selected&&W===D.options.discriminatorKey&&A[W]!=null&&!A[W]){delete A[W];return}if(J===!1&&C.selected&&A[W]!=null&&!A[W]){delete A[W];return}let Q="+"+W;if(A&&Q in A){if(delete A[Q],J===!1&&X.length>1&&!~X.indexOf(W)&&!Z)A[W]=1;else if(J==null&&Z&&C.selected===!1)A[W]=0;return}let U=W.split("."),z="";for(let L=0;L<U.length;++L)if(z+=z.length?"."+U[L]:U[L],Y.indexOf(z)!==-1)return;if(!J&&(C&&C.options&&C.options.$skipDiscriminatorCheck||!1)){let L="";for(let V=0;V<U.length;++V){L+=(L.length===0?"":".")+U[V];let P=Gg(A,L,!1)||Gg(A,L+".$",!1);if(P&&typeof P!=="object")return}}return(C.selected?G:Y).push(W),W}};function wG1(F){return function(A){if(A.options||(A.options={}),F!=null&&Array.isArray(F.virtuals))F=Object.assign({},F),F.virtuals=F.virtuals.filter((D)=>typeof D==="string"&&D.startsWith(A.path+".")).map((D)=>D.slice(A.path.length+1));A.options.lean=F}}});var kW=E((QT1,Hg)=>{function jG1(F){return!!F&&(typeof F==="object"||typeof F==="function")&&typeof F.then==="function"}Hg.exports=jG1});var Wg=E((KT1,qg)=>{qg.exports=function F(A,D,Z){let J=D[0],X=Z,$=A;for(let G=0;G<D.length-1;++G){let Y=X.path(J);if(Y&&Y.schema){let B=$.get(J);if(X=Y.schema,J=D[G+1],Array.isArray(B)&&!isNaN(J))B=B[J],J="";if(B==null)break;$=B}else J+=J.length?"."+D[G+1]:D[G+1]}return $}});var $J=E((ET1,Qg)=>{var a4=r2(),TG1=g6(),kG1=H3().internalToObjectOptions,Cg=i("node:util"),OG1=q1();Qg.exports=s1;function s1(F,A,D,Z,J){if(typeof Z==="object"&&Z!=null&&J==null)J=Z,Z=void 0;if(D!=null){let X={isNew:D.isNew};if("defaults"in D.$__)X.defaults=D.$__.defaults;J=Object.assign(X,J)}if(J!=null&&J.path!=null)this.$basePath=J.path;a4.call(this,F,A,Z,J),delete this.$__.priorDoc}s1.prototype=Object.create(a4.prototype);Object.defineProperty(s1.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0});Object.defineProperty(s1.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0});/*!
189
+ * ignore
190
+ */s1.prototype.toBSON=function(){return this.toObject(kG1)};s1.prototype.save=async function F(A){if(A=A||{},!A.suppressWarning)OG1.warn("mongoose: calling `save()` on a subdoc does **not** save the document to MongoDB, it only runs save middleware. Use `subdoc.save({ suppressWarning: true })` to hide this warning if you're sure this behavior is right for your app.");return new Promise((D,Z)=>{this.$__save((J)=>{if(J!=null)return Z(J);D(this)})})};s1.prototype.$__fullPath=function(F){if(!this.$__.fullPath)this.ownerDocument();return F?this.$__.fullPath+"."+F:this.$__.fullPath};s1.prototype.$__pathRelativeToParent=function(F){if(F==null)return this.$basePath;return[this.$basePath,F].join(".")};s1.prototype.$__save=function(F){return TG1(()=>F(null,this))};/*!
191
+ * ignore
192
+ */s1.prototype.$isValid=function(F){let A=this.$parent(),D=this.$__pathRelativeToParent(F);if(A!=null&&D!=null)return A.$isValid(D);return a4.prototype.$isValid.call(this,F)};/*!
193
+ * ignore
194
+ */s1.prototype.markModified=function(F){a4.prototype.markModified.call(this,F);let A=this.$parent(),D=this.$__pathRelativeToParent(F);if(A==null||D==null)return;let Z=this.$__pathRelativeToParent().replace(/\.$/,"");if(A.isDirectModified(Z)||this.isNew)return;this.$__parent.markModified(D,this)};/*!
195
+ * ignore
196
+ */s1.prototype.isModified=function(F,A,D){let Z=this.$parent();if(Z!=null){if(Array.isArray(F)||typeof F==="string")F=Array.isArray(F)?F:F.split(" "),F=F.map((J)=>this.$__pathRelativeToParent(J)).filter((J)=>J!=null);else if(!F)F=this.$__pathRelativeToParent();return Z.$isModified(F,A,D)}return a4.prototype.isModified.call(this,F,A,D)};s1.prototype.$markValid=function(F){a4.prototype.$markValid.call(this,F);let A=this.$parent(),D=this.$__pathRelativeToParent(F);if(A!=null&&D!=null)A.$markValid(D)};/*!
197
+ * ignore
198
+ */s1.prototype.invalidate=function(F,A,D){a4.prototype.invalidate.call(this,F,A,D);let Z=this.$parent(),J=this.$__pathRelativeToParent(F);if(Z!=null&&J!=null)Z.invalidate(J,A,D);else if(A.kind==="cast"||A.name==="CastError"||J==null)throw A;return this.ownerDocument().$__.validationError};/*!
199
+ * ignore
200
+ */s1.prototype.$ignore=function(F){a4.prototype.$ignore.call(this,F);let A=this.$parent(),D=this.$__pathRelativeToParent(F);if(A!=null&&D!=null)A.$ignore(D)};s1.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;let F=this,A=[],D=new Set([F]);while(!0){if(typeof F.$__pathRelativeToParent!=="function")break;A.unshift(F.$__pathRelativeToParent(void 0,!0));let Z=F.$parent();if(Z==null)break;if(F=Z,D.has(F))throw new Error("Infinite subdocument loop: subdoc with _id "+F._id+" is a parent of itself");D.add(F)}return this.$__.fullPath=A.join("."),this.$__.ownerDocument=F,this.$__.ownerDocument};/*!
201
+ * ignore
202
+ */s1.prototype.$__fullPathWithIndexes=function(){let F=this,A=[],D=new Set([F]);while(!0){if(typeof F.$__pathRelativeToParent!=="function")break;A.unshift(F.$__pathRelativeToParent(void 0,!1));let Z=F.$parent();if(Z==null)break;if(F=Z,D.has(F))throw new Error("Infinite subdocument loop: subdoc with _id "+F._id+" is a parent of itself");D.add(F)}return A.join(".")};s1.prototype.parent=function(){return this.$__parent};s1.prototype.$parent=s1.prototype.parent;s1.prototype.$__deleteOne=function(F){if(F==null)return;return F(null,this)};s1.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)};s1.prototype.deleteOne=function(F,A){if(typeof F==="function")A=F,F=null;if(SG1(this),!F||!F.noop){this.$__removeFromParent();let D=this.ownerDocument();D.$__.removedSubdocs=D.$__.removedSubdocs||[],D.$__.removedSubdocs.push(this)}return this.$__deleteOne(A)};/*!
203
+ * ignore
204
+ */s1.prototype.populate=function(){throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')};s1.prototype.inspect=function(){return this.toObject()};if(Cg.inspect.custom)s1.prototype[Cg.inspect.custom]=s1.prototype.inspect;function SG1(F){let A=F.ownerDocument();function D(){A.$removeListener("save",D),A.$removeListener("deleteOne",D),F.emit("deleteOne",F),F.constructor.emit("deleteOne",F)}A.$on("save",D),A.$on("deleteOne",D)}});var x8=E((UT1,Ug)=>{/*!
205
+ * Module dependencies.
206
+ */var Kg=i("node:events").EventEmitter,Eg=$J(),_G1=q1(),lF=A1().documentArrayParent;function t2(F,A,D,Z,J){if(_G1.isMongooseDocumentArray(A))this.__parentArray=A,this[lF]=A.$parent();else this.__parentArray=void 0,this[lF]=void 0;this.$setIndex(J),this.$__parent=this[lF];let X;if(typeof D==="object"&&D!=null)X={isNew:!0,...D},D=void 0;else X={isNew:!0};Eg.call(this,F,Z,this[lF],D,X)}/*!
207
+ * Inherit from Subdocument
208
+ */t2.prototype=Object.create(Eg.prototype);t2.prototype.constructor=t2;Object.defineProperty(t2.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1});Object.defineProperty(t2.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0});for(let F in Kg.prototype)t2[F]=Kg.prototype[F];/*!
209
+ * ignore
210
+ */t2.prototype.$setIndex=function(F){if(this.__index=F,this.$__!=null&&this.$__.validationError!=null){let A=Object.keys(this.$__.validationError.errors);for(let D of A)this.invalidate(D,this.$__.validationError.errors[D])}};/*!
211
+ * ignore
212
+ */t2.prototype.populate=function(){throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`')};/*!
213
+ * ignore
214
+ */t2.prototype.$__removeFromParent=function(){let F=this._doc._id;if(!F)throw new Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:F})};t2.prototype.$__fullPath=function(F,A){if(this.__index==null)return null;if(!this.$__.fullPath)this.ownerDocument();if(A)return F?this.$__.fullPath+"."+F:this.$__.fullPath;return F?this.$__.fullPath+"."+this.__index+"."+F:this.$__.fullPath+"."+this.__index};t2.prototype.$__pathRelativeToParent=function(F,A){if(this.__index==null||(!this.__parentArray||!this.__parentArray.$path))return null;if(A)return F==null?this.__parentArray.$path():this.__parentArray.$path()+"."+F;if(F==null)return this.__parentArray.$path()+"."+this.__index;return this.__parentArray.$path()+"."+this.__index+"."+F};t2.prototype.$parent=function(){return this[lF]};t2.prototype.parentArray=function(){return this.__parentArray};/*!
215
+ * Module exports.
216
+ */Ug.exports=t2});var BJ=E((zT1,Mg)=>{var _W=r2(),OW=x8(),uG1=w1(),zg=FJ(),xG1=K0(),Vg=H3().internalToObjectOptions,wg=z6(),V2=q1(),SW=D2(),A4=A1().arrayAtomicsSymbol,D4=A1().arrayParentSymbol,Z4=A1().arrayPathSymbol,o2=A1().arraySchemaSymbol,Pg=A1().populateModelSymbol,gG1=Symbol("mongoose#Array#sliced"),Lg=Array.prototype.push;/*!
217
+ * ignore
218
+ */var GJ={$__getAtomics(){let F=[],A=Object.keys(this[A4]||{}),D=A.length,Z=Object.assign({},Vg,{_isNested:!0});if(D===0)return F[0]=["$set",this.toObject(Z)],F;while(D--){let J=A[D],X=this[A4][J];if(V2.isMongooseObject(X))X=X.toObject(Z);else if(Array.isArray(X))X=this.toObject.call(X,Z);else if(X!=null&&Array.isArray(X.$each))X.$each=this.toObject.call(X.$each,Z);else if(X!=null&&typeof X.valueOf==="function")X=X.valueOf();if(J==="$addToSet")X={$each:X};F.push([J,X])}return F},$atomics(){/*!
219
+ * ignore
220
+ */return this[A4]},$parent(){/*!
221
+ * ignore
222
+ */return this[D4]},$path(){/*!
223
+ * ignore
224
+ */return this[Z4]},$shift(){this._registerAtomic("$pop",-1),this._markModified();let F=this.__array;if(F._shifted)return;return F._shifted=!0,[].shift.call(F)},$pop(){if(this._registerAtomic("$pop",1),this._markModified(),this._popped)return;return this._popped=!0,[].pop.call(this)},$schema(){/*!
225
+ * ignore
226
+ */return this[o2]},_cast(F){let A=!1,D,Z=this[D4];if(Z)A=Z.$populated(this[Z4],!0);if(A&&F!==null&&F!==void 0){if(D=A.options[Pg],D==null)throw new uG1("No populated model found for path `"+this[Z4]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");if(Buffer.isBuffer(F)||SW(F,"ObjectId")||!V2.isObject(F))F={_id:F};if(!(F.schema&&F.schema.discriminatorMapping&&F.schema.discriminatorMapping.key!==void 0))F=new D(F);return this[o2].caster.applySetters(F,Z,!0)}return this[o2].caster.applySetters(F,Z,!1)},_mapCast(F,A){return this._cast(F,this.length+A)},_markModified(F){let A=this[D4],D;if(A){if(D=this[Z4],arguments.length)D=D+"."+F;if(D!=null&&D.endsWith(".$"))return this;A.markModified(D,arguments.length!==0?F:A)}return this},_registerAtomic(F,A){if(this[gG1])return;if(F==="$set")return this[A4]={$set:A},zg(this[D4],this[Z4]),this._markModified(),this;let D=this[A4];if(F==="$pop"&&!("$pop"in D)){let J=this;this[D4].once("save",function(){J._popped=J._shifted=null})}if(D.$set||Object.keys(D).length&&!(F in D))return this[A4]={$set:this},this;let Z;if(F==="$pullAll"||F==="$addToSet")D[F]||(D[F]=[]),D[F]=D[F].concat(A);else if(F==="$pullDocs"){let J=D.$pull||(D.$pull={});if(A[0]instanceof OW)Z=J.$or||(J.$or=[]),Array.prototype.push.apply(Z,A.map((X)=>{return X.toObject({transform:($,G)=>{if(X==null||X.$__==null)return G;return Object.keys(X.$__.activePaths.getStatePaths("default")).forEach((Y)=>{wg.unset(Y,G),Ig(G,Y)}),G},virtuals:!1})}));else Z=J._id||(J._id={$in:[]}),Z.$in=Z.$in.concat(A)}else if(F==="$push")if(D.$push=D.$push||{$each:[]},A!=null&&V2.hasUserDefinedProperty(A,"$each"))D.$push=A;else if(A.length===1)D.$push.$each.push(A[0]);else if(A.length<1e4)D.$push.$each.push(...A);else for(let J of A)D.$push.$each.push(J);else D[F]=A;return this},addToSet(){YJ(this,arguments),Rg(this,arguments);let F=[].map.call(arguments,this._mapCast,this),A=[],D="";if(F[0]instanceof OW)D="doc";else if(F[0]instanceof Date)D="date";else if(SW(F[0],"ObjectId"))D="ObjectId";let Z=V2.isMongooseArray(F)?F.__array:F,J=V2.isMongooseArray(this)?this.__array:this;return Z.forEach(function(X){let $,G=+X;switch(D){case"doc":$=this.some(function(Y){return Y.equals(X)});break;case"date":$=this.some(function(Y){return+Y===G});break;case"ObjectId":$=this.find((Y)=>Y.toString()===X.toString());break;default:$=~this.indexOf(X);break}if(!$)this._markModified(),J.push(X),this._registerAtomic("$addToSet",X),[].push.call(A,X)},this),A},hasAtomics(){if(!V2.isPOJO(this[A4]))return 0;return Object.keys(this[A4]).length},includes(F,A){return this.indexOf(F,A)!==-1},indexOf(F,A){if(SW(F,"ObjectId"))F=F.toString();A=A==null?0:A;let D=this.length;for(let Z=A;Z<D;++Z)if(F==this[Z])return Z;return-1},inspect(){return JSON.stringify(this)},nonAtomicPush(){let F=[].map.call(arguments,this._mapCast,this);this._markModified();let A=[].push.apply(this,F);return this._registerAtomic("$set",this),A},pop(){this._markModified();let F=[].pop.call(this);return this._registerAtomic("$set",this),F},pull(){let F=[].map.call(arguments,(J,X)=>this._cast(J,X,{defaults:!1}),this),A=this[D4].get(this[Z4]);if(V2.isMongooseArray(A))A=A.__array;let D=A.length,Z;this._markModified();while(D--)if(Z=A[D],Z instanceof _W){if(F.some(function(X){return Z.equals(X)}))A.splice(D,1)}else if(~this.indexOf.call(F,Z))A.splice(D,1);if(F[0]instanceof OW)this._registerAtomic("$pullDocs",F.map(function(J){let X=J.$__getValue("_id");if(X===void 0||J.$isDefault("_id"))return J;return X}));else this._registerAtomic("$pullAll",F);if(zg(this[D4],this[Z4])>0)this._registerAtomic("$set",this);return this},push(){let F=arguments,A=F,D=F[0]!=null&&V2.hasUserDefinedProperty(F[0],"$each"),Z=V2.isMongooseArray(this)?this.__array:this;if(D)A=F[0],F=F[0].$each;if(this[o2]==null)return Lg.apply(this,F);YJ(this,F),Rg(this,F),F=[].map.call(F,this._mapCast,this);let J,X=this[A4];if(this._markModified(),D)if(A.$each=F,(X.$push&&X.$push.$each&&X.$push.$each.length||0)!==0&&X.$push.$position!=A.$position){if(A.$position!=null)[].splice.apply(Z,[A.$position,0].concat(F)),J=Z.length;else J=[].push.apply(Z,F);this._registerAtomic("$set",this)}else if(A.$position!=null)[].splice.apply(Z,[A.$position,0].concat(F)),J=this.length;else J=[].push.apply(Z,F);else A=F,J=Lg.apply(Z,F);return this._registerAtomic("$push",A),J},remove(){return this.pull.apply(this,arguments)},set(F,A,D){let Z=this.__array;if(D)return Z[F]=A,this;let J=GJ._cast.call(this,A,F);return GJ._markModified.call(this,F),Z[F]=J,this},shift(){let F=V2.isMongooseArray(this)?this.__array:this;this._markModified();let A=[].shift.call(F);return this._registerAtomic("$set",this),A},sort(){let F=V2.isMongooseArray(this)?this.__array:this,A=[].sort.apply(F,arguments);return this._registerAtomic("$set",this),A},splice(){let F,A=V2.isMongooseArray(this)?this.__array:this;if(this._markModified(),YJ(this,Array.prototype.slice.call(arguments,2)),arguments.length){let D;if(this[o2]==null)D=arguments;else{D=[];for(let Z=0;Z<arguments.length;++Z)D[Z]=Z<2?arguments[Z]:this._cast(arguments[Z],arguments[0]+(Z-2))}F=[].splice.apply(A,D),this._registerAtomic("$set",this)}return F},toBSON(){/*!
227
+ * ignore
228
+ */return this.toObject(Vg)},toObject(F){let A=V2.isMongooseArray(this)?this.__array:this;if(F&&F.depopulate)return F=xG1(F),F._isNested=!0,[].concat(A).map(function(D){return D instanceof _W?D.toObject(F):D});return[].concat(A)},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift(){YJ(this,arguments);let F;if(this[o2]==null)F=arguments;else F=[].map.call(arguments,this._cast,this);let A=V2.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(A,F),this._registerAtomic("$set",this),this.length}};/*!
229
+ * ignore
230
+ */function fG1(F,A){if(!A)return!1;for(let D of F){if(D==null)return!1;let Z=D.constructor;if(!(D instanceof _W)||Z.modelName!==A&&Z.baseModelName!==A)return!1}return!0}/*!
231
+ * Minimize _just_ empty objects along the path chain specified
232
+ * by `parts`, ignoring all other paths. Useful in cases where
233
+ * you want to minimize after unsetting a path.
234
+ *
235
+ * #### Example:
236
+ *
237
+ * const obj = { foo: { bar: { baz: {} } }, a: {} };
238
+ * _minimizePath(obj, 'foo.bar.baz');
239
+ * obj; // { a: {} }
240
+ */function Ig(F,A,D){if(typeof A==="string"){if(A.indexOf(".")===-1)return;A=wg.stringToParts(A)}if(D=D||0,D>=A.length)return;if(F==null||typeof F!=="object")return;if(Ig(F[A[0]],A,D+1),F[A[0]]!=null&&typeof F[A[0]]==="object"&&Object.keys(F[A[0]]).length===0)delete F[A[0]]}/*!
241
+ * ignore
242
+ */function YJ(F,A){let D=F==null?null:F[o2]&&F[o2].caster&&F[o2].caster.options&&F[o2].caster.options.ref||null;if(F.length===0&&A.length!==0){if(fG1(A,D))F[D4].$populated(F[Z4],[],{[Pg]:A[0].constructor})}}/*!
243
+ * If `docs` isn't all instances of the right model, depopulate `arr`
244
+ */function Rg(F,A){let D=F==null?null:F[o2]&&F[o2].caster&&F[o2].caster.options&&F[o2].caster.options.ref||null,Z=F[D4],J=F[Z4];if(!D||!Z.populated(J))return;for(let X of A){if(X==null)continue;if(typeof X!=="object"||X instanceof String||X instanceof Number||X instanceof Buffer||V2.isMongooseType(X)){Z.depopulate(J);break}}}var yG1=["filter","flat","flatMap","map","slice"];for(let F of yG1){if(Array.prototype[F]==null)continue;GJ[F]=function(){let A=V2.isMongooseArray(this)?this.__array:this,D=[].concat(A);return D[F].apply(D,arguments)}}Mg.exports=GJ});var xW=E((Og,Sg)=>{/*!
245
+ * Module dependencies.
246
+ */var bG1=r2(),uW=BJ(),HJ=A1().arrayAtomicsSymbol,hG1=A1().arrayAtomicsBackupSymbol,Ng=A1().arrayParentSymbol,vG1=A1().arrayPathSymbol,jg=A1().arraySchemaSymbol,Tg=Array.prototype.push,kg=/^\d+$/;function mG1(F,A,D,Z){let J;if(Array.isArray(F)){let G=F.length;if(G===0)J=new Array;else if(G===1)J=new Array(1),J[0]=F[0];else if(G<1e4)J=new Array,Tg.apply(J,F);else{J=new Array;for(let Y=0;Y<G;++Y)Tg.call(J,F[Y])}}else J=[];let X={[HJ]:{},[hG1]:void 0,[vG1]:A,[jg]:Z,[Ng]:void 0,isMongooseArray:!0,isMongooseArrayProxy:!0,__array:J};if(F&&F[HJ]!=null)X[HJ]=F[HJ];if(D!=null&&D instanceof bG1)X[Ng]=D,X[jg]=Z||D.schema.path(A);let $=new Proxy(J,{get:function(G,Y){if(X.hasOwnProperty(Y))return X[Y];if(uW.hasOwnProperty(Y))return uW[Y];if(Z&&Z.virtuals&&Z.virtuals.hasOwnProperty(Y))return Z.virtuals[Y].applyGetters(void 0,G);if(typeof Y==="string"&&kg.test(Y)&&Z?.$embeddedSchemaType!=null)return Z.$embeddedSchemaType.applyGetters(J[Y],D);return J[Y]},set:function(G,Y,B){if(typeof Y==="string"&&kg.test(Y))uW.set.call($,Y,B,!1);else if(X.hasOwnProperty(Y))X[Y]=B;else if(Z&&Z.virtuals&&Z.virtuals.hasOwnProperty(Y))Z.virtuals[Y].applySetters(B,G);else J[Y]=B;return!0}});return $}/*!
247
+ * Module exports.
248
+ */Sg.exports=Og=mG1});var fW=E((VT1,ug)=>{var _g=D2(),gW=F4();ug.exports=function F(A){if(A==null)return A;if(_g(A,"ObjectId"))return A;if(A._id){if(_g(A._id,"ObjectId"))return A._id;if(A._id.toString instanceof Function)return new gW(A._id.toString())}if(A.toString instanceof Function)return new gW(A.toString());return new gW(A)}});var yg=E((LT1,fg)=>{var qJ=BJ(),dG1=r2(),cG1=fW(),xg=d6(),lG1=H3().internalToObjectOptions,WJ=q1(),yW=D2(),QJ=A1().arrayParentSymbol,hW=A1().arrayPathSymbol,bW=A1().arraySchemaSymbol,gg=A1().documentArrayParent,pG1=Array.prototype.toString,vW={toBSON(){/*!
249
+ * ignore
250
+ */return this.toObject(lG1)},toString(){return pG1.call(this.__array.map((F)=>{if(F!=null&&F.$__!=null)return F.toString();return F}))},getArrayParent(){/*!
251
+ * ignore
252
+ */return this[QJ]},_cast(F,A,D){if(this[bW]==null)return F;let Z=this[bW].casterConstructor;if((Z.$isMongooseDocumentArray?WJ.isMongooseDocumentArray(F):F instanceof Z)||F&&F.constructor&&F.constructor.baseCasterConstructor===Z){if(!(F[gg]&&F.__parentArray))F[gg]=this[QJ],F.__parentArray=this;return F.$setIndex(A),F}if(F===void 0||F===null)return null;if(Buffer.isBuffer(F)||yW(F,"ObjectId")||!WJ.isObject(F))F={_id:F};if(F&&Z.discriminators&&Z.schema&&Z.schema.options&&Z.schema.options.discriminatorKey)if(typeof F[Z.schema.options.discriminatorKey]==="string"&&Z.discriminators[F[Z.schema.options.discriminatorKey]])Z=Z.discriminators[F[Z.schema.options.discriminatorKey]];else{let $=xg(Z.discriminators,F[Z.schema.options.discriminatorKey]);if($)Z=$}if(Z.$isMongooseDocumentArray)return Z.cast(F,this,void 0,void 0,A);let X=new Z(F,this,D,void 0,A);return X.isNew=!0,X},id(F){let A,D,Z;try{A=cG1(F).toString()}catch(J){A=null}for(let J of this){if(!J)continue;if(Z=J.get("_id"),Z===null||typeof Z==="undefined")continue;else if(Z instanceof dG1){if(D||(D=String(F)),D==Z._id)return J}else if(!yW(F,"ObjectId")&&!yW(Z,"ObjectId")){if(F==Z||WJ.deepEqual(F,Z))return J}else if(A==Z)return J}return null},toObject(F){return[].concat(this.map(function(A){if(A==null)return null;if(typeof A.toObject!=="function")return A;return A.toObject(F)}))},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},push(){let F=qJ.push.apply(this,arguments);return CJ(this),F},pull(){let F=qJ.pull.apply(this,arguments);return CJ(this),F},shift(){let F=qJ.shift.apply(this,arguments);return CJ(this),F},splice(){let F=qJ.splice.apply(this,arguments);return CJ(this),F},inspect(){return this.toObject()},create(F){let A=this[bW].casterConstructor;if(F&&A.discriminators&&A.schema&&A.schema.options&&A.schema.options.discriminatorKey)if(typeof F[A.schema.options.discriminatorKey]==="string"&&A.discriminators[F[A.schema.options.discriminatorKey]])A=A.discriminators[F[A.schema.options.discriminatorKey]];else{let D=xg(A.discriminators,F[A.schema.options.discriminatorKey]);if(D)A=D}return new A(F,this)},notify(F){/*!
253
+ * ignore
254
+ */let A=this;return function D(Z,J){J=J||A;let X=J.length;while(X--){if(J[X]==null)continue;switch(F){case"save":Z=A[X];break;default:break}if(WJ.isMongooseArray(J[X]))D(Z,J[X]);else if(J[X])J[X].emit(F,Z)}}},set(F,A,D){let Z=this.__array;if(D)return Z[F]=A,this;let J=vW._cast.call(this,A,F);return vW._markModified.call(this,F),Z[F]=J,this},_markModified(F,A){let D=this[QJ],Z;if(D){if(Z=this[hW],arguments.length)if(A!=null){let J=F.__index;Z=Z+"."+J+"."+A}else Z=Z+"."+F;if(Z!=null&&Z.endsWith(".$"))return this;D.markModified(Z,arguments.length!==0?F:D)}return this}};fg.exports=vW;function CJ(F){let A=F[QJ];if(!A||A.$__.populated==null)return;let D=Object.keys(A.$__.populated).filter((Z)=>Z.startsWith(F[hW]+"."));for(let Z of D){let J=Z.slice((F[hW]+".").length);if(!Array.isArray(A.$__.populated[Z].value))continue;A.$__.populated[Z].value=F.map((X)=>X.$populated(J))}}});var n9=E((RT1,hg)=>{/*!
255
+ * Module dependencies.
256
+ */var bg=BJ(),mW=yg(),iG1=r2(),dW=A1().arrayAtomicsSymbol,aG1=A1().arrayAtomicsBackupSymbol,cW=A1().arrayParentSymbol,lW=A1().arrayPathSymbol,a9=A1().arraySchemaSymbol,nG1=Array.prototype.push,sG1=/^\d+$/;function rG1(F,A,D,Z){let J=[],X={[dW]:{},[aG1]:void 0,[lW]:A,[a9]:void 0,[cW]:void 0};if(Array.isArray(F)){if(F[lW]===A&&F[cW]===D)X[dW]=Object.assign({},F[dW]);F.forEach((G)=>{nG1.call(J,G)})}if(X[lW]=A,X.__array=J,D&&D instanceof iG1){X[cW]=D,X[a9]=D.$__schema.path(A);while(X[a9]!=null&&X[a9].$isMongooseArray&&!X[a9].$isMongooseDocumentArray)X[a9]=X[a9].casterConstructor}let $=new Proxy(J,{get:function(G,Y){if(Y==="isMongooseArray"||Y==="isMongooseArrayProxy"||Y==="isMongooseDocumentArray"||Y==="isMongooseDocumentArrayProxy")return!0;if(X.hasOwnProperty(Y))return X[Y];if(mW.hasOwnProperty(Y))return mW[Y];if(Z&&Z.virtuals&&Z.virtuals.hasOwnProperty(Y))return Z.virtuals[Y].applyGetters(void 0,G);if(bg.hasOwnProperty(Y))return bg[Y];return J[Y]},set:function(G,Y,B){if(typeof Y==="string"&&sG1.test(Y))mW.set.call($,Y,B,!1);else if(X.hasOwnProperty(Y))X[Y]=B;else if(Z&&Z.virtuals&&Z.virtuals.hasOwnProperty(Y))Z.virtuals[Y].applySetters(B,G);else J[Y]=B;return!0}});return $}/*!
257
+ * Module exports.
258
+ */hg.exports=rG1});var r2=E((Jf,Xf)=>{/*!
259
+ * Module dependencies.
260
+ */var tG1=HW(),aW=i("node:events").EventEmitter,oG1=Wx(),eG1=k8(),e2=a2(),vg=i9(),FB1=zx(),AB1=tZ(),DB1=oZ(),mg=wx(),ZB1=g8(),nW=i4(),zJ=c9(),sg=eq(),rg=RW(),sW=eZ(),pW=FJ(),C3=K0(),JB1=DJ().compile,XB1=DJ().defineKey,$B1=ux(),YB1=S8().flatten,iW=lx(),dg=ix(),GB1=nx(),BB1=JJ(),cg=g6(),lg=D2(),tg=_8(),HB1=u8(),pg=MW(),rW=i("node:util").inspect,og=H3().internalToObjectOptions,qB1=NW(),WB1=jW(),CB1=z6(),tW=TW(),QB1=cF(),K1=q1(),KB1=kW(),EJ=K1.deepEqual,EB1=K1.isMongooseObject,iF=A1().arrayAtomicsBackupSymbol,h2=A1().arrayAtomicsSymbol,UB1=A1().documentArrayParent,zB1=A1().documentIsModified,eg=A1().documentModifiedPaths,VB1=A1().documentSchemaSymbol,LB1=A1().getSymbol,RB1=A1().modelSymbol,ig=A1().populateModelSymbol,wB1=A1().scopeSymbol,PB1=p9().schemaMixedSymbol,IB1=Wg(),KJ=A1().sessionNewDocuments,UJ,ag,pF,Ff=K1.specialProperties;function m(F,A,D,Z){if(typeof D==="object"&&D!=null)Z=D,D=Z.skipId;if(Z=Object.assign({},Z),this.$__schema==null){let B=K1.isObject(A)&&!A.instanceOfSchema?new ZB1(A):A;this.$__setSchema(B),A=D,D=Z,Z=arguments[4]||{}}if(this.$__=new oG1,Z.isNew!=null&&Z.isNew!==!0)this.$isNew=Z.isNew;if(Z.priorDoc!=null)this.$__.priorDoc=Z.priorDoc;if(D)this.$__.skipId=D;if(F!=null&&typeof F!=="object")throw new DB1(F,"obj","Document");let J=!0;if(Z.defaults!==void 0)this.$__.defaults=Z.defaults,J=Z.defaults;let X=this.$__schema;if(typeof A==="boolean"||A==="throw"){if(A!==!0)this.$__.strictMode=A;A=void 0}else if(X.options.strict!==!0)this.$__.strictMode=X.options.strict;let $=X.requiredPaths(!0);for(let B of $)this.$__.activePaths.require(B);let G=null;if(K1.isPOJO(A)&&Object.keys(A).length>0)G=HB1(A),this.$__.selected=A,this.$__.exclude=G;let Y=G===!1&&A?rg(A):null;if(this._doc==null){if(this.$__buildDoc(F,A,D,G,Y,!1),J)sW(this,A,G,Y,!0,null,{skipParentChangeTracking:!0})}if(F){if(this.$__original_set)this.$__original_set(F,void 0,!0,Z);else this.$set(F,void 0,!0,Z);if(F instanceof m)this.$isNew=F.$isNew}if(Z.willInit&&J){if(Z.skipDefaults)this.$__.skipDefaults=Z.skipDefaults}else if(J)sW(this,A,G,Y,!1,Z.skipDefaults);if(!this.$__.strictMode&&F){let B=this;Object.keys(this._doc).forEach(function(q){if(!(q in X.tree)&&!(q in X.methods)&&!(q in X.virtuals)&&!q.startsWith("$"))XB1({prop:q,subprops:null,prototype:B})})}uB1(this)}m.prototype.$isMongooseDocumentPrototype=!0;Object.defineProperty(m.prototype,"isNew",{get:function(){return this.$isNew},set:function(F){this.$isNew=F}});Object.defineProperty(m.prototype,"errors",{get:function(){return this.$errors},set:function(F){this.$errors=F}});/*!
261
+ * ignore
262
+ */m.prototype.$isNew=!0;/*!
263
+ * Document exposes the NodeJS event emitter API, so you can use
264
+ * `on`, `once`, etc.
265
+ */K1.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(F){m.prototype[F]=function(){if(!this.$__.emitter){if(F==="emit")return;this.$__.emitter=new aW,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[F].apply(this.$__.emitter,arguments)},m.prototype[`$${F}`]=m.prototype[F]});m.prototype.constructor=m;for(let F in aW.prototype)m[F]=aW.prototype[F];m.prototype.$__schema;m.prototype.schema;Object.defineProperty(m.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){if(this.$__.locals==null)this.$__.locals={};return this.$__.locals},set:function(F){this.$__.locals=F}});m.prototype.isNew;Object.defineProperty(m.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0});m.prototype.id;m.prototype.$errors;Object.defineProperty(m.prototype,"$op",{get:function(){return this.$__.op||null},set:function(F){this.$__.op=F}});/*!
266
+ * ignore
267
+ */function MB1(F,A,D){if(F==null)return;let Z=Object.keys(D.$__schema.paths),J=Z.length,X=A.indexOf(".")===-1?[A]:A.split(".");for(let $=0;$<J;++$){let G="",Y=Z[$];if(!Y.startsWith(A+"."))continue;let B=D.$__schema.paths[Y],H=B.splitPath().slice(X.length),q=H.length;if(B.defaultValue===void 0)continue;let W=F;for(let C=0;C<q;++C){if(W==null)break;let Q=H[C];if(C===q-1){if(W[Q]!==void 0)break;try{let K=B.getDefault(D,!1);if(K!==void 0)W[Q]=K}catch(K){D.invalidate(A+"."+G,K);break}break}G+=(!G.length?"":".")+Q,W[Q]=W[Q]||{},W=W[Q]}}}m.prototype.$__buildDoc=function(F,A,D,Z,J){let X={},$=Object.keys(this.$__schema.paths).filter((B)=>!B.includes("$*")),G=$.length,Y=0;for(;Y<G;++Y){let B=$[Y];if(B==="_id"){if(D)continue;if(F&&"_id"in F)continue}let H=this.$__schema.paths[B].splitPath(),q=H.length,W=q-1,C="",Q=X,K=!1;for(let U=0;U<q;++U){let z=H[U];if(!C.length)C=z;else C+="."+z;if(Z===!0){if(C in A)break}else if(Z===!1&&A&&!K){if(C in A)K=!0;else if(!J[C])break}if(U<W)Q=Q[z]||(Q[z]={})}}this._doc=X};/*!
268
+ * Converts to POJO when you use the document for querying
269
+ */m.prototype.toBSON=function(){return this.toObject(og)};m.prototype.init=function(F,A,D){if(typeof A==="function")D=A,A=null;if(this.$__init(F,A),D)D(null,this);return this};m.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)};m.prototype.$__init=function(F,A){if(this.$isNew=!1,A=A||{},F._id!=null&&A.populated&&A.populated.length){let Z=String(F._id);for(let J of A.populated){if(J.isVirtual)this.$populated(J.path,K1.getValue(J.path,F),J);else this.$populated(J.path,J._docs[Z],J);if(J._childDocs==null)continue;for(let X of J._childDocs){if(X==null||X.$__==null)continue;X.$__.parent=this}J._childDocs=[]}}Af(this,F,this._doc,A),qB1(this,A.populated),this.$emit("init",this),this.constructor.emit("init",this);let D=this.$__.exclude===!1&&this.$__.selected?rg(this.$__.selected):null;return sW(this,this.$__.selected,this.$__.exclude,D,!1,this.$__.skipDefaults),this};function Af(F,A,D,Z,J){if(J=J||"",A.$__!=null)A=A._doc;let X=Object.keys(A),$=X.length,G,Y,B,H=F.$__.strictMode,q=F.$__schema;for(let W=0;W<$;++W){if(B=X[W],Ff.has(B))continue;if(Y=J?J+B:B,G=q.path(Y),q.$isRootDiscriminator&&!F.$__isSelected(Y))continue;let C=A[B];if(!G&&K1.isPOJO(C)){if(!D[B]){if(D[B]={},!H&&!(B in q.tree)&&!(B in q.methods)&&!(B in q.virtuals))F[B]=D[B]}Af(F,C,D[B],Z,Y+".")}else if(!G){if(D[B]=C,!H&&!J)F[B]=C}else{if(D.hasOwnProperty(B)&&C!==void 0&&!Z.hydratedPopulatedDocs)delete D[B];if(C===null)D[B]=G._castNullish(null);else if(C!==void 0){let Q=C.$__==null?null:C.$__.wasPopulated;if(G&&!Q&&!Z.hydratedPopulatedDocs)try{if(Z&&Z.setters)D[B]=G.applySetters(C,F,!1);else D[B]=G.cast(C,F,!0)}catch(K){F.invalidate(K.path,new sg({path:K.path,message:K.message,type:"cast",value:K.value,reason:K}))}else if(G&&Z.hydratedPopulatedDocs){if(D[B]=G.cast(C,F,!0,void 0,{hydratedPopulatedDocs:!0}),D[B]&&D[B].$__&&D[B].$__.wasPopulated)F.$populated(Y,D[B].$__.wasPopulated.value,D[B].$__.wasPopulated.options);else if(Array.isArray(D[B])&&D[B].length&&D[B][0]?.$__?.wasPopulated)F.$populated(Y,D[B].map((K)=>K?.$__?.wasPopulated?.value).filter((K)=>K!=null),D[B][0].$__.wasPopulated.options)}else D[B]=C}if(!F.$isModified(Y))F.$__.activePaths.init(Y)}}}m.prototype.updateOne=function F(A,D,Z){let J=this.constructor.updateOne({_id:this._doc._id},A,D),X=this;if(J.pre(function $(G){X.constructor._middleware.execPre("updateOne",X,[X],G)}),J.post(function $(G){X.constructor._middleware.execPost("updateOne",X,[X],{},G)}),this.$session()!=null){if(!("session"in J.options))J.options.session=this.$session()}if(Z!=null)return J.exec(Z);return J};m.prototype.replaceOne=function F(){let A=[...arguments];return A.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,A)};m.prototype.$session=function F(A){if(arguments.length===0){if(this.$__.session!=null&&this.$__.session.hasEnded)return this.$__.session=null,null;return this.$__.session}if(A!=null&&A.hasEnded)throw new e2("Cannot set a document's session to a session that has ended. Make sure you haven't called `endSession()` on the session you are passing to `$session()`.");if(A==null&&this.$__.session==null)return;if(this.$__.session=A,!this.$isSubdocument){let D=this.$getAllSubdocs();for(let Z of D)Z.$session(A)}return A};m.prototype.$timestamps=function F(A){if(arguments.length===0){if(this.$__.timestamps!=null)return this.$__.timestamps;if(this.$__schema)return this.$__schema.options.timestamps;return}let D=this.$timestamps();if(A!==D)this.$__.timestamps=A;return this};m.prototype.overwrite=function F(A){let D=Array.from(new Set(Object.keys(this._doc).concat(Object.keys(A))));for(let Z of D){if(Z==="_id")continue;if(this.$__schema.options.versionKey&&Z===this.$__schema.options.versionKey)continue;if(this.$__schema.options.discriminatorKey&&Z===this.$__schema.options.discriminatorKey)continue;this.$set(Z,A[Z])}return this};m.prototype.$set=function F(A,D,Z,J){if(K1.isPOJO(Z))J=Z,Z=void 0;let X=J&&J.merge,$=Z&&Z!==!0,G=Z===!0,Y,B,H=0,q,W,C,Q=J&&"strict"in J,K=Q?J.strict:this.$__.strictMode;if($)Y=this.$__.adhocPaths||(this.$__.adhocPaths={}),Y[A]=this.$__schema.interpretAsType(A,Z,this.$__schema.options);if(A==null)[A,D]=[D,A];else if(typeof A!=="string"){if(A instanceof m)if(A.$__isNested)A=A.toObject();else A=A.$__schema===this.$__schema?oW(A,{...A._doc}):A._doc;if(A==null)[A,D]=[D,A];C=D?D+".":"",B=dg(this.$__schema,A);let _=B.length,O=J&&J._skipMinimizeTopLevel||!1;if(_===0&&O){if(delete J._skipMinimizeTopLevel,D)this.$set(D,{});return this}J=Object.assign({},J,{_skipMinimizeTopLevel:!1});for(let u=0;u<_;++u){W=B[u];let c=C?C+W:W;q=this.$__schema.pathType(c);let r=A[W];if(Z===!0&&!C&&r!=null&&q==="nested"&&this._doc[W]!=null)delete this._doc[W];if(K1.isNonBuiltinObject(r)&&q==="nested"){this.$set(c,r,G,Object.assign({},J,{_skipMarkModified:!0})),MB1(this.$get(c),c,this);continue}else if(K){if(G&&r===void 0&&this.$get(c)!==void 0)continue;if(q==="adhocOrUndefined")q=iW(this,c,{typeOnly:!0});if(q==="real"||q==="virtual")this.$set(c,r,G,J);else if(q==="nested"&&r instanceof m)this.$set(c,r.toObject({transform:!1}),G,J);else if(K==="throw")if(q==="nested")throw new AB1(W,r);else throw new nW(W);else if(q==="nested"&&r==null)this.$set(c,r,G,J)}else this.$set(c,r,G,J)}let R={},S=Object.keys(this.$__schema.tree);for(let u=0,c=S.length;u<c;++u)(W=S[u])&&this._doc.hasOwnProperty(W)&&(R[W]=void 0);return this._doc=Object.assign(R,this._doc),this}let U=this.$__schema.pathType(A),z=null;if(U==="adhocOrUndefined")z=A.indexOf(".")===-1?[A]:A.split("."),U=iW(this,z,{typeOnly:!0});if(U==="adhocOrUndefined"&&!Q){if(z==null)z=A.indexOf(".")===-1?[A]:A.split(".");let _=GB1(this.$__schema,z);if(_!==void 0)K=_}D=BB1(D,!0);let L=(()=>{if(this.$__.priorDoc!=null)return this.$__.priorDoc.$__getValue(A);if(G)return;return this.$__getValue(A)})();if(U==="nested"&&D){if(typeof D==="object"&&D!=null){if(D.$__!=null)D=D.toObject(og);if(D==null)return this.invalidate(A,new e2.CastError("Object",D,A)),this;let _=this.$isModified(A),O=this.$__.savedState!=null&&this.$__.savedState.hasOwnProperty(A);if(this.$__.savedState!=null&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(A)){let S=this.$__getValue(A);this.$__.savedState[A]=S;let u=Object.keys(S||{});for(let c of u)this.$__.savedState[A+"."+c]=S[c]}if(!X)this.$__setValue(A,null),pW(this,A);else return this.$set(D,A,G,J);let R=dg(this.$__schema,D,A);this.$__setValue(A,{});for(let S of R)this.$set(A+"."+S,D[S],G,{...J,_skipMarkModified:!0});if(L!=null&&(!_||O)&&K1.deepEqual(O?this.$__.savedState[A]:L,D))this.unmarkModified(A);else this.markModified(A);return this}return this.invalidate(A,new e2.CastError("Object",D,A)),this}let V;if(z==null)z=A.indexOf(".")===-1?[A]:A.split(".");if(typeof this.$__schema.aliases[z[0]]==="string")z[0]=this.$__schema.aliases[z[0]];if(U==="adhocOrUndefined"&&K){let _;for(H=0;H<z.length;++H){let O=z.slice(0,H+1).join(".");if(H+1<z.length&&this.$__schema.pathType(O)==="virtual")return CB1.set(A,D,this),this;if(V=this.$__schema.path(O),V==null)continue;if(V instanceof vg){_=!0;break}else if(V.$isSchemaMap&&V.$__schemaType instanceof vg&&H<z.length-1){_=!0,V=V.$__schemaType;break}}if(V==null)V=iW(this,A);if(!_&&!V){if(K==="throw")throw new nW(A);return this}}else if(U==="virtual")return V=this.$__schema.virtualpath(A),V.applySetters(D,this),this;else V=this.$__path(A);let P=this._doc,I="";for(H=0;H<z.length-1;++H)if(P=P[z[H]],I+=(I.length!==0?".":"")+z[H],!P){if(this.$set(I,{}),!this.$__isSelected(I))this.unmarkModified(I);P=this.$__getValue(I)}let M;if(z.length<=1)M=A;else{let _=z.length;for(H=0;H<_;++H){let O=z.slice(0,H+1).join(".");if(this.$get(O,null,{getters:!1})===null){M=O;break}}if(!M)M=A}if(!V){if(this.$__set(M,A,J,G,z,V,D,L),U==="nested"&&D==null)pW(this,A);return this}if(V.$isSingleNested||V.$isMongooseArray)SB1(this,A);if(D!=null&&X&&V.$isSingleNested){if(D instanceof m)D=D.toObject({virtuals:!1,transform:!1});let _=Object.keys(D);for(let O of _)this.$set(A+"."+O,D[O],G,J);return this}let x=!0;try{let _=(()=>{if(V.options==null)return!1;if(!(D instanceof m))return!1;let u=D.constructor,c=typeof V.options.ref==="function"&&!V.options.ref[RB1]?V.options.ref.call(this,this):V.options.ref,r=c?.modelName||c;if(r!=null&&(r===u.modelName||r===u.baseModelName))return!0;let J0=V.options.refPath;if(J0==null)return!1;let d0=D.get(J0);return d0===u.modelName||d0===u.baseModelName})(),O=!1;if(_&&D instanceof m&&(!D.$__.wasPopulated||K1.deepEqual(D.$__.wasPopulated.value,D._doc._id))){let u=V&&V.$isSingleNested?V.cast(D,this):D._doc._id;this.$populated(A,u,{[ig]:D.constructor}),D.$__.wasPopulated={value:u},O=!0}let R,S=this.$__schema.options.typeKey;if(V.options&&Array.isArray(V.options[S])&&V.options[S].length&&V.options[S][0]&&V.options[S][0].ref&&NB1(D,V.options[S][0].ref)){R={[ig]:D[0].constructor},this.$populated(A,D.map(function(u){return u._doc._id}),R);for(let u of D)u.$__.wasPopulated={value:u._doc._id};O=!0}if(!_||!V.$isSingleNested||!D.$__){let u=this;if(this.$__schema.singleNestedPaths[A]!=null&&z.length>1)u=IB1(this,z,this.schema);if(J!=null&&J.overwriteImmutable)D=V.applySetters(D,u,!1,L,{overwriteImmutable:!0});else D=V.applySetters(D,u,!1,L)}if(Array.isArray(D)&&!Array.isArray(V)&&V.$isMongooseDocumentArray&&D.length!==0&&D[0]!=null&&D[0].$__!=null&&D[0].$__.populated!=null){let u=Object.keys(D[0].$__.populated);for(let c of u)this.$populated(A+"."+c,D.map((r)=>r.$populated(c)),D[0].$__.populated[c].options);O=!0}if(!O&&this.$__.populated){if(Array.isArray(D)&&this.$__.populated[A]){for(let u=0;u<D.length;++u)if(D[u]instanceof m)D.set(u,D[u]._doc._id,!0)}delete this.$__.populated[A]}if(D!=null&&V.$isSingleNested)_B1(D,V,L);this.$markValid(A)}catch(_){if(_ instanceof e2.StrictModeError&&_.isImmutableError)this.invalidate(A,_);else if(_ instanceof e2.CastError){if(this.invalidate(_.path,_),_.$originalErrorPath)this.invalidate(A,new e2.CastError(V.instance,D,A,_.$originalErrorPath))}else this.invalidate(A,new e2.CastError(V.instance,D,A,_));x=!1}if(x){let _=null,O=null;if(!G){let u=this.$isSubdocument?this.ownerDocument():this;_=u.$__.savedState,O=this.$isSubdocument?this.$__.fullPath+"."+A:A,u.$__saveInitialState(O)}this.$__set(M,A,J,G,z,V,D,L);let R=!!this.$__.session?.transaction,S=this.$__.session&&this.$__.session[KJ]&&this.$__.session[KJ].has(this)&&this.$__.session[KJ].get(this).modifiedPaths&&!this.$__.session[KJ].get(this).modifiedPaths.has(O);if(_!=null&&_.hasOwnProperty(O)&&(!R||S)&&K1.deepEqual(D,_[O]))this.unmarkModified(A)}if(V.$isSingleNested&&(this.isDirectModified(A)||D==null))pW(this,A);return this};/*!
270
+ * ignore
271
+ */function NB1(F,A){if(!Array.isArray(F))return!1;if(F.length===0)return!1;for(let D of F){if(!(D instanceof m))return!1;if(D.constructor.modelName==null)return!1;if(D.constructor.modelName!=A&&D.constructor.baseModelName!=A)return!1}return!0}m.prototype.set=m.prototype.$set;m.prototype.$__shouldModify=function(F,A,D,Z,J,X,$,G){if(D&&D._skipMarkModified)return!1;if(this.$isNew)return!0;if(A in this.$__.activePaths.getStatePaths("modify"))return!0;if($===void 0&&!this.$__isSelected(A))return!0;if($===void 0&&A in this.$__.activePaths.getStatePaths("default"))return!1;if(this.$populated(A)&&$ instanceof m&&EJ($._doc._id,G))return!1;if(!EJ($,G!==void 0?G:K1.getValue(A,this)))return!0;if(!Z&&$!==null&&$!==void 0&&A in this.$__.activePaths.getStatePaths("default")&&EJ($,X.getDefault(this,Z)))return!0;return!1};m.prototype.$__set=function(F,A,D,Z,J,X,$,G){pF=pF||x8();let Y=this.$__shouldModify(F,A,D,Z,J,X,$,G);if(Y){if(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[A]){if(delete this.$__.primitiveAtomics[A],Object.keys(this.$__.primitiveAtomics).length===0)delete this.$__.primitiveAtomics}if(this.markModified(F),ag||(ag=xW()),$&&K1.isMongooseArray($)){if($._registerAtomic("$set",$),K1.isMongooseDocumentArray($))$.forEach(function(C){C&&C.__parentArray&&(C.__parentArray=$)})}}else if(Array.isArray($)&&Array.isArray(G)&&K1.isMongooseArray($)&&K1.isMongooseArray(G)){if($[h2]=G[h2],$[iF]=G[iF],K1.isMongooseDocumentArray($))$.forEach((C)=>{if(C!=null)C.$isNew=!1})}let B=this._doc,H=0,q=J.length,W="";for(;H<q;H++){let Q=H+1===q;if(W+=W?"."+J[H]:J[H],Ff.has(J[H]))continue;if(Q)if(B instanceof Map)B.set(J[H],$);else if(B.$isSingleNested){if(!(J[H]in B))B[J[H]]=$,B._doc[J[H]]=$;else B._doc[J[H]]=$;if(Y)B.markModified(J[H])}else B[J[H]]=$;else{let K=B instanceof Map,U=K?B.get(J[H]):B[J[H]];if(K1.isPOJO(U))B=U;else if(U&&U instanceof pF)B=U;else if(U&&!Array.isArray(U)&&U.$isSingleNested)B=U;else if(U&&Array.isArray(U))B=U;else if(U==null){if(U={},K)B.set(J[H],U);else B[J[H]]=U;B=U}else B=U}}};m.prototype.$__getValue=function(F){if(typeof F!=="string"&&!Array.isArray(F))throw new TypeError(`Invalid \`path\`. Must be either string or array. Got "${F}" (type ${typeof F})`);return K1.getValue(F,this._doc)};m.prototype.$inc=function F(A,D){if(D==null)D=1;if(Array.isArray(A))return A.forEach((Y)=>this.$inc(Y,D)),this;let Z=this.$__path(A);if(Z==null){if(this.$__.strictMode==="throw")throw new nW(A);else if(this.$__.strictMode===!0)return this}else if(Z.instance!=="Number")return this.invalidate(A,new e2.CastError(Z.instance,D,A)),this;let J=this.$__getValue(A)||0,X=!1,$=null,G=D;try{D=Z.cast(D),$=Z.applySetters(J+D,this),G=$-J,X=!0}catch(Y){this.invalidate(A,new e2.CastError("number",D,A,Y))}if(X){if(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},this.$__.primitiveAtomics[A]==null)this.$__.primitiveAtomics[A]={$inc:G};else this.$__.primitiveAtomics[A].$inc+=G;this.markModified(A),this.$__setValue(A,$)}return this};m.prototype.$__setValue=function(F,A){return K1.setValue(F,A,this._doc),this};m.prototype.get=function(F,A,D){let Z;if(D==null)D={};if(A)Z=this.$__schema.interpretAsType(F,A,this.$__schema.options);let J=D.noDottedPath,X=J?this.$__schema.paths[F]:this.$__path(F);if(X==null){if(X=this.$__schema.virtualpath(F),X!=null)return X.applyGetters(void 0,this)}if(J){let B=this._doc[F];if(Z)B=Z.cast(B);if(X!=null&&D.getters!==!1)return X.applyGetters(B,this);return B}if(X!=null&&X.instance==="Mixed"){let B=this.$__schema.virtualpath(F);if(B!=null)X=B}let $=F.indexOf(".")!==-1,G=this._doc,Y=$?F.split("."):[F];if(typeof this.$__schema.aliases[Y[0]]==="string")Y[0]=this.$__schema.aliases[Y[0]];for(let B=0,H=Y.length;B<H;B++){if(G&&G._doc)G=G._doc;if(G==null)G=void 0;else if(G instanceof Map)G=G.get(Y[B],{getters:!1});else if(B===H-1)G=K1.getValue(Y[B],G);else G=G[Y[B]]}if(Z)G=Z.cast(G);if(X!=null&&D.getters!==!1)G=X.applyGetters(G,this);else if(this.$__schema.nested[F]&&D.virtuals)return oW(this,C3(G)||{},{path:F});return G};/*!
272
+ * ignore
273
+ */m.prototype[LB1]=m.prototype.get;m.prototype.$get=m.prototype.get;m.prototype.$__path=function(F){let A=this.$__.adhocPaths,D=A&&A.hasOwnProperty(F)?A[F]:null;if(D)return D;return this.$__schema.path(F)};m.prototype.markModified=function(F,A){if(this.$__saveInitialState(F),this.$__.activePaths.modify(F),A!=null&&!this.$isSubdocument)this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[F]=A};/*!
274
+ * ignore
275
+ */m.prototype.$__saveInitialState=function F(A){let D=this.$__.savedState,Z=A;if(D!=null){let J=Z.indexOf("."),X=J===-1?Z:Z.slice(0,J);if(!D.hasOwnProperty(X))D[X]=C3(this.$__getValue(X))}};m.prototype.unmarkModified=function(F){if(this.$__.activePaths.init(F),this.$__.pathsToScopes!=null)delete this.$__.pathsToScopes[F]};m.prototype.$ignore=function(F){this.$__.activePaths.ignore(F)};m.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))};m.prototype.$isEmpty=function(F){let A={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(arguments.length!==0){let D=this.$get(F);if(D==null)return!0;if(typeof D!=="object")return!1;if(K1.isPOJO(D))return Df(D);return Object.keys(D.toObject(A)).length===0}return Object.keys(this.toObject(A)).length===0};/*!
276
+ * ignore
277
+ */function Df(F){if(F==null)return!0;if(typeof F!=="object"||Array.isArray(F))return!1;for(let A of Object.keys(F))if(!Df(F[A]))return!1;return!0}m.prototype.modifiedPaths=function(F){F=F||{};let A=Object.keys(this.$__.activePaths.getStatePaths("modify")),D=new Set,Z=0,J=0,X=A.length;for(Z=0;Z<X;++Z){let $=A[Z],G=tW($),Y=G.length;for(J=0;J<Y;++J)D.add(G[J]);if(!F.includeChildren)continue;let B=0,H=this.$get($);if(typeof H==="object"&&H!==null){if(H._doc)H=H._doc;let q=H.length;if(Array.isArray(H))for(B=0;B<q;++B){let W=$+"."+B;if(!D.has(W)){if(D.add(W),H[B]!=null&&H[B].$__){let C=H[B].modifiedPaths(),Q=0,K=C.length;for(Q=0;Q<K;++Q)D.add(W+"."+C[Q])}}}else{let W=Object.keys(H),C=0,Q=W.length;for(C=0;C<Q;++C)D.add($+"."+W[C])}}}return Array.from(D)};m.prototype[eg]=m.prototype.modifiedPaths;m.prototype.isModified=function(F,A,D){if(F){let Z=A&&A.ignoreAtomics,J=this.$__.activePaths.states.modify;if(J==null)return!1;if(typeof F==="string")F=F.indexOf(" ")===-1?[F]:F.split(" ");for(let Y of F)if(J[Y]!=null)return!0;let X=D||this[eg](),$=F.some(function(Y){return!!~X.indexOf(Y)}),G=Object.keys(J);if(Z)G=G.filter((Y)=>{let B=this.$__getValue(Y);if(B!=null&&B[h2]!=null&&B[h2].$set===void 0)return!1;return!0});return $||F.some(function(Y){return G.some(function(B){return B===Y||Y.startsWith(B+".")})})}return this.$__.activePaths.some("modify")};m.prototype.$isModified=m.prototype.isModified;m.prototype[zB1]=m.prototype.isModified;m.prototype.$isDefault=function(F){if(F==null)return this.$__.activePaths.some("default");if(typeof F==="string"&&F.indexOf(" ")===-1)return this.$__.activePaths.getStatePaths("default").hasOwnProperty(F);let A=F;if(!Array.isArray(A))A=A.split(" ");return A.some((D)=>this.$__.activePaths.getStatePaths("default").hasOwnProperty(D))};m.prototype.$isDeleted=function(F){if(arguments.length===0)return!!this.$__.isDeleted;return this.$__.isDeleted=!!F,this};m.prototype.isDirectModified=function(F){if(F==null)return this.$__.activePaths.some("modify");if(typeof F==="string"&&F.indexOf(" ")===-1){let D=this.$__.activePaths.getStatePaths("modify").hasOwnProperty(F);if(D||F.indexOf(".")===-1)return D;let Z=F.split(".");for(let J=0;J<Z.length-1;++J){let X=Z.slice(0,J+1).join("."),$=this.$get(X);if($!=null&&$.$__!=null&&$.isDirectModified(Z.slice(J+1).join(".")))return!0}return!1}let A=F;if(typeof A==="string")A=A.split(" ");return A.some((D)=>this.isDirectModified(D))};m.prototype.isInit=function(F){if(F==null)return this.$__.activePaths.some("init");if(typeof F==="string"&&F.indexOf(" ")===-1)return this.$__.activePaths.getStatePaths("init").hasOwnProperty(F);let A=F;if(!Array.isArray(A))A=A.split(" ");return A.some((D)=>this.$__.activePaths.getStatePaths("init").hasOwnProperty(D))};m.prototype.isSelected=function F(A){if(this.$__.selected==null)return!0;if(!A)return!1;if(A==="_id")return this.$__.selected._id!==0;if(A.indexOf(" ")!==-1)A=A.split(" ");if(Array.isArray(A))return A.some((X)=>this.$__isSelected(X));let D=Object.keys(this.$__.selected),Z=null;if(D.length===1&&D[0]==="_id")return this.$__.selected._id===0;for(let X of D){if(X==="_id")continue;if(!tg(this.$__.selected[X]))continue;Z=!!this.$__.selected[X];break}if(Z===null)return!0;if(A in this.$__.selected)return Z;let J=A+".";for(let X of D){if(X==="_id")continue;if(X.startsWith(J))return Z||X!==J;if(J.startsWith(X+"."))return Z}return!Z};m.prototype.$__isSelected=m.prototype.isSelected;m.prototype.isDirectSelected=function F(A){if(this.$__.selected==null)return!0;if(A==="_id")return this.$__.selected._id!==0;if(A.indexOf(" ")!==-1)A=A.split(" ");if(Array.isArray(A))return A.some((J)=>this.isDirectSelected(J));let D=Object.keys(this.$__.selected),Z=null;if(D.length===1&&D[0]==="_id")return this.$__.selected._id===0;for(let J of D){if(J==="_id")continue;if(!tg(this.$__.selected[J]))continue;Z=!!this.$__.selected[J];break}if(Z===null)return!0;if(this.$__.selected.hasOwnProperty(A))return Z;return!Z};m.prototype.validate=async function F(A,D){if(typeof A==="function"||typeof D==="function"||typeof arguments[2]==="function")throw new e2("Document.prototype.validate() no longer accepts a callback");let Z;if(this.$op="validate",arguments.length===1){if(typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))D=arguments[0],A=null}if(D&&typeof D.pathsToSkip==="string"){let X=D.pathsToSkip.indexOf(" ")===-1;D.pathsToSkip=X?[D.pathsToSkip]:D.pathsToSkip.split(" ")}let J=D&&D._skipParallelValidateCheck;if(this.$isSubdocument!=null);else if(this.$__.validating&&!J)Z=new mg(this,{parentStack:D&&D.parentStack,conflictStack:this.$__.validating.stack});else if(!J)this.$__.validating=new mg(this,{parentStack:D&&D.parentStack});if(Z!=null)throw Z;return new Promise((X,$)=>{this.$__validate(A,D,(G)=>{if(this.$op=null,this.$__.validating=null,G!=null)return $(G);X()})})};m.prototype.$validate=m.prototype.validate;/*!
278
+ * ignore
279
+ */function jB1(F){let A=Object.keys(F.$__.activePaths.getStatePaths("require")),D=0,Z=A.length;for(D=0;D<Z;++D){let J=A[D],X=F.$__schema.path(J);if(X!=null&&typeof X.originalRequiredValue==="function"){F.$__.cachedRequired=F.$__.cachedRequired||{};try{F.$__.cachedRequired[J]=X.originalRequiredValue.call(F,F)}catch($){F.invalidate(J,$)}}}}/*!
280
+ * ignore
281
+ */function Zf(F,A,D,Z){let J={};jB1(F);let X=new Set(Object.keys(F.$__.activePaths.getStatePaths("require")).filter(function(Y){if(!F.$__isSelected(Y)&&!F.$isModified(Y))return!1;if(F.$__.cachedRequired!=null&&Y in F.$__.cachedRequired)return F.$__.cachedRequired[Y];return!0}));Object.keys(F.$__.activePaths.getStatePaths("init")).forEach($),Object.keys(F.$__.activePaths.getStatePaths("modify")).forEach($),Object.keys(F.$__.activePaths.getStatePaths("default")).forEach($);function $(Y){X.add(Y)}if(!Z){let Y=F.$getAllSubdocs({useCache:!0}),B=F.modifiedPaths();for(let H of Y)if(H.$basePath){let q=H.$isSingleNested?H.$__pathRelativeToParent():H.$__fullPathWithIndexes();for(let W of H.modifiedPaths())X.delete(q+"."+W);if(F.$isModified(q,null,B)&&!F.$__.activePaths.getStatePaths("modify").hasOwnProperty(q)&&!F.$isDefault(q)){if(X.add(q),F.$__.pathsToScopes==null)F.$__.pathsToScopes={};if(F.$__.pathsToScopes[q]=H.$isDocumentArrayElement?H.__parentArray:H.$parent(),J[q]={skipSchemaValidators:!0},H.$isDocumentArrayElement&&H.__index!=null)J[q].index=H.__index}}}for(let Y of X){let B=F.$__schema.path(Y);if(!B)continue;if(B.$isMongooseDocumentArray){for(let H of X)if(H==null||H.startsWith(B.path+"."))X.delete(H)}if(!B.caster&&B.validators.length===0&&!B.$parentSchemaDocArray)X.delete(Y);else if(B.$isMongooseArray&&!B.$isMongooseDocumentArray&&!B.$embeddedSchemaType.$isMongooseArray&&B.validators.length===0&&B.$embeddedSchemaType.validators.length===0)X.delete(Y)}if(Array.isArray(A))X=kB1(X,A);else if(Array.isArray(D))X=OB1(X,D);TB1(F,X);let G={skipArrays:!0};for(let Y of X)if(F.$__schema.nested[Y]){let B=F.$__getValue(Y);if(EB1(B))B=B.toObject({transform:!1});let H=YB1(B,Y,G,F.$__schema);Object.keys(H).filter((q)=>!F.$__schema.singleNestedPaths.hasOwnProperty(q)).forEach($)}for(let Y of X){let B=F.$__schema.path(Y);if(!B)continue;if(B.$parentSchemaDocArray&&typeof B.$parentSchemaDocArray.path==="string")X.add(B.$parentSchemaDocArray.path);if(!B.$isSchemaMap)continue;let H=F.$__getValue(Y);if(H==null)continue;for(let q of H.keys())X.add(Y+"."+q)}return X=Array.from(X),[X,J]}function TB1(F,A){for(let D of A){let Z=F.$__schema.path(D);if(!Z)continue;if(!Z.$isMongooseArray||!Array.isArray(Z)&&Z.$isMongooseDocumentArray&&!(Z&&Z.schemaOptions&&Z.schemaOptions.required))continue;if(Z.$isMongooseArray&&!Z.$isMongooseDocumentArray&&!Z.$embeddedSchemaType.$isMongooseArray&&Z.$embeddedSchemaType.validators.length===0)continue;let J=F.$__getValue(D);VJ(J,A,D)}}function VJ(F,A,D){if(F!=null){let Z=F.length;for(let J=0;J<Z;++J)if(Array.isArray(F[J]))VJ(F[J],A,D+"."+J);else A.add(D+"."+J)}}/*!
282
+ * ignore
283
+ */m.prototype.$__validate=function(F,A,D){if(this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!F)F=[...this.$__.saveOptions.pathsToSave];else if(typeof F==="function")D=F,A=null,F=null;else if(typeof A==="function")D=A,A=null;let Z=A&&typeof A==="object"&&"validateModifiedOnly"in A,J=A&&A.pathsToSkip||null,X;if(Z)X=!!A.validateModifiedOnly;else X=this.$__schema.options.validateModifiedOnly;let $=A&&A.validateAllPaths;if($){if(J)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(F)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(Z&&X)throw new TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}let G=this,Y=()=>{let U=this.$__.validationError;if(this.$__.validationError=null,this.$__.validating=null,X&&U!=null){let z=Object.keys(U.errors);for(let L of z)if(!this.$isModified(L))delete U.errors[L];if(Object.keys(U.errors).length===0)U=void 0}if(this.$__.cachedRequired={},this.$emit("validate",G),this.constructor.emit("validate",G),U){for(let z in U.errors)if(!this[UB1]&&U.errors[z]instanceof e2.CastError)this.invalidate(z,U.errors[z]);return U}},B,H;if($){B=new Set(Object.keys(this.$__schema.paths));for(let U of B){let z=this.$__schema.path(U);if(!z||!z.$isMongooseArray)continue;let L=this.$__getValue(U);if(!L)continue;VJ(L,B,U)}B=[...B],H={}}else{let U=Zf(this,F,J,A&&A._nestedValidate);B=X?U[0].filter((z)=>this.$isModified(z)):U[0],H=U[1]}if(typeof F==="string")F=F.split(" ");if(B.length===0)return cg(function(){let U=Y();if(U)return G.$__schema.s.hooks.execPost("validate:error",G,[G],{error:U},function(z){D(z)});D(null,G)});let q={},W=0,C=this.$__.saveOptions?.pathsToSave;if(Array.isArray(C)){C=new Set(C);for(let U of B){if(!C.has(U))continue;Q(U)}}else for(let U of B)Q(U);function Q(U){if(U==null||q[U])return;q[U]=!0,W++,cg(function(){let z=G.$__schema.path(U);if(!z)return--W||K();if(!G.$isValid(U)){--W||K();return}if(z[PB1]!=null&&U!==z.path)return--W||K();let L=G.$__getValue(U),V;if(V=G.$populated(U))L=V;else if(L!=null&&L.$__!=null&&L.$__.wasPopulated)L=L._doc._id;let P=G.$__.pathsToScopes!=null&&U in G.$__.pathsToScopes?G.$__.pathsToScopes[U]:G,I={...H[U],path:U,validateAllPaths:$,_nestedValidate:!0};z.doValidate(L,function(M){if(M){if((z.$isSingleNested||z.$isArraySubdocument||z.$isMongooseDocumentArray)&&M instanceof zJ)return--W||K();G.invalidate(U,M,void 0,!0)}--W||K()},P,I)})}function K(){let U=Y();if(U)return G.$__schema.s.hooks.execPost("validate:error",G,[G],{error:U},function(z){D(z)});D(null,G)}};/*!
284
+ * ignore
285
+ */function kB1(F,A){let D=new Set(A),Z=new Map([]);for(let X of A){if(X.indexOf(".")===-1)continue;let $=X.split("."),G=$[0];for(let Y=1;Y<$.length;++Y)Z.set(G,X),G=G+"."+$[Y]}let J=new Set;for(let X of F)if(D.has(X))J.add(X);else if(Z.has(X))J.add(Z.get(X));return J}/*!
286
+ * ignore
287
+ */function OB1(F,A){return A=new Set(A),F=Array.from(F).filter((D)=>!A.has(D)),new Set(F)}m.prototype.validateSync=function(F,A){let D=this;if(arguments.length===1&&typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))A=arguments[0],F=null;let Z=A&&typeof A==="object"&&"validateModifiedOnly"in A,J;if(Z)J=!!A.validateModifiedOnly;else J=this.$__schema.options.validateModifiedOnly;let X=A&&A.pathsToSkip,$=A&&A.validateAllPaths;if($){if(X)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(F)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`")}if(typeof F==="string")F=F.indexOf(" ")===-1?[F]:F.split(" ");else if(typeof X==="string"&&X.indexOf(" ")!==-1)X=X.split(" ");let G,Y;if($){G=new Set(Object.keys(this.$__schema.paths));for(let q of G){let W=this.$__schema.path(q);if(!W||!W.$isMongooseArray)continue;let C=this.$__getValue(q);if(!C)continue;VJ(C,G,q)}G=[...G],Y={}}else{let q=Zf(this,F,X);G=J?q[0].filter((W)=>this.$isModified(W)):q[0],Y=q[1]}let B={};for(let q=0,W=G.length;q<W;++q){let C=G[q];if(B[C])continue;B[C]=!0;let Q=D.$__schema.path(C);if(!Q)continue;if(!D.$isValid(C))continue;let K=D.$__getValue(C),U=Q.doValidateSync(K,D,{skipSchemaValidators:Y[C],path:C,validateModifiedOnly:J,validateAllPaths:$});if(U){if((Q.$isSingleNested||Q.$isArraySubdocument||Q.$isMongooseDocumentArray)&&U instanceof zJ)continue;D.invalidate(C,U,void 0,!0)}}let H=D.$__.validationError;if(D.$__.validationError=void 0,D.$emit("validate",D),D.constructor.emit("validate",D),H){for(let q in H.errors)if(H.errors[q]instanceof e2.CastError)D.invalidate(q,H.errors[q])}return H};m.prototype.invalidate=function(F,A,D,Z){if(!this.$__.validationError)this.$__.validationError=new zJ(this);if(this.$__.validationError.errors[F])return;if(!A||typeof A==="string")A=new sg({path:F,message:A,type:Z||"user defined",value:D});if(this.$__.validationError===A)return this.$__.validationError;return this.$__.validationError.addError(F,A),this.$__.validationError};m.prototype.$markValid=function(F){if(!this.$__.validationError||!this.$__.validationError.errors[F])return;if(delete this.$__.validationError.errors[F],Object.keys(this.$__.validationError.errors).length===0)this.$__.validationError=null};/*!
288
+ * ignore
289
+ */function SB1(F,A){if(!F.$__.validationError)return;let D=Object.keys(F.$__.validationError.errors);for(let Z of D)if(Z.startsWith(A+"."))delete F.$__.validationError.errors[Z];if(Object.keys(F.$__.validationError.errors).length===0)F.$__.validationError=null}/*!
290
+ * ignore
291
+ */function _B1(F,A,D){let Z=A.schema;if(Z==null)return;for(let J of Object.keys(Z.paths)){let X=Z.paths[J];if(X.$immutableSetter==null)continue;let $=D==null?void 0:D.$__getValue(J);X.$immutableSetter.call(F,$)}}m.prototype.$isValid=function(F){if(this.$__.validationError==null||Object.keys(this.$__.validationError.errors).length===0)return!0;if(F==null)return!1;if(F.indexOf(" ")!==-1)F=F.split(" ");if(Array.isArray(F))return F.some((A)=>this.$__.validationError.errors[A]==null);return this.$__.validationError.errors[F]==null};m.prototype.$__reset=function F(){let A=this,D=!this.$isSubdocument?this.$getAllSubdocs({useCache:!0}):null;if(D&&D.length>0)for(let Z of D)Z.$__reset();return this.$__dirty().forEach(function(Z){let J=Z.value;if(J&&J[h2])J[iF]=J[h2],J[h2]={}}),this.$__.backup={},this.$__.backup.activePaths={modify:Object.assign({},this.$__.activePaths.getStatePaths("modify")),default:Object.assign({},this.$__.activePaths.getStatePaths("default"))},this.$__.backup.validationError=this.$__.validationError,this.$__.backup.errors=this.$errors,this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("default"),this.$__.validationError=void 0,this.$errors=void 0,A=this,this.$__schema.requiredPaths().forEach(function(Z){A.$__.activePaths.require(Z)}),this};/*!
292
+ * ignore
293
+ */m.prototype.$__undoReset=function F(){if(this.$__.backup==null||this.$__.backup.activePaths==null)return;this.$__.activePaths.states.modify=this.$__.backup.activePaths.modify,this.$__.activePaths.states.default=this.$__.backup.activePaths.default,this.$__.validationError=this.$__.backup.validationError,this.$errors=this.$__.backup.errors;for(let A of this.$__dirty()){let D=A.value;if(D&&D[h2]&&D[iF])D[h2]=D[iF]}if(!this.$isSubdocument)for(let A of this.$getAllSubdocs())A.$__undoReset()};m.prototype.$__dirty=function(){let F=this,A=this.$__.activePaths.map("modify",function(J){return{path:J,value:F.$__getValue(J),schema:F.$__path(J)}});A=A.concat(this.$__.activePaths.map("default",function(J){if(J==="_id"||F.$__getValue(J)==null)return;return{path:J,value:F.$__getValue(J),schema:F.$__path(J)}}));let D=new Map(A.filter((J)=>J!=null).map((J)=>[J.path,J.value])),Z=[];return A.forEach(function(J){if(!J)return;let X=null,$=tW(J.path);for(let G=0;G<$.length-1;G++)if(D.has($[G])){X=D.get($[G]);break}if(X==null)Z.push(J);else if(X!=null&&X[h2]!=null&&X.hasAtomics())X[h2]={},X[h2].$set=X}),Z};m.prototype.$__setSchema=function(F){JB1(F.tree,this,void 0,F.options);for(let A of Object.keys(F.virtuals))F.virtuals[A]._applyDefaultGetters();if(F.path("schema")==null)this.schema=F;this.$__schema=F,this[VB1]=F};m.prototype.$__getArrayPathsToValidate=function(){return UJ||(UJ=n9()),this.$__.activePaths.map("init","modify",function(F){return this.$__getValue(F)}.bind(this)).filter(function(F){return F&&Array.isArray(F)&&K1.isMongooseDocumentArray(F)&&F.length}).reduce(function(F,A){return F.concat(A)},[]).filter(function(F){return F})};m.prototype.$getAllSubdocs=function(F){if(F?.useCache&&this.$__.saveOptions?.__subdocs)return this.$__.saveOptions.__subdocs;UJ||(UJ=n9()),pF=pF||x8();let A=[];function D(Z){let J=[];for(let{model:X}of Z.$__schema.childSchemas){let $=Z.$__getValue(X.path);if($==null)continue;if($.$__)J.push($);if(Array.isArray($)){for(let G of $)if(G!=null&&G.$__)J.push(G)}if($ instanceof Map){for(let G of $.values())if(G!=null&&G.$__)J.push(G)}}for(let X of J)D(X);A.push(...J)}if(D(this),this.$__.saveOptions)this.$__.saveOptions.__subdocs=A;return A};/*!
294
+ * Runs queued functions
295
+ */function uB1(F){let A=F.$__schema&&F.$__schema.callQueue;if(!A.length)return;for(let D of A)if(D[0]!=="pre"&&D[0]!=="post"&&D[0]!=="on")F[D[0]].apply(F,D[1])}/*!
296
+ * ignore
297
+ */m.prototype.$__handleReject=function F(A){if(this.$listeners("error").length)this.$emit("error",A);else if(this.constructor.listeners&&this.constructor.listeners("error").length)this.constructor.emit("error",A)};m.prototype.$toObject=function(F,A){let D=this.$__schema._defaultToObjectOptions(A),Z=this.$__hasOnlyPrimitiveValues();F=K1.isPOJO(F)?{...F}:{},F._calledWithOptions=F._calledWithOptions||{...F};let J;if(F._calledWithOptions.minimize!=null)J=F.minimize;else if(D!=null&&D.minimize!=null)J=D.minimize;else J=this.$__schema.options.minimize;if(F.minimize=J,!Z)F._seen=F._seen||new Map;let X=F._calledWithOptions.depopulate??D?.depopulate??F.depopulate??!1;if(X&&F._isNested&&this.$__.wasPopulated)return C3(this.$__.wasPopulated.value||this._doc._id,F);if(X)F.depopulate=!0;if(D!=null){for(let C of Object.keys(D))if(F[C]==null)F[C]=D[C]}F._isNested=!0,F.json=A,F.minimize=J;let $=F._parentOptions;F._parentOptions=this.$isSubdocument?F:null;let G=F._calledWithOptions.schemaFieldsOnly??F.schemaFieldsOnly??D.schemaFieldsOnly??!1,Y;if(Z&&!F.flattenObjectIds)Y=this.$__toObjectShallow(G);else if(G){Y={};for(let C of Object.keys(this.$__schema.paths)){let Q=this.$__getValue(C);if(Q===void 0)continue;let K=C,U=Y;if(C.indexOf(".")!==-1){let z=C.split(".");K=z[z.length-1];for(let L=0;L<z.length-1;++L)U[z[L]]=U[z[L]]??{},U=U[z[L]]}if(Q===null){U[K]=null;continue}U[K]=C3(Q,F)}}else Y=C3(this._doc,F)||{};let B=F._calledWithOptions.getters??F.getters??D.getters??!1;if(B){if(xB1(this,Y),F.minimize)Y=WB1(Y)||{}}let H=F._calledWithOptions.virtuals??D.virtuals??$?.virtuals??void 0;if(H||B&&H!==!1)oW(this,Y,F,F);if(F.versionKey===!1&&this.$__schema.options.versionKey)delete Y[this.$__schema.options.versionKey];let q=F._calledWithOptions.transform??!0,W=void 0;if(q===!0)W=D.transform;else if(typeof q==="function")W=q;if(q)gB1(this,Y);if(F.useProjection)fB1(this,Y);if(typeof W==="function"){let C=W(this,Y,F);if(typeof C!=="undefined")Y=C}return Y};/*!
298
+ * Internal shallow clone alternative to `$toObject()`: much faster, no options processing
299
+ */m.prototype.$__toObjectShallow=function F(A){let D={};if(this._doc!=null){let Z=A?Object.keys(this.$__schema.paths):Object.keys(this._doc);for(let J of Z){let X=this._doc[J];if(X instanceof Date)D[J]=new Date(X);else if(X!==void 0)D[J]=X}}return D};m.prototype.toObject=function(F){return this.$toObject(F)};/*!
300
+ * Applies virtuals properties to `json`.
301
+ */function oW(F,A,D,Z){let J=F.$__schema,X=J.virtuals,$=Object.keys(X),G=$.length,Y=G,B,H,q=F._doc,W,C=typeof(Z&&Z.aliases)==="boolean"?Z.aliases:!0;D=D||{};let Q=null;if(Array.isArray(D.virtuals))Q=new Set(D.virtuals);else if(D.virtuals&&D.virtuals.pathsToSkip){Q=new Set($);for(let K=0;K<D.virtuals.pathsToSkip.length;K++)if(Q.has(D.virtuals.pathsToSkip[K]))Q.delete(D.virtuals.pathsToSkip[K])}if(!q)return A;for(G=0;G<Y;++G){if(B=$[G],Q!=null&&!Q.has(B))continue;if(!C&&J.aliases.hasOwnProperty(B))continue;if(H=B,D.path!=null){if(!B.startsWith(D.path+"."))continue;H=B.substring(D.path.length+1)}if(H.indexOf(".")===-1&&H===B){if(W=X[B].applyGetters(void 0,F),W===void 0)continue;W=C3(W,D),A[H]=W;continue}let K=H.split(".");if(W=C3(F.get(B),D),W===void 0)continue;let U=K.length;q=A;for(let z=0;z<U-1;++z)q[K[z]]=q[K[z]]||{},q=q[K[z]];q[K[U-1]]=W}return A}function xB1(F,A){let D=F.$__schema,Z=Object.keys(D.paths),J=Z.length,X,$=F._doc,G;if(!$)return A;while(J--){X=Z[J];let Y=X.split("."),B=Y.length,H=B-1,q=A,W;if($=F._doc,!F.$__isSelected(X))continue;for(let C=0;C<B;++C){if(W=Y[C],G=$[W],q!=null&&typeof q!=="object")break;else if(C===H){if(q[W]=D.paths[X].applyGetters(q[W],F),Array.isArray(q[W])&&D.paths[X].$embeddedSchemaType)for(let Q=0;Q<q[W].length;++Q)q[W][Q]=D.paths[X].$embeddedSchemaType.applyGetters(q[W][Q],F)}else if(G==null){if(W in $)q[W]=G;break}else q=q[W]||(q[W]={});$=G}}return A}function gB1(F,A){let D=F.$__schema,Z=Object.keys(D.paths||{});if(!F._doc)return A;for(let X of Z){let $=D.paths[X],G=$.options.transform??$.constructor?.defaultOptions?.transform,Y=$.$embeddedSchemaType?.options?.transform??$.$embeddedSchemaType?.constructor?.defaultOptions?.transform;if(typeof G==="function"){let B=F.$get(X);if(B===void 0)continue;let H=G.call(F,B);ng(X,H),K1.setValue(X,H,A)}else if(typeof Y==="function"){let B=F.$get(X);if(B===void 0)continue;let H=[].concat(B);for(let q=0;q<H.length;++q){let W=Y.call(F,H[q]);H[q]=W,ng(X,W)}A[X]=H}}return A}function ng(F,A){if(KB1(A))throw new Error("`transform` function must be synchronous, but the transform on path `"+F+"` returned a promise.")}/*!
302
+ * ignore
303
+ */function fB1(F,A){let D=F.$__schema,Z=Object.keys(D.paths||{});if(!F._doc)return A;let X=F.$__.selected;if(X===void 0)X={},QB1.applyPaths(X,D);if(X==null||Object.keys(X).length===0)return A;for(let $ of Z)if(X[$]!=null&&!X[$])delete A[$];return A}m.prototype.toJSON=function(F){return this.$toObject(F,!0)};/*!
304
+ * ignore
305
+ */m.prototype.ownerDocument=function(){return this};m.prototype.parent=function(){if(this.$isSubdocument||this.$__.wasPopulated)return this.$__.parent;return this};m.prototype.$parent=m.prototype.parent;m.prototype.inspect=function(F){let A=K1.isPOJO(F),D;if(A)D=F,D.minimize=!1;let Z=arguments.length>0?this.toObject(D):this.toObject();if(Z==null)return"MongooseDocument { "+Z+" }";return Z};if(rW.custom)m.prototype[rW.custom]=m.prototype.inspect;m.prototype.toString=function(){let F=this.inspect();if(typeof F==="string")return F;return rW(F)};m.prototype.equals=function(F){if(!F)return!1;let A=this.$__getValue("_id"),D=F.$__!=null?F.$__getValue("_id"):F;if(!A&&!D)return EJ(this,F);return A&&A.equals?A.equals(D):A===D};m.prototype.populate=async function F(){let A={},D=[...arguments];if(typeof D[D.length-1]==="function")throw new e2("Document.prototype.populate() no longer accepts a callback");if(D.length!==0){let X=K1.populate.apply(null,D);for(let $ of X)A[$.path]=$}let Z=K1.object.vals(A),J=this.constructor;if(this.$__isNested){J=this.$__[wB1].constructor;let X=this.$__.nestedPath;Z.forEach(function($){$.path=X+"."+$.path})}if(this.$session()!=null){let X=this.$session();Z.forEach(($)=>{if($.options==null){$.options={session:X};return}if(!("session"in $.options))$.options.session=X})}return Z.forEach((X)=>{X._localModel=J}),J.populate(this,Z)};m.prototype.$getPopulatedDocs=function F(){let A=[];if(this.$__.populated!=null)A=A.concat(Object.keys(this.$__.populated));let D=[];for(let Z of A){let J=this.$get(Z);if(Array.isArray(J))D=D.concat(J);else if(J instanceof m)D.push(J)}return D};m.prototype.populated=function(F,A,D){if(A==null||A===!0){if(!this.$__.populated)return;if(typeof F!=="string")return;let J=F.endsWith(".$*")?F.replace(/\.\$\*$/,""):F,X=this.$__.populated[J];if(X)return A===!0?X:X.value;return}this.$__.populated||(this.$__.populated={}),this.$__.populated[F]={value:A,options:D};let Z=F.split(".");for(let J=0;J<Z.length-1;++J){let X=Z.slice(0,J+1).join("."),$=this.$get(X);if($!=null&&$.$__!=null&&this.$populated(X)){let G=Z.slice(J+1).join(".");$.$populated(G,A,D);break}}return A};m.prototype.$populated=m.prototype.populated;m.prototype.$assertPopulated=function F(A,D){if(Array.isArray(A))return A.forEach((Z)=>this.$assertPopulated(Z,D)),this;if(arguments.length>1)this.$set(D);if(!this.$populated(A))throw new e2(`Expected path "${A}" to be populated`);return this};m.prototype.depopulate=function(F){if(typeof F==="string")F=F.indexOf(" ")===-1?[F]:F.split(" ");let A,D=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],Z=this.$__&&this.$__.populated||{};if(arguments.length===0){for(let X of D)delete this.$$populatedVirtuals[X],delete this._doc[X],delete Z[X];let J=Object.keys(Z);for(let X of J){if(A=this.$populated(X),!A)continue;if(delete Z[X],Array.isArray(A)){let $=K1.getValue(X,this._doc);if($.isMongooseArray){let G=$.__array;for(let Y=0;Y<G.length;++Y){let B=G[Y];if(B==null)continue;G[Y]=B instanceof m?B._doc._id:B._id}}else K1.setValue(X,A,this._doc)}else K1.setValue(X,A,this._doc)}return this}for(let J of F)if(A=this.$populated(J),delete Z[J],D.indexOf(J)!==-1)delete this.$$populatedVirtuals[J],delete this._doc[J];else if(A)if(Array.isArray(A)){let X=K1.getValue(J,this._doc);if(X.isMongooseArray){let $=X.__array;for(let G=0;G<$.length;++G){let Y=$[G];if(Y==null)continue;$[G]=Y instanceof m?Y._doc._id:Y._id}}else K1.setValue(J,A,this._doc)}else K1.setValue(J,A,this._doc);return this};m.prototype.$__fullPath=function(F){return F||""};m.prototype.getChanges=function(){let F=this.$__delta();return F?F[1]:{}};m.prototype.$__delta=function F(){let A=this.$__dirty(),D=this.$__schema.options.optimisticConcurrency;if(D)if(Array.isArray(D)){let Y=new Set(D);if(this.modifiedPaths().find((H)=>Y.has(H)))this.$__.version=A.length?3:1}else this.$__.version=A.length?3:1;if(!A.length&&this.$__.version!==3)return;let Z={},J={},X=A.length,$=[],G=0;if(Z._id=this._doc._id,(Z&&Z._id&&Z._id.$__||null)!=null)Z._id=Z._id.toObject({transform:!1,depopulate:!0});for(;G<X;++G){let Y=A[G],B=Y.value,H=yB1(this,Y.path,B);if(H){$.push(H);continue}if(!this.$populated(Y.path,!0)&&this.$__.selected){let W=Y.path.split("."),C=W[0];if(this.$__.selected[C]&&this.$__.selected[C].$elemMatch)if(W.length>1&&W[1]==0&&typeof Z[C]==="undefined")Z[C]=this.$__.selected[C],W[1]="$",Y.path=W.join(".");else{$.push(Y.path);continue}}if(this.$isDefault(Y.path)&&this.$__.selected){if(Y.path.indexOf(".")===-1&&pg(this.$__.selected,Y.path))continue;if(tW(Y.path).find((C)=>pg(this.$__.isSelected,C)))continue}if($.length)continue;if(B===void 0)n4(this,Z,J,Y,1,"$unset");else if(B===null)n4(this,Z,J,Y,null);else if(K1.isMongooseArray(B)&&B.$path()&&B[h2])bB1(this,Z,J,Y,B);else if(B[eG1.pathSymbol]&&Buffer.isBuffer(B))B=B.toObject(),n4(this,Z,J,Y,B);else if(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[Y.path]!=null){let W=this.$__.primitiveAtomics[Y.path],C=$B1(W);n4(this,Z,J,Y,W[C],C)}else B=C3(B,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}),n4(this,Z,J,Y,B)}if($.length)return new tG1($);if(this.$__.version)this.$__version(Z,J);if(Object.keys(J).length===0)return[Z,null];return[Z,J]};function yB1(F,A,D){let Z=F.$populated(A,!0);if(!Z&&F.$__.selected){let X=A.split(".")[0];if(F.$__.selected[X+".$"])return X}if(!(Z&&K1.isMongooseArray(D)))return;if(Z.options.match||Z.options.options&&K1.object.hasOwnProperty(Z.options.options,"limit")||Z.options.options&&Z.options.options.skip||Z.options.select&&(Z.options.select._id===0||/\s?-_id\s?/.test(Z.options.select))){let X=D[h2];if(Object.keys(X).length===0||X.$set||X.$pop)return A}}function n4(F,A,D,Z,J,X){if(X||(X="$set"),!D[X])D[X]={};if(D[X][Z.path]=J,F.$__schema.options.versionKey===!1)return;if(hB1(F,Z.path))return;if((3&F.$__.version)===3)return;if(F.$__schema.options.optimisticConcurrency)return;switch(X){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}if(X==="$push"||X==="$addToSet"||X==="$pullAll"||X==="$pull")if(/\.\d+\.|\.\d+$/.test(Z.path))F.$__.version=3;else F.$__.version=2;else if(/^\$p/.test(X))F.$__.version=3;else if(Array.isArray(J))F.$__.version=3;else if(/\.\d+\.|\.\d+$/.test(Z.path))F.$__.version=1}function bB1(F,A,D,Z,J){if(D.$set&&D.$set[Z.path])return;if(typeof J.$__getAtomics==="function"){J.$__getAtomics().forEach(function(q){let W=q[0],C=q[1];n4(F,A,D,Z,C,W)});return}let X=J[h2],$=Object.keys(X),G=$.length,Y,B;if(G===0){if(K1.isMongooseObject(J))J=J.toObject({depopulate:1,_isNested:!0});else if(J.valueOf)J=J.valueOf();return n4(F,A,D,Z,J)}function H(q){return K1.isMongooseObject(q)?q.toObject({depopulate:1,_isNested:!0}):q}while(G--){if(B=$[G],Y=X[B],K1.isMongooseObject(Y))Y=Y.toObject({depopulate:!0,transform:!1,_isNested:!0});else if(Array.isArray(Y))Y=Y.map(H);else if(Y.valueOf)Y=Y.valueOf();if(B==="$addToSet")Y={$each:Y};n4(F,A,D,Z,Y,B)}}function hB1(F,A){let D=F.$__schema.options.skipVersioning;if(!D)return!1;return A=A.replace(/\.\d+\./,"."),D[A]}m.prototype.$clone=function(){let A=new this.constructor;if(A.$isNew=this.$isNew,this._doc)A._doc=C3(this._doc,{retainDocuments:!0});if(this.$__){let Z=new this.$__.constructor;for(let J of Object.getOwnPropertyNames(this.$__)){if(J==="activePaths")continue;Z[J]=C3(this.$__[J])}Object.assign(Z.activePaths,C3({...this.$__.activePaths})),A.$__=Z}return A};m.prototype.$createModifiedPathsSnapshot=function F(){let A=new WeakMap;if(!this.$isSubdocument){let D=this.$getAllSubdocs();for(let Z of D)A.set(Z,Z.$__.activePaths.clone())}return new FB1(A,this.$__.activePaths.clone(),this.$__.version)};m.prototype.$restoreModifiedPathsSnapshot=function F(A){if(this.$__.activePaths=A.activePaths.clone(),this.$__.version=A.version,!this.$isSubdocument){let D=this.$getAllSubdocs();for(let Z of D)if(A.subdocSnapshot.has(Z))Z.$__.activePaths=A.subdocSnapshot.get(Z)}return this};m.prototype.$clearModifiedPaths=function F(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){let A=this.$getAllSubdocs();for(let D of A)D.$clearModifiedPaths()}return this};/*!
306
+ * Check if the given document only has primitive values
307
+ */m.prototype.$__hasOnlyPrimitiveValues=function F(){return!this.$__.populated&&!this.$__.wasPopulated&&(this._doc==null||Object.values(this._doc).every((A)=>{return A==null||typeof A!=="object"||K1.isNativeObject(A)&&!Array.isArray(A)||lg(A,"ObjectId")||lg(A,"Decimal128")}))};/*!
308
+ * Module exports.
309
+ */m.VERSION_WHERE=1;m.VERSION_INC=2;m.VERSION_ALL=3;m.ValidationError=zJ;Xf.exports=Jf=m});var q1=E((FH1)=>{/*!
310
+ * Module dependencies.
311
+ */var vB1=B3().UUID,mB1=iu(),qf=z6(),dB1=F4(),Wf=EW(),FC=K0(),cB1=g6(),lB1=p4(),Cf=vZ(),Qf=Jx(),s4=D2(),pB1=R8(),iB1=bq(),aF=fF(),aB1=nZ(),nB1=sZ(),nF=v9(),{trustedSymbol:y8}=w8(),eW;FH1.specialProperties=nF;FH1.isMongooseArray=Cf.isMongooseArray;FH1.isMongooseDocumentArray=Qf.isMongooseDocumentArray;FH1.registerMongooseArray=Cf.registerMongooseArray;FH1.registerMongooseDocumentArray=Qf.registerMongooseDocumentArray;var AC=/\s/,DC=/\s+/;FH1.toCollectionName=function(F,A){if(F==="system.profile")return F;if(F==="system.indexes")return F;if(typeof A==="function"){if(typeof F!=="string")throw new TypeError("Collection name must be a string");if(F.length===0)throw new TypeError("Collection name cannot be empty");return A(F)}return F};FH1.deepEqual=function F(A,D){if(A===D)return!0;if(typeof A!=="object"||typeof D!=="object")return A===D;if(A instanceof Date&&D instanceof Date)return A.getTime()===D.getTime();if(s4(A,"ObjectId")&&s4(D,"ObjectId")||s4(A,"Decimal128")&&s4(D,"Decimal128"))return A.toString()===D.toString();if(A instanceof RegExp&&D instanceof RegExp)return A.source===D.source&&A.ignoreCase===D.ignoreCase&&A.multiline===D.multiline&&A.global===D.global&&A.dotAll===D.dotAll&&A.unicode===D.unicode&&A.sticky===D.sticky&&A.hasIndices===D.hasIndices;if(A==null||D==null)return!1;if(A.prototype!==D.prototype)return!1;if(A instanceof Map||D instanceof Map){if(!(A instanceof Map)||!(D instanceof Map))return!1;return F(Array.from(A.keys()),Array.from(D.keys()))&&F(Array.from(A.values()),Array.from(D.values()))}if(A instanceof Number&&D instanceof Number)return A.valueOf()===D.valueOf();if(Buffer.isBuffer(A))return FH1.buffer.areEqual(A,D);if(Array.isArray(A)||Array.isArray(D)){if(!Array.isArray(A)||!Array.isArray(D))return!1;let $=A.length;if($!==D.length)return!1;for(let G=0;G<$;++G)if(!F(A[G],D[G]))return!1;return!0}if(A.$__!=null)A=A._doc;else if(aF(A))A=A.toObject();if(D.$__!=null)D=D._doc;else if(aF(D))D=D.toObject();let Z=Object.keys(A),J=Object.keys(D),X=Z.length;if(X!==J.length)return!1;for(let $=X-1;$>=0;$--)if(Z[$]!==J[$])return!1;for(let $ of Z)if(!F(A[$],D[$]))return!1;return!0};FH1.last=function(F){if(F.length>0)return F[F.length-1];return};/*!
312
+ * ignore
313
+ */FH1.promiseOrCallback=aB1;/*!
314
+ * ignore
315
+ */FH1.cloneArrays=function F(A){if(!Array.isArray(A))return A;return A.map((D)=>FH1.cloneArrays(D))};/*!
316
+ * ignore
317
+ */FH1.omit=function F(A,D){if(D==null)return Object.assign({},A);if(!Array.isArray(D))D=[D];let Z=Object.assign({},A);for(let J of D)delete Z[J];return Z};FH1.merge=function F(A,D,Z,J){Z=Z||{};let X=Object.keys(D),$=0,G=X.length,Y;if(D[y8])A[y8]=D[y8];J=J||"";let B=Z.omitNested||{};while($<G){if(Y=X[$++],Z.omit&&Z.omit[Y])continue;if(B[J])continue;if(nF.has(Y))continue;if(A[Y]==null)if(pB1(D[Y]))A[Y]={...D[Y]};else if(Array.isArray(D[Y]))A[Y]=[...D[Y]];else A[Y]=D[Y];else if(FH1.isObject(D[Y])){if(!FH1.isObject(A[Y]))A[Y]={};if(D[Y]!=null){if(Z.isDiscriminatorSchemaMerge&&(D[Y].$isSingleNested&&A[Y].$isMongooseDocumentArray)||D[Y].$isMongooseDocumentArray&&A[Y].$isSingleNested)continue;else if(D[Y].instanceOfSchema){if(A[Y].instanceOfSchema)nB1(A[Y],D[Y].clone(),Z.isDiscriminatorSchemaMerge);else A[Y]=D[Y].clone();continue}else if(s4(D[Y],"ObjectId")){A[Y]=new dB1(D[Y]);continue}}F(A[Y],D[Y],Z,J?J+"."+Y:Y)}else if(Z.overwrite)A[Y]=D[Y]}return A};FH1.toObject=function F(A){eW||(eW=r2());let D;if(A==null)return A;if(A instanceof eW)return A.toObject();if(Array.isArray(A)){D=[];for(let Z of A)D.push(F(Z));return D}if(FH1.isPOJO(A)){if(D={},A[y8])D[y8]=A[y8];for(let Z of Object.keys(A)){if(nF.has(Z))continue;D[Z]=F(A[Z])}return D}return A};FH1.isObject=lB1;FH1.isPOJO=R8();FH1.isNonBuiltinObject=function F(A){return typeof A==="object"&&!FH1.isNativeObject(A)&&!FH1.isMongooseType(A)&&!(A instanceof vB1)&&A!=null};FH1.isNativeObject=function(F){return Array.isArray(F)||F instanceof Date||F instanceof Boolean||F instanceof Number||F instanceof String};FH1.isEmptyObject=function(F){return F!=null&&typeof F==="object"&&Object.keys(F).length===0};FH1.hasKey=function F(A,D){let Z=Object.keys(A);for(let J of Z){if(J===D)return!0;if(FH1.isPOJO(A[J])&&FH1.hasKey(A[J],D))return!0}return!1};FH1.tick=function F(A){if(typeof A!=="function")return;return function(){try{A.apply(this,arguments)}catch(D){cB1(function(){throw D})}}};FH1.isMongooseType=function(F){return s4(F,"ObjectId")||s4(F,"Decimal128")||F instanceof Buffer};FH1.isMongooseObject=aF;FH1.expires=function F(A){if(!(A&&A.constructor.name==="Object"))return;if(!("expires"in A))return;A.expireAfterSeconds=typeof A.expires!=="string"?A.expires:Math.round(mB1(A.expires)/1000),delete A.expires};FH1.populate=function F(A,D,Z,J,X,$,G,Y){let B=null;if(arguments.length===1){if(A instanceof Wf)return A._docs={},A._childDocs=[],[A];if(Array.isArray(A))return H(A).map((W)=>FH1.populate(W)[0]);if(FH1.isObject(A))B=Object.assign({},A);else B={path:A}}else if(typeof Z==="object")B={path:A,select:D,match:Z,options:J};else B={path:A,select:D,model:Z,match:J,options:X,populate:$,justOne:G,count:Y};if(typeof B.path!=="string"&&!(Array.isArray(B.path)&&B.path.every((q)=>typeof q==="string")))throw new TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `"+typeof A+"`");return sB1(B);function H(q){let W=[];return q.forEach(function(C){if(AC.test(C.path))C.path.split(DC).forEach(function(K){let U=Object.assign({},C);U.path=K,W.push(U)});else W.push(C)}),W}};function sB1(F){if(Array.isArray(F.populate)){let Z=[];F.populate.forEach(function(J){if(AC.test(J.path)){let X=Object.assign({},J);X.path.split(DC).forEach(function(G){X.path=G,Z.push(FH1.populate(X)[0])})}else Z.push(FH1.populate(J)[0])}),F.populate=FH1.populate(Z)}else if(F.populate!=null&&typeof F.populate==="object")F.populate=FH1.populate(F.populate);let A=[],D=AC.test(F.path)?F.path.split(DC):Array.isArray(F.path)?F.path:[F.path];if(F.options!=null)F.options=FC(F.options);for(let Z of D)A.push(new Wf(Object.assign({},F,{path:Z})));return A}FH1.getValue=function(F,A,D){return qf.get(F,A,tB1,D)};/*!
318
+ * ignore
319
+ */var rB1=Object.freeze({getters:!1});function tB1(F,A){if(A==="$*"&&F instanceof Map)return F;let D=F?._doc||F;if(D!=null&&D.isMongooseArrayProxy)D=D.__array;return D instanceof Map?D.get(A,rB1):D[A]}FH1.setValue=function(F,A,D,Z,J){qf.set(F,A,D,"_doc",Z,J)};FH1.object={};FH1.object.vals=function F(A){let D=Object.keys(A),Z=D.length,J=[];while(Z--)J.push(A[D[Z]]);return J};var oB1=Object.prototype.hasOwnProperty;FH1.object.hasOwnProperty=function(F,A){return oB1.call(F,A)};FH1.isNullOrUndefined=function(F){return F===null||F===void 0};/*!
320
+ * ignore
321
+ */FH1.array={};FH1.array.flatten=function F(A,D,Z){return Z||(Z=[]),A.forEach(function(J){if(Array.isArray(J))F(J,D,Z);else if(!D||D(J))Z.push(J)}),Z};/*!
322
+ * ignore
323
+ */var eB1=Object.prototype.hasOwnProperty;FH1.hasUserDefinedProperty=function(F,A){if(F==null)return!1;if(Array.isArray(A)){for(let D of A)if(FH1.hasUserDefinedProperty(F,D))return!0;return!1}if(eB1.call(F,A))return!0;if(typeof F==="object"&&A in F){let D=F[A];return D!==Object.prototype[A]&&D!==Array.prototype[A]}return!1};/*!
324
+ * ignore
325
+ */var $f=Math.pow(2,32)-1;FH1.isArrayIndex=function(F){if(typeof F==="number")return F>=0&&F<=$f;if(typeof F==="string"){if(!/^\d+$/.test(F))return!1;return F=+F,F>=0&&F<=$f}return!1};FH1.array.unique=function(F){let A=new Set,D=new Set,Z=[];for(let J of F)if(typeof J==="number"||typeof J==="string"||J==null){if(A.has(J))continue;Z.push(J),A.add(J)}else if(s4(J,"ObjectId")){if(D.has(J.toString()))continue;Z.push(J),D.add(J.toString())}else Z.push(J);return Z};FH1.buffer={};FH1.buffer.areEqual=function(F,A){if(!Buffer.isBuffer(F))return!1;if(!Buffer.isBuffer(A))return!1;if(F.length!==A.length)return!1;for(let D=0,Z=F.length;D<Z;++D)if(F[D]!==A[D])return!1;return!0};FH1.getFunctionName=iB1;FH1.decorate=function(F,A){for(let D in A){if(nF.has(D))continue;F[D]=A[D]}};FH1.mergeClone=function(F,A){if(aF(A))A=A.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});let D=Object.keys(A),Z=D.length,J=0,X;while(J<Z){if(X=D[J++],nF.has(X))continue;if(typeof F[X]==="undefined")F[X]=FC(A[X],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{let $=A[X];if($!=null&&$.valueOf&&!($ instanceof Date))$=$.valueOf();if(FH1.isObject($)){let G=$;if(aF($)&&!$.isMongooseBuffer)G=G.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});if($.isMongooseBuffer)G=Buffer.from(G);FH1.mergeClone(F[X],G)}else F[X]=FC($,{flattenDecimals:!1})}}};FH1.each=function(F,A){for(let D of F)A(D)};FH1.renameObjKey=function(F,A,D){return Object.keys(F).reduce((J,X)=>{if(X===A)J[D]=F[A];else J[X]=F[X];return J},{})};/*!
326
+ * ignore
327
+ */FH1.getOption=function(F){let A=Array.prototype.slice.call(arguments,1);for(let D of A){if(D==null)continue;if(D[F]!=null)return D[F]}return null};/*!
328
+ * ignore
329
+ */FH1.noop=function(){};FH1.errorToPOJO=function F(A){if(!(A instanceof Error))throw new Error("`error` must be `instanceof Error`.");let Z={};for(let J of Object.getOwnPropertyNames(A))Z[J]=A[J];return Z};/*!
330
+ * ignore
331
+ */FH1.warn=function F(A){return process.emitWarning(A,{code:"MONGOOSE"})};FH1.injectTimestampsOption=function F(A,D){if(D==null)return;A.timestamps=D}});var _0=E((wJ,If)=>{/*!
332
+ * Module dependencies.
333
+ */var sF=a2(),wf=U6(),uH1=iZ(),xH1=QW(),RJ=K0(),XC=vu(),gH1=du(),$C=lu(),Uf=g6(),fH1=A1().schemaTypeSymbol,s9=q1(),Pf=A1().validatorErrorSymbol,yH1=A1().documentIsModified,zf=A1().populateModelSymbol,YC=sF.CastError,GC=sF.ValidatorError,bH1={_skipMarkModified:!0};function U1(F,A,D){this[fH1]=!0,this.path=F,this.instance=D,this.validators=[],this.getters=this.constructor.hasOwnProperty("getters")?this.constructor.getters.slice():[],this.setters=this.constructor.hasOwnProperty("setters")?this.constructor.setters.slice():[],this.splitPath(),A=A||{};let Z=this.constructor.defaultOptions||{},J=Object.keys(Z);for(let G of J)if(G==="validate")this.validate(Z.validate);else if(Z.hasOwnProperty(G)&&!Object.prototype.hasOwnProperty.call(A,G))A[G]=Z[G];if(A.select==null)delete A.select;let X=this.OptionsConstructor||wf;if(this.options=new X(A),this._index=null,s9.hasUserDefinedProperty(this.options,"immutable"))this.$immutable=this.options.immutable,XC(this);let $=Object.keys(this.options);for(let G of $){if(G==="cast"){if(Array.isArray(this.options[G]))this.castFunction.apply(this,this.options[G]);else this.castFunction(this.options[G]);continue}if(s9.hasUserDefinedProperty(this.options,G)&&typeof this[G]==="function"){if(G==="index"&&this._index){if(A.index===!1){let H=this._index;if(typeof H==="object"&&H!=null){if(H.unique)throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(H.sparse)throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}let Y=A[G];if(G==="default"){this.default(Y);continue}let B=Array.isArray(Y)?Y:[Y];this[G].apply(this,B)}}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}U1.prototype.OptionsConstructor=wf;U1.prototype.path;U1.prototype.validators;U1.prototype.isRequired;U1.prototype.splitPath=function(){if(this._presplitPath!=null)return this._presplitPath;if(this.path==null)return;return this._presplitPath=this.path.indexOf(".")===-1?[this.path]:this.path.split("."),this._presplitPath};U1.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=(D)=>D;return this._cast=A,this._cast};U1.prototype.castFunction=function F(A,D){if(arguments.length===0)return this._castFunction;if(A===!1)A=this.constructor._defaultCaster||((Z)=>Z);if(typeof A==="string")return this._castErrorMessage=A,this._castFunction;if(A!=null)this._castFunction=A;if(D!=null)this._castErrorMessage=D;return this._castFunction};U1.prototype.cast=function F(){throw new Error("Base SchemaType class does not implement a `cast()` function")};U1.set=function F(A,D){if(!this.hasOwnProperty("defaultOptions"))this.defaultOptions=Object.assign({},this.defaultOptions);this.defaultOptions[A]=D};U1.get=function(F){this.getters=this.hasOwnProperty("getters")?this.getters:[],this.getters.push(F)};U1.prototype.default=function(F){if(arguments.length===1){if(F===void 0){this.defaultValue=void 0;return}if(F!=null&&F.instanceOfSchema)throw new sF("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=F,this.defaultValue}else if(arguments.length>1)this.defaultValue=[...arguments];return this.defaultValue};U1.prototype.index=function(F){return this._index=F,s9.expires(this._index),this};U1.prototype.unique=function F(A,D){if(this._index===!1){if(!A)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}if(!this.options.hasOwnProperty("index")&&A===!1)return this;if(this._index==null||this._index===!0)this._index={};else if(typeof this._index==="string")this._index={type:this._index};if(this._index.unique=!!A,typeof D==="string")this._duplicateKeyErrorMessage=D;return this};U1.prototype.text=function(F){if(this._index===!1){if(!F)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}if(!this.options.hasOwnProperty("index")&&F===!1)return this;if(this._index===null||this._index===void 0||typeof this._index==="boolean")this._index={};else if(typeof this._index==="string")this._index={type:this._index};return this._index.text=F,this};U1.prototype.sparse=function(F){if(this._index===!1){if(!F)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}if(!this.options.hasOwnProperty("index")&&F===!1)return this;if(this._index==null||typeof this._index==="boolean")this._index={};else if(typeof this._index==="string")this._index={type:this._index};return this._index.sparse=F,this};U1.prototype.immutable=function(F){return this.$immutable=F,XC(this),this};U1.prototype.transform=function(F){return this.options.transform=F,this};U1.prototype.set=function(F){if(typeof F!=="function")throw new TypeError("A setter must be a function.");return this.setters.push(F),this};U1.prototype.get=function(F){if(typeof F!=="function")throw new TypeError("A getter must be a function.");return this.getters.push(F),this};U1.prototype.validateAll=function(F){for(let A=0;A<F.length;A++)this.validate(F[A]);return this};U1.prototype.validate=function(F,A,D){if(typeof F==="function"||F&&s9.getFunctionName(F.constructor)==="RegExp"){let $;if(typeof A==="function")$={validator:F,message:A},$.type=D||"user defined";else if(A instanceof Object&&!D){if($=$C(A)?Object.assign({},A):RJ(A),!$.message)$.message=$.msg;$.validator=F,$.type=$.type||"user defined"}else{if(A==null)A=sF.messages.general.default;if(!D)D="user defined";$={message:A,type:D,validator:F}}return this.validators.push($),this}let Z,J,X;for(Z=0,J=arguments.length;Z<J;Z++){if(X=arguments[Z],!s9.isPOJO(X)){let $="Invalid validator. Received ("+typeof X+") "+X+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()";throw new Error($)}this.validate(X.validator,X)}return this};U1.prototype.required=function(F,A){let D={};if(arguments.length>0&&F==null)return this.validators=this.validators.filter(function(X){return X.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;if(typeof F==="object")D=F,A=D.message||A,F=F.isRequired;if(F===!1)return this.validators=this.validators.filter(function(X){return X.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;let Z=this;if(this.isRequired=!0,this.requiredValidator=function(X){let $=this&&this.$__&&this.$__.cachedRequired;if($!=null&&!this.$__isSelected(Z.path)&&!this[yH1](Z.path))return!0;if($!=null&&Z.path in $){let G=$[Z.path]?Z.checkRequired(X,this):!0;return delete $[Z.path],G}else if(typeof F==="function")return F.apply(this)?Z.checkRequired(X,this):!0;return Z.checkRequired(X,this)},this.originalRequiredValue=F,typeof F==="string")A=F,F=void 0;let J=A||sF.messages.general.required;return this.validators.unshift(Object.assign({},D,{validator:this.requiredValidator,message:J,type:"required"})),this};U1.prototype.ref=function(F){return this.options.ref=F,this};U1.prototype.getDefault=function(F,A,D){let Z;if(typeof this.defaultValue==="function")if(this.defaultValue===Date.now||this.defaultValue===Array||this.defaultValue.name.toLowerCase()==="objectid")Z=this.defaultValue.call(F);else Z=this.defaultValue.call(F,F);else Z=this.defaultValue;if(Z!==null&&Z!==void 0){if(typeof Z==="object"&&(!this.options||!this.options.shared))Z=RJ(Z);if(D&&D.skipCast)return this._applySetters(Z,F);let J=this.applySetters(Z,F,A,void 0,bH1);if(J&&!Array.isArray(J)&&J.$isSingleNested)J.$__parent=F;return J}return Z};U1.prototype._applySetters=function(F,A,D,Z,J){let X=F;if(D)return X;let $=this.setters;for(let G=$.length-1;G>=0;G--)X=$[G].call(A,X,Z,this,J);return X};/*!
334
+ * ignore
335
+ */U1.prototype._castNullish=function F(A){return A};U1.prototype.applySetters=function(F,A,D,Z,J){let X=this._applySetters(F,A,D,Z,J);if(X==null)return this._castNullish(X);return X=this.cast(X,A,D,Z,J),X};U1.prototype.applyGetters=function(F,A){let D=F,Z=this.getters,J=Z.length;if(J===0)return D;for(let X=0;X<J;++X)D=Z[X].call(A,D,this);return D};U1.prototype.select=function F(A){return this.selected=!!A,this};U1.prototype.doValidate=function(F,A,D,Z){let J=!1,X=this.path;if(typeof A!=="function")throw new TypeError(`Must pass callback function to doValidate(), got ${typeof A}`);let $=this.validators.filter((B)=>typeof B==="object"&&B!==null),G=$.length;if(!G)return A(null);for(let B=0,H=$.length;B<H;++B){if(J)break;let q=$[B],W=q.validator,C,Q=$C(q)?Object.assign({},q):RJ(q);if(Q.path=Z&&Z.path?Z.path:X,Q.fullPath=this.$fullPath,Q.value=F,W instanceof RegExp){Y(W.test(F),Q,D);continue}if(typeof W!=="function")continue;if(F===void 0&&W!==this.requiredValidator){Y(!0,Q,D);continue}try{if(Q.propsParameter)C=W.call(D,F,Q);else C=W.call(D,F)}catch(K){if(C=!1,Q.reason=K,K.message)Q.message=K.message}if(C!=null&&typeof C.then==="function")C.then(function(K){Y(K,Q,D)},function(K){Q.reason=K,Q.message=K.message,C=!1,Y(C,Q,D)});else Y(C,Q,D)}function Y(B,H,q){if(J)return;if(B===void 0||B){if(--G<=0)Uf(function(){A(null)})}else J=new(H.ErrorConstructor||GC)(H,q),J[Pf]=!0,Uf(function(){A(J)})}};function Vf(F,A){if(F!==void 0&&!F){let Z=new(A.ErrorConstructor||GC)(A);return Z[Pf]=!0,Z}}U1.prototype.doValidateSync=function(F,A,D){let Z=this.path;if(!this.validators.length)return null;let X=this.validators;if(F===void 0)if(this.validators.length!==0&&this.validators[0].type==="required")X=[this.validators[0]];else return null;let $=null,G=0,Y=X.length;for(G=0;G<Y;++G){let B=X[G];if(B===null||typeof B!=="object")continue;let H=B.validator,q=$C(B)?Object.assign({},B):RJ(B);q.path=D&&D.path?D.path:Z,q.fullPath=this.$fullPath,q.value=F;let W=!1;if(gH1(H))continue;if(H instanceof RegExp){$=Vf(H.test(F),q);continue}if(typeof H!=="function")continue;try{if(q.propsParameter)W=H.call(A,F,q);else W=H.call(A,F)}catch(C){W=!1,q.reason=C}if(W!=null&&typeof W.then==="function")continue;if($=Vf(W,q),$)break}return $};U1._isRef=function(F,A,D,Z){let J=Z&&F.options&&(F.options.ref||F.options.refPath);if(!J&&D&&D.$__!=null){let X=D.$__fullPath(F.path,!0),$=D.ownerDocument();J=X!=null&&$.$populated(X)||D.$populated(F.path)}if(J){if(A==null)return!0;if(!Buffer.isBuffer(A)&&A._bsontype!=="Binary"&&s9.isObject(A))return!0;return Z}return!1};/*!
336
+ * ignore
337
+ */U1.prototype._castRef=function F(A,D,Z,J){if(A==null)return A;if(A.$__!=null)return A.$__.wasPopulated=A.$__.wasPopulated||{value:A._doc._id},A;if(Buffer.isBuffer(A)||!s9.isObject(A)){if(Z)return A;throw new YC(this.instance,A,this.path,null,this)}let X=D.$__fullPath(this.path,!0),G=D.ownerDocument().$populated(X,!0),Y=A;if(!D.$__.populated||!D.$__.populated[X]||!D.$__.populated[X].options||!D.$__.populated[X].options.options||!D.$__.populated[X].options.options.lean){let B=G?G.options[zf]:D.constructor.db.model(this.options.ref);Y=B.hydrate(A,null,J),Y.$__.wasPopulated={value:Y._doc._id,options:{[zf]:B}}}return Y};/*!
338
+ * ignore
339
+ */function Lf(F,A){return this.castForQuery(null,F,A)}/*!
340
+ * ignore
341
+ */function hH1(F,A){let D=this;if(!Array.isArray(F))return[this.castForQuery(null,F,A)];return F.map(function(Z){return D.castForQuery(null,Z,A)})}function Rf(F,A){let D=this;if(!Array.isArray(F))return[this.castForQuery(null,F,A)];return F.map(function(Z){if(Array.isArray(Z)&&Z.length===0)return Z;return D.castForQuery(null,Z,A)})}/*!
342
+ * ignore
343
+ */U1.prototype.$conditionalHandlers={$all:hH1,$eq:Lf,$in:Rf,$ne:Lf,$nin:Rf,$exists:uH1,$type:xH1};U1.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=this.$conditionalHandlers[F],!Z)throw new Error("Can't use "+F);return Z.call(this,A,D)}try{return this.applySetters(A,D)}catch(J){if(J instanceof YC&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};U1.checkRequired=function(F){if(arguments.length!==0)this._checkRequired=F;return this._checkRequired};U1.prototype.checkRequired=function(F){return F!=null};U1.prototype.clone=function(){let F=Object.assign({},this.options),A=new this.constructor(this.path,F,this.instance);if(A.validators=this.validators.slice(),this.requiredValidator!==void 0)A.requiredValidator=this.requiredValidator;if(this.defaultValue!==void 0)A.defaultValue=this.defaultValue;if(this.$immutable!==void 0&&this.options.immutable===void 0)A.$immutable=this.$immutable,XC(A);if(this._index!==void 0)A._index=this._index;if(this.selected!==void 0)A.selected=this.selected;if(this.isRequired!==void 0)A.isRequired=this.isRequired;if(this.originalRequiredValue!==void 0)A.originalRequiredValue=this.originalRequiredValue;return A.getters=this.getters.slice(),A.setters=this.setters.slice(),A};U1.prototype.getEmbeddedSchemaType=function F(){return this.$embeddedSchemaType};/*!
344
+ * If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string.
345
+ *
346
+ * @api private
347
+ */U1.prototype._duplicateKeyErrorMessage=null;U1.prototype.toJSONSchema=function F(){throw new Error("Converting unsupported SchemaType to JSON Schema: "+this.instance)};/*!
348
+ * Module exports.
349
+ */If.exports=wJ=U1;wJ.CastError=YC;wJ.ValidatorError=GC});var BC=E((PT1,Mf)=>{var Q3=v6();class V6{constructor(F){if(Object.assign(this,F),F!=null&&F.options!=null)this.options=Object.assign({},F.options)}}Object.defineProperty(V6.prototype,"ref",Q3);Object.defineProperty(V6.prototype,"refPath",Q3);Object.defineProperty(V6.prototype,"localField",Q3);Object.defineProperty(V6.prototype,"foreignField",Q3);Object.defineProperty(V6.prototype,"justOne",Q3);Object.defineProperty(V6.prototype,"count",Q3);Object.defineProperty(V6.prototype,"match",Q3);Object.defineProperty(V6.prototype,"options",Q3);Object.defineProperty(V6.prototype,"skip",Q3);Object.defineProperty(V6.prototype,"limit",Q3);Object.defineProperty(V6.prototype,"perDocumentLimit",Q3);Mf.exports=V6});var PJ=E((IT1,Nf)=>{Nf.exports=function F(A,D,Z){if(A==null)return A;if(A._doc!=null)A=A._doc;if(arguments.length>=3){if(typeof A!=="object")return;if(Z===void 0)return;if(A instanceof Map)A.set(D,Z);else A[D]=Z;return Z}if(D==="$*")return A instanceof Map?Array.from(A.values()):Object.keys(A).map((J)=>A[J]);if(A instanceof Map)return A.get(D);return A[D]}});var HC=E((MT1,Of)=>{var vH1=w1(),mH1=MW(),jf=PJ(),Tf=z6(),dH1=i("node:util"),cH1=q1(),kf=/(\.\d+$|\.\d+\.)/g;Of.exports=function F(A,D,Z,J,X){if(A==null)return[];if(typeof A==="string"&&X!=null&&mH1(X,A))throw new vH1("refPath `"+A+"` must not be excluded in projection, got "+dH1.inspect(X));if(kf.test(Z)){let Y=Z.split(kf);if(Y[Y.length-1]==="")throw new Error("Can't populate individual element in an array");let B="",H=A;for(let C=0;C<Y.length;C+=2){let Q=Y[C];if(H.startsWith(Q+"."))B+=H.substring(0,Q.length)+Y[C+1],H=H.substring(Q.length+1);else if(C===Y.length-1){B+=H,H="";break}else throw new Error("Could not normalize ref path, chunk "+Q+" not in populated path")}let q=Tf.get(B,D,jf),W=Array.isArray(q)?q:[q];return W=cH1.array.flatten(W),W}let $=Tf.get(A,D,jf),G;if(J!=null&&J.virtuals.hasOwnProperty(A))G=[J.virtuals[A].applyGetters(void 0,D)];else G=Array.isArray($)?$:[$];return G}});var IJ=E((NT1,Sf)=>{var lH1=HC(),pH1=q1(),iH1=A1().modelSymbol;function J4(F,A){this.path=A,this.getters=[],this.setters=[],this.options=Object.assign({},F)}J4.prototype._applyDefaultGetters=function(){if(this.getters.length>0||this.setters.length>0)return;let A="$"+this.path;this.getters.push(function(){return this.$locals[A]}),this.setters.push(function(D){this.$locals[A]=D})};/*!
350
+ * ignore
351
+ */J4.prototype.clone=function(){let F=new J4(this.options,this.path);return F.getters=[].concat(this.getters),F.setters=[].concat(this.setters),F};J4.prototype.get=function(F){return this.getters.push(F),this};J4.prototype.set=function(F){return this.setters.push(F),this};J4.prototype.applyGetters=function(F,A){if(pH1.hasUserDefinedProperty(this.options,["ref","refPath"])&&A.$$populatedVirtuals&&A.$$populatedVirtuals.hasOwnProperty(this.path))F=A.$$populatedVirtuals[this.path];let D=F;for(let Z of this.getters)D=Z.call(A,D,this,A);return D};J4.prototype.applySetters=function(F,A){let D=F;for(let Z of this.setters)D=Z.call(A,D,this,A);return D};J4.prototype._getModelNamesForPopulate=function F(A){if(this.options.refPath)return lH1(this.options.refPath,A,this.path);let D=null;if(typeof this.options.ref==="function"&&!this.options.ref[iH1])D=this.options.ref.call(A,A);else D=this.options.ref;if(D!=null&&!Array.isArray(D))return[D];return D};/*!
352
+ * exports
353
+ */Sf.exports=J4});var qC=E((jT1,_f)=>{_f.exports=function F(A){let D={_id:{auto:!0}};D._id[A.options.typeKey]="ObjectId",A.add(D)}});var WC=E((TT1,uf)=>{uf.exports=function F(A,D){let Z=A.discriminatorMapping&&A.discriminatorMapping.value;if(Z&&!("sparse"in D)){let J=A.options.discriminatorKey;D.partialFilterExpression=D.partialFilterExpression||{},D.partialFilterExpression[J]=Z}return D}});var gf=E((kT1,xf)=>{var CC=L0(),aH1=p4(),nH1=WC();xf.exports=function F(A){let D=[],Z=new WeakMap,J=A.constructor.indexTypes,X=new Map;return $(A),D;function $(Y,B,H){if(Z.has(Y))return;Z.set(Y,!0),B=B||"";let q=Object.keys(Y.paths);for(let W of q){let C=Y.paths[W];if(H!=null&&H.paths[W])continue;if(C._duplicateKeyErrorMessage!=null)Y._duplicateKeyErrorMessagesByPath=Y._duplicateKeyErrorMessagesByPath||{},Y._duplicateKeyErrorMessagesByPath[W]=C._duplicateKeyErrorMessage;if(C.$isMongooseDocumentArray||C.$isSingleNested){if(CC(C,"options.excludeIndexes")!==!0&&CC(C,"schemaOptions.excludeIndexes")!==!0&&CC(C,"schema.options.excludeIndexes")!==!0)$(C.schema,B+W+".");if(C.schema.discriminators!=null){let K=C.schema.discriminators,U=Object.keys(K);for(let z of U)$(K[z],B+W+".",C.schema)}if(C.$isMongooseDocumentArray)continue}let Q=C._index||C.caster&&C.caster._index;if(Q!==!1&&Q!==null&&Q!==void 0){let K={},U=aH1(Q),z=U?Q:{},L=typeof Q==="string"?Q:U?Q.type:!1;if(L&&J.indexOf(L)!==-1)K[B+W]=L;else if(z.text)K[B+W]="text",delete z.text;else{let P=!1;if(Q==="descending"||Q==="desc")P=!0;else if(Q==="ascending"||Q==="asc")P=!1;else P=Number(Q)===-1;K[B+W]=P?-1:1}if(delete z.type,!("background"in z))z.background=!0;if(Y.options.autoIndex!=null)z._autoIndex=Y.options.autoIndex;let V=z&&z.name;if(typeof V==="string")if(X.has(V))Object.assign(X.get(V),K);else D.push([K,z]),X.set(V,K);else D.push([K,z]),X.set(V,K)}}if(Z.delete(Y),B)G(Y,B);else Y._indexes.forEach(function(W){let C=W[1];if(!("background"in C))C.background=!0;nH1(Y,C)}),D=D.concat(Y._indexes)}function G(Y,B){let H=Y._indexes,q=H.length;for(let W=0;W<q;++W){let C=H[W][0],Q=H[W][1],K=Object.keys(C),U=K.length,z={};for(let V=0;V<U;++V){let P=K[V];z[B+P]=C[P]}let L=Object.assign({},Q);if(Q!=null&&Q.partialFilterExpression!=null){L.partialFilterExpression={};let V=Q.partialFilterExpression;for(let P of Object.keys(V))L.partialFilterExpression[B+P]=V[P]}D.push([z,L])}}}});var QC=E((OT1,ff)=>{ff.exports=function F(A){switch(A){case"p":A="primary";break;case"pp":A="primaryPreferred";break;case"s":A="secondary";break;case"sp":A="secondaryPreferred";break;case"n":A="nearest";break}return A}});var bf=E((ST1,yf)=>{/*!
354
+ * ignore
355
+ */yf.exports=function F(A){if(!(!A.paths.id&&A.paths._id&&A.options.id))return A;if(A.aliases&&A.aliases.id)return A;return A.virtual("id").get(sH1),A};function sH1(){if(this._id!=null)return this._id.toString();return null}});var vf=E((_T1,hf)=>{hf.exports=function F(A,D){let Z=Object.keys(A),J=Object.keys(D);if(Z.length!==J.length)return!1;for(let X=0;X<Z.length;X++){let $=Z[X];if($!==J[X]||A[$]!==D[$])return!1}return!0}});var df=E((uT1,mf)=>{mf.exports=function F(A,D,Z,J){if(J.justOne||J.count){if(A[D]=Array.isArray(Z)?Z[0]:Z,typeof A[D]!=="object")A[D]=J.count?Z:null}else A[D]=Array.isArray(Z)?Z:Z==null?[]:[Z],A[D]=A[D].filter(function(X){return X&&typeof X==="object"});return A[D]}});var rF=E((xT1,cf)=>{cf.exports=function F(A){return A.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}});var MJ=E((gT1,lf)=>{lf.exports=rH1;/*!
356
+ * ignore
357
+ */function rH1(F,A){if(F==null)return null;if(typeof F==="boolean")return A;if(typeof F[A]==="boolean")return F[A]?A:null;if(!(A in F))return A;return F[A]}});var EC=E((fT1,pf)=>{var tH1=rF(),X4=MJ();pf.exports=r9;/*!
358
+ * ignore
359
+ */function r9(F,A,D){if(A==null)return;if(Object.keys(A).some((G)=>G[0]==="$")){if(A.$push)$(A.$push);if(A.$addToSet)$(A.$addToSet);if(A.$set!=null){let G=Object.keys(A.$set);for(let Y of G)KC(D,Y,A.$set,F)}if(A.$setOnInsert!=null){let G=Object.keys(A.$setOnInsert);for(let Y of G)KC(D,Y,A.$setOnInsert,F)}}let X=Object.keys(A).filter((G)=>G[0]!=="$");for(let G of X)KC(D,G,A,F);function $(G){for(let Y of Object.keys(G)){let B=D.path(Y.replace(/\.\$\./i,".").replace(/.\$$/,""));if(G[Y]&&B&&B.$isMongooseDocumentArray&&B.schema.options.timestamps){let H=B.schema.options.timestamps,q=X4(H,"createdAt"),W=X4(H,"updatedAt");if(G[Y].$each)G[Y].$each.forEach(function(C){if(W!=null)C[W]=F;if(q!=null)C[q]=F;r9(F,C,B.schema)});else{if(W!=null)G[Y][W]=F;if(q!=null)G[Y][q]=F;r9(F,G[Y],B.schema)}}}}}function oH1(F,A,D){let Z=A.schema.options.timestamps,J=F.length;if(!Z){for(let G=0;G<J;++G)r9(D,F[G],A.schema);return}let X=X4(Z,"createdAt"),$=X4(Z,"updatedAt");for(let G=0;G<J;++G){if($!=null)F[G][$]=D;if(X!=null)F[G][X]=D;r9(D,F[G],A.schema)}}function eH1(F,A,D){let Z=A.schema.options.timestamps;if(!Z){r9(D,F,A.schema);return}let J=X4(Z,"createdAt"),X=X4(Z,"updatedAt");if(X!=null)F[X]=D;if(J!=null)F[J]=D;r9(D,F,A.schema)}function KC(F,A,D,Z){let J=tH1(A),X=F.path(J);if(!X)return;let $=[],G=J.split(".");for(let Y=G.length-1;Y>0;--Y){let B=F.path(G.slice(0,Y).join("."));if(B!=null&&(B.$isMongooseDocumentArray||B.$isSingleNested))$.push({parentPath:A.split(".").slice(0,Y).join("."),parentSchemaType:B})}if(Array.isArray(D[A])&&X.$isMongooseDocumentArray)oH1(D[A],X,Z);else if(D[A]&&X.$isSingleNested)eH1(D[A],X,Z);else if($.length>0)for(let Y of $){let{parentPath:B,parentSchemaType:H}=Y,q=H.schema.options.timestamps,W=X4(q,"updatedAt");if(!q||W==null)continue;if(H.$isSingleNested)D[B+"."+W]=Z;else if(H.$isMongooseDocumentArray){let C=A.substring(B.length+1);if(/^\d+$/.test(C)){D[B+"."+C][W]=Z;continue}let Q=C.indexOf(".");C=Q!==-1?C.substring(0,Q):C,D[B+"."+C+"."+W]=Z}}else if(X.schema!=null&&X.schema!=F&&D[A]){let Y=X.schema.options.timestamps,B=X4(Y,"createdAt"),H=X4(Y,"updatedAt");if(!Y)return;if(H!=null)D[A][H]=Z;if(B!=null)D[A][B]=Z}}});var UC=E((yT1,af)=>{/*!
360
+ * ignore
361
+ */var Fq1=L0();af.exports=Aq1;/*!
362
+ * ignore
363
+ */function Aq1(F,A,D,Z,J,X){let $=Z,G=$,Y=Fq1(J,"timestamps",!0);if(!Y||$==null)return Z;let B=Y!=null&&Y.createdAt===!1,H=Y!=null&&Y.updatedAt===!1;if(X){if(Z&&Z.$set)Z=Z.$set,$.$set={},G=$.$set;if(!H&&D&&!Z[D])G[D]=F;if(!B&&A&&!Z[A])G[A]=F;return $}if(Z=Z||{},Array.isArray($)){if(D==null)return $;return $.push({$set:{[D]:F}}),$}if($.$set=$.$set||{},!H&&D&&(!Z.$currentDate||!Z.$currentDate[D])){let q=!1;if(D.indexOf(".")!==-1){let W=D.split(".");for(let C=1;C<W.length;++C){let Q=W.slice(-C).join("."),K=W.slice(0,-C).join(".");if(Z[K]!=null){Z[K][Q]=F,q=!0;break}else if(Z.$set&&Z.$set[K]){Z.$set[K][Q]=F,q=!0;break}}}if(!q)$.$set[D]=F;if($.hasOwnProperty(D))delete $[D]}if(!B&&A){if(Z[A])delete Z[A];if(Z.$set&&Z.$set[A])delete Z.$set[A];let q=!1;if(A.indexOf(".")!==-1){let W=A.split(".");for(let C=1;C<W.length;++C){let Q=W.slice(-C).join("."),K=W.slice(0,-C).join(".");if(Z[K]!=null){Z[K][Q]=F,q=!0;break}else if(Z.$set&&Z.$set[K]){Z.$set[K][Q]=F,q=!0;break}}}if(!q)$.$setOnInsert=$.$setOnInsert||{},$.$setOnInsert[A]=F}if(Object.keys($.$set).length===0)delete $.$set;return $}});var sf=E((bT1,nf)=>{nf.exports=function F(A,D,Z,J,X){let $=D!=null&&D.updatedAt===!1,G=D!=null&&D.createdAt===!1,Y=Z!=null?Z():A.ownerDocument().constructor.base.now();if(!G&&(A.isNew||A.$isSubdocument)&&J&&!A.$__getValue(J)&&A.$__isSelected(J))A.$set(J,Y,void 0,{overwriteImmutable:!0});if(!$&&X&&(A.isNew||A.$isModified())){let B=Y;if(A.isNew&&J!=null)B=A.$__getValue(J);A.$set(X,B)}}});var ef=E((hT1,of)=>{var Dq1=EC(),Zq1=UC(),Jq1=L0(),rf=MJ(),Xq1=sf(),$q1=p9(),tf=new Set(["replaceOne","findOneAndReplace"]);of.exports=function F(A,D){let Z=A.childSchemas.find(J);function J(q){return!!q.schema.options.timestamps}if(!D&&!Z)return;let X=rf(D,"createdAt"),$=rf(D,"updatedAt"),G=D!=null&&D.hasOwnProperty("currentTime")?D.currentTime:null,Y={};if(A.$timestamps={createdAt:X,updatedAt:$},X&&!A.paths[X]){let q=A.base!=null?A.base.get("timestamps.createdAt.immutable"):null,W=q!=null?q:!0;Y[X]={[A.options.typeKey||"type"]:Date,immutable:W}}if($&&!A.paths[$])Y[$]=Date;A.add(Y),A.pre("save",function q(W){let C=Jq1(this,"$__.saveOptions.timestamps");if(C===!1)return W();Xq1(this,C,G,X,$),W()}),A.methods.initializeTimestamps=function(){let q=G!=null?G():this.constructor.base.now();if(X&&!this.get(X))this.$set(X,q);if($&&!this.get($))this.$set($,q);if(this.$isSubdocument)return this;let W=this.$getAllSubdocs();for(let C of W)if(C.initializeTimestamps)C.initializeTimestamps();return this},H[$q1.builtInMiddleware]=!0;let B={query:!0,model:!1};A.pre("findOneAndReplace",B,H),A.pre("findOneAndUpdate",B,H),A.pre("replaceOne",B,H),A.pre("update",B,H),A.pre("updateOne",B,H),A.pre("updateMany",B,H);function H(q){let W=G!=null?G():this.model.base.now();if(tf.has(this.op)&&this.getUpdate()==null)this.setUpdate({});Zq1(W,X,$,this.getUpdate(),this._mongooseOptions,tf.has(this.op)),Dq1(W,this.getUpdate(),this.model.schema),q()}}});var Ay=E((vT1,Fy)=>{var Yq1=w1(),Gq1=i("node:util");Fy.exports=Bq1;function Bq1(F,A){if(typeof F==="string")return;if(typeof F==="function")return;throw new Yq1('Invalid ref at path "'+A+'". Got '+Gq1.inspect(F,{depth:0}))}});var NJ=E((Qq1)=>{/*!
364
+ * ignore
365
+ */var Dy=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]);Qq1.queryOperations=Dy;/*!
366
+ * ignore
367
+ */var Hq1=Dy.concat(["validate"]);Qq1.queryMiddlewareFunctions=Hq1;/*!
368
+ * ignore
369
+ */var qq1=["aggregate"];Qq1.aggregateMiddlewareFunctions=qq1;/*!
370
+ * ignore
371
+ */var Wq1=["bulkWrite","createCollection","insertMany"];Qq1.modelMiddlewareFunctions=Wq1;/*!
372
+ * ignore
373
+ */var Cq1=["validate","save","remove","updateOne","deleteOne","init"];Qq1.documentMiddlewareFunctions=Cq1});var jJ=E((dT1,Zy)=>{var Lq1=p9(),Rq1=nZ();/*!
374
+ * ignore
375
+ */Zy.exports=tF;/*!
376
+ * ignore
377
+ */tF.middlewareFunctions=["deleteOne","save","validate","remove","updateOne","init"];/*!
378
+ * ignore
379
+ */var wq1=new Set(tF.middlewareFunctions.flatMap((F)=>[F,`$__${F}`]));function tF(F,A,D){D=D||{};let Z={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},J=D.decorateDoc?F:F.prototype;F.$appliedHooks=!0;for(let B of Object.keys(A.paths)){let H=A.paths[B],q=null;if(H.$isSingleNested)q=H.caster;else if(H.$isMongooseDocumentArray)q=H.Constructor;else continue;if(q.$appliedHooks)continue;if(tF(q,H.schema,{...D,isChildSchema:!0}),q.discriminators!=null){let W=Object.keys(q.discriminators);for(let C of W)tF(q.discriminators[C],q.discriminators[C].schema,D)}}let X=A.s.hooks.filter((B)=>{if(B.name==="updateOne"||B.name==="deleteOne")return!!B.document;if(B.name==="remove"||B.name==="init")return B.document==null||!!B.document;if(B.query!=null||B.document!=null)return B.document!==!1;return!0}).filter((B)=>{if(A.methods[B.name])return!B.fn[Lq1.builtInMiddleware];return!0});F._middleware=X,J.$__originalValidate=J.$__originalValidate||J.$__validate;let $=D&&D.isChildSchema?["save","validate","deleteOne"]:["save","validate"];for(let B of $){let H=B==="validate"?"$__originalValidate":`$__${B}`,q=X.createWrapper(B,J[H],null,Z);J[`$__${B}`]=q}J.$__init=X.createWrapperSync("init",J.$__init,null,Z);let G=Object.keys(A.methods),Y=Object.assign({},Z,{checkForPromise:!0});for(let B of G){if(wq1.has(B))continue;if(!X.hasHooks(B))continue;let H=J[B];J[B]=function(){let q=Array.prototype.slice.call(arguments),W=q.slice(-1).pop(),C=typeof W==="function"?q.slice(0,q.length-1):q;return Rq1(W,(Q)=>{return this[`$__${B}`].apply(this,C.concat([Q]))},F.events)},J[`$__${B}`]=X.createWrapper(B,H,null,Y)}}});var Xy=E((cT1,Jy)=>{Jy.exports=B3().Double});var TJ=E((lT1,Hy)=>{var Pq1=i9(),Iq1=w1(),$y=K0(),Mq1=q1().deepEqual,Nq1=b2(),jq1=JJ(),Yy=i("node:util"),Tq1=v9(),zC=D2(),kq1=FJ(),Gy=A1().populateModelSymbol;/*!
380
+ * ignore
381
+ */class T3 extends Map{constructor(F,A,D,Z){if(Nq1(F)==="Object")F=Object.keys(F).reduce((J,X)=>J.concat([[X,F[X]]]),[]);super(F);this.$__parent=D!=null&&D.$__!=null?D:null,this.$__path=A,this.$__schemaType=Z==null?new Pq1(A):Z,this.$__runDeferred()}$init(F,A){if(By(F),super.set(F,A),A!=null&&A.$isSingleNested)A.$basePath=this.$__path+"."+F}$__set(F,A){super.set(F,A)}get(F,A){if(zC(F,"ObjectId"))F=F.toString();if(A=A||{},A.getters===!1)return super.get(F);return this.$__schemaType.applyGetters(super.get(F),this.$__parent)}set(F,A){if(zC(F,"ObjectId"))F=F.toString();if(By(F),A=jq1(A),this.$__schemaType==null){this.$__deferred=this.$__deferred||[],this.$__deferred.push({key:F,value:A});return}let D,Z=this.$__parent,J=Z!=null&&Z.$__&&Z.$__.populated?Z.$populated($.call(this),!0)||Z.$populated(this.$__path,!0):null,X=this.get(F);if(J!=null){if(this.$__schemaType.$isSingleNested)throw new Iq1(`Cannot manually populate single nested subdoc underneath Map at path "${this.$__path}". Try using an array instead of a Map.`);if(Array.isArray(A)&&this.$__schemaType.$isMongooseArray)A=A.map((G)=>{if(G.$__==null)G=new J.options[Gy](G);return G.$__.wasPopulated={value:G._doc._id},G});else if(A!=null){if(A.$__==null)A=new J.options[Gy](A);A.$__.wasPopulated={value:A._doc._id}}}else try{let G=this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested?{path:$.call(this)}:null;A=this.$__schemaType.applySetters(A,this.$__parent,!1,this.get(F),G)}catch(G){if(this.$__parent!=null&&this.$__parent.$__!=null){this.$__parent.invalidate($.call(this),G);return}throw G}if(super.set(F,A),Z!=null&&Z.$__!=null&&!Mq1(A,X)){let G=$.call(this);if(Z.markModified(G),this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested)kq1(Z,G)}function $(){if(D)return D;return D=this.$__path+"."+F,D}}clear(){super.clear();let F=this.$__parent;if(F!=null)F.markModified(this.$__path)}delete(F){if(zC(F,"ObjectId"))F=F.toString();return this.set(F,void 0),super.delete(F)}toBSON(){return new Map(this)}toObject(F){if(F&&F.flattenMaps){let A={},D=this.keys();for(let Z of D)A[Z]=$y(this.get(Z),F);return A}return new Map(this)}$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)}toJSON(F){if(typeof(F&&F.flattenMaps)==="boolean"?F.flattenMaps:!0){let A={},D=this.keys();for(let Z of D)A[Z]=$y(this.get(Z),F);return A}return new Map(this)}inspect(){return new Map(this)}$__runDeferred(){if(!this.$__deferred)return;for(let F of this.$__deferred)this.set(F.key,F.value);this.$__deferred=null}}if(Yy.inspect.custom)Object.defineProperty(T3.prototype,Yy.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:T3.prototype.inspect});Object.defineProperty(T3.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(T3.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(T3.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(T3.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(T3.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0});Object.defineProperty(T3.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0});function By(F){let A=typeof F;if(A!=="string")throw new TypeError(`Mongoose maps only support string keys, got ${A}`);if(F.startsWith("$"))throw new Error(`Mongoose maps do not support keys that start with "$", got "${F}"`);if(F.includes("."))throw new Error(`Mongoose maps do not support keys that contain ".", got "${F}"`);if(Tq1.has(F))throw new Error(`Mongoose maps do not support reserved key name "${F}"`)}Hy.exports=T3});var Wy=E((pT1,qy)=>{qy.exports=B3().UUID});var b8=E((Oq1)=>{/*!
382
+ * Module exports.
383
+ */Oq1.Array=xW();Oq1.Buffer=k8();Oq1.Document=Oq1.Embedded=x8();Oq1.DocumentArray=n9();Oq1.Double=Xy();Oq1.Decimal128=hZ();Oq1.ObjectId=F4();Oq1.Map=TJ();Oq1.Subdocument=$J();Oq1.UUID=Wy()});var Qy=E((nT1,Cy)=>{var mq1=U6();class oF extends mq1{}var VC=v6();Object.defineProperty(oF.prototype,"enum",VC);Object.defineProperty(oF.prototype,"of",VC);Object.defineProperty(oF.prototype,"castNonArrays",VC);/*!
384
+ * ignore
385
+ */Cy.exports=oF});var Ey=E((sT1,Ky)=>{Ky.exports=LC;function LC(F){if(!Array.isArray(F))return{min:0,max:0,containsNonArrayItem:!0};if(F.length===0)return{min:1,max:1,containsNonArrayItem:!1};if(F.length===1&&!Array.isArray(F[0]))return{min:1,max:1,containsNonArrayItem:!1};let A=LC(F[0]);for(let D=1;D<F.length;++D){let Z=LC(F[D]);if(Z.min<A.min)A.min=Z.min;if(Z.max>A.max)A.max=Z.max;A.containsNonArrayItem=A.containsNonArrayItem||Z.containsNonArrayItem}return A.min=A.min+1,A.max=A.max+1,A}});var eF=E((rT1,zy)=>{var Uy=i("node:assert");zy.exports=function F(A){if(A==null)return A;if(A==="")return null;if(typeof A==="string"||typeof A==="boolean")A=Number(A);if(Uy.ok(!isNaN(A)),A instanceof Number)return A.valueOf();if(typeof A==="number")return A;if(!Array.isArray(A)&&typeof A.valueOf==="function")return Number(A.valueOf());if(A.toString&&!Array.isArray(A)&&A.toString()==Number(A))return Number(A);Uy.ok(!1)}});var RC=E((tT1,Vy)=>{Vy.exports=function F(A){if(A==null||typeof A!=="object")return A;if(Array.isArray(A)){for(let D=A.length-1;D>=0;--D)if(A[D]===void 0)A.splice(D,1)}for(let D of Object.keys(A))if(A[D]===void 0)delete A[D];return A}});var wy=E((oT1,Ry)=>{var h8=E2(),Ly=i4(),kJ=eF(),dq1=RC(),cq1=new Set(["$and","$or"]),lq1=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),pq1=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),iq1=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),aq1=new Set(["$arrayElemAt","$first","$last"]),nq1=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),sq1=new Set(["$not"]);Ry.exports=function F(A,D,Z){if(typeof A!=="object"||A===null)throw new Error("`$expr` must be an object");return c6(A,D,Z)};function c6(F,A,D){if(FA(F)||F===null)return F;if(F.$cond!=null)if(Array.isArray(F.$cond))F.$cond=F.$cond.map((J)=>c6(J,A,D));else F.$cond.if=c6(F.$cond.if,A,D),F.$cond.then=c6(F.$cond.then,A,D),F.$cond.else=c6(F.$cond.else,A,D);else if(F.$ifNull!=null)F.$ifNull.map((J)=>c6(J,A,D));else if(F.$switch!=null){if(Array.isArray(F.$switch.branches))F.$switch.branches=F.$switch.branches.map((J)=>c6(J,A,D));if("default"in F.$switch)F.$switch.default=c6(F.$switch.default,A,D)}let Z=Object.keys(F);for(let J of Z)if(cq1.has(J))F[J]=F[J].map((X)=>c6(X,A,D));else if(lq1.has(J))F[J]=oq1(F[J],A,D);else if(pq1.has(J))F[J]=tq1(F[J],A,D);else if(iq1.has(J))F[J]=wC(F[J],A,D);else if(sq1.has(J))F[J]=c6(F[J],A,D);if(F.$in)F.$in=rq1(F.$in,A,D);if(F.$size)F.$size=wC(F.$size,A,D);if(F.$round){let J=F.$round;if(!Array.isArray(J)||J.length<1||J.length>2)throw new h8("Array",J,"$round");F.$round=J.map((X)=>wC(X,A,D))}return dq1(F),F}function wC(F){if(!OJ(F))return F;try{return kJ(F)}catch(A){throw new h8("Number",F)}}function rq1(F,A,D){let Z=F[1];if(!FA(Z))return F;let J=F[0],X=A.path(Z.slice(1));if(X===null){if(D===!1)return F;else if(D==="throw")throw new Ly("$in");return}if(!X.$isMongooseArray)throw new Error("Path must be an array for $in");return[X.$isMongooseDocumentArray?X.$embeddedSchemaType.cast(J):X.caster.cast(J),Z]}function tq1(F){if(!Array.isArray(F)){if(!OJ(F))return F;try{return kJ(F)}catch(A){throw new h8("Number",F)}}return F.map((A)=>{if(!OJ(A))return A;try{return kJ(A)}catch(D){throw new h8("Number",A)}})}function oq1(F,A,D){if(!Array.isArray(F)||F.length!==2)throw new Error("Comparison operator must be an array of length 2");F[0]=c6(F[0],A,D);let Z=F[0];if(OJ(F[1])){let J=null,X=null,$=null;if(FA(Z))J=Z.slice(1),X=A.path(J);else if(typeof Z==="object"&&Z!=null){for(let Y of Object.keys(Z))if(nq1.has(Y)&&FA(Z[Y]))J=Z[Y].slice(1)+"."+Y,$=kJ;else if(aq1.has(Y)&&FA(Z[Y])){if(J=Z[Y].slice(1)+"."+Y,X=A.path(Z[Y].slice(1)),X!=null){if(X.$isMongooseDocumentArray)X=X.$embeddedSchemaType;else if(X.$isMongooseArray)X=X.caster}}}let G=typeof F[1]==="object"&&F[1]!=null&&F[1].$literal!=null;if(X!=null)if(G)F[1]={$literal:X.cast(F[1].$literal)};else F[1]=X.cast(F[1]);else if($!=null)if(G)try{F[1]={$literal:$(F[1].$literal)}}catch(Y){throw new h8($.name.replace(/^cast/,""),F[1],J+".$literal")}else try{F[1]=$(F[1])}catch(Y){throw new h8($.name.replace(/^cast/,""),F[1],J)}else if(J!=null&&D===!0)return;else if(J!=null&&D==="throw")throw new Ly(J)}else F[1]=c6(F[1]);return F}function FA(F){return typeof F==="string"&&F[0]==="$"}function OJ(F){if(typeof F==="string"&&F[0]==="$")return!1;if(typeof F==="object"&&F!==null&&Object.keys(F).find((A)=>A[0]==="$"))return F.$literal!=null;return!0}});var SJ=E((eT1,Py)=>{var eq1=E2();Py.exports=function F(A,D){if(A==null)return A;if(A._id&&typeof A._id==="string")return A._id;if(A.toString&&A.toString!==Object.prototype.toString&&!Array.isArray(A))return A.toString();throw new eq1("string",A,D)}});var jy=E((Fk1,Ny)=>{var FW1=E2(),Iy=pZ(),My=SJ();Ny.exports=function F(A,D){if(A==null||typeof A!=="object")throw new FW1("$text",A,D);if(A.$search!=null)A.$search=My(A.$search,D+".$search");if(A.$language!=null)A.$language=My(A.$language,D+".$language");if(A.$caseSensitive!=null)A.$caseSensitive=Iy(A.$caseSensitive,D+".$castSensitive");if(A.$diacriticSensitive!=null)A.$diacriticSensitive=Iy(A.$diacriticSensitive,D+".$diacriticSensitive");return A}});var AA=E((Ak1,Ty)=>{var AW1=new Set(["$ref","$id","$db"]);Ty.exports=function F(A){return A[0]==="$"&&!AW1.has(A)}});var t9=E((Dk1,uy)=>{/*!
386
+ * Module dependencies.
387
+ */var ky=E2(),PC=i4(),DW1=DA(),ZW1=wy(),JW1=SJ(),XW1=jy(),$W1=L0(),Oy=ZJ(),Sy=AA(),YW1=i("node:util"),MC=p4(),IC=fF(),_y=q1(),GW1=["Polygon","MultiPolygon"];uy.exports=function F(A,D,Z,J){if(Array.isArray(D))throw new Error("Query filter must be an object, got an array ",YW1.inspect(D));if(D==null)return D;if(A!=null&&A.discriminators!=null&&D[A.options.discriminatorKey]!=null)A=Oy(A,D[A.options.discriminatorKey])||A;let X=Object.keys(D),$=X.length,G,Y,B,H,q,W,C;Z=Z||{};while($--)if(q=X[$],C=D[q],q==="$or"||q==="$nor"||q==="$and"){if(!Array.isArray(C))throw new ky("Array",C,q);for(let Q=C.length-1;Q>=0;Q--){if(C[Q]==null||typeof C[Q]!=="object")throw new ky("Object",C[Q],q+"."+Q);let K=Object.keys(C[Q]).length,U=C[Q][A.options.discriminatorKey];if(U==null)C[Q]=F(A,C[Q],Z,J);else{let z=Oy(J.schema,U);C[Q]=F(z?z:A,C[Q],Z,J)}if(Object.keys(C[Q]).length===0&&K!==0)C.splice(Q,1)}if(C.length===0)delete D[q]}else if(q==="$where"){if(W=typeof C,W!=="string"&&W!=="function")throw new Error("Must have a string or function for $where");if(W==="function")D[q]=C.toString();continue}else if(q==="$expr"){C=ZW1(C,A);continue}else if(q==="$elemMatch")C=F(A,C,Z,J);else if(q==="$text")C=XW1(C,q);else if(q==="$comment"&&!A.paths.hasOwnProperty("$comment"))C=JW1(C,q),D[q]=C;else{if(!A)continue;if(B=A.path(q),!B){let Q=q.split("."),K=Q.length;while(K--){let U=Q.slice(0,K).join("."),z=Q.slice(K).join("."),L=A.path(U),V=L&&L.schema&&L.schema.options&&L.schema.options.discriminatorKey;if(L!=null&&(L.schema&&L.schema.discriminators)!=null&&V!=null&&z!==V){let P=$W1(D,U+"."+V),I=L.schema.discriminators;if(typeof P==="string"&&I[P]!=null)B=I[P].path(z);else if(P!=null&&Object.keys(P).length===1&&Array.isArray(P.$in)&&P.$in.length===1&&typeof P.$in[0]==="string"&&I[P.$in[0]]!=null)B=I[P.$in[0]].path(z)}}}if(!B){let Q=q.split("."),K=Q.length,U,z,L;while(K--)if(U=Q.slice(0,K).join("."),B=A.path(U),B)break;if(B){if(B.caster&&B.caster.schema){L={},z=Q.slice(K).join("."),L[z]=C;let I=F(B.caster.schema,L,Z,J)[z];if(I===void 0)delete D[q];else D[q]=I}else D[q]=C;continue}if(MC(C)){let I="";if(C.$near)I="$near";else if(C.$nearSphere)I="$nearSphere";else if(C.$within)I="$within";else if(C.$geoIntersects)I="$geoIntersects";else if(C.$geoWithin)I="$geoWithin";if(I){let M=new DW1.Number("__QueryCasting__"),x=C[I];if(C.$maxDistance!=null)C.$maxDistance=M.castForQuery(null,C.$maxDistance,J);if(C.$minDistance!=null)C.$minDistance=M.castForQuery(null,C.$minDistance,J);if(I==="$within"){let _=x.$center||x.$centerSphere||x.$box||x.$polygon;if(!_)throw new Error("Bad $within parameter: "+JSON.stringify(C));x=_}else if(I==="$near"&&typeof x.type==="string"&&Array.isArray(x.coordinates))x=x.coordinates;else if((I==="$near"||I==="$nearSphere"||I==="$geoIntersects")&&x.$geometry&&typeof x.$geometry.type==="string"&&Array.isArray(x.$geometry.coordinates)){if(x.$maxDistance!=null)x.$maxDistance=M.castForQuery(null,x.$maxDistance,J);if(x.$minDistance!=null)x.$minDistance=M.castForQuery(null,x.$minDistance,J);if(IC(x.$geometry))x.$geometry=x.$geometry.toObject({transform:!1,virtuals:!1});x=x.$geometry.coordinates}else if(I==="$geoWithin"){if(x.$geometry){if(IC(x.$geometry))x.$geometry=x.$geometry.toObject({virtuals:!1});let _=x.$geometry.type;if(GW1.indexOf(_)===-1)throw new Error('Invalid geoJSON type for $geoWithin "'+_+'", must be "Polygon" or "MultiPolygon"');x=x.$geometry.coordinates}else if(x=x.$box||x.$polygon||x.$center||x.$centerSphere,IC(x))x=x.toObject({virtuals:!1})}NC(x,M,J);continue}}if(A.nested[q])continue;let V="strict"in Z?Z.strict:A.options.strict,P=BW1(Z,A._userProvidedOptions,A.options,J);if(Z.upsert&&V){if(V==="throw")throw new PC(q);throw new PC(q,'Path "'+q+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if(P==="throw")throw new PC(q,'Path "'+q+`" is not in schema and strictQuery is 'throw'.`);else if(P)delete D[q]}else if(C==null)continue;else if(_y.isPOJO(C))if(Y=Object.keys(C).some(Sy),!Y)D[q]=B.castForQuery(null,C,J);else{let Q=Object.keys(C),K,U=Q.length;while(U--)if(K=Q[U],H=C[K],K==="$elemMatch"){if(H&&B!=null&&B.schema!=null)F(B.schema,H,Z,J);else if(H&&B!=null&&B.$isMongooseArray)if(_y.isPOJO(H)&&H.$not!=null)F(A,H,Z,J);else C[K]=B.castForQuery(K,H,J)}else if(K==="$not"){if(H&&B){if(G=Object.keys(H),G.length&&Sy(G[0]))for(let z in H)H[z]=B.castForQuery(z,H[z],J);else C[K]=B.castForQuery(K,H,J);continue}}else C[K]=B.castForQuery(K,H,J)}else if(Array.isArray(C)&&["Buffer","Array"].indexOf(B.instance)===-1&&!Z.sanitizeFilter){let Q=[],K=C;for(let U of K)Q.push(B.castForQuery(null,U,J));D[q]={$in:Q}}else D[q]=B.castForQuery(null,C,J)}return D};function NC(F,A,D){if(Array.isArray(F))F.forEach(function(Z,J){if(Array.isArray(Z)||MC(Z))return NC(Z,A,D);F[J]=A.castForQuery(null,Z,D)});else{let Z=Object.keys(F),J=Z.length;while(J--){let X=Z[J],$=F[X];if(Array.isArray($)||MC($))NC($,A,D),F[X]=$;else F[X]=A.castForQuery({val:$,context:D})}}}function BW1(F,A,D,Z){if("strictQuery"in F)return F.strictQuery;if("strictQuery"in A)return A.strictQuery;let J=Z&&Z.mongooseCollection&&Z.mongooseCollection.conn&&Z.mongooseCollection.conn.base&&Z.mongooseCollection.conn.base.options;if(J){if("strictQuery"in J)return J.strictQuery}return D.strictQuery}});var gy=E((Zk1,xy)=>{var HW1=U6();class v8 extends HW1{}var _J=v6();Object.defineProperty(v8.prototype,"min",_J);Object.defineProperty(v8.prototype,"max",_J);Object.defineProperty(v8.prototype,"enum",_J);Object.defineProperty(v8.prototype,"populate",_J);/*!
388
+ * ignore
389
+ */xy.exports=v8});var L2=E((Jk1,fy)=>{fy.exports=function F(A,D,Z,J){if(Z){if(J)return{bsonType:D};return{bsonType:[D,"null"]}}else{if(J)return{type:A};return{type:[A,"null"]}}}});var ZA=E((Xk1,by)=>{/*!
390
+ * Module requirements.
391
+ */var qW1=E2();/*!
392
+ * ignore
393
+ */function WW1(F){let A=this;if(Array.isArray(F))return F.map(function(D){return yy(A.path,D)});else if(Buffer.isBuffer(F))return F;return yy(A.path,F)}/*!
394
+ * ignore
395
+ */function yy(F,A){let D=Number(A);if(isNaN(D))throw new qW1("number",A,F);return D}by.exports=WW1});var kC=E(($k1,hy)=>{/*!
396
+ * Module requirements.
397
+ */var gJ=a2(),CW1=gy(),$4=_0(),QW1=eF(),KW1=L2(),uJ=ZA(),jC=q1(),TC=$4.CastError;function G0(F,A){$4.call(this,F,A,"Number")}G0.get=$4.get;G0.set=$4.set;G0.setters=[];/*!
398
+ * ignore
399
+ */G0._cast=QW1;G0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
400
+ * ignore
401
+ */G0._defaultCaster=(F)=>{if(typeof F!=="number")throw new Error;return F};G0.schemaName="Number";G0.defaultOptions={};/*!
402
+ * Inherits from SchemaType.
403
+ */G0.prototype=Object.create($4.prototype);G0.prototype.constructor=G0;G0.prototype.OptionsConstructor=CW1;/*!
404
+ * ignore
405
+ */G0._checkRequired=(F)=>typeof F==="number"||F instanceof Number;G0.checkRequired=$4.checkRequired;G0.prototype.checkRequired=function F(A,D){if(typeof A==="object"&&$4._isRef(this,A,D,!0))return A!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():G0.checkRequired())(A)};G0.prototype.min=function(F,A){if(this.minValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.minValidator},this);if(F!==null&&F!==void 0){let D=A||gJ.messages.Number.min;D=D.replace(/{MIN}/,F),this.validators.push({validator:this.minValidator=function(Z){return Z==null||Z>=F},message:D,type:"min",min:F})}return this};G0.prototype.max=function(F,A){if(this.maxValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.maxValidator},this);if(F!==null&&F!==void 0){let D=A||gJ.messages.Number.max;D=D.replace(/{MAX}/,F),this.validators.push({validator:this.maxValidator=function(Z){return Z==null||Z<=F},message:D,type:"max",max:F})}return this};G0.prototype.enum=function(F,A){if(this.enumValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.enumValidator},this);if(!Array.isArray(F)){if(jC.isPOJO(F)&&F.values!=null)A=F.message,F=F.values;else if(typeof F==="number")F=Array.prototype.slice.call(arguments),A=null;if(jC.isPOJO(F))F=Object.values(F);A=A||gJ.messages.Number.enum}return A=A==null?gJ.messages.Number.enum:A,this.enumValidator=(D)=>D==null||F.indexOf(D)!==-1,this.validators.push({validator:this.enumValidator,message:A,type:"enum",enumValues:F}),this};G0.prototype.cast=function(F,A,D,Z,J){if(typeof F!=="number"&&$4._isRef(this,F,A,D)){if(F==null||jC.isNonBuiltinObject(F))return this._castRef(F,A,D,J)}let X=F&&typeof F._id!=="undefined"?F._id:F,$;if(typeof this._castFunction==="function")$=this._castFunction;else if(typeof this.constructor.cast==="function")$=this.constructor.cast();else $=G0.cast();try{return $(X)}catch(G){throw new TC("Number",X,this.path,G,this)}};/*!
406
+ * ignore
407
+ */function xJ(F){return this.cast(F)}function EW1(F){let A=this;if(!Array.isArray(F))return[this.cast(F)];return F.map(function(D){return A.cast(D)})}G0.prototype.$conditionalHandlers={...$4.prototype.$conditionalHandlers,$bitsAllClear:uJ,$bitsAnyClear:uJ,$bitsAllSet:uJ,$bitsAnySet:uJ,$gt:xJ,$gte:xJ,$lt:xJ,$lte:xJ,$mod:EW1};G0.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=this.$conditionalHandlers[F],!Z)throw new TC("number",A,this.path,null,this);return Z.call(this,A,D)}try{A=this.applySetters(A,D)}catch(J){if(J instanceof TC&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}return A};G0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function"||this.path==="_id";return KW1("number","number",A?.useBsonType,D)};/*!
408
+ * Module exports.
409
+ */hy.exports=G0});var JA=E((zW1)=>{/*!
410
+ * Module requirements.
411
+ */var UW1=kC();/*!
412
+ * ignore
413
+ */zW1.castToNumber=vy;zW1.castArraysOfNumbers=my;/*!
414
+ * ignore
415
+ */function vy(F){return UW1.cast()(F)}function my(F,A){F.forEach(function(D,Z){if(Array.isArray(D))my(D,A);else F[Z]=vy.call(A,D)})}});var _C=E((IW1)=>{/*!
416
+ * Module requirements.
417
+ */var dy=JA().castArraysOfNumbers,XA=JA().castToNumber;/*!
418
+ * ignore
419
+ */IW1.cast$geoIntersects=PW1;IW1.cast$near=RW1;IW1.cast$within=wW1;function RW1(F){let A=fJ();if(Array.isArray(F))return dy(F,this),F;if(SC(this,F),F&&F.$geometry)return OC(F,this);if(!Array.isArray(F))throw new TypeError("$near must be either an array or an object with a $geometry property");return A.prototype.castForQuery.call(this,null,F)}function OC(F,A){switch(F.$geometry.type){case"Polygon":case"LineString":case"Point":dy(F.$geometry.coordinates,A);break;default:break}return SC(A,F),F}function wW1(F){if(SC(this,F),F.$box||F.$polygon){let A=F.$box?"$box":"$polygon";F[A].forEach((D)=>{if(!Array.isArray(D)){let Z="Invalid $within $box argument. Expected an array, received "+D;throw new TypeError(Z)}D.forEach((Z,J)=>{D[J]=XA.call(this,Z)})})}else if(F.$center||F.$centerSphere){let A=F.$center?"$center":"$centerSphere";F[A].forEach((D,Z)=>{if(Array.isArray(D))D.forEach((J,X)=>{D[X]=XA.call(this,J)});else F[A][Z]=XA.call(this,D)})}else if(F.$geometry)OC(F,this);return F}function PW1(F){if(!F.$geometry)return;return OC(F,this),F}function SC(F,A){if(A.$maxDistance)A.$maxDistance=XA.call(F,A.$maxDistance);if(A.$minDistance)A.$minDistance=XA.call(F,A.$minDistance)}});var fJ=E((Bk1,iy)=>{/*!
420
+ * Module dependencies.
421
+ */var TW1=iZ(),kW1=QW(),ly=w1(),OW1=Qy(),l6=_0(),bJ=l6.CastError,hJ=i9(),SW1=BC(),cy=IJ(),_W1=Ey(),uC=t9(),uW1=K0(),xW1=b2(),gW1=AA(),vJ=i("node:util"),r4=q1(),fW1=JA().castToNumber,yW1=L2(),xC=_C(),bW1=d6(),$A,yJ,py=Symbol("mongoose#isNestedArray"),hW1=Object.freeze({});function S1(F,A,D,Z){yJ||(yJ=b8().Embedded);let J="type";if(Z&&Z.typeKey)J=Z.typeKey;if(this.schemaOptions=Z,A){let G={};if(r4.isPOJO(A))if(A[J])G=uW1(A),delete G[J],A=A[J];else A=hJ;if(D!=null&&D.ref!=null&&G.ref==null)G.ref=D.ref;if(A===Object)A=hJ;let Y=typeof A==="string"?A:r4.getFunctionName(A),B=DA(),H=B.hasOwnProperty(Y)?B[Y]:A;if(this.casterConstructor=H,this.casterConstructor instanceof S1)this.casterConstructor[py]=!0;if(typeof H==="function"&&!H.$isArraySubdocument&&!H.$isSchemaMap){let q=this.caster instanceof yJ?null:F;this.caster=new H(q,G)}else if(this.caster=H,!(this.caster instanceof yJ))this.caster.path=F;this.$embeddedSchemaType=this.caster}this.$isMongooseArray=!0,l6.call(this,F,D,"Array");let X,$;if(this.defaultValue!=null)X=this.defaultValue,$=typeof X==="function";if(!("defaultValue"in this)||this.defaultValue!=null){let G=function(){return $?X.call(this):X!=null?[].concat(X):[]};G.$runBeforeSetters=!$,this.default(G)}}S1.schemaName="Array";S1.options={castNonArrays:!0};/*!
422
+ * ignore
423
+ */S1.defaultOptions={};S1.set=l6.set;S1.setters=[];S1.get=l6.get;/*!
424
+ * Inherits from SchemaType.
425
+ */S1.prototype=Object.create(l6.prototype);S1.prototype.constructor=S1;S1.prototype.OptionsConstructor=OW1;/*!
426
+ * ignore
427
+ */S1._checkRequired=l6.prototype.checkRequired;S1.checkRequired=l6.checkRequired;/*!
428
+ * Virtuals defined on this array itself.
429
+ */S1.prototype.virtuals=null;S1.prototype.checkRequired=function F(A,D){if(typeof A==="object"&&l6._isRef(this,A,D,!0))return!!A;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():S1.checkRequired())(A)};S1.prototype.enum=function(){let F=this;while(!0){let D=F&&F.caster&&F.caster.instance;if(D==="Array"){F=F.caster;continue}if(D!=="String"&&D!=="Number")throw new Error("`enum` can only be set on an array of strings or numbers , not "+D);break}let A=arguments;if(!Array.isArray(arguments)&&r4.isObject(arguments))A=r4.object.vals(A);return F.caster.enum.apply(F.caster,A),this};S1.prototype.applyGetters=function(F,A){if(A!=null&&A.$__!=null&&A.$populated(this.path))return F;return l6.prototype.applyGetters.call(this,F,A)};S1.prototype._applySetters=function(F,A,D,Z){if(this.casterConstructor.$isMongooseArray&&S1.options.castNonArrays&&!this[py]){let J=0,X=this;while(X!=null&&X.$isMongooseArray&&!X.$isMongooseDocumentArray)++J,X=X.casterConstructor;if(F!=null&&F.length!==0){let $=_W1(F);if($.min===$.max&&$.max<J&&$.containsNonArrayItem)for(let G=$.max;G<J;++G)F=[F]}}return l6.prototype._applySetters.call(this,F,A,D,Z)};S1.prototype.cast=function(F,A,D,Z,J){$A||($A=b8().Array);let X,$;if(Array.isArray(F)){if(!F.length&&A){let C=A.schema.indexedPaths(),Q=this.path;for(X=0,$=C.length;X<$;++X){let U=C[X][0][Q];if(U==="2dsphere"||U==="2d")return}let K=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(K!=null){for(X=0,$=C.length;X<$;++X)if(C[X][0][K]==="2dsphere")return}}J=J||hW1;let B=r4.isMongooseArray(F)?F.__array:F,H=J.path||this.path;if(J.arrayPathIndex!=null)H+="."+J.arrayPathIndex;if(F=$A(B,H,A,this),B=F.__array,D&&A!=null&&A.$__!=null&&A.$populated(this.path))return F;let q=this.caster,W=q.$isMongooseArray;if(q&&this.casterConstructor!==hJ)try{let C=B.length;for(X=0;X<C;X++){let Q={};if(W){if(J.arrayPath!=null)Q.arrayPathIndex=X;else if(q._arrayParentPath!=null)Q.arrayPathIndex=X}if(J.hydratedPopulatedDocs)Q.hydratedPopulatedDocs=J.hydratedPopulatedDocs;B[X]=q.applySetters(B[X],A,D,void 0,Q)}}catch(C){throw new bJ("["+C.kind+"]",vJ.inspect(F),this.path+"."+X,C,this)}return F}let G=this.options.castNonArrays!=null?this.options.castNonArrays:S1.options.castNonArrays;if(D||G){if(!!A&&!!D)A.markModified(this.path);return this.cast([F],A,D)}throw new bJ("Array",vJ.inspect(F),this.path,null,this)};/*!
430
+ * ignore
431
+ */S1.prototype._castForPopulate=function F(A,D){if($A||($A=b8().Array),Array.isArray(A)){let Z,J=A.__array?A.__array:A,X=J.length,$=this.caster;if($&&this.casterConstructor!==hJ)try{for(Z=0;Z<X;Z++){let G={};if($.$isMongooseArray&&$._arrayParentPath!=null)G.arrayPathIndex=Z;J[Z]=$.cast(J[Z],D,!1,void 0,G)}}catch(G){throw new bJ("["+G.kind+"]",vJ.inspect(A),this.path+"."+Z,G,this)}return A}throw new bJ("Array",vJ.inspect(A),this.path,null,this)};S1.prototype.$toObject=S1.prototype.toObject;/*!
432
+ * ignore
433
+ */S1.prototype.discriminator=function(...F){let A=this;while(A.$isMongooseArray&&!A.$isMongooseDocumentArray)if(A=A.casterConstructor,A==null||typeof A==="function")throw new ly("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return A.discriminator(...F)};/*!
434
+ * ignore
435
+ */S1.prototype.clone=function(){let F=Object.assign({},this.options),A=new this.constructor(this.path,this.caster,F,this.schemaOptions);if(A.validators=this.validators.slice(),this.requiredValidator!==void 0)A.requiredValidator=this.requiredValidator;return A};S1.prototype._castForQuery=function(F,A){let D=this.casterConstructor;if(F&&D.discriminators&&D.schema&&D.schema.options&&D.schema.options.discriminatorKey)if(typeof F[D.schema.options.discriminatorKey]==="string"&&D.discriminators[F[D.schema.options.discriminatorKey]])D=D.discriminators[F[D.schema.options.discriminatorKey]];else{let Y=bW1(D.discriminators,F[D.schema.options.discriminatorKey]);if(Y)D=Y}let Z=this.casterConstructor.prototype,J=Z&&Z.castForQuery,X=Z&&Z.cast,$=D.castForQuery,G=this.caster;if(Array.isArray(F))this.setters.reverse().forEach((Y)=>{F=Y.call(this,F,this)}),F=F.map(function(Y){if(r4.isObject(Y)&&Y.$elemMatch)return Y;if(J)return Y=J.call(G,null,Y,A),Y;else if(X)return Y=X.call(G,Y),Y;else if($)return Y=$.call(G,null,Y,A),Y;if(Y!=null)return Y=new D(Y),Y;return Y});else if(J)F=J.call(G,null,F,A);else if(X)F=X.call(G,F);else if($)F=$.call(G,null,F,A);else if(F!=null)F=new D(F);return F};S1.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=this.$conditionalHandlers[F],!Z)throw new Error("Can't use "+F+" with Array.");return Z.call(this,A,D)}else return this._castForQuery(A,D)};S1.prototype.virtual=function F(A,D){if(A instanceof cy||xW1(A)==="VirtualType")return this.virtual(A.path,A.options);if(D=new SW1(D),r4.hasUserDefinedProperty(D,["ref","refPath"]))throw new ly("Cannot set populate virtual as a property of an array");let Z=new cy(D,A);if(this.virtuals===null)this.virtuals={};return this.virtuals[A]=Z,Z};function vW1(F,A){if(!Array.isArray(F))F=[F];return F=F.map((D)=>{if(!r4.isObject(D))return D;if(D.$elemMatch!=null)return{$elemMatch:uC(this.casterConstructor.schema,D.$elemMatch,null,this&&this.$$context)};let Z={};return Z[this.path]=D,uC(this.casterConstructor.schema,Z,null,this&&this.$$context)[this.path]},this),this.castForQuery(null,F,A)}function mW1(F,A){let D=Object.keys(F),Z=D.length;for(let J=0;J<Z;++J){let X=D[J],$=F[X];if(gW1(X)&&$!=null)F[X]=this.castForQuery(X,$,A)}return F}var D0=S1.prototype.$conditionalHandlers={};D0.$all=vW1;D0.$options=String;D0.$elemMatch=mW1;D0.$geoIntersects=xC.cast$geoIntersects;D0.$or=gC("$or");D0.$and=gC("$and");D0.$nor=gC("$nor");function gC(F){return function A(D,Z){if(!Array.isArray(D))throw new TypeError("conditional "+F+" requires an array");let J=[];for(let X of D)J.push(uC(this.casterConstructor.schema??Z.schema,X,null,this&&this.$$context));return J}}D0.$near=D0.$nearSphere=xC.cast$near;D0.$within=D0.$geoWithin=xC.cast$within;D0.$size=D0.$minDistance=D0.$maxDistance=fW1;D0.$exists=TW1;D0.$type=kW1;D0.$eq=D0.$gt=D0.$gte=D0.$lt=D0.$lte=D0.$not=D0.$regex=D0.$ne=S1.prototype._castForQuery;D0.$nin=l6.prototype.$conditionalHandlers.$nin;D0.$in=l6.prototype.$conditionalHandlers.$in;S1.prototype.toJSONSchema=function F(A){let D=this.getEmbeddedSchemaType(),Z=this.options.required&&typeof this.options.required!=="function";return{...yW1("array","array",A?.useBsonType,Z),items:D.toJSONSchema(A)}};/*!
436
+ * Module exports.
437
+ */iy.exports=S1});var sy=E((Hk1,ny)=>{var{Long:dW1}=B3(),fC=9223372036854775807n,yC=-9223372036854775808n,ay=`Mongoose only supports BigInts between ${yC} and ${fC} because MongoDB does not support arbitrary precision integers`;ny.exports=function F(A){if(A==null)return A;if(A==="")return null;if(typeof A==="bigint"){if(A>fC||A<yC)throw new Error(ay);return A}if(A instanceof dW1)return A.toBigInt();if(typeof A==="string"||typeof A==="number"){if(A=BigInt(A),A>fC||A<yC)throw new Error(ay);return A}throw new Error(`Cannot convert value to BigInt: "${A}"`)}});var oy=E((qk1,ty)=>{/*!
438
+ * Module dependencies.
439
+ */var ry=E2(),m8=_0(),cW1=sy(),lW1=L2();function R0(F,A){m8.call(this,F,A,"BigInt")}R0.schemaName="BigInt";R0.defaultOptions={};/*!
440
+ * Inherits from SchemaType.
441
+ */R0.prototype=Object.create(m8.prototype);R0.prototype.constructor=R0;/*!
442
+ * ignore
443
+ */R0._cast=cW1;R0.set=m8.set;R0.setters=[];R0.get=m8.get;R0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
444
+ * ignore
445
+ */R0._checkRequired=(F)=>F!=null;R0.checkRequired=m8.checkRequired;R0.prototype.checkRequired=function(F){return this.constructor._checkRequired(F)};R0.prototype.cast=function(F){let A;if(typeof this._castFunction==="function")A=this._castFunction;else if(typeof this.constructor.cast==="function")A=this.constructor.cast();else A=R0.cast();try{return A(F)}catch(D){throw new ry("BigInt",F,this.path,D,this)}};/*!
446
+ * ignore
447
+ */R0.$conditionalHandlers={...m8.prototype.$conditionalHandlers,$gt:mJ,$gte:mJ,$lt:mJ,$lte:mJ};/*!
448
+ * ignore
449
+ */function mJ(F,A){return this.castForQuery(null,F,A)}R0.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=R0.$conditionalHandlers[F],Z)return Z.call(this,A);return this.applySetters(A,D)}try{return this.applySetters(A,D)}catch(J){if(J instanceof ry&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};R0.prototype._castNullish=function F(A){if(typeof A==="undefined")return A;if((typeof this.constructor.cast==="function"?this.constructor.cast():R0.cast())==null)return A;return A};R0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return lW1("string","long",A?.useBsonType,D)};/*!
450
+ * Module exports.
451
+ */ty.exports=R0});var Ab=E((Wk1,Fb)=>{/*!
452
+ * Module dependencies.
453
+ */var ey=E2(),d8=_0(),YA=pZ(),pW1=L2();function B0(F,A){d8.call(this,F,A,"Boolean")}B0.schemaName="Boolean";B0.defaultOptions={};/*!
454
+ * Inherits from SchemaType.
455
+ */B0.prototype=Object.create(d8.prototype);B0.prototype.constructor=B0;/*!
456
+ * ignore
457
+ */B0._cast=YA;B0.set=d8.set;B0.setters=[];B0.get=d8.get;B0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
458
+ * ignore
459
+ */B0._defaultCaster=(F)=>{if(F!=null&&typeof F!=="boolean")throw new Error;return F};/*!
460
+ * ignore
461
+ */B0._checkRequired=(F)=>F===!0||F===!1;B0.checkRequired=d8.checkRequired;B0.prototype.checkRequired=function(F){return this.constructor._checkRequired(F)};Object.defineProperty(B0,"convertToTrue",{get:()=>YA.convertToTrue,set:(F)=>{YA.convertToTrue=F}});Object.defineProperty(B0,"convertToFalse",{get:()=>YA.convertToFalse,set:(F)=>{YA.convertToFalse=F}});B0.prototype.cast=function(F){let A;if(typeof this._castFunction==="function")A=this._castFunction;else if(typeof this.constructor.cast==="function")A=this.constructor.cast();else A=B0.cast();try{return A(F)}catch(D){throw new ey("Boolean",F,this.path,D,this)}};B0.$conditionalHandlers={...d8.prototype.$conditionalHandlers};B0.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=B0.$conditionalHandlers[F],Z)return Z.call(this,A);return this.applySetters(A,D)}try{return this.applySetters(A,D)}catch(J){if(J instanceof ey&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};B0.prototype._castNullish=function F(A){if(typeof A==="undefined")return A;let D=typeof this.constructor.cast==="function"?this.constructor.cast():B0.cast();if(D==null)return A;if(D.convertToFalse instanceof Set&&D.convertToFalse.has(A))return!1;if(D.convertToTrue instanceof Set&&D.convertToTrue.has(A))return!0;return A};B0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return pW1("boolean","bool",A?.useBsonType,D)};/*!
462
+ * Module exports.
463
+ */Fb.exports=B0});var Zb=E((Ck1,Db)=>{var iW1=U6();class bC extends iW1{}var aW1=v6();Object.defineProperty(bC.prototype,"subtype",aW1);/*!
464
+ * ignore
465
+ */Db.exports=bC});var $b=E((Qk1,Xb)=>{/*!
466
+ * Module dependencies.
467
+ */var c8=k8(),nW1=Zb(),Y4=_0(),sW1=L2(),dJ=ZA(),Jb=q1(),hC=c8.Binary,lJ=Y4.CastError;function m0(F,A){Y4.call(this,F,A,"Buffer")}m0.schemaName="Buffer";m0.defaultOptions={};/*!
468
+ * Inherits from SchemaType.
469
+ */m0.prototype=Object.create(Y4.prototype);m0.prototype.constructor=m0;m0.prototype.OptionsConstructor=nW1;/*!
470
+ * ignore
471
+ */m0._checkRequired=(F)=>!!(F&&F.length);m0.set=Y4.set;m0.setters=[];m0.get=Y4.get;m0.checkRequired=Y4.checkRequired;m0.prototype.checkRequired=function(F,A){if(Y4._isRef(this,F,A,!0))return!!F;return this.constructor._checkRequired(F)};m0.prototype.cast=function(F,A,D,Z,J){let X;if(Y4._isRef(this,F,A,D)){if(F&&F.isMongooseBuffer)return F;if(Buffer.isBuffer(F)){if(!F||!F.isMongooseBuffer){if(F=new c8(F,[this.path,A]),this.options.subtype!=null)F._subtype=this.options.subtype}return F}if(F instanceof hC){if(X=new c8(F.value(!0),[this.path,A]),typeof F.sub_type!=="number")throw new lJ("Buffer",F,this.path,null,this);return X._subtype=F.sub_type,X}if(F==null||Jb.isNonBuiltinObject(F))return this._castRef(F,A,D,J)}if(F&&F._id)F=F._id;if(F&&F.isMongooseBuffer)return F;if(Buffer.isBuffer(F)){if(!F||!F.isMongooseBuffer){if(F=new c8(F,[this.path,A]),this.options.subtype!=null)F._subtype=this.options.subtype}return F}if(F instanceof hC){if(X=new c8(F.value(!0),[this.path,A]),typeof F.sub_type!=="number")throw new lJ("Buffer",F,this.path,null,this);return X._subtype=F.sub_type,X}if(F===null)return F;let $=typeof F;if($==="string"||$==="number"||Array.isArray(F)||$==="object"&&F.type==="Buffer"&&Array.isArray(F.data)){if($==="number")F=[F];if(X=new c8(F,[this.path,A]),this.options.subtype!=null)X._subtype=this.options.subtype;return X}if(Jb.isPOJO(F)&&(F.$binary instanceof hC||typeof F.$binary==="string")){let G=this.cast(Buffer.from(F.$binary,"base64"));if(F.$type!=null)return G._subtype=F.$type,G}throw new lJ("Buffer",F,this.path,null,this)};m0.prototype.subtype=function(F){return this.options.subtype=F,this};/*!
472
+ * ignore
473
+ */function cJ(F,A){return this.castForQuery(null,F,A)}m0.prototype.$conditionalHandlers={...Y4.prototype.$conditionalHandlers,$bitsAllClear:dJ,$bitsAnyClear:dJ,$bitsAllSet:dJ,$bitsAnySet:dJ,$gt:cJ,$gte:cJ,$lt:cJ,$lte:cJ};m0.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=this.$conditionalHandlers[F],!Z)throw new Error("Can't use "+F+" with Buffer.");return Z.call(this,A)}let J;try{J=this.applySetters(A,D)}catch(X){if(X instanceof lJ&&X.path===this.path&&this.$fullPath!=null)X.path=this.$fullPath;throw X}return J?J.toObject({transform:!1,virtuals:!1}):J};m0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return sW1("string","binData",A?.useBsonType,D)};/*!
474
+ * Module exports.
475
+ */Xb.exports=m0});var Gb=E((Kk1,Yb)=>{var rW1=U6();class GA extends rW1{}var vC=v6();Object.defineProperty(GA.prototype,"min",vC);Object.defineProperty(GA.prototype,"max",vC);Object.defineProperty(GA.prototype,"expires",vC);/*!
476
+ * ignore
477
+ */Yb.exports=GA});var Hb=E((Ek1,Bb)=>{var mC=i("node:assert");Bb.exports=function F(A){if(A==null||A==="")return null;if(A instanceof Date)return mC.ok(!isNaN(A.valueOf())),A;let D;if(mC.ok(typeof A!=="boolean"),A instanceof Number||typeof A==="number")D=new Date(A);else if(typeof A==="string"&&!isNaN(Number(A))&&(Number(A)>=275761||Number(A)<-271820))D=new Date(Number(A));else if(typeof A.valueOf==="function")D=new Date(A.valueOf());else D=new Date(A);if(!isNaN(D.valueOf()))return D;mC.ok(!1)}});var Qb=E((Uk1,Cb)=>{/*!
478
+ * Module requirements.
479
+ */var qb=a2(),tW1=Gb(),t4=_0(),oW1=Hb(),eW1=L2(),FC1=b2(),AC1=q1(),Wb=t4.CastError;function H0(F,A){t4.call(this,F,A,"Date")}H0.schemaName="Date";H0.defaultOptions={};/*!
480
+ * Inherits from SchemaType.
481
+ */H0.prototype=Object.create(t4.prototype);H0.prototype.constructor=H0;H0.prototype.OptionsConstructor=tW1;/*!
482
+ * ignore
483
+ */H0._cast=oW1;H0.set=t4.set;H0.setters=[];H0.get=t4.get;H0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
484
+ * ignore
485
+ */H0._defaultCaster=(F)=>{if(F!=null&&!(F instanceof Date))throw new Error;return F};H0.prototype.expires=function(F){if(FC1(this._index)!=="Object")this._index={};return this._index.expires=F,AC1.expires(this._index),this};/*!
486
+ * ignore
487
+ */H0._checkRequired=(F)=>F instanceof Date;H0.checkRequired=t4.checkRequired;H0.prototype.checkRequired=function(F,A){if(typeof F==="object"&&t4._isRef(this,F,A,!0))return F!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():H0.checkRequired())(F)};H0.prototype.min=function(F,A){if(this.minValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.minValidator},this);if(F){let D=A||qb.messages.Date.min;if(typeof D==="string")D=D.replace(/{MIN}/,F===Date.now?"Date.now()":F.toString());let Z=this;this.validators.push({validator:this.minValidator=function(J){let X=F;if(typeof F==="function"&&F!==Date.now)X=X.call(this);let $=X===Date.now?X():Z.cast(X);return J===null||J.valueOf()>=$.valueOf()},message:D,type:"min",min:F})}return this};H0.prototype.max=function(F,A){if(this.maxValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.maxValidator},this);if(F){let D=A||qb.messages.Date.max;if(typeof D==="string")D=D.replace(/{MAX}/,F===Date.now?"Date.now()":F.toString());let Z=this;this.validators.push({validator:this.maxValidator=function(J){let X=F;if(typeof X==="function"&&X!==Date.now)X=X.call(this);let $=X===Date.now?X():Z.cast(X);return J===null||J.valueOf()<=$.valueOf()},message:D,type:"max",max:F})}return this};H0.prototype.cast=function(F){let A;if(typeof this._castFunction==="function")A=this._castFunction;else if(typeof this.constructor.cast==="function")A=this.constructor.cast();else A=H0.cast();try{return A(F)}catch(D){throw new Wb("date",F,this.path,D,this)}};function pJ(F){return this.cast(F)}H0.prototype.$conditionalHandlers={...t4.prototype.$conditionalHandlers,$gt:pJ,$gte:pJ,$lt:pJ,$lte:pJ};H0.prototype.castForQuery=function(F,A,D){if(F==null)try{return this.applySetters(A,D)}catch(J){if(J instanceof Wb&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}let Z=this.$conditionalHandlers[F];if(!Z)throw new Error("Can't use "+F+" with Date.");return Z.call(this,A)};H0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return eW1("string","date",A?.useBsonType,D)};/*!
488
+ * Module exports.
489
+ */Cb.exports=H0});var Eb=E((zk1,Kb)=>{var o9=hZ(),DC1=i("node:assert");Kb.exports=function F(A){if(A==null)return A;if(typeof A==="object"&&typeof A.$numberDecimal==="string")return o9.fromString(A.$numberDecimal);if(A instanceof o9)return A;if(typeof A==="string")return o9.fromString(A);if(typeof Buffer==="function"&&Buffer.isBuffer(A))return new o9(A);if(typeof Uint8Array==="function"&&A instanceof Uint8Array)return new o9(A);if(typeof A==="number")return o9.fromString(String(A));if(typeof A.valueOf==="function"&&typeof A.valueOf()==="string")return o9.fromString(A.valueOf());DC1.ok(!1)}});var zb=E((Vk1,Ub)=>{/*!
490
+ * Module dependencies.
491
+ */var G4=_0(),ZC1=G4.CastError,JC1=Eb(),XC1=L2(),dC=D2();function u0(F,A){G4.call(this,F,A,"Decimal128")}u0.schemaName="Decimal128";u0.defaultOptions={};/*!
492
+ * Inherits from SchemaType.
493
+ */u0.prototype=Object.create(G4.prototype);u0.prototype.constructor=u0;/*!
494
+ * ignore
495
+ */u0._cast=JC1;u0.set=G4.set;u0.setters=[];u0.get=G4.get;u0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
496
+ * ignore
497
+ */u0._defaultCaster=(F)=>{if(F!=null&&!dC(F,"Decimal128"))throw new Error;return F};/*!
498
+ * ignore
499
+ */u0._checkRequired=(F)=>dC(F,"Decimal128");u0.checkRequired=G4.checkRequired;u0.prototype.checkRequired=function F(A,D){if(G4._isRef(this,A,D,!0))return!!A;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():u0.checkRequired())(A)};u0.prototype.cast=function(F,A,D,Z,J){if(G4._isRef(this,F,A,D)){if(dC(F,"Decimal128"))return F;return this._castRef(F,A,D,J)}let X;if(typeof this._castFunction==="function")X=this._castFunction;else if(typeof this.constructor.cast==="function")X=this.constructor.cast();else X=u0.cast();try{return X(F)}catch($){throw new ZC1("Decimal128",F,this.path,$,this)}};/*!
500
+ * ignore
501
+ */function iJ(F){return this.cast(F)}u0.prototype.$conditionalHandlers={...G4.prototype.$conditionalHandlers,$gt:iJ,$gte:iJ,$lt:iJ,$lte:iJ};u0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return XC1("string","decimal",A?.useBsonType,D)};/*!
502
+ * Module exports.
503
+ */Ub.exports=u0});var Lb=E((Lk1,Vb)=>{var $C1=U6();class cC extends $C1{}var YC1=v6();Object.defineProperty(cC.prototype,"_id",YC1);Vb.exports=cC});var lC=E((Rk1,Rb)=>{Rb.exports=function F(A,D,Z){if(A.length===0)return Z();let J=A.length,X=null;for(let $ of A)D($,function(G){if(X!=null)return;if(G!=null)return X=G,Z(X);if(--J<=0)return Z()})}});var Pb=E((wk1,wb)=>{var GC1=lC();/*!
504
+ * ignore
505
+ */wb.exports=function F(A){A.s.hooks.pre("save",!1,function Z(J){if(this.$isSubdocument){J();return}let X=this,$=this.$getAllSubdocs({useCache:!0});if(!$.length){J();return}GC1($,function(G,Y){G.$__schema.s.hooks.execPre("save",G,function(B){Y(B)})},function(G){if(X.$__.saveOptions)X.$__.saveOptions.__subdocs=null;if(G)return X.$__schema.s.hooks.execPost("save:error",X,[X],{error:G},function(Y){J(Y)});J()})},null,!0),A.s.hooks.post("save",async function Z(){let J=this.$__.removedSubdocs;if(!J||!J.length)return;let X=[];for(let $ of J)X.push(new Promise((G,Y)=>{$.$__schema.s.hooks.execPost("deleteOne",$,[$],function(B){if(B)return Y(B);G()})}));this.$__.removedSubdocs=null,await Promise.all(X)}),A.s.hooks.post("save",async function Z(){if(this.$isSubdocument)return;let J=this,X=this.$getAllSubdocs({useCache:!0});if(!X.length)return;let $=[];for(let G of X)$.push(new Promise((Y,B)=>{G.$__schema.s.hooks.execPost("save",G,[G],function(H){if(H)return B(H);Y()})}));try{await Promise.all($)}catch(G){await new Promise((Y,B)=>{this.$__schema.s.hooks.execPost("save:error",J,[J],{error:G},function(H){if(H)return B(H);Y()})})}},null,!0)}});var Nb=E((Pk1,iC)=>{var BC1=A1().objectIdSymbol,Ib=q1();/*!
506
+ * ignore
507
+ */iC.exports=function F(A){A.post("init",function D(){return pC.call(this),this}),A.pre("save",function D(Z){Mb.call(this),Z()}),A.pre("remove",function D(Z){Mb.call(this),Z()}),A.post("save",function D(){pC.call(this)})};/*!
508
+ * ignore
509
+ */function Mb(){let F,A;if(this.$__.shardval){F=Object.keys(this.$__.shardval),A=F.length,this.$where=this.$where||{};for(let D=0;D<A;++D)this.$where[F[D]]=this.$__.shardval[F[D]]}}/*!
510
+ * ignore
511
+ */iC.exports.storeShard=pC;/*!
512
+ * ignore
513
+ */function pC(){let F=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(!Ib.isPOJO(F))return;let A=this.$__.shardval={},D=Object.keys(F),Z=D.length,J;for(let X=0;X<Z;++X)if(J=this.$__getValue(D[X]),J==null)A[D[X]]=J;else if(Ib.isMongooseObject(J))A[D[X]]=J.toObject({depopulate:!0,_isNested:!0});else if(J instanceof Date||J[BC1])A[D[X]]=J;else if(typeof J.valueOf==="function")A[D[X]]=J.valueOf();else A[D[X]]=J}});var kb=E((Ik1,Tb)=>{var l8=A1().arrayAtomicsSymbol,aC=A1().sessionNewDocuments,HC1=q1();Tb.exports=function F(A){A.pre("save",function D(){let Z=this.$session();if(Z==null)return;if(Z.transaction==null||Z[aC]==null)return;if(!Z[aC].has(this)){let J={};if(this.isNew)J.isNew=!0;if(this.$__schema.options.versionKey)J.versionKey=this.get(this.$__schema.options.versionKey);J.modifiedPaths=new Set(Object.keys(this.$__.activePaths.getStatePaths("modify"))),J.atomics=qC1(this),Z[aC].set(this,J)}})};function qC1(F,A){let D=new Map;A=A||new Map;let Z=Object.keys(F.$__.activePaths.init).concat(Object.keys(F.$__.activePaths.modify));for(let X of Z){let $=F.$__getValue(X);if($!=null&&Array.isArray($)&&HC1.isMongooseDocumentArray($)&&$.length&&$[l8]!=null&&Object.keys($[l8]).length!==0){let G=A.get(X)||{};D.set(X,jb(G,$[l8]))}}let J=F.$__dirty();for(let X of J){let{path:$,value:G}=X;if(G!=null&&G[l8]!=null&&Object.keys(G[l8]).length!==0){let Y=A.get($)||{};D.set($,jb(Y,G[l8]))}}return D}function jb(F,A){if(F=F||{},A.$pullAll!=null)F.$pullAll=(F.$pullAll||[]).concat(A.$pullAll);if(A.$push!=null)F.$push=F.$push||{},F.$push.$each=(F.$push.$each||[]).concat(A.$push.$each);if(A.$addToSet!=null)F.$addToSet=(F.$addToSet||[]).concat(A.$addToSet);if(A.$set!=null)F.$set=Array.isArray(A.$set)?[...A.$set]:Object.assign({},A.$set);return F}});var Sb=E((Mk1,Ob)=>{/*!
514
+ * ignore
515
+ */Ob.exports=function F(A){A.pre("save",!1,function Z(J,X){let $=this;if(this.$isSubdocument)return J();let G=X&&typeof X==="object"&&"validateBeforeSave"in X,Y;if(G)Y=!!X.validateBeforeSave;else Y=this.$__schema.options.validateBeforeSave;if(Y){let H=X&&typeof X==="object"&&"validateModifiedOnly"in X?{validateModifiedOnly:X.validateModifiedOnly}:null;this.$validate(H).then(()=>{this.$op="save",J()},(q)=>{$.$__schema.s.hooks.execPost("save:error",$,[$],{error:q},function(W){$.$op="save",J(W)})})}else J()},null,!0)}});var nC=E((WC1)=>{WC1.saveSubdocs=Pb();WC1.sharding=Nb();WC1.trackTransaction=kb();WC1.validateBeforeSave=Sb()});var xb=E((jk1,ub)=>{var _b=nC();ub.exports=function F(A){for(let D of Object.values(_b))D(A,{deduplicate:!0});A.plugins=Object.values(_b).map((D)=>({fn:D,opts:{deduplicate:!0}})).concat(A.plugins)}});var yb=E((Tk1,fb)=>{var UC1=sZ(),zC1=v9(),VC1=D2(),LC1=F4(),gb=p4();fb.exports=function F(A,D,Z,J){let X=Object.keys(D),$=0,G=X.length,Y;if(Z=Z||"",J=J||new WeakSet,J.has(D))return;J.add(D);while($<G){if(Y=X[$++],!Z){if(Y==="discriminators"||Y==="base"||Y==="_applyDiscriminators"||Y==="_userProvidedOptions"||Y==="options"||Y==="tree")continue}if(Z==="tree"&&D!=null&&D.instanceOfSchema)continue;if(zC1.has(Y))continue;if(A[Y]==null)A[Y]=D[Y];else if(gb(D[Y])){if(!gb(A[Y]))A[Y]={};if(D[Y]!=null){if(D[Y].$isSingleNested&&A[Y].$isMongooseDocumentArray||D[Y].$isMongooseDocumentArray&&A[Y].$isSingleNested||D[Y].$isMongooseDocumentArrayElement&&A[Y].$isMongooseDocumentArrayElement)continue;else if(D[Y].instanceOfSchema){if(A[Y].instanceOfSchema)UC1(A[Y],D[Y].clone(),!0);else A[Y]=D[Y].clone();continue}else if(VC1(D[Y],"ObjectId")){A[Y]=new LC1(D[Y]);continue}}F(A[Y],D[Y],Z?Z+"."+Y:Y,J)}}if(D!=null&&D.instanceOfSchema)A.tree=Object.assign({},D.tree,A.tree)}});var aJ=E((kk1,vb)=>{var bb=i9(),RC1=xb(),wC1=K0(),PC1=DJ().defineKey,IC1=L0(),sC=q1(),MC1=yb(),hb={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0};/*!
516
+ * ignore
517
+ */vb.exports=function F(A,D,Z,J,X,$,G){if(!(Z&&Z.instanceOfSchema))throw new Error("You must pass a valid discriminator Schema");if($=$==null?!0:$,A.schema.discriminatorMapping&&!A.schema.discriminatorMapping.isRoot)throw new Error('Discriminator "'+D+'" can only be a discriminator of the root model');if(X){let W=IC1(A.base,"options.applyPluginsToDiscriminators",!1)||!$;A.base._applyPlugins(Z,{skipTopLevel:!W})}else if(!$)RC1(Z);let Y=A.schema.options.discriminatorKey,B=A.schema.path(Y);if(B!=null){if(!sC.hasUserDefinedProperty(B.options,"select"))B.options.select=!0;B.options.$skipDiscriminatorCheck=!0}else{let W={};W[Y]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},W[Y][A.schema.options.typeKey]=String,A.schema.add(W),PC1({prop:Y,prototype:A.prototype,options:A.schema.options})}if(Z.path(Y)&&Z.path(Y).options.$skipDiscriminatorCheck!==!0)throw new Error('Discriminator "'+D+'" cannot have field with name "'+Y+'"');let H=D;if(typeof J==="string"&&J.length||J!=null)H=J;function q(W,C){if(W._baseSchema=C,C.paths._id&&C.paths._id.options&&!C.paths._id.options.auto)W.remove("_id");let Q=Object.keys(C.paths),K=[];for(let x of Q){if(W.nested[x]){K.push(x);continue}if(x.indexOf(".")===-1)continue;let _=x.split(".").slice(0,-1),O="";for(let R of _)if(O+=(O.length?".":"")+R,W.paths[O]instanceof bb||W.singleNestedPaths[O]instanceof bb)K.push(x)}W.obj={...W.obj},MC1(W,C),W._gatherChildSchemas();for(let x of K)delete W.paths[x];W.childSchemas.forEach((x)=>{x.model.prototype.$__setSchema(x.schema)});let U={};if(U[Y]={default:H,select:!0,set:function(x){if(x===H||Array.isArray(H)&&sC.deepEqual(x,H))return H;throw new Error(`Can't set discriminator key "`+Y+'"')},$skipDiscriminatorCheck:!0},U[Y][W.options.typeKey]=B?B.options[W.options.typeKey]:String,W.add(U),W.discriminatorMapping={key:Y,value:H,isRoot:!1},C.options.collection)W.options.collection=C.options.collection;let z=W.options.toJSON,L=W.options.toObject,V=W.options._id,P=W.options.id,I=Object.keys(W.options);W.options.discriminatorKey=C.options.discriminatorKey;let M=W._userProvidedOptions;for(let x of I)if(!hb[x]){if(x in M&&!sC.deepEqual(W.options[x],C.options[x]))throw new Error("Can't customize discriminator option "+x+" (can only modify "+Object.keys(hb).join(", ")+")")}W.options=wC1(C.options);for(let x of Object.keys(M))W.options[x]=M[x];if(z)W.options.toJSON=z;if(L)W.options.toObject=L;if(typeof V!=="undefined")W.options._id=V;if(W.options.id=P,$)W.s.hooks=A.schema.s.hooks.merge(W.s.hooks);if(X)W.plugins=Array.prototype.slice.call(C.plugins);W.callQueue=C.callQueue.concat(W.callQueue),delete W._requiredpaths}if(q(Z,A.schema),!A.discriminators)A.discriminators={};if(!A.schema.discriminatorMapping)A.schema.discriminatorMapping={key:Y,value:null,isRoot:!0};if(!A.schema.discriminators)A.schema.discriminators={};if(A.schema.discriminators[D]=Z,A.discriminators[D]&&!Z.options.overwriteModels&&!G)throw new Error('Discriminator with name "'+D+'" already exists');return Z}});var nJ=E((Ok1,mb)=>{var NC1=d6();mb.exports=function F(A,D,Z){let J=A.schema.options.discriminatorKey,X=D!=null&&D[J];if(X==null)X=Z;if(A.discriminators&&X!=null)if(A.discriminators[X])A=A.discriminators[X];else{let $=NC1(A.discriminators,X);if($)A=$}return A}});var rC=E((Sk1,db)=>{var jC1=qC();db.exports=function F(A,D){if(D==null||D._id==null)return A;if(A=A.clone(),!D._id)A.remove("_id"),A.options._id=!1;else if(!A.paths._id)jC1(A),A.options._id=!0;return A}});var oC=E((_k1,cb)=>{/*!
518
+ * Module dependencies.
519
+ */var TC1=w1();class tC extends TC1{constructor(F,A){let D=`Cannot create use schema for property "${F}" because the schema has the ${A} option enabled.`;super(D)}}Object.defineProperty(tC.prototype,"name",{value:"InvalidSchemaOptionError"});/*!
520
+ * exports
521
+ */cb.exports=tC});var DQ=E((uk1,ab)=>{/*!
522
+ * Module dependencies.
523
+ */var lb=E2(),eC=i("node:events").EventEmitter,kC1=tZ(),OC1=Lb(),p8=_0(),SC1=eZ(),_C1=iZ(),pb=JA().castToNumber,uC1=L2(),xC1=aJ(),FQ=_C(),AQ=nJ(),gC1=rC(),fC1=H3().internalToObjectOptions,yC1=u8(),bC1=q1(),hC1=oC(),sJ;ab.exports=i1;function i1(F,A,D){if(F.options.timeseries)throw new hC1(A,"timeseries");let Z=i1.defaultOptions&&i1.defaultOptions._id;if(Z!=null)D=D||{},D._id=Z;F=gC1(F,D),this.caster=ib(F,null,D),this.caster.path=A,this.caster.prototype.$basePath=A,this.schema=F,this.$isSingleNested=!0,this.base=F.base,p8.call(this,A,D,"Embedded")}/*!
524
+ * ignore
525
+ */i1.prototype=Object.create(p8.prototype);i1.prototype.constructor=i1;i1.prototype.OptionsConstructor=OC1;/*!
526
+ * ignore
527
+ */function ib(F,A,D){sJ||(sJ=$J());let Z=function X($,G,Y){if(this.$__parent=Y,sJ.apply(this,arguments),Y==null)return;this.$session(Y.$session())};F._preCompile();let J=A!=null?A.prototype:sJ.prototype;Z.prototype=Object.create(J),Z.prototype.$__setSchema(F),Z.prototype.constructor=Z,Z.$__required=D?.required,Z.base=F.base,Z.schema=F,Z.$isSingleNested=!0,Z.events=new eC,Z.prototype.toBSON=function(){return this.toObject(fC1)};for(let X in F.methods)Z.prototype[X]=F.methods[X];for(let X in F.statics)Z[X]=F.statics[X];for(let X in eC.prototype)Z[X]=eC.prototype[X];return Z}i1.prototype.$conditionalHandlers.$geoWithin=function F(A,D){return{$geometry:this.castForQuery(null,A.$geometry,D)}};/*!
528
+ * ignore
529
+ */i1.prototype.$conditionalHandlers.$near=i1.prototype.$conditionalHandlers.$nearSphere=FQ.cast$near;i1.prototype.$conditionalHandlers.$within=i1.prototype.$conditionalHandlers.$geoWithin=FQ.cast$within;i1.prototype.$conditionalHandlers.$geoIntersects=FQ.cast$geoIntersects;i1.prototype.$conditionalHandlers.$minDistance=pb;i1.prototype.$conditionalHandlers.$maxDistance=pb;i1.prototype.$conditionalHandlers.$exists=_C1;i1.prototype.cast=function(F,A,D,Z,J){if(F&&F.$isSingleNested&&F.parent===A)return F;if(F!=null&&(typeof F!=="object"||Array.isArray(F)))throw new kC1(this.path,F);let X=this.schema.path(this.schema.options.discriminatorKey),$=X==null?null:X.getDefault(A),G=AQ(this.caster,F,$),Y,B=A&&A.$__&&A.$__.selected,H=this.path,q=B==null?null:Object.keys(B).reduce((W,C)=>{if(C.startsWith(H+"."))W=W||{},W[C.substring(H.length+1)]=B[C];return W},null);if(D){Y=new G(void 0,q,A,!1,{defaults:!1}),delete Y.$__.defaults,Y.$init(F);let W=yC1(q);SC1(Y,q,W)}else{if(J=Object.assign({},J,{priorDoc:Z}),Object.keys(F).length===0)return new G({},q,A,void 0,J);return new G(F,q,A,void 0,J)}return Y};i1.prototype.castForQuery=function(F,A,D,Z){let J;if(F!=null){if(J=this.$conditionalHandlers[F],!J)throw new Error("Can't use "+F);return J.call(this,A)}if(A==null)return A;let X=AQ(this.caster,A);if(A instanceof X)return A;if(this.options.runSetters)A=this._applySetters(A,D);let $=Z!=null&&Z.strict!=null?Z.strict:void 0;try{A=new X(A,$)}catch(G){if(!(G instanceof lb))throw new lb("Embedded",A,this.path,G,this);throw G}return A};i1.prototype.doValidate=function(F,A,D,Z){let J=AQ(this.caster,F);if(F&&!(F instanceof J))F=new J(F,null,D!=null&&D.$__!=null?D:null);if(Z&&Z.skipSchemaValidators){if(!F)return A(null);return F.validate().then(()=>A(null),(X)=>A(X))}p8.prototype.doValidate.call(this,F,function(X){if(X)return A(X);if(!F)return A(null);F.validate().then(()=>A(null),($)=>A($))},D,Z)};i1.prototype.doValidateSync=function(F,A,D){if(!D||!D.skipSchemaValidators){let Z=p8.prototype.doValidateSync.call(this,F,A);if(Z)return Z}if(!F)return;return F.validateSync()};i1.prototype.discriminator=function(F,A,D){D=D||{};let Z=bC1.isPOJO(D)?D.value:D,J=typeof D.clone==="boolean"?D.clone:!0;if(A.instanceOfSchema&&J)A=A.clone();return A=xC1(this.caster,F,A,Z,null,null,D.overwriteExisting),this.caster.discriminators[F]=ib(A,this.caster),this.caster.discriminators[F]};/*!
530
+ * ignore
531
+ */i1.defaultOptions={};i1.set=p8.set;i1.setters=[];i1.get=p8.get;/*!
532
+ * ignore
533
+ */i1.prototype.toJSON=function F(){return{path:this.path,options:this.options}};/*!
534
+ * ignore
535
+ */i1.prototype.clone=function(){let F=new this.constructor(this.schema,this.path,{...this.options,_skipApplyDiscriminators:!0});if(F.validators=this.validators.slice(),this.requiredValidator!==void 0)F.requiredValidator=this.requiredValidator;return F.caster.discriminators=Object.assign({},this.caster.discriminators),F._appliedDiscriminators=this._appliedDiscriminators,F};i1.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return{...this.schema.toJSONSchema(A),...uC1("object","object",A?.useBsonType,D)}}});var sb=E((xk1,nb)=>{/*!
536
+ * Module dependencies.
537
+ */var vC1=w1(),ZQ=_0(),mC1=DQ(),dC1=nJ();function B4(F,A){if(this.$parentSchemaType=A&&A.$parentSchemaType,!this.$parentSchemaType)throw new vC1("Cannot create DocumentArrayElement schematype without a parent");delete A.$parentSchemaType,ZQ.call(this,F,A,"DocumentArrayElement"),this.$isMongooseDocumentArrayElement=!0}B4.schemaName="DocumentArrayElement";B4.defaultOptions={};/*!
538
+ * Inherits from SchemaType.
539
+ */B4.prototype=Object.create(ZQ.prototype);B4.prototype.constructor=B4;B4.prototype.cast=function(...F){return this.$parentSchemaType.cast(...F)[0]};B4.prototype.doValidate=function(F,A,D,Z){let J=dC1(this.caster,F);if(F&&!(F instanceof J))F=new J(F,D,null,null,Z&&Z.index!=null?Z.index:null);return mC1.prototype.doValidate.call(this,F,A,D,Z)};B4.prototype.clone=function(){this.options.$parentSchemaType=this.$parentSchemaType;let F=ZQ.prototype.clone.apply(this,arguments);return delete this.options.$parentSchemaType,F.caster=this.caster,F.schema=this.schema,F};/*!
540
+ * Module exports.
541
+ */nb.exports=B4});var ob=E((gk1,tb)=>{var cC1=U6();class rJ extends cC1{}var rb=v6();Object.defineProperty(rJ.prototype,"excludeIndexes",rb);Object.defineProperty(rJ.prototype,"_id",rb);/*!
542
+ * ignore
543
+ */tb.exports=rJ});var Yh=E((fk1,$h)=>{/*!
544
+ * Module dependencies.
545
+ */var eb=E2(),lC1=sb(),JQ=i("node:events").EventEmitter,$Q=fJ(),pC1=ob(),BA=_0(),Fh=t9(),Ah=L2(),iC1=aJ(),Dh=rC(),aC1=JJ(),nC1=AA(),i8=q1(),tJ=nJ(),sC1=oC(),Zh=A1().arrayAtomicsSymbol,XQ=A1().arrayPathSymbol,rC1=A1().documentArrayParent,H4,e9;function W0(F,A,D,Z){if(A.options&&A.options.timeseries)throw new sC1(F,"timeseries");let J=W0.defaultOptions&&W0.defaultOptions._id;if(J!=null)Z=Z||{},Z._id=J;if(Z!=null&&Z._id!=null)A=Dh(A,Z);else if(D!=null&&D._id!=null)A=Dh(A,D);let X=Xh(A,D);X.prototype.$basePath=F,$Q.call(this,F,X,D),this.schema=A,this.schemaOptions=Z||{},this.$isMongooseDocumentArray=!0,this.Constructor=X,X.base=A.base;let $=this.defaultValue;if(!("defaultValue"in this)||$!=null)this.default(function(){let Y=$.call(this);if(Y!=null&&!Array.isArray(Y))Y=[Y];return Y});let G=this;this.$embeddedSchemaType=new lC1(F+".$",{required:this&&this.schemaOptions&&this.schemaOptions.required||!1,$parentSchemaType:G}),this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}W0.schemaName="DocumentArray";W0.options={castNonArrays:!0};/*!
546
+ * Inherits from SchemaArray.
547
+ */W0.prototype=Object.create($Q.prototype);W0.prototype.constructor=W0;W0.prototype.OptionsConstructor=pC1;W0.prototype.$conditionalHandlers={...$Q.prototype.$conditionalHandlers};/*!
548
+ * ignore
549
+ */function Xh(F,A,D){e9||(e9=x8());function Z(){if(e9.apply(this,arguments),this.__parentArray==null||this.__parentArray.getArrayParent()==null)return;this.$session(this.__parentArray.getArrayParent().$session())}F._preCompile();let J=D!=null?D.prototype:e9.prototype;Z.prototype=Object.create(J),Z.prototype.$__setSchema(F),Z.schema=F,Z.prototype.constructor=Z,Z.$isArraySubdocument=!0,Z.events=new JQ,Z.base=F.base;for(let X in F.methods)Z.prototype[X]=F.methods[X];for(let X in F.statics)Z[X]=F.statics[X];for(let X in JQ.prototype)Z[X]=JQ.prototype[X];return Z.options=A,Z}W0.prototype.discriminator=function(F,A,D){if(typeof F==="function")F=i8.getFunctionName(F);D=D||{};let Z=i8.isPOJO(D)?D.value:D,J=typeof D.clone==="boolean"?D.clone:!0;if(A.instanceOfSchema&&J)A=A.clone();A=iC1(this.casterConstructor,F,A,Z,null,null,D?.overwriteExisting);let X=Xh(A,null,this.casterConstructor);X.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(X,"name",{value:F})}catch($){}return this.casterConstructor.discriminators[F]=X,this.casterConstructor.discriminators[F]};W0.prototype.doValidate=function(F,A,D,Z){H4||(H4=n9());let J=this;try{BA.prototype.doValidate.call(this,F,X,D)}catch($){return A($)}function X($){if($)return A($);let G=F&&F.length,Y;if(!G)return A();if(Z&&Z.updateValidator)return A();if(!i8.isMongooseDocumentArray(F))F=new H4(F,J.path,D);function B(H){if(H!=null)Y=H;--G||A(Y)}for(let H=0,q=G;H<q;++H){let W=F[H];if(W==null){--G||A(Y);continue}if(!(W instanceof e9)){let C=tJ(J.casterConstructor,F[H]);W=F[H]=new C(W,F,void 0,void 0,H)}if(Z!=null&&Z.validateModifiedOnly&&!W.$isModified()){--G||A(Y);continue}W.$__validate(null,Z,B)}}};W0.prototype.doValidateSync=function(F,A,D){let Z=BA.prototype.doValidateSync.call(this,F,A);if(Z!=null)return Z;let J=F&&F.length,X=null;if(!J)return;for(let $=0,G=J;$<G;++$){let Y=F[$];if(!Y)continue;if(!(Y instanceof e9)){let H=tJ(this.casterConstructor,F[$]);Y=F[$]=new H(Y,F,void 0,void 0,$)}if(D!=null&&D.validateModifiedOnly&&!Y.$isModified())continue;let B=Y.validateSync(D);if(B&&X==null)X=B}return X};/*!
550
+ * ignore
551
+ */W0.prototype.getDefault=function(F,A,D){let Z=typeof this.defaultValue==="function"?this.defaultValue.call(F):this.defaultValue;if(Z==null)return Z;if(D&&D.skipCast)return Z;if(H4||(H4=n9()),!Array.isArray(Z))Z=[Z];Z=new H4(Z,this.path,F);for(let J=0;J<Z.length;++J){let $=new(tJ(this.casterConstructor,Z[J]))({},Z,void 0,void 0,J);$.$init(Z[J]),$.isNew=!0,Object.assign($.$__.activePaths.default,$.$__.activePaths.init),$.$__.activePaths.init={},Z[J]=$}return Z};var tC1=Object.freeze({transform:!1,virtuals:!1}),Jh=Object.freeze({skipId:!1,willInit:!0});W0.prototype.cast=function(F,A,D,Z,J){if(H4||(H4=n9()),F!=null&&F[XQ]!=null&&F===Z)return F;let X,$;J=J||{};let G=J.path||this.path;if(!Array.isArray(F)){if(!D&&!W0.options.castNonArrays)throw new eb("DocumentArray",F,this.path,null,this);if(!!A&&D)A.markModified(G);return this.cast([F],A,D,Z,J)}if(!J.skipDocumentArrayCast||i8.isMongooseDocumentArray(F))F=new H4(F,G,A,this);if(Z!=null)F[Zh]=Z[Zh]||{};if(J.arrayPathIndex!=null)F[XQ]=G+"."+J.arrayPathIndex;let Y=i8.isMongooseDocumentArray(F)?F.__array:F,B=Y.length;for(let H=0;H<B;++H){if(!Y[H])continue;let q=tJ(this.casterConstructor,Y[H]),W=aC1(Y[H],!0);if(Y[H]!==W)Y[H]=W;if(Y[H]instanceof e9){if(Y[H][rC1]!==A)if(D){let C=new q(null,F,Jh,X,H);Y[H]=C.$init(Y[H])}else{let C=new q(Y[H],F,void 0,void 0,H);Y[H]=C}if(Y[H].__index==null)Y[H].$setIndex(H)}else if(Y[H]!=null)if(D){if(A)X||(X=oC1(this,A.$__.selected,D));else X=!0;$=new q(null,F,Jh,X,H),Y[H]=$.$init(Y[H])}else{if(Z&&typeof Z.id==="function")$=Z.id(Y[H]._id);if(Z&&$&&i8.deepEqual($.toObject(tC1),Y[H]))$.set(Y[H]),Y[H]=$;else try{$=new q(Y[H],F,void 0,void 0,H),Y[H]=$}catch(C){throw new eb("embedded",Y[H],F[XQ],C,this)}}}return F};/*!
552
+ * ignore
553
+ */W0.prototype.clone=function(){let F=Object.assign({},this.options),A=new this.constructor(this.path,this.schema,F,this.schemaOptions);if(A.validators=this.validators.slice(),this.requiredValidator!==void 0)A.requiredValidator=this.requiredValidator;return A.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),A._appliedDiscriminators=this._appliedDiscriminators,A};/*!
554
+ * ignore
555
+ */W0.prototype.applyGetters=function(F,A){return BA.prototype.applyGetters.call(this,F,A)};function oC1(F,A,D){if(!(D&&A))return;let Z=F.path+".",J=Object.keys(A),X=J.length,$={},G,Y,B;while(X--)if(Y=J[X],Y.startsWith(Z)){if(B=Y.substring(Z.length),B==="$")continue;if(B.startsWith("$."))B=B.substring(2);G||(G=!0),$[B]=A[Y]}return G&&$||void 0}/*!
556
+ * ignore
557
+ */W0.defaultOptions={};W0.set=BA.set;W0.setters=[];W0.get=BA.get;/*!
558
+ * Handle casting $elemMatch operators
559
+ */W0.prototype.$conditionalHandlers.$elemMatch=eC1;function eC1(F,A){let D=Object.keys(F),Z=D.length;for(let G=0;G<Z;++G){let Y=D[G],B=F[Y];if(nC1(Y)&&B!=null)F[Y]=this.castForQuery(Y,B,A)}let J=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.options&&this.casterConstructor.schema.options.discriminatorKey,X=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.discriminators||{};if(J!=null&&F[J]!=null&&X[F[J]]!=null)return Fh(X[F[J]],F,null,this&&this.$$context);let $=this.casterConstructor.schema??A.schema;return Fh($,F,null,this&&this.$$context)}W0.prototype.toJSONSchema=function F(A){let D=Ah("object","object",A?.useBsonType,!1),Z=this.options.required&&typeof this.options.required!=="function";return{...Ah("array","array",A?.useBsonType,Z),items:{...D,...this.schema.toJSONSchema(A)}}};/*!
560
+ * Module exports.
561
+ */$h.exports=W0});var Bh=E((yk1,Gh)=>{var FQ1=U6();class YQ extends FQ1{}var AQ1=v6();Object.defineProperty(YQ.prototype,"of",AQ1);Gh.exports=YQ});var Wh=E((bk1,qh)=>{/*!
562
+ * ignore
563
+ */var GQ=TJ(),DQ1=Bh(),Hh=_0(),ZQ1=L2();/*!
564
+ * ignore
565
+ */class HA extends Hh{constructor(F,A){super(F,A,"Map");this.$isSchemaMap=!0}set(F,A){return Hh.set(F,A)}cast(F,A,D){if(F instanceof GQ)return F;let Z=this.path;if(D){let J=new GQ({},Z,A,this.$__schemaType);if(F instanceof global.Map)for(let X of F.keys()){let $=F.get(X);if($==null)$=J.$__schemaType._castNullish($);else $=J.$__schemaType.cast($,A,!0,null,{path:Z+"."+X});J.$init(X,$)}else for(let X of Object.keys(F)){let $=F[X];if($==null)$=J.$__schemaType._castNullish($);else $=J.$__schemaType.cast($,A,!0,null,{path:Z+"."+X});J.$init(X,$)}return J}return new GQ(F,Z,A,this.$__schemaType)}clone(){let F=super.clone();if(this.$__schemaType!=null)F.$__schemaType=this.$__schemaType.clone();return F}getEmbeddedSchemaType(){return this.$__schemaType}toJSONSchema(F){let A=F?.useBsonType,D=this.getEmbeddedSchemaType(),Z=this.options.required&&typeof this.options.required!=="function",J=ZQ1("object","object",A,Z);return J.additionalProperties=D.toJSONSchema(F),J}}HA.schemaName="Map";HA.prototype.OptionsConstructor=DQ1;HA.defaultOptions={};qh.exports=HA});var Kh=E((hk1,Qh)=>{var JQ1=U6();class oJ extends JQ1{}var Ch=v6();Object.defineProperty(oJ.prototype,"auto",Ch);Object.defineProperty(oJ.prototype,"populate",Ch);/*!
566
+ * ignore
567
+ */Qh.exports=oJ});var Vh=E((vk1,zh)=>{/*!
568
+ * Module dependencies.
569
+ */var XQ1=Kh(),q4=_0(),$Q1=fW(),YQ1=L2(),GQ1=b2(),HQ=F4(),qQ=D2(),Eh=q1(),BQ1=q4.CastError,BQ;function w0(F,A){let D=typeof F==="string"&&F.length===24&&/^[a-f0-9]+$/i.test(F),Z=A&&A.suppressWarning;if((D||typeof F==="undefined")&&!Z)Eh.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema.");q4.call(this,F,A,"ObjectId")}w0.schemaName="ObjectId";w0.defaultOptions={};/*!
570
+ * Inherits from SchemaType.
571
+ */w0.prototype=Object.create(q4.prototype);w0.prototype.constructor=w0;w0.prototype.OptionsConstructor=XQ1;w0.get=q4.get;w0.set=q4.set;w0.setters=[];w0.prototype.auto=function(F){if(F)this.default(Uh),this.set(HQ1);return this};/*!
572
+ * ignore
573
+ */w0._checkRequired=(F)=>qQ(F,"ObjectId");/*!
574
+ * ignore
575
+ */w0._cast=$Q1;w0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
576
+ * ignore
577
+ */w0._defaultCaster=(F)=>{if(!qQ(F,"ObjectId"))throw new Error(F+" is not an instance of ObjectId");return F};w0.checkRequired=q4.checkRequired;w0.prototype.checkRequired=function F(A,D){if(q4._isRef(this,A,D,!0))return!!A;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():w0.checkRequired())(A)};w0.prototype.cast=function(F,A,D,Z,J){if(!qQ(F,"ObjectId")&&q4._isRef(this,F,A,D)){if((GQ1(F)||"").toLowerCase()==="objectid")return new HQ(F.toHexString());if(F==null||Eh.isNonBuiltinObject(F))return this._castRef(F,A,D,J)}let X;if(typeof this._castFunction==="function")X=this._castFunction;else if(typeof this.constructor.cast==="function")X=this.constructor.cast();else X=w0.cast();try{return X(F)}catch($){throw new BQ1("ObjectId",F,this.path,$,this)}};/*!
578
+ * ignore
579
+ */function eJ(F){return this.cast(F)}w0.prototype.$conditionalHandlers={...q4.prototype.$conditionalHandlers,$gt:eJ,$gte:eJ,$lt:eJ,$lte:eJ};/*!
580
+ * ignore
581
+ */function Uh(){return new HQ}Uh.$runBeforeSetters=!0;function HQ1(F){if(BQ||(BQ=r2()),this instanceof BQ){if(F===void 0)return new HQ}return F}w0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function"||this.path==="_id";return YQ1("string","objectId",A?.useBsonType,D)};/*!
582
+ * Module exports.
583
+ */zh.exports=w0});var Rh=E((mk1,Lh)=>{var qQ1=U6();class p6 extends qQ1{}var k3=v6();Object.defineProperty(p6.prototype,"enum",k3);Object.defineProperty(p6.prototype,"match",k3);Object.defineProperty(p6.prototype,"lowercase",k3);Object.defineProperty(p6.prototype,"trim",k3);Object.defineProperty(p6.prototype,"uppercase",k3);Object.defineProperty(p6.prototype,"minLength",k3);Object.defineProperty(p6.prototype,"minlength",k3);Object.defineProperty(p6.prototype,"maxLength",k3);Object.defineProperty(p6.prototype,"maxlength",k3);Object.defineProperty(p6.prototype,"populate",k3);/*!
584
+ * ignore
585
+ */Lh.exports=p6});var WQ=E((dk1,Mh)=>{/*!
586
+ * Module dependencies.
587
+ */var W4=_0(),WA=a2(),WQ1=Rh(),CQ1=SJ(),QQ1=L2(),wh=q1(),KQ1=D2(),Ih=W4.CastError;function g1(F,A){this.enumValues=[],this.regExp=null,W4.call(this,F,A,"String")}g1.schemaName="String";g1.defaultOptions={};/*!
588
+ * Inherits from SchemaType.
589
+ */g1.prototype=Object.create(W4.prototype);g1.prototype.constructor=g1;Object.defineProperty(g1.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:WQ1});/*!
590
+ * ignore
591
+ */g1._cast=CQ1;g1.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
592
+ * ignore
593
+ */g1._defaultCaster=(F)=>{if(F!=null&&typeof F!=="string")throw new Error;return F};g1.get=W4.get;g1.set=W4.set;g1.setters=[];/*!
594
+ * ignore
595
+ */g1._checkRequired=(F)=>(F instanceof String||typeof F==="string")&&F.length;g1.checkRequired=W4.checkRequired;g1.prototype.enum=function(){if(this.enumValidator)this.validators=this.validators.filter(function(Z){return Z.validator!==this.enumValidator},this),this.enumValidator=!1;if(arguments[0]===void 0||arguments[0]===!1)return this;let F,A;if(wh.isObject(arguments[0]))if(Array.isArray(arguments[0].values))F=arguments[0].values,A=arguments[0].message;else F=wh.object.vals(arguments[0]),A=WA.messages.String.enum;else F=arguments,A=WA.messages.String.enum;for(let Z of F)if(Z!==void 0)this.enumValues.push(this.cast(Z));let D=this.enumValues;return this.enumValidator=function(Z){return Z==null||~D.indexOf(Z)},this.validators.push({validator:this.enumValidator,message:A,type:"enum",enumValues:D}),this};g1.prototype.lowercase=function(F){if(arguments.length>0&&!F)return this;return this.set((A)=>{if(typeof A!=="string")A=this.cast(A);if(A)return A.toLowerCase();return A})};g1.prototype.uppercase=function(F){if(arguments.length>0&&!F)return this;return this.set((A)=>{if(typeof A!=="string")A=this.cast(A);if(A)return A.toUpperCase();return A})};g1.prototype.trim=function(F){if(arguments.length>0&&!F)return this;return this.set((A)=>{if(typeof A!=="string")A=this.cast(A);if(A)return A.trim();return A})};g1.prototype.minlength=function(F,A){if(this.minlengthValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.minlengthValidator},this);if(F!==null&&F!==void 0){let D=A||WA.messages.String.minlength;D=D.replace(/{MINLENGTH}/,F),this.validators.push({validator:this.minlengthValidator=function(Z){return Z===null||Z.length>=F},message:D,type:"minlength",minlength:F})}return this};g1.prototype.minLength=g1.prototype.minlength;g1.prototype.maxlength=function(F,A){if(this.maxlengthValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.maxlengthValidator},this);if(F!==null&&F!==void 0){let D=A||WA.messages.String.maxlength;D=D.replace(/{MAXLENGTH}/,F),this.validators.push({validator:this.maxlengthValidator=function(Z){return Z===null||Z.length<=F},message:D,type:"maxlength",maxlength:F})}return this};g1.prototype.maxLength=g1.prototype.maxlength;g1.prototype.match=function F(A,D){let Z=D||WA.messages.String.match,J=function(X){if(!A)return!1;return A.lastIndex=0,X!=null&&X!==""?A.test(X):!0};return this.validators.push({validator:J,message:Z,type:"regexp",regexp:A}),this};g1.prototype.checkRequired=function F(A,D){if(typeof A==="object"&&W4._isRef(this,A,D,!0))return A!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():g1.checkRequired())(A)};g1.prototype.cast=function(F,A,D,Z,J){if(typeof F!=="string"&&W4._isRef(this,F,A,D))return this._castRef(F,A,D,J);let X;if(typeof this._castFunction==="function")X=this._castFunction;else if(typeof this.constructor.cast==="function")X=this.constructor.cast();else X=g1.cast();try{return X(F)}catch($){throw new Ih("string",F,this.path,null,this)}};/*!
596
+ * ignore
597
+ */function qA(F,A){return this.castForQuery(null,F,A)}/*!
598
+ * ignore
599
+ */function EQ1(F,A){let D=this;if(!Array.isArray(F))return[this.castForQuery(null,F,A)];return F.map(function(Z){return D.castForQuery(null,Z,A)})}/*!
600
+ * ignore
601
+ */function Ph(F){if(F==null)return this._castNullish(F);return this.cast(F,this)}var UQ1={...W4.prototype.$conditionalHandlers,$all:EQ1,$gt:qA,$gte:qA,$lt:qA,$lte:qA,$options:Ph,$regex:function F(A){if(Object.prototype.toString.call(A)==="[object RegExp]")return A;return Ph.call(this,A)},$not:qA};Object.defineProperty(g1.prototype,"$conditionalHandlers",{configurable:!1,enumerable:!1,writable:!1,value:Object.freeze(UQ1)});g1.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=this.$conditionalHandlers[F],!Z)throw new Error("Can't use "+F+" with String.");return Z.call(this,A,D)}if(Object.prototype.toString.call(A)==="[object RegExp]"||KQ1(A,"BSONRegExp"))return A;try{return this.applySetters(A,D)}catch(J){if(J instanceof Ih&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};g1.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return QQ1("string","string",A?.useBsonType,D)};/*!
602
+ * Module exports.
603
+ */Mh.exports=g1});var jh=E((ck1,KQ)=>{var QQ=k8(),CQ=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,zQ1=QQ.Binary;KQ.exports=function F(A){if(A==null)return A;function D(Z){let J=new QQ(Z);return J._subtype=4,J}if(typeof A==="string")if(CQ.test(A))return Nh(A);else throw new Error(`"${A}" is not a valid UUID string`);if(Buffer.isBuffer(A))return D(A);if(A instanceof zQ1)return D(A.value(!0));if(A.toString&&A.toString!==Object.prototype.toString){if(CQ.test(A.toString()))return Nh(A.toString())}throw new Error(`"${A}" cannot be casted to a UUID`)};KQ.exports.UUID_FORMAT=CQ;function VQ1(F){return F!=null&&Buffer.from(F,"hex")}function Nh(F){if(typeof F!=="string")F="";let A=F.replace(/[{}-]/g,""),D=VQ1(A),Z=new QQ(D);return Z._subtype=4,Z}});var _h=E((lk1,Sh)=>{/*!
604
+ * Module dependencies.
605
+ */var LQ1=k8(),o4=_0(),Th=o4.CastError,kh=jh(),RQ1=L2(),Oh=q1(),FX=ZA(),wQ1=kh.UUID_FORMAT,PQ1=LQ1.Binary;function AX(F){let A;if(typeof F!=="string"&&F!=null)return A=F.toString("hex"),A.substring(0,8)+"-"+A.substring(8,12)+"-"+A.substring(12,16)+"-"+A.substring(16,20)+"-"+A.substring(20,32);return F}function x0(F,A){o4.call(this,F,A,"UUID"),this.getters.push(function(D){if(D!=null&&D.$__!=null)return D;if(Buffer.isBuffer(D))return AX(D);else if(D instanceof PQ1)return AX(D.buffer);else if(Oh.isPOJO(D)&&D.type==="Buffer"&&Array.isArray(D.data))return AX(Buffer.from(D.data));return D})}x0.schemaName="UUID";x0.defaultOptions={};/*!
606
+ * Inherits from SchemaType.
607
+ */x0.prototype=Object.create(o4.prototype);x0.prototype.constructor=x0;/*!
608
+ * ignore
609
+ */x0._cast=kh;x0.get=o4.get;x0.set=o4.set;x0.setters=[];x0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
610
+ * ignore
611
+ */x0._checkRequired=(F)=>F!=null;x0.checkRequired=o4.checkRequired;x0.prototype.checkRequired=function F(A){if(Buffer.isBuffer(A))A=AX(A);return A!=null&&wQ1.test(A)};x0.prototype.cast=function(F,A,D,Z,J){if(Oh.isNonBuiltinObject(F)&&o4._isRef(this,F,A,D))return this._castRef(F,A,D,J);let X;if(typeof this._castFunction==="function")X=this._castFunction;else if(typeof this.constructor.cast==="function")X=this.constructor.cast();else X=x0.cast();try{return X(F)}catch($){throw new Th(x0.schemaName,F,this.path,$,this)}};/*!
612
+ * ignore
613
+ */function CA(F){return this.cast(F)}/*!
614
+ * ignore
615
+ */function EQ(F){return F.map((A)=>{return this.cast(A)})}x0.prototype.$conditionalHandlers={...o4.prototype.$conditionalHandlers,$bitsAllClear:FX,$bitsAnyClear:FX,$bitsAllSet:FX,$bitsAnySet:FX,$all:EQ,$gt:CA,$gte:CA,$in:EQ,$lt:CA,$lte:CA,$ne:CA,$nin:EQ};x0.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=this.$conditionalHandlers[F],!Z)throw new Error("Can't use "+F+" with UUID.");return Z.call(this,A,D)}try{return this.applySetters(A,D)}catch(J){if(J instanceof Th&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};x0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return RQ1("string","binData",A?.useBsonType,D)};/*!
616
+ * Module exports.
617
+ */Sh.exports=x0});var gh=E((pk1,xh)=>{var uh=i("node:assert"),UQ=B3(),IQ1=D2();xh.exports=function F(A){if(A==null||A==="")return null;let D;if(IQ1(A,"Long"))D=A.toNumber();else if(typeof A==="string")try{return D=UQ.Double.fromString(A),D}catch{uh.ok(!1)}else if(typeof A==="object"){let Z=A.valueOf()??A.toString();if(typeof Z==="string")try{return D=UQ.Double.fromString(A),D}catch{uh.ok(!1)}else D=Number(Z)}else D=Number(A);return new UQ.Double(D)}});var yh=E((ik1,fh)=>{/*!
618
+ * Module dependencies.
619
+ */var MQ1=E2(),a8=_0(),NQ1=gh(),jQ1=L2();function f0(F,A){a8.call(this,F,A,"Double")}f0.schemaName="Double";f0.defaultOptions={};/*!
620
+ * Inherits from SchemaType.
621
+ */f0.prototype=Object.create(a8.prototype);f0.prototype.constructor=f0;/*!
622
+ * ignore
623
+ */f0._cast=NQ1;f0.set=a8.set;f0.setters=[];f0.get=a8.get;/*!
624
+ * ignore
625
+ */f0._defaultCaster=(F)=>{if(F!=null){if(F._bsontype!=="Double")throw new Error}return F};f0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
626
+ * ignore
627
+ */f0._checkRequired=(F)=>F!=null;f0.checkRequired=a8.checkRequired;f0.prototype.checkRequired=function(F){return this.constructor._checkRequired(F)};f0.prototype.cast=function(F){let A;if(typeof this._castFunction==="function")A=this._castFunction;else if(typeof this.constructor.cast==="function")A=this.constructor.cast();else A=f0.cast();try{return A(F)}catch(D){throw new MQ1("Double",F,this.path,D,this)}};/*!
628
+ * ignore
629
+ */function DX(F){return this.cast(F)}f0.prototype.$conditionalHandlers={...a8.prototype.$conditionalHandlers,$gt:DX,$gte:DX,$lt:DX,$lte:DX};f0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return jQ1("number","double",A?.useBsonType,D)};/*!
630
+ * Module exports.
631
+ */fh.exports=f0});var hh=E((ak1,bh)=>{var TQ1=D2(),kQ1=i("node:assert");bh.exports=function F(A){if(A==null)return A;if(A==="")return null;let D=TQ1(A,"Long")?A.toNumber():Number(A),Z=2147483647,J=-2147483648;if(D===(D|0)&&D>=J&&D<=Z)return D;kQ1.ok(!1)}});var dh=E((nk1,mh)=>{/*!
632
+ * Module dependencies.
633
+ */var vh=E2(),n8=_0(),OQ1=hh(),SQ1=L2(),ZX=ZA();function T0(F,A){n8.call(this,F,A,"Int32")}T0.schemaName="Int32";T0.defaultOptions={};/*!
634
+ * Inherits from SchemaType.
635
+ */T0.prototype=Object.create(n8.prototype);T0.prototype.constructor=T0;/*!
636
+ * ignore
637
+ */T0._cast=OQ1;T0.set=n8.set;T0.setters=[];T0.get=n8.get;/*!
638
+ * ignore
639
+ */T0._defaultCaster=(F)=>{if(F!=null){if(typeof F!=="number"||F!==(F|0)||F<-2147483648||F>2147483647)throw new Error}return F};T0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
640
+ * ignore
641
+ */T0._checkRequired=(F)=>F!=null;T0.checkRequired=n8.checkRequired;T0.prototype.checkRequired=function(F){return this.constructor._checkRequired(F)};T0.prototype.cast=function(F){let A;if(typeof this._castFunction==="function")A=this._castFunction;else if(typeof this.constructor.cast==="function")A=this.constructor.cast();else A=T0.cast();try{return A(F)}catch(D){throw new vh("Int32",F,this.path,D,this)}};/*!
642
+ * ignore
643
+ */T0.$conditionalHandlers={...n8.prototype.$conditionalHandlers,$gt:JX,$gte:JX,$lt:JX,$lte:JX,$bitsAllClear:ZX,$bitsAnyClear:ZX,$bitsAllSet:ZX,$bitsAnySet:ZX};/*!
644
+ * ignore
645
+ */function JX(F,A){return this.castForQuery(null,F,A)}T0.prototype.castForQuery=function(F,A,D){let Z;if(F!=null){if(Z=T0.$conditionalHandlers[F],Z)return Z.call(this,A);return this.applySetters(A,D)}try{return this.applySetters(A,D)}catch(J){if(J instanceof vh&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};T0.prototype.toJSONSchema=function F(A){let D=this.options.required&&typeof this.options.required!=="function";return SQ1("number","int",A?.useBsonType,D)};/*!
646
+ * Module exports.
647
+ */mh.exports=T0});var DA=E((_Q1)=>{/*!
648
+ * Module exports.
649
+ */_Q1.Array=fJ();_Q1.BigInt=oy();_Q1.Boolean=Ab();_Q1.Buffer=$b();_Q1.Date=Qb();_Q1.Decimal128=_Q1.Decimal=zb();_Q1.DocumentArray=Yh();_Q1.Map=Wh();_Q1.Mixed=i9();_Q1.Number=kC();_Q1.ObjectId=Vh();_Q1.String=WQ();_Q1.Subdocument=DQ();_Q1.UUID=_h();_Q1.Double=yh();_Q1.Int32=dh();_Q1.Oid=_Q1.ObjectId;_Q1.Object=_Q1.Mixed;_Q1.Bool=_Q1.Boolean;_Q1.ObjectID=_Q1.ObjectId});var g8=E((wQ,Zv)=>{/*!
650
+ * Module dependencies.
651
+ */var rQ1=i("node:events").EventEmitter,tQ1=m9(),C4=w1(),ph=_0(),ih=U6(),oQ1=BC(),RQ=IJ(),ah=qC(),v2=K0(),nh=L0(),eQ1=b2(),FK1=gf(),YX=QC(),AK1=bf(),rh=vf(),DK1=sZ(),XX=z6(),ZK1=df(),JK1=ef(),r1=q1(),XK1=Ay(),$K1=/\.\d+(\.|$)/,e4,YK1=NJ().queryMiddlewareFunctions,GK1=jJ().middlewareFunctions,th=YK1.concat(GK1).reduce((F,A)=>F.add(A),new Set),VQ=r1.isPOJO,oh=0,BK1=/^\d+$/;function t(F,A){if(!(this instanceof t))return new t(F,A);if(this.obj=F,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this._searchIndexes=[],this.methods=A&&A.methods||{},this.methodOptions={},this.statics=A&&A.statics||{},this.tree={},this.query=A&&A.query||{},this.childSchemas=[],this.plugins=[],this.$id=++oh,this.mapPaths=[],this.s={hooks:new tQ1},this.options=this.defaultOptions(A),Array.isArray(F))for(let J of F)this.add(J);else if(F)this.add(F);if(A&&A.virtuals){let J=A.virtuals,X=Object.keys(J);for(let $ of X){let G=J[$].options?J[$].options:void 0,Y=this.virtual($,G);if(J[$].get)Y.get(J[$].get);if(J[$].set)Y.set(J[$].set)}}let D=F&&F._id&&r1.isObject(F._id);if(!this.paths._id&&this.options._id&&!D)ah(this);this.setupTimestamp(this.options.timestamps)}function eh(F,A){for(let D of Object.keys(A)){let Z=null;if(A[D]!=null)Z=A[D];else{let X=nh(F.paths[D],"options");if(X==null)continue;Z=X.alias}if(!Z)continue;let J=F.paths[D].path;if(Array.isArray(Z)){for(let X of Z){if(typeof X!=="string")throw new Error("Invalid value for alias option on "+J+", got "+X);F.aliases[X]=J,F.virtual(X).get(function($){return function(){if(typeof this.get==="function")return this.get($);return this[$]}}(J)).set(function($){return function(G){return this.$set($,G)}}(J))}continue}if(typeof Z!=="string")throw new Error("Invalid value for alias option on "+J+", got "+Z);F.aliases[Z]=J,F.virtual(Z).get(function(X){return function(){if(typeof this.get==="function")return this.get(X);return this[X]}}(J)).set(function(X){return function($){return this.$set(X,$)}}(J))}}/*!
652
+ * Inherit from EventEmitter.
653
+ */t.prototype=Object.create(rQ1.prototype);t.prototype.constructor=t;t.prototype.instanceOfSchema=!0;/*!
654
+ * ignore
655
+ */Object.defineProperty(t.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0});Object.defineProperty(t.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(t.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0});t.prototype.obj;t.prototype.paths;t.prototype.tree;t.prototype.clone=function(){let F=this._clone();return F.on("init",(A)=>this.emit("init",A)),F};/*!
656
+ * ignore
657
+ */t.prototype._clone=function F(A){A=A||(this.base==null?t:this.base.Schema);let D=new A({},this._userProvidedOptions);D.base=this.base,D.obj=this.obj,D.options=v2(this.options),D.callQueue=this.callQueue.map(function(Z){return Z}),D.methods=v2(this.methods),D.methodOptions=v2(this.methodOptions),D.statics=v2(this.statics),D.query=v2(this.query),D.plugins=Array.prototype.slice.call(this.plugins),D._indexes=v2(this._indexes),D._searchIndexes=v2(this._searchIndexes),D.s.hooks=this.s.hooks.clone(),D.tree=v2(this.tree),D.paths=Object.fromEntries(Object.entries(this.paths).map(([Z,J])=>[Z,J.clone()])),D.nested=v2(this.nested),D.subpaths=v2(this.subpaths);for(let Z of Object.values(D.paths))if(Z.$isSingleNested){let J=Z.path;for(let X of Object.keys(Z.schema.paths))D.singleNestedPaths[J+"."+X]=Z.schema.paths[X];for(let X of Object.keys(Z.schema.singleNestedPaths))D.singleNestedPaths[J+"."+X]=Z.schema.singleNestedPaths[X];for(let X of Object.keys(Z.schema.subpaths))D.singleNestedPaths[J+"."+X]=Z.schema.subpaths[X];for(let X of Object.keys(Z.schema.nested))D.singleNestedPaths[J+"."+X]="nested"}if(D._gatherChildSchemas(),D.virtuals=v2(this.virtuals),D.$globalPluginsApplied=this.$globalPluginsApplied,D.$isRootDiscriminator=this.$isRootDiscriminator,D.$implicitlyCreated=this.$implicitlyCreated,D.$id=++oh,D.$originalSchemaId=this.$id,D.mapPaths=[].concat(this.mapPaths),this.discriminatorMapping!=null)D.discriminatorMapping=Object.assign({},this.discriminatorMapping);if(this.discriminators!=null)D.discriminators=Object.assign({},this.discriminators);if(this._applyDiscriminators!=null)D._applyDiscriminators=new Map(this._applyDiscriminators);return D.aliases=Object.assign({},this.aliases),D};t.prototype.pick=function(F,A){let D=new t({},A||this.options);if(!Array.isArray(F))throw new C4('Schema#pick() only accepts an array argument, got "'+typeof F+'"');for(let Z of F)if(this.nested[Z])D.add({[Z]:nh(this.tree,Z)});else{let J=this.path(Z);if(J==null)throw new C4("Path `"+Z+"` is not in the schema");D.add({[Z]:J})}return D};t.prototype.omit=function(F,A){let D=new t(this,A||this.options);if(!Array.isArray(F))throw new C4('Schema#omit() only accepts an array argument, got "'+typeof F+'"');D.remove(F);for(let Z in D.singleNestedPaths)if(F.includes(Z))delete D.singleNestedPaths[Z];return D};t.prototype.defaultOptions=function(F){this._userProvidedOptions=F==null?{}:v2(F);let A=this.base&&this.base.options||{},D="strict"in A?A.strict:!0,Z="strictQuery"in A?A.strictQuery:!1,J="id"in A?A.id:!0;if(F={strict:D,strictQuery:Z,bufferCommands:!0,capped:!1,versionKey:"__v",optimisticConcurrency:!1,minimize:!0,autoIndex:null,discriminatorKey:"__t",shardKey:null,read:null,validateBeforeSave:!0,validateModifiedOnly:!1,_id:!0,id:J,typeKey:"type",...F},F.versionKey&&typeof F.versionKey!=="string")throw new C4("`versionKey` must be falsy or string, got `"+typeof F.versionKey+"`");if(typeof F.read==="string")F.read=YX(F.read);else if(Array.isArray(F.read)&&typeof F.read[0]==="string")F.read={mode:YX(F.read[0]),tags:F.read[1]};if(F.optimisticConcurrency&&!F.versionKey)throw new C4("Must set `versionKey` if using `optimisticConcurrency`");return F};t.prototype.discriminator=function(F,A,D){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(F,{schema:A,options:D}),this};/*!
658
+ * Get this schema's default toObject/toJSON options, including Mongoose global
659
+ * options.
660
+ */t.prototype._defaultToObjectOptions=function(F){let A=F?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&this._defaultToObjectOptionsMap[A])return this._defaultToObjectOptionsMap[A];let D=this.base&&this.base.options&&this.base.options[A]||{},Z=this.options[A]||{},J=Object.assign({},D,Z);return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[A]=J,J};t.prototype.add=function F(A,D){if(A instanceof t||A!=null&&A.instanceOfSchema)return DK1(this,A),this;if(A._id===!1&&D==null)this.options._id=!1;if(D=D||"",D==="__proto__."||D==="constructor."||D==="prototype.")return this;let Z=Object.keys(A),J=this.options.typeKey;for(let $ of Z){if(r1.specialProperties.has($))continue;let G=D+$,Y=A[$];if(Y==null)throw new TypeError("Invalid value for schema path `"+G+'`, got value "'+Y+'"');if($==="_id"&&Y===!1)continue;let B=!1;if(typeof Y==="string"){let H=this.base!=null?this.base.Schema.Types:t.Types,q=Y.charAt(0).toUpperCase()+Y.substring(1);B=H[q]!=null}if($!=="_id"&&(typeof Y!=="object"&&typeof Y!=="function"&&!B||Y==null))throw new TypeError(`Invalid schema configuration: \`${Y}\` is not a valid type at path \`${$}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if(Y instanceof RQ||(Y.constructor&&Y.constructor.name||null)==="VirtualType"){this.virtual(Y);continue}if(Array.isArray(Y)&&Y.length===1&&Y[0]==null)throw new TypeError("Invalid value for schema Array path `"+G+'`, got value "'+Y[0]+'"');if(!(VQ(Y)||Y instanceof ih)){if(D)this.nested[D.substring(0,D.length-1)]=!0;if(this.path(D+$,Y),Y[0]!=null&&!Y[0].instanceOfSchema&&r1.isPOJO(Y[0].discriminators)){let H=this.path(D+$);for(let q in Y[0].discriminators)H.discriminator(q,Y[0].discriminators[q])}}else if(Object.keys(Y).length<1){if(D)this.nested[D.substring(0,D.length-1)]=!0;this.path(G,Y)}else if(!Y[J]||J==="type"&&VQ(Y.type)&&Y.type.type)this.nested[G]=!0,this.add(Y,G+".");else{let H=Y[J];if(VQ(H)&&Object.keys(H).length>0){if(D)this.nested[D.substring(0,D.length-1)]=!0;let q={};if(this._userProvidedOptions.typeKey)q.typeKey=this._userProvidedOptions.typeKey;if(this._userProvidedOptions.strict!=null)q.strict=this._userProvidedOptions.strict;if(this._userProvidedOptions.toObject!=null)q.toObject=r1.omit(this._userProvidedOptions.toObject,["transform"]);if(this._userProvidedOptions.toJSON!=null)q.toJSON=r1.omit(this._userProvidedOptions.toJSON,["transform"]);let W=new t(H,q);W.$implicitlyCreated=!0;let C=Object.assign({},Y,{[J]:W});this.path(D+$,C)}else{if(D)this.nested[D.substring(0,D.length-1)]=!0;if(this.path(D+$,Y),Y!=null&&!Y.instanceOfSchema&&r1.isPOJO(Y.discriminators)){let q=this.path(D+$);for(let W in Y.discriminators)q.discriminator(W,Y.discriminators[W])}}}}let X=Object.fromEntries(Object.entries(A).map(([$])=>[D+$,null]));return eh(this,X),this};t.prototype.alias=function A(F,A){return eh(this,{[F]:A}),this};t.prototype.removeIndex=function F(A){if(arguments.length>1)throw new Error("removeIndex() takes only 1 argument");if(typeof A!=="object"&&typeof A!=="string")throw new Error("removeIndex() may only take either an object or a string as an argument");if(typeof A==="object"){for(let D=this._indexes.length-1;D>=0;--D)if(rh(this._indexes[D][0],A))this._indexes.splice(D,1)}else for(let D=this._indexes.length-1;D>=0;--D)if(this._indexes[D][1]!=null&&this._indexes[D][1].name===A)this._indexes.splice(D,1);return this};t.prototype.clearIndexes=function F(){return this._indexes.length=0,this};t.prototype.searchIndex=function F(A){return this._searchIndexes.push(A),this};t.reserved=Object.create(null);t.prototype.reserved=t.reserved;var Z2=t.reserved;Z2.prototype=Z2.emit=Z2.listeners=Z2.removeListener=Z2.collection=Z2.errors=Z2.get=Z2.init=Z2.isModified=Z2.isNew=Z2.populated=Z2.remove=Z2.save=Z2.toObject=Z2.validate=1;Z2.collection=1;t.prototype.path=function(F,A){if(A===void 0){if(this.paths[F]!=null)return this.paths[F];let Y=Fv(F),B=HK1(this,F,Y);if(B!=null)return B;let H=Av(this,F);if(H!=null)return H;if(B=this.hasMixedParent(Y),B!=null)return B;return $K1.test(F)?WK1(this,F,Y):void 0}let D=F.split(".")[0];if(Z2[D]&&!this.options.suppressReservedKeysWarning){let Y=`\`${D}\` is a reserved schema pathname and may break some functionality. You are allowed to use it, but use at your own risk. To disable this warning pass \`suppressReservedKeysWarning\` as a schema option.`;r1.warn(Y)}if(typeof A==="object"&&r1.hasUserDefinedProperty(A,"ref"))XK1(A.ref,F);let Z=F.split(/\./),J=Z.pop(),X=this.tree,$="";for(let Y of Z){if(r1.specialProperties.has(Y))throw new Error("Cannot set special property `"+Y+"` on a schema");if($=$+=($.length>0?".":"")+Y,!X[Y])this.nested[$]=!0,X[Y]={};if(typeof X[Y]!=="object"){let B="Cannot set nested path `"+F+"`. Parent path `"+$+"` already set to type "+X[Y].name+".";throw new Error(B)}X=X[Y]}X[J]=v2(A),this.paths[F]=this.interpretAsType(F,A,this.options);let G=this.paths[F];if(this.childSchemas=this.childSchemas.filter((Y)=>Y.path!==F),G.$isSchemaMap){let Y=F+".$*";if(this.paths[Y]=G.$__schemaType,this.mapPaths.push(this.paths[Y]),G.$__schemaType.$isSingleNested)this.childSchemas.push({schema:G.$__schemaType.schema,model:G.$__schemaType.caster,path:F})}if(G.$isSingleNested){for(let Y of Object.keys(G.schema.paths))this.singleNestedPaths[F+"."+Y]=G.schema.paths[Y];for(let Y of Object.keys(G.schema.singleNestedPaths))this.singleNestedPaths[F+"."+Y]=G.schema.singleNestedPaths[Y];for(let Y of Object.keys(G.schema.subpaths))this.singleNestedPaths[F+"."+Y]=G.schema.subpaths[Y];for(let Y of Object.keys(G.schema.nested))this.singleNestedPaths[F+"."+Y]="nested";Object.defineProperty(G.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),G.caster.base=this.base,this.childSchemas.push({schema:G.schema,model:G.caster,path:F})}else if(G.$isMongooseDocumentArray)Object.defineProperty(G.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),G.casterConstructor.base=this.base,this.childSchemas.push({schema:G.schema,model:G.casterConstructor,path:F});if(G.$isMongooseArray&&G.caster instanceof ph){let Y=F,B=G,H=[];while(B.$isMongooseArray){if(Y=Y+".$",B.$isMongooseDocumentArray)B.$embeddedSchemaType._arrayPath=Y,B.$embeddedSchemaType._arrayParentPath=F,B=B.$embeddedSchemaType;else B.caster._arrayPath=Y,B.caster._arrayParentPath=F,B=B.caster;this.subpaths[Y]=B}for(let q of H)this.subpaths[q.path]=q}if(G.$isMongooseDocumentArray){for(let Y of Object.keys(G.schema.paths)){let B=G.schema.paths[Y];if(this.subpaths[F+"."+Y]=B,typeof B==="object"&&B!=null&&B.$parentSchemaDocArray==null)B.$parentSchemaDocArray=G}for(let Y of Object.keys(G.schema.subpaths)){let B=G.schema.subpaths[Y];if(this.subpaths[F+"."+Y]=B,typeof B==="object"&&B!=null&&B.$parentSchemaDocArray==null)B.$parentSchemaDocArray=G}for(let Y of Object.keys(G.schema.singleNestedPaths)){let B=G.schema.singleNestedPaths[Y];if(this.subpaths[F+"."+Y]=B,typeof B==="object"&&B!=null&&B.$parentSchemaDocArray==null)B.$parentSchemaDocArray=G}}return this};/*!
661
+ * ignore
662
+ */t.prototype._gatherChildSchemas=function F(){let A=[];for(let D of Object.keys(this.paths)){if(typeof D!=="string")continue;let Z=this.paths[D];if(Z.$isMongooseDocumentArray||Z.$isSingleNested)A.push({schema:Z.schema,model:Z.caster,path:D});else if(Z.$isSchemaMap&&Z.$__schemaType.$isSingleNested)A.push({schema:Z.$__schemaType.schema,model:Z.$__schemaType.caster,path:D})}return this.childSchemas=A,A};/*!
663
+ * ignore
664
+ */function HK1(F,A,D){if(F.paths.hasOwnProperty(A))return F.paths[A];if(F.subpaths.hasOwnProperty(D)){let Z=F.subpaths[D];if(Z==="nested")return;return Z}if(F.singleNestedPaths.hasOwnProperty(D)&&typeof F.singleNestedPaths[D]==="object"){let Z=F.singleNestedPaths[D];if(Z==="nested")return;return Z}return null}/*!
665
+ * ignore
666
+ */function Fv(F){if(!/\.\d+/.test(F))return F;return F.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$")}/*!
667
+ * ignore
668
+ */function Av(F,A){if(F.mapPaths.length===0)return null;for(let D of F.mapPaths){let Z=D.path;if(new RegExp("^"+Z.replace(/\.\$\*/g,"\\.[^.]+")+"$").test(A))return F.paths[Z]}return null}Object.defineProperty(t.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null});t.prototype.interpretAsType=function(F,A,D){if(A instanceof ph){if(A.path===F)return A;let Y=A.clone();return Y.path=F,Y}let Z=this.base!=null?this.base.Schema.Types:t.Types,J=this.base!=null?this.base.Types:b8();if(!r1.isPOJO(A)&&!(A instanceof ih)){if(r1.getFunctionName(A.constructor)!=="Object"){let B=A;A={},A[D.typeKey]=B}}let X=A[D.typeKey]&&(A[D.typeKey]instanceof Function||D.typeKey!=="type"||!A.type.type)?A[D.typeKey]:{},$;if(r1.isPOJO(X)||X==="mixed")return new Z.Mixed(F,A);if(Array.isArray(X)||X===Array||X==="array"||X===Z.Array){let Y=X===Array||X==="array"?A.cast||A.of:X[0];if(Y&&Y.instanceOfSchema){if(!(Y instanceof t))if(this.options._isMerging)Y=new t(Y);else throw new TypeError("Schema for array path `"+F+`\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${F}: new Schema(...)`);return new Z.DocumentArray(F,Y,A)}if(Y&&Y[D.typeKey]&&Y[D.typeKey].instanceOfSchema){if(!(Y[D.typeKey]instanceof t))if(this.options._isMerging)Y[D.typeKey]=new t(Y[D.typeKey]);else throw new TypeError("Schema for array path `"+F+`\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${F}: new Schema(...)`);return new Z.DocumentArray(F,Y[D.typeKey],A,Y)}if(typeof Y!=="undefined"){if(Array.isArray(Y)||Y.type===Array||Y.type=="Array"){if(Y&&Y.type=="Array")Y.type=Array;return new Z.Array(F,this.interpretAsType(F,Y,D),A)}}let B=Y!=null&&Y[D.typeKey]&&(D.typeKey!=="type"||!Y.type.type)?Y[D.typeKey]:Y;if(typeof Y==="string")Y=Z[Y.charAt(0).toUpperCase()+Y.substring(1)];else if(r1.isPOJO(B))if(Object.keys(B).length){let H={minimize:D.minimize};if(D.typeKey)H.typeKey=D.typeKey;if(D.hasOwnProperty("strict"))H.strict=D.strict;if(D.hasOwnProperty("strictQuery"))H.strictQuery=D.strictQuery;if(D.hasOwnProperty("toObject"))H.toObject=r1.omit(D.toObject,["transform"]);if(D.hasOwnProperty("toJSON"))H.toJSON=r1.omit(D.toJSON,["transform"]);if(this._userProvidedOptions.hasOwnProperty("_id"))H._id=this._userProvidedOptions._id;else if(t.Types.DocumentArray.defaultOptions._id!=null)H._id=t.Types.DocumentArray.defaultOptions._id;let q=new t(B,H);return q.$implicitlyCreated=!0,new Z.DocumentArray(F,q,A)}else return new Z.Array(F,Z.Mixed,A);if(Y){if(X=Y[D.typeKey]&&(D.typeKey!=="type"||!Y.type.type)?Y[D.typeKey]:Y,Array.isArray(X))return new Z.Array(F,this.interpretAsType(F,X,D),A);if($=typeof X==="string"?X:X.schemaName||r1.getFunctionName(X),$==="ClockDate")$="Date";if($===void 0)throw new TypeError(`Invalid schema configuration: Could not determine the embedded type for array \`${F}\`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(!Z.hasOwnProperty($))throw new TypeError(`Invalid schema configuration: \`${$}\` is not a valid type within the array \`${F}\`.See https://bit.ly/mongoose-schematypes for a list of valid schema types.`)}return new Z.Array(F,Y||Z.Mixed,A,D)}if(X&&X.instanceOfSchema)return new Z.Subdocument(X,F,A);if(Buffer.isBuffer(X))$="Buffer";else if(typeof X==="function"||typeof X==="object")$=X.schemaName||r1.getFunctionName(X);else if(X===J.ObjectId)$="ObjectId";else if(X===J.Decimal128)$="Decimal128";else $=X==null?""+X:X.toString();if($)$=$.charAt(0).toUpperCase()+$.substring(1);if($==="ObjectID")$="ObjectId";if($==="ClockDate")$="Date";if($===void 0)throw new TypeError(`Invalid schema configuration: \`${F}\` schematype definition is invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(Z[$]==null)throw new TypeError(`Invalid schema configuration: \`${$}\` is not a valid type at path \`${F}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);let G=new Z[$](F,A);if(G.$isSchemaMap)qK1(this,G,F,A,D);return G};/*!
669
+ * ignore
670
+ */function qK1(F,A,D,Z,J){let X=D+".$*",$={type:{}};if(r1.hasUserDefinedProperty(Z,"of")){if(r1.isPOJO(Z.of)&&Object.keys(Z.of).length>0&&!r1.hasUserDefinedProperty(Z.of,F.options.typeKey))$={[F.options.typeKey]:new t(Z.of)};else if(r1.isPOJO(Z.of))$=Object.assign({},Z.of);else $={[F.options.typeKey]:Z.of};if($[F.options.typeKey]&&$[F.options.typeKey].instanceOfSchema)$[F.options.typeKey].eachPath((B,H)=>{if(H.options.select===!0||H.options.select===!1)throw new C4('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+D+"."+B+'"')});if(r1.hasUserDefinedProperty(Z,"ref"))$.ref=Z.ref}A.$__schemaType=F.interpretAsType(X,$,J)}t.prototype.eachPath=function(F){let A=Object.keys(this.paths),D=A.length;for(let Z=0;Z<D;++Z)F(A[Z],this.paths[A[Z]]);return this};t.prototype.requiredPaths=function F(A){if(this._requiredpaths&&!A)return this._requiredpaths;let D=Object.keys(this.paths),Z=D.length,J=[];while(Z--){let X=D[Z];if(this.paths[X].isRequired)J.push(X)}return this._requiredpaths=J,this._requiredpaths};t.prototype.indexedPaths=function F(){if(this._indexedpaths)return this._indexedpaths;return this._indexedpaths=this.indexes(),this._indexedpaths};t.prototype.pathType=function(F){if(this.paths.hasOwnProperty(F))return"real";if(this.virtuals.hasOwnProperty(F))return"virtual";if(this.nested.hasOwnProperty(F))return"nested";let A=Fv(F);if(this.subpaths.hasOwnProperty(A)||this.subpaths.hasOwnProperty(F))return"real";let D=this.singleNestedPaths.hasOwnProperty(A)||this.singleNestedPaths.hasOwnProperty(F);if(D)return D==="nested"?"nested":"real";if(Av(this,F)!=null)return"real";if(/\.\d+\.|\.\d+$/.test(F))return Dv(this,F,A);return"adhocOrUndefined"};t.prototype.hasMixedParent=function(F){let A=F.split(/\./g);F="";for(let D=0;D<A.length;++D)if(F=D>0?F+"."+A[D]:A[D],this.paths.hasOwnProperty(F)&&this.paths[F]instanceof e4.Mixed)return this.paths[F];return null};t.prototype.setupTimestamp=function(F){return JK1(this,F)};function Dv(F,A,D){let Z=A.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(Z.length<2)return F.paths.hasOwnProperty(Z[0])?F.paths[Z[0]]:"adhocOrUndefined";let J=F.path(Z[0]),X=!1;if(!J)return"adhocOrUndefined";let $=Z.length-1;for(let G=1;G<Z.length;++G){X=!1;let Y=Z[G];if(G===$&&J&&!/\D/.test(Y)){if(J.$isMongooseDocumentArray)J=J.$embeddedSchemaType;else if(J instanceof e4.Array)J=J.caster;else J=void 0;break}if(!/\D/.test(Y)){if(J instanceof e4.Array&&G!==$)J=J.caster;continue}if(!(J&&J.schema)){J=void 0;break}X=J.schema.pathType(Y)==="nested",J=J.schema.path(Y)}if(F.subpaths[D]=J,J)return"real";if(X)return"nested";return"adhocOrUndefined"}/*!
671
+ * ignore
672
+ */function WK1(F,A,D){return Dv(F,A,D),F.subpaths[D]}t.prototype.queue=function(F,A){return this.callQueue.push([F,A]),this};t.prototype.pre=function(F){if(F instanceof RegExp){let A=Array.prototype.slice.call(arguments,1);for(let D of th)if(F.test(D))this.pre.apply(this,[D].concat(A));return this}if(Array.isArray(F)){let A=Array.prototype.slice.call(arguments,1);for(let D of F)this.pre.apply(this,[D].concat(A));return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this};t.prototype.post=function(F){if(F instanceof RegExp){let A=Array.prototype.slice.call(arguments,1);for(let D of th)if(F.test(D))this.post.apply(this,[D].concat(A));return this}if(Array.isArray(F)){let A=Array.prototype.slice.call(arguments,1);for(let D of F)this.post.apply(this,[D].concat(A));return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this};t.prototype.plugin=function(F,A){if(typeof F!=="function")throw new Error('First param to `schema.plugin()` must be a function, got "'+typeof F+'"');if(A&&A.deduplicate){for(let D of this.plugins)if(D.fn===F)return this}return this.plugins.push({fn:F,opts:A}),F(this,A),this};t.prototype.method=function(F,A,D){if(typeof F!=="string")for(let Z in F)this.methods[Z]=F[Z],this.methodOptions[Z]=v2(D);else this.methods[F]=A,this.methodOptions[F]=v2(D);return this};t.prototype.static=function(F,A){if(typeof F!=="string")for(let D in F)this.statics[D]=F[D];else this.statics[F]=A;return this};t.prototype.index=function(F,A){if(F||(F={}),A||(A={}),A.expires)r1.expires(A);for(let D in F)if(this.aliases[D])F=r1.renameObjKey(F,D,this.aliases[D]);for(let D of Object.keys(F))if(F[D]==="ascending"||F[D]==="asc")F[D]=1;else if(F[D]==="descending"||F[D]==="desc")F[D]=-1;for(let D of this.indexes())if(A.name==null&&D[1].name==null&&rh(D[0],F))r1.warn(`Duplicate schema index on ${JSON.stringify(F)} found. This is often due to declaring an index using both "index: true" and "schema.index()". Please remove the duplicate index definition.`);return this._indexes.push([F,A]),this};t.prototype.set=function(F,A,D){if(arguments.length===1)return this.options[F];switch(F){case"read":if(typeof A==="string")this.options[F]={mode:YX(A),tags:D};else if(Array.isArray(A)&&typeof A[0]==="string")this.options[F]={mode:YX(A[0]),tags:A[1]};else this.options[F]=A;this._userProvidedOptions[F]=this.options[F];break;case"timestamps":this.setupTimestamp(A),this.options[F]=A,this._userProvidedOptions[F]=this.options[F];break;case"_id":if(this.options[F]=A,this._userProvidedOptions[F]=this.options[F],A&&!this.paths._id)ah(this);else if(!A&&this.paths._id!=null&&this.paths._id.auto)this.remove("_id");break;default:this.options[F]=A,this._userProvidedOptions[F]=this.options[F];break}if(F==="strict")QA(this,{strict:A});if(F==="strictQuery")QA(this,{strictQuery:A});if(F==="toObject")A={...A},delete A.transform,QA(this,{toObject:A});if(F==="toJSON")A={...A},delete A.transform,QA(this,{toJSON:A});return this};/*!
673
+ * Recursively set options on implicitly created schemas
674
+ */function QA(F,A){for(let{schema:D}of F.childSchemas){if(!D.$implicitlyCreated)continue;Object.assign(D.options,A),QA(D,A)}}t.prototype.get=function(F){return this.options[F]};var CK1="2d 2dsphere hashed text".split(" ");Object.defineProperty(t,"indexTypes",{get:function(){return CK1},set:function(){throw new Error("Cannot overwrite Schema.indexTypes")}});t.prototype.indexes=function(){return FK1(this)};t.prototype.virtual=function(F,A){if(F instanceof RQ||eQ1(F)==="VirtualType")return this.virtual(F.path,F.options);if(A=new oQ1(A),r1.hasUserDefinedProperty(A,["ref","refPath"])){if(A.localField==null)throw new Error("Reference virtuals require `localField` option");if(A.foreignField==null)throw new Error("Reference virtuals require `foreignField` option");let J=this.virtual(F);if(J.options=A,this.pre("init",function G(Y,B){if(XX.has(F,Y)){let H=XX.get(F,Y);if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};if(A.justOne||A.count)this.$$populatedVirtuals[F]=Array.isArray(H)?H[0]:H;else this.$$populatedVirtuals[F]=Array.isArray(H)?H:H==null?[]:[H];if(B?.hydratedPopulatedDocs&&!A.count){let q=J._getModelNamesForPopulate(this),W=this.$$populatedVirtuals[F];if(!Array.isArray(W)&&!W.$__&&q?.length===1){let C=this.db.model(q[0]);this.$$populatedVirtuals[F]=C.hydrate(W)}else if(Array.isArray(W)&&q?.length===1){let C=this.db.model(q[0]);for(let K=0;K<W.length;++K)if(!W[K].$__)W[K]=C.hydrate(W[K],null,{hydratedPopulatedDocs:!0});let Q=A.foreignField;this.$populated(F,W.map((K)=>K==null?K:K.get(typeof Q==="function"?Q.call(K,K):Q)),{populateModelSymbol:C})}}XX.unset(F,Y)}}),J.set(function(G){if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};return ZK1(this.$$populatedVirtuals,F,G,A)}),typeof A.get==="function")J.get(A.get);let X=F.split("."),$=X[0];for(let G=0;G<X.length-1;++G){if(this.paths[$]==null)continue;if(this.paths[$].$isMongooseDocumentArray||this.paths[$].$isSingleNested){let Y=X.slice(G+1).join(".");this.paths[$].schema.virtual(Y,A);break}$+="."+X[G+1]}return J}let D=this.virtuals,Z=F.split(".");if(this.pathType(F)==="real")throw new Error('Virtual path "'+F+'" conflicts with a real path in the schema');if(D[F]=Z.reduce(function(J,X,$){return J[X]||(J[X]=$===Z.length-1?new RQ(A,F):{}),J[X]},this.tree),A&&A.applyToArray&&Z.length>1){let J=this.path(Z.slice(0,-1).join("."));if(J&&J.$isMongooseArray)return J.virtual(Z[Z.length-1],A);else throw new C4(`Path "${J}" is not an array`)}return D[F]};t.prototype.virtualpath=function(F){return this.virtuals.hasOwnProperty(F)?this.virtuals[F]:null};t.prototype.remove=function(F){if(typeof F==="string")F=[F];if(Array.isArray(F))F.forEach(function(A){if(this.path(A)==null&&!this.nested[A])return;if(this.nested[A]){let D=Object.keys(this.paths).concat(Object.keys(this.nested));for(let Z of D)if(Z.startsWith(A+"."))delete this.paths[Z],delete this.nested[Z],LQ(this,Z);delete this.nested[A],LQ(this,A);return}delete this.paths[A],LQ(this,A)},this);return this};/*!
675
+ * ignore
676
+ */function LQ(F,A){let D=A.split("."),Z=D.pop(),J=F.tree;for(let X of D)J=J[X];delete J[Z]}t.prototype.removeVirtual=function(F){if(typeof F==="string")F=[F];if(Array.isArray(F)){for(let A of F)if(this.virtuals[A]==null)throw new C4(`Attempting to remove virtual "${A}" that does not exist.`);for(let A of F)if(delete this.paths[A],delete this.virtuals[A],A.indexOf(".")!==-1)XX.unset(A,this.tree);else delete this.tree[A]}return this};t.prototype.loadClass=function(F,A){if(F===Object.prototype||F===Function.prototype||F.prototype.hasOwnProperty("$isMongooseModelPrototype")||F.prototype.hasOwnProperty("$isMongooseDocumentPrototype"))return this;if(this.loadClass(Object.getPrototypeOf(F),A),!A)Object.getOwnPropertyNames(F).forEach(function(D){if(D.match(/^(length|name|prototype|constructor|__proto__)$/))return;let Z=Object.getOwnPropertyDescriptor(F,D);if(Z.hasOwnProperty("value"))this.static(D,Z.value)},this);return Object.getOwnPropertyNames(F.prototype).forEach(function(D){if(D.match(/^(constructor)$/))return;let Z=Object.getOwnPropertyDescriptor(F.prototype,D);if(!A){if(typeof Z.value==="function")this.method(D,Z.value)}if(typeof Z.get==="function"){if(this.virtuals[D])this.virtuals[D].getters=[];this.virtual(D).get(Z.get)}if(typeof Z.set==="function"){if(this.virtuals[D])this.virtuals[D].setters=[];this.virtual(D).set(Z.set)}},this),this};/*!
677
+ * ignore
678
+ */t.prototype._getSchema=function(F){let A=this,D=A.path(F),Z=[];if(D)return D.$fullPath=F,D;function J($,G){let Y=$.length+1,B,H;while(Y--)if(H=$.slice(0,Y).join("."),B=G.path(H),B){if(Z.push(H),B.caster){if(B.caster instanceof e4.Mixed)return B.caster.$fullPath=Z.join("."),B.caster;if(Y!==$.length){if(Y+1===$.length&&B.$embeddedSchemaType&&($[Y]==="$"||$X($[Y])))return B.$embeddedSchemaType;if(B.schema){let q;if($[Y]==="$"||$X($[Y])){if(Y+1===$.length)return B.$embeddedSchemaType;if(q=J($.slice(Y+1),B.schema),q)q.$parentSchemaDocArray=q.$parentSchemaDocArray||(B.schema.$isSingleNested?null:B);return q}if(q=J($.slice(Y),B.schema),q)q.$parentSchemaDocArray=q.$parentSchemaDocArray||(B.schema.$isSingleNested?null:B);return q}}}else if(B.$isSchemaMap){if(Y>=$.length)return B;if(Y+1>=$.length)return B.$__schemaType;if(B.$__schemaType instanceof e4.Mixed)return B.$__schemaType;if(B.$__schemaType.schema!=null)return J($.slice(Y+1),B.$__schemaType.schema)}return B.$fullPath=Z.join("."),B}}let X=F.split(".");for(let $=0;$<X.length;++$){if(X[$]==="$"||$X(X[$]))X[$]="0";if(BK1.test(X[$]))X[$]="$"}return J(X,A)};/*!
679
+ * ignore
680
+ */t.prototype._getPathType=function(F){let A=this;if(A.path(F))return"real";function Z(J,X){let $=J.length+1,G,Y;while($--)if(Y=J.slice(0,$).join("."),G=X.path(Y),G){if(G.caster){if(G.caster instanceof e4.Mixed)return{schema:G,pathType:"mixed"};if($!==J.length&&G.schema){if(J[$]==="$"||$X(J[$])){if($===J.length-1)return{schema:G,pathType:"nested"};return Z(J.slice($+1),G.schema)}return Z(J.slice($),G.schema)}return{schema:G,pathType:G.$isSingleNested?"nested":"array"}}return{schema:G,pathType:"real"}}else if($===J.length&&X.nested[Y])return{schema:X,pathType:"nested"};return{schema:G||X,pathType:"undefined"}}return Z(F.split("."),A)};t.prototype._transformDuplicateKeyError=function F(A){if(!this._duplicateKeyErrorMessagesByPath)return A;if(A.code!==11000&&A.code!==11001)return A;if(A.keyPattern!=null){let D=A.keyPattern,Z=Object.keys(D);if(Z.length!==1)return A;let J=Z[0];if(!this._duplicateKeyErrorMessagesByPath.hasOwnProperty(J))return A;return new C4(this._duplicateKeyErrorMessagesByPath[J],{cause:A})}return A};/*!
681
+ * ignore
682
+ */function $X(F){return F.startsWith("$[")&&F.endsWith("]")}t.prototype._preCompile=function F(){this.plugin(AK1,{deduplicate:!0})};t.prototype.toJSONSchema=function F(A){let D=A?.useBsonType??!1,Z=D?{required:[],properties:{}}:{type:"object",required:[],properties:{}};for(let J of Object.keys(this.paths)){let X=this.paths[J];if(X._presplitPath.indexOf("$*")!==-1)continue;let $=X._presplitPath.length>1,G=Z;if($)for(let H=0;H<X._presplitPath.length-1;++H){let q=X._presplitPath[H];if(G.properties[q]==null)G.properties[q]=D?{bsonType:["object","null"],properties:{}}:{type:["object","null"],properties:{}};G=G.properties[q]}let Y=X._presplitPath[X._presplitPath.length-1],B=!1;if(J==="_id"){if(!G.required)G.required=[];G.required.push("_id"),B=!0}else if(X.options.required&&typeof X.options.required!=="function"){if(!G.required)G.required=[];G.required.push(Y),B=!0}if(G.properties[Y]=X.toJSONSchema(A),X.options.enum)G.properties[Y].enum=B?X.options.enum:[...X.options.enum,null]}if(Z.required.length===0)delete Z.required;return Z};/*!
683
+ * Module exports.
684
+ */Zv.exports=wQ=t;t.Types=e4=DA();/*!
685
+ * ignore
686
+ */wQ.ObjectId=e4.ObjectId});var IQ=E((tk1,Jv)=>{/*!
687
+ * Module dependencies.
688
+ */var QK1=a2();class PQ extends QK1{constructor(F,A,D,Z){let J=F.map((X)=>X.message).join(", ");if(J.length>200)J=J.slice(0,200)+"...";super(`${Z} failed with ${F.length} Mongoose validation errors: ${J}`);this.validationErrors=F,this.results=A,this.rawResult=D,this.operation=Z}}Object.defineProperty(PQ.prototype,"name",{value:"MongooseBulkWriteError"});/*!
689
+ * exports
690
+ */Jv.exports=PQ});var $v=E((ok1,Xv)=>{/*!
691
+ * Module dependencies.
692
+ */var KK1=w1();class MQ extends KK1{constructor(F,A){super(F);this.errors=A}}Object.defineProperty(MQ.prototype,"name",{value:"SyncIndexesError"});Xv.exports=MQ});var NQ=E((ek1,Yv)=>{Yv.exports=function F(A,D,Z,J){if(A[J])return;if(A[J]=!0,!Z||!Z.skipTopLevel){let Y=null;for(let B of D){let H=B[1]==null?null:B[1].tags;if(!Array.isArray(H)){A.plugin(B[0],B[1]);continue}if(Y=Y||new Set(A.options.pluginTags||[]),!H.find((q)=>Y.has(q)))continue;A.plugin(B[0],B[1])}}if(Z=Object.assign({},Z),delete Z.skipTopLevel,Z.applyPluginsToChildSchemas!==!1)for(let Y of Object.keys(A.paths)){let B=A.paths[Y];if(B.schema!=null)F(B.schema,D,Z,J),B.caster.prototype.$__setSchema(B.schema)}let X=A.discriminators;if(X==null)return;let $=Z.applyPluginsToDiscriminators,G=Object.keys(X);for(let Y of G){let B=X[Y];F(B,D,{skipTopLevel:!$},J)}}});var GX=E((EK1,jQ)=>{/*!
693
+ * ignore
694
+ */var Gv=null;EK1.get=function(){return Gv};EK1.set=function(F){Gv=F}});var TQ=E((FO1,Bv)=>{function VK1(){return{ok:1,nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[],writeErrors:[],insertedIds:[],writeConcernErrors:[]}}Bv.exports=VK1});var qv=E((AO1,Hv)=>{var LK1=w1();class kQ extends LK1{constructor(F,A){super(F);this.errors=A}}Object.defineProperty(kQ.prototype,"name",{value:"CreateCollectionsError"});Hv.exports=kQ});var OQ=E((DO1,Cv)=>{var Wv=S8().modifiedPaths;Cv.exports=function F(A){let D=Object.keys(A),Z={},J={};for(let X of D){if(X.startsWith("$")){Wv(A[X],"",Z);continue}J[X]=A[X]}return Wv(J,"",Z),Z}});var SQ=E((ZO1,Qv)=>{var RK1=OQ();Qv.exports=function F(A){if(A==null)return{};let D=RK1(A);return Object.keys(D).reduce((Z,J)=>{let X=J.match(/\$\[[^\]]+\]/g);if(X==null)return Z;for(let $ of X){let G=J.indexOf($);if(G!==J.lastIndexOf($))throw new Error(`Path '${J}' contains the same array filter multiple times`);Z[$.substring(2,$.length-1)]=J.substring(0,G-1).replace(/\$\[[^\]]+\]/g,"0")}return Z},{})}});var Uv=E((JO1,Ev)=>{var wK1=rF(),Kv=L0(),PK1=d6(),IK1=SQ();Ev.exports=function F(A,D,Z,J,X){let $=J.split("."),G=null,Y="adhocOrUndefined";Z=Z||{},D=D||{};let B=X!=null&&Array.isArray(X.arrayFilters)?X.arrayFilters:[],H=IK1(D);for(let q=0;q<$.length;++q){let W=$.slice(0,q+1).join("."),C=wK1(W);if(G=A.path(C),G==null)continue;if(Y=A.pathType(C),(G.$isSingleNested||G.$isMongooseDocumentArrayElement)&&G.schema.discriminators!=null){let Q=Kv(G,"schema.options.discriminatorKey"),K=C+"."+Q,U=K.replace(/\.\d+\./,"."),z=null;if(K in Z)z=Z[K];if(U in Z)z=Z[U];let L=C.replace(/\.\d+$/,"");if(G.$isMongooseDocumentArrayElement&&Kv(Z[L],"$elemMatch."+Q)!=null)z=Z[L].$elemMatch[Q];let V=W+"."+Q;if(V in D)z=D[V];if(K in D)z=D[K];for(let x of Object.keys(H)){let _=H[x]+"."+Q,O=x+"."+Q;if(_===U){let R=B.find((S)=>S.hasOwnProperty(O));if(R!=null)z=R[O]}}if(z==null)continue;let P=PK1(G.caster.discriminators,z),I=P&&P.schema;if(I==null)continue;let M=$.slice(q+1).join(".");if(G=I.path(M),G!=null){Y=I._getPathType(M);break}}}return{type:Y,schematype:G}}});var Vv=E((XO1,zv)=>{var MK1=i4();zv.exports=function F(A,D,Z,J,X,$,G){if(A==null||!A.options||!A.options.immutable)return!1;let Y=A.options.immutable;if(typeof Y==="function")Y=Y.call(G,G);if(!Y)return!1;if($&&$.overwriteImmutable)return!1;if(D===!1)return!1;if(D==="throw")throw new MK1(null,`Field ${X} is immutable and strict = 'throw'`);return delete Z[J],!0}});var wv=E(($O1,Rv)=>{var NK1=L0();Rv.exports=function F(A,D,Z){if(D==null)return;let J=Object.keys(D);for(let X of J){let $=X.startsWith("$");if(X==="$set"){let G=Object.keys(D[X]);for(let Y of G)Lv(A,D[X],Y,D,Z)}else if(!$)Lv(A,D,X,D,Z)}};function Lv(F,A,D,Z,J){let X=F.path(D);if(X==null)return;let $=NK1(X,"options.immutable",null);if($==null)return;if(typeof $==="function")$=$.call(J,J);if(!$)return;Z.$setOnInsert=Z.$setOnInsert||{},Z.$setOnInsert[D]=A[D],delete A[D]}});var uQ=E((YO1,Pv)=>{var _Q=v9();Pv.exports=function F(A,D,Z){if(D.indexOf(".")===-1){if(_Q.has(D))return;A[D]=Z;return}let J=D.split("."),X=J.pop(),$=A;for(let G of J){if(_Q.has(G))continue;if($[G]==null)$[G]={};$=$[G]}if(!_Q.has(X))$[X]=Z}});var hQ=E((GO1,Sv)=>{var BX=E2(),KA=w1(),Iv=WQ(),Mv=i4(),jK1=c9(),fQ=eF(),TK1=t9(),kK1=b2(),xQ=d6(),gQ=Uv(),Nv=Vv(),OK1=wv(),kv=p9().schemaMixedSymbol,SK1=uQ(),r8=q1(),{internalToObjectOptions:_K1}=H3(),yQ=new Set(["$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$bit"]);Sv.exports=function F(A,D,Z,J,X){if(D==null)return;if(Z=Z||{},Array.isArray(D)){let q=D.length;for(let W=0;W<q;++W){let C=Object.keys(D[W]);for(let Q of C)D[W][Q]=uK1(Q,D[W][Q])}return D}if(A!=null&&X!=null&&r8.hasUserDefinedProperty(X,A.options.discriminatorKey)&&typeof X[A.options.discriminatorKey]!=="object"&&A.discriminators!=null){let q=X[A.options.discriminatorKey],W=xQ(J.model.discriminators,q);A=A.discriminators[q]||W&&W.schema||A}else if(A!=null&&Z.overwriteDiscriminatorKey&&r8.hasUserDefinedProperty(D,A.options.discriminatorKey)&&A.discriminators!=null){let q=D[A.options.discriminatorKey],W=xQ(J.model.discriminators,q);A=A.discriminators[q]||W&&W.schema||A}else if(A!=null&&Z.overwriteDiscriminatorKey&&D.$set!=null&&r8.hasUserDefinedProperty(D.$set,A.options.discriminatorKey)&&A.discriminators!=null){let q=D.$set[A.options.discriminatorKey],W=xQ(J.model.discriminators,q);A=A.discriminators[q]||W&&W.schema||A}if(Z.upsert)OK1(A,D,J);let $=Object.keys(D),G=$.length,Y={},B,H=!1;X=X||{};while(G--){let q=$[G];if(!yQ.has(q)){if(!Y.$set)if(D.$set)Y.$set=D.$set;else Y.$set={};if(Y.$set[q]=D[q],$.splice(G,1),!~$.indexOf("$set"))$.push("$set")}else if(q==="$set"){if(!Y.$set)Y[q]=D[q]}else Y[q]=D[q]}G=$.length;while(G--){let q=$[G];if(B=Y[q],H=H||q.startsWith("$"),B!=null&&B.$__)B=B.toObject(_K1),Y[q]=B;if(B&&typeof B==="object"&&!Buffer.isBuffer(B)&&yQ.has(q))Ov(A,B,q,Z,J,X);else{let W="Invalid atomic update value for "+q+". Expected an object, received "+typeof B;throw new Error(W)}if(q.startsWith("$")&&r8.isEmptyObject(B))delete Y[q]}if(Object.keys(Y).length===0&&Z.upsert&&Object.keys(X).length>0)return{$setOnInsert:{...X}};return Y};/*!
695
+ * ignore
696
+ */function uK1(F,A){if(F==="$unset"){if(typeof A!=="string"&&(!Array.isArray(A)||A.find((D)=>typeof D!=="string")))throw new KA("Invalid $unset in pipeline, must be a string or an array of strings");return A}if(F==="$project"){if(A==null||typeof A!=="object")throw new KA("Invalid $project in pipeline, must be an object");return A}if(F==="$addFields"||F==="$set"){if(A==null||typeof A!=="object")throw new KA("Invalid "+F+" in pipeline, must be an object");return A}else if(F==="$replaceRoot"||F==="$replaceWith"){if(A==null||typeof A!=="object")throw new KA("Invalid "+F+" in pipeline, must be an object");return A}throw new KA('Invalid update pipeline operator: "'+F+'"')}function Ov(F,A,D,Z,J,X,$){let G=Z.strict,Y=$?$+".":"",B=Object.keys(A),H=B.length,q=!1,W,C,Q,K=null,U=G!=null?G:F.options.strict;while(H--){if(C=B[H],Q=A[C],D==="$pull"){if(W=F._getSchema(Y+C),W==null){let L=gQ(F,A,X,Y+C,Z);if(L.schematype!=null)W=L.schematype}if(W!=null&&W.schema!=null){A[C]=TK1(W.schema,A[C],Z,J),q=!0;continue}}let z=Y?Y+C:C;if(F.discriminatorMapping!=null&&z===F.options.discriminatorKey&&F.discriminatorMapping.value!==A[C]&&!Z.overwriteDiscriminatorKey){if(U==="throw"){let L=new Error(`Can't modify discriminator key "`+z+'" on discriminator model');K=F7(L,J,z,K);continue}else if(U){delete A[C];continue}}if(kK1(Q)==="Object"){if(W=F._getSchema(Y+C),W==null){let L=gQ(F,A,X,Y+C,Z);if(L.schematype!=null)W=L.schematype}if(D!=="$setOnInsert"&&Nv(W,G,A,C,Y+C,Z,J))continue;if(W&&W.caster&&D in bQ)if("$each"in Q){q=!0;try{A[C]={$each:s8(W,Q.$each,D,C,J,Y+C)}}catch(L){K=F7(L,J,C,K)}if(Q.$slice!=null)A[C].$slice=Q.$slice|0;if(Q.$sort)A[C].$sort=Q.$sort;if(Q.$position!=null)A[C].$position=fQ(Q.$position)}else{if(W!=null&&W.$isSingleNested){let L=G==null?W.schema.options.strict:G;try{A[C]=W.castForQuery(null,Q,J,{strict:L})}catch(V){K=F7(V,J,C,K)}}else try{A[C]=s8(W,Q,D,C,J,Y+C)}catch(L){K=F7(L,J,C,K)}if(A[C]===void 0){delete A[C];continue}q=!0}else if(D==="$currentDate"||D in bQ&&W){try{A[C]=s8(W,Q,D,C,J,Y+C)}catch(L){K=F7(L,J,C,K)}if(A[C]===void 0){delete A[C];continue}q=!0}else if(D==="$rename"){let L=new Iv(`${Y}${C}.$rename`);try{A[C]=s8(L,Q,D,C,J,Y+C)}catch(V){K=F7(V,J,C,K)}if(A[C]===void 0){delete A[C];continue}q=!0}else{let L=Y+C,V=F._getPathType(L),P=G;if(V&&V.schema&&P==null)P=V.schema.options.strict;if(V.pathType==="undefined"){if(P==="throw")throw new Mv(L);else if(P){delete A[C];continue}}q|=Ov(F,Q,D,Z,J,X,Y+C)||r8.isObject(Q)&&Object.keys(Q).length===0}}else{let L=C==="$each"||C==="$or"||C==="$and"||C==="$in"?$:Y+C;if(W=F._getSchema(L),D!=="$setOnInsert"&&Nv(W,G,A,C,Y+C,Z,J))continue;let V=F._getPathType(L);if(W==null){let M=gQ(F,A,X,L,Z);if(M.schematype!=null)W=M.schematype,V=M.type}let P=G;if(V&&V.schema&&G==null)P=V.schema.options.strict;if(P&&!W&&!/real|nested/.test(V.pathType))if(P==="throw"&&F.virtuals[L]==null)throw new Mv(Y+C);else delete A[C];else{if(D==="$rename"){if(A[C]==null)throw new BX("String",A[C],`${Y}${C}.$rename`);let M=new Iv(`${Y}${C}.$rename`);A[C]=M.castForQuery(null,A[C],J);continue}try{if(Y.length===0||C.indexOf(".")===-1)A[C]=s8(W,Q,D,C,J,Y+C);else if(P!==!1||W!=null)SK1(A,C,s8(W,Q,D,C,J,Y+C)),delete A[C]}catch(M){K=F7(M,J,C,K)}if(Array.isArray(A[C])&&(D==="$addToSet"||D==="$push")&&C!=="$each"){if(W&&W.caster&&!W.caster.$isMongooseArray&&!W.caster[kv])A[C]={$each:A[C]}}if(A[C]===void 0){delete A[C];continue}q=!0}}}if(K!=null)throw K;return q}/*!
697
+ * ignore
698
+ */function F7(F,A,D,Z){if(typeof A!=="object"||!A.options.multipleCastError)throw F;return Z=Z||new jK1,Z.addError(D,F),Z}var jv={$pop:1,$inc:1},xK1={$unset:1},bQ={$push:1,$addToSet:1,$set:1,$setOnInsert:1};/*!
699
+ * ignore
700
+ */var Tv={$set:1,$setOnInsert:1};function s8(F,A,D,Z,J,X){if(!F){if(D in jv)try{return fQ(A)}catch(G){throw new BX("number",A,X)}return A}if(F.caster&&D in bQ&&(r8.isObject(A)||Array.isArray(A))&&!Tv[D]){let G=0,Y=F;while(Y.$isMongooseArray)++G,Y=Y.caster;let B=0,H=A;while(Array.isArray(H))++B,H=H[0];let q=G-B;while(B<G)A=[A],++B;let W=F.applySetters(Array.isArray(A)?A:[A],J);for(let C=0;C<q;++C)W=W[0];return W}if(D in xK1)return A;if(D in jv){if(A==null)throw new BX("number",A,F.path);if(D==="$inc")return F.castForQuery(null,A,J);try{return fQ(A)}catch(G){throw new BX("number",A,F.path)}}if(D==="$currentDate"){if(typeof A==="object")return{$type:A.$type};return Boolean(A)}if(yQ.has(Z))return F.castForQuery(Z,A,J);if(Tv[D]){let G=A!=null&&F.$isMongooseArray&&F.$fullPath!=null&&!F.$fullPath.match(/\d+$/),Y=F[kv]!=null;if(G||Y)return F.applySetters(A,J);return F.castForQuery(null,A,J)}return F.castForQuery(null,A,J)}});var vQ=E((BO1,_v)=>{var gK1=OQ();_v.exports=function F(A,D,Z){if(!Z||!(D&&D.upsert))return;if(!gK1(A)[Z])if(D.overwrite)A[Z]=0;else{if(!A.$setOnInsert)A.$setOnInsert={};A.$setOnInsert[Z]=0}}});var mQ=E((HO1,xv)=>{var uv=S8().modifiedPaths,fK1=L0();xv.exports=function(F,A,D,Z){Z=Z||{};let J=Z.setDefaultsOnInsert!=null?Z.setDefaultsOnInsert:A.base.options.setDefaultsOnInsert;if(!Z.upsert||J===!1)return D;let X=Object.keys(D||{}),$={},G={},Y=X.length,B={},H=!1;for(let C=0;C<Y;++C)if(X[C].startsWith("$"))uv(D[X[C]],"",B),H=!0;if(!H)uv(D,"",B);let q=Object.keys(F),W=q.length;for(let C=0;C<W;++C){let Q=q[C],K=F[Q];if(K&&typeof K==="object"){let U=Object.keys(K),z=U.length,L=!1;for(let V=0;V<z;++V)if(U[V].startsWith("$")){L=!0;break}if(L)continue}$[Q]=!0,B[Q]=!0}if(Z&&Z.overwrite&&!H)return D;return A.eachPath(function(C,Q){if(Q.path==="_id"&&Q.options.auto)return;let K=Q.getDefault(null,!0);if(yK1(B,C))return;if(typeof K==="undefined")return;if(Q.splitPath().includes("$*"))return;if(D=D||{},D.$setOnInsert=D.$setOnInsert||{},fK1(D,C)==null)D.$setOnInsert[C]=K;G[C]=K}),D};function yK1(F,A){if(F[A])return!0;let D=A.split("."),Z=D[0];for(let X=1;X<D.length;++X){if(F[Z])return!0;Z+="."+D[X]}let J=Object.keys(F);if(J.length){let X=A+".";for(let $ of J)if($.slice(0,A.length+1)===X)return!0}return!1}});var dQ=E((qO1,k0)=>{var bK1=w1(),hK1=d6(),gv=EC(),fv=UC(),EA=t9(),yv=hQ(),vK1=K0(),bv=vQ(),{inspect:mK1}=i("node:util"),hv=mQ();k0.exports=function F(A,D,Z){let J=A.base.now();if(D.insertOne)return(X)=>k0.exports.castInsertOne(A,D.insertOne,Z).then(()=>X(null),($)=>X($));else if(D.updateOne)return(X)=>{try{k0.exports.castUpdateOne(A,D.updateOne,Z,J),X(null)}catch($){X($)}};else if(D.updateMany)return(X)=>{try{k0.exports.castUpdateMany(A,D.updateMany,Z,J),X(null)}catch($){X($)}};else if(D.replaceOne)return(X)=>{k0.exports.castReplaceOne(A,D.replaceOne,Z).then(()=>X(null),($)=>X($))};else if(D.deleteOne)return(X)=>{try{k0.exports.castDeleteOne(A,D.deleteOne),X(null)}catch($){X($)}};else if(D.deleteMany)return(X)=>{try{k0.exports.castDeleteMany(A,D.deleteMany),X(null)}catch($){X($)}};else return(X)=>{let $=new bK1(`Invalid op passed to \`bulkWrite()\`: ${mK1(D)}`);X($,null)}};k0.exports.castInsertOne=async function F(A,D,Z){let J=t8(A,D.document),X=new J(D.document);if(J.schema.options.timestamps&&HX(D,Z))X.initializeTimestamps();if(Z.session!=null)X.$session(Z.session);let $=J?.schema?.options?.versionKey;if($&&X[$]==null)X[$]=0;if(D.document=X,Z.skipValidation||D.skipValidation)return D;return await D.document.$validate(),D};k0.exports.castUpdateOne=function F(A,D,Z,J){if(!D.filter)throw new Error("Must provide a filter object.");if(!D.update)throw new Error("Must provide an update object.");let X=t8(A,D.filter),$=X.schema,G=Z.strict!=null?Z.strict:X.schema.options.strict,Y=vK1(D.update);UA($,D.filter);let B=HX(D,Z);if(X.schema.$timestamps!=null&&B){let W=X.schema.$timestamps.createdAt,C=X.schema.$timestamps.updatedAt;fv(J,W,C,Y,{})}if(B)gv(J,Y,X.schema);let H=A.base.options.setDefaultsOnInsert;if((D.setDefaultsOnInsert==null?H:D.setDefaultsOnInsert)!==!1)hv(D.filter,X.schema,Y,{setDefaultsOnInsert:!0,upsert:D.upsert});return bv(Y,D,X.schema.options.versionKey),D.filter=EA(X.schema,D.filter,{strict:G,upsert:D.upsert}),D.update=yv(X.schema,Y,{strict:G,upsert:D.upsert,arrayFilters:D.arrayFilters,overwriteDiscriminatorKey:D.overwriteDiscriminatorKey},X,D.filter),D};k0.exports.castUpdateMany=function F(A,D,Z,J){if(!D.filter)throw new Error("Must provide a filter object.");if(!D.update)throw new Error("Must provide an update object.");let X=t8(A,D.filter),$=X.schema,G=Z.strict!=null?Z.strict:X.schema.options.strict,Y=A.base.options.setDefaultsOnInsert;if((D.setDefaultsOnInsert==null?Y:D.setDefaultsOnInsert)!==!1)hv(D.filter,X.schema,D.update,{setDefaultsOnInsert:!0,upsert:D.upsert});let H=HX(D,Z);if(X.schema.$timestamps!=null&&H){let q=X.schema.$timestamps.createdAt,W=X.schema.$timestamps.updatedAt;fv(J,q,W,D.update,{})}if(H)gv(J,D.update,X.schema);UA($,D.filter),bv(D.update,D,X.schema.options.versionKey),D.filter=EA(X.schema,D.filter,{strict:G,upsert:D.upsert}),D.update=yv(X.schema,D.update,{strict:G,upsert:D.upsert,arrayFilters:D.arrayFilters,overwriteDiscriminatorKey:D.overwriteDiscriminatorKey},X,D.filter)};k0.exports.castReplaceOne=async function F(A,D,Z){let J=t8(A,D.filter),X=J.schema,$=Z.strict!=null?Z.strict:J.schema.options.strict;UA(X,D.filter),D.filter=EA(J.schema,D.filter,{strict:$,upsert:D.upsert});let G=new J(D.replacement,$,!0);if(J.schema.options.timestamps&&HX(D,Z))G.initializeTimestamps();if(Z.session!=null)G.$session(Z.session);let Y=J?.schema?.options?.versionKey;if(Y&&G[Y]==null)G[Y]=0;if(D.replacement=G,Z.skipValidation||D.skipValidation){D.replacement=D.replacement.toBSON();return}await D.replacement.$validate(),D.replacement=D.replacement.toBSON()};k0.exports.castDeleteOne=function F(A,D){let Z=t8(A,D.filter),J=Z.schema;UA(J,D.filter),D.filter=EA(Z.schema,D.filter)};k0.exports.castDeleteMany=function F(A,D){let Z=t8(A,D.filter),J=Z.schema;UA(J,D.filter),D.filter=EA(Z.schema,D.filter)};k0.exports.cast={insertOne:k0.exports.castInsertOne,updateOne:k0.exports.castUpdateOne,updateMany:k0.exports.castUpdateMany,replaceOne:k0.exports.castReplaceOne,deleteOne:k0.exports.castDeleteOne,deleteMany:k0.exports.castDeleteMany};function UA(F,A){if(F==null)return;if(F.discriminatorMapping&&!F.discriminatorMapping.isRoot)A[F.discriminatorMapping.key]=F.discriminatorMapping.value}function t8(F,A){let D=F.schema.options.discriminatorKey;if(A!=null&&A.hasOwnProperty(D))F=hK1(F.discriminators,A[D])||F;return F}function HX(F,A){let D=F.timestamps,Z=A.timestamps;if(D!=null)return D;else if(Z!=null)return Z;return!0}});var cQ=E((WO1,vv)=>{vv.exports=function F(A,D,Z){return A.mongoose=A.mongoose||{},A.mongoose.validationErrors=D,A.mongoose.results=Z,A}});var pv=E((CO1,lv)=>{/*!
701
+ * Module dependencies.
702
+ */var dK1=aq(),pQ=i("node:events").EventEmitter,cK1=g8(),O0=NF(),mv=IQ(),P0=a2(),lK1=GW(),pK1=$v(),iK1=NQ(),aK1=K0(),nK1=GX(),sK1=L0(),rK1=TQ(),dv=g6(),iQ=q1(),tK1=qv(),qX=dQ(),{modelSymbol:WX}=A1(),oK1=kW(),lQ=cQ(),eK1=A1().arrayAtomicsSymbol,zA=A1().sessionNewDocuments,FE1=["MONGODB-X509"];function X1(F){if(this.base=F,this.collections={},this.models={},this.config={},this.replica=!1,this.options=null,this.otherDbs=[],this.relatedDbs={},this.states=O0,this._readyState=O0.disconnected,this._closeCalled=!1,this._hasOpened=!1,this.plugins=[],typeof F==="undefined"||!F.connections.length)this.id=0;else this.id=F.nextConnectionId;this._queue=[]}/*!
703
+ * Inherit from EventEmitter
704
+ */Object.setPrototypeOf(X1.prototype,pQ.prototype);Object.defineProperty(X1.prototype,"readyState",{get:function(){if(this._readyState===O0.connected&&this._lastHeartbeatAt!=null&&this.client?.topology?.s?.description?.type!=="LoadBalanced"&&typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS==="number"&&Date.now()-this._lastHeartbeatAt>=this.client.topology.s.description.heartbeatFrequencyMS*2)return O0.disconnected;return this._readyState},set:function(F){if(!(F in O0))throw new Error("Invalid connection state: "+F);if(this._readyState!==F){this._readyState=F;for(let A of this.otherDbs)A.readyState=F;if(O0.connected===F)this._hasOpened=!0;this.emit(O0[F])}}});X1.prototype.get=function F(A){if(this.config.hasOwnProperty(A))return this.config[A];return sK1(this.options,A)};X1.prototype.set=function F(A,D){if(this.config.hasOwnProperty(A))return this.config[A]=D,D;return this.options=this.options||{},this.options[A]=D,D};X1.prototype.collections;X1.prototype.name;X1.prototype.models;X1.prototype.id;Object.defineProperty(X1.prototype,"plugins",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(X1.prototype,"host",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(X1.prototype,"port",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(X1.prototype,"user",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(X1.prototype,"pass",{configurable:!0,enumerable:!0,writable:!0});X1.prototype.db;X1.prototype.client;X1.prototype.config;X1.prototype.createCollection=async function F(A,D){if(typeof D==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new P0("Connection.prototype.createCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.createCollection(A,D)};X1.prototype.bulkWrite=async function F(A,D){await this._waitForConnect(),D=D||{};let Z=D.ordered==null?!0:D.ordered,J=this.base.transactionAsyncLocalStorage?.getStore();if((!D||!D.hasOwnProperty("session"))&&J?.session!=null)D={...D,session:J.session};let X=this.base.now(),$=null;if(Z){let G=[];for(let Y of A){if(typeof Y.model!=="string"&&!Y.model?.[WX])throw new P0("Must specify model in Connection.prototype.bulkWrite() operations");let B=Y.model[WX]?Y.model:this.model(Y.model);if(Y.name==null)throw new P0("Must specify operation name in Connection.prototype.bulkWrite()");if(!qX.cast.hasOwnProperty(Y.name))throw new P0(`Unrecognized bulkWrite() operation name ${Y.name}`);await qX.cast[Y.name](B,Y,D,X),G.push({...Y,namespace:B.namespace()})}$=await this.client.bulkWrite(G,D)}else{let G=[],Y=[],B=[],H=[],q=[];for(let C=0;C<A.length;++C){let Q=A[C];if(typeof Q.model!=="string"&&!Q.model?.[WX]){let z=new P0("Must specify model in Connection.prototype.bulkWrite() operations");B.push({index:C,error:z}),q[C]=z;continue}let K;try{K=Q.model[WX]?Q.model:this.model(Q.model)}catch(z){B.push({index:C,error:z});continue}if(Q.name==null){let z=new P0("Must specify operation name in Connection.prototype.bulkWrite()");B.push({index:C,error:z}),q[C]=z;continue}if(!qX.cast.hasOwnProperty(Q.name)){let z=new P0(`Unrecognized bulkWrite() operation name ${Q.name}`);B.push({index:C,error:z}),q[C]=z;continue}let U=null;try{U=qX.cast[Q.name](K,Q,D,X)}catch(z){B.push({index:C,error:z}),q[C]=z;continue}if(oK1(U))H.push(U.then(()=>{G.push({...Q,namespace:K.namespace()}),Y.push(C)},(z)=>{B.push({index:C,error:z}),q[C]=z}));else G.push({...Q,namespace:K.namespace()}),Y.push(C)}if(H.length>0)await Promise.all(H);if(B=B.sort((C,Q)=>C.index-Q.index).map((C)=>C.error),G.length===0){if(D.throwOnValidationError&&B.length)throw new mv(B,q,Q,"bulkWrite");let Q=new(this.base.driver.get()).BulkWriteResult(rK1(),!1);return lQ(Q,B,q)}let W;[$,W]=await this.client.bulkWrite(G,D).then((C)=>[C,null]).catch((C)=>[null,C]);for(let C=0;C<Y.length;++C)q[Y[C]]=null;if(W){if(B.length>0)lQ(W,B,q),W.mongoose=W.mongoose||{},W.mongoose.validationErrors=B}if(B.length>0)if(D.throwOnValidationError)throw new mv(B,q,$,"bulkWrite");else lQ($,B,q)}return $};X1.prototype.createCollections=async function F(A={}){let D={},Z={},{continueOnError:J}=A;delete A.continueOnError;for(let X of Object.values(this.models))try{D[X.modelName]=await X.createCollection({})}catch($){if(!J){Z[X.modelName]=$;break}else D[X.modelName]=$}if(!J&&Object.keys(Z).length){let X=Object.entries(Z).map(([G,Y])=>`${G}: ${Y.message}`).join(", ");throw new tK1(X,Z)}return D};X1.prototype.withSession=async function F(A){if(arguments.length===0)throw new Error("Please provide an executor function");return await this.client.withSession(A)};X1.prototype.startSession=async function F(A){if(arguments.length>=2&&typeof arguments[1]==="function")throw new P0("Connection.prototype.startSession() no longer accepts a callback");return await this._waitForConnect(),this.client.startSession(A)};X1.prototype.transaction=function F(A,D){return this.startSession().then((Z)=>{return Z[zA]=new Map,Z.withTransaction(()=>AE1(A,Z,this.base),D).then((J)=>{return delete Z[zA],J}).catch((J)=>{throw delete Z[zA],J}).finally(()=>{Z.endSession().catch(()=>{})})})};/*!
705
+ * Reset document state in between transaction retries re: gh-13698
706
+ */async function AE1(F,A,D){try{return D.transactionAsyncLocalStorage==null?await F(A):await new Promise((J)=>{D.transactionAsyncLocalStorage.run({session:A},()=>J(F(A)))})}catch(Z){throw DE1(A),Z}}/*!
707
+ * If transaction was aborted, we need to reset newly inserted documents' `isNew`.
708
+ */function DE1(F){for(let A of F[zA].keys()){let D=F[zA].get(A);if(D.hasOwnProperty("isNew"))A.$isNew=D.isNew;if(D.hasOwnProperty("versionKey"))A.set(A.schema.options.versionKey,D.versionKey);if(D.modifiedPaths.length>0&&A.$__.activePaths.states.modify==null)A.$__.activePaths.states.modify={};for(let Z of D.modifiedPaths){let J=A.$__.activePaths.paths[Z];if(J!=null)delete A.$__.activePaths[J][Z];A.$__.activePaths.paths[Z]="modify",A.$__.activePaths.states.modify[Z]=!0}for(let Z of D.atomics.keys()){let J=A.$__getValue(Z);if(J==null)continue;J[eK1]=D.atomics.get(Z)}}}X1.prototype.dropCollection=async function F(A){if(arguments.length>=2&&typeof arguments[1]==="function")throw new P0("Connection.prototype.dropCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.dropCollection(A)};X1.prototype._waitForConnect=async function F(A){if((this.readyState===O0.connecting||this.readyState===O0.disconnected)&&this._shouldBufferCommands()){let D=this._getBufferTimeoutMS(),Z=null,J=!1,X={},$=new Promise((G)=>{X.fn=G,this._queue.push(X)});if(A)await $;else await Promise.race([$,new Promise((G)=>{Z=setTimeout(()=>{J=!0,G()},D)})]);if(J){let G=this._queue.indexOf(X);if(G!==-1)this._queue.splice(G,1);let Y="Connection operation buffering timed out after "+D+"ms";throw new P0(Y)}else if(Z!=null)clearTimeout(Z)}};/*!
709
+ * Get the default buffer timeout for this connection
710
+ */X1.prototype._getBufferTimeoutMS=function F(){if(this.config.bufferTimeoutMS!=null)return this.config.bufferTimeoutMS;if(this.base!=null&&this.base.get("bufferTimeoutMS")!=null)return this.base.get("bufferTimeoutMS");return 1e4};X1.prototype.listCollections=async function F(){return await this._waitForConnect(),await this.db.listCollections().toArray()};X1.prototype.listDatabases=async function F(){throw new P0("listDatabases() not implemented by driver")};X1.prototype.dropDatabase=async function F(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new P0("Connection.prototype.dropDatabase() no longer accepts a callback");await this._waitForConnect();for(let A of Object.values(this.models))delete A.$init;return this.db.dropDatabase()};/*!
711
+ * ignore
712
+ */X1.prototype._shouldBufferCommands=function F(){if(this.config.bufferCommands!=null)return this.config.bufferCommands;if(this.base.get("bufferCommands")!=null)return this.base.get("bufferCommands");return!0};X1.prototype.error=function F(A,D){if(D)return D(A),null;if(this.listeners("error").length>0)this.emit("error",A);return Promise.reject(A)};X1.prototype.onOpen=function(){this.readyState=O0.connected;for(let F of this._queue)F.fn.apply(F.ctx,F.args);this._queue=[];for(let F in this.collections)if(iQ.object.hasOwnProperty(this.collections,F))this.collections[F].onOpen();this.emit("open")};X1.prototype.openUri=async function F(A,D){if(this.readyState===O0.connecting||this.readyState===O0.connected){if(this._connectionString===A)return this}this._closeCalled=!1;let Z=!1;if(D&&"_fireAndForget"in D)Z=D._fireAndForget,delete D._fireAndForget;try{ZE1.apply(arguments)}catch(J){if(Z)throw J;throw this.$initialConnection=Promise.reject(J),J}this.$initialConnection=this.createClient(A,D).then(()=>this).catch((J)=>{if(this.readyState=O0.disconnected,this.listeners("error").length>0)dv(()=>this.emit("error",J));throw J});for(let J of Object.values(this.models))J.init().catch(function X(){});if(Z)return this;try{await this.$initialConnection}catch(J){throw cv(J)}return this};X1.prototype.on=function F(A,D){if(A==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return pQ.prototype.on.call(this,A,D)};X1.prototype.once=function F(A,D){if(A==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return pQ.prototype.once.call(this,A,D)};/*!
713
+ * ignore
714
+ */function ZE1(F,A,D){if(typeof A==="function"&&D==null)throw new P0("Connection.prototype.openUri() no longer accepts a callback");else if(typeof D==="function")throw new P0("Connection.prototype.openUri() no longer accepts a callback")}/*!
715
+ * ignore
716
+ */function cv(F){if(F?.name==="MongoServerSelectionError"){let A=F;F=new lK1,F.assimilateError(A)}return F}X1.prototype.destroy=async function F(A){if(typeof A==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new P0("Connection.prototype.destroy() no longer accepts a callback");if(A!=null&&typeof A==="object")this.$wasForceClosed=!!A.force;else this.$wasForceClosed=!!A;return this._close(A,!0)};X1.prototype.close=async function F(A){if(typeof A==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new P0("Connection.prototype.close() no longer accepts a callback");if(A!=null&&typeof A==="object")this.$wasForceClosed=!!A.force;else this.$wasForceClosed=!!A;if(this._lastHeartbeatAt!=null)this._lastHeartbeatAt=null;for(let D of Object.values(this.models))delete D.$init;return this._close(A,!1)};X1.prototype._close=async function F(A,D){let Z=this,J=this._closeCalled;if(this._closeCalled=!0,this._destroyCalled=D,this.client!=null)this.client._closeCalled=!0,this.client._destroyCalled=D;let X=this;switch(this.readyState){case O0.disconnected:if(D&&this.base.connections.indexOf(X)!==-1)this.base.connections.splice(this.base.connections.indexOf(X),1);if(!J)await this.doClose(A),this.onClose(A);break;case O0.connected:if(this.readyState=O0.disconnecting,await this.doClose(A),D&&Z.base.connections.indexOf(X)!==-1)this.base.connections.splice(this.base.connections.indexOf(X),1);this.onClose(A);break;case O0.connecting:return new Promise(($,G)=>{let Y=()=>{if(this.removeListener("open",Y),this.removeListener("error",Y),D)this.destroy(A).then($,G);else this.close(A).then($,G)};this.once("open",Y),this.once("error",Y)});case O0.disconnecting:return new Promise(($)=>{this.once("close",()=>{if(D&&this.base.connections.indexOf(X)!==-1)this.base.connections.splice(this.base.connections.indexOf(X),1);$()})})}return this};X1.prototype.doClose=function F(){throw new Error("Connection#doClose unimplemented by driver")};X1.prototype.onClose=function F(A){this.readyState=O0.disconnected;for(let D in this.collections)if(iQ.object.hasOwnProperty(this.collections,D))this.collections[D].onClose(A);this.emit("close",A);for(let D of this.otherDbs)this._destroyCalled?D.destroy({force:A,skipCloseClient:!0}):D.close({force:A,skipCloseClient:!0})};X1.prototype.collection=function(F,A){let D={autoIndex:this.config.autoIndex!=null?this.config.autoIndex:this.base.options.autoIndex,autoCreate:this.config.autoCreate!=null?this.config.autoCreate:this.base.options.autoCreate,autoSearchIndex:this.config.autoSearchIndex!=null?this.config.autoSearchIndex:this.base.options.autoSearchIndex};A=Object.assign({},D,A?aK1(A):{}),A.$wasForceClosed=this.$wasForceClosed;let Z=this.base&&this.base.__driver&&this.base.__driver.Collection||nK1.get().Collection;if(!(F in this.collections))this.collections[F]=new Z(F,this,A);return this.collections[F]};X1.prototype.plugin=function(F,A){return this.plugins.push([F,A]),this};X1.prototype.model=function F(A,D,Z,J){if(!(this instanceof X1))throw new P0("`connection.model()` should not be run with `new`. If you are doing `new db.model(foo)(bar)`, use `db.model(foo)(bar)` instead");let X;if(typeof A==="function")X=A,A=X.name;if(typeof D==="string")Z=D,D=!1;if(iQ.isObject(D)){if(!D.instanceOfSchema)D=new cK1(D);else if(!(D instanceof this.base.Schema))D=D._clone(this.base.Schema)}if(D&&!D.instanceOfSchema)throw new Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");let $={cache:!1,overwriteModels:this.base.options.overwriteModels},G=Object.assign($,J,{connection:this});if(this.models[A]&&!Z&&G.overwriteModels!==!0){if(D&&D.instanceOfSchema&&D!==this.models[A].schema)throw new P0.OverwriteModelError(A);return this.models[A]}let Y;if(D&&D.instanceOfSchema){if(iK1(D,this.plugins,null,"$connectionPluginsApplied"),Y=this.base._model(X||A,D,Z,G),!this.models[A])this.models[A]=Y;return Y.init().catch(function B(){}),Y}if(this.models[A]&&Z)return Y=this.models[A],D=Y.prototype.schema,Y.__subclass(this,D,Z);if(arguments.length===1){if(Y=this.models[A],!Y)throw new P0.MissingSchemaError(A);return Y}if(!Y)throw new P0.MissingSchemaError(A);if(this===Y.prototype.db&&(!Z||Z===Y.collection.name)){if(!this.models[A])this.models[A]=Y;return Y}return this.models[A]=Y.__subclass(this,D,Z),this.models[A]};X1.prototype.deleteModel=function F(A){if(typeof A==="string"){let D=this.model(A);if(D==null)return this;let Z=D.collection.name;delete this.models[A],delete this.collections[Z],this.emit("deleteModel",D)}else if(A instanceof RegExp){let D=A,Z=this.modelNames();for(let J of Z)if(D.test(J))this.deleteModel(J)}else throw new Error('First parameter to `deleteModel()` must be a string or regexp, got "'+A+'"');return this};X1.prototype.watch=function F(A,D){return new dK1((X)=>{dv(()=>{if(this.readyState===O0.connecting)this.once("open",function(){let $=this.db.watch(A,D);X(null,$)});else{let $=this.db.watch(A,D);X(null,$)}})},A,D)};X1.prototype.asPromise=async function F(){try{return await this.$initialConnection,this}catch(A){throw cv(A)}};X1.prototype.modelNames=function F(){return Object.keys(this.models)};X1.prototype.shouldAuthenticate=function F(){return this.user!=null&&(this.pass!=null||this.authMechanismDoesNotRequirePassword())};X1.prototype.authMechanismDoesNotRequirePassword=function F(){if(this.options&&this.options.auth)return FE1.indexOf(this.options.auth.authMechanism)>=0;return!0};X1.prototype.optionsProvideAuthenticationData=function F(A){return A&&A.user&&(A.pass||this.authMechanismDoesNotRequirePassword())};X1.prototype.getClient=function F(){return this.client};X1.prototype.setClient=function F(){throw new P0("Connection#setClient not implemented by driver")};/*!
717
+ * Called internally by `openUri()` to create a MongoClient instance.
718
+ */X1.prototype.createClient=function F(){throw new P0("Connection#createClient not implemented by driver")};X1.prototype.syncIndexes=async function F(A={}){let D={},Z={},{continueOnError:J}=A;delete A.continueOnError;for(let X of Object.values(this.models))try{D[X.modelName]=await X.syncIndexes(A)}catch($){if(!J){Z[X.modelName]=$;break}else D[X.modelName]=$}if(!J&&Object.keys(Z).length){let X=Object.entries(Z).map(([G,Y])=>`${G}: ${Y.message}`).join(", ");throw new pK1(X,Z)}return D};/*!
719
+ * Module exports.
720
+ */X1.STATES=O0;lv.exports=X1});var aQ=E((QO1,JE1)=>{JE1.exports={name:"mongoose",description:"Mongoose MongoDB ODM",version:"8.13.0",author:"Guillermo Rauch <guillermo@learnboost.com>",keywords:["mongodb","document","model","schema","database","odm","data","datastore","query","nosql","orm","db"],type:"commonjs",license:"MIT",dependencies:{bson:"^6.10.3",kareem:"2.6.3",mongodb:"~6.15.0",mpath:"0.9.0",mquery:"5.0.0",ms:"2.1.3",sift:"17.1.3"},devDependencies:{"@babel/core":"7.26.9","@babel/preset-env":"7.26.9","@typescript-eslint/eslint-plugin":"^8.19.1","@typescript-eslint/parser":"^8.19.1",acquit:"1.3.0","acquit-ignore":"0.2.1","acquit-require":"0.1.1",ajv:"8.17.1","assert-browserify":"2.0.0","babel-loader":"8.2.5","broken-link-checker":"^0.7.8",buffer:"^5.6.0",cheerio:"1.0.0","crypto-browserify":"3.12.1",dox:"1.0.0",eslint:"8.57.1","eslint-plugin-markdown":"^5.1.0","eslint-plugin-mocha-no-only":"1.2.0",express:"^4.19.2","fs-extra":"~11.3.0","highlight.js":"11.11.1","lodash.isequal":"4.5.0","lodash.isequalwith":"4.4.0","markdownlint-cli2":"^0.17.1",marked:"15.0.7",mkdirp:"^3.0.1",mocha:"11.1.0",moment:"2.30.1","mongodb-memory-server":"10.1.4",ncp:"^2.0.0",nyc:"15.1.0",pug:"3.0.3",q:"1.5.1",sinon:"19.0.2","stream-browserify":"3.0.0",tsd:"0.31.2",typescript:"5.7.3",uuid:"11.1.0",webpack:"5.98.0"},directories:{lib:"./lib/mongoose"},scripts:{"docs:clean":"npm run docs:clean:stable","docs:clean:stable":"rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:clean:5x":"rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:clean:6x":"rimraf index.html && rimraf -rf ./docs/6.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:copy:tmp":"mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && mkdirp ./tmp/docs/api && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/","docs:copy:tmp:5x":"rimraf ./docs/5.x && ncp ./tmp ./docs/5.x","docs:copy:tmp:6x":"rimraf ./docs/6.x && ncp ./tmp ./docs/6.x","docs:generate":"node ./scripts/website.js","docs:generate:sponsorData":"node ./scripts/loadSponsorData.js","docs:test":"npm run docs:generate","docs:view":"node ./scripts/static.js","docs:prepare:publish:stable":"git checkout gh-pages && git merge master && npm run docs:generate","docs:prepare:publish:5x":"git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x","docs:prepare:publish:6x":"git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x","docs:prepare:publish:7x":"env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/7.x && mv ./tmp ./docs/7.x","docs:check-links":"blc http://127.0.0.1:8089 -ro",lint:"eslint .","lint-js":"eslint . --ext .js --ext .cjs","lint-ts":"eslint . --ext .ts","lint-md":'markdownlint-cli2 "**/*.md" "#node_modules" "#benchmarks"',"build-browser":"(rm ./dist/* || true) && node ./scripts/build-browser.js",prepublishOnly:"npm run build-browser",release:"git pull && git push origin master --tags && npm publish","release-5x":"git pull origin 5.x && git push origin 5.x && git push origin 5.x --tags && npm publish --tag 5x","release-6x":"git pull origin 6.x && git push origin 6.x && git push origin 6.x --tags && npm publish --tag 6x",mongo:"node ./tools/repl.js","publish-7x":"npm publish --tag 7x",test:"mocha --exit ./test/*.test.js","test-deno":"deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.js","test-rs":"START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js","test-tsd":"node ./test/types/check-types-filename && tsd","setup-test-encryption":"bash scripts/configure-cluster-with-encryption.sh","test-encryption":"mocha --exit ./test/encryption/*.test.js",tdd:"mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}","test-coverage":"nyc --reporter=html --reporter=text npm test","ts-benchmark":"cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check"},main:"./index.js",types:"./types/index.d.ts",engines:{node:">=16.20.1"},bugs:{url:"https://github.com/Automattic/mongoose/issues/new"},repository:{type:"git",url:"git://github.com/Automattic/mongoose.git"},homepage:"https://mongoosejs.com",browser:"./dist/browser.umd.js",config:{mongodbMemoryServer:{disablePostinstall:!0}},funding:{type:"opencollective",url:"https://opencollective.com/mongoose"},tsd:{directory:"test/types",compilerOptions:{esModuleInterop:!1,strict:!0,allowSyntheticDefaultImports:!0,strictPropertyInitialization:!1,noImplicitAny:!1,strictNullChecks:!0,module:"commonjs",target:"ES2017"}}}});var av=E((KO1,iv)=>{var XE1=K0(),$E1=a2();function YE1(F,A){let D=A?A:{},Z=D.readPreference?D.readPreference:qE1(F),J=XE1(D);return Z&&Z!=="primary"&&Z!=="primaryPreferred"?GE1(Z,J):J}function GE1(F,A){if(BE1(A)&&HE1(F))CE1();else return WE1(A)}function BE1(F){let A=F.config&&F.config.autoIndex,{autoCreate:D,autoIndex:Z}=F;return!!(A||D||Z)}function HE1(F){return F==="secondary"||F==="secondaryPreferred"}function qE1(F){let D=/(?:&|\?)readPreference=(\w+)(?:&|$)/.exec(F);return D?D[1]:null}function WE1(F){return F.config={autoIndex:!1},F.autoCreate=!1,F.autoIndex=!1,F}function CE1(){throw new $E1('MongoDB prohibits index creation on connections that read from non-primary replicas. Connections that set "readPreference" to "secondary" or "secondaryPreferred" may not opt-in to the following connection options: autoCreate, autoIndex')}iv.exports=YE1});var nv=E((QE1)=>{QE1.setTimeout=setTimeout});var ev=E((UO1,ov)=>{/*!
721
+ * Module dependencies.
722
+ */var sv=pv(),A7=a2(),F6=NF(),rv=Y8(),EE1=aQ(),UE1=av(),zE1=nv().setTimeout,tv=q1();function O3(){sv.apply(this,arguments),this._listening=!1,this._lastHeartbeatAt=null}O3.STATES=F6;/*!
723
+ * Inherits from Connection.
724
+ */Object.setPrototypeOf(O3.prototype,sv.prototype);O3.prototype.useDb=function(F,A){if(A=A||{},A.useCache&&this.relatedDbs[F])return this.relatedDbs[F];let D=new this.constructor;D.name=F,D.base=this.base,D.collections={},D.models={},D.replica=this.replica,D.config=Object.assign({},this.config,D.config),D.name=this.name,D.options=this.options,D._readyState=this._readyState,D._closeCalled=this._closeCalled,D._hasOpened=this._hasOpened,D._listening=!1,D._parent=this,D.host=this.host,D.port=this.port,D.user=this.user,D.pass=this.pass;let Z=this;if(D.client=Z.client,this.db&&this._readyState===F6.connected)J();else this._queue.push({fn:J});function J(){D.client=Z.client;let X={};if(A.hasOwnProperty("noListener"))X.noListener=A.noListener;D.db=Z.client.db(F,X),D._lastHeartbeatAt=Z._lastHeartbeatAt,D.onOpen()}if(D.name=F,A.noListener!==!0)this.otherDbs.push(D);if(D.otherDbs.push(this),A&&A.useCache)this.relatedDbs[D.name]=D,D.relatedDbs=this.relatedDbs;return D};O3.prototype.aggregate=function F(A,D){return new this.base.Aggregate(null,this).append(A).option(D??{})};O3.prototype.removeDb=function F(A){let D=this.otherDbs.filter((Z)=>Z.name===A);if(!D.length)throw new A7(`No connections to database "${A}" found`);for(let Z of D)Z._closeCalled=!0,Z._destroyCalled=!0,Z._readyState=F6.disconnected,Z.$wasForceClosed=!0;delete this.relatedDbs[A],this.otherDbs=this.otherDbs.filter((Z)=>Z.name!==A)};O3.prototype.doClose=async function F(A){if(this.client==null)return this;let D=!1;if(A!=null&&typeof A==="object")D=A.skipCloseClient,A=A.force;if(D)return this;return await this.client.close(A),await new Promise((Z)=>zE1(Z,1)),this};O3.prototype.listDatabases=async function F(){return await this._waitForConnect(),await this.db.admin().listDatabases()};/*!
725
+ * ignore
726
+ */O3.prototype.createClient=async function F(A,D){if(typeof A!=="string")throw new A7(`The \`uri\` parameter to \`openUri()\` must be a string, got "${typeof A}". Make sure the first parameter to \`mongoose.connect()\` or \`mongoose.createConnection()\` is a string.`);if(this._destroyCalled)throw new A7("Connection has been closed and destroyed, and cannot be used for re-opening the connection. Please create a new connection with `mongoose.createConnection()` or `mongoose.connect()`.");if(this.readyState===F6.connecting||this.readyState===F6.connected){if(this._connectionString!==A)throw new A7("Can't call `openUri()` on an active connection with different connection strings. Make sure you aren't calling `mongoose.connect()` multiple times. See: https://mongoosejs.com/docs/connections.html#multiple_connections")}if(D=UE1(A,D),D){let X=D.config&&D.config.autoIndex!=null?D.config.autoIndex:D.autoIndex;if(X!=null)this.config.autoIndex=X!==!1,delete D.config,delete D.autoIndex;if("autoCreate"in D)this.config.autoCreate=!!D.autoCreate,delete D.autoCreate;if("sanitizeFilter"in D)this.config.sanitizeFilter=D.sanitizeFilter,delete D.sanitizeFilter;if("autoSearchIndex"in D)this.config.autoSearchIndex=D.autoSearchIndex,delete D.autoSearchIndex;if("bufferTimeoutMS"in D)this.config.bufferTimeoutMS=D.bufferTimeoutMS,delete D.bufferTimeoutMS;if(D.user||D.pass)D.auth=D.auth||{},D.auth.username=D.user,D.auth.password=D.pass,this.user=D.user,this.pass=D.pass;if(delete D.user,delete D.pass,D.bufferCommands!=null)this.config.bufferCommands=D.bufferCommands,delete D.bufferCommands}else D={};this._connectionOptions=D;let Z=D.dbName;if(Z!=null)this.$dbName=Z;if(delete D.dbName,!tv.hasUserDefinedProperty(D,"driverInfo"))D.driverInfo={name:"Mongoose",version:EE1.version};this.readyState=F6.connecting,this._connectionString=A;let J;try{J=new rv.MongoClient(A,D)}catch(X){throw this.readyState=F6.disconnected,X}this.client=J,J.setMaxListeners(0),await J.connect(),nQ(this,J,D,Z);for(let X of this.otherDbs)nQ(X,J,{},X.name);return this};/*!
727
+ * ignore
728
+ */O3.prototype.setClient=function F(A){if(!(A instanceof rv.MongoClient))throw new A7("Must call `setClient()` with an instance of MongoClient");if(this.readyState!==F6.disconnected)throw new A7("Cannot call `setClient()` on a connection that is already connected.");if(A.topology==null)throw new A7("Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.");this._connectionString=A.s.url,nQ(this,A,{},A.s.options.dbName);for(let D of Object.values(this.models))D.init().catch(function Z(){});return this};/*!
729
+ * ignore
730
+ */function nQ(F,A,D,Z){let J=Z!=null?A.db(Z):A.db();F.db=J,F.client=A,F.host=A&&A.s&&A.s.options&&A.s.options.hosts&&A.s.options.hosts[0]&&A.s.options.hosts[0].host||void 0,F.port=A&&A.s&&A.s.options&&A.s.options.hosts&&A.s.options.hosts[0]&&A.s.options.hosts[0].port||void 0,F.name=Z!=null?Z:J.databaseName,F._closeCalled=A._closeCalled;let X=()=>{if(F.readyState!==F6.connected)F.readyState=F6.connected,F.emit("reconnect"),F.emit("reconnected"),F.onOpen()},$=A&&A.topology&&A.topology.description&&A.topology.description.type||"";if($==="Single")A.on("serverDescriptionChanged",(G)=>{if(G.newDescription.type==="Unknown")F.readyState=F6.disconnected;else X()});else if($.startsWith("ReplicaSet"))A.on("topologyDescriptionChanged",(G)=>{let Y=G.newDescription;if(F.readyState===F6.connected&&Y.type!=="ReplicaSetWithPrimary")F.readyState=F6.disconnected;else if(F.readyState===F6.disconnected&&Y.type==="ReplicaSetWithPrimary")X()});if(F._lastHeartbeatAt=null,A.on("serverHeartbeatSucceeded",()=>{F._lastHeartbeatAt=Date.now()}),D.monitorCommands)A.on("commandStarted",(G)=>F.emit("commandStarted",G)),A.on("commandFailed",(G)=>F.emit("commandFailed",G)),A.on("commandSucceeded",(G)=>F.emit("commandSucceeded",G));F.onOpen();for(let G in F.collections)if(tv.object.hasOwnProperty(F.collections,G))F.collections[G].onOpen()}/*!
731
+ * Module exports.
732
+ */ov.exports=O3});var Fm=E((VE1)=>{/*!
733
+ * Module exports.
734
+ */VE1.BulkWriteResult=gS();VE1.Collection=r_();VE1.Connection=ev()});var Dm=E((VO1,Am)=>{/*!
735
+ * Valid mongoose options
736
+ */var PE1=Object.freeze(["allowDiskUse","applyPluginsToChildSchemas","applyPluginsToDiscriminators","autoCreate","autoIndex","autoSearchIndex","bufferCommands","bufferTimeoutMS","cloneSchemas","createInitialConnection","debug","forceRepopulate","id","timestamps.createdAt.immutable","maxTimeMS","objectIdGetter","overwriteModels","returnOriginal","runValidators","sanitizeFilter","sanitizeProjection","selectPopulatedPaths","setDefaultsOnInsert","strict","strictPopulate","strictQuery","toJSON","toObject","transactionAsyncLocalStorage","translateAliases"]);Am.exports=PE1});var Jm=E((LO1,Zm)=>{/*!
737
+ * Module dependencies.
738
+ */var IE1=w1();class sQ extends IE1{constructor(F){let A=F.map((D)=>D.message).join(", ");if(A.length>50)A=A.slice(0,50)+"...";super(`eachAsync() finished with ${F.length} errors: ${A}`);this.errors=F}}Object.defineProperty(sQ.prototype,"name",{value:"EachAsyncMultiError"});/*!
739
+ * exports
740
+ */Zm.exports=sQ});var tQ=E((RO1,$m)=>{/*!
741
+ * Module dependencies.
742
+ */var ME1=Jm(),rQ=g6();$m.exports=async function F(A,D,Z){let J=Z.parallel||1,X=Z.batchSize,$=Z.signal,G=Z.continueOnError,Y=[],B=NE1(),H=!1;return new Promise((C,Q)=>{if($!=null){if($.aborted)return C(null);$.addEventListener("abort",()=>{return H=!0,C(null)},{once:!0})}if(X!=null){if(typeof X!=="number")throw new TypeError("batchSize must be a number");else if(!Number.isInteger(X))throw new TypeError("batchSize must be an integer");else if(X<1)throw new TypeError("batchSize must be at least 1")}q((K,U)=>{if(K!=null)return Q(K);C(U)})});function q(C){let Q=0,K=0,U=null;for(let L=0;L<J;++L)B(z());function z(){let L=[],V=!1;return P;function P(I){if(V||H)return I();else if(U)return I();A(function(M,x){if(U!=null)return I();if(M!=null)if(M.name==="MongoCursorExhaustedError")x=null;else if(G)Y.push(M);else return U=M,C(M),I();if(x==null){if(V=!0,Q<=0){let R=G?Xm(Y):U;C(R)}else if(X&&L.length)W(L,K++,O);return I()}if(++Q,rQ(()=>I()),X)L.push(x);if(X&&L.length!==X){rQ(()=>B(P));return}let _=X?L:x;function O(R){if(X)Q-=L.length,L=[];else--Q;if(R!=null)if(G)Y.push(R);else return U=R,C(R);if((V||H)&&Q<=0){let S=G?Xm(Y):U;return C(S)}rQ(()=>B(P))}W(_,K++,O)})}}}function W(C,Q,K){let U;try{U=D(C,Q)}catch(z){return K(z)}if(U&&typeof U.then==="function")U.then(function(){K(null)},function(z){K(z||new Error("`eachAsync()` promise rejected without error"))});else K(null)}};function NE1(){let F=[],A=null,D=0;return function J(X){if(A===null&&F.length===0)return A=D++,X(Z);F.push(X)};function Z(){if(F.length!==0)A=D++,F.shift()(Z);else A=null}}function Xm(F){if(F.length===0)return null;return new ME1(F)}});var Km=E((wO1,Qm)=>{/*!
743
+ * Module dependencies.
744
+ */var VA=w1(),Hm=i("node:stream").Readable,jE1=tQ(),qm=cF(),TE1=m9(),oQ=g6(),{once:kE1}=i("node:events"),Wm=i("node:util");function R2(F){Hm.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this.skipped=!1,this.query=F,this._closed=!1;let A=F.model;this._mongooseOptions={},this._transforms=[],this.model=A,this.options={},A.hooks.execPre("find",F,(D)=>{if(D!=null){if(D instanceof TE1.skipWrappedFunction){let Z=D.args[0];if(Z!=null&&(!Array.isArray(Z)||Z.length)){let J=new VA('Cannot `skipMiddlewareFunction()` with a value when using `.find().cursor()`, value must be nullish or empty array, got "'+Wm.inspect(Z)+'".');this._markError(J),this.listeners("error").length>0&&this.emit("error",J);return}this.skipped=!0,this.emit("cursor",null);return}this._markError(D),this.listeners("error").length>0&&this.emit("error",D);return}if(Object.assign(this.options,F._optionsForExec()),this._transforms=this._transforms.concat(F._transforms.slice()),this.options.transform)this._transforms.push(this.options.transform);if(this.options.batchSize)this.options._populateBatchSize=Math.min(this.options.batchSize,5000);if(A.collection._shouldBufferCommands()&&A.collection.buffer)A.collection.queue.push([()=>Ym(F,this)]);else Ym(F,this)})}Wm.inherits(R2,Hm);/*!
745
+ * ignore
746
+ */function Ym(F,A){try{let D=F.model.collection.find(F._conditions,A.options);A.cursor=D,A.emit("cursor",D)}catch(D){A._markError(D),A.listeners("error").length>0&&A.emit("error",A._error)}}R2.prototype._read=function(){KX(this,(F,A)=>{if(F)return this.emit("error",F);if(!A){this.push(null),this.cursor.close(function(D){if(D)return this.emit("error",D)});return}this.push(A)})};R2.prototype.getDriverCursor=async function F(){if(this.cursor)return this.cursor;return await kE1(this,"cursor"),this.cursor};Object.defineProperty(R2.prototype,"map",{value:function(F){return this._transforms.push(F),this},enumerable:!0,configurable:!0,writable:!0});R2.prototype._markError=function(F){return this._error=F,this};R2.prototype.close=async function F(){if(typeof arguments[0]==="function")throw new VA("QueryCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close(),this._closed=!0,this.emit("close")}catch(A){throw this.listeners("error").length>0&&this.emit("error",A),A}};R2.prototype._destroy=function F(A,D){let Z=null;if(!this.cursor)Z=new Promise((J)=>{this.once("cursor",J)});else Z=Promise.resolve();return Z.then(()=>{this.cursor.close()}).then(()=>{this._closed=!0,D()}).catch((J)=>{D(J)}),this};R2.prototype.rewind=function(){return Cm(this,()=>{this.cursor.rewind()}),this};R2.prototype.next=async function F(){if(typeof arguments[0]==="function")throw new VA("QueryCursor.prototype.next() no longer accepts a callback");if(this._closed)throw new VA("Cannot call `next()` on a closed cursor");return new Promise((A,D)=>{KX(this,function(Z,J){if(Z)return D(Z);A(J)})})};R2.prototype.eachAsync=function(F,A){if(typeof arguments[2]==="function")throw new VA("QueryCursor.prototype.eachAsync() no longer accepts a callback");if(typeof A==="function")A={};return A=A||{},jE1((D)=>KX(this,D),F,A)};R2.prototype.options;R2.prototype.addCursorFlag=function(F,A){return Cm(this,()=>{this.cursor.addCursorFlag(F,A)}),this};/*!
747
+ * ignore
748
+ */R2.prototype.transformNull=function(F){if(arguments.length===0)F=!0;return this._mongooseOptions.transformNull=F,this};/*!
749
+ * ignore
750
+ */R2.prototype._transformForAsyncIterator=function(){if(this._transforms.indexOf(Gm)===-1)this.map(Gm);return this};if(Symbol.asyncIterator!=null)R2.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()};/*!
751
+ * ignore
752
+ */function Gm(F){return F==null?{done:!0}:{value:F,done:!1}}function KX(F,A){let D=A;if(F._transforms.length)D=function(Z,J){if(Z||J===null&&!F._mongooseOptions.transformNull)return A(Z,J);A(Z,F._transforms.reduce(function(X,$){return $.call(F,X)},J))};if(F._error)return oQ(function(){D(F._error)});if(F.skipped)return oQ(()=>D(null,null));if(F.cursor){if(F.query._mongooseOptions.populate&&!F._pop)F._pop=qm.preparePopulationOptionsMQ(F.query,F.query._mongooseOptions),F._pop.__noPromise=!0;if(F.query._mongooseOptions.populate&&F.options._populateBatchSize>1)if(F._batchDocs&&F._batchDocs.length)return CX(F,F._batchDocs.shift(),F._pop,D);else if(F._batchExhausted)return D(null,null);else{F._batchDocs=[],F.cursor.next().then((Z)=>{QX.call({ctx:F,callback:D},null,Z)},(Z)=>{QX.call({ctx:F,callback:D},Z)});return}else return F.cursor.next().then((Z)=>{if(!Z){D(null,null);return}if(!F.query._mongooseOptions.populate)return CX(F,Z,null,D);F.query.model.populate(Z,F._pop).then((J)=>{CX(F,J,F._pop,D)},(J)=>{D(J)})},(Z)=>{D(Z)})}else F.once("error",A),F.once("cursor",function(Z){if(F.removeListener("error",A),Z==null){if(F.skipped)return A(null,null);return}KX(F,A)})}/*!
753
+ * ignore
754
+ */function QX(F,A){if(F)return this.callback(F);if(!A)return this.ctx._batchExhausted=!0,Bm.call(this);if(this.ctx._batchDocs.push(A),this.ctx._batchDocs.length<this.ctx.options._populateBatchSize)oQ(()=>this.ctx.cursor.next().then((D)=>{QX.call(this,null,D)},(D)=>{QX.call(this,D)}));else Bm.call(this)}/*!
755
+ * ignore
756
+ */function Bm(){if(!this.ctx._batchDocs.length)return this.callback(null,null);this.ctx.query.model.populate(this.ctx._batchDocs,this.ctx._pop).then(()=>{CX(this.ctx,this.ctx._batchDocs.shift(),this.ctx._pop,this.callback)},(F)=>{this.callback(F)})}/*!
757
+ * ignore
758
+ */function CX(F,A,D,Z){if(F.query._mongooseOptions.lean)return F.model.hooks.execPost("find",F.query,[[A]],(Y)=>{if(Y!=null)return Z(Y);Z(null,A)});let{model:J,_fields:X,_userProvidedFields:$,options:G}=F.query;qm.createModelAndInit(J,A,X,$,G,D,(Y,B)=>{if(Y!=null)return Z(Y);F.model.hooks.execPost("find",F.query,[[B]],(H)=>{if(H!=null)return Z(H);Z(null,B)})})}/*!
759
+ * ignore
760
+ */function Cm(F,A){if(F.cursor)return A();F.once("cursor",function(D){if(D==null)return;A()})}Qm.exports=R2});var FK=E((PO1,Um)=>{var eQ=q1();function OE1(F,A,D){Em(F,A,D,"maxTimeMS")}function SE1(F,A,D){Em(F,A,D,"allowDiskUse")}Um.exports={applyGlobalMaxTimeMS:OE1,applyGlobalDiskUse:SE1};function Em(F,A,D,Z){if(eQ.hasUserDefinedProperty(F,Z))return;if(eQ.hasUserDefinedProperty(A,Z))F[Z]=A[Z];else if(eQ.hasUserDefinedProperty(D,Z))F[Z]=D[Z]}});var AK=E((IO1,zm)=>{zm.exports=function F(A,D){if(D.readConcern!==void 0)return;if(D&&D.session&&D.session.transaction)return;let Z=A.options?.readConcern?.level;if(Z!=null)D.readConcern={level:Z}}});var DK=E((MO1,Vm)=>{Vm.exports=function F(A,D){if(D.writeConcern!=null)return;if(D&&D.session&&D.session.transaction)return;let Z=A.options.writeConcern??{};if(Object.keys(Z).length!=0){if(D.writeConcern={},!("w"in D)&&Z.w!=null)D.writeConcern.w=Z.w;if(!("j"in D)&&Z.j!=null)D.writeConcern.j=Z.j;if(!("wtimeout"in D)&&Z.wtimeout!=null)D.writeConcern.wtimeout=Z.wtimeout}else{if(!("w"in D)&&Z.w!=null)D.w=Z.w;if(!("j"in D)&&Z.j!=null)D.j=Z.j;if(!("wtimeout"in D)&&Z.wtimeout!=null)D.wtimeout=Z.wtimeout}}});var wm=E((NO1,Rm)=>{var Lm=AA();Rm.exports=function F(A,D,Z){if(!Object.keys(Z).some(Lm))return D.castForQuery(null,Z,A);let X=Object.keys(Z),$=X.length;while($--){let G=X[$],Y=Z[G];if(G==="$not"){if(Y&&D&&!D.caster){let B=Object.keys(Y);if(B.length&&Lm(B[0]))for(let H of Object.keys(Y))Y[H]=D.castForQuery(H,Y[H],A);else Z[G]=D.castForQuery(G,Y,A);continue}}else Z[G]=D.castForQuery(G,Y,A)}return Z}});var Im=E((jO1,Pm)=>{var _E1=/^\d+$/;Pm.exports=function F(A,D){let Z=A.path(D);if(Z!=null)return Z;let J=D.split("."),X="",$=!1;for(let G of J){if($&&_E1.test(G))continue;if(X=X.length===0?G:X+"."+G,Z=A.path(X),Z!=null&&Z.schema){if(A=Z.schema,X="",!$&&Z.$isMongooseDocumentArray)$=!0}}return Z}});var km=E((TO1,Tm)=>{var uE1=wm(),Mm=rF(),Nm=Im(),xE1=SQ();Tm.exports=function F(A){let D=A.options.arrayFilters,Z=A.getUpdate(),J=A.schema,X=xE1(Z),$=J.options.strict;if(A._mongooseOptions.strict!=null)$=A._mongooseOptions.strict;if(A.model&&A.model.base.options.strictQuery!=null)$=A.model.base.options.strictQuery;if(J._userProvidedOptions.strictQuery!=null)$=J._userProvidedOptions.strictQuery;if(A._mongooseOptions.strictQuery!=null)$=A._mongooseOptions.strictQuery;jm(D,J,$,X,A)};function jm(F,A,D,Z,J){if(!Array.isArray(F))return;for(let X of F){if(X==null)throw new Error(`Got null array filter in ${F}`);let $=Object.keys(X).filter((C)=>X[C]!=null);if($.length===0)continue;let G=$[0];if(G==="$and"||G==="$or"){for(let C of $)jm(X[C],A,D,Z,J);continue}let Y=G.indexOf("."),B=Y===-1?G:G.substring(0,Y);if(Z[B]==null)continue;let H=Mm(Z[B]),q=Nm(A,H),W=q!=null?q.schema:null;if(W!=null&&W.discriminators!=null&&X[B+"."+W.options.discriminatorKey])W=W.discriminators[X[B+"."+W.options.discriminatorKey]]||W;for(let C of $){if(Z[C]===null)continue;if(Object.keys(Z).length===0)continue;let Q=C.indexOf("."),K=Q===-1?null:C.substring(Q),U;if(K==null||W==null)U=q;else K=Mm(K),U=Nm(W,K);if(U==null){if(!D)return;let z=K==null?H+".0":H+".0"+K;throw new Error(`Could not find path "${z}" in schema`)}if(typeof X[C]==="object")X[C]=uE1(J,U,X[C]);else X[C]=U.castForQuery(null,X[C])}}}});var EX=E((kO1,Om)=>{var gE1=_8(),fE1=R8();/*!
761
+ * ignore
762
+ */Om.exports=function F(A){if(A==null)return!1;let D=Object.keys(A),Z=D.length;if(Z===0)return!1;for(let J=0;J<Z;++J){let X=D[J];if(X.startsWith("+"))continue;if(gE1(A[X])&&!!A[X])if(fE1(A[X]))return F(A[X]);else return!!A[X]}return!1}});var _m=E((OO1,Sm)=>{Sm.exports=function F(A,D){return A===D||D.startsWith(A+".")}});var fm=E((vE1)=>{/*!
763
+ * Module dependencies.
764
+ */var ZK=["__proto__","constructor","prototype"],UX=vE1.clone=function F(A,D){if(A===void 0||A===null)return A;if(Array.isArray(A))return vE1.cloneArray(A,D);if(A.constructor){if(/ObjectI[dD]$/.test(A.constructor.name))return typeof A.clone=="function"?A.clone():new A.constructor(A.id);if(A.constructor.name==="ReadPreference")return new A.constructor(A.mode,F(A.tags,D));if(A._bsontype=="Binary"&&A.buffer&&A.value)return typeof A.clone=="function"?A.clone():new A.constructor(A.value(!0),A.sub_type);if(A.constructor.name==="Date"||A.constructor.name==="Function")return new A.constructor(+A);if(A.constructor.name==="RegExp")return new RegExp(A);if(A.constructor.name==="Buffer")return Buffer.from(A)}if(bE1(A))return vE1.cloneObject(A,D);if(A.valueOf)return A.valueOf()};/*!
765
+ * ignore
766
+ */vE1.cloneObject=function F(A,D){let Z=D&&D.minimize,J={},X=Object.keys(A),$=X.length,G=!1,Y,B="",H=0;for(H=0;H<$;++H){if(B=X[H],ZK.indexOf(B)!==-1)continue;if(Y=UX(A[B],D),!Z||typeof Y!=="undefined")G||(G=!0),J[B]=Y}return Z?G&&J:J};vE1.cloneArray=function F(A,D){let Z=[],J=A.length,X=0;for(;X<J;X++)Z.push(UX(A[X],D));return Z};vE1.merge=function F(A,D){let Z=Object.keys(D);for(let J of Z){if(ZK.indexOf(J)!==-1)continue;if(typeof A[J]==="undefined")A[J]=D[J];else if(vE1.isObject(D[J]))F(A[J],D[J]);else A[J]=D[J]}};vE1.mergeClone=function F(A,D){let Z=Object.keys(D);for(let J of Z){if(ZK.indexOf(J)!==-1)continue;if(typeof A[J]==="undefined")A[J]=UX(D[J]);else if(vE1.isObject(D[J]))F(A[J],D[J]);else A[J]=UX(D[J])}};vE1.readPref=function F(A){switch(A){case"p":A="primary";break;case"pp":A="primaryPreferred";break;case"s":A="secondary";break;case"sp":A="secondaryPreferred";break;case"n":A="nearest";break}return A};vE1.readConcern=function F(A){if(typeof A==="string"){switch(A){case"l":A="local";break;case"a":A="available";break;case"m":A="majority";break;case"lz":A="linearizable";break;case"s":A="snapshot";break}A={level:A}}return A};var yE1=Object.prototype.toString;vE1.toString=function(F){return yE1.call(F)};var bE1=vE1.isObject=function(F){return vE1.toString(F)=="[object Object]"};vE1.keys=Object.keys;vE1.create=typeof Object.create=="function"?Object.create:hE1;function hE1(F){if(arguments.length>1)throw new Error("Adding properties is not supported");function A(){}return A.prototype=F,new A}vE1.inherits=function(F,A){F.prototype=vE1.create(A.prototype),F.prototype.constructor=F};vE1.isArgumentsObject=function(F){return Object.prototype.toString.call(F)==="[object Arguments]"}});var bm=E((uO1,ym)=>{var o8=1000,e8=o8*60,F5=e8*60,D7=F5*24,rE1=D7*7,tE1=D7*365.25;ym.exports=function(F,A){A=A||{};var D=typeof F;if(D==="string"&&F.length>0)return oE1(F);else if(D==="number"&&isFinite(F))return A.long?FU1(F):eE1(F);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(F))};function oE1(F){if(F=String(F),F.length>100)return;var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(F);if(!A)return;var D=parseFloat(A[1]),Z=(A[2]||"ms").toLowerCase();switch(Z){case"years":case"year":case"yrs":case"yr":case"y":return D*tE1;case"weeks":case"week":case"w":return D*rE1;case"days":case"day":case"d":return D*D7;case"hours":case"hour":case"hrs":case"hr":case"h":return D*F5;case"minutes":case"minute":case"mins":case"min":case"m":return D*e8;case"seconds":case"second":case"secs":case"sec":case"s":return D*o8;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return D;default:return}}function eE1(F){var A=Math.abs(F);if(A>=D7)return Math.round(F/D7)+"d";if(A>=F5)return Math.round(F/F5)+"h";if(A>=e8)return Math.round(F/e8)+"m";if(A>=o8)return Math.round(F/o8)+"s";return F+"ms"}function FU1(F){var A=Math.abs(F);if(A>=D7)return zX(F,A,D7,"day");if(A>=F5)return zX(F,A,F5,"hour");if(A>=e8)return zX(F,A,e8,"minute");if(A>=o8)return zX(F,A,o8,"second");return F+" ms"}function zX(F,A,D,Z){var J=A>=D*1.5;return Math.round(F/D)+" "+Z+(J?"s":"")}});var JK=E((xO1,hm)=>{function AU1(F){D.debug=D,D.default=D,D.coerce=Y,D.disable=X,D.enable=J,D.enabled=$,D.humanize=bm(),D.destroy=B,Object.keys(F).forEach((H)=>{D[H]=F[H]}),D.names=[],D.skips=[],D.formatters={};function A(H){let q=0;for(let W=0;W<H.length;W++)q=(q<<5)-q+H.charCodeAt(W),q|=0;return D.colors[Math.abs(q)%D.colors.length]}D.selectColor=A;function D(H){let q,W=null,C,Q;function K(...U){if(!K.enabled)return;let z=K,L=Number(new Date),V=L-(q||L);if(z.diff=V,z.prev=q,z.curr=L,q=L,U[0]=D.coerce(U[0]),typeof U[0]!=="string")U.unshift("%O");let P=0;U[0]=U[0].replace(/%([a-zA-Z%])/g,(M,x)=>{if(M==="%%")return"%";P++;let _=D.formatters[x];if(typeof _==="function"){let O=U[P];M=_.call(z,O),U.splice(P,1),P--}return M}),D.formatArgs.call(z,U),(z.log||D.log).apply(z,U)}if(K.namespace=H,K.useColors=D.useColors(),K.color=D.selectColor(H),K.extend=Z,K.destroy=D.destroy,Object.defineProperty(K,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(W!==null)return W;if(C!==D.namespaces)C=D.namespaces,Q=D.enabled(H);return Q},set:(U)=>{W=U}}),typeof D.init==="function")D.init(K);return K}function Z(H,q){let W=D(this.namespace+(typeof q==="undefined"?":":q)+H);return W.log=this.log,W}function J(H){D.save(H),D.namespaces=H,D.names=[],D.skips=[];let q,W=(typeof H==="string"?H:"").split(/[\s,]+/),C=W.length;for(q=0;q<C;q++){if(!W[q])continue;if(H=W[q].replace(/\*/g,".*?"),H[0]==="-")D.skips.push(new RegExp("^"+H.slice(1)+"$"));else D.names.push(new RegExp("^"+H+"$"))}}function X(){let H=[...D.names.map(G),...D.skips.map(G).map((q)=>"-"+q)].join(",");return D.enable(""),H}function $(H){if(H[H.length-1]==="*")return!0;let q,W;for(q=0,W=D.skips.length;q<W;q++)if(D.skips[q].test(H))return!1;for(q=0,W=D.names.length;q<W;q++)if(D.names[q].test(H))return!0;return!1}function G(H){return H.toString().substring(2,H.toString().length-2).replace(/\.\*\?$/,"*")}function Y(H){if(H instanceof Error)return H.stack||H.message;return H}function B(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return D.enable(D.load()),D}hm.exports=AU1});var mm=E((vm,LX)=>{vm.formatArgs=ZU1;vm.save=JU1;vm.load=XU1;vm.useColors=DU1;vm.storage=$U1();vm.destroy=(()=>{let F=!1;return()=>{if(!F)F=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();vm.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function DU1(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ZU1(F){if(F[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+F[0]+(this.useColors?"%c ":" ")+"+"+LX.exports.humanize(this.diff),!this.useColors)return;let A="color: "+this.color;F.splice(1,0,A,"color: inherit");let D=0,Z=0;F[0].replace(/%[a-zA-Z%]/g,(J)=>{if(J==="%%")return;if(D++,J==="%c")Z=D}),F.splice(Z,0,A)}vm.log=console.debug||console.log||(()=>{});function JU1(F){try{if(F)vm.storage.setItem("debug",F);else vm.storage.removeItem("debug")}catch(A){}}function XU1(){let F;try{F=vm.storage.getItem("debug")}catch(A){}if(!F&&typeof process!=="undefined"&&"env"in process)F=process.env.DEBUG;return F}function $U1(){try{return localStorage}catch(F){}}LX.exports=JK()(vm);var{formatters:YU1}=LX.exports;YU1.j=function(F){try{return JSON.stringify(F)}catch(A){return"[UnexpectedJSONParseError]: "+A.message}}});var pm=E((cm,wX)=>{var KU1=i("node:tty"),RX=i("node:util");cm.init=wU1;cm.log=VU1;cm.formatArgs=UU1;cm.save=LU1;cm.load=RU1;cm.useColors=EU1;cm.destroy=RX.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");cm.colors=[6,2,3,4,5,1];try{let F=(()=>{throw new Error("Cannot require module "+"supports-color");})();if(F&&(F.stderr||F).level>=2)cm.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(F){}cm.inspectOpts=Object.keys(process.env).filter((F)=>{return/^debug_/i.test(F)}).reduce((F,A)=>{let D=A.substring(6).toLowerCase().replace(/_([a-z])/g,(J,X)=>{return X.toUpperCase()}),Z=process.env[A];if(/^(yes|on|true|enabled)$/i.test(Z))Z=!0;else if(/^(no|off|false|disabled)$/i.test(Z))Z=!1;else if(Z==="null")Z=null;else Z=Number(Z);return F[D]=Z,F},{});function EU1(){return"colors"in cm.inspectOpts?Boolean(cm.inspectOpts.colors):KU1.isatty(process.stderr.fd)}function UU1(F){let{namespace:A,useColors:D}=this;if(D){let Z=this.color,J="\x1B[3"+(Z<8?Z:"8;5;"+Z),X=` ${J};1m${A} \x1B[0m`;F[0]=X+F[0].split(`
767
+ `).join(`
768
+ `+X),F.push(J+"m+"+wX.exports.humanize(this.diff)+"\x1B[0m")}else F[0]=zU1()+A+" "+F[0]}function zU1(){if(cm.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function VU1(...F){return process.stderr.write(RX.format(...F)+`
769
+ `)}function LU1(F){if(F)process.env.DEBUG=F;else delete process.env.DEBUG}function RU1(){return process.env.DEBUG}function wU1(F){F.inspectOpts={};let A=Object.keys(cm.inspectOpts);for(let D=0;D<A.length;D++)F.inspectOpts[A[D]]=cm.inspectOpts[A[D]]}wX.exports=JK()(cm);var{formatters:dm}=wX.exports;dm.o=function(F){return this.inspectOpts.colors=this.useColors,RX.inspect(F,this.inspectOpts).split(`
770
+ `).map((A)=>A.trim()).join(" ")};dm.O=function(F){return this.inspectOpts.colors=this.useColors,RX.inspect(F,this.inspectOpts)}});var im=E((yO1,XK)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)XK.exports=mm();else XK.exports=pm()});var nm=E((am)=>{var I0=am;I0.distinct=function(F){if(F._fields&&Object.keys(F._fields).length>0)return"field selection and slice";let A=Object.keys(I0.distinct),D;return A.every(function(Z){if(F.options[Z])return D=Z,!1;return!0}),D};I0.distinct.select=I0.distinct.slice=I0.distinct.sort=I0.distinct.limit=I0.distinct.skip=I0.distinct.batchSize=I0.distinct.hint=I0.distinct.tailable=!0;I0.findOneAndUpdate=I0.findOneAndRemove=function(F){let A=Object.keys(I0.findOneAndUpdate),D;return A.every(function(Z){if(F.options[Z])return D=Z,!1;return!0}),D};I0.findOneAndUpdate.limit=I0.findOneAndUpdate.skip=I0.findOneAndUpdate.batchSize=I0.findOneAndUpdate.tailable=!0;I0.count=function(F){if(F._fields&&Object.keys(F._fields).length>0)return"field selection and slice";let A=Object.keys(I0.count),D;return A.every(function(Z){if(F.options[Z])return D=Z,!1;return!0}),D};I0.count.slice=I0.count.batchSize=I0.count.tailable=!0});var YK=E((OU1,sm)=>{OU1.isNode=typeof process!="undefined"&&typeof sm=="object"&&typeof global=="object"&&typeof Buffer=="function"&&process.argv;OU1.isMongo=!OU1.isNode&&typeof printjson=="function"&&typeof ObjectId=="function"&&typeof rs=="function"&&typeof sh=="function";OU1.isBrowser=!OU1.isNode&&!OU1.isMongo&&typeof window!="undefined";OU1.type=OU1.isNode?"node":OU1.isMongo?"mongo":OU1.isBrowser?"browser":"unknown"});var LA=E((tm,om)=>{var GK=["find","findOne","updateMany","updateOne","replaceOne","count","distinct","findOneAndDelete","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function BK(){}for(let F=0,A=GK.length;F<A;++F){let D=GK[F];BK.prototype[D]=_U1(D)}om.exports=tm=BK;BK.methods=GK;function _U1(F){return function(){throw new Error("collection."+F+" not implemented")}}});var Dd=E((Fd,Ad)=>{var uU1=LA();class em extends uU1{constructor(F){super();this.collection=F,this.collectionName=F.collectionName}async find(F,A){return this.collection.find(F,A).toArray()}async findOne(F,A){return this.collection.findOne(F,A)}async count(F,A){return this.collection.count(F,A)}async distinct(F,A,D){return this.collection.distinct(F,A,D)}async updateMany(F,A,D){return this.collection.updateMany(F,A,D)}async updateOne(F,A,D){return this.collection.updateOne(F,A,D)}async replaceOne(F,A,D){return this.collection.replaceOne(F,A,D)}async deleteOne(F,A){return this.collection.deleteOne(F,A)}async deleteMany(F,A){return this.collection.deleteMany(F,A)}async findOneAndDelete(F,A){return this.collection.findOneAndDelete(F,A)}async findOneAndUpdate(F,A,D){return this.collection.findOneAndUpdate(F,A,D)}findCursor(F,A){return this.collection.find(F,A)}}Ad.exports=Fd=em});var Jd=E((hO1,Zd)=>{var HK=YK();if(HK.type=="unknown")throw new Error("Unknown environment");Zd.exports=HK.isNode?Dd():HK.isMongo?LA():LA()});var QK=E(($d,Yd)=>{var xU1=i("node:assert"),gU1=i("node:util"),f1=fm(),Q4=im()("mquery");function l(F,A){if(!(this instanceof l))return new l(F,A);let D=this.constructor.prototype;if(this.op=D.op||void 0,this.options=Object.assign({},D.options),this._conditions=D._conditions?f1.clone(D._conditions):{},this._fields=D._fields?f1.clone(D._fields):void 0,this._updateDoc=D._updateDoc?f1.clone(D._updateDoc):void 0,this._path=D._path||void 0,this._distinctDoc=D._distinctDoc||void 0,this._collection=D._collection||void 0,this._traceFunction=D._traceFunction||void 0,A)this.setOptions(A);if(F)this.find(F)}var Z7="$geoWithin";Object.defineProperty(l,"use$geoWithin",{get:function(){return Z7=="$geoWithin"},set:function(F){if(F===!0)Z7="$geoWithin";else Z7="$within"}});l.prototype.toConstructor=function F(){function A(Z,J){if(!(this instanceof A))return new A(Z,J);l.call(this,Z,J)}f1.inherits(A,l);let D=A.prototype;return D.options={},D.setOptions(this.options),D.op=this.op,D._conditions=f1.clone(this._conditions),D._fields=f1.clone(this._fields),D._updateDoc=f1.clone(this._updateDoc),D._path=this._path,D._distinctDoc=this._distinctDoc,D._collection=this._collection,D._traceFunction=this._traceFunction,A};l.prototype.setOptions=function(F){if(!(F&&f1.isObject(F)))return this;let A=f1.keys(F),D;for(let Z=0;Z<A.length;++Z)if(D=A[Z],typeof this[D]=="function"){let J=Array.isArray(F[D])?F[D]:[F[D]];this[D].apply(this,J)}else this.options[D]=F[D];return this};l.prototype.collection=function F(A){return this._collection=new l.Collection(A),this};l.prototype.collation=function(F){return this.options.collation=F,this};l.prototype.$where=function(F){return this._conditions.$where=F,this};l.prototype.where=function(){if(!arguments.length)return this;if(!this.op)this.op="find";let F=typeof arguments[0];if(F=="string"){if(this._path=arguments[0],arguments.length===2)this._conditions[this._path]=arguments[1];return this}if(F=="object"&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw new TypeError("path must be a string or object")};l.prototype.equals=function F(A){this._ensurePath("equals");let D=this._path;return this._conditions[D]=A,this};l.prototype.eq=function F(A){this._ensurePath("eq");let D=this._path;return this._conditions[D]=A,this};l.prototype.or=function F(A){let D=this._conditions.$or||(this._conditions.$or=[]);if(!Array.isArray(A))A=[A];return D.push.apply(D,A),this};l.prototype.nor=function F(A){let D=this._conditions.$nor||(this._conditions.$nor=[]);if(!Array.isArray(A))A=[A];return D.push.apply(D,A),this};l.prototype.and=function F(A){let D=this._conditions.$and||(this._conditions.$and=[]);if(!Array.isArray(A))A=[A];return D.push.apply(D,A),this};/*!
771
+ * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
772
+ *
773
+ * Thing.where('type').nin(array)
774
+ */"gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach(function(F){l.prototype[F]=function(){let A,D;if(arguments.length===1)this._ensurePath(F),D=arguments[0],A=this._path;else D=arguments[1],A=arguments[0];let Z=this._conditions[A]===null||typeof this._conditions[A]==="object"?this._conditions[A]:this._conditions[A]={};return Z["$"+F]=D,this}});l.prototype.mod=function(){let F,A;if(arguments.length===1)this._ensurePath("mod"),F=arguments[0],A=this._path;else if(arguments.length===2&&!Array.isArray(arguments[1]))this._ensurePath("mod"),F=[arguments[0],arguments[1]],A=this._path;else if(arguments.length===3)F=[arguments[1],arguments[2]],A=arguments[0];else F=arguments[1],A=arguments[0];let D=this._conditions[A]||(this._conditions[A]={});return D.$mod=F,this};l.prototype.exists=function(){let F,A;if(arguments.length===0)this._ensurePath("exists"),F=this._path,A=!0;else if(arguments.length===1)if(typeof arguments[0]==="boolean")this._ensurePath("exists"),F=this._path,A=arguments[0];else F=arguments[0],A=!0;else if(arguments.length===2)F=arguments[0],A=arguments[1];let D=this._conditions[F]||(this._conditions[F]={});return D.$exists=A,this};l.prototype.elemMatch=function(){if(arguments[0]==null)throw new TypeError("Invalid argument");let F,A,D;if(typeof arguments[0]==="function")this._ensurePath("elemMatch"),A=this._path,F=arguments[0];else if(f1.isObject(arguments[0]))this._ensurePath("elemMatch"),A=this._path,D=arguments[0];else if(typeof arguments[1]==="function")A=arguments[0],F=arguments[1];else if(arguments[1]&&f1.isObject(arguments[1]))A=arguments[0],D=arguments[1];else throw new TypeError("Invalid argument");if(F)D=new l,F(D),D=D._conditions;let Z=this._conditions[A]||(this._conditions[A]={});return Z.$elemMatch=D,this};l.prototype.within=function F(){if(this._ensurePath("within"),this._geoComparison=Z7,arguments.length===0)return this;if(arguments.length===2)return this.box.apply(this,arguments);else if(2<arguments.length)return this.polygon.apply(this,arguments);let A=arguments[0];if(!A)throw new TypeError("Invalid argument");if(A.center)return this.circle(A);if(A.box)return this.box.apply(this,A.box);if(A.polygon)return this.polygon.apply(this,A.polygon);if(A.type&&A.coordinates)return this.geometry(A);throw new TypeError("Invalid argument")};l.prototype.box=function(){let F,A;if(arguments.length===3)F=arguments[0],A=[arguments[1],arguments[2]];else if(arguments.length===2)this._ensurePath("box"),F=this._path,A=[arguments[0],arguments[1]];else throw new TypeError("Invalid argument");let D=this._conditions[F]||(this._conditions[F]={});return D[this._geoComparison||Z7]={$box:A},this};l.prototype.polygon=function(){let F,A;if(typeof arguments[0]=="string")F=Array.from(arguments),A=F.shift();else this._ensurePath("polygon"),A=this._path,F=Array.from(arguments);let D=this._conditions[A]||(this._conditions[A]={});return D[this._geoComparison||Z7]={$polygon:F},this};l.prototype.circle=function(){let F,A;if(arguments.length===1)this._ensurePath("circle"),F=this._path,A=arguments[0];else if(arguments.length===2)F=arguments[0],A=arguments[1];else throw new TypeError("Invalid argument");if(!(("radius"in A)&&A.center))throw new Error("center and radius are required");let D=this._conditions[F]||(this._conditions[F]={}),Z=A.spherical?"$centerSphere":"$center",J=this._geoComparison||Z7;if(D[J]={},D[J][Z]=[A.center,A.radius],"unique"in A)D[J].$uniqueDocs=!!A.unique;return this};l.prototype.near=function F(){let A,D;if(this._geoComparison="$near",arguments.length===0)return this;else if(arguments.length===1)this._ensurePath("near"),A=this._path,D=arguments[0];else if(arguments.length===2)A=arguments[0],D=arguments[1];else throw new TypeError("Invalid argument");if(!D.center)throw new Error("center is required");let Z=this._conditions[A]||(this._conditions[A]={}),J=D.spherical?"$nearSphere":"$near";if(Array.isArray(D.center)){Z[J]=D.center;let X="maxDistance"in D?D.maxDistance:null;if(X!=null)Z.$maxDistance=X;if(D.minDistance!=null)Z.$minDistance=D.minDistance}else{if(D.center.type!="Point"||!Array.isArray(D.center.coordinates))throw new Error(gU1.format("Invalid GeoJSON specified for %s",J));if(Z[J]={$geometry:D.center},"maxDistance"in D)Z[J].$maxDistance=D.maxDistance;if("minDistance"in D)Z[J].$minDistance=D.minDistance}return this};l.prototype.intersects=function F(){if(this._ensurePath("intersects"),this._geoComparison="$geoIntersects",arguments.length===0)return this;let A=arguments[0];if(A!=null&&A.type&&A.coordinates)return this.geometry(A);throw new TypeError("Invalid argument")};l.prototype.geometry=function F(){if(!(this._geoComparison=="$within"||this._geoComparison=="$geoWithin"||this._geoComparison=="$near"||this._geoComparison=="$geoIntersects"))throw new Error("geometry() must come after `within()`, `intersects()`, or `near()");let A,D;if(arguments.length===1)this._ensurePath("geometry"),D=this._path,A=arguments[0];else throw new TypeError("Invalid argument");if(!(A.type&&Array.isArray(A.coordinates)))throw new TypeError("Invalid argument");let Z=this._conditions[D]||(this._conditions[D]={});return Z[this._geoComparison]={$geometry:A},this};l.prototype.select=function F(){let A=arguments[0];if(!A)return this;if(arguments.length!==1)throw new Error("Invalid select: select only takes 1 argument");this._validate("select");let D=this._fields||(this._fields={}),Z=typeof A,J,X;if((Z=="string"||f1.isArgumentsObject(A))&&typeof A.length=="number"||Array.isArray(A)){if(Z=="string")A=A.split(/\s+/);for(J=0,X=A.length;J<X;++J){let $=A[J];if(!$)continue;let G=$[0]=="-"?0:1;if(G===0)$=$.substring(1);D[$]=G}return this}if(f1.isObject(A)){let $=f1.keys(A);for(J=0;J<$.length;++J)D[$[J]]=A[$[J]];return this}throw new TypeError("Invalid select() argument. Must be string or object.")};l.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let F,A;if(arguments.length===1){let Z=arguments[0];if(typeof Z==="object"&&!Array.isArray(Z)){let J=Object.keys(Z),X=J.length;for(let $=0;$<X;++$)this.slice(J[$],Z[J[$]]);return this}this._ensurePath("slice"),F=this._path,A=arguments[0]}else if(arguments.length===2)if(typeof arguments[0]==="number")this._ensurePath("slice"),F=this._path,A=[arguments[0],arguments[1]];else F=arguments[0],A=arguments[1];else if(arguments.length===3)F=arguments[0],A=[arguments[1],arguments[2]];let D=this._fields||(this._fields={});return D[F]={$slice:A},this};l.prototype.sort=function(F){if(!F)return this;let A,D,Z;this._validate("sort");let J=typeof F;if(Array.isArray(F)){D=F.length;for(A=0;A<F.length;++A){if(!Array.isArray(F[A]))throw new Error("Invalid sort() argument, must be array of arrays");fU1(this.options,F[A][0],F[A][1])}return this}if(arguments.length===1&&J=="string"){F=F.split(/\s+/),D=F.length;for(A=0;A<D;++A){if(Z=F[A],!Z)continue;let X=Z[0]=="-"?-1:1;if(X===-1)Z=Z.substring(1);Xd(this.options,Z,X)}return this}if(f1.isObject(F)){let X=f1.keys(F);for(A=0;A<X.length;++A)Z=X[A],Xd(this.options,Z,F[Z]);return this}if(typeof Map!=="undefined"&&F instanceof Map)return yU1(this.options,F),this;throw new TypeError("Invalid sort() argument. Must be a string, object, or array.")};/*!
775
+ * @ignore
776
+ */var qK={1:1,"-1":-1,asc:1,ascending:1,desc:-1,descending:-1};function Xd(F,A,D){if(Array.isArray(F.sort))throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let Z;if(D&&D.$meta){Z=F.sort||(F.sort={}),Z[A]={$meta:D.$meta};return}Z=F.sort||(F.sort={});let J=String(D||1).toLowerCase();if(J=qK[J],!J)throw new TypeError("Invalid sort value: { "+A+": "+D+" }");Z[A]=J}function fU1(F,A,D){if(F.sort=F.sort||[],!Array.isArray(F.sort))throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let Z=String(D||1).toLowerCase();if(Z=qK[Z],!Z)throw new TypeError("Invalid sort value: [ "+A+", "+D+" ]");F.sort.push([A,Z])}function yU1(F,A){if(F.sort=F.sort||new Map,!(F.sort instanceof Map))throw new TypeError("Can't mix sort syntaxes. Use either array or object or map consistently");A.forEach(function(D,Z){let J=String(D||1).toLowerCase();if(J=qK[J],!J)throw new TypeError("Invalid sort value: < "+Z+": "+D+" >");F.sort.set(Z,J)})}/*!
777
+ * limit, skip, batchSize, comment
778
+ *
779
+ * Sets these associated options.
780
+ *
781
+ * query.comment('feed query');
782
+ */["limit","skip","batchSize","comment"].forEach(function(F){l.prototype[F]=function(A){return this._validate(F),this.options[F]=A,this}});l.prototype.maxTime=l.prototype.maxTimeMS=function(F){return this._validate("maxTime"),this.options.maxTimeMS=F,this};l.prototype.hint=function(){if(arguments.length===0)return this;this._validate("hint");let F=arguments[0];if(f1.isObject(F)){let A=this.options.hint||(this.options.hint={});for(let D in F)A[D]=F[D];return this}if(typeof F==="string")return this.options.hint=F,this;throw new TypeError("Invalid hint. "+F)};l.prototype.j=function F(A){return this.options.j=A,this};l.prototype.slaveOk=function(F){return this.options.slaveOk=arguments.length?!!F:!0,this};l.prototype.read=l.prototype.setReadPreference=function(F){if(arguments.length>1&&!l.prototype.read.deprecationWarningIssued)console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),l.prototype.read.deprecationWarningIssued=!0;return this.options.readPreference=f1.readPref(F),this};l.prototype.readConcern=l.prototype.r=function(F){return this.options.readConcern=f1.readConcern(F),this};l.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=arguments.length?!!arguments[0]:!0,this};l.prototype.writeConcern=l.prototype.w=function F(A){if(typeof A==="object"){if(typeof A.j!=="undefined")this.options.j=A.j;if(typeof A.w!=="undefined")this.options.w=A.w;if(typeof A.wtimeout!=="undefined")this.options.wtimeout=A.wtimeout}else this.options.w=A==="m"?"majority":A;return this};l.prototype.wtimeout=l.prototype.wTimeout=function F(A){return this.options.wtimeout=A,this};l.prototype.merge=function(F){if(!F)return this;if(!l.canMerge(F))throw new TypeError("Invalid argument. Expected instanceof mquery or plain object");if(F instanceof l){if(F._conditions)f1.merge(this._conditions,F._conditions);if(F._fields)this._fields||(this._fields={}),f1.merge(this._fields,F._fields);if(F.options)this.options||(this.options={}),f1.merge(this.options,F.options);if(F._updateDoc)this._updateDoc||(this._updateDoc={}),f1.mergeClone(this._updateDoc,F._updateDoc);if(F._distinctDoc)this._distinctDoc=F._distinctDoc;return this}return f1.merge(this._conditions,F),this};l.prototype.find=function(F){if(this.op="find",l.canMerge(F))this.merge(F);return this};l.prototype._find=async function F(){let A=this._conditions,D=this._optionsForExec();if(this.$useProjection)D.projection=this._fieldsForExec();else D.fields=this._fieldsForExec();return Q4("_find",this._collection.collectionName,A,D),this._collection.find(A,D)};l.prototype.cursor=function F(A){if(this.op){if(this.op!=="find")throw new TypeError(".cursor only support .find method")}else this.find(A);let D=this._conditions,Z=this._optionsForExec();if(this.$useProjection)Z.projection=this._fieldsForExec();else Z.fields=this._fieldsForExec();return Q4("findCursor",this._collection.collectionName,D,Z),this._collection.findCursor(D,Z)};l.prototype.findOne=function(F){if(this.op="findOne",l.canMerge(F))this.merge(F);return this};l.prototype._findOne=async function F(){let A=this._conditions,D=this._optionsForExec();if(this.$useProjection)D.projection=this._fieldsForExec();else D.fields=this._fieldsForExec();return Q4("findOne",this._collection.collectionName,A,D),this._collection.findOne(A,D)};l.prototype.count=function(F){if(this.op="count",this._validate(),l.canMerge(F))this.merge(F);return this};l.prototype._count=async function F(){let A=this._conditions,D=this._optionsForExec();return Q4("count",this._collection.collectionName,A,D),this._collection.count(A,D)};l.prototype.distinct=function(F,A){if(this.op="distinct",this._validate(),!A&&typeof F==="string")A=F,F=void 0;if(typeof A=="string")this._distinctDoc=A;if(l.canMerge(F))this.merge(F);return this};l.prototype._distinct=async function F(){if(!this._distinctDoc)throw new Error("No value for `distinct` has been declared");let A=this._conditions,D=this._optionsForExec();return Q4("distinct",this._collection.collectionName,A,D),this._collection.distinct(this._distinctDoc,A,D)};l.prototype.updateMany=function F(A,D,Z){if(arguments.length===1)D=A,A=Z=void 0;return WK(this,"updateMany",A,D,Z)};l.prototype._updateMany=async function(){return CK(this,"updateMany")};l.prototype.updateOne=function F(A,D,Z){if(arguments.length===1)D=A,A=Z=void 0;return WK(this,"updateOne",A,D,Z)};l.prototype._updateOne=async function(){return CK(this,"updateOne")};l.prototype.replaceOne=function F(A,D,Z){if(arguments.length===1)D=A,A=Z=void 0;return this.setOptions({overwrite:!0}),WK(this,"replaceOne",A,D,Z)};l.prototype._replaceOne=async function(){return CK(this,"replaceOne")};/*!
783
+ * Internal helper for updateMany, updateOne
784
+ */function WK(F,A,D,Z,J){if(F.op=A,l.canMerge(D))F.merge(D);if(Z)F._mergeUpdate(Z);if(f1.isObject(J))F.setOptions(J);return F}async function CK(F,A){let D=F._optionsForExec(),Z=F._conditions,J=F._updateForExec();return Q4("update",F._collection.collectionName,Z,J,D),F._collection[A](Z,J,D)}l.prototype.deleteOne=function(F){if(this.op="deleteOne",l.canMerge(F))this.merge(F);return this};l.prototype._deleteOne=async function(){let F=this._optionsForExec();delete F.justOne;let A=this._conditions;return Q4("deleteOne",this._collection.collectionName,A,F),this._collection.deleteOne(A,F)};l.prototype.deleteMany=function(F){if(this.op="deleteMany",l.canMerge(F))this.merge(F);return this};l.prototype._deleteMany=async function(){let F=this._optionsForExec();delete F.justOne;let A=this._conditions;return Q4("deleteOne",this._collection.collectionName,A,F),this._collection.deleteMany(A,F)};l.prototype.findOneAndUpdate=function(F,A,D){if(this.op="findOneAndUpdate",this._validate(),arguments.length===1)A=F,F=D=void 0;if(l.canMerge(F))this.merge(F);if(A)this._mergeUpdate(A);return D&&this.setOptions(D),this};l.prototype._findOneAndUpdate=async function(){let F=this._conditions,A=this._updateForExec(),D=this._optionsForExec();return this._collection.findOneAndUpdate(F,A,D)};l.prototype.findOneAndRemove=l.prototype.findOneAndDelete=function(F,A){if(this.op="findOneAndRemove",this._validate(),l.canMerge(F))this.merge(F);return A&&this.setOptions(A),this};l.prototype._findOneAndRemove=async function(){let F=this._optionsForExec(),A=this._conditions;return this._collection.findOneAndDelete(A,F)};l.prototype.setTraceFunction=function(F){return this._traceFunction=F,this};l.prototype.exec=async function F(A){if(typeof A==="string")this.op=A;xU1.ok(this.op,"Missing query type: (find, etc)");let D="_"+this.op;if(typeof this[D]!=="function")throw new TypeError(`this[${D}] is not a function`);return this[D]()};l.prototype.then=async function(F,A){return this.exec().then(F,A)};l.prototype.cursor=function(){if(this.op!="find")throw new Error("cursor() is only available for find");let F=this._conditions,A=this._optionsForExec();if(this.$useProjection)A.projection=this._fieldsForExec();else A.fields=this._fieldsForExec();return Q4("cursor",this._collection.collectionName,F,A),this._collection.findCursor(F,A)};l.prototype.selected=function F(){return!!(this._fields&&Object.keys(this._fields).length>0)};l.prototype.selectedInclusively=function F(){if(!this._fields)return!1;let A=Object.keys(this._fields);if(A.length===0)return!1;for(let D=0;D<A.length;++D){let Z=A[D];if(this._fields[Z]===0)return!1;if(this._fields[Z]&&typeof this._fields[Z]==="object"&&this._fields[Z].$meta)return!1}return!0};l.prototype.selectedExclusively=function F(){if(!this._fields)return!1;let A=Object.keys(this._fields);if(A.length===0)return!1;for(let D=0;D<A.length;++D){let Z=A[D];if(this._fields[Z]===0)return!0}return!1};l.prototype._mergeUpdate=function(F){if(!this._updateDoc)this._updateDoc={};if(F instanceof l){if(F._updateDoc)f1.mergeClone(this._updateDoc,F._updateDoc)}else f1.mergeClone(this._updateDoc,F)};l.prototype._optionsForExec=function(){return f1.clone(this.options)};l.prototype._fieldsForExec=function(){return f1.clone(this._fields)};l.prototype._updateForExec=function(){let F=f1.clone(this._updateDoc),A=f1.keys(F),D={};for(let Z of A){if(this.options.overwrite){D[Z]=F[Z];continue}if(Z[0]!=="$"){if(!D.$set)if(F.$set)D.$set=F.$set;else D.$set={};if(D.$set[Z]=F[Z],!~A.indexOf("$set"))A.push("$set")}else if(Z==="$set"){if(!D.$set)D[Z]=F[Z]}else D[Z]=F[Z]}return this._compiledUpdate=D,D};l.prototype._ensurePath=function(F){if(!this._path){let A=F+"() must be used after where() when called with these arguments";throw new Error(A)}};/*!
785
+ * Permissions
786
+ */l.permissions=nm();l._isPermitted=function(F,A){let D=l.permissions[A];if(!D)return!0;return D[F]!==!0};l.prototype._validate=function(F){let A,D;if(F===void 0){if(D=l.permissions[this.op],typeof D!="function")return!0;A=D(this)}else if(!l._isPermitted(F,this.op))A=F;if(A)throw new Error(A+" cannot be used with "+this.op)};l.canMerge=function(F){return F instanceof l||f1.isObject(F)};l.setGlobalTraceFunction=function(F){l.traceFunction=F};/*!
787
+ * Exports.
788
+ */l.utils=f1;l.env=YK();l.Collection=Jd();l.BaseCollection=LA();Yd.exports=$d=l});var KK=E((vO1,Gd)=>{Gd.exports=function F(A,D){if(typeof A==="string")A=A.split(/\s+/);if(!Array.isArray(A)&&Object.prototype.toString.call(A)!=="[object Arguments]")return A;let J=A.length,X={};for(let $=0;$<J;++$){let G=A[$];if(!G)continue;let Y=G[0]=="-"?0:1;if(!D&&Y===0)G=G.substring(1);X[G]=Y}return X}});var qd=E((mO1,Hd)=>{Hd.exports=function F(A,D){let Z=Object.keys(A).map((J)=>Object.keys(A[J])).reduce((J,X)=>J.concat(X),[]);return D.filter((J)=>{return Bd(J,Z)})};function Bd(F,A){let D=Object.keys(F)[0];if(D==="$and"||D==="$or"){if(!Array.isArray(F[D]))return!1;return F[D].find((X)=>Bd(X,A))!=null}let Z=D.indexOf("."),J=Z===-1?D:D.slice(0,Z);return A.find((X)=>X.includes("$["+J+"]"))!=null}});var IX=E((dO1,Wd)=>{/*!
789
+ * ignore
790
+ */Wd.exports=function F(A){if(typeof A!=="object"||A===null)return!1;let D=Object.keys(A),Z=D.length;for(let J=0;J<Z;++J)if(D[J][0]==="$")return!0;return!1}});var EK=E((cO1,Cd)=>{var bU1=IX(),{trustedSymbol:hU1}=w8();Cd.exports=function F(A){if(A==null||typeof A!=="object")return A;if(Array.isArray(A)){for(let Z of A)F(Z);return A}let D=Object.keys(A);for(let Z of D){let J=A[Z];if(J!=null&&J[hU1])continue;if(Z==="$and"||Z==="$or"){F(J);continue}if(bU1(J)){let X=Object.keys(J);if(X.length===1&&X[0]==="$eq")continue;A[Z]={$eq:A[Z]}}}return A}});var Kd=E((lO1,Qd)=>{Qd.exports=function F(A){if(A==null)return;let D=Object.keys(A);for(let Z=0;Z<D.length;++Z)if(typeof A[D[Z]]==="string")A[D[Z]]=1}});var zd=E((pO1,Ud)=>{var vU1=u8(),mU1=EX();/*!
791
+ * ignore
792
+ */Ud.exports=function F(A,D,Z){if(Z==null)return;let J=Object.keys(Z);if(D=D||{},mU1(A))for(let X of J){if(!Ed(D,X))A[X]=1;else if(D[X]===0)delete A[X];let $=Z[X]?.refPath;if(typeof $==="string"){if(!Ed(D,$))A[$]=1;else if(D[$]===0)delete A[$]}}else if(vU1(A))for(let X of J){if(D[X]==null)delete A[X];let $=Z[X]?.refPath;if(typeof $==="string"&&D[$]==null)delete A[$]}};/*!
793
+ * ignore
794
+ */function Ed(F,A){let D=A.split("."),Z=D.length,J=D[0];for(let X=1;X<Z;++X){if(F[J]!=null||F[J+".$"]!=null)return!0;J+="."+D[X]}return F[J]!=null||F[J+".$"]!=null}});var Pd=E((iO1,wd)=>{/*!
795
+ * Module dependencies.
796
+ */var Vd=c9(),dU1=rF(),Ld=S8().flatten,Rd=S8().modifiedPaths;wd.exports=function(F,A,D,Z,J){let X=Object.keys(D||{}),$={},G={},Y={},B={},H=X.length,q=!1,W={},C,Q,K;for(K=0;K<H;++K)if(X[K].startsWith("$")){if(q=!0,X[K]==="$push"||X[K]==="$addToSet"){let c=Object.keys(D[X[K]]);for(let r=0;r<c.length;++r)if(C=D[X[K]][c[r]],C&&C.$each)B[c[r]]=(B[c[r]]||[]).concat(C.$each);else B[c[r]]=(B[c[r]]||[]).concat([C]);continue}Rd(D[X[K]],"",W);let R=Ld(D[X[K]],null,null,A),S=Object.keys(R),u=S.length;for(let c=0;c<u;++c){let r=dU1(S[c]);if(Q=X[K],r.includes("$"))continue;if(Q==="$set"||Q==="$setOnInsert"||Q==="$pull"||Q==="$pullAll")G[r]=R[S[c]],Y[r]=Q==="$pull"||Q==="$pullAll";else if(Q==="$unset")G[r]=void 0;$[r]=!0}}if(!q)Rd(D,"",W),G=Ld(D,null,null,A),$=Object.keys(G);let U=Object.keys(G),z=U.length,L=[],V=[],P=[],I=F;function M(R,S){let u=A._getSchema(U[R]);if(u==null)return;if(u.instance==="Mixed"&&u.path!==U[R])return;if(S&&Array.isArray(S.$in))S.$in.forEach((c,r)=>{L.push(function(J0){u.doValidate(c,function(d0){if(d0)d0.path=U[r]+".$in."+r,V.push(d0);J0(null)},I,{updateValidator:!0})})});else{if(Y[U[R]]&&u.$isMongooseArray)return;if(u.$isMongooseDocumentArrayElement&&S!=null&&S.$__!=null)P.push(U[R]),L.push(function(c){u.doValidate(S,function(r){if(r)if(r.errors)for(let J0 of Object.keys(r.errors)){let d0=r.errors[J0];d0.path=U[R]+"."+J0,V.push(d0)}else r.path=U[R],V.push(r);return c(null)},I,{updateValidator:!0})});else L.push(function(c){for(let r of P)if(U[R].startsWith(r+"."))return c(null);u.doValidate(S,function(r){if(u.schema!=null&&u.schema.options.storeSubdocValidationError===!1&&r instanceof Vd)return c(null);if(r)r.path=U[R],V.push(r);c(null)},I,{updateValidator:!0})})}}for(K=0;K<z;++K)M(K,G[U[K]]);let x=Object.keys(B);for(let R of x){let S=A._getSchema(R);if(S&&S.$isMongooseDocumentArray)L.push(function(u){S.doValidate(B[R],O(R,V,u),Z&&Z.context==="query"?F:null)});else{S=A._getSchema(R+".0");for(let u of B[R])L.push(function(c){S.doValidate(u,O(R,V,c),Z&&Z.context==="query"?F:null,{updateValidator:!0})})}}if(J!=null){let R=L.length;if(R===0)return _(J);for(let S of L)S(function(){if(--R<=0)_(J)});return}return function(R){let S=L.length;if(S===0)return _(R);for(let u of L)u(function(){if(--S<=0)_(R)})};function _(R){if(V.length){let S=new Vd(null);for(let u of V)S.addError(u.path,u);return R(S)}R(null)}function O(R,S,u){return function(c){if(c)c.path=R,S.push(c);u(null)}}}});var jX=E((aO1,fd)=>{/*!
797
+ * Module dependencies.
798
+ */var wA=E2(),cU1=lZ(),zK=m9(),w2=w1(),F9=oZ(),Id=Km(),Md=c9(),{applyGlobalMaxTimeMS:PA,applyGlobalDiskUse:IA}=FK(),lU1=QC(),pU1=AK(),iU1=DK(),aU1=t9(),nU1=km(),NX=eF(),sU1=hQ(),A6=K0(),rU1=d6(),MA=cF(),tU1=H3().internalToObjectOptions,oU1=u8(),eU1=EX(),Fz1=XJ(),Nd=_m(),Td=z6(),L6=QK(),Az1=KK(),Dz1=qd(),Zz1=EK(),Jz1=Kd(),Xz1=zd(),kd=mQ(),MX=v9(),$z1=Pd(),RA=i("node:util"),Z0=q1(),Yz1=NJ().queryMiddlewareFunctions,Gz1=new Set(["allowDiskUse","batchSize","collation","comment","explain","hint","j","lean","limit","maxTimeMS","populate","projection","read","select","skip","slice","sort","tailable","w","writeConcern","wtimeout"]),Bz1=new Map([["countDocuments","_countDocuments"],["distinct","__distinct"],["estimatedDocumentCount","_estimatedDocumentCount"],["find","_find"],["findOne","_findOne"],["findOneAndReplace","_findOneAndReplace"],["findOneAndUpdate","_findOneAndUpdate"],["replaceOne","_replaceOne"],["updateMany","_updateMany"],["updateOne","_updateOne"],["deleteMany","_deleteMany"],["deleteOne","_deleteOne"],["findOneAndDelete","_findOneAndDelete"]]);function d(F,A,D,Z){if(!this._mongooseOptions)this._mongooseOptions={};A=A||{},this._transforms=[],this._hooks=new zK,this._executionStack=null;let J=Object.keys(A);for(let $ of J)this._mongooseOptions[$]=A[$];if(Z)this.mongooseCollection=Z;if(D)this.model=D,this.schema=D.schema;if(this.model&&this.model._mapreduce)this.lean();if(L6.call(this,null,A),Z)this.collection(Z);if(F)this.find(F);this.options=this.options||{},this.$useProjection=!0;let X=this&&this.schema&&this.schema.options&&this.schema.options.collation||null;if(X!=null)this.options.collation=X}/*!
799
+ * inherit mquery
800
+ */d.prototype=new L6;d.prototype.constructor=d;d.prototype.count=void 0;d.prototype.findOneAndRemove=void 0;d.base=L6.prototype;/*!
801
+ * Overwrite mquery's `_distinct`, because Mongoose uses that name
802
+ * to store the field to apply distinct on.
803
+ */Object.defineProperty(d.prototype,"_distinct",{configurable:!0,writable:!0,enumerable:!0,value:void 0});d.use$geoWithin=L6.use$geoWithin;d.prototype.toConstructor=function F(){let A=this.model,D=this.mongooseCollection,Z=function($,G){if(!(this instanceof Z))return new Z($,G);this._mongooseOptions=A6(J._mongooseOptions),d.call(this,$,G||null,A,D)};RA.inherits(Z,A.Query);let J=Z.prototype;J.options={};let X=Object.assign({},this.options);if(X.sort!=null)J.sort(X.sort),delete X.sort;return J.setOptions(X),J.op=this.op,J._validateOp(),J._conditions=A6(this._conditions),J._fields=A6(this._fields),J._update=A6(this._update,{flattenDecimals:!1}),J._path=this._path,J._distinct=this._distinct,J._collection=this._collection,J._mongooseOptions=this._mongooseOptions,Z};d.prototype.clone=function(){let F=this.model,A=this.mongooseCollection,D=new this.model.Query({},{},F,A),Z=Object.assign({},this.options);if(Z.sort!=null)D.sort(Z.sort),delete Z.sort;return D.setOptions(Z),D.op=this.op,D._validateOp(),D._conditions=A6(this._conditions),D._fields=A6(this._fields),D._update=A6(this._update,{flattenDecimals:!1}),D._path=this._path,D._distinct=this._distinct,D._collection=this._collection,D._mongooseOptions=this._mongooseOptions,D};d.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let F,A;if(arguments.length===1){let Z=arguments[0];if(typeof Z==="object"&&!Array.isArray(Z)){let J=Object.keys(Z),X=J.length;for(let $=0;$<X;++$)this.slice(J[$],Z[J[$]]);return this}this._ensurePath("slice"),F=this._path,A=arguments[0]}else if(arguments.length===2)if(typeof arguments[0]==="number")this._ensurePath("slice"),F=this._path,A=[arguments[0],arguments[1]];else F=arguments[0],A=arguments[1];else if(arguments.length===3)F=arguments[0],A=[arguments[1],arguments[2]];let D={};return D[F]={$slice:A},this.select(D),this};/*!
804
+ * ignore
805
+ */var Hz1=new Set(Yz1);d.prototype._validateOp=function(){if(this.op!=null&&!Hz1.has(this.op))this.error(new Error('Query has invalid `op`: "'+this.op+'"'))};d.prototype.mod=function(){let F,A;if(arguments.length===1)this._ensurePath("mod"),F=arguments[0],A=this._path;else if(arguments.length===2&&!Array.isArray(arguments[1]))this._ensurePath("mod"),F=[arguments[0],arguments[1]],A=this._path;else if(arguments.length===3)F=[arguments[1],arguments[2]],A=arguments[0];else F=arguments[1],A=arguments[0];let D=this._conditions[A]||(this._conditions[A]={});return D.$mod=F,this};d.prototype.limit=function F(A){if(this._validate("limit"),typeof A==="string")try{A=NX(A)}catch(D){throw new wA("Number",A,"limit")}return this.options.limit=A,this};d.prototype.skip=function F(A){if(this._validate("skip"),typeof A==="string")try{A=NX(A)}catch(D){throw new wA("Number",A,"skip")}return this.options.skip=A,this};d.prototype.projection=function(F){if(arguments.length===0)return this._fields;return this._fields={},this._userProvidedFields={},this.select(F),this._fields};d.prototype.select=function F(){let A=arguments[0];if(!A)return this;if(arguments.length!==1)throw new Error("Invalid select: select only takes 1 argument");this._validate("select");let D=this._fields||(this._fields={}),Z=this._userProvidedFields||(this._userProvidedFields={}),J=void 0;if(this.model!=null&&Z0.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))J=this.model.db.options.sanitizeProjection;else if(this.model!=null&&Z0.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))J=this.model.base.options.sanitizeProjection;else J=this._mongooseOptions.sanitizeProjection;function X($){return typeof $==="string"&&J?$=1:$}if(A=Az1(A,!0),Z0.isObject(A)){if(this.selectedInclusively())Object.entries(A).forEach(([$,G])=>{if(G){if(D["-"+$]!=null)delete D["-"+$];D[$]=Z[$]=X(G)}else Object.keys(Z).forEach((Y)=>{if(Nd($,Y))delete D[Y],delete Z[Y]})});else if(this.selectedExclusively())Object.entries(A).forEach(([$,G])=>{if(!G){if(D["+"+$]!=null)delete D["+"+$];D[$]=Z[$]=X(G)}else Object.keys(Z).forEach((Y)=>{if(Nd($,Y))delete D[Y],delete Z[Y]})});else{let $=Object.keys(A);for(let G=0;G<$.length;++G){let Y=A[$[G]],B=$[G];D[B]=X(Y),Z[B]=X(Y)}}return this}throw new TypeError("Invalid select() argument. Must be string or object.")};d.prototype.schemaLevelProjections=function F(A){return this._mongooseOptions.schemaLevelProjections=A,this};d.prototype.sanitizeProjection=function F(A){return this._mongooseOptions.sanitizeProjection=A,this};d.prototype.read=function F(A,D){if(typeof A==="string")A=lU1(A),this.options.readPreference={mode:A,tags:D};else this.options.readPreference=A;return this};d.prototype.toString=function F(){if(this.op==="count"||this.op==="countDocuments"||this.op==="find"||this.op==="findOne"||this.op==="deleteMany"||this.op==="deleteOne"||this.op==="findOneAndDelete"||this.op==="remove")return`${this.model.modelName}.${this.op}(${RA.inspect(this._conditions)})`;if(this.op==="distinct")return`${this.model.modelName}.distinct('${this._distinct}', ${RA.inspect(this._conditions)})`;if(this.op==="findOneAndReplace"||this.op==="findOneAndUpdate"||this.op==="replaceOne"||this.op==="update"||this.op==="updateMany"||this.op==="updateOne")return`${this.model.modelName}.${this.op}(${RA.inspect(this._conditions)}, ${RA.inspect(this._update)})`;return`${this.model.modelName}.${this.op}()`};d.prototype.session=function F(A){if(A==null)delete this.options.session;return this.options.session=A,this};d.prototype.writeConcern=function F(A){if(A==null)return delete this.options.writeConcern,this;return this.options.writeConcern=A,this};d.prototype.w=function F(A){if(A==null)delete this.options.w;if(this.options.writeConcern!=null)this.options.writeConcern.w=A;else this.options.w=A;return this};d.prototype.j=function F(A){if(A==null)delete this.options.j;if(this.options.writeConcern!=null)this.options.writeConcern.j=A;else this.options.j=A;return this};d.prototype.wtimeout=function F(A){if(A==null)delete this.options.wtimeout;if(this.options.writeConcern!=null)this.options.writeConcern.wtimeout=A;else this.options.wtimeout=A;return this};d.prototype.getOptions=function(){return this.options};d.prototype.setOptions=function(F,A){if(A){if(this._mongooseOptions=F&&A6(F)||{},this.options=F||{},"populate"in F)this.populate(this._mongooseOptions);return this}if(F==null)return this;if(typeof F!=="object")throw new Error('Options must be an object, got "'+F+'"');if(F=Object.assign({},F),Array.isArray(F.populate)){let D=F.populate;delete F.populate;let Z=D.length;for(let J=0;J<Z;++J)this.populate(D[J])}if("setDefaultsOnInsert"in F)this._mongooseOptions.setDefaultsOnInsert=F.setDefaultsOnInsert,delete F.setDefaultsOnInsert;if("overwriteDiscriminatorKey"in F)this._mongooseOptions.overwriteDiscriminatorKey=F.overwriteDiscriminatorKey,delete F.overwriteDiscriminatorKey;if("overwriteImmutable"in F)this._mongooseOptions.overwriteImmutable=F.overwriteImmutable,delete F.overwriteImmutable;if("sanitizeProjection"in F){if(F.sanitizeProjection&&!this._mongooseOptions.sanitizeProjection)Jz1(this._fields);this._mongooseOptions.sanitizeProjection=F.sanitizeProjection,delete F.sanitizeProjection}if("sanitizeFilter"in F)this._mongooseOptions.sanitizeFilter=F.sanitizeFilter,delete F.sanitizeFilter;if("timestamps"in F)this._mongooseOptions.timestamps=F.timestamps,delete F.timestamps;if("defaults"in F)this._mongooseOptions.defaults=F.defaults;if("translateAliases"in F)this._mongooseOptions.translateAliases=F.translateAliases,delete F.translateAliases;if("schemaLevelProjections"in F)this._mongooseOptions.schemaLevelProjections=F.schemaLevelProjections,delete F.schemaLevelProjections;if(F.lean==null&&this.schema&&"lean"in this.schema.options)this._mongooseOptions.lean=this.schema.options.lean;if(typeof F.limit==="string")try{F.limit=NX(F.limit)}catch(D){throw new wA("Number",F.limit,"limit")}if(typeof F.skip==="string")try{F.skip=NX(F.skip)}catch(D){throw new wA("Number",F.skip,"skip")}for(let D of Object.keys(F))if(Gz1.has(D)){let Z=Array.isArray(F[D])?F[D]:[F[D]];this[D].apply(this,Z)}else this.options[D]=F[D];return this};d.prototype.explain=function F(A){if(arguments.length===0)this.options.explain=!0;else if(A===!1)delete this.options.explain;else this.options.explain=A;return this};d.prototype.allowDiskUse=function(F){if(arguments.length===0)this.options.allowDiskUse=!0;else if(F===!1)delete this.options.allowDiskUse;else this.options.allowDiskUse=F;return this};d.prototype.maxTimeMS=function(F){return this.options.maxTimeMS=F,this};d.prototype.getFilter=function(){return this._conditions};d.prototype.getQuery=function(){return this._conditions};d.prototype.setQuery=function(F){this._conditions=F};d.prototype.getUpdate=function(){return this._update};d.prototype.setUpdate=function(F){this._update=F};d.prototype._fieldsForExec=function(){if(this._fields==null)return null;if(Object.keys(this._fields).length===0)return null;return A6(this._fields)};d.prototype._updateForExec=function(){let F=A6(this._update,{transform:!1,depopulate:!0}),A=Object.keys(F),D=A.length,Z={};while(D--){let J=A[D];if(J[0]!=="$"){if(!Z.$set)if(F.$set)Z.$set=F.$set;else Z.$set={};if(Z.$set[J]=F[J],A.splice(D,1),!~A.indexOf("$set"))A.push("$set")}else if(J==="$set"){if(!Z.$set)Z[J]=F[J]}else Z[J]=F[J]}return Z};d.prototype._optionsForExec=function(F){let A=A6(this.options);if(delete A.populate,F=F||this.model,!F)return A;pU1(F.schema,A),iU1(F.schema,A);let D=this.model?.db?.base.transactionAsyncLocalStorage?.getStore();if(!this.options.hasOwnProperty("session")&&D?.session!=null)A.session=D.session;let Z=F&&F.schema&&F.schema.options&&F.schema.options.read;if(!("readPreference"in A)&&Z)A.readPreference=Z;if(A.upsert!==void 0)A.upsert=!!A.upsert;if(A.writeConcern){if(A.j)A.writeConcern.j=A.j,delete A.j;if(A.w)A.writeConcern.w=A.w,delete A.w;if(A.wtimeout)A.writeConcern.wtimeout=A.wtimeout,delete A.wtimeout}if(this._applyPaths(),this._fields!=null){this._fields=this._castFields(this._fields);let J=this._fieldsForExec();if(J!=null)A.projection=J}return A};d.prototype.lean=function(F){return this._mongooseOptions.lean=arguments.length?F:!0,this};d.prototype.set=function(F,A){if(typeof F==="object"){let D=Object.keys(F);for(let Z of D)this.set(Z,F[Z]);return this}if(this._update=this._update||{},F in this._update)delete this._update[F];return this._update.$set=this._update.$set||{},this._update.$set[F]=A,this};d.prototype.get=function F(A){let D=this._update;if(D==null)return;let Z=D.$set;if(Z==null)return D[A];if(Z0.hasUserDefinedProperty(D,A))return D[A];if(Z0.hasUserDefinedProperty(Z,A))return Z[A];return};d.prototype.error=function F(A){if(arguments.length===0)return this._error;return this._error=A,this};d.prototype._unsetCastError=function F(){if(this._error==null||!(this._error instanceof wA))return;return this.error(null)};d.prototype.mongooseOptions=function(F){if(arguments.length>0)this._mongooseOptions=F;return this._mongooseOptions};d.prototype._castConditions=function(){let F=void 0;if(this.model?.db.options?.sanitizeFilter!=null)F=this.model.db.options.sanitizeFilter;else if(this.model?.base.options?.sanitizeFilter!=null)F=this.model.base.options.sanitizeFilter;else F=this._mongooseOptions.sanitizeFilter;if(F)Zz1(this._conditions);try{this.cast(this.model),this._unsetCastError()}catch(A){this.error(A)}};/*!
806
+ * ignore
807
+ */function Od(F){try{nU1(F)}catch(A){F.error(A)}}d.prototype._find=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let A=this._mongooseOptions,D=this._userProvidedFields||{};PA(this.options,this.model.db.options,this.model.base.options),IA(this.options,this.model.db.options,this.model.base.options);let Z={session:this&&this.options&&this.options.session||null,lean:A.lean||null},J=this._optionsForExec(),X=this._conditions,$=J.projection,G=await this.mongooseCollection.find(X,J);if(J.explain)return G.explain();let Y=await G.toArray();if(Y.length===0)return Y;if(!A.populate){let H=this.schema.options.versionKey;if(A.lean&&A.lean.versionKey===!1&&H)Y.forEach((q)=>{if(H in q)delete q[H]});return A.lean?_d(this.model.schema,Y,null,Z):this._completeMany(Y,$,D,Z)}let B=MA.preparePopulationOptionsMQ(this,A);if(A.lean)return this.model.populate(Y,B);return Y=await this._completeMany(Y,$,D,Z),await this.model.populate(Y,B),Y};d.prototype.find=function(F){if(typeof F==="function"||typeof arguments[1]==="function")throw new w2("Query.prototype.find() no longer accepts a callback");if(this.op="find",L6.canMerge(F))this.merge(F),NA(this);else if(F!=null)this.error(new F9(F,"filter","find"));return this};d.prototype.merge=function(F){if(!F)return this;let A={overwrite:!0};if(F instanceof d){if(F._conditions){if(A.omit={},this._conditions&&this._conditions.$and&&F._conditions.$and)A.omit.$and=!0,this._conditions.$and=this._conditions.$and.concat(F._conditions.$and);if(this._conditions&&this._conditions.$or&&F._conditions.$or)A.omit.$or=!0,this._conditions.$or=this._conditions.$or.concat(F._conditions.$or);Z0.merge(this._conditions,F._conditions,A)}if(F._fields)this._fields||(this._fields={}),Z0.merge(this._fields,F._fields,A);if(F.options)this.options||(this.options={}),Z0.merge(this.options,F.options,A);if(F._update)this._update||(this._update={}),Z0.mergeClone(this._update,F._update);if(F._distinct)this._distinct=F._distinct;return Z0.merge(this._mongooseOptions,F._mongooseOptions),this}else if(this.model!=null&&F instanceof this.model.base.Types.ObjectId)return Z0.merge(this._conditions,{_id:F},A),this;else if(F&&F.$__)F=F.toObject(tU1);if(A.omit={},Array.isArray(F.$and)){if(A.omit.$and=!0,!this._conditions)this._conditions={};this._conditions.$and=(this._conditions.$and||[]).concat(F.$and.map((D)=>Z0.isPOJO(D)?Z0.merge({},D):D))}if(Array.isArray(F.$or)){if(A.omit.$or=!0,!this._conditions)this._conditions={};this._conditions.$or=(this._conditions.$or||[]).concat(F.$or.map((D)=>Z0.isPOJO(D)?Z0.merge({},D):D))}return Z0.merge(this._conditions,F,A),this};d.prototype.collation=function(F){if(this.options==null)this.options={};return this.options.collation=F,this};d.prototype._completeOne=function(F,A,D,Z){if(!F&&!this.options.includeResultMetadata)return Z(null,null);let J=this.model,X=this._userProvidedFields||{},$=this._mongooseOptions,G=this.options;if(!G.lean&&$.lean)G.lean=$.lean;if(G.explain)return Z(null,F);if(!$.populate){let B=this.schema.options.versionKey;if($.lean&&$.lean.versionKey===!1&&B){if(B in F)delete F[B]}return $.lean?VK(J.schema,F,null,A,G,Z):jd(J,F,A,G,D,X,null,Z)}let Y=MA.preparePopulationOptionsMQ(this,this._mongooseOptions);if($.lean)return J.populate(F,Y).then((B)=>{VK(J.schema,B,null,A,G,Z)},(B)=>{Z(B)});jd(J,F,A,G,D,X,[],(B,H)=>{if(B!=null)return Z(B);J.populate(H,Y).then((q)=>{Z(null,q)},(q)=>{Z(q)})})};d.prototype._completeMany=async function F(A,D,Z,J){let X=this.model;return Promise.all(A.map(($)=>new Promise((G,Y)=>{let B=$;if($=MA.createModel(X,$,D,Z),J.session!=null)$.$session(J.session);$.$init(B,J,(H)=>{if(H!=null)return Y(H);G($)})})))};d.prototype._findOne=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();PA(this.options,this.model.db.options,this.model.base.options),IA(this.options,this.model.db.options,this.model.base.options);let A=this._optionsForExec(),D=await this.mongooseCollection.findOne(this._conditions,A);return new Promise((Z,J)=>{this._completeOne(D,null,A.projection,(X,$)=>{if(X)return J(X);Z($)})})};d.prototype.findOne=function(F,A,D){if(typeof F==="function"||typeof A==="function"||typeof D==="function"||typeof arguments[3]==="function")throw new w2("Query.prototype.findOne() no longer accepts a callback");if(this.op="findOne",this._validateOp(),D)this.setOptions(D);if(A)this.select(A);if(L6.canMerge(F))this.merge(F),NA(this);else if(F!=null)this.error(new F9(F,"filter","findOne"));return this};d.prototype._countDocuments=async function F(){this._applyTranslateAliases();try{this.cast(this.model)}catch(Z){this.error(Z)}if(this.error())throw this.error();PA(this.options,this.model.db.options,this.model.base.options),IA(this.options,this.model.db.options,this.model.base.options);let A=this._optionsForExec(),D=this._conditions;return this.mongooseCollection.countDocuments(D,A)};/*!
808
+ * If `translateAliases` option is set, call `Model.translateAliases()`
809
+ * on the following query properties: filter, projection, update, distinct.
810
+ */d.prototype._applyTranslateAliases=function F(){let A=!1;if("translateAliases"in this._mongooseOptions)A=this._mongooseOptions.translateAliases;else if(this.model?.schema?._userProvidedOptions?.translateAliases!=null)A=this.model.schema._userProvidedOptions.translateAliases;else if(this.model?.base?.options?.translateAliases!=null)A=this.model.base.options.translateAliases;if(!A)return;if(this.model?.schema?.aliases&&Object.keys(this.model.schema.aliases).length>0){if(this.model.translateAliases(this._conditions,!0),this.model.translateAliases(this._fields,!0),this.model.translateAliases(this._update,!0),this._distinct!=null&&this.model.schema.aliases[this._distinct]!=null)this._distinct=this.model.schema.aliases[this._distinct]}};d.prototype._estimatedDocumentCount=async function F(){if(this.error())throw this.error();let A=this._optionsForExec();return this.mongooseCollection.estimatedDocumentCount(A)};d.prototype.estimatedDocumentCount=function(F){if(typeof F==="function"||typeof arguments[1]==="function")throw new w2("Query.prototype.estimatedDocumentCount() no longer accepts a callback");if(this.op="estimatedDocumentCount",this._validateOp(),F!=null)this.setOptions(F);return this};d.prototype.countDocuments=function(F,A){if(typeof F==="function"||typeof A==="function"||typeof arguments[2]==="function")throw new w2("Query.prototype.countDocuments() no longer accepts a callback");if(this.op="countDocuments",this._validateOp(),L6.canMerge(F))this.merge(F);if(A!=null)this.setOptions(A);return this};d.prototype.__distinct=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();PA(this.options,this.model.db.options,this.model.base.options),IA(this.options,this.model.db.options,this.model.base.options);let A=this._optionsForExec();return this.mongooseCollection.distinct(this._distinct,this._conditions,A)};d.prototype.distinct=function(F,A,D){if(typeof F==="function"||typeof A==="function"||typeof D==="function"||typeof arguments[3]==="function")throw new w2("Query.prototype.distinct() no longer accepts a callback");if(this.op="distinct",this._validateOp(),L6.canMerge(A))this.merge(A),NA(this);else if(A!=null)this.error(new F9(A,"filter","distinct"));if(F!=null)this._distinct=F;if(D!=null)this.setOptions(D);return this};d.prototype.sort=function(F,A){if(arguments.length>2)throw new Error("sort() takes at most 2 arguments");if(A!=null&&typeof A!=="object")throw new Error("sort() options argument must be an object or nullish");if(this.options.sort==null)this.options.sort={};if(A&&A.override)this.options.sort={};let D=this.options.sort;if(typeof F==="string"){let Z=F.indexOf(" ")===-1?[F]:F.split(" ");for(let J of Z){let X=J[0]=="-"?-1:1;if(X===-1)J=J.slice(1);if(MX.has(J))continue;D[J]=X}}else if(Array.isArray(F))for(let Z of F){if(!Array.isArray(Z))throw new TypeError("Invalid sort() argument, must be array of arrays");let J=""+Z[0];if(MX.has(J))continue;D[J]=UK(Z[1],J)}else if(typeof F==="object"&&F!=null&&!(F instanceof Map))for(let Z of Object.keys(F)){if(MX.has(Z))continue;D[Z]=UK(F[Z],Z)}else if(F instanceof Map)for(let Z of F.keys()){if(Z=""+Z,MX.has(Z))continue;D[Z]=UK(F.get(Z),Z)}else if(F!=null)throw new TypeError("Invalid sort() argument. Must be a string, object, array, or map.");return this};/*!
811
+ * Convert sort values
812
+ */function UK(F,A){if(F===1||F==="asc"||F==="ascending")return 1;if(F===-1||F==="desc"||F==="descending")return-1;if(F?.$meta!=null)return{$meta:F.$meta};throw new TypeError("Invalid sort value: { "+A+": "+F+" }")}d.prototype.deleteOne=function F(A,D){if(typeof A==="function"||typeof D==="function"||typeof arguments[2]==="function")throw new w2("Query.prototype.deleteOne() no longer accepts a callback");if(this.op="deleteOne",this.setOptions(D),L6.canMerge(A))this.merge(A),NA(this);else if(A!=null)this.error(new F9(A,"filter","deleteOne"));return this};d.prototype._deleteOne=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let A=this._optionsForExec();return this.mongooseCollection.deleteOne(this._conditions,A)};d.prototype.deleteMany=function(F,A){if(typeof F==="function"||typeof A==="function"||typeof arguments[2]==="function")throw new w2("Query.prototype.deleteMany() no longer accepts a callback");if(this.setOptions(A),this.op="deleteMany",L6.canMerge(F))this.merge(F),NA(this);else if(F!=null)this.error(new F9(F,"filter","deleteMany"));return this};d.prototype._deleteMany=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let A=this._optionsForExec();return this.mongooseCollection.deleteMany(this._conditions,A)};function jd(F,A,D,Z,J,X,$,G){if(Z.includeResultMetadata&&A==null)return Y(null),null;MA.createModelAndInit(F,A,J,X,Z,$,Y);function Y(B,H){if(B)return G(B);if(Z.includeResultMetadata){if(A&&H){if(Z.session!=null)H.$session(Z.session);D.value=H}else D.value=null;return G(null,D)}if(Z.session!=null)H.$session(Z.session);G(null,H)}}function NA(F){if(!F||!F.model||!F.model.schema)return;let A=F.model.schema;if(A&&A.discriminatorMapping&&!A.discriminatorMapping.isRoot)F._conditions[A.discriminatorMapping.key]=A.discriminatorMapping.value}d.prototype.findOneAndUpdate=function(F,A,D){if(typeof F==="function"||typeof A==="function"||typeof D==="function"||typeof arguments[3]==="function")throw new w2("Query.prototype.findOneAndUpdate() no longer accepts a callback");switch(this.op="findOneAndUpdate",this._validateOp(),this._validate(),arguments.length){case 2:D=void 0;break;case 1:A=F,F=D=void 0;break}if(L6.canMerge(F))this.merge(F);else if(F!=null)this.error(new F9(F,"filter","findOneAndUpdate"));if(A)this._mergeUpdate(A);if(D=D?A6(D):{},D.projection)this.select(D.projection),delete D.projection;if(D.fields)this.select(D.fields),delete D.fields;let Z=this&&this.model&&this.model.base&&this.model.base.options&&this.model.base.options.returnOriginal;if(D.new==null&&D.returnDocument==null&&D.returnOriginal==null&&Z!=null)D.returnOriginal=Z;return this.setOptions(D),this};d.prototype._findOneAndUpdate=async function F(){if(this._applyTranslateAliases(),this._castConditions(),Od(this),this.error())throw this.error();if(PA(this.options,this.model.db.options,this.model.base.options),IA(this.options,this.model.db.options,this.model.base.options),"strict"in this.options)this._mongooseOptions.strict=this.options.strict;let A=this._optionsForExec(this.model);Sd(A),this._update=this._castUpdate(this._update);let D=Object.assign({},A,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});if(this._update=kd(this._conditions,this.model.schema,this._update,D),!this._update||Object.keys(this._update).length===0)if(A.upsert){let $=A6(this._update);delete $._id,this._update={$set:$}}else return this._executionStack=null,await this._findOne();else if(this._update instanceof Error)throw this._update;else if(this._update.$set&&Object.keys(this._update.$set).length===0)delete this._update.$set;if(LK(this,"runValidators",!1))await this.validate(this._update,A,!1);if(this._update.toBSON)this._update=this._update.toBSON();let J=await this.mongooseCollection.findOneAndUpdate(this._conditions,this._update,A);for(let $ of this._transforms)J=$(J);let X=!A.includeResultMetadata?J:J.value;return new Promise(($,G)=>{this._completeOne(X,J,A.projection,(Y,B)=>{if(Y)return G(Y);$(B)})})};d.prototype.findOneAndDelete=function(F,A){if(typeof F==="function"||typeof A==="function"||typeof arguments[2]==="function")throw new w2("Query.prototype.findOneAndDelete() no longer accepts a callback");if(this.op="findOneAndDelete",this._validateOp(),this._validate(),L6.canMerge(F))this.merge(F);return A&&this.setOptions(A),this};d.prototype._findOneAndDelete=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let A=this.options.includeResultMetadata,D=this._conditions,Z=this._optionsForExec(this.model),J=await this.mongooseCollection.findOneAndDelete(D,Z);for(let $ of this._transforms)J=$(J);let X=!A?J:J.value;return new Promise(($,G)=>{this._completeOne(X,J,Z.projection,(Y,B)=>{if(Y)return G(Y);$(B)})})};d.prototype.findOneAndReplace=function(F,A,D){if(typeof F==="function"||typeof A==="function"||typeof D==="function"||typeof arguments[4]==="function")throw new w2("Query.prototype.findOneAndReplace() no longer accepts a callback");if(this.op="findOneAndReplace",this._validateOp(),this._validate(),L6.canMerge(F))this.merge(F);else if(F!=null)this.error(new F9(F,"filter","findOneAndReplace"));if(A!=null)this._mergeUpdate(A);D=D||{};let Z=this&&this.model&&this.model.base&&this.model.base.options&&this.model.base.options.returnOriginal;if(D.new==null&&D.returnDocument==null&&D.returnOriginal==null&&Z!=null)D.returnOriginal=Z;return this.setOptions(D),this};d.prototype._findOneAndReplace=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();if("strict"in this.options)this._mongooseOptions.strict=this.options.strict,delete this.options.strict;let A=this._conditions,D=this._optionsForExec();Sd(D);let Z=this.options.includeResultMetadata,J={skipId:!0};if("strict"in this._mongooseOptions)J.strict=this._mongooseOptions.strict;let X=LK(this,"runValidators",!1);try{let Y=new this.model(this._update,null,J);if(X)await Y.validate();else if(Y.$__.validationError)throw Y.$__.validationError;this._update=Y.toBSON()}catch(Y){if(Y instanceof Md)throw Y;let B=new Md;throw B.errors[Y.path]=Y,B}let $=await this.mongooseCollection.findOneAndReplace(A,this._update,D);for(let Y of this._transforms)$=Y($);let G=!Z?$:$.value;return new Promise((Y,B)=>{this._completeOne(G,$,D.projection,(H,q)=>{if(H)return B(H);Y(q)})})};function Sd(F){if("new"in F)F.returnDocument=F.new?"after":"before",delete F.new;if("returnOriginal"in F)F.returnDocument=F.returnOriginal?"before":"after",delete F.returnOriginal;if(typeof F.returnDocument==="string")F.returnOriginal=F.returnDocument==="before"}function LK(F,A,D){let Z=F._optionsForExec(F.model);if(A in Z)return Z[A];if(A in F.model.base.options)return F.model.base.options[A];return D}/*!
813
+ * ignore
814
+ */function VK(F,A,D,Z,J,X){if(J.lean&&typeof J.lean.transform==="function"){J.lean.transform(A);for(let $=0;$<F.childSchemas.length;$++){let G=D?D+"."+F.childSchemas[$].model.path:F.childSchemas[$].model.path,Y=F.childSchemas[$].schema,B=Td.get(G,A);if(B==null)continue;if(Array.isArray(B))for(let H=0;H<B.length;H++)J.lean.transform(B[H]);else J.lean.transform(B);VK(Y,B,G,Z,J)}if(X)return X(null,A);else return}if(J.includeResultMetadata)return X(null,Z);return X(null,A)}/*!
815
+ * ignore
816
+ */function _d(F,A,D,Z){if(Z.lean&&typeof Z.lean.transform==="function"){for(let J of A)Z.lean.transform(J);for(let J=0;J<F.childSchemas.length;J++){let X=D?D+"."+F.childSchemas[J].model.path:F.childSchemas[J].model.path,$=F.childSchemas[J].schema,G=Td.get(X,A);if(G==null)continue;G=G.flat();for(let Y=0;Y<G.length;Y++)Z.lean.transform(G[Y]);_d($,G,X,Z)}}return A}d.prototype._mergeUpdate=function(F){if(!this._update)this._update=Array.isArray(F)?[]:{};if(F==null||typeof F==="object"&&Object.keys(F).length===0)return;if(F instanceof d){if(Array.isArray(this._update))throw new Error("Cannot mix array and object updates");if(F._update)Z0.mergeClone(this._update,F._update)}else if(Array.isArray(F)){if(!Array.isArray(this._update))throw new Error("Cannot mix array and object updates");this._update=this._update.concat(F)}else{if(Array.isArray(this._update))throw new Error("Cannot mix array and object updates");Z0.mergeClone(this._update,F)}};/*!
817
+ * ignore
818
+ */async function RK(F){if(this._applyTranslateAliases(),this._castConditions(),Od(this),this.error()!=null)throw this.error();let A=this._conditions,D=this._optionsForExec(this.model);this._update=A6(this._update,D);let Z=F==="replaceOne";if(Z)this._update=new this.model(this._update,null,!0);else{if(this._update=this._castUpdate(this._update),this._update==null||Object.keys(this._update).length===0)return{acknowledged:!1};let X=Object.assign({},D,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});this._update=kd(this._conditions,this.model.schema,this._update,X)}if(Array.isArray(D.arrayFilters))D.arrayFilters=Dz1(this._update,D.arrayFilters);if(LK(this,"runValidators",!1))await this.validate(this._update,D,Z);if(this._update.toBSON)this._update=this._update.toBSON();return this.mongooseCollection[F](A,this._update,D)}d.prototype.validate=async function F(A,D,Z){if(typeof arguments[3]==="function")throw new w2("Query.prototype.validate() no longer accepts a callback");if(await xd(this,"validate"),Z)await A.$validate();else await new Promise((J,X)=>{$z1(this,this.model.schema,A,D,($)=>{if($!=null)return X($);J()})});await ud(this,null,null,"validate")};d.prototype._updateMany=async function F(){return RK.call(this,"updateMany")};d.prototype._updateOne=async function F(){return RK.call(this,"updateOne")};d.prototype._replaceOne=async function F(){return RK.call(this,"replaceOne")};d.prototype.updateMany=function(F,A,D,Z){if(typeof D==="function")Z=D,D=null;else if(typeof A==="function")Z=A,A=F,F={},D=null;else if(typeof F==="function")Z=F,F=void 0,A=void 0,D=void 0;else if(typeof F==="object"&&!A&&!D&&!Z)A=F,F=void 0,D=void 0,Z=void 0;return wK(this,"updateMany",F,A,D,Z)};d.prototype.updateOne=function(F,A,D,Z){if(typeof D==="function")Z=D,D=null;else if(typeof A==="function")Z=A,A=F,F={},D=null;else if(typeof F==="function")Z=F,F=void 0,A=void 0,D=void 0;else if(typeof F==="object"&&!A&&!D&&!Z)A=F,F=void 0,D=void 0,Z=void 0;return wK(this,"updateOne",F,A,D,Z)};d.prototype.replaceOne=function(F,A,D,Z){if(typeof D==="function")Z=D,D=null;else if(typeof A==="function")Z=A,A=F,F={},D=null;else if(typeof F==="function")Z=F,F=void 0,A=void 0,D=void 0;else if(typeof F==="object"&&!A&&!D&&!Z)A=F,F=void 0,D=void 0,Z=void 0;return wK(this,"replaceOne",F,A,D,Z)};function wK(F,A,D,Z,J,X){if(F.op=A,F._validateOp(),Z=Z||{},J!=null){if("strict"in J)F._mongooseOptions.strict=J.strict}if(!(D instanceof d)&&D!=null&&D.toString()!=="[object Object]")F.error(new F9(D,"filter",A));else F.merge(D);if(Z0.isObject(J))F.setOptions(J);if(F._mergeUpdate(Z),X)return F.exec(X),F;return F}d.prototype.transform=function(F){return this._transforms.push(F),this};d.prototype.orFail=function(F){return this.transform((A)=>{switch(this.op){case"find":if(A.length===0)throw D5(F,this);break;case"findOne":if(A==null)throw D5(F,this);break;case"replaceOne":case"updateMany":case"updateOne":if(A&&A.matchedCount===0)throw D5(F,this);break;case"findOneAndDelete":case"findOneAndUpdate":case"findOneAndReplace":if(this.options.includeResultMetadata&&A!=null&&A.value==null)throw D5(F,this);if(!this.options.includeResultMetadata&&A==null)throw D5(F,this);break;case"deleteMany":case"deleteOne":if(A.deletedCount===0)throw D5(F,this);break;default:break}return A}),this};function D5(F,A){if(typeof F==="function")F=F.call(A);if(F==null)F=new cU1(A.getQuery(),A.model.modelName);return F}d.prototype.isPathSelectedInclusive=function(F){return Fz1(this._fields,F)};d.prototype.exec=async function F(A){if(typeof A==="function"||arguments.length>=2&&typeof arguments[1]==="function")throw new w2("Query.prototype.exec() no longer accepts a callback");if(typeof A==="string")this.op=A;if(this.op==null)throw new w2("Query must have `op` before executing");if(this.model==null)throw new w2("Query must have an associated model before executing");let D=Bz1.get(this.op);if(!D)throw new w2('Query has invalid `op`: "'+this.op+'"');if(this.options&&this.options.sort&&typeof this.options.sort==="object"&&this.options.sort.hasOwnProperty(""))throw new Error('Invalid field "" passed to sort()');if(this._executionStack!=null){let $=this.toString();if($.length>60)$=$.slice(0,60)+"...";let G=new w2("Query was already executed: "+$);throw G.originalStack=this._executionStack,G}else this._executionStack=new Error().stack;let Z=null;try{await Wz1(this)}catch($){if($ instanceof zK.skipWrappedFunction)Z=$;else throw $}let J,X=null;try{await xd(this),J=Z?Z.args[0]:await this[D]();for(let $ of this._transforms)J=$(J)}catch($){if($ instanceof zK.skipWrappedFunction)J=$.args[0];else X=$;X=this.model.schema._transformDuplicateKeyError(X)}return J=await ud(this,J,X),await qz1(this),J};/*!
819
+ * ignore
820
+ */function qz1(F){return new Promise((A,D)=>{F._hooks.execPost("exec",F,[],{},(Z)=>{if(Z)return D(Z);A()})})}/*!
821
+ * ignore
822
+ */function ud(F,A,D,Z){if(F._queryMiddleware==null){if(D!=null)throw D;return A}return new Promise((J,X)=>{let $=D?{error:D}:{};F._queryMiddleware.execPost(Z||F.op,F,[A],$,(G,Y)=>{if(G)return X(G);J(Y)})})}/*!
823
+ * ignore
824
+ */function Wz1(F){return new Promise((A,D)=>{F._hooks.execPre("exec",F,[],(Z)=>{if(Z!=null)return D(Z);A()})})}/*!
825
+ * ignore
826
+ */function xd(F,A){if(F._queryMiddleware==null)return;return new Promise((D,Z)=>{F._queryMiddleware.execPre(A||F.op,F,[],(J)=>{if(J!=null)return Z(J);D()})})}d.prototype.then=function(F,A){return this.exec().then(F,A)};d.prototype.catch=function(F){return this.exec().then(null,F)};d.prototype.finally=function(F){return this.exec().finally(F)};d.prototype[Symbol.toStringTag]=function F(){return`Query { ${this.op} }`};d.prototype.pre=function(F){return this._hooks.pre("exec",F),this};d.prototype.post=function(F){return this._hooks.post("exec",F),this};d.prototype._castUpdate=function F(A){let D=this.schema,Z=D.options.discriminatorKey,J=D._baseSchema?D._baseSchema:D;if(this._mongooseOptions.overwriteDiscriminatorKey&&A[Z]!=null&&J.discriminators){let $=Object.values(J.discriminators).find((G)=>G.discriminatorMapping.value===A[Z]);if($!=null)D=$}let X;if("upsert"in this.options)X=this.options.upsert;return sU1(D,A,{strict:this._mongooseOptions.strict,upsert:X,arrayFilters:this.options.arrayFilters,overwriteDiscriminatorKey:this._mongooseOptions.overwriteDiscriminatorKey,overwriteImmutable:this._mongooseOptions.overwriteImmutable},this,this._conditions)};d.prototype.populate=function(){let F=Array.from(arguments);if(!F.some(Boolean))return this;let A=Z0.populate.apply(null,F);if(this.options!=null){let J=this.options.readConcern,X=this.options.readPreference;for(let $ of A){if(J!=null&&($&&$.options&&$.options.readConcern)==null)$.options=$.options||{},$.options.readConcern=J;if(X!=null&&($&&$.options&&$.options.readPreference)==null)$.options=$.options||{},$.options.readPreference=X}}let D=this._mongooseOptions;if(D.lean!=null){let J=D.lean;for(let X of A)if((X&&X.options&&X.options.lean)==null)X.options=X.options||{},X.options.lean=J}if(!Z0.isObject(D.populate))D.populate={};let Z=D.populate;for(let J of A){let X=J.path;if(Z[X]&&Z[X].populate&&J.populate)J.populate=Z[X].populate.concat(J.populate);Z[J.path]=J}return this};d.prototype.getPopulatedPaths=function F(){let A=this._mongooseOptions.populate||{},D=Object.keys(A);for(let Z of Object.keys(A)){let J=A[Z];if(!Array.isArray(J.populate))continue;gd(D,J.populate,Z+".")}return D};/*!
827
+ * ignore
828
+ */function gd(F,A,D){for(let Z of A){if(F.push(D+Z.path),!Array.isArray(Z.populate))continue;gd(F,Z.populate,D+Z.path+".")}}d.prototype.cast=function(F,A){A||(A=this._conditions),F=F||this.model;let D=F.schema.options.discriminatorKey;if(A!=null&&A.hasOwnProperty(D))F=rU1(F.discriminators,A[D])||F;let Z={upsert:this.options&&this.options.upsert};if(this.options){if("strict"in this.options)Z.strict=this.options.strict;if("strictQuery"in this.options)Z.strictQuery=this.options.strictQuery}if("sanitizeFilter"in this._mongooseOptions)Z.sanitizeFilter=this._mongooseOptions.sanitizeFilter;try{return aU1(F.schema,A,Z,this)}catch(J){if(typeof J.setModel==="function")J.setModel(F);throw J}};d.prototype._castFields=function F(A){let D,Z,J,X,$;if(A){J=Object.keys(A),Z=[];for(let G=0;G<J.length;++G)if(X=J[G],A[X].$elemMatch)D||(D={}),D[X]=A[X],Z.push(X)}if(D){try{$=this.cast(this.model,D)}catch(G){return G}for(let G=0;G<Z.length;++G)X=Z[G],A[X]=$[X]}return A};d.prototype._applyPaths=function F(){if(!this.model)return;this._fields=this._fields||{};let A=void 0;if(this.model!=null&&Z0.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))A=this.model.db.options.sanitizeProjection;else if(this.model!=null&&Z0.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))A=this.model.base.options.sanitizeProjection;else A=this._mongooseOptions.sanitizeProjection;if(this._mongooseOptions.schemaLevelProjections??!0)MA.applyPaths(this._fields,this.model.schema,A);let Z=!0;if("selectPopulatedPaths"in this.model.base.options)Z=this.model.base.options.selectPopulatedPaths;if("selectPopulatedPaths"in this.model.schema.options)Z=this.model.schema.options.selectPopulatedPaths;if(Z)Xz1(this._fields,this._userProvidedFields,this._mongooseOptions.populate)};d.prototype.cursor=function F(A){if(A)this.setOptions(A);try{this.cast(this.model)}catch(D){return new Id(this)._markError(D)}return new Id(this)};d.prototype.tailable=function(F,A){if(F!=null&&typeof F.constructor==="function"&&F.constructor.name==="Object")A=F,F=!0;if(F===void 0)F=!0;if(A&&typeof A==="object")for(let D of Object.keys(A))if(D==="awaitData"||D==="awaitdata")this.options.awaitData=!!A[D];else this.options[D]=A[D];return this.options.tailable=arguments.length?!!F:!0,this};d.prototype.near=function(){let F=[],A=this._mongooseOptions.nearSphere;if(arguments.length===1)if(Array.isArray(arguments[0]))F.push({center:arguments[0],spherical:A});else if(typeof arguments[0]==="string")F.push(arguments[0]);else if(Z0.isObject(arguments[0])){if(typeof arguments[0].spherical!=="boolean")arguments[0].spherical=A;F.push(arguments[0])}else throw new TypeError("invalid argument");else if(arguments.length===2)if(typeof arguments[0]==="number"&&typeof arguments[1]==="number")F.push({center:[arguments[0],arguments[1]],spherical:A});else if(typeof arguments[0]==="string"&&Array.isArray(arguments[1]))F.push(arguments[0]),F.push({center:arguments[1],spherical:A});else if(typeof arguments[0]==="string"&&Z0.isObject(arguments[1])){if(F.push(arguments[0]),typeof arguments[1].spherical!=="boolean")arguments[1].spherical=A;F.push(arguments[1])}else throw new TypeError("invalid argument");else if(arguments.length===3)if(typeof arguments[0]==="string"&&typeof arguments[1]==="number"&&typeof arguments[2]==="number")F.push(arguments[0]),F.push({center:[arguments[1],arguments[2]],spherical:A});else throw new TypeError("invalid argument");else throw new TypeError("invalid argument");return d.base.near.apply(this,F)};d.prototype.nearSphere=function(){return this._mongooseOptions.nearSphere=!0,this.near.apply(this,arguments),this};if(Symbol.asyncIterator!=null)d.prototype[Symbol.asyncIterator]=function(){return this.cursor().transformNull()._transformForAsyncIterator()};d.prototype.box=function(F,A){if(!Array.isArray(F)&&Z0.isObject(F))A=F.ur,F=F.ll;return d.base.box.call(this,F,A)};d.prototype.center=d.base.circle;d.prototype.centerSphere=function(){if(arguments[0]!=null&&typeof arguments[0].constructor==="function"&&arguments[0].constructor.name==="Object")arguments[0].spherical=!0;if(arguments[1]!=null&&typeof arguments[1].constructor==="function"&&arguments[1].constructor.name==="Object")arguments[1].spherical=!0;d.base.circle.apply(this,arguments)};d.prototype.selectedInclusively=function F(){return eU1(this._fields)};d.prototype.selectedExclusively=function F(){return oU1(this._fields)};d.prototype.model;/*!
829
+ * Export
830
+ */fd.exports=d});var dd=E((nO1,md)=>{/*!
831
+ * Module dependencies.
832
+ */var jA=w1(),hd=i("node:stream").Readable,Cz1=tQ(),Qz1=g6(),Kz1=m9(),vd=i("node:util");function D6(F){hd.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this.agg=F,this._transforms=[];let{_connection:A,_model:D}=F;if(delete F.options.cursor.useMongooseAggCursor,this._mongooseOptions={},A)this.cursor=A.db.aggregate(F._pipeline,F.options||{}),setImmediate(()=>this.emit("cursor",this.cursor));else Ez1(D,this,F)}vd.inherits(D6,hd);/*!
833
+ * ignore
834
+ */function Ez1(F,A,D){if(!F.collection.buffer)F.hooks.execPre("aggregate",D,function(Z){if(Z!=null){yd(A,Z);return}if(typeof D.options?.cursor?.transform==="function")A._transforms.push(D.options.cursor.transform);A.cursor=F.collection.aggregate(D._pipeline,D.options||{}),A.emit("cursor",A.cursor)});else F.collection.emitter.once("queue",function(){F.hooks.execPre("aggregate",D,function(Z){if(Z!=null){yd(A,Z);return}if(typeof D.options?.cursor?.transform==="function")A._transforms.push(D.options.cursor.transform);A.cursor=F.collection.aggregate(D._pipeline,D.options||{}),A.emit("cursor",A.cursor)})})}function yd(F,A){if(A instanceof Kz1.skipWrappedFunction){let D=A.args[0];if(D!=null&&(!Array.isArray(D)||D.length)){let Z=new jA('Cannot `skipMiddlewareFunction()` with a value when using `.aggregate().cursor()`, value must be nullish or empty array, got "'+vd.inspect(D)+'".');F._markError(Z),F.listeners("error").length>0&&F.emit("error",Z);return}F.emit("cursor",null);return}F._markError(A),F.listeners("error").length>0&&F.emit("error",A)}D6.prototype._read=function(){let F=this;TX(this,function(A,D){if(A)return F.emit("error",A);if(!D){F.push(null),F.cursor.close(function(Z){if(Z)return F.emit("error",Z)});return}F.push(D)})};if(Symbol.asyncIterator!=null){let F="Mongoose does not support using async iterators with an existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation";D6.prototype[Symbol.asyncIterator]=function(){throw new jA(F)}}Object.defineProperty(D6.prototype,"map",{value:function(F){return this._transforms.push(F),this},enumerable:!0,configurable:!0,writable:!0});D6.prototype._markError=function(F){return this._error=F,this};D6.prototype.close=async function F(){if(typeof arguments[0]==="function")throw new jA("AggregationCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close()}catch(A){throw this.listeners("error").length>0&&this.emit("error",A),A}this.emit("close")};D6.prototype._destroy=function F(A,D){let Z=null;if(!this.cursor)Z=new Promise((J)=>{this.once("cursor",J)});else Z=Promise.resolve();return Z.then(()=>this.cursor.close()).then(()=>{this._closed=!0,D()}).catch((J)=>{D(J)}),this};D6.prototype.next=async function F(){if(typeof arguments[0]==="function")throw new jA("AggregationCursor.prototype.next() no longer accepts a callback");return new Promise((A,D)=>{TX(this,(Z,J)=>{if(Z!=null)return D(Z);A(J)})})};D6.prototype.eachAsync=function(F,A){if(typeof arguments[2]==="function")throw new jA("AggregationCursor.prototype.eachAsync() no longer accepts a callback");let D=this;if(typeof A==="function")A={};return A=A||{},Cz1(function(Z){return TX(D,Z)},F,A)};if(Symbol.asyncIterator!=null)D6.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()};/*!
835
+ * ignore
836
+ */D6.prototype._transformForAsyncIterator=function(){if(this._transforms.indexOf(bd)===-1)this.map(bd);return this};/*!
837
+ * ignore
838
+ */D6.prototype.transformNull=function(F){if(arguments.length===0)F=!0;return this._mongooseOptions.transformNull=F,this};/*!
839
+ * ignore
840
+ */function bd(F){return F==null?{done:!0}:{value:F,done:!1}}D6.prototype.addCursorFlag=function(F,A){let D=this;return Uz1(this,function(){D.cursor.addCursorFlag(F,A)}),this};/*!
841
+ * ignore
842
+ */function Uz1(F,A){if(F.cursor)return A();F.once("cursor",function(){A()})}function TX(F,A){let D=A;if(F._transforms.length)D=function(Z,J){if(Z||J===null&&!F._mongooseOptions.transformNull)return A(Z,J);A(Z,F._transforms.reduce(function(X,$){return $(X)},J))};if(F._error)return Qz1(function(){D(F._error)});if(F.cursor)return F.cursor.next().then((Z)=>{if(!Z)return D(null,null);D(null,Z)},(Z)=>D(Z));else F.once("error",A),F.once("cursor",function(){TX(F,A)})}md.exports=D6});var PK=E((sO1,cd)=>{cd.exports=function F(A,D,Z){let J=D&&D.discriminatorMapping;if(Z=Z||"",J&&!J.isRoot){let X=A,$=(Z.length>0?Z+".":Z)+J.key,G=J.value;if(X[0]!=null&&X[0].$match&&(X[0].$match[$]===void 0||X[0].$match[$]===G))X[0].$match[$]=G;else if(X[0]!=null&&X[0].$geoNear)X[0].$geoNear.query=X[0].$geoNear.query||{},X[0].$geoNear.query[$]=G;else if(X[0]!=null&&X[0].$search)if(X[1]&&X[1].$match!=null)X[1].$match[$]=X[1].$match[$]||G;else{let Y={};Y[$]=G,X.splice(1,0,{$match:Y})}else{let Y={};Y[$]=G,X.unshift({$match:Y})}}}});var pd=E((rO1,ld)=>{ld.exports=function F(A){if(!Array.isArray(A))return;for(let D of A){if(D==null)continue;let Z=D.$group||D.$bucket||D.$bucketAuto;if(Z!=null)for(let X of Object.keys(Z))zz1(Z[X]);let J=Object.keys(D)[0];if(J&&typeof D[J]==="object"){let X=D[J];for(let $ of Object.keys(X))if(X[$]!=null&&X[$].$function!=null&&typeof X[$].$function.body==="function")X[$].$function.body=X[$].$function.body.toString()}if(D.$facet!=null)for(let X of Object.keys(D.$facet))F(D.$facet[X])}};function zz1(F){if(F==null||F.$accumulator==null)return;for(let A of["init","accumulate","merge","finalize"])if(typeof F.$accumulator[A]==="function")F.$accumulator[A]=String(F.$accumulator[A])}});var MK=E((tO1,rd)=>{/*!
843
+ * Module dependencies
844
+ */var nd=dd(),J7=w1(),sd=jX(),{applyGlobalMaxTimeMS:Vz1,applyGlobalDiskUse:Lz1}=FK(),Rz1=K0(),wz1=b2(),IK=PK(),Pz1=pd(),id=q1(),{modelSymbol:Iz1}=A1(),Mz1=sd.prototype.read,Nz1=sd.prototype.readConcern,ad=new Set(["$$DESCEND","$$PRUNE","$$KEEP"]);function I1(F,A){if(this._pipeline=[],A==null||A[Iz1])this._model=A;else this._connection=A;if(this.options={},arguments.length===1&&Array.isArray(F))this.append.apply(this,F)}I1.prototype.options;I1.prototype._optionsForExec=function(){let F=this.options||{},A=this.model()?.db?.base.transactionAsyncLocalStorage?.getStore();if(!F.hasOwnProperty("session")&&A?.session!=null)F.session=A.session;return F};I1.prototype.model=function(F){if(arguments.length===0)return this._model;if(this._model=F,F.schema!=null){if(this.options.readPreference==null&&F.schema.options.read!=null)this.options.readPreference=F.schema.options.read;if(this.options.collation==null&&F.schema.options.collation!=null)this.options.collation=F.schema.options.collation}return F};I1.prototype.append=function(){let F=arguments.length===1&&Array.isArray(arguments[0])?arguments[0]:[...arguments];if(!F.every(jz1))throw new Error("Arguments must be aggregate pipeline operators");return this._pipeline=this._pipeline.concat(F),this};I1.prototype.addFields=function(F){if(typeof F!=="object"||F===null||Array.isArray(F))throw new Error("Invalid addFields() argument. Must be an object");return this.append({$addFields:Object.assign({},F)})};I1.prototype.project=function(F){let A={};if(typeof F==="object"&&!Array.isArray(F))Object.keys(F).forEach(function(D){A[D]=F[D]});else if(arguments.length===1&&typeof F==="string")F.split(/\s+/).forEach(function(D){if(!D)return;let Z=D[0]==="-"?0:1;if(Z===0)D=D.substring(1);A[D]=Z});else throw new Error("Invalid project() argument. Must be string or object");return this.append({$project:A})};I1.prototype.near=function(F){if(F==null)throw new J7("Aggregate `near()` must be called with non-nullish argument");if(F.near==null)throw new J7("Aggregate `near()` argument must have a `near` property");let A=Array.isArray(F.near)?F.near:F.near.coordinates;if(typeof F.near==="object"&&(!Array.isArray(A)||A.length<2||A.find((Z)=>typeof Z!=="number")))throw new J7(`Aggregate \`near()\` argument has invalid coordinates, got "${A}"`);let D={};return D.$geoNear=F,this.append(D)};/*!
845
+ * define methods
846
+ */"group match skip limit out densify fill".split(" ").forEach(function(F){I1.prototype[F]=function(A){let D={};return D["$"+F]=A,this.append(D)}});I1.prototype.unwind=function(){let F=[...arguments],A=[];for(let D of F)if(D&&typeof D==="object")A.push({$unwind:D});else if(typeof D==="string")A.push({$unwind:D[0]==="$"?D:"$"+D});else throw new Error('Invalid arg "'+D+'" to unwind(), must be string or object');return this.append.apply(this,A)};I1.prototype.replaceRoot=function(F){let A;if(typeof F==="string")A=F.startsWith("$")?F:"$"+F;else A=F;return this.append({$replaceRoot:{newRoot:A}})};I1.prototype.count=function(F){return this.append({$count:F})};I1.prototype.sortByCount=function(F){if(F&&typeof F==="object")return this.append({$sortByCount:F});else if(typeof F==="string")return this.append({$sortByCount:F[0]==="$"?F:"$"+F});else throw new TypeError('Invalid arg "'+F+'" to sortByCount(), must be string or object')};I1.prototype.lookup=function(F){return this.append({$lookup:F})};I1.prototype.graphLookup=function(F){let A={};if(F){if(!id.isObject(F))throw new TypeError("Invalid graphLookup() argument. Must be an object.");id.mergeClone(A,F);let D=A.startWith;if(D&&typeof D==="string")A.startWith=A.startWith.startsWith("$")?A.startWith:"$"+A.startWith}return this.append({$graphLookup:A})};I1.prototype.sample=function(F){return this.append({$sample:{size:F}})};I1.prototype.sort=function(F){let A={};if(wz1(F)==="Object"){let D=["desc","descending",-1];Object.keys(F).forEach(function(Z){if(F[Z]instanceof Object&&F[Z].$meta){A[Z]=F[Z];return}A[Z]=D.indexOf(F[Z])===-1?1:-1})}else if(arguments.length===1&&typeof F==="string")F.split(/\s+/).forEach(function(D){if(!D)return;let Z=D[0]==="-"?-1:1;if(Z===-1)D=D.substring(1);A[D]=Z});else throw new TypeError("Invalid sort() argument. Must be a string or object.");return this.append({$sort:A})};I1.prototype.unionWith=function(F){return this.append({$unionWith:F})};I1.prototype.read=function(F,A){return Mz1.call(this,F,A),this};I1.prototype.readConcern=function(F){return Nz1.call(this,F),this};I1.prototype.redact=function(F,A,D){if(arguments.length===3){if(typeof A==="string"&&!ad.has(A)||typeof D==="string"&&!ad.has(D))throw new Error("If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP");F={$cond:{if:F,then:A,else:D}}}else if(arguments.length!==1)throw new TypeError("Invalid arguments");return this.append({$redact:F})};I1.prototype.explain=async function F(A){if(typeof A==="function"||typeof arguments[1]==="function")throw new J7("Aggregate.prototype.explain() no longer accepts a callback");let D=this._model;if(!this._pipeline.length)throw new Error("Aggregate has empty pipeline");IK(this._pipeline,this._model.schema),await new Promise(($,G)=>{D.hooks.execPre("aggregate",this,(Y)=>{if(Y){let B={error:Y};return D.hooks.execPost("aggregate",this,[null],B,(H)=>{G(H)})}else $()})});let Z=D.collection.aggregate(this._pipeline,this.options);if(A==null)A=!0;let J=null;try{J=await Z.explain(A)}catch($){await new Promise((G,Y)=>{let B={error:$};D.hooks.execPost("aggregate",this,[null],B,(H)=>{if(H)return Y(H);return G()})})}let X={error:null};return await new Promise(($,G)=>{D.hooks.execPost("aggregate",this,[J],X,(Y)=>{if(Y)return G(Y);return $()})}),J};I1.prototype.allowDiskUse=function(F){return this.options.allowDiskUse=F,this};I1.prototype.hint=function(F){return this.options.hint=F,this};I1.prototype.session=function(F){if(F==null)delete this.options.session;else this.options.session=F;return this};I1.prototype.option=function(F){for(let A in F)this.options[A]=F[A];return this};I1.prototype.cursor=function(F){return this._optionsForExec(),this.options.cursor=F||{},new nd(this)};I1.prototype.collation=function(F){return this.options.collation=F,this};I1.prototype.facet=function(F){return this.append({$facet:F})};I1.prototype.search=function(F){return this.append({$search:F})};I1.prototype.pipeline=function(){return this._pipeline};I1.prototype.exec=async function F(){if(!this._model&&!this._connection)throw new Error("Aggregate not bound to any Model");if(typeof arguments[0]==="function")throw new J7("Aggregate.prototype.exec() no longer accepts a callback");if(this._connection){if(!this._pipeline.length)throw new J7("Aggregate has empty pipeline");return this._optionsForExec(),await(await this._connection.client.db().aggregate(this._pipeline,this.options)).toArray()}let A=this._model,D=this._model.collection;if(Vz1(this.options,A.db.options,A.base.options),Lz1(this.options,A.db.options,A.base.options),this._optionsForExec(),this.options&&this.options.cursor)return new nd(this);if(IK(this._pipeline,this._model.schema),Pz1(this._pipeline),await new Promise(($,G)=>{A.hooks.execPre("aggregate",this,(Y)=>{if(Y){let B={error:Y};return A.hooks.execPost("aggregate",this,[null],B,(H)=>{G(H)})}else $()})}),!this._pipeline.length)throw new J7("Aggregate has empty pipeline");let Z=Rz1(this.options||{}),J;try{J=await(await D.aggregate(this._pipeline,Z)).toArray()}catch($){await new Promise((G,Y)=>{let B={error:$};A.hooks.execPost("aggregate",this,[null],B,(H)=>{if(H)return Y(H);G()})})}let X={error:null};return await new Promise(($,G)=>{A.hooks.execPost("aggregate",this,[J],X,(Y)=>{if(Y)return G(Y);return $()})}),J};I1.prototype.then=function(F,A){return this.exec().then(F,A)};I1.prototype.catch=function(F){return this.exec().then(null,F)};I1.prototype.finally=function(F){return this.exec().finally(F)};if(Symbol.asyncIterator!=null)I1.prototype[Symbol.asyncIterator]=function(){return this.cursor({useMongooseAggCursor:!0}).transformNull()._transformForAsyncIterator()};/*!
847
+ * Helpers
848
+ */function jz1(F){if(typeof F!=="object"||F===null)return!1;let A=Object.keys(F);return A.length===1&&A[0][0]==="$"}I1._prepareDiscriminatorPipeline=IK;/*!
849
+ * Exports
850
+ */rd.exports=I1});var od=E((oO1,td)=>{var Tz1=K0();class NK{constructor(F){if(F==null)return;Object.assign(this,Tz1(F))}}NK.prototype.__subdocs=null;td.exports=NK});var Fc=E((eO1,ed)=>{ed.exports=function F(A,D){let Z=Object.keys(D.paths),J=Z.length;for(let X=0;X<J;++X){let $="",G=Z[X],Y=D.paths[G],B=Y.splitPath(),H=B.length,q=A;for(let W=0;W<H;++W){if(q==null)break;let C=B[W];if($+=(!$.length?"":".")+C,W===H-1){if(typeof q[C]!=="undefined"){if(Y.$isSingleNested)F(q[C],Y.caster.schema);else if(Y.$isMongooseDocumentArray&&Array.isArray(q[C]))q[C].forEach((K)=>F(K,Y.schema));break}let Q=Y.getDefault(A,!1,{skipCast:!0});if(typeof Q!=="undefined"){if(q[C]=Q,Y.$isSingleNested)F(Q,Y.caster.schema);else if(Y.$isMongooseDocumentArray&&Array.isArray(Q))Q.forEach((K)=>F(K,Y.schema))}}else{if(q[C]==null)q[C]={};q=q[C]}}}}});var TK=E((FS1,Ac)=>{Ac.exports=jK;function jK(F,A=new WeakSet,D=!1){if(A.has(F))return;A.add(F);for(let Z of Object.keys(F.paths)){let J=F.paths[Z];if(!J.schema)continue;if(jK(J.schema,A),!J.schema._applyDiscriminators)continue;if(J._appliedDiscriminators&&!D)continue;for(let X of J.schema._applyDiscriminators.keys()){let{schema:$,options:G}=J.schema._applyDiscriminators.get(X);jK($,A),J.discriminator(X,$,D?{...G,overwriteExisting:!0}:G)}J._appliedDiscriminators=!0}}});var Zc=E((AS1,Dc)=>{var kz1=L0(),Oz1=q1();Dc.exports=function F(A,D){let Z=kK();function J(X,$){Object.defineProperty(A.prototype,X,{get:function(){let G={};for(let Y in $.methods[X])G[Y]=$.methods[X][Y].bind(this);return G},configurable:!0})}for(let X of Object.keys(D.methods)){let $=D.methods[X];if(D.tree.hasOwnProperty(X))throw new Error('You have a method and a property in your schema both named "'+X+'"');if(typeof $==="function"&&Z.prototype[X]===$){delete D.methods[X];continue}if(D.reserved[X]&&!kz1(D,`methodOptions.${X}.suppressWarning`,!1))Oz1.warn(`mongoose: the method name "${X}" is used by mongoose internally, overwriting it may cause bugs. If you're sure you know what you're doing, you can suppress this error by using \`schema.method('${X}', fn, { suppressWarning: true })\`.`);if(typeof $==="function")A.prototype[X]=$;else J(X,D)}A.$appliedMethods=!0;for(let X of Object.keys(D.paths)){let $=D.paths[X];if($.$isSingleNested&&!$.caster.$appliedMethods)F($.caster,$.schema);if($.$isMongooseDocumentArray&&!$.Constructor.$appliedMethods)F($.Constructor,$.schema)}}});var $c=E((DS1,Xc)=>{var Jc=RW(),Sz1=u8(),_z1=EX(),SX=q1().isPOJO;Xc.exports=function F(A,D,Z){if(D==null)return A;if(A==null)return A;let J=null;if(_z1(D))J=!1;else if(Sz1(D))J=!0;if(J==null)return A;else if(J)return Z=Z||Jc(D),kX(A,D,Z);else return Z=Z||Jc(D),OX(A,D,Z)};function kX(F,A,D,Z,J){if(F==null||typeof F!=="object")return F;if(Array.isArray(F))return F.map(($)=>kX($,A,D,Z,J));let X={...F};Z=J?Z||{}:A;for(let $ of Object.keys(X)){let G=J?J+"."+$:$;if(A.hasOwnProperty(G)||Z.hasOwnProperty($))if(SX(A[G])||SX(Z[$]))X[$]=kX(X[$],A,D,Z[$],G);else delete X[$];else if(D[G])X[$]=kX(X[$],A,D,Z[$],G)}return X}function OX(F,A,D,Z,J){if(F==null||typeof F!=="object")return F;if(Array.isArray(F))return F.map(($)=>OX($,A,D,Z,J));let X={...F};Z=J?Z||{}:A;for(let $ of Object.keys(X)){let G=J?J+"."+$:$;if(A.hasOwnProperty(G)||Z.hasOwnProperty($)){if(SX(A[G])||SX(Z[$]))X[$]=OX(X[$],A,D,Z[$],G);continue}else if(D[G])X[$]=OX(X[$],A,D,Z[$],G);else delete X[$]}return X}});var Gc=E((ZS1,Yc)=>{Yc.exports=function F(A){let D=!1;for(let Z of Object.keys(A))if(A[Z]==="text")D=!0;return D}});var Hc=E((JS1,Bc)=>{var uz1=Gc();Bc.exports=function F(A,D,Z){if(uz1(A))return;if(Z.hasOwnProperty("collation")&&!D.hasOwnProperty("collation"))D.collation=Z.collation}});var Wc=E((XS1,qc)=>{var xz1=nZ(),{queryMiddlewareFunctions:gz1,aggregateMiddlewareFunctions:fz1,modelMiddlewareFunctions:yz1,documentMiddlewareFunctions:bz1}=NJ(),hz1=Array.from(new Set([...gz1,...fz1,...yz1,...bz1]));qc.exports=function F(A,D,Z){let J={useErrorHandlers:!0,numCallbackParams:1};A.$__insertMany=D.createWrapper("insertMany",A.$__insertMany,A,J),D=D.filter((X)=>{if(hz1.indexOf(X.name)!==-1)return!!X.model;return X.model!==!1});for(let X of Object.keys(Z))if(D.hasHooks(X)){let $=A[X];A[X]=function(){let G=arguments.length,Y=G>0?arguments[G-1]:null,B=typeof Y==="function"?Y:null,H=Array.prototype.slice.call(arguments,0,B==null?G:G-1);return xz1(B,(q)=>{D.execPre(X,A,H,function(W){if(W!=null)return q(W);let C=0,Q=$.apply(A,H.concat(K));if(Q!=null&&typeof Q.then==="function")Q.then((U)=>K(null,U),(U)=>K(U));function K(U,z){if(C++>0)return;if(U!=null)return q(U);D.execPost(X,A,[z],function(L){if(L!=null)return q(L);q(null,z)})}})},A.events)}}}});var Qc=E(($S1,Cc)=>{Cc.exports=function F(A,D){for(let Z in D.statics)A[Z]=D.statics[Z]}});var Vc=E((YS1,zc)=>{var Kc=MJ(),vz1=z6();zc.exports=Ec;function Ec(F,A,D){if(A==null)return A;return mz1(F,A,D),Uc(F,A,D)}function mz1(F,A,D){for(let Z of F.childSchemas){let J=Z.model.path,X=Z.schema;if(!J)continue;let $=vz1.get(J,A);if($==null||Array.isArray($)&&$.flat(1/0).length===0)continue;Ec(X,$,D)}}function Uc(F,A,D){if(A==null||typeof A!=="object")return;if(Array.isArray(A)){for(let G of A)Uc(F,G,D);return}if(F.discriminators&&Object.keys(F.discriminators).length>0)for(let G of Object.keys(F.discriminators)){let Y=F.discriminators[G],B=Y.discriminatorMapping.key,H=Y.discriminatorMapping.value;if(A[B]==H){F=Y;break}}let Z=Kc(F.options.timestamps,"createdAt"),J=Kc(F.options.timestamps,"updatedAt"),X=D?.currentTime,$=null;if(X!=null)$=X();else if(F.base?.now)$=F.base.now();else $=new Date;if(Z&&A[Z]==null&&!D?.isUpdate)A[Z]=$;if(J)A[J]=$}});var wc=E((GS1,Rc)=>{var dz1=z6();Rc.exports=Lc;function Lc(F,A,D){if(A==null)return A;let Z=D,J=null;if(Array.isArray(D)){Z=[],J=[];for(let X of D)if(X.length===1)J.push(X[0]);else Z.push(X)}return cz1(F,A,Z),OK(F,A,J)}function cz1(F,A,D){let Z=!1;for(let J of F.childSchemas){let X=J.model.path,$=J.schema;if(!X)continue;let G=dz1.get(X,A);if(G==null||Array.isArray(G)&&G.flat(1/0).length===0)continue;let Y=null;if(Array.isArray(D)){Y=[];for(let B of D)if(B[0]==X)Y.push(B.slice(1));if(Y.length===0)continue}Lc($,G,Y),Z=!0}if(D&&D.length&&!Z)OK(F,A,D)}function OK(F,A,D){if(A==null||typeof A!=="object")return;if(Array.isArray(A)){for(let Z of A)OK(F,Z,D);return}if(F.discriminators&&Object.keys(F.discriminators).length>0)for(let Z of Object.keys(F.discriminators)){let J=F.discriminators[Z],X=J.discriminatorMapping.key,$=J.discriminatorMapping.value;if(A[X]==$){F=J;break}}if(D==null)D=Object.keys(F.virtuals);for(let Z of D){if(F.virtuals[Z]==null)continue;let J=F.virtuals[Z],X=Array.isArray(Z)?Z:Z.indexOf(".")===-1?[Z]:Z.split("."),$=A;for(let B=0;B<X.length-1;++B)$[X[B]]=X[B]in $?$[X[B]]:{},$=$[X[B]];let G=J.applyGetters($[X[X.length-1]],A);if(J.options&&(J.options.ref||J.options.refPath)&&G===void 0)if(J.options.justOne)G=null;else G=[];$[X[X.length-1]]=G}}});var _X=E((BS1,Pc)=>{Pc.exports=function F(A){if(!(this instanceof F))return new F(A);return this.val=A,this}});var TA=E((HS1,Ic)=>{/*!
851
+ * ignore
852
+ */Ic.exports=new WeakMap});var Tc=E((qS1,jc)=>{var lz1=K0(),Mc=TA(),pz1=A1().modelSymbol,iz1=q1();jc.exports=Nc;var uX=Symbol("mongoose#assignRawDocsToIdStructure#hasArray");function Nc(F,A,D,Z,J){let X=[],$=Z.isVirtual&&Z.justOne&&F.length>1?!1:Z.sort&&F.length>1,G=Z.$nullIfNotFound,Y,B,H;if(iz1.isMongooseArray(F))F=F.__array;let q=0,W=F.length;if($&&J&&Z[uX]===void 0){Z[uX]=!1;for(let C in D)if(Array.isArray(D[C])){Z[uX]=!0;break}}for(q=0;q<W;++q){if(H=F[q],Array.isArray(H)){Nc(H,A,D,Z,!0),X.push(H);continue}if(H===null&&$===!1){X.push(H);continue}if(B=String(H),Y=A[B],Z.clone&&Y!=null)if(Z.lean){let C=Mc.get(Y);Y=lz1(Y),Mc.set(Y,C)}else Y=Y.constructor.hydrate(Y._doc);if(J)if(Y)if($){let C=D[B];if(Z[uX])X.push(Y);else X[C]=Y}else X.push(Y);else if(H!=null&&H[pz1]!=null)X.push(H);else X.push(Z.retainNullValues||G?null:H);else X[q]=Y||null}if(F.length=0,X.length)X.forEach(function(C,Q){F[Q]=C})}});var _K=E((WS1,kc)=>{kc.exports=SK;/*!
853
+ * ignore
854
+ */function SK(F,A){if(F.virtuals[A])return{virtual:F.virtuals[A],path:void 0};let D=A.split("."),Z="",J="";for(let X=0;X<D.length;++X){if(Z+=(Z.length>0?".":"")+D[X],F.virtuals[Z]){if(X===D.length-1)return{virtual:F.virtuals[Z],path:J};continue}if(F.nested[Z])continue;if(F.paths[Z]&&F.paths[Z].schema){F=F.paths[Z].schema;let $=D.slice(X+1).join(".");if(F.virtuals[$]){if(X===D.length-2)return{virtual:F.virtuals[$],nestedSchemaPath:[J,Z].filter((G)=>!!G).join(".")};continue}if(X+1<D.length&&F.discriminators)for(let G of Object.keys(F.discriminators)){let Y=SK(F.discriminators[G],$);if(Y!=null){let B=[J,Z,Y.nestedSchemaPath].filter((H)=>!!H).join(".");return{virtual:Y.virtual,nestedSchemaPath:B}}}J+=(J.length>0?".":"")+Z,Z="";continue}if(F.discriminators)for(let $ of Object.keys(F.discriminators)){let G=SK(F.discriminators[$],A);if(G)return G}return null}}});var Sc=E((xX,Oc)=>{(function(F,A){typeof xX==="object"&&typeof Oc!=="undefined"?A(xX):typeof define==="function"&&define.amd?define(["exports"],A):(F=typeof globalThis!=="undefined"?globalThis:F||self,A(F.sift={}))})(xX,function(F){var A=function(w,N){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,b){k.__proto__=b}||function(k,b){for(var s in b)if(Object.prototype.hasOwnProperty.call(b,s))k[s]=b[s]},A(w,N)};function D(w,N){if(typeof N!=="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");A(w,N);function k(){this.constructor=w}w.prototype=N===null?Object.create(N):(k.prototype=N.prototype,new k)}typeof SuppressedError==="function"&&SuppressedError;var Z=function(w){var N="[object "+w+"]";return function(k){return J(k)===N}},J=function(w){return Object.prototype.toString.call(w)},X=function(w){if(w instanceof Date)return w.getTime();else if(G(w))return w.map(X);else if(w&&typeof w.toJSON==="function")return w.toJSON();return w},$=function(w){return w==null?null:w},G=Z("Array"),Y=Z("Object"),B=Z("Function"),H=function(w,N){return w.hasOwnProperty(N)&&!B(w[N])},q=function(w){return w&&(w.constructor===Object||w.constructor===Array||w.constructor.toString()==="function Object() { [native code] }"||w.constructor.toString()==="function Array() { [native code] }")&&!w.toJSON},W=function(w,N){if(w==null&&w==N)return!0;if(w===N)return!0;if(Object.prototype.toString.call(w)!==Object.prototype.toString.call(N))return!1;if(G(w)){if(w.length!==N.length)return!1;for(var k=0,b=w.length;k<b;k++)if(!W(w[k],N[k]))return!1;return!0}else if(Y(w)){if(Object.keys(w).length!==Object.keys(N).length)return!1;for(var s in w)if(!W(w[s],N[s]))return!1;return!0}return!1},C=function(w,N,k,b,s,D1){var C1=N[b];if(G(w)&&isNaN(Number(C1))&&!H(w,C1)){for(var M1=0,X2=w.length;M1<X2;M1++)if(!C(w[M1],N,k,b,M1,w))return!1}if(b===N.length||w==null)return k(w,s,D1,b===0,b===N.length);return C(w[C1],N,k,b+1,C1,w)},Q=function(){function w(N,k,b,s){this.params=N,this.owneryQuery=k,this.options=b,this.name=s,this.init()}return w.prototype.init=function(){},w.prototype.reset=function(){this.done=!1,this.keep=!1},w}(),K=function(w){D(N,w);function N(k,b,s,D1){var C1=w.call(this,k,b,s)||this;return C1.children=D1,C1}return N.prototype.reset=function(){this.keep=!1,this.done=!1;for(var k=0,b=this.children.length;k<b;k++)this.children[k].reset()},N.prototype.childrenNext=function(k,b,s,D1,C1){var M1=!0,X2=!0;for(var Z6=0,K3=this.children.length;Z6<K3;Z6++){var J9=this.children[Z6];if(!J9.done)J9.next(k,b,s,D1,C1);if(!J9.keep)X2=!1;if(J9.done){if(!J9.keep)break}else M1=!1}this.done=M1,this.keep=X2},N}(Q),U=function(w){D(N,w);function N(k,b,s,D1,C1){var M1=w.call(this,k,b,s,D1)||this;return M1.name=C1,M1}return N}(K),z=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.next=function(k,b,s,D1){this.childrenNext(k,b,s,D1)},N}(K),L=function(w){D(N,w);function N(k,b,s,D1,C1){var M1=w.call(this,b,s,D1,C1)||this;return M1.keyPath=k,M1.propop=!0,M1._nextNestedValue=function(X2,Z6,K3,J9,_p){return M1.childrenNext(X2,Z6,K3,J9,_p),!M1.done},M1}return N.prototype.next=function(k,b,s){C(k,this.keyPath,this._nextNestedValue,0,b,s)},N}(K),V=function(w,N){if(w instanceof Function)return w;if(w instanceof RegExp)return function(b){var s=typeof b==="string"&&w.test(b);return w.lastIndex=0,s};var k=X(w);return function(b){return N(k,X(b))}},P=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.init=function(){this._test=V(this.params,this.options.compare)},N.prototype.next=function(k,b,s){if(!Array.isArray(s)||s.hasOwnProperty(b)){if(this._test(k,b,s))this.done=!0,this.keep=!0}},N}(Q),I=function(w,N,k){return new P(w,N,k)},M=function(w){return function(N,k,b,s){return w(N,k,b,s)}},x=function(w){return M(function(N,k,b,s){var D1=typeof X(N),C1=w(N);return new P(function(M1){var X2=$(M1);return typeof X(X2)===D1&&C1(X2)},k,b,s)})},_=function(w,N,k,b){var s=b.operations[w];if(!s)O(w);return s(N,k,b,w)},O=function(w){throw new Error("Unsupported operation: ".concat(w))},R=function(w,N){for(var k in w)if(N.operations.hasOwnProperty(k)||k.charAt(0)==="$")return!0;return!1},S=function(w,N,k,b,s){if(R(N,s)){var D1=c(N,k,s),C1=D1[0],M1=D1[1];if(M1.length)throw new Error("Property queries must contain only operations, or exact objects.");return new L(w,N,b,s,C1)}return new L(w,N,b,s,[new P(N,b,s)])},u=function(w,N,k){if(N===void 0)N=null;var b=k===void 0?{}:k,s=b.compare,D1=b.operations,C1={compare:s||W,operations:Object.assign({},D1||{})},M1=c(w,null,C1),X2=M1[0],Z6=M1[1],K3=[];if(X2.length)K3.push(new L([],w,N,C1,X2));if(K3.push.apply(K3,Z6),K3.length===1)return K3[0];return new z(w,N,C1,K3)},c=function(w,N,k){var b=[],s=[];if(!q(w))return b.push(new P(w,w,k)),[b,s];for(var D1 in w)if(k.operations.hasOwnProperty(D1)){var C1=_(D1,w[D1],w,k);if(C1){if(!C1.propop&&N&&!k.operations[N])throw new Error("Malformed query. ".concat(D1," cannot be matched against property."))}if(C1!=null)b.push(C1)}else if(D1.charAt(0)==="$")O(D1);else s.push(S(D1.split("."),w[D1],D1,w,k));return[b,s]},r=function(w){return function(N,k,b){return w.reset(),w.next(N,k,b),w.keep}},J0=function(w,N){if(N===void 0)N={};return r(u(w,null,N))},d0=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.init=function(){this._test=V(this.params,this.options.compare)},N.prototype.reset=function(){w.prototype.reset.call(this),this.keep=!0},N.prototype.next=function(k){if(this._test(k))this.done=!0,this.keep=!1},N}(Q),X0=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.init=function(){if(!this.params||typeof this.params!=="object")throw new Error("Malformed query. $elemMatch must by an object.");this._queryOperation=u(this.params,this.owneryQuery,this.options)},N.prototype.reset=function(){w.prototype.reset.call(this),this._queryOperation.reset()},N.prototype.next=function(k){if(G(k)){for(var b=0,s=k.length;b<s;b++){this._queryOperation.reset();var D1=k[b];this._queryOperation.next(D1,b,k,!1),this.keep=this.keep||this._queryOperation.keep}this.done=!0}else this.done=!1,this.keep=!1},N}(Q),c0=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.init=function(){this._queryOperation=u(this.params,this.owneryQuery,this.options)},N.prototype.reset=function(){w.prototype.reset.call(this),this._queryOperation.reset()},N.prototype.next=function(k,b,s,D1){this._queryOperation.next(k,b,s,D1),this.done=this._queryOperation.done,this.keep=!this._queryOperation.keep},N}(Q),M2=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.init=function(){},N.prototype.next=function(k){if(G(k)&&k.length===this.params)this.done=!0,this.keep=!0},N}(Q),J2=function(w){if(w.length===0)throw new Error("$and/$or/$nor must be a nonempty array")},_3=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!1,k}return N.prototype.init=function(){var k=this;J2(this.params),this._ops=this.params.map(function(b){return u(b,null,k.options)})},N.prototype.reset=function(){this.done=!1,this.keep=!1;for(var k=0,b=this._ops.length;k<b;k++)this._ops[k].reset()},N.prototype.next=function(k,b,s){var D1=!1,C1=!1;for(var M1=0,X2=this._ops.length;M1<X2;M1++){var Z6=this._ops[M1];if(Z6.next(k,b,s),Z6.keep){D1=!0,C1=Z6.keep;break}}this.keep=C1,this.done=D1},N}(Q),Mp=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!1,k}return N.prototype.next=function(k,b,s){w.prototype.next.call(this,k,b,s),this.keep=!this.keep},N}(_3),GE=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.init=function(){var k=this,b=Array.isArray(this.params)?this.params:[this.params];this._testers=b.map(function(s){if(R(s,k.options))throw new Error("cannot nest $ under ".concat(k.name.toLowerCase()));return V(s,k.options.compare)})},N.prototype.next=function(k,b,s){var D1=!1,C1=!1;for(var M1=0,X2=this._testers.length;M1<X2;M1++){var Z6=this._testers[M1];if(Z6(k)){D1=!0,C1=!0;break}}this.keep=C1,this.done=D1},N}(Q),Np=function(w){D(N,w);function N(k,b,s,D1){var C1=w.call(this,k,b,s,D1)||this;return C1.propop=!0,C1._in=new GE(k,b,s,D1),C1}return N.prototype.next=function(k,b,s,D1){if(this._in.next(k,b,s),G(s)&&!D1){if(this._in.keep)this.keep=!1,this.done=!0;else if(b==s.length-1)this.keep=!0,this.done=!0}else this.keep=!this._in.keep,this.done=!0},N.prototype.reset=function(){w.prototype.reset.call(this),this._in.reset()},N}(Q),jp=function(w){D(N,w);function N(){var k=w!==null&&w.apply(this,arguments)||this;return k.propop=!0,k}return N.prototype.next=function(k,b,s,D1,C1){if(!C1)this.done=!0,this.keep=!this.params;else if(s.hasOwnProperty(b)===this.params)this.done=!0,this.keep=!0},N}(Q),Tp=function(w){D(N,w);function N(k,b,s,D1){var C1=w.call(this,k,b,s,k.map(function(M1){return u(M1,b,s)}),D1)||this;return C1.propop=!1,J2(k),C1}return N.prototype.next=function(k,b,s,D1){this.childrenNext(k,b,s,D1)},N}(U),kp=function(w){D(N,w);function N(k,b,s,D1){var C1=w.call(this,k,b,s,k.map(function(M1){return u(M1,b,s)}),D1)||this;return C1.propop=!0,C1}return N.prototype.next=function(k,b,s,D1){this.childrenNext(k,b,s,D1)},N}(U),BE=function(w,N,k){return new P(w,N,k)},HE=function(w,N,k,b){return new d0(w,N,k,b)},qE=function(w,N,k,b){return new _3(w,N,k,b)},WE=function(w,N,k,b){return new Mp(w,N,k,b)},CE=function(w,N,k,b){return new X0(w,N,k,b)},QE=function(w,N,k,b){return new Np(w,N,k,b)},KE=function(w,N,k,b){return new GE(w,N,k,b)},EE=x(function(w){return function(N){return N!=null&&N<w}}),UE=x(function(w){return function(N){return N===w||N<=w}}),zE=x(function(w){return function(N){return N!=null&&N>w}}),VE=x(function(w){return function(N){return N===w||N>=w}}),LE=function(w,N,k){var b=w[0],s=w[1];return new P(function(D1){return X(D1)%b===s},N,k)},RE=function(w,N,k,b){return new jp(w,N,k,b)},wE=function(w,N,k){return new P(new RegExp(w,N.$options),N,k)},PE=function(w,N,k,b){return new c0(w,N,k,b)},IE={number:function(w){return typeof w==="number"},string:function(w){return typeof w==="string"},bool:function(w){return typeof w==="boolean"},array:function(w){return Array.isArray(w)},null:function(w){return w===null},timestamp:function(w){return w instanceof Date}},ME=function(w,N,k){return new P(function(b){if(typeof w==="string"){if(!IE[w])throw new Error("Type alias does not exist");return IE[w](b)}return b!=null?b instanceof w||b.constructor===w:!1},N,k)},NE=function(w,N,k,b){return new Tp(w,N,k,b)},jE=function(w,N,k,b){return new kp(w,N,k,b)},TE=function(w,N,k){return new M2(w,N,k,"$size")},kE=function(){return null},OE=function(w,N,k){var b;if(B(w))b=w;else if(!process.env.CSP_ENABLED)b=new Function("obj","return "+w);else throw new Error('In CSP mode, sift does not support strings in "$where" condition');return new P(function(s){return b.bind(s)(s)},N,k)},Op=Object.freeze({__proto__:null,$Size:M2,$all:jE,$and:NE,$elemMatch:CE,$eq:BE,$exists:RE,$gt:zE,$gte:VE,$in:KE,$lt:EE,$lte:UE,$mod:LE,$ne:HE,$nin:QE,$nor:WE,$not:PE,$options:kE,$or:qE,$regex:wE,$size:TE,$type:ME,$where:OE}),SE=function(w,N,k){var b=k===void 0?{}:k,s=b.compare,D1=b.operations;return u(w,N,{compare:s,operations:Object.assign({},Op,D1||{})})},Sp=function(w,N){if(N===void 0)N={};var k=SE(w,null,N);return r(k)};F.$Size=M2,F.$all=jE,F.$and=NE,F.$elemMatch=CE,F.$eq=BE,F.$exists=RE,F.$gt=zE,F.$gte=VE,F.$in=KE,F.$lt=EE,F.$lte=UE,F.$mod=LE,F.$ne=HE,F.$nin=QE,F.$nor=WE,F.$not=PE,F.$options=kE,F.$or=qE,F.$regex=wE,F.$size=TE,F.$type=ME,F.$where=OE,F.EqualsOperation=P,F.createDefaultQueryOperation=SE,F.createEqualsOperation=I,F.createOperationTester=r,F.createQueryOperation=u,F.createQueryTester=J0,F.default=Sp,Object.defineProperty(F,"__esModule",{value:!0})})});var uc=E((CS1,uK)=>{var _c=Sc();uK.exports=_c.default;Object.assign(uK.exports,_c)});var hc=E((QS1,bc)=>{var az1=TJ(),nz1=_X(),sz1=Tc(),gX=L0(),rz1=_K(),yc=TA(),xc=PJ(),tz1=NW(),xK=z6(),gc=uc().default,fX=q1(),{populateModelSymbol:oz1}=A1();bc.exports=function F(A){let D=Object.assign({},gX(A,"allOptions.options.options"),gX(A,"allOptions.options")),Z=Object.assign({},A.options,D,{justOne:A.justOne,isVirtual:A.isVirtual});Z.$nullIfNotFound=A.isVirtual;let J=A.populatedModel,X=[].concat(A.rawIds);A.allIds=[].concat(A.allIds),sz1(A.rawIds,A.rawDocs,A.rawOrder,Z);let{docs:$,rawIds:G,options:Y}=A,B=A.count&&A.isVirtual,H,q=0;function W(C){if(++q,B)return C;if(C instanceof nz1)return C.val;if(C===void 0)return C;let Q=A.allIds[H];if(A.path.endsWith(".$*"))return kA(C,Y,Z,Q);if(A.justOne===!0&&Array.isArray(C)){let K=[];for(let U of C){let z=yc.get(U);if(z==null||z===J)K.push(U)}while(C.length>K.length)Array.prototype.pop.apply(C,[]);for(let U=0;U<K.length;++U)C[U]=K[U];return kA(C[0],Y,Z,Q)}else if(A.justOne===!1&&!Array.isArray(C))return kA([C],Y,Z,Q);else if(A.justOne===!0&&!Array.isArray(C)&&Array.isArray(Q))return kA(C,Y,Z,C==null?C:Q[q-1]);return kA(C,Y,Z,Q)}for(H=0;H<$.length;++H){q=0;let C=A.path.endsWith(".$*")?A.path.slice(0,-3):A.path,Q=xK.get(C,$[H],xc);if(Q==null&&!rz1(A.originalModel.schema,C))continue;let K;if(B)K=ez1(G[H]);else if(Array.isArray(A.match))K=Array.isArray(G[H])?G[H].filter((I)=>I==null||gc(A.match[H])(I)):[G[H]].filter((I)=>I==null||gc(A.match[H])(I))[0];else K=G[H];let U=A.originalModel.schema,z=gX($[H],"$__",null)!=null,L=z?Q instanceof Map:fX.isPOJO(Q);if(L=L&&gX(U._getSchema(C),"$isSchemaMap"),!A.isVirtual&&L){let I=Q instanceof Map?Array.from(Q.keys()):Object.keys(Q);K=K.reduce((M,x,_)=>{return M.set(I[_],x),M},new Map)}if(z&&Array.isArray(K)){for(let I of K)if(I!=null&&I.$__!=null)I.$__.parent=$[H]}else if(z&&K!=null&&K.$__!=null)K.$__.parent=$[H];if(A.isVirtual&&z){if($[H].$populated(C,A.justOne?X[0]:X,A.allOptions),Array.isArray(K))K=K.map((I)=>I==null?void 0:I);xK.set(C,K,$[H],void 0,W,!1);continue}let V=C.split("."),P=$[H];for(let I=0;I<V.length-1;++I){if(Array.isArray(P)&&!fX.isArrayIndex(V[I]))break;if(V[I]==="$*")break;if(P[V[I]]==null){let M=V.slice(0,I+1).join("."),x=U._getSchema(M);if(K==null&&x!=null&&x.$isMongooseArray)break;P[V[I]]={}}if(P=P[V[I]],typeof P!=="object")break}if($[H].$__){if(A.allOptions.options[oz1]=A.allOptions.model,$[H].$populated(C,A.unpopulatedValues[H],A.allOptions.options),K!=null&&K.$__!=null)K.$__.wasPopulated={value:A.unpopulatedValues[H]};if(K instanceof Map&&!K.$isMongooseMap)K=new az1(K,C,$[H],$[H].schema.path(C).$__schemaType)}if(xK.set(C,K,$[H],xc,W,!1),$[H].$__)tz1($[H],[A.allOptions.options])}};function ez1(F){if(Array.isArray(F)){if(F.some((A)=>Array.isArray(A)||A===null))return F.map((A)=>{if(A==null)return 0;if(Array.isArray(A))return A.filter((D)=>D!=null).length;return 1});return F.filter((A)=>A!=null).length}return F==null?0:1}function kA(F,A,D,Z){let J=typeof D.transform==="function",X=J?D.transform:($)=>$;if(Array.isArray(F)){let $=[],G=F.length;for(let H=0;H<G;++H){let q=F[H],W=Array.isArray(Z)?Z[H]:Z;if(!gK(q)&&(!D.retainNullValues||q!=null)&&!J)continue;else if(!D.retainNullValues&&q==null)continue;else if(J)q=X(gK(q)?q:null,W);if(fc(q,A),$.push(q),A.originalLimit&&$.length>=A.originalLimit)break}let Y=$.length;while(F.length>Y)Array.prototype.pop.apply(F,[]);let B=0;if(fX.isMongooseArray(F))for(B=0;B<Y;++B)F.set(B,$[B],!0);else for(B=0;B<Y;++B)F[B]=$[B];return F}if(gK(F)||fX.isPOJO(F))return fc(F,A),X(F,Z);if(F instanceof Map)return F;if(D.justOne===!1)return[];return F==null?X(F,Z):X(null,Z)}function fc(F,A){if(F!=null&&A.excludeId)if(typeof F.$__setValue==="function")delete F._doc._id;else delete F._id}function gK(F){if(F==null)return!1;return Array.isArray(F)||F.$isMongooseMap||F.$__!=null||yc.has(F)}});var cc=E((KS1,dc)=>{var FV1=_X(),AV1=TW(),{trusted:yX}=w8(),vc=IX();dc.exports=function F(A,D,Z,J,X){let $=DV1(D);if(Z.size===1){let G=Array.from(Z)[0],Y=J.schema.path(G);if(G!=="_id"||!$._id)A=mc(A,Y,X),$[G]=yX({$in:A});else if(G==="_id"&&$._id){let H=vc($[G])?$[G]:{$eq:$[G]};$[G]={...yX({$in:A}),...H}}let B=AV1(G);for(let H=0;H<B.length-1;++H){let q=B[H];if($[q]!=null&&$[q].$elemMatch!=null){$[q].$elemMatch[G.slice(q.length+1)]=yX({$in:A}),delete $[G];break}}}else{let G=[];if(Array.isArray($.$or))$.$and=[{$or:$.$or},{$or:G}],delete $.$or;else $.$or=G;for(let Y of Z)if(Y!=="_id"||!$._id){let B=J.schema.path(Y);A=mc(A,B,X),G.push({[Y]:{$in:A}})}else if(Y==="_id"&&$._id){let B=vc($[Y])?$[Y]:{$eq:$[Y]};$[Y]={...yX({$in:A}),...B}}}return $};function mc(F,A,D){if(F=F.filter((Z)=>!(Z instanceof FV1)),!D)return F;return F.filter((Z)=>{try{return A.cast(Z),!0}catch(J){return!1}})}function DV1(F){if(Array.isArray(F)){if(F.length>1)return{$or:[].concat(F.map((A)=>Object.assign({},A)))};return Object.assign({},F[0])}return Object.assign({},F)}});var ac=E((ES1,ic)=>{/*!
855
+ * ignore
856
+ */var lc=i9(),ZV1=L0(),JV1=d6(),pc=TA(),Z5=z6(),XV1=A1().populateModelSymbol;ic.exports=function F(A,D,Z,J){let X=D.path(J),$=Z;if(X)return X;let G=D.discriminatorMapping&&D.discriminatorMapping.key;if(G&&A!=null){if(Z!=null&&Z[G]!=null){let H=JV1(A.discriminators,Z[G]);D=H?H.schema:D}else if(A.discriminators!=null)return Object.keys(A.discriminators).reduce((H,q)=>{let W=A.discriminators[q];return H.concat(F(W,W.schema,null,J))},[])}function Y(H,q,W,C){let Q=H.length+1,K,U;while(Q--){if(U=H.slice(0,Q).join("."),K=q.path(U),K==null)continue;if(K.caster){if(K.caster instanceof lc)return K.caster;let V=null;if(K.schema!=null&&K.schema.discriminators!=null){let P=K.schema.discriminators,I=U+"."+K.schema.options.discriminatorKey,M=W?Z5.get(I,W)||[]:[];V=Object.keys(P).reduce(function(x,_){let O=P[_].discriminatorMapping.value;if(Z==null||M.indexOf(_)!==-1||M.indexOf(O)!==-1)x.push(P[_]);return x},[])}if(Q!==H.length&&K.schema){let P;if(H[Q]==="$"){if(Q+1===H.length)return K;if(P=Y(H.slice(Q+1),q,W?Z5.get(U,W):null,C.concat(H.slice(0,Q))),P)P.$parentSchemaDocArray=P.$parentSchemaDocArray||(K.schema.$isSingleNested?null:K);return P}if(V!=null&&V.length>0){P=[];for(let I of V){let M=Y(H.slice(Q),I,W?Z5.get(U,W):null,C.concat(H.slice(0,Q)));if(M!=null){if(M.$parentSchemaDocArray=M.$parentSchemaDocArray||(K.schema.$isSingleNested?null:K),M.$parentSchemaDocArray)P.$parentSchemaDocArray=M.$parentSchemaDocArray;P.push(M)}}return P}else{if(P=Y(H.slice(Q),K.schema,W?Z5.get(U,W):null,C.concat(H.slice(0,Q))),P)P.$parentSchemaDocArray=P.$parentSchemaDocArray||(K.schema.$isSingleNested?null:K);return P}}else if(Q!==H.length&&K.$isMongooseArray&&K.casterConstructor.$isMongooseArray){let P=K;while(P.$isMongooseArray&&!P.$isMongooseDocumentArray)P=P.casterConstructor;let I=Y(H.slice(Q),P.schema,null,C.concat(H.slice(0,Q)));if(I!=null)return I;if(P.schema.discriminators){let M=[];for(let x of Object.keys(P.schema.discriminators)){let _=P.schema.discriminators[x]||P.schema,O=Y(H.slice(Q),_,null,C.concat(H.slice(0,Q)));if(O!=null)M.push(O)}if(M.length>0)return M}}}else if(K.$isSchemaMap&&K.$__schemaType instanceof lc)return K.$__schemaType;let z=C.concat([U]).join(".");if($!=null&&$.$__&&$.$populated(z,!0)&&Q<H.length){let V=$.$populated(z,!0).options[XV1];if(V!=null)return Y(H.slice(Q),V.schema,W?Z5.get(U,W):null,C.concat(H.slice(0,Q)))}let L=ZV1($,U);if(L!=null){let V=Array.isArray(L)&&L.length>0?pc.get(L[0]):pc.get(L),P=V!=null?V.schema:null;if(P!=null){let I=Y(H.slice(Q),P,W?Z5.get(U,W):null,C.concat(H.slice(0,Q)));if(I!=null)return I.$parentSchemaDocArray=I.$parentSchemaDocArray||(P.$isSingleNested?null:P),I}}return K}}let B=J.split(".");for(let H=0;H<B.length;++H)if(B[H]==="$")B[H]="0";return Y(B,D,Z,[])}});var ec=E((US1,oc)=>{var mK=a2(),$V1=_X(),YV1=K0(),i6=L0(),GV1=d6(),BV1=b2(),nc=ac(),HV1=_K(),OA=PJ(),X7=z6(),bX=HC(),P2=q1(),bK=A1().modelSymbol,fK=A1().populateModelSymbol,hK=p9().schemaMixedSymbol,qV1=CW();oc.exports=function F(A,D,Z){let J,X=D.length,$=[],G=Z.model&&Z.model.modelName||Z.model,Y,B,H,q={},W=A.schema;if(Z._localModel!=null&&Z._localModel.schema.nested[Z.path])return[];let C=HV1(A.schema,Z.path);if((C==null?null:C.virtual)!=null)return WV1(A,D,Z,C);let K=nc(A,W,null,Z.path);if(K=Array.isArray(K)?K:[K].filter((L)=>L!=null),!(Z.strictPopulate===!1||Z.options?.strictPopulate===!1)&&K.length===0&&Z._localModel!=null)return new qV1(Z._fullPath||Z.path);for(let L=0;L<X;L++){J=D[L];let V=null;if(J.$__!=null&&J.populated(Z.path)){if((Z.forceRepopulate!=null?Z.forceRepopulate:J.constructor.base.options.forceRepopulate)===!1)continue}let P=J!=null&&J.$__!=null?J.$__schema:W;if(Y=nc(A,P,J,Z.path),Y!=null&&Y.$isMongooseDocumentArray&&Y.options.ref==null&&Y.options.refPath==null)continue;if(Y&&Y.$parentSchemaDocArray&&i6(Z,"options.sort")!=null)return new mK("Cannot populate with `sort` on path "+Z.path+" because it is a subproperty of a document array");H=null;let M=!1,x=null,_=null,O=null;if(Y!=null&&Y.instance==="Embedded"){if(Y.options.ref){let X0={localField:Z.path+"._id",foreignField:"_id",justOne:!0},c0=z(J,Y,G,A),M2=X7.get(Z.path,J),J2=X7.get("_id",M2);vK(A,$,q,c0.modelNames,Z,X0,J2,J,_,M2)}continue}if(Array.isArray(Y)){let X0=Y;for(let c0 of X0){let M2,J2;try{J2=z(J,c0,G,A),M2=J2.modelNames,M=M||J2.isRefPath,x=x||J2.refPath,V=J2.justOne}catch(_3){return _3}if(M&&!J2.isRefPath)continue;if(!M2)continue;H=H||[];for(let _3 of M2)if(H.indexOf(_3)===-1)H.push(_3)}}else{try{let X0=z(J,Y,G,A);if(H=X0.modelNames,M=X0.isRefPath,x=x||X0.refPath,V=X0.justOne,_=i6(Y,"options.populate",null),M)O=H,H=Array.from(new Set(H))}catch(X0){return X0}if(!H)continue}let R={},S=Z.path,u="_id";if("justOne"in Z&&Z.justOne!==void 0)V=Z.justOne;else if(Y&&!Y[hK]){if(Z.path.endsWith("."+Y.path)||Z.path===Y.path)V=Array.isArray(Y)?Y.every((X0)=>!X0.$isMongooseArray):!Y.$isMongooseArray}if(!H)continue;R.isVirtual=!1,R.justOne=V,R.localField=S,R.foreignField=u;let c=rc(J,S,A,Z,null,Y),r=String(P2.getValue(u,J));Z._docs[r]=Array.isArray(c)?c.slice():c;let J0=i6(Z,"match",null),d0=typeof J0==="function";if(d0)J0=J0.call(J,J);if(cK(J0),R.match=J0,R.hasMatchFunction=d0,R.isRefPath=M,R.modelNamesInOrder=O,M)H=CV1(J,W,R,Z,x,c)||H;try{vK(A,$,q,H,Z,R,c,J,_)}catch(X0){return X0}}return $;function z(L,V,P,I){let M,x=!1,_=null,O=V;if(V&&V.instance==="Array")V=V.caster;if(V&&V.$isSchemaMap)V=V.$__schemaType;let R=V&&V.options&&V.options.ref;if(B=V&&V.options&&V.options.refPath,V!=null&&V[hK]&&!R&&!B&&!P)return{modelNames:null};if(P)M=[P];else if(B!=null){if(typeof B==="function"){let S=Z.path.slice(0,Z.path.length-V.path.length-1),u=X7.get(S,L,OA),c=Array.isArray(u)?P2.array.flatten(u):u?[u]:[];M=new Set;for(let r of c)B=B.call(r,r,Z.path),bX(B,L,Z.path,W,Z._queryProjection).forEach((J0)=>M.add(J0));M=Array.from(M)}else M=bX(B,L,Z.path,W,Z._queryProjection);x=!0}else{let S,u,c,r,J0=I,d0=I.schema.options.discriminatorKey;if(!V&&d0&&(r=P2.getValue(d0,L))){let X0=GV1(I.discriminators,r)||I;if(X0!=null)J0=X0;else try{J0=dK(I.db,r)}catch(c0){return c0}if(c=J0.schema._getSchema(Z.path),c&&c.caster)c=c.caster}else c=V;if(O&&O.path.endsWith(".$*"))_=!O.$isMongooseArray&&!O._arrayPath;else if(c!=null)_=!c.$isMongooseArray&&!c._arrayPath;if((S=i6(c,"options.ref"))!=null)if(c!=null&&typeof S==="function"&&Z.path.endsWith("."+c.path)){M=new Set;let X0=Z.path.slice(0,Z.path.length-c.path.length-1),c0=X7.get(X0,L,OA),M2=Array.isArray(c0)?P2.array.flatten(c0):c0?[c0]:[];for(let J2 of M2)M.add(yK(S,J2));if(M2.length===0)M=[yK(S,L)];else M=Array.from(M)}else S=yK(S,L),M=[S];else if((c=i6(V,"options.refPath"))!=null)if(x=!0,typeof u==="function"){let X0=Z.path.slice(0,Z.path.length-c.path.length-1),c0=X7.get(X0,L,OA),M2=Array.isArray(c0)?P2.array.flatten(c0):c0?[c0]:[];M=new Set;for(let J2 of M2)u=u.call(J2,J2,Z.path),bX(u,L,Z.path,W,Z._queryProjection).forEach((_3)=>M.add(_3));M=Array.from(M)}else M=bX(u,L,Z.path,W,Z._queryProjection)}if(!M)if(Z._localModel==null)M=[I.modelName];else return{modelNames:M,justOne:_,isRefPath:x,refPath:B};if(!Array.isArray(M))M=[M];return{modelNames:M,justOne:_,isRefPath:x,refPath:B}}};/*!
857
+ * ignore
858
+ */function WV1(F,A,D,Z){let J=[],X={},$=Z.virtual;for(let G of A){let Y=null,B={},H,q=Z.nestedSchemaPath?Z.nestedSchemaPath+".":"";if(typeof D.localField==="string")H=D.localField;else if(typeof $.options.localField==="function")H=q+$.options.localField.call(G,G);else if(Array.isArray($.options.localField))H=$.options.localField.map((L)=>q+L);else H=q+$.options.localField;if(B.count=$.options.count,$.options.skip!=null&&!D.hasOwnProperty("skip"))D.skip=$.options.skip;if($.options.limit!=null&&!D.hasOwnProperty("limit"))D.limit=$.options.limit;if($.options.perDocumentLimit!=null&&!D.hasOwnProperty("perDocumentLimit"))D.perDocumentLimit=$.options.perDocumentLimit;let W=$.options.foreignField;if(!H||!W)return new mK(`Cannot populate virtual \`${D.path}\` on model \`${F.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`);if(typeof H==="function")H=H.call(G,G);if(typeof W==="function")W=W.call(G,G);B.isRefPath=!1;let C=null;if("justOne"in D&&D.justOne!==void 0)C=D.justOne;if(Y=$._getModelNamesForPopulate(G),$.options.refPath)C=!!$.options.justOne,B.isRefPath=!0;else if($.options.ref)C=!!$.options.justOne;B.isVirtual=!0,B.virtual=$,B.justOne=C;let Q=i6(B,"virtual.options.match",null)||i6(B,"virtual.options.options.match",null),K=i6(D,"match",null)||Q,U=typeof K==="function";if(U)K=K.call(G,G,B.virtual);if(Array.isArray(H)&&Array.isArray(W)&&H.length===W.length){K=Object.assign({},K);for(let L=1;L<H.length;++L)K[W[L]]=tc(X7.get(H[L],G,OA),F.schema),U=!0;H=H[0],W=W[0]}B.localField=H,B.foreignField=W,B.match=K,B.hasMatchFunction=U,cK(K);let z=rc(G,H,F,D,$);try{vK(F,J,X,Y,D,B,z,G)}catch(L){return L}}return J}/*!
859
+ * ignore
860
+ */function vK(F,A,D,Z,J,X,$,G,Y,B){let H=J.connection!=null?J.connection:F.db;if(B=B===void 0?$:B,Array.isArray(B))B=P2.cloneArrays(B);if(Z==null)return;let q=P2.array.flatten(Z),W=q.length;while(W--){let C=q[W];if(C==null)continue;let Q;if(J.model&&J.model[bK])Q=J.model;else if(C[bK])Q=C,C=Q.modelName;else try{Q=dK(H,C)}catch(L){if($!==void 0)throw L;Q=null}let K=$,U=X.modelNamesInOrder?X.modelNamesInOrder:Z;if(X.isRefPath&&Array.isArray($)&&$.length===U.length)K=sc($,U,C);let z=J.perDocumentLimit==null?i6(J,"options.perDocumentLimit",null):J.perDocumentLimit;if(!D[C]||z!=null){let L={model:Q};if(X.isVirtual&&i6(X.virtual,"options.options"))L.options=YV1(X.virtual.options.options);else if(Y!=null)L.options=Object.assign({},Y);P2.merge(L,J),J[fK]=Q,L[fK]=Q,D[C]={model:Q,options:L,match:X.hasMatchFunction?[X.match]:X.match,docs:[G],ids:[K],allIds:[$],unpopulatedValues:[B],localField:new Set([X.localField]),foreignField:new Set([X.foreignField]),justOne:X.justOne,isVirtual:X.isVirtual,virtual:X.virtual,count:X.count,[fK]:Q},A.push(D[C])}else if(D[C].localField.add(X.localField),D[C].foreignField.add(X.foreignField),D[C].docs.push(G),D[C].ids.push(K),D[C].allIds.push($),D[C].unpopulatedValues.push(B),X.hasMatchFunction)D[C].match.push(X.match)}}function dK(F,A){if(F.models[A]==null&&F._parent!=null)return dK(F._parent,A);return F.model(A)}function sc(F,A,D){if(!Array.isArray(A))return A===D?Array.isArray(F)?P2.array.flatten(F):[F]:[];if(Array.isArray(F)&&Array.isArray(A))return F.flatMap((Z,J)=>sc(Z,A[J],D));return[]}/*!
861
+ * ignore
862
+ */function yK(F,A){if(typeof F==="function"&&!F[bK])return F.call(A,A);return F}/*!
863
+ * ignore
864
+ */function rc(F,A,D,Z,J,X){let $=D.schema._getPathType(A),G=$==="real"?D.schema.path(A):$.schema,Y=G&&G.getters?G.getters:[];A=G!=null&&G.instance==="Embedded"?A+"._id":A;let B=i6(Z,"options",{}),H="getters"in B?B.getters:i6(J,"options.getters",!1);if(Y.length!==0&&H){let q=F.$__!=null?F:D.hydrate(F),W=P2.getValue(A,F);if(Array.isArray(W)){let C=P2.getValue(A.split(".").slice(0,-1),q);return W.map((Q,K)=>G.applyGetters(Q,C[K]))}else return G.applyGetters(W,q)}else return tc(X7.get(A,F,OA),X)}function tc(F,A){if(F!=null&&F.$__!=null)return F._doc._id;if(F!=null&&F._id!=null&&(A==null||!A.$isSchemaMap))return F._id;if(Array.isArray(F)){let D=F.__array!=null?F.__array:F;for(let Z=0;Z<D.length;++Z)if(D[Z]!=null&&D[Z].$__!=null)D[Z]=D[Z]._doc._id;if(P2.isMongooseArray(F)&&F.$schema())return F.$schema()._castForPopulate(F,F.$parent());return[].concat(F)}if(BV1(F)==="Object"&&(A==null||A[hK]==null)){let D=[];for(let Z of Object.keys(F))D.push(F[Z]);return D}if(F instanceof Map)return Array.from(F.values());return F}/*!
865
+ * ignore
866
+ */function CV1(F,A,D,Z,J,X){if(!D.isRefPath||J==null)return;let $=J.split("."),G="",Y=void 0;for(let B=0;B<$.length;++B){let H=$[B];G=G+(G.length===0?"":".")+H;let q=A.path(G);if(q!=null&&q.$isMongooseArray&&q.caster.discriminators!=null&&Object.keys(q.caster.discriminators).length!==0){let W=P2.getValue(G,F),C=Z.path.substring(G.length+1),Q=q.caster.schema.options.discriminatorKey;Y=[];for(let K of W){let U=P2.getValue(Q,K),z=q.caster.discriminators[U],L=z&&z.schema;if(L==null)continue;let V=L.path(C);if(V==null||V.options.refPath==null){let I=P2.getValue(D.localField.substring(G.length+1),K);X.forEach((M,x)=>{if(M===I)X[x]=$V1(M)});continue}let P=P2.getValue($.slice(B+1).join("."),K);Y.push(P)}}}return Y}function cK(F){if(F==null)return;if(typeof F!=="object")return;for(let A of Object.keys(F)){if(A==="$where")throw new mK("Cannot use $where filter with populate() match");if(F[A]!=null&&typeof F[A]==="object")cK(F[A])}}});var Al=E((zS1,Fl)=>{var QV1=L0();Fl.exports=function F(A){if(Array.isArray(A)){let Z=Object.keys(A[0]);return Z.length===1&&Z[0]==="_id"&&A[0]._id!=="hashed"}if(typeof A!=="object")return!1;let D=QV1(A,"key",{});return Object.keys(D).length===1&&D.hasOwnProperty("_id")}});var Jl=E((VS1,Zl)=>{var hX=L0(),Dl=q1();Zl.exports=function F(A,D,Z){if(Z.textIndexVersion!=null){delete Z.key._fts,delete Z.key._ftsx;let G={...Z.weights,...Z.key};if(Object.keys(G).length!==Object.keys(A).length)return!1;for(let Y of Object.keys(G)){if(!(Y in A))return!1;let B=G[Y];if(B!==hX(D,"weights."+Y)&&!(B===1&&hX(D,"weights."+Y)==null))return!1}if(D.default_language!==Z.default_language)return Z.default_language==="english"&&D.default_language==null;return!0}let J=["unique","partialFilterExpression","sparse","expireAfterSeconds","collation"];for(let G of J){if(!(G in D)&&!(G in Z))continue;if(G==="collation"){if(D[G]==null||Z[G]==null)return D[G]==null&&Z[G]==null;let Y=Object.keys(D.collation),B=D.collation,H=Z.collation;for(let q of Y)if(hX(B,q)!==hX(H,q))return!1}else if(!Dl.deepEqual(D[G],Z[G]))return!1}let X=Object.keys(A),$=Object.keys(Z.key);if(X.length!==$.length)return!1;for(let G=0;G<X.length;++G){if(X[G]!==$[G])return!1;if(!Dl.deepEqual(A[X[G]],Z.key[$[G]]))return!1}return!0}});var $l=E((LS1,Xl)=>{Xl.exports=function F(A,D){if(D.timeseries==null)return!1;let{timeField:Z,metaField:J}=D.timeseries;if(typeof Z!=="string"||typeof J!=="string")return!1;return Object.keys(A.key).length===2&&A.key[Z]===1&&A.key[J]===1}});var Hl=E((RS1,Bl)=>{var KV1=IX();function EV1(F,A){return Gl({baseModelName:F.baseModelName,discriminatorMapping:F.schema.discriminatorMapping,indexes:A,indexesType:"schema"})}function UV1(F,A){return Gl({baseModelName:F.baseModelName,discriminatorMapping:F.schema.discriminatorMapping,indexes:A,indexesType:"db"})}Bl.exports={getRelatedSchemaIndexes:EV1,getRelatedDBIndexes:UV1};function Gl({baseModelName:F,discriminatorMapping:A,indexes:D,indexesType:Z}){let J=A&&A.key,X=A&&A.value;if(!J)return D;if(Boolean(F))return D.filter((G)=>{let Y=Yl(G,Z);return Y&&Y[J]===X});return D.filter((G)=>{let Y=Yl(G,Z);return!Y||!Y[J]||KV1(Y[J])&&!("$eq"in Y[J])})}function Yl(F,A){if(A==="schema"){let D=F[1];return D&&D.partialFilterExpression}return F.partialFilterExpression}});var Wl=E((wS1,ql)=>{ql.exports=zV1;/*!
867
+ * ignore
868
+ */function zV1(F,A,D){let Z=0,J=0,X=null;if(A<=0)throw new Error("Limit must be positive");if(F.length===0)return D(null,[]);for(let B=0;B<F.length&&B<A;++B)$();function $(){F[J+Z](Y(J+Z)),++Z}let G=[];function Y(B){return(H,q)=>{if(--Z,++J,X!=null)return;if(H!=null)return X=H,D(X);if(G[B]=q,J===F.length)return D(null,G);else if(J+Z<F.length)$()}}}});var Ql=E((PS1,Cl)=>{Cl.exports=function F(A,D,Z){if(D==null)return;for(let J=0;J<D.length;++J)if(Array.isArray(D[J]))F(A,D[J],Z+"."+J);else A.push(Z+"."+J)}});var Vl=E((IS1,zl)=>{var Kl=L0(),El=z6(),Ul=KK();/*!
869
+ * ignore
870
+ */zl.exports=function F(A,D,Z){let J=Ul(Kl(D,"select",null),!0)||Ul(Kl(D,"options.select",null),!0);if(J==null)return;for(let X of A){if(!J.hasOwnProperty("-"+X))continue;for(let $ of Z)if($.$__!=null)El.unset(X,$._doc);else El.unset(X,$)}}});var Rl=E((MS1,Ll)=>{/*!
871
+ * Module dependencies.
872
+ */var VV1=w1();class lK extends VV1{constructor(F,A,D){let Z=D?.matchedCount??0,J=D?.insertedCount??0,X=A.map((G)=>G._id).join(", ");if(X.length>100)X=X.slice(0,100)+"...";let $=A.length-Z-J;super(`${F}.bulkSave() was not able to update ${$} of the given documents due to incorrect version or optimistic concurrency, document ids: ${X}`);this.modelName=F,this.documents=A,this.bulkWriteResult=D,this.numDocumentsNotUpdated=$}}Object.defineProperty(lK.prototype,"name",{value:"MongooseBulkSaveIncompleteError"});/*!
873
+ * exports
874
+ */Ll.exports=lK});var kK=E((vl,ml)=>{/*!
875
+ * Module dependencies.
876
+ */var LV1=MK(),RV1=aq(),S3=r2(),wV1=lZ(),iK=i("node:events").EventEmitter,sK=m9(),dX=IQ(),W1=a2(),PV1=oZ(),IV1=XW(),vX=jX(),MV1=od(),aK=g8(),mX=c9(),kl=AW(),wl=ZW(),NV1=eZ(),jV1=Fc(),TV1=TK(),kV1=jJ(),Ol=Zc(),OV1=$c(),SV1=AK(),Sl=Hc(),_V1=Wc(),_l=Qc(),uV1=Vc(),ul=DK(),xV1=wc(),gV1=hc(),fV1=dQ(),K4=K0(),yV1=cc(),xl=vQ(),pK=TQ(),gl=ZJ(),bV1=aJ(),nK=lC(),uA=L0(),hV1=b2(),SA=d6(),vV1=ec(),xA=g6(),rK=H3().internalToObjectOptions,tK=Al(),fl=Jl(),mV1=$l(),{getRelatedDBIndexes:dV1,getRelatedSchemaIndexes:cV1}=Hl(),oK=WC(),lV1=XJ(),pV1=TA(),iV1=Wl(),aV1=PK(),yl=Ql(),nV1=Vl(),sV1=uQ(),Pl=i("node:util"),t1=q1(),rV1=jW(),tV1=Rl(),oV1=tZ(),$7=cQ(),Y7=Symbol("mongoose#Model#collection"),G7=Symbol("mongoose#Model#db"),bl=A1().modelSymbol,_A=Symbol("mongoose#Model#subclassed"),{VERSION_INC:cX,VERSION_WHERE:Il,VERSION_ALL:eV1}=S3,FL1=Object.assign({},rK,{bson:!0});function p(F,A,D){if(A instanceof aK)throw new TypeError("2nd argument to `Model` constructor must be a POJO or string, **not** a schema. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`.");if(typeof F==="string")throw new TypeError("First argument to `Model` constructor must be an object, **not** a string. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`.");S3.call(this,F,A,D)}Object.setPrototypeOf(p.prototype,S3.prototype);p.prototype.$isMongooseModelPrototype=!0;p.prototype.db;p.useConnection=function F(A){if(!A)throw new Error("Please provide a connection.");if(this.db)delete this.db.models[this.modelName],delete this.prototype.db,delete this.prototype[G7],delete this.prototype.collection,delete this.prototype.$collection,delete this.prototype[Y7];this.db=A;let D=A.collection(this.modelName,A.options);return this.prototype.collection=D,this.prototype.$collection=D,this.prototype[Y7]=D,this.prototype.db=A,this.prototype[G7]=A,this.collection=D,this.$__collection=D,A.models[this.modelName]=this,this};p.prototype.collection;p.prototype.$__collection;p.prototype.modelName;p.prototype.$where;p.prototype.baseModelName;p.events;p._middleware;/*!
877
+ * ignore
878
+ */function hl(F,A){if(F.$where==null)return;for(let D of Object.keys(F.$where))A[D]=F.$where[D]}/*!
879
+ * ignore
880
+ */p.prototype.$__handleSave=function(F,A){let D={};if(ul(this.$__schema,F),typeof F.writeConcern!=="undefined"){if(D.writeConcern={},"w"in F.writeConcern)D.writeConcern.w=F.writeConcern.w;if("j"in F.writeConcern)D.writeConcern.j=F.writeConcern.j;if("wtimeout"in F.writeConcern)D.writeConcern.wtimeout=F.writeConcern.wtimeout}else{if("w"in F)D.w=F.w;if("j"in F)D.j=F.j;if("wtimeout"in F)D.wtimeout=F.wtimeout}if("checkKeys"in F)D.checkKeys=F.checkKeys;let Z=this.$session(),J=this[G7].base.transactionAsyncLocalStorage?.getStore();if(Z!=null)D.session=Z;else if(!F.hasOwnProperty("session")&&J?.session!=null)D.session=J.session;if(this.$isNew){let G=this.toObject(FL1);if((G||{})._id===void 0){xA(function(){A(new W1("document must have an _id before saving"))});return}this.$__version(!0,G),this[Y7].insertOne(G,D).then((Y)=>A(null,Y),(Y)=>{J5(this,!0),A(Y,null)}),this.$__reset(),J5(this,!1),this.$__.inserting=!0;return}this.$__.inserting=!1;let X=this.$__delta();if(F.pathsToSave)for(let G in X[1].$set)if(F.pathsToSave.includes(G))continue;else if(F.pathsToSave.some((Y)=>G.slice(0,Y.length)===Y&&G.charAt(Y.length)==="."))continue;else delete X[1].$set[G];if(X){if(X instanceof W1){A(X);return}let G=this.$__where(X[0]);if(G instanceof W1){A(G);return}hl(this,G);let Y=X[1];if(this.$__schema.options.minimize)for(let B of Object.values(Y)){if(B==null)continue;for(let H of Object.keys(B)){if(B[H]==null||typeof B[H]!=="object")continue;if(!t1.isPOJO(B[H]))continue;if(rV1(B[H]),Object.keys(B[H]).length===0)delete B[H],Y.$unset=Y.$unset||{},Y.$unset[H]=1}}this[Y7].updateOne(G,Y,D).then((B)=>{if(B==null)B={$where:G};else B.$where=G;A(null,B)},(B)=>{this.$__undoReset(),A(B)})}else{$.call(this);return}this.$__.modifiedPaths=this.modifiedPaths(),this.$__reset(),J5(this,!1);function $(){let G=Object.assign({},F,D),Y=this.$__where(),B=this.$__schema.options.optimisticConcurrency;if(B&&!Array.isArray(B)){let H=this.$__schema.options.versionKey,q=this.$__getValue(H);if(q!=null)Y[H]=q}SV1(this.$__schema,G),this.constructor.collection.findOne(Y,G).then((H)=>{A(null,{$where:Y,matchedCount:!H?0:1})}).catch(A)}};/*!
881
+ * ignore
882
+ */p.prototype.$__save=function(F,A){this.$__handleSave(F,(D,Z)=>{if(D)return D=this.$__schema._transformDuplicateKeyError(D),this.$__schema.s.hooks.execPost("save:error",this,[this],{error:D},(G)=>{A(G,this)});let J=0;if((F!=null?F.writeConcern!=null?F.writeConcern.w:F.w:0)!==0){if(Z!=null)if(Array.isArray(Z))J=Z.length;else if(Z.matchedCount!=null)J=Z.matchedCount;else J=Z;if(this.$__.version&&!this.$__.inserting){let G=cX===(cX&this.$__.version);this.$__.version=void 0;let Y=this.$__schema.options.versionKey,B=this.$__getValue(Y)||0;if(J<=0){this.$__undoReset();let H=this.$__.$versionError||new kl(this,B,this.$__.modifiedPaths);return A(H)}if(G)this.$__setValue(Y,B+1)}if(Z!=null&&J<=0)return this.$__undoReset(),D=new wV1(Z.$where,this.constructor.modelName,J,Z),this.$__schema.s.hooks.execPost("save:error",this,[this],{error:D},(Y)=>{A(Y,this)})}this.$__.saving=void 0,this.$__.savedState={},this.$emit("save",this,J),this.constructor.emit("save",this,J),A(null,this)})};/*!
883
+ * ignore
884
+ */function AL1(F,A){let D=F.$__schema.options.versionKey;if(!D)return null;let Z=F.$__getValue(D)||0;return new kl(F,Z,A)}p.prototype.save=async function F(A){if(typeof A==="function"||typeof arguments[1]==="function")throw new W1("Model.prototype.save() no longer accepts a callback");let D;if(this.$op="save",this.$__.saving)D=new wl(this);else this.$__.saving=new wl(this);if(A=new MV1(A),A.hasOwnProperty("session"))this.$session(A.session);if(this.$__.timestamps!=null)A.timestamps=this.$__.timestamps;if(this.$__.$versionError=AL1(this,this.modifiedPaths()),D)throw this.$__handleReject(D),D;return this.$__.saveOptions=A,await new Promise((Z,J)=>{this.$__save(A,(X)=>{if(this.$__.saving=null,this.$__.saveOptions=null,this.$__.$versionError=null,this.$op=null,X!=null)return this.$__handleReject(X),J(X);Z()})}),this};p.prototype.$save=p.prototype.save;p.prototype.$__version=function(F,A){let D=this.$__schema.options.versionKey;if(F===!0){if(D)sV1(A,D,0),this.$__setValue(D,0);return}if(D===!1)return;if(!this.$__isSelected(D))return;if(Il===(Il&this.$__.version)){let Z=this.$__getValue(D);if(Z!=null)F[D]=Z}if(cX===(cX&this.$__.version))if(uA(A.$set,D,null)!=null)++A.$set[D];else A.$inc=A.$inc||{},A.$inc[D]=1};p.prototype.increment=function F(){return this.$__.version=eV1,this};p.prototype.$__where=function F(A){if(A||(A={}),!A._id)A._id=this._doc._id;if(this._doc._id===void 0)return new W1("No _id found on document!");return A};p.prototype.deleteOne=function F(A){if(typeof A==="function"||typeof arguments[1]==="function")throw new W1("Model.prototype.deleteOne() no longer accepts a callback");if(!A)A={};if(A.hasOwnProperty("session"))this.$session(A.session);let D=this,Z=this.$__where();if(Z instanceof Error)throw Z;let J=D.constructor.deleteOne(Z,A);if(this.$session()!=null){if(!("session"in J.options))J.options.session=this.$session()}return J.pre(function X($){D.constructor._middleware.execPre("deleteOne",D,[D],$)}),J.pre(function X($){nK(D.$getAllSubdocs(),(G,Y)=>{G.constructor._middleware.execPre("deleteOne",G,[G],Y)},$)}),J.pre(function X($){if(D.$__.isDeleted)return $(sK.skipWrappedFunction());return $()}),J.post(function X($){nK(D.$getAllSubdocs(),(G,Y)=>{G.constructor._middleware.execPost("deleteOne",G,[G],{},Y)},$)}),J.post(function X($){D.constructor._middleware.execPost("deleteOne",D,[D],{},$)}),J};p.prototype.$model=function F(A){if(arguments.length===0)return this.constructor;return this[G7].model(A)};p.prototype.model=p.prototype.$model;p.exists=function F(A,D){if(z1(this,"exists"),typeof arguments[2]==="function")throw new W1("Model.exists() no longer accepts a callback");return this.findOne(A).select({_id:1}).lean().setOptions(D)};p.discriminator=function(F,A,D){let Z;if(typeof F==="function"){if(Z=F,F=t1.getFunctionName(Z),!(Z.prototype instanceof p))throw new W1("The provided class "+F+" must extend Model")}D=D||{};let J=t1.isPOJO(D)?D.value:D,X=typeof D.clone==="boolean"?D.clone:!0,$=typeof D.mergePlugins==="boolean"?D.mergePlugins:!0,G=typeof D.overwriteModels==="boolean"?D.overwriteModels:!1;if(z1(this,"discriminator"),t1.isObject(A)&&!A.instanceOfSchema)A=new aK(A);if(A instanceof aK&&X)A=A.clone();if(A=bV1(this,F,A,J,$,D.mergeHooks,G),this.db.models[F]&&!A.options.overwriteModels&&!G)throw new IV1(F);A.$isRootDiscriminator=!0,A.$globalPluginsApplied=!0,Z=this.db.model(Z||F,A,this.$__collection.name),this.discriminators[F]=Z;let Y=this.discriminators[F];if(Object.setPrototypeOf(Y.prototype,this.prototype),Object.defineProperty(Y,"baseModelName",{value:this.modelName,configurable:!0,writable:!1}),Ol(Y,A),_l(Y,A),this[_A]!=null)for(let B of this[_A])B.discriminators=B.discriminators||{},B.discriminators[F]=Z.__subclass(Z.db,A,B.collection.name);return Y};function z1(F,A){if(F==null||F===global)throw new W1("`Model."+A+"()` cannot run without a model as `this`. Make sure you are calling `MyModel."+A+"()` where `MyModel` is a Mongoose model.");else if(F[bl]==null)throw new W1("`Model."+A+"()` cannot run without a model as `this`. Make sure you are not calling `new Model."+A+"()`")}/*!
885
+ * Give the constructor the ability to emit events.
886
+ */for(let F in iK.prototype)p[F]=iK.prototype[F];p.init=function F(){if(z1(this,"init"),typeof arguments[0]==="function")throw new W1("Model.init() no longer accepts a callback");if(this.schema.emit("init",this),this.$init!=null)return this.$init;let A=this.db,D=async()=>{if(!t1.getOption("autoIndex",this.schema.options,A.config,A.base.options))return;return await this.ensureIndexes({_automatic:!0})},Z=async()=>{if(!t1.getOption("autoSearchIndex",this.schema.options,A.config,A.base.options))return;let Y=[];for(let B of this.schema._searchIndexes)Y.push(await this.createSearchIndex(B));return Y},J=async()=>{let G=t1.getOption("autoCreate",this.schema.options,A.config);if(G==null)await A._waitForConnect(!0),G=t1.getOption("autoCreate",this.schema.options,A.config,A.base.options);if(!G)return;return await this.createCollection()};this.$init=J().then(()=>D()).then(()=>Z());let X=this.$init.catch,$=this;return this.$init.catch=function(){return $.$caught=!0,X.apply($.$init,arguments)},this.$init};p.createCollection=async function F(A){if(z1(this,"createCollection"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new W1("Model.createCollection() no longer accepts a callback");let D=await new Promise((Y,B)=>{this.hooks.execPre("createCollection",this,[A],(H)=>{if(H!=null){if(H instanceof sK.skipWrappedFunction)return Y(!0);return B(H)}Y()})}),Z=this&&this.schema&&this.schema.options&&this.schema.options.collectionOptions;if(Z!=null)A=Object.assign({},Z,A);let J=this&&this.schema&&this.schema.options&&this.schema.options.collation;if(J!=null)A=Object.assign({collation:J},A);let X=this&&this.schema&&this.schema.options&&this.schema.options.capped;if(X!=null){if(typeof X==="number")A=Object.assign({capped:!0,size:X},A);else if(typeof X==="object")A=Object.assign({capped:!0},X,A)}let $=this&&this.schema&&this.schema.options&&this.schema.options.timeseries;if($!=null){if(A=Object.assign({timeseries:$},A),A.expireAfterSeconds!=null);else if(A.expires!=null)t1.expires(A);else if(this.schema.options.expireAfterSeconds!=null)A.expireAfterSeconds=this.schema.options.expireAfterSeconds;else if(this.schema.options.expires!=null)A.expires=this.schema.options.expires,t1.expires(A)}let G=this&&this.schema&&this.schema.options&&this.schema.options.clusteredIndex;if(G!=null)A=Object.assign({clusteredIndex:{...G,unique:!0}},A);try{if(!D)await this.db.createCollection(this.$__collection.collectionName,A)}catch(Y){if(Y!=null&&(Y.name!=="MongoServerError"||Y.code!==48))await new Promise((B,H)=>{let q={error:Y};this.hooks.execPost("createCollection",this,[null],q,(W)=>{if(W!=null)return H(W);B()})})}return await new Promise((Y,B)=>{this.hooks.execPost("createCollection",this,[this.$__collection],(H)=>{if(H!=null)return B(H);Y()})}),this.$__collection};p.syncIndexes=async function F(A){if(z1(this,"syncIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new W1("Model.syncIndexes() no longer accepts a callback");if(A?.autoCreate??this.schema.options?.autoCreate??this.db.config.autoCreate??!0)try{await this.createCollection()}catch(X){if(X!=null&&(X.name!=="MongoServerError"||X.code!==48))throw X}let Z=await this.diffIndexes({indexOptionsToCreate:!0}),J=await this.cleanIndexes({...A,toDrop:Z.toDrop});return await this.createIndexes({...A,toCreate:Z.toCreate}),J};p.createSearchIndex=async function F(A){return z1(this,"createSearchIndex"),await this.$__collection.createSearchIndex(A)};p.updateSearchIndex=async function F(A,D){return z1(this,"updateSearchIndex"),await this.$__collection.updateSearchIndex(A,D)};p.dropSearchIndex=async function F(A){return z1(this,"dropSearchIndex"),await this.$__collection.dropSearchIndex(A)};p.listSearchIndexes=async function F(A){return z1(this,"listSearchIndexes"),await(await this.$__collection.listSearchIndexes(A)).toArray()};p.diffIndexes=async function F(A){if(typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new W1("Model.syncIndexes() no longer accepts a callback");let D=this,Z=await D.listIndexes().catch((Y)=>{if(Y.codeName=="NamespaceNotFound")return;throw Y});if(Z===void 0)Z=[];Z=dV1(D,Z);let J=D.schema,X=cV1(D,J.indexes()),$=ZL1(J,X,Z),G=DL1(J,X,Z,$,A);return{toDrop:$,toCreate:G}};function DL1(F,A,D,Z,J){let X=[],$=J?.indexOptionsToCreate??!1;for(let[G,Y]of A){let B=!1,H=oK(F,K4(Y));for(let q of D){if(tK(q))continue;if(fl(G,H,q)&&!Z.includes(q.name)){B=!0;break}}if(!B)if($)X.push([G,Y]);else X.push(G)}return X}function ZL1(F,A,D){let Z=[];for(let J of D){let X=!1;if(tK(J))continue;if(mV1(J,F.options))continue;for(let[$,G]of A){let Y=oK(F,K4(G));if(Sl($,Y,F.options),fl($,Y,J)){X=!0;break}}if(X)continue;Z.push(J.name)}return Z}p.cleanIndexes=async function F(A){if(z1(this,"cleanIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new W1("Model.cleanIndexes() no longer accepts a callback");let D=this;if(Array.isArray(A&&A.toDrop))return await Ml(A.toDrop,D,A);let Z=await D.diffIndexes();return await Ml(Z.toDrop,D,A)};async function Ml(F,A,D){if(F.length===0)return[];let Z=A.$__collection;if(D&&D.hideIndexes)await Promise.all(F.map((J)=>{return A.db.db.command({collMod:Z.collectionName,index:{name:J,hidden:!0}})}));else await Promise.all(F.map((J)=>Z.dropIndex(J)));return F}p.listIndexes=async function F(){if(z1(this,"listIndexes"),typeof arguments[0]==="function")throw new W1("Model.listIndexes() no longer accepts a callback");if(this.$__collection.buffer)await new Promise((A)=>{this.$__collection.addQueue(A)});return this.$__collection.listIndexes().toArray()};p.ensureIndexes=async function F(A){if(z1(this,"ensureIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new W1("Model.ensureIndexes() no longer accepts a callback");await new Promise((D,Z)=>{JL1(this,A,(J)=>{if(J!=null)return Z(J);D()})})};p.createIndexes=async function F(A){if(z1(this,"createIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new W1("Model.createIndexes() no longer accepts a callback");return this.ensureIndexes(A)};/*!
887
+ * ignore
888
+ */function JL1(F,A,D){let Z=Array.isArray(A?.toCreate)?A.toCreate:F.schema.indexes(),J;A=A||{};let X=function(q){if(q&&!F.$caught)F.emit("error",q);F.emit("index",q||J),D&&D(q||J)};for(let q of Z)if(tK(q))t1.warn('mongoose: Cannot specify a custom index on `_id` for model name "'+F.modelName+'", MongoDB does not allow overwriting the default `_id` index. See https://bit.ly/mongodb-id-index');if(!Z.length){xA(function(){X()});return}let $=function(q,W,C,Q){F.emit("index-single-done",q,W,C,Q)},G=function(q,W){F.emit("index-single-start",q,W)},Y=F.schema._baseSchema,B=Y?Y.indexes():[];xA(function(){if(A._automatic&&!F.collection.collection)F.collection.addQueue(H,[]);else H()});function H(){if(A._automatic){if(F.schema.options.autoIndex===!1||F.schema.options.autoIndex==null&&F.db.config.autoIndex===!1)return X()}let q=Z.shift();if(!q)return X();if(A._automatic&&q[1]._autoIndex===!1)return H();if(B.find((K)=>t1.deepEqual(K,q)))return H();let W=K4(q[0]),C=K4(q[1]);if(delete C._autoIndex,oK(F.schema,C),ul(F.schema,C),Sl(W,C,F.schema.options),G(W,A),"background"in A)C.background=A.background;let Q=null;try{Q=F.collection.createIndex(W,C)}catch(K){if(!J)J=K;if(!F.$caught)F.emit("error",K);$(K,W,C),H();return}Q.then((K)=>{$(null,W,C,K),H()},(K)=>{if(!J)J=K;if(!F.$caught)F.emit("error",K);$(K,W,C),H()})}}p.schema;p.db;p.collection;p.$__collection;p.base;p.discriminators;p.translateAliases=function F(A,D){z1(this,"translateAliases");let Z=(J,X)=>{let $,G=[],Y=J.split("."),B=this.schema;for(let q in Y){let W=Y[q];if(B&&B.aliases[W]){if($=B.aliases[W],D&&$ in A)throw new W1(`Provided object has both field "${W}" and its alias "${$}"`);G.push($)}else $=W,G.push(W);if(B&&B.paths[$])B=B.paths[$].schema;else B=null}let H=G.join(".");if(A instanceof Map)A.set(H,X);else A[H]=X;if(H!==J)if(A instanceof Map)A.delete(J);else delete A[J];return A};if(typeof A==="object"){if(A instanceof Map)for(let J of new Map(A))A=Z(J[0],J[1]);else for(let J of Object.keys(A))if(A=Z(J,A[J]),J[0]==="$")if(Array.isArray(A[J]))for(let X in A[J])A[J][X]=this.translateAliases(A[J][X]);else this.translateAliases(A[J]);return A}else return A};p.deleteOne=function F(A,D){if(z1(this,"deleteOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.prototype.deleteOne() no longer accepts a callback");let Z=new this.Query({},{},this,this.$__collection);return Z.setOptions(D),Z.deleteOne(A)};p.deleteMany=function F(A,D){if(z1(this,"deleteMany"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.deleteMany() no longer accepts a callback");let Z=new this.Query({},{},this,this.$__collection);return Z.setOptions(D),Z.deleteMany(A)};p.find=function F(A,D,Z){if(z1(this,"find"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new W1("Model.find() no longer accepts a callback");let J=new this.Query({},{},this,this.$__collection);return J.select(D),J.setOptions(Z),J.find(A)};p.findById=function F(A,D,Z){if(z1(this,"findById"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.findById() no longer accepts a callback");if(typeof A==="undefined")A=null;return this.findOne({_id:A},D,Z)};p.findOne=function F(A,D,Z){if(z1(this,"findOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.findOne() no longer accepts a callback");let J=new this.Query({},{},this,this.$__collection);return J.select(D),J.setOptions(Z),J.findOne(A)};p.estimatedDocumentCount=function F(A){return z1(this,"estimatedDocumentCount"),new this.Query({},{},this,this.$__collection).estimatedDocumentCount(A)};p.countDocuments=function F(A,D){if(z1(this,"countDocuments"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.countDocuments() no longer accepts a callback");let Z=new this.Query({},{},this,this.$__collection);if(D!=null)Z.setOptions(D);return Z.countDocuments(A)};p.distinct=function F(A,D,Z){if(z1(this,"distinct"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.distinct() no longer accepts a callback");let J=new this.Query({},{},this,this.$__collection);if(Z!=null)J.setOptions(Z);return J.distinct(A,D)};p.where=function F(A,D){z1(this,"where");let Z=new this.Query({},{},this,this.$__collection).find({});return Z.where.apply(Z,arguments)};p.$where=function F(){z1(this,"$where");let A=new this.Query({},{},this,this.$__collection).find({});return A.$where.apply(A,arguments)};p.findOneAndUpdate=function(F,A,D){if(z1(this,"findOneAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new W1("Model.findOneAndUpdate() no longer accepts a callback");if(arguments.length===1)A=F,F=null,D=null;let Z;if(D)Z=D.fields||D.projection;A=K4(A,{depopulate:!0,_isNested:!0}),xl(A,D,this.schema.options.versionKey);let J=new this.Query({},{},this,this.$__collection);return J.select(Z),J.findOneAndUpdate(F,A,D)};p.findByIdAndUpdate=function(F,A,D){if(z1(this,"findByIdAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new W1("Model.findByIdAndUpdate() no longer accepts a callback");if(F instanceof S3)F=F._doc._id;return this.findOneAndUpdate.call(this,{_id:F},A,D)};p.findOneAndDelete=function(F,A){if(z1(this,"findOneAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.findOneAndDelete() no longer accepts a callback");let D;if(A)D=A.select,A.select=void 0;let Z=new this.Query({},{},this,this.$__collection);return Z.select(D),Z.findOneAndDelete(F,A)};p.findByIdAndDelete=function(F,A){if(z1(this,"findByIdAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new W1("Model.findByIdAndDelete() no longer accepts a callback");return this.findOneAndDelete({_id:F},A)};p.findOneAndReplace=function(F,A,D){if(z1(this,"findOneAndReplace"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new W1("Model.findOneAndReplace() no longer accepts a callback");let Z;if(D)Z=D.select,D.select=void 0;let J=new this.Query({},{},this,this.$__collection);return J.select(Z),J.findOneAndReplace(F,A,D)};p.create=async function F(A,D){if(typeof D==="function"||typeof arguments[2]==="function")throw new W1("Model.create() no longer accepts a callback");z1(this,"create");let Z,J=this.schema.options.discriminatorKey;if(Array.isArray(A))Z=A,D=D!=null&&typeof D==="object"?D:{};else{let G=arguments[arguments.length-1];if(D={},typeof G==="function"||typeof D==="function"||typeof arguments[2]==="function")throw new W1("Model.create() no longer accepts a callback");else if(Z=[...arguments],Z.length>1&&!G)Z.pop();if(Z.length===2&&Z[0]!=null&&Z[1]!=null&&Z[0].session==null&&G&&hV1(G.session)==="ClientSession"&&!this.schema.path("session"))t1.warn("WARNING: to pass a `session` to `Model.create()` in Mongoose, you **must** pass an array as the first argument. See: https://mongoosejs.com/docs/api/model.html#Model.create()")}if(Z.length===0)return Array.isArray(A)?[]:null;let X=[],$=typeof D.aggregateErrors==="boolean"?!D.aggregateErrors:!0;if(delete D.aggregateErrors,D.session&&!D.ordered&&Z.length>1)throw new W1("Cannot call `create()` with a session and multiple documents unless `ordered: true` is set");if(D.ordered){for(let G=0;G<Z.length;G++)try{let Y=Z[G],B=this.discriminators&&Y[J]!=null?this.discriminators[Y[J]]||SA(this.discriminators,Y[J]):this;if(B==null)throw new W1(`Discriminator "${Y[J]}" not found for model "${this.modelName}"`);let H=Y;if(!(H instanceof B))H=new B(H);await H.$save(D),X.push(H)}catch(Y){if(!$)X.push(Y);else throw Y}return X}else if(!$)X=await Promise.allSettled(Z.map(async(G)=>{let Y=this.discriminators&&G[J]!=null?this.discriminators[G[J]]||SA(this.discriminators,G[J]):this;if(Y==null)throw new W1(`Discriminator "${G[J]}" not found for model "${this.modelName}"`);let B=G;if(!(B instanceof Y))B=new Y(B);return await B.$save(D),B})),X=X.map((G)=>G.status==="fulfilled"?G.value:G.reason);else{let G=null;if(X=await Promise.all(Z.map(async(Y)=>{let B=this.discriminators&&Y[J]!=null?this.discriminators[Y[J]]||SA(this.discriminators,Y[J]):this;if(B==null)throw new W1(`Discriminator "${Y[J]}" not found for model "${this.modelName}"`);try{let H=Y;if(!(H instanceof B))H=new B(H);return await H.$save(D),H}catch(H){if(!G)G=H}})),G)throw G}if(!Array.isArray(A)&&Z.length===1)return X[0];return X};p.insertOne=async function F(A,D){z1(this,"insertOne");let Z=this.schema.options.discriminatorKey,J=this.discriminators&&A[Z]!=null?this.discriminators[A[Z]]||SA(this.discriminators,A[Z]):this;if(J==null)throw new W1(`Discriminator "${A[Z]}" not found for model "${this.modelName}"`);if(!(A instanceof J))A=new J(A);return await A.$save(D)};p.watch=function(F,A){z1(this,"watch");let D=(Z)=>{if(F=F||[],aV1(F,this.schema,"fullDocument"),this.$__collection.buffer)this.$__collection.addQueue(()=>{if(this.closed)return;let J=this.$__collection.watch(F,A);Z(null,J)});else{let J=this.$__collection.watch(F,A);Z(null,J)}};return A=A||{},A.model=this,new RV1(D,F,A)};p.startSession=function(){return z1(this,"startSession"),this.db.startSession.apply(this.db,arguments)};p.insertMany=async function F(A,D){if(z1(this,"insertMany"),typeof D==="function"||typeof arguments[2]==="function")throw new W1("Model.insertMany() no longer accepts a callback");return new Promise((Z,J)=>{this.$__insertMany(A,D,(X,$)=>{if(X!=null)return J(X);Z($)})})};p.$__insertMany=function(F,A,D){let Z=this;if(typeof A==="function")D=A,A=null;D=D||t1.noop,A=A||{};let J=A.limit||1000,X=!!A.rawResult,$=typeof A.ordered==="boolean"?A.ordered:!0,G=typeof A.throwOnValidationError==="boolean"?A.throwOnValidationError:!1,Y=!!A.lean,B=this.db.base.transactionAsyncLocalStorage?.getStore();if((!A||!A.hasOwnProperty("session"))&&B?.session!=null)A={...A,session:B.session};if(!Array.isArray(F))F=[F];let H=[],q=new Map,W=$?null:new Array(F.length),C=F.map((Q,K)=>(U)=>{if(Y)return xA(()=>U(null,Q));let z=!1;if(!(Q instanceof Z)){if(Q!=null&&typeof Q!=="object")return U(new PV1(Q,"arr."+K,"insertMany"));try{Q=new Z(Q),z=!0}catch(L){return U(L)}}if(A.session!=null)Q.$session(A.session);if(Y)return xA(()=>U(null,Q));Q.$validate(z?{_skipParallelValidateCheck:!0}:null).then(()=>{U(null,Q)},(L)=>{if($===!1)return H.push(L),q.set(L,K),W[K]=L,U(null,null);U(L)})});iV1(C,J,function(Q,K){if(Q){D(Q,null);return}let U=new Map,z=new Map;for(let P=0;P<K.length;++P)U.set(K[P],P);let L=K.filter(function(P){return P!=null});for(let P=0;P<L.length;++P)z.set(P,U.get(L[P]));if(H.length>0)H.sort((P,I)=>{return q.get(P)-q.get(I)});if(L.length===0){if(G)return D(new dX(H,W,null,"insertMany"));if(X){let P={acknowledged:!0,insertedCount:0,insertedIds:{}};return $7(P,H,H),D(null,P)}D(null,[]);return}let V=Y?L:L.map(function(P){if(P.$__schema.options.versionKey)P[P.$__schema.options.versionKey]=0;if((!A||A.timestamps!==!1)&&P.initializeTimestamps&&(!P.$__||P.$__.timestamps!==!1))P.initializeTimestamps();if(P.$__hasOnlyPrimitiveValues())return P.$__toObjectShallow();return P.toObject(rK)});Z.$__collection.insertMany(V,A).then((P)=>{if(!Y)for(let I of L)I.$__reset(),J5(I,!1);if($===!1&&G&&H.length>0){for(let I=0;I<W.length;++I)if(W[I]===void 0)W[I]=K[I];return D(new dX(H,W,P,"insertMany"))}if(X){if($===!1){for(let I=0;I<W.length;++I)if(W[I]===void 0)W[I]=K[I];$7(P,H,W)}return D(null,P)}if(A.populate!=null)return Z.populate(L,A.populate).then((I)=>{D(null,I)},(I)=>{if(I!=null)I.insertedDocs=L;throw I});D(null,L)},(P)=>{if(P.writeErrors==null&&(P.result&&P.result.result&&P.result.result.writeErrors)!=null)P.writeErrors=P.result.result.writeErrors;let I=P&&P.writeErrors,M=new Set((P&&P.writeErrors||[]).map((_)=>_.index));if(P.writeErrors!=null)for(let _=0;_<P.writeErrors.length;++_){let O=z.get(P.writeErrors[_].index);if(P.writeErrors[_]={...P.writeErrors[_],index:O},!$)W[O]=P.writeErrors[_]}if(!$){for(let _=0;_<W.length;++_)if(W[_]===void 0)W[_]=K[_];P.results=W}let x=-1;if(P.insertedDocs=L.filter((_,O)=>{let R=!I||M.has(O);if($){if(x>-1)return O<x;if(R)x=O}return!R}).map(function _(O){if(Y)return O;return O.$__reset(),J5(O,!1),O}),X&&$===!1)$7(P,H,W);D(P,null)})})};/*!
889
+ * ignore
890
+ */function J5(F,A){F.$isNew=A,F.$emit("isNew",A),F.constructor.emit("isNew",A);let D=F.$getAllSubdocs({useCache:!0});for(let Z of D)Z.$isNew=A,Z.$emit("isNew",A)}p.bulkWrite=async function F(A,D){if(z1(this,"bulkWrite"),typeof D==="function"||typeof arguments[2]==="function")throw new W1("Model.bulkWrite() no longer accepts a callback");D=D||{};let Z=await new Promise((Y,B)=>{this.hooks.execPre("bulkWrite",this,[A,D],(H)=>{if(H!=null){if(H instanceof sK.skipWrappedFunction)return Y(H);return B(H)}Y()})});if(Z)return Z.args[0];let J=D.ordered==null?!0:D.ordered;if(A.length===0){let B=new(this.base.driver.get()).BulkWriteResult(pK(),!1);return B.n=0,$7(B,[],[]),B}let X=A.map((Y)=>fV1(this,Y,D)),$=this.db.base.transactionAsyncLocalStorage?.getStore();if((!D||!D.hasOwnProperty("session"))&&$?.session!=null)D={...D,session:$.session};let G=null;if(J){await new Promise((Y,B)=>{nK(X,(H,q)=>H(q),(H)=>{if(H)return B(H);Y()})});try{G=await this.$__collection.bulkWrite(A,D)}catch(Y){await new Promise((B,H)=>{let q={error:Y};this.hooks.execPost("bulkWrite",this,[null],q,(W)=>{if(W!=null)return H(W);B()})})}}else{let Y=X.length,B=[],H=[],q=[];await new Promise((K)=>{for(let U=0;U<X.length;++U)X[U]((z)=>{if(z==null)B.push(U);else H.push({index:U,error:z}),q[U]=z;if(--Y<=0)K()})}),H=H.sort((K,U)=>K.index-U.index).map((K)=>K.error);let W=B;if(B=B.sort().map((K)=>A[K]),B.length===0){if(D.throwOnValidationError&&H.length)throw new dX(H,q,G,"bulkWrite");let U=new(this.base.driver.get()).BulkWriteResult(pK(),!1);return U.result=pK(),$7(U,H,q),U}let C;[G,C]=await this.$__collection.bulkWrite(B,D).then((K)=>[K,null]).catch((K)=>[null,K]);let Q={};if(C?.writeErrors)for(let K of C.writeErrors)Q[K.err.index]=K;for(let K=0;K<W.length;++K)q[W[K]]=Q[K]??null;if(C){if(H.length>0)$7(C,H,q);await new Promise((K,U)=>{let z={error:C};this.hooks.execPost("bulkWrite",this,[null],z,(L)=>{if(L!=null)return U(L);K()})})}if(H.length>0)if(D.throwOnValidationError)throw new dX(H,q,G,"bulkWrite");else $7(G,H,q)}return await new Promise((Y,B)=>{this.hooks.execPost("bulkWrite",this,[G],(H)=>{if(H!=null)return B(H);Y()})}),G};p.bulkSave=async function F(A,D){if(D=D||{},D.timestamps!=null)for(let B of A)B.$__.saveOptions=B.$__.saveOptions||{},B.$__.saveOptions.timestamps=D.timestamps;else for(let B of A)if(B.$__.timestamps!=null)B.$__.saveOptions=B.$__.saveOptions||{},B.$__.saveOptions.timestamps=B.$__.timestamps;await Promise.all(A.map((B)=>XL1(B,D)));let Z=this.buildBulkWriteOperations(A,{skipValidation:!0,timestamps:D.timestamps}),{bulkWriteResult:J,bulkWriteError:X}=await this.bulkWrite(Z,{skipValidation:!0,...D}).then((B)=>({bulkWriteResult:B,bulkWriteError:null}),(B)=>({bulkWriteResult:null,bulkWriteError:B}));if(X!=null&&X.name!=="MongoBulkWriteError")throw X;let $=J?.matchedCount??0,G=J?.insertedCount??0;if(Z.length>0&&$+G<Z.length&&!X)throw new tV1(this.modelName,A,J);let Y=[];for(let B=0;B<A.length;B++){let H=A[B];if((X&&X.writeErrors.find((W)=>{return(W.err.op._id||W.err.op.q._id).toString()===H._doc._id.toString()}))==null)Y.push(H)}if(await Promise.all(Y.map((B)=>$L1(B))),X!=null)throw X;return J};function XL1(F,A){return new Promise((D,Z)=>{F.schema.s.hooks.execPre("save",F,[A],(J)=>{if(J){Z(J);return}D()})})}function $L1(F){return new Promise((A,D)=>{if(F.$isNew)J5(F,!1);F.$__reset(),F.schema.s.hooks.execPost("save",F,[F],{},(Z)=>{if(Z){D(Z);return}A()})})}p.applyDefaults=function F(A){if(A==null)return A;if(A.$__!=null){NV1(A,A.$__.fields,A.$__.exclude);for(let D of A.$getAllSubdocs())F(D,D.$__.fields,D.$__.exclude);return A}return jV1(A,this.schema),A};p.applyVirtuals=function F(A,D){if(A==null)return A;if(A.$__!=null)return A;return xV1(this.schema,A,D),A};p.applyTimestamps=function F(A,D){if(A==null)return A;if(A.$__!=null)return A;return uV1(this.schema,A,D),A};p.castObject=function F(A,D){D=D||{};let Z={},J=this.schema,X=J.options.discriminatorKey;if(J.discriminators!=null&&A!=null&&A[X]!=null)J=gl(J,A[X])||J;let $=Object.keys(J.paths);for(let Y of $){let B=J.path(Y);if(!B||!B.$isMongooseArray)continue;let H=uA(A,Y);yl($,H,Y)}let G=null;for(let Y of $){let B=J.path(Y);if(B==null)continue;let H=uA(A,Y,void 0);if(H==null)continue;let q=Y.indexOf(".")===-1?[Y]:Y.split("."),W=Z;for(let C=0;C<q.length-1;++C){if(W[q[C]]==null)W[q[C]]=isNaN(q[C+1])?{}:[];W=W[q[C]]}if(B.$isMongooseDocumentArray){let C=B.options?.castNonArrays??B.constructor.options.castNonArrays;if(!Array.isArray(H)){if(!C){if(!D.ignoreCastErrors)G=G||new mX,G.addError(Y,new oV1(Y,H))}else W[q[q.length-1]]=[p.castObject.call(B.caster,H)];continue}}if(B.$isSingleNested||B.$isMongooseDocumentArrayElement){try{H=p.castObject.call(B.caster,H)}catch(C){if(!D.ignoreCastErrors)G=G||new mX,G.addError(Y,C);continue}W[q[q.length-1]]=H;continue}try{H=B.cast(H),W[q[q.length-1]]=H}catch(C){if(!D.ignoreCastErrors)G=G||new mX,G.addError(Y,C);continue}}if(G!=null)throw G;return Z};p.buildBulkWriteOperations=function F(A,D){if(!Array.isArray(A))throw new Error(`bulkSave expects an array of documents to be passed, received \`${A}\` instead`);X();let Z=this.schema.options.discriminatorKey;return A.reduce(($,G,Y)=>{if(!D.skipValidation){if(!(G instanceof S3))throw new Error(`documents.${Y} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`);let W=G.validateSync();if(W)throw W}if(G.isNew){let W={insertOne:{document:G}};return t1.injectTimestampsOption(W.insertOne,D.timestamps),$.push(W),$}let H=G.$__delta();if(H!=null&&!t1.isEmptyObject(H[0])){let W=G.$__where(H[0]),C=H[1];hl(G,W);let Q=this.schema.options.shardKey;if(Q){let U=Object.keys(Q),z=U.length;for(let L=0;L<z;++L)W[U[L]]=G[U[L]]}if(G[Z]!=null&&!(Z in W))W[Z]=G[Z];G.$__version(W,H);let K={updateOne:{filter:W,update:C}};return t1.injectTimestampsOption(K.updateOne,D.timestamps),$.push(K),$}return $},[]);function X(){if(D=D||{},D.skipValidation==null)D.skipValidation=!1}};p.hydrate=function(F,A,D){if(z1(this,"hydrate"),A!=null){if(F!=null&&F.$__!=null)F=F.toObject(rK);F=OV1(F,A)}let Z=cF().createModel(this,F,A);return Z.$init(F,D),Z};p.updateMany=function F(A,D,Z){if(z1(this,"updateMany"),D==null)throw new W1("updateMany `update` parameter cannot be nullish");return eK(this,"updateMany",A,D,Z)};p.updateOne=function F(A,D,Z){return z1(this,"updateOne"),eK(this,"updateOne",A,D,Z)};p.replaceOne=function F(A,D,Z){z1(this,"replaceOne");let J=this&&this.schema&&this.schema.options&&this.schema.options.versionKey||null;if(J&&!D[J])D[J]=0;return eK(this,"replaceOne",A,D,Z)};function eK(F,A,D,Z,J){let X=new F.Query({},{},F,F.collection);if(D instanceof S3)D=D.toObject();else D=K4(D);J=typeof J==="function"?J:K4(J);let $=F&&F.schema&&F.schema.options&&F.schema.options.versionKey||null;return xl(Z,J,$),X[A](D,Z,J)}p.aggregate=function F(A,D){if(z1(this,"aggregate"),typeof D==="function"||typeof arguments[2]==="function")throw new W1("Model.aggregate() no longer accepts a callback");let Z=new LV1(A||[]);if(Z.model(this),D!=null)Z.option(D);return Z};p.validate=async function F(A,D,Z){if(arguments.length<3||arguments.length===3&&typeof arguments[2]==="function")Z=A;if(typeof Z==="function"||typeof arguments[3]==="function")throw new W1("Model.validate() no longer accepts a callback");let J=this.schema,X=J.options.discriminatorKey;if(J.discriminators!=null&&A!=null&&A[X]!=null)J=gl(J,A[X])||J;let $=Object.keys(J.paths);if(D!=null){let B=typeof D==="string"?new Set(D.split(" ")):Array.isArray(D)?new Set(D):new Set($);$=$.filter((H)=>{if(D.pathsToSkip){if(Array.isArray(D.pathsToSkip)){if(D.pathsToSkip.find((C)=>C==H))return!1}else if(typeof D.pathsToSkip=="string"){if(D.pathsToSkip.includes(H))return!1}}let q=H.split("."),W=q[0];for(let C of q){if(B.has(W))return!0;W+="."+C}return B.has(H)})}for(let B of $){let H=J.path(B);if(!H||!H.$isMongooseArray||H.$isMongooseDocumentArray)continue;let q=uA(A,B);yl($,q,B)}let G=null;$=new Set($);try{A=this.castObject(A)}catch(B){G=B;for(let H of Object.keys(G.errors||{}))$.delete(H)}let Y=$.size;return new Promise((B,H)=>{for(let W of $){let C=J.path(W);if(C==null){q();continue}let Q=W.indexOf(".")===-1?[W]:W.split("."),K=A;for(let z=0;z<Q.length-1;++z)K=K[Q[z]];let U=uA(A,W,void 0);C.doValidate(U,(z)=>{if(z)G=G||new mX,G.addError(W,z);q()},Z,{path:W})}function q(){if(--Y<=0)if(G)H(G);else B(A)}})};p.populate=async function F(A,D){if(z1(this,"populate"),typeof D==="function"||typeof arguments[2]==="function")throw new W1("Model.populate() no longer accepts a callback");if(D=t1.populate(D),D.length===0)return A;if(D.find((Z)=>Z.ordered))for(let Z of D)await Nl(this,A,Z);else{let Z=[];for(let J of D)Z.push(Nl(this,A,J));await Promise.all(Z)}return A};/*!
891
+ * Populates `docs` for a single `populateOptions` instance.
892
+ */var YL1=/\s?-_id\s?/,GL1=/\s?-_id\s?/g;async function Nl(F,A,D){if(D.strictPopulate==null){if(D._localModel!=null&&D._localModel.schema._userProvidedOptions.strictPopulate!=null)D.strictPopulate=D._localModel.schema._userProvidedOptions.strictPopulate;else if(D._localModel!=null&&F.base.options.strictPopulate!=null)D.strictPopulate=F.base.options.strictPopulate;else if(F.base.options.strictPopulate!=null)D.strictPopulate=F.base.options.strictPopulate}if(!Array.isArray(A))A=[A];if(A.length===0||A.every(t1.isNullOrUndefined))return;let Z=vV1(F,A,D);if(Z instanceof W1)throw Z;let J=Z.length,X=[];function $(B){return B!==void 0}let G=!1,Y=[];for(let B=0;B<J;++B){let H=Z[B],q=H.options.select,W=t1.array.flatten(H.ids,$);W=t1.array.unique(W);let C={};if(C.sort=H&&H.options&&H.options.options&&H.options.options.sort||void 0,C.excludeId=YL1.test(q)||q&&q._id===0,H.options&&H.options.options&&H.options.options.lean&&H.options.options.lean.transform)H.options.options._leanTransform=H.options.options.lean.transform,H.options.options.lean=!0;if(W.length===0||W.every(t1.isNullOrUndefined)){Tl(F,[],H,C);continue}if(G=!0,typeof D.foreignField==="string")H.foreignField.clear(),H.foreignField.add(D.foreignField);let Q=yV1(W,H.match,H.foreignField,H.model,H.options.skipInvalidIds);if(C.excludeId)if(typeof q==="string")q=q.replace(GL1," ");else if(Array.isArray(q))q=q.filter((K)=>K!=="-_id");else q={...q},delete q._id;if(H.options.options&&H.options.options.limit!=null)C.originalLimit=H.options.options.limit;else if(H.options.limit!=null)C.originalLimit=H.options.limit;Y.push([H,Q,q,C])}if(!G){if(Z.length!==0)return;if(D.populate!=null){let B=t1.populate(D.populate).map((H)=>Object.assign({},H,{path:D.path+"."+H.path}));return F.populate(A,B)}return}if(D.ordered)for(let B of Y)await jl.apply(null,B).then((H)=>{X=X.concat(H)});else{let B=[];for(let H of Y)B.push(jl.apply(null,H).then((q)=>{X=X.concat(q)}));await Promise.all(B)}for(let B of Y){let H=B[0],q=B[3];for(let W of X)H.options._childDocs.push(W);Tl(F,X,H,q)}for(let B of Y)nV1(B[0].foreignField,B[0].options,X);for(let B of Y){let H=B[0];if(H.options&&H.options.options&&H.options.options._leanTransform)for(let q of X)H.options.options._leanTransform(q)}}/*!
893
+ * ignore
894
+ */function jl(F,A,D){let Z=K4(F.options.populate),J=Object.assign({skip:F.options.skip,limit:F.options.limit,perDocumentLimit:F.options.perDocumentLimit},F.options.options);if(F.count)delete J.skip;if(J.perDocumentLimit!=null)J.limit=J.perDocumentLimit,delete J.perDocumentLimit;else if(J.limit!=null)J.limit=J.limit*F.ids.length;let X=F.model.find(A,D,J);for(let $ of F.foreignField)if($!=="_id"&&X.selectedInclusively()&&!lV1(X._fields,$))X.select($);if(F.count)for(let $ of F.foreignField)X.select($);if(Z){if(F.model.baseModelName!=null)if(Array.isArray(Z))Z.forEach((G)=>{G.strictPopulate=!1});else if(typeof Z==="string")Z={path:Z,strictPopulate:!1};else Z.strictPopulate=!1;let $=F.options._fullPath||F.options.path;if(Array.isArray(Z))for(let G of Z)G._fullPath=$+"."+G.path;else if(typeof Z==="object")Z._fullPath=$+"."+Z.path;X.populate(Z)}return X.exec().then(($)=>{for(let G of $)pV1.set(G,F.model);return $})}/*!
895
+ * ignore
896
+ */function Tl(F,A,D,Z){let{options:J,isVirtual:X,justOne:$}=D,G,Y=J&&J.options&&J.options.lean||!1,B=A.length,H={},q={},W,C,Q=K4(D.allIds);for(let K=0;K<B;K++){if(C=A[K],C==null)continue;for(let U of D.foreignField){if(G=t1.getValue(U,C),Array.isArray(G)){G=t1.array.unique(t1.array.flatten(G));for(let z of G){if(z instanceof S3)z=z._doc._id;if(W=String(z),q[W])if(Array.isArray(q[W]))q[W].push(C),H[W].push(K);else q[W]=[q[W],C],H[W]=[H[W],K];else if(X&&!$)q[W]=[C],H[W]=[K];else q[W]=C,H[W]=K}}else{if(G instanceof S3)G=G._doc._id;if(W=String(G),q[W]){if(Array.isArray(q[W]))q[W].push(C),H[W].push(K);else if(X||q[W].constructor!==C.constructor||(q[W]instanceof S3?String(q[W]._doc._id):String(q[W]._id))!==(C instanceof S3?String(C._doc._id):String(C._id)))q[W]=[q[W],C],H[W]=[H[W],K]}else q[W]=C,H[W]=K}if(!Y)C.$__.wasPopulated=C.$__.wasPopulated||{value:G}}}gV1({originalModel:F,rawIds:D.isVirtual?Q:D.allIds,allIds:Q,unpopulatedValues:D.unpopulatedValues,foreignField:D.foreignField,rawDocs:q,rawOrder:H,docs:D.docs,path:J.path,options:Z,justOne:D.justOne,isVirtual:D.isVirtual,allOptions:D,populatedModel:D.model,lean:Y,virtual:D.virtual,count:D.count,match:D.match})}p.compile=function F(A,D,Z,J,X){if(D.options.versionKey!==!1&&!D.paths[D.options.versionKey]){let q={};q[D.options.versionKey]=Number,D.add(q)}let G;if(typeof A==="function"&&A.prototype instanceof p)G=A,A=G.name,D.loadClass(G,!1),G.prototype.$isMongooseModelPrototype=!0;else G=function q(W,C,Q){if(q.hooks.execPreSync("createModel",W),!(this instanceof q))return new q(W,C,Q);let K=q.schema.options.discriminatorKey;if(q.discriminators==null||W==null||W[K]==null){p.call(this,W,C,Q);return}let U=q.discriminators[W[K]]||SA(q.discriminators,W[K]);if(U!=null)return new U(W,C,Q);p.call(this,W,C,Q)};if(G.hooks=D.s.hooks.clone(),G.base=X,G.modelName=A,!(G.prototype instanceof p))Object.setPrototypeOf(G,p),Object.setPrototypeOf(G.prototype,p.prototype);G.model=function q(W){return this.db.model(W)},G.db=J,G.prototype.db=J,G.prototype[G7]=J,G.discriminators=G.prototype.discriminators=void 0,G[bl]=!0,G.events=new iK,D._preCompile();let B={schemaUserProvidedOptions:D._userProvidedOptions||{},capped:D.options.capped,Promise:G.base.Promise,modelName:A};if(D.options.autoCreate!==void 0)B.autoCreate=D.options.autoCreate;let H=J.collection(Z,B);return G.prototype.collection=H,G.prototype.$collection=H,G.prototype[Y7]=H,G.prototype.$__setSchema(D),Ol(G,D),_l(G,D),kV1(G,D),_V1(G,D.s.hooks,D.statics),G.schema=G.prototype.$__schema,G.collection=H,G.$__collection=H,G.Query=function(){vX.apply(this,arguments)},Object.setPrototypeOf(G.Query.prototype,vX.prototype),G.Query.base=vX.base,G.Query.prototype.constructor=vX,G._applyQueryMiddleware(),BL1(G,D.query),G};p.$__updateConnection=function F(A){this.db=A,this.prototype.db=A,this.prototype[G7]=A;let D=A.collection(this.collection.collectionName,this.collection.opts);this.prototype.collection=D,this.prototype.$collection=D,this.prototype[Y7]=D,this.collection=D,this.$__collection=D};function BL1(F,A){for(let D in A)F.Query.prototype[D]=A[D]}p.__subclass=function F(A,D,Z){let J=this,X=function H(q,W,C){if(!(this instanceof H))return new H(q,W,C);J.call(this,q,W,C)};if(Object.setPrototypeOf(X,J),Object.setPrototypeOf(X.prototype,J.prototype),X.db=A,X.prototype.db=A,X.prototype[G7]=A,J[_A]=J[_A]||[],J[_A].push(X),J.discriminators!=null){X.discriminators={};for(let H of Object.keys(J.discriminators))X.discriminators[H]=J.discriminators[H].__subclass(J.db,J.discriminators[H].schema,Z)}let $=D&&typeof D!=="string"?D:J.prototype.$__schema,G=$.options||{},Y=$._userProvidedOptions||{};if(!Z)Z=J.prototype.$__schema.get("collection")||t1.toCollectionName(J.modelName,this.base.pluralize());let B={schemaUserProvidedOptions:Y,capped:$&&G.capped};return X.prototype.collection=A.collection(Z,B),X.prototype.$collection=X.prototype.collection,X.prototype[Y7]=X.prototype.collection,X.collection=X.prototype.collection,X.$__collection=X.collection,X.init().catch(()=>{}),X};p.recompileSchema=function F(){if(this.prototype.$__setSchema(this.schema),this.schema._applyDiscriminators!=null)for(let A of this.schema._applyDiscriminators.keys())this.discriminator(A,this.schema._applyDiscriminators.get(A));delete this.schema._defaultToObjectOptionsMap,TV1(this.schema,new WeakSet,!0)};p.inspect=function(){return`Model { ${this.modelName} }`};p.namespace=function F(){return this.db.name+"."+this.collection.collectionName};if(Pl.inspect.custom)p[Pl.inspect.custom]=p.inspect;/*!
897
+ * Applies query middleware from this model's schema to this model's
898
+ * Query constructor.
899
+ */p._applyQueryMiddleware=function F(){let A=this.Query,D=this.schema.s.hooks.filter((Z)=>{let J=HL1(Z);if(Z.name==="validate")return!!J.query;if(Z.name==="deleteOne"||Z.name==="updateOne")return!!J.query||Object.keys(J).length===0;if(Z.query!=null||Z.document!=null)return!!Z.query;return!0});A.prototype._queryMiddleware=D};function HL1(F){let A={};if(F.hasOwnProperty("query"))A.query=F.query;if(F.hasOwnProperty("document"))A.document=F.document;return A}/*!
900
+ * Module exports.
901
+ */ml.exports=vl=p});var cl=E((gA,dl)=>{dl.exports=CL1;gA.pluralization=[[/human$/gi,"humans"],[/(m)an$/gi,"$1en"],[/(pe)rson$/gi,"$1ople"],[/(child)$/gi,"$1ren"],[/^(ox)$/gi,"$1en"],[/(ax|test)is$/gi,"$1es"],[/(octop|vir)us$/gi,"$1i"],[/(alias|status)$/gi,"$1es"],[/(bu)s$/gi,"$1ses"],[/(buffal|tomat|potat)o$/gi,"$1oes"],[/([ti])um$/gi,"$1a"],[/sis$/gi,"ses"],[/(?:([^f])fe|([lr])f)$/gi,"$1$2ves"],[/(hive)$/gi,"$1s"],[/([^aeiouy]|qu)y$/gi,"$1ies"],[/(x|ch|ss|sh)$/gi,"$1es"],[/(matr|vert|ind)ix|ex$/gi,"$1ices"],[/([m|l])ouse$/gi,"$1ice"],[/(kn|w|l)ife$/gi,"$1ives"],[/(quiz)$/gi,"$1zes"],[/^goose$/i,"geese"],[/s$/gi,"s"],[/([^a-z])$/,"$1"],[/$/gi,"s"]];var qL1=gA.pluralization;gA.uncountables=["advice","energy","excretion","digestion","cooperation","health","justice","labour","machinery","equipment","information","pollution","sewage","paper","money","species","series","rain","rice","fish","sheep","moose","deer","news","expertise","status","media"];var WL1=gA.uncountables;function CL1(F){let A;if(F=F.toLowerCase(),!~WL1.indexOf(F)){if(A=qL1.filter(function(D){return F.match(D[0])}),A[0])return F.replace(A[0][0],A[0][1])}return F}});var sl=E((NS1,nl)=>{/*!
902
+ * Module requirements
903
+ */var il=w1(),ll=i("node:util"),pl=oq();class A9 extends il{constructor(){super("");this.errors={}}toString(){return pl(this)}inspect(){return Object.assign(new Error(this.message),this)}addError(F,A){if(A instanceof A9){let{errors:D}=A;for(let Z of Object.keys(D))this.addError(Z,D[Z]);return}this.errors[F]=A,this.message=pl(this)}}if(ll.inspect.custom)A9.prototype[ll.inspect.custom]=A9.prototype.inspect;Object.defineProperty(A9.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(A9.prototype,"name",{value:"SetOptionError"});class al extends il{constructor(F){super(`"${F}" is not a valid option to set`)}}A9.SetOptionInnerError=al;/*!
904
+ * Module exports
905
+ */nl.exports=A9});var tl=E(()=>{var rl=q1();if(typeof jest!=="undefined"&&!process.env.SUPPRESS_JEST_WARNINGS){if(typeof window!=="undefined")rl.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's default jsdom test environment. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning.");if(setTimeout.clock!=null&&typeof setTimeout.clock.Date==="function")rl.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's mock timers enabled. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning.")}});var Zp=E((Ap,Dp)=>{/*!
906
+ * Module dependencies.
907
+ */var ol=r2(),el=i("node:events").EventEmitter,Fp=a2(),QL1=g8(),KL1=F4(),EL1=Fp.ValidationError,UL1=jJ(),zL1=p4();function a6(F,A,D,Z,J){if(!(this instanceof a6))return new a6(F,A,D,Z,J);if(zL1(A)&&!A.instanceOfSchema)A=new QL1(A);if(A=this.schema||A,!this.schema&&A.options._id){if(F=F||{},F._id===void 0)F._id=new KL1}if(!A)throw new Fp.MissingSchemaError;this.$__setSchema(A),ol.call(this,F,D,Z,J),UL1(this,A,{decorateDoc:!0});for(let X in A.methods)this[X]=A.methods[X];for(let X in A.statics)this[X]=A.statics[X]}/*!
908
+ * Inherit from the NodeJS document
909
+ */a6.prototype=Object.create(ol.prototype);a6.prototype.constructor=a6;/*!
910
+ * ignore
911
+ */a6.events=new el;/*!
912
+ * Browser doc exposes the event emitter API
913
+ */a6.$emitter=new el;["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"].forEach(function(F){a6[F]=function(){return a6.$emitter[F].apply(a6.$emitter,arguments)}});/*!
914
+ * Module exports.
915
+ */a6.ValidationError=EL1;Dp.exports=Ap=a6});var Xp=E((kS1,FE)=>{/*!
916
+ * Module dependencies.
917
+ */var VL1=r2(),LL1=Zp(),Jp=!1;FE.exports=function F(){if(Jp)return LL1;return VL1};/*!
918
+ * ignore
919
+ */FE.exports.setBrowser=function(F){Jp=F}});var Kp=E((Cp,Qp)=>{/*!
920
+ * Module dependencies.
921
+ */var RL1=r2(),wL1=i("node:events").EventEmitter,Yp=m9(),E4=g8(),PL1=_0(),fA=DA(),IL1=IJ(),pX=NF(),$p=Dm(),ML1=b8(),NL1=jX(),Gp=kK(),jL1=NQ(),TL1=nC(),Bp=GX(),kL1=cl(),AE=q1(),OL1=aQ(),SL1=t9(),_L1=MK(),uL1=w8().trusted,xL1=EK(),gL1=D2(),X5=w1(),lX=sl(),fL1=TK(),Hp=Symbol.for("mongoose:default"),qp=Symbol("mongoose:defaultConnection");tl();var yL1=/^[0-9A-Fa-f]{24}$/,{AsyncLocalStorage:Wp}=i("node:async_hooks");function o(F){if(this.connections=[],this.nextConnectionId=0,this.models={},this.events=new wL1,this.__driver=Bp.get(),this.options=Object.assign({pluralization:!0,autoIndex:!0,autoCreate:!0,autoSearchIndex:!1},F),(AE.getOption("createInitialConnection",this.options)??!0)&&this.__driver!=null)DE(this);if(this.options.pluralization)this._pluralize=kL1;if(!F||!F[Hp]){let D=this;this.Schema=function(){return this.base=D,E4.apply(this,arguments)},this.Schema.prototype=Object.create(E4.prototype),Object.assign(this.Schema,E4),this.Schema.base=this,this.Schema.Types=Object.assign({},E4.Types)}else for(let D of["Schema","model"])this[D]=o.prototype[D];if(this.Schema.prototype.base=this,F?.transactionAsyncLocalStorage)this.transactionAsyncLocalStorage=new Wp;Object.defineProperty(this,"plugins",{configurable:!1,enumerable:!0,writable:!1,value:Object.values(TL1).map((D)=>[D,{deduplicate:!0}])})}o.prototype.cast=SL1;o.prototype.STATES=pX;o.prototype.ConnectionStates=pX;o.prototype.driver=Bp;o.prototype.setDriver=function F(A){let D=this instanceof o?this:I2;if(D.__driver===A)return D;if(D.connections&&D.connections.find(($)=>$.readyState!==pX.disconnected))throw new X5("Cannot modify Mongoose driver if a connection is already open. Call `mongoose.disconnect()` before modifying the driver");if(D.__driver=A,Array.isArray(A.plugins)){for(let $ of A.plugins)if(typeof $==="function")D.plugin($)}if(A.SchemaTypes!=null)Object.assign(I2.Schema.Types,A.SchemaTypes);let J=A.Connection,X=D.connections[0];if(D.connections=[new J(D)],D.connections[0].models=D.models,X==null)return D;for(let $ of Object.values(D.models)){if($.db!==X)continue;$.$__updateConnection(D.connections[0])}return D};o.prototype.set=function F(A,D){let Z=this instanceof o?this:I2;if(arguments.length===1&&typeof A!=="object"){if($p.indexOf(A)===-1){let $=new lX;throw $.addError(A,new lX.SetOptionInnerError(A)),$}return Z.options[A]}let J={};if(arguments.length===2)J={[A]:D};if(arguments.length===1&&typeof A==="object")J=A;let X=void 0;for(let[$,G]of Object.entries(J)){if($p.indexOf($)===-1){if(!X)X=new lX;X.addError($,new lX.SetOptionInnerError($));continue}if(Z.options[$]=G,$==="objectIdGetter")if(G)Object.defineProperty(Z.Types.ObjectId.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});else delete Z.Types.ObjectId.prototype._id;else if($==="transactionAsyncLocalStorage"){if(G&&!Z.transactionAsyncLocalStorage)Z.transactionAsyncLocalStorage=new Wp;else if(!G&&Z.transactionAsyncLocalStorage)delete Z.transactionAsyncLocalStorage}else if($==="createInitialConnection"){if(G&&!Z.connection)DE(Z);else if(G===!1&&Z.connection&&Z.connection[qp]){if(Z.connection.readyState===pX.disconnected&&Object.keys(Z.connection.models).length===0)Z.connections.shift()}}}if(X)throw X;return Z};o.prototype.get=o.prototype.set;o.prototype.createConnection=function F(A,D){let Z=this instanceof o?this:I2,X=new Z.__driver.Connection(Z);if(Z.connections.push(X),Z.nextConnectionId++,Z.events.emit("createConnection",X),arguments.length>0)X.openUri(A,{...D,_fireAndForget:!0});return X};o.prototype.connect=async function F(A,D){if(typeof D==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new X5("Mongoose.prototype.connect() no longer accepts a callback");let Z=this instanceof o?this:I2;if(Z.connection==null)DE(Z);return Z.connection.openUri(A,D).then(()=>Z)};o.prototype.disconnect=async function F(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new X5("Mongoose.prototype.disconnect() no longer accepts a callback");let A=this instanceof o?this:I2;if(A.connections.length<=0)return;await Promise.all(A.connections.map((Z)=>Z.close()))};o.prototype.startSession=function F(){let A=this instanceof o?this:I2;return A.connection.startSession.apply(A.connection,arguments)};o.prototype.pluralize=function F(A){let D=this instanceof o?this:I2;if(arguments.length>0)D._pluralize=A;return D._pluralize};o.prototype.model=function F(A,D,Z,J){let X=this instanceof o?this:I2;if(typeof D==="string")Z=D,D=!1;if(arguments.length===1){let B=X.models[A];if(!B)throw new X.Error.MissingSchemaError(A);return B}if(AE.isObject(D)&&!(D instanceof E4))D=new E4(D);if(D&&!(D instanceof E4))throw new X.Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");J=J||{};let $=D;if(D){if(X.get("cloneSchemas"))D=D.clone();X._applyPlugins(D)}let G=X.options.hasOwnProperty("overwriteModels")?X.options.overwriteModels:J.overwriteModels;if(X.models.hasOwnProperty(A)&&J.cache!==!1&&G!==!0){if($&&$.instanceOfSchema&&$!==X.models[A].schema)throw new X.Error.OverwriteModelError(A);if(Z&&Z!==X.models[A].collection.name){let B=X.models[A];return D=B.prototype.schema,B.__subclass(X.connection,D,Z)}return X.models[A]}if(D==null)throw new X.Error.MissingSchemaError(A);let Y=X._model(A,D,Z,J);return X.connection.models[A]=Y,X.models[A]=Y,Y};/*!
922
+ * ignore
923
+ */o.prototype._model=function F(A,D,Z,J){let X=this instanceof o?this:I2,$;if(typeof A==="function"){if($=A,A=$.name,!($.prototype instanceof Gp))throw new X.Error("The provided class "+A+" must extend Model")}if(D){if(X.get("cloneSchemas"))D=D.clone();X._applyPlugins(D)}if(D==null||!("pluralization"in D.options))D.options.pluralization=X.options.pluralization;if(!Z)Z=D.get("collection")||AE.toCollectionName(A,X.pluralize());fL1(D);let G=J.connection||X.connection;if($=X.Model.compile($||A,D,Z,G,X),$.init().catch(function Y(){}),G.emit("model",$),D._applyDiscriminators!=null)for(let Y of D._applyDiscriminators.keys()){let{schema:B,options:H}=D._applyDiscriminators.get(Y);$.discriminator(Y,B,H)}return $};o.prototype.deleteModel=function F(A){let D=this instanceof o?this:I2;return D.connection.deleteModel(A),delete D.models[A],D};o.prototype.modelNames=function F(){let A=this instanceof o?this:I2;return Object.keys(A.models)};o.prototype._applyPlugins=function F(A,D){let Z=this instanceof o?this:I2;D=D||{},D.applyPluginsToDiscriminators=Z.options&&Z.options.applyPluginsToDiscriminators||!1,D.applyPluginsToChildSchemas=typeof(Z.options&&Z.options.applyPluginsToChildSchemas)==="boolean"?Z.options.applyPluginsToChildSchemas:!0,jL1(A,Z.plugins,D,"$globalPluginsApplied")};o.prototype.plugin=function F(A,D){let Z=this instanceof o?this:I2;return Z.plugins.push([A,D]),Z};o.prototype.__defineGetter__("connection",function(){return this.connections[0]});o.prototype.__defineSetter__("connection",function(F){if(F instanceof this.__driver.Connection)this.connections[0]=F,this.models=F.models});o.prototype.connections;o.prototype.nextConnectionId;o.prototype.Aggregate=_L1;Object.defineProperty(o.prototype,"Collection",{get:function(){return this.__driver.Collection},set:function(F){this.__driver.Collection=F}});Object.defineProperty(o.prototype,"Connection",{get:function(){return this.__driver.Connection},set:function(F){if(F===this.__driver.Connection)return;this.__driver.Connection=F}});o.prototype.version=OL1.version;o.prototype.Mongoose=o;o.prototype.Schema=E4;o.prototype.SchemaType=PL1;o.prototype.SchemaTypes=E4.Types;o.prototype.VirtualType=IL1;o.prototype.Types=ML1;o.prototype.Query=NL1;o.prototype.Model=Gp;o.prototype.Document=RL1;o.prototype.DocumentProvider=Xp();o.prototype.ObjectId=fA.ObjectId;o.prototype.isValidObjectId=function F(A){return(this instanceof o?this:I2).Types.ObjectId.isValid(A)};o.prototype.isObjectIdOrHexString=function F(A){return gL1(A,"ObjectId")||typeof A==="string"&&yL1.test(A)};o.prototype.syncIndexes=function F(A){return(this instanceof o?this:I2).connection.syncIndexes(A)};o.prototype.Decimal128=fA.Decimal128;o.prototype.Mixed=fA.Mixed;o.prototype.Date=fA.Date;o.prototype.Number=fA.Number;o.prototype.Error=X5;o.prototype.MongooseError=X5;o.prototype.now=function F(){return new Date};o.prototype.CastError=X5.CastError;o.prototype.SchemaTypeOptions=U6();o.prototype.mquery=QK();o.prototype.sanitizeFilter=xL1;o.prototype.trusted=uL1;o.prototype.skipMiddlewareFunction=Yp.skipWrappedFunction;o.prototype.overwriteMiddlewareResult=Yp.overwriteResult;o.prototype.omitUndefined=RC();/*!
924
+ * Create a new default connection (`mongoose.connection`) for a Mongoose instance.
925
+ * No-op if there is already a default connection.
926
+ */function DE(F){if(F.connection)return;let A=F.createConnection();A[qp]=!0,A.models=F.models}var I2=Qp.exports=Cp=new o({[Hp]:!0})});var zp=E((OS1,Up)=>{/*!
927
+ * Module dependencies.
928
+ */var Ep=Fm();GX().set(Ep);var ZE=Kp();ZE.setDriver(Ep);ZE.Mongoose.prototype.mongo=Y8();Up.exports=ZE});var yA=E((SS1,G1)=>{var B1=zp();G1.exports=B1;G1.exports.default=B1;G1.exports.mongoose=B1;G1.exports.cast=B1.cast;G1.exports.STATES=B1.STATES;G1.exports.setDriver=B1.setDriver;G1.exports.set=B1.set;G1.exports.get=B1.get;G1.exports.createConnection=B1.createConnection;G1.exports.connect=B1.connect;G1.exports.disconnect=B1.disconnect;G1.exports.startSession=B1.startSession;G1.exports.pluralize=B1.pluralize;G1.exports.model=B1.model;G1.exports.deleteModel=B1.deleteModel;G1.exports.modelNames=B1.modelNames;G1.exports.plugin=B1.plugin;G1.exports.connections=B1.connections;G1.exports.version=B1.version;G1.exports.Aggregate=B1.Aggregate;G1.exports.Mongoose=B1.Mongoose;G1.exports.Schema=B1.Schema;G1.exports.SchemaType=B1.SchemaType;G1.exports.SchemaTypes=B1.SchemaTypes;G1.exports.VirtualType=B1.VirtualType;G1.exports.Types=B1.Types;G1.exports.Query=B1.Query;G1.exports.Model=B1.Model;G1.exports.Document=B1.Document;G1.exports.ObjectId=B1.ObjectId;G1.exports.isValidObjectId=B1.isValidObjectId;G1.exports.isObjectIdOrHexString=B1.isObjectIdOrHexString;G1.exports.syncIndexes=B1.syncIndexes;G1.exports.Decimal128=B1.Decimal128;G1.exports.Mixed=B1.Mixed;G1.exports.Date=B1.Date;G1.exports.Number=B1.Number;G1.exports.Error=B1.Error;G1.exports.MongooseError=B1.MongooseError;G1.exports.now=B1.now;G1.exports.CastError=B1.CastError;G1.exports.SchemaTypeOptions=B1.SchemaTypeOptions;G1.exports.mongo=B1.mongo;G1.exports.mquery=B1.mquery;G1.exports.sanitizeFilter=B1.sanitizeFilter;G1.exports.trusted=B1.trusted;G1.exports.skipMiddlewareFunction=B1.skipMiddlewareFunction;G1.exports.overwriteMiddlewareResult=B1.overwriteMiddlewareResult});var iX=hA(yA(),1);class Vp{async connect(F){if(!F)throw new Error("DB URI is not valid.");console.log("Connecting to database..."),await iX.default.connect(F).catch((A)=>console.error("Unable to connect to the database:",A)),iX.default.connection.on("open",()=>{console.log("Database connection is ready.")}),iX.default.connection.on("error",(A)=>{console.error("Database connection error:",A)})}}var bL1;((F)=>{F[F.Public=0]="Public",F[F.Private=1]="Private"})(bL1||={});var hL1;((F)=>{F[F.Offline=0]="Offline",F[F.Booting=1]="Booting",F[F.Available=2]="Available",F[F.Busy=3]="Busy",F[F.Disconnected=4]="Disconnected"})(hL1||={});var vL1;((F)=>{F[F.Neutral=0]="Neutral",F[F.Success=1]="Success",F[F.Info=2]="Info",F[F.Warn=3]="Warn",F[F.Error=4]="Error"})(vL1||={});var JE;((F)=>{F.Win="WIN",F.Mac="MAC",F.Psn="PSN",F.Xbl="XBL",F.Swt="SWT",F.Ios="IOS",F.And="AND",F.Ps5="PS5",F.Xsx="XSX"})(JE||={});var XE;((F)=>{F[F.Public=0]="Public",F[F.Private=1]="Private"})(XE||={});var D9;((F)=>{F[F.Equals=0]="Equals",F[F.Includes=1]="Includes",F[F.StartsWith=2]="StartsWith",F[F.EndsWith=3]="EndsWith"})(D9||={});var Z9;((F)=>{F[F.Blacklist=0]="Blacklist",F[F.Whitelist=1]="Whitelist",F[F.Kick=2]="Kick",F[F.Block=3]="Block",F[F.RemoveFriend=4]="RemoveFriend",F[F.AddFriend=5]="AddFriend",F[F.Promote=6]="Promote",F[F.Copy=7]="Copy",F[F.Mimic=8]="Mimic",F[F.Hide=9]="Hide",F[F.Show=10]="Show"})(Z9||={});var aX;((F)=>{F.Default="en",F.De="de",F.Es="es",F.Fr="fr",F.It="it",F.Pl="pl",F.Pt="pt",F.Tr="tr"})(aX||={});var mL1;((F)=>{F[F.RequiredParam=0]="RequiredParam",F[F.OptionalParam=1]="OptionalParam",F[F.RequiredSelect=2]="RequiredSelect",F[F.OptionalSelect=3]="OptionalSelect",F[F.RequiredNumericParam=4]="RequiredNumericParam",F[F.OptionalNumericParam=5]="OptionalNumericParam"})(mL1||={});var Lp;((F)=>{F.GenericUnknown="net.fnlb.errors.generic.unknown",F.GenericInternalError="net.fnlb.errors.generic.internal_error",F.GenericValidationFailed="net.fnlb.errors.generic.validation_failed",F.GenericParseFailed="net.fnlb.errors.generic.parse_failed",F.GenericNotFound="net.fnlb.errors.generic.not_found",F.GenericAlreadyExists="net.fnlb.errors.generic.already_exists",F.CommonInvalidRequest="net.fnlb.errors.common.invalid_request",F.CommonUnableToProcessRequest="net.fnlb.errors.common.unable_to_process_request",F.CommonInvalidFieldsLength="net.fnlb.errors.common.invalid_body_fields_length",F.CommonRateLimitExceeded="net.fnlb.errors.common.rate_limit_exceeded",F.CommonLimitExceeded="net.fnlb.errors.common.limit_exceeded",F.CommonUnableToSaveToDatabase="net.fnlb.errors.common.unable_to_save_to_database",F.AuthInvalidToken="net.fnlb.errors.auth.invalid_token",F.AuthInvalidAPIToken="net.fnlb.errors.auth.invalid_api_token",F.AuthInvalidCaptchaToken="net.fnlb.errors.auth.invalid_captcha_token",F.AuthUnauthorized="net.fnlb.errors.auth.unauthorized",F.AuthForbidden="net.fnlb.errors.auth.forbidden",F.AuthUserBanned="net.fnlb.errors.auth.user_banned",F.Oauth2InvalidCode="net.fnlb.errors.oauth2.invalid_code",F.Oauth2InvalidScope="net.fnlb.errors.oauth2.invalid_scope",F.Oauth2TokenInvalid="net.fnlb.errors.oauth2.token_invalid",F.Oauth2UnableToFetchUser="net.fnlb.errors.oauth2.unable_to_fetch_user",F.Oauth2UnableToFetchConnections="net.fnlb.errors.oauth2.unable_to_fetch_connections",F.Oauth2UserWithoutConnection="net.fnlb.errors.oauth2.user_without_connection",F.Oauth2ConnectionNotVerified="net.fnlb.errors.oauth2.connection_not_verified",F.ReleaseNotFound="net.fnlb.errors.release.no_release_found",F.ReleaseVersionAlreadyExists="net.fnlb.errors.release.version_already_exists"})(Lp||={});var Rp;((F)=>{F.LoginInvalidCredentials="net.fnlb.errors.login.invalid_credentials",F.LoginInvalidEmail="net.fnlb.errors.login.invalid_email",F.LoginInvalidOrUsedEmail="net.fnlb.errors.login.invalid_or_used_email",F.AuthPasswordConfirmationInvalid="net.fnlb.errors.auth.invalid_password_confirmation"})(Rp||={});var B7={...Lp,...Rp},dL1;((F)=>{F.Username="username",F.Email="email",F.Password="password",F.Shared="shared"})(dL1||={});var cL1;((F)=>{F.General="general",F.Input="input"})(cL1||={});var $E;((X)=>{X[X.InternalError=1]="InternalError";X[X.BadValue=2]="BadValue";X[X.NoSuchKey=4]="NoSuchKey";X[X.KeyNotFound=211]="KeyNotFound";X[X.DuplicateKey=11000]="DuplicateKey"})($E||={});class wp{static handleError(F,A){if(!F)return!1;switch(F.code){case 11000:return A.sendError(400,B7.GenericAlreadyExists);case 2:return A.sendError(500,B7.CommonUnableToSaveToDatabase);case 211:return A.sendError(500,B7.CommonUnableToSaveToDatabase);case 4:return A.sendError(500,B7.CommonUnableToSaveToDatabase);case 1:return console.error("Internal MongoDB error:",F),A.sendError(500,B7.CommonUnableToSaveToDatabase);default:return console.error("Unhandled MongoError code:",F.code,F),A.sendError(500,B7.CommonUnableToSaveToDatabase)}}}var $5=hA(yA(),1);class H7{static transformSchemaToJSON(F,A){A.id=A._id,delete A._id,delete A.__v}}var Pp=new $5.Schema({owner:{type:$5.Schema.Types.ObjectId,ref:"user",required:!0,index:!0},parent:{type:$5.Schema.Types.ObjectId,ref:"category",required:!1,index:!0,sparse:!0},nickname:{type:String,required:!0,trim:!0},type:{type:Number,required:!0,index:!0},email:{type:String,lowercase:!0,required:!1,trim:!0},disabled:{type:Boolean,required:!1},deviceAuth:{required:!0,type:{accountId:{type:String,required:!0,unique:!0,lowercase:!0,trim:!0},deviceId:{type:String,required:!0,lowercase:!0,trim:!0},secret:{type:String,required:!0,trim:!0}},_id:!1},mmsBannedUntil:{type:Number,required:!1}});Pp.set("toJSON",{transform:H7.transformSchemaToJSON});var lL1=$5.model("bot",Pp);var bA=hA(yA(),1);var Ip=new bA.Schema({owner:{type:bA.Schema.Types.ObjectId,ref:"user",required:!0,index:!0},name:{type:String,required:!0,trim:!0},disabled:{type:Boolean,required:!1},managed:{type:Boolean,required:!1,index:!0,sparse:!0},config:{replyLangs:{type:[String],enum:Object.values(aX),default:void 0},searchLangs:{type:[String],enum:Object.values(aX),default:void 0},platform:{type:[String],enum:Object.values(JE),default:void 0},privacy:{type:Number,enum:Object.values(XE),default:void 0},prefixes:{type:[String],default:void 0},statusText:{type:[String],default:void 0},statusInterval:{type:Number,default:void 0},level:{type:[Number],default:void 0},bpLevel:{type:[Number],default:void 0},extraOwners:{type:[{id:String,name:String,_id:!1}],default:void 0},admins:{type:[{id:String,name:String,_id:!1}],default:void 0},whitelistUsers:{type:[{id:String,name:String,_id:!1}],default:void 0},blacklistUsers:{type:[{id:String,name:String,_id:!1}],default:void 0},excludedAutoAddFriends:{type:[{id:String,name:String,_id:!1}],default:void 0},otherBots:{type:[{id:String,name:String,_id:!1}],default:void 0},inviteTimeout:{type:Number,default:void 0},maxBotsPerLobby:{type:Number,default:void 0},maxBotsPerLobbyWithOwner:{type:Number,default:void 0},maxBotsPerLobbyWithAdmin:{type:Number,default:void 0},maxBotsPerLobbyWithWhitelistUser:{type:Number,default:void 0},allowMatchmaking:{type:Boolean,default:void 0},leaveAfterMatchmaking:{type:Boolean,default:void 0},disableMatchmakingChecks:{type:Boolean,default:void 0},disablePlaylistChecks:{type:Boolean,default:void 0},disableJoinMessages:{type:Boolean,default:void 0},disableAutomaticMessages:{type:Boolean,default:void 0},acceptFriendRequests:{type:Boolean,default:void 0},sendFriendRequestOnJoinParty:{type:Boolean,default:void 0},sendFriendRequestOnMemberJoinParty:{type:Boolean,default:void 0},runCommandsWithoutPrefix:{type:Boolean,default:void 0},setCosmeticsWithoutCommands:{type:Boolean,default:void 0},setCosmeticsWithPrefix:{type:Boolean,default:void 0},acceptInvites:{type:Boolean,default:void 0},usernameTriggers:{type:[{triggers:{type:[String],default:void 0},detectionMethods:{type:[Number],enum:Object.values(D9),default:void 0},actions:{type:[Number],enum:Object.values(Z9),default:void 0},messages:{type:[String],default:void 0},_id:!1}],default:void 0},messageContentTriggers:{type:[{triggers:{type:[String],default:void 0},detectionMethods:{type:[Number],enum:Object.values(D9),default:void 0},actions:{type:[Number],enum:Object.values(Z9),default:void 0},messages:{type:[String],default:void 0},_id:!1}],default:void 0},cosmeticTriggers:{type:[{triggers:{type:[String],default:void 0},detectionMethods:{type:[Number],enum:Object.values(D9),default:void 0},actions:{type:[Number],enum:Object.values(Z9),default:void 0},messages:{type:[String],default:void 0},_id:!1}],default:void 0},addFriendTriggers:{type:[{triggers:{type:[String],default:void 0},detectionMethods:{type:[Number],enum:Object.values(D9),default:void 0},actions:{type:[Number],enum:Object.values(Z9),default:void 0},messages:{type:[String],default:void 0},_id:!1}],default:void 0},memberJoinTriggers:{type:[{triggers:{type:[String],default:void 0},detectionMethods:{type:[Number],enum:Object.values(D9),default:void 0},actions:{type:[Number],enum:Object.values(Z9),default:void 0},messages:{type:[String],default:void 0},_id:!1}],default:void 0},changeCosmeticTriggers:{type:[{triggers:{type:[String],default:void 0},detectionMethods:{type:[Number],enum:Object.values(D9),default:void 0},actions:{type:[Number],enum:Object.values(Z9),default:void 0},messages:{type:[String],default:void 0},_id:!1}],default:void 0},onlyOwnerCommands:{type:[String],default:void 0},onlyAdminCommands:{type:[String],default:void 0},onlyWhitelistUsersCommands:{type:[String],default:void 0},onlyFriendsCommands:{type:[String],default:void 0},onlyPartyMembersCommands:{type:[String],default:void 0},onlyWhisperCommands:{type:[String],default:void 0},startOutfit:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},startBackpack:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},startPickaxe:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},startShoes:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},startBanner:{type:[{id:String,_id:!1}],default:void 0},startBannerColor:{type:[{id:String,_id:!1}],default:void 0},joinOutfit:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},joinBackpack:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},joinPickaxe:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},joinEmote:{type:[{id:String,_id:!1}],default:void 0},joinShoes:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},joinBanner:{type:[{id:String,_id:!1}],default:void 0},joinBannerColor:{type:[{id:String,_id:!1}],default:void 0},memberJoinOutfit:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},memberJoinBackpack:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},memberJoinPickaxe:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},memberJoinEmote:{type:[{id:String,_id:!1}],default:void 0},memberJoinShoes:{type:[{id:String,variants:[Number],_id:!1}],default:void 0},memberJoinBanner:{type:[{id:String,_id:!1}],default:void 0},memberJoinBannerColor:{type:[{id:String,_id:!1}],default:void 0}}});Ip.set("toJSON",{transform:H7.transformSchemaToJSON});var pL1=bA.model("category",Ip);var nX=hA(yA(),1);var YE=new nX.Schema({token:{type:String,required:!0,unique:!1},username:{type:String,required:!0,trim:!0},email:{type:String,index:!0,required:!0,unique:!0,lowercase:!0,trim:!0},password:{type:String,required:!0},apiToken:{type:String,required:!0,unique:!1,trim:!0},verified:{type:Boolean,required:!1},connections:{discord:{id:{type:String,index:!0,unique:!0,sparse:!0},username:{type:String},verified:{type:Boolean,required:!1}},epic:{id:{type:String,index:!0,unique:!0,sparse:!0},username:{type:String},verified:{type:Boolean,required:!1}}}},{statics:{async verifyPassword(F,A){return Bun.password.verify(F,A)},async findByToken(F,A){let D=await this.findById(F);if(!D?.token||D.token!==A)return null;return D},async findByAPIToken(F,A){let D=await this.findById(F);if(!D?.apiToken||D.apiToken!==A)return null;return D}}});YE.pre("save",async function(F){if(!this.isModified("password"))return F();try{return this.password=await Bun.password.hash(this.password,{algorithm:process.env.SAVE_ACCOUNT_ALGORITHM||"argon2id",timeCost:parseInt(process.env.SAVE_ACCOUNT_TIME_COST||"3"),cost:parseInt(process.env.SAVE_ACCOUNT_ALGORITHM_COST||"12")}),F()}catch(A){return F(A)}});YE.set("toJSON",{transform:H7.transformSchemaToJSON});var iL1=nX.model("user",YE);export{iL1 as UserModel,$E as DatabaseErrors,wp as DatabaseErrorHandler,Vp as DatabaseClient,pL1 as CategoryModel,lL1 as BotModel};