@fnlb-project/database 1.0.4 → 1.0.5
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.d.ts +1623 -0
- package/dist/index.js +892 -0
- package/package.json +5 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,892 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var Zd=Object.create;var{getPrototypeOf:Xd,defineProperty:fW,getOwnPropertyNames:Yd}=Object;var $d=Object.prototype.hasOwnProperty;var hF=(F,A,B)=>{B=F!=null?Zd(Xd(F)):{};let D=A||!F||!F.__esModule?fW(B,"default",{value:F,enumerable:!0}):B;for(let J of Yd(F))if(!$d.call(D,J))fW(D,J,{get:()=>F[J],enumerable:!0});return D};var z=(F,A)=>()=>(A||F((A={exports:{}}).exports,A),A.exports);var w9=z((_W,gW)=>{/*!
|
|
3
|
+
* Connection states
|
|
4
|
+
*/var B2=gW.exports=_W=Object.create(null);B2[0]="disconnected";B2[1]="connected";B2[2]="connecting";B2[3]="disconnecting";B2[99]="uninitialized";B2.disconnected=0;B2.connected=1;B2.connecting=2;B2.disconnecting=3;B2.uninitialized=99});var r2=z((JK1,bW)=>{/*!
|
|
5
|
+
* Centralize this so we can more easily work around issues with people
|
|
6
|
+
* stubbing out `process.nextTick()` in tests using sinon:
|
|
7
|
+
* https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time
|
|
8
|
+
* See gh-6074
|
|
9
|
+
*/var Gd=typeof process!=="undefined"&&typeof process.nextTick==="function"?process.nextTick.bind(process):(F)=>setTimeout(F,0);bW.exports=function F(A){return Gd(A)}});var hW=z((ZK1,vW)=>{/*!
|
|
10
|
+
* Module dependencies.
|
|
11
|
+
*/var Ed=import.meta.require("events").EventEmitter,Cd=w9(),yW=r2();function f1(F,A,B){if(B===void 0)B={};if(this.opts=B,this.name=F,this.collectionName=F,this.conn=A,this.queue=[],this.buffer=!0,this.emitter=new Ed,Cd.connected===this.conn.readyState)this.onOpen()}f1.prototype.name;f1.prototype.collectionName;f1.prototype.conn;f1.prototype.onOpen=function(){this.buffer=!1,yW(()=>this.doQueue())};f1.prototype.onClose=function(){};f1.prototype.addQueue=function(F,A){return this.queue.push([F,A]),this};f1.prototype.removeQueue=function(F,A){let B=this.queue.findIndex((D)=>D[0]===F&&D[1]===A);if(B===-1)return!1;return this.queue.splice(B,1),!0};f1.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 yW(function(){F.emitter.emit("queue")}),this};f1.prototype.ensureIndex=function(){throw new Error("Collection#ensureIndex unimplemented by driver")};f1.prototype.createIndex=function(){throw new Error("Collection#createIndex unimplemented by driver")};f1.prototype.findAndModify=function(){throw new Error("Collection#findAndModify unimplemented by driver")};f1.prototype.findOneAndUpdate=function(){throw new Error("Collection#findOneAndUpdate unimplemented by driver")};f1.prototype.findOneAndDelete=function(){throw new Error("Collection#findOneAndDelete unimplemented by driver")};f1.prototype.findOneAndReplace=function(){throw new Error("Collection#findOneAndReplace unimplemented by driver")};f1.prototype.findOne=function(){throw new Error("Collection#findOne unimplemented by driver")};f1.prototype.find=function(){throw new Error("Collection#find unimplemented by driver")};f1.prototype.insert=function(){throw new Error("Collection#insert unimplemented by driver")};f1.prototype.insertOne=function(){throw new Error("Collection#insertOne unimplemented by driver")};f1.prototype.insertMany=function(){throw new Error("Collection#insertMany unimplemented by driver")};f1.prototype.save=function(){throw new Error("Collection#save unimplemented by driver")};f1.prototype.updateOne=function(){throw new Error("Collection#updateOne unimplemented by driver")};f1.prototype.updateMany=function(){throw new Error("Collection#updateMany unimplemented by driver")};f1.prototype.deleteOne=function(){throw new Error("Collection#deleteOne unimplemented by driver")};f1.prototype.deleteMany=function(){throw new Error("Collection#deleteMany unimplemented by driver")};f1.prototype.getIndexes=function(){throw new Error("Collection#getIndexes unimplemented by driver")};f1.prototype.watch=function(){throw new Error("Collection#watch unimplemented by driver")};/*!
|
|
12
|
+
* ignore
|
|
13
|
+
*/f1.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()};/*!
|
|
14
|
+
* ignore
|
|
15
|
+
*/f1.prototype._getBufferTimeoutMS=function F(){let A=this.conn,B=this.opts;if(B.bufferTimeoutMS!=null)return B.bufferTimeoutMS;if(B&&B.schemaUserProvidedOptions!=null&&B.schemaUserProvidedOptions.bufferTimeoutMS!=null)return B.schemaUserProvidedOptions.bufferTimeoutMS;if(A.config.bufferTimeoutMS!=null)return A.config.bufferTimeoutMS;if(A.base!=null&&A.base.get("bufferTimeoutMS")!=null)return A.base.get("bufferTimeoutMS");return 1e4};/*!
|
|
16
|
+
* Module exports.
|
|
17
|
+
*/vW.exports=f1});var C1=z((XK1,mW)=>{/*!
|
|
18
|
+
* ignore
|
|
19
|
+
*/class rJ extends Error{}Object.defineProperty(rJ.prototype,"name",{value:"MongooseError"});mW.exports=rJ});var l6=z((Fc)=>{function RZ(F){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(F))}function N9(F){return Object.prototype.toString.call(F)==="[object Uint8Array]"}function P9(F){return Object.prototype.toString.call(F)==="[object RegExp]"}function wZ(F){return Object.prototype.toString.call(F)==="[object Map]"}function M9(F){return Object.prototype.toString.call(F)==="[object Date]"}function y2(F,A){return JSON.stringify(F,(B,D)=>{if(typeof D==="bigint")return{$numberLong:`${D}`};else if(wZ(D))return Object.fromEntries(D);return D})}function Hd(F){if(F!=null&&typeof F==="object"&&"stylize"in F&&typeof F.stylize==="function")return F.stylize}var O4=6,V8=2147483647,R8=-2147483648,ZK=Math.pow(2,63)-1,XK=-Math.pow(2,63),YK=Math.pow(2,53),$K=-Math.pow(2,53),IZ=1,GK=2,NZ=3,EK=4,PZ=5,qd=6,CK=7,HK=8,qK=9,MZ=10,cF=11,Wd=12,TZ=13,WK=14,KK=15,U8=16,zK=17,jZ=18,UK=19,QK=255,LK=127,Kd=0,lF=4,VK=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 y 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 n3 extends y{get name(){return"BSONVersionError"}constructor(){super(`Unsupported BSON version, bson types must be from bson ${O4}.x.x`)}}class Q8 extends y{get name(){return"BSONRuntimeError"}constructor(F){super(F)}}class w6 extends y{get name(){return"BSONOffsetError"}constructor(F,A,B){super(`${F}. offset: ${A}`,B);this.offset=A}}var dW,cW;function RK(F,A,B,D){if(D){dW??=new TextDecoder("utf8",{fatal:!0});try{return dW.decode(F.subarray(A,B))}catch(J){throw new y("Invalid UTF-8 string in BSON document",{cause:J})}}return cW??=new TextDecoder("utf8",{fatal:!1}),cW.decode(F.subarray(A,B))}function wK(F,A,B){if(F.length===0)return"";let D=B-A;if(D===0)return"";if(D>20)return null;if(D===1&&F[A]<128)return String.fromCharCode(F[A]);if(D===2&&F[A]<128&&F[A+1]<128)return String.fromCharCode(F[A])+String.fromCharCode(F[A+1]);if(D===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 Z=A;Z<B;Z++){let X=F[Z];if(X>127)return null;J.push(X)}return String.fromCharCode(...J)}function zd(F,A,B){if(A.length===0)return 0;if(A.length>25)return null;if(F.length-B<A.length)return null;for(let D=0,J=B;D<A.length;D++,J++){let Z=A.charCodeAt(D);if(Z>127)return null;F[J]=Z}return A.length}function Ud(F){return p3.fromNumberArray(Array.from({length:F},()=>Math.floor(Math.random()*256)))}var Qd=(()=>{try{return import.meta.require("crypto").randomBytes}catch{return Ud}})(),p3={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 y(`Cannot create Buffer from ${String(F)}`)},allocate(F){return Buffer.alloc(F)},allocateUnsafe(F){return Buffer.allocUnsafe(F)},equals(F,A){return p3.toLocalBufferType(F).equals(A)},fromNumberArray(F){return Buffer.from(F)},fromBase64(F){return Buffer.from(F,"base64")},toBase64(F){return p3.toLocalBufferType(F).toString("base64")},fromISO88591(F){return Buffer.from(F,"binary")},toISO88591(F){return p3.toLocalBufferType(F).toString("binary")},fromHex(F){return Buffer.from(F,"hex")},toHex(F){return p3.toLocalBufferType(F).toString("hex")},toUTF8(F,A,B,D){let J=B-A<=20?wK(F,A,B):null;if(J!=null)return J;let Z=p3.toLocalBufferType(F).toString("utf8",A,B);if(D){for(let X=0;X<Z.length;X++)if(Z.charCodeAt(X)===65533){RK(F,A,B,!0);break}}return Z},utf8ByteLength(F){return Buffer.byteLength(F,"utf8")},encodeUTF8Into(F,A,B){let D=zd(F,A,B);if(D!=null)return D;return p3.toLocalBufferType(F).write(A,B,void 0,"utf8")},randomBytes:Qd};function Ld(){let{navigator:F}=globalThis;return typeof F==="object"&&F.product==="ReactNative"}function Vd(F){if(F<0)throw new RangeError(`The argument 'byteLength' is invalid. Received ${F}`);return L8.fromNumberArray(Array.from({length:F},()=>Math.floor(Math.random()*256)))}var Rd=(()=>{let{crypto:F}=globalThis;if(F!=null&&typeof F.getRandomValues==="function")return(A)=>{return F.getRandomValues(L8.allocate(A))};else{if(Ld()){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 Vd}})(),lW=/(\d|[a-f])/i,L8={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 y(`Cannot make a Uint8Array from ${String(F)}`)},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 L8.allocate(F)},equals(F,A){if(F.byteLength!==A.byteLength)return!1;for(let B=0;B<F.byteLength;B++)if(F[B]!==A[B])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(L8.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),B=[];for(let D=0;D<A.length;D+=2){let J=A[D],Z=A[D+1];if(!lW.test(J))break;if(!lW.test(Z))break;let X=Number.parseInt(`${J}${Z}`,16);B.push(X)}return Uint8Array.from(B)},toHex(F){return Array.from(F,(A)=>A.toString(16).padStart(2,"0")).join("")},toUTF8(F,A,B,D){let J=B-A<=20?wK(F,A,B):null;if(J!=null)return J;return RK(F,A,B,D)},utf8ByteLength(F){return new TextEncoder().encode(F).byteLength},encodeUTF8Into(F,A,B){let D=new TextEncoder().encode(A);return F.set(D,B),D.byteLength},randomBytes:Rd},wd=typeof Buffer==="function"&&Buffer.prototype?._isBuffer!==!0,f=wd?p3:L8;class D2{get[Symbol.for("@@mdb.bson.version")](){return O4}[Symbol.for("nodejs.util.inspect.custom")](F,A,B){return this.inspect(F,A,B)}}class Q1 extends D2{get _bsontype(){return"Binary"}constructor(F,A){super();if(F!=null&&typeof F==="string"&&!ArrayBuffer.isView(F)&&!RZ(F)&&!Array.isArray(F))throw new y("Binary can only be constructed from Uint8Array or number[]");if(this.sub_type=A??Q1.BSON_BINARY_SUBTYPE_DEFAULT,F==null)this.buffer=f.allocate(Q1.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 y("only accepts single character String");else if(typeof F!=="number"&&F.length!==1)throw new y("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 y("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=A;else{let B=f.allocate(Q1.BUFFER_SIZE+this.buffer.length);B.set(this.buffer,0),this.buffer=B,this.buffer[this.position++]=A}}write(F,A){if(A=typeof A==="number"?A:this.position,this.buffer.byteLength<A+F.length){let B=f.allocate(this.buffer.byteLength+F.length);B.set(this.buffer,0),this.buffer=B}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 y("input cannot be string")}read(F,A){return A=A&&A>0?A:this.position,this.buffer.slice(F,F+A)}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){F=F||{};let A=f.toBase64(this.buffer),B=Number(this.sub_type).toString(16);if(F.legacy)return{$binary:A,$type:B.length===1?"0"+B:B};return{$binary:{base64:A,subType:B.length===1?"0"+B:B}}}toUUID(){if(this.sub_type===Q1.SUBTYPE_UUID)return new N0(this.buffer.slice(0,this.position));throw new y(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${Q1.SUBTYPE_UUID}" is currently supported.`)}static createFromHexString(F,A){return new Q1(f.fromHex(F),A)}static createFromBase64(F,A){return new Q1(f.fromBase64(F),A)}static fromExtendedJSON(F,A){A=A||{};let B,D;if("$binary"in F){if(A.legacy&&typeof F.$binary==="string"&&"$type"in F)D=F.$type?parseInt(F.$type,16):0,B=f.fromBase64(F.$binary);else if(typeof F.$binary!=="string")D=F.$binary.subType?parseInt(F.$binary.subType,16):0,B=f.fromBase64(F.$binary.base64)}else if("$uuid"in F)D=4,B=N0.bytesFromString(F.$uuid);if(!B)throw new y(`Unexpected Binary Extended JSON format ${JSON.stringify(F)}`);return D===lF?new N0(B):new Q1(B,D)}inspect(F,A,B){B??=y2;let D=f.toBase64(this.buffer.subarray(0,this.position)),J=B(D,A),Z=B(this.sub_type,A);return`Binary.createFromBase64(${J}, ${Z})`}}Q1.BSON_BINARY_SUBTYPE_DEFAULT=0;Q1.BUFFER_SIZE=256;Q1.SUBTYPE_DEFAULT=0;Q1.SUBTYPE_FUNCTION=1;Q1.SUBTYPE_BYTE_ARRAY=2;Q1.SUBTYPE_UUID_OLD=3;Q1.SUBTYPE_UUID=4;Q1.SUBTYPE_MD5=5;Q1.SUBTYPE_ENCRYPTED=6;Q1.SUBTYPE_COLUMN=7;Q1.SUBTYPE_SENSITIVE=8;Q1.SUBTYPE_USER_DEFINED=128;var tJ=16,Id=/^[0-9A-F]{32}$/i,Nd=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class N0 extends Q1{constructor(F){let A;if(F==null)A=N0.generate();else if(F instanceof N0)A=f.toLocalBufferType(new Uint8Array(F.buffer));else if(ArrayBuffer.isView(F)&&F.byteLength===tJ)A=f.toLocalBufferType(F);else if(typeof F==="string")A=N0.bytesFromString(F);else throw new y("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,lF)}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 N0)return f.equals(F.id,this.id);try{return f.equals(new N0(F).id,this.id)}catch{return!1}}toBinary(){return new Q1(this.id,Q1.SUBTYPE_UUID)}static generate(){let F=f.randomBytes(tJ);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 N0.isValidUUIDString(F);if(N9(F))return F.byteLength===tJ;return F._bsontype==="Binary"&&F.sub_type===this.SUBTYPE_UUID&&F.buffer.byteLength===16}static createFromHexString(F){let A=N0.bytesFromString(F);return new N0(A)}static createFromBase64(F){return new N0(f.fromBase64(F))}static bytesFromString(F){if(!N0.isValidUUIDString(F))throw new y("UUID string representation must be 32 hex digits or canonical hyphenated representation");return f.fromHex(F.replace(/-/g,""))}static isValidUUIDString(F){return Id.test(F)||Nd.test(F)}inspect(F,A,B){return B??=y2,`new UUID(${B(this.toHexString(),A)})`}}class Y3 extends D2{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 Y3(F.$code,F.$scope)}inspect(F,A,B){B??=y2;let D=B(this.code,A),J=D.includes(`
|
|
20
|
+
`);if(this.scope!=null)D+=`,${J?`
|
|
21
|
+
`:" "}${B(this.scope,A)}`;let Z=J&&this.scope===null;return`new Code(${J?`
|
|
22
|
+
`:""}${D}${Z?`
|
|
23
|
+
`:""})`}}function IK(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 c6 extends D2{get _bsontype(){return"DBRef"}constructor(F,A,B,D){super();let J=F.split(".");if(J.length===2)B=J.shift(),F=J.shift();this.collection=F,this.oid=A,this.db=B,this.fields=D||{}}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 c6(F.$ref,F.$id,F.$db,A)}inspect(F,A,B){B??=y2;let D=[B(this.namespace,A),B(this.oid,A),...this.db?[B(this.db,A)]:[],...Object.keys(this.fields).length>0?[B(this.fields,A)]:[]];return D[1]=B===y2?`new ObjectId(${D[1]})`:D[1],`new DBRef(${D.join(", ")})`}}function NK(F){if(F==="")return F;let A=0,B=F[A]==="-",D=F[A]==="+";if(D||B)A+=1;let J=!1;for(;A<F.length&&F[A]==="0";++A)J=!0;if(!J)return D?F.slice(1):F;return`${B?"-":""}${F.length===A?"0":F.slice(A)}`}function Pd(F,A){A=A??10;let B="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,A);return new RegExp(`[^-+${B}]`,"i").test(F)?!1:F}var t2=void 0;try{t2=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 pW=65536,Md=16777216,T9=pW*pW,PK=T9*T9,iW=PK/2,nW={},sW={},Td=20,jd=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class N extends D2{get _bsontype(){return"Long"}get __isLong__(){return!0}constructor(F=0,A,B){super();let D=typeof A==="boolean"?A:Boolean(B),J=typeof A==="number"?A:0,Z=typeof F==="string"?N.fromString(F,D):typeof F==="bigint"?N.fromBigInt(F,D):{low:F|0,high:J|0,unsigned:D};this.low=Z.low,this.high=Z.high,this.unsigned=Z.unsigned}static fromBits(F,A,B){return new N(F,A,B)}static fromInt(F,A){let B,D,J;if(A){if(F>>>=0,J=0<=F&&F<256){if(D=sW[F],D)return D}if(B=N.fromBits(F,(F|0)<0?-1:0,!0),J)sW[F]=B;return B}else{if(F|=0,J=-128<=F&&F<128){if(D=nW[F],D)return D}if(B=N.fromBits(F,F<0?-1:0,!1),J)nW[F]=B;return B}}static fromNumber(F,A){if(isNaN(F))return A?N.UZERO:N.ZERO;if(A){if(F<0)return N.UZERO;if(F>=PK)return N.MAX_UNSIGNED_VALUE}else{if(F<=-iW)return N.MIN_VALUE;if(F+1>=iW)return N.MAX_VALUE}if(F<0)return N.fromNumber(-F,A).neg();return N.fromBits(F%T9|0,F/T9|0,A)}static fromBigInt(F,A){let B=BigInt(4294967295),D=BigInt(32);return new N(Number(F&B),Number(F>>D&B),A)}static _fromString(F,A,B){if(F.length===0)throw new y("empty string");if(B<2||36<B)throw new y("radix");let D;if((D=F.indexOf("-"))>0)throw new y("interior hyphen");else if(D===0)return N._fromString(F.substring(1),A,B).neg();let J=N.fromNumber(Math.pow(B,8)),Z=N.ZERO;for(let X=0;X<F.length;X+=8){let Y=Math.min(8,F.length-X),$=parseInt(F.substring(X,X+Y),B);if(Y<8){let G=N.fromNumber(Math.pow(B,Y));Z=Z.mul(G).add(N.fromNumber($))}else Z=Z.mul(J),Z=Z.add(N.fromNumber($))}return Z.unsigned=A,Z}static fromStringStrict(F,A,B){let D=!1;if(typeof A==="number")B=A,A=!1;else D=!!A;if(B??=10,F.trim()!==F)throw new y(`Input: '${F}' contains leading and/or trailing whitespace`);if(!Pd(F,B))throw new y(`Input: '${F}' contains invalid characters for radix: ${B}`);let J=NK(F),Z=N._fromString(J,D,B);if(Z.toString(B).toLowerCase()!==J.toLowerCase())throw new y(`Input: ${F} is not representable as ${Z.unsigned?"an unsigned":"a signed"} 64-bit Long ${B!=null?`with radix: ${B}`:""}`);return Z}static fromString(F,A,B){let D=!1;if(typeof A==="number")B=A,A=!1;else D=!!A;if(B??=10,F==="NaN"&&B<24)return N.ZERO;else if((F==="Infinity"||F==="+Infinity"||F==="-Infinity")&&B<35)return N.ZERO;return N._fromString(F,D,B)}static fromBytes(F,A,B){return B?N.fromBytesLE(F,A):N.fromBytesBE(F,A)}static fromBytesLE(F,A){return new N(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 N(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 N.fromNumber(F,A);if(typeof F==="string")return N.fromString(F,A);return N.fromBits(F.low,F.high,typeof A==="boolean"?A:F.unsigned)}add(F){if(!N.isLong(F))F=N.fromValue(F);let A=this.high>>>16,B=this.high&65535,D=this.low>>>16,J=this.low&65535,Z=F.high>>>16,X=F.high&65535,Y=F.low>>>16,$=F.low&65535,G=0,E=0,C=0,H=0;return H+=J+$,C+=H>>>16,H&=65535,C+=D+Y,E+=C>>>16,C&=65535,E+=B+X,G+=E>>>16,E&=65535,G+=A+Z,G&=65535,N.fromBits(C<<16|H,G<<16|E,this.unsigned)}and(F){if(!N.isLong(F))F=N.fromValue(F);return N.fromBits(this.low&F.low,this.high&F.high,this.unsigned)}compare(F){if(!N.isLong(F))F=N.fromValue(F);if(this.eq(F))return 0;let A=this.isNegative(),B=F.isNegative();if(A&&!B)return-1;if(!A&&B)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(!N.isLong(F))F=N.fromValue(F);if(F.isZero())throw new y("division by zero");if(t2){if(!this.unsigned&&this.high===-2147483648&&F.low===-1&&F.high===-1)return this;let J=(this.unsigned?t2.div_u:t2.div_s)(this.low,this.high,F.low,F.high);return N.fromBits(J,t2.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?N.UZERO:N.ZERO;let A,B,D;if(!this.unsigned){if(this.eq(N.MIN_VALUE))if(F.eq(N.ONE)||F.eq(N.NEG_ONE))return N.MIN_VALUE;else if(F.eq(N.MIN_VALUE))return N.ONE;else if(A=this.shr(1).div(F).shl(1),A.eq(N.ZERO))return F.isNegative()?N.ONE:N.NEG_ONE;else return B=this.sub(F.mul(A)),D=A.add(B.div(F)),D;else if(F.eq(N.MIN_VALUE))return this.unsigned?N.UZERO:N.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();D=N.ZERO}else{if(!F.unsigned)F=F.toUnsigned();if(F.gt(this))return N.UZERO;if(F.gt(this.shru(1)))return N.UONE;D=N.UZERO}B=this;while(B.gte(F)){A=Math.max(1,Math.floor(B.toNumber()/F.toNumber()));let J=Math.ceil(Math.log(A)/Math.LN2),Z=J<=48?1:Math.pow(2,J-48),X=N.fromNumber(A),Y=X.mul(F);while(Y.isNegative()||Y.gt(B))A-=Z,X=N.fromNumber(A,this.unsigned),Y=X.mul(F);if(X.isZero())X=N.ONE;D=D.add(X),B=B.sub(Y)}return D}div(F){return this.divide(F)}equals(F){if(!N.isLong(F))F=N.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(N.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(!N.isLong(F))F=N.fromValue(F);if(t2){let A=(this.unsigned?t2.rem_u:t2.rem_s)(this.low,this.high,F.low,F.high);return N.fromBits(A,t2.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 N.ZERO;if(!N.isLong(F))F=N.fromValue(F);if(t2){let q=t2.mul(this.low,this.high,F.low,F.high);return N.fromBits(q,t2.get_high(),this.unsigned)}if(F.isZero())return N.ZERO;if(this.eq(N.MIN_VALUE))return F.isOdd()?N.MIN_VALUE:N.ZERO;if(F.eq(N.MIN_VALUE))return this.isOdd()?N.MIN_VALUE:N.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(N.TWO_PWR_24)&&F.lt(N.TWO_PWR_24))return N.fromNumber(this.toNumber()*F.toNumber(),this.unsigned);let A=this.high>>>16,B=this.high&65535,D=this.low>>>16,J=this.low&65535,Z=F.high>>>16,X=F.high&65535,Y=F.low>>>16,$=F.low&65535,G=0,E=0,C=0,H=0;return H+=J*$,C+=H>>>16,H&=65535,C+=D*$,E+=C>>>16,C&=65535,C+=J*Y,E+=C>>>16,C&=65535,E+=B*$,G+=E>>>16,E&=65535,E+=D*Y,G+=E>>>16,E&=65535,E+=J*X,G+=E>>>16,E&=65535,G+=A*$+B*Y+D*X+J*Z,G&=65535,N.fromBits(C<<16|H,G<<16|E,this.unsigned)}mul(F){return this.multiply(F)}negate(){if(!this.unsigned&&this.eq(N.MIN_VALUE))return N.MIN_VALUE;return this.not().add(N.ONE)}neg(){return this.negate()}not(){return N.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(!N.isLong(F))F=N.fromValue(F);return N.fromBits(this.low|F.low,this.high|F.high,this.unsigned)}shiftLeft(F){if(N.isLong(F))F=F.toInt();if((F&=63)===0)return this;else if(F<32)return N.fromBits(this.low<<F,this.high<<F|this.low>>>32-F,this.unsigned);else return N.fromBits(0,this.low<<F-32,this.unsigned)}shl(F){return this.shiftLeft(F)}shiftRight(F){if(N.isLong(F))F=F.toInt();if((F&=63)===0)return this;else if(F<32)return N.fromBits(this.low>>>F|this.high<<32-F,this.high>>F,this.unsigned);else return N.fromBits(this.high>>F-32,this.high>=0?0:-1,this.unsigned)}shr(F){return this.shiftRight(F)}shiftRightUnsigned(F){if(N.isLong(F))F=F.toInt();if(F&=63,F===0)return this;else{let A=this.high;if(F<32){let B=this.low;return N.fromBits(B>>>F|A<<32-F,A>>>F,this.unsigned)}else if(F===32)return N.fromBits(A,0,this.unsigned);else return N.fromBits(A>>>F-32,0,this.unsigned)}}shr_u(F){return this.shiftRightUnsigned(F)}shru(F){return this.shiftRightUnsigned(F)}subtract(F){if(!N.isLong(F))F=N.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)*T9+(this.low>>>0);return this.high*T9+(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 N.fromBits(this.low,this.high,!1)}toString(F){if(F=F||10,F<2||36<F)throw new y("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(N.MIN_VALUE)){let J=N.fromNumber(F),Z=this.div(J),X=Z.mul(J).sub(this);return Z.toString(F)+X.toInt().toString(F)}else return"-"+this.neg().toString(F);let A=N.fromNumber(Math.pow(F,6),this.unsigned),B=this,D="";while(!0){let J=B.div(A),X=(B.sub(J.mul(A)).toInt()>>>0).toString(F);if(B=J,B.isZero())return X+D;else{while(X.length<6)X="0"+X;D=""+X+D}}}toUnsigned(){if(this.unsigned)return this;return N.fromBits(this.low,this.high,!0)}xor(F){if(!N.isLong(F))F=N.fromValue(F);return N.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:B=!1,relaxed:D=!0}={...A};if(F.$numberLong.length>Td)throw new y("$numberLong string is too long");if(!jd.test(F.$numberLong))throw new y(`$numberLong string "${F.$numberLong}" is in an invalid format`);if(B){let Z=BigInt(F.$numberLong);return BigInt.asIntN(64,Z)}let J=N.fromString(F.$numberLong);if(D)return J.toNumber();return J}inspect(F,A,B){B??=y2;let D=B(this.toString(),A),J=this.unsigned?`, ${B(this.unsigned,A)}`:"";return`new Long(${D}${J})`}}N.TWO_PWR_24=N.fromInt(Md);N.MAX_UNSIGNED_VALUE=N.fromBits(-1,-1,!0);N.ZERO=N.fromInt(0);N.UZERO=N.fromInt(0,!0);N.ONE=N.fromInt(1);N.UONE=N.fromInt(1,!0);N.NEG_ONE=N.fromInt(-1);N.MAX_VALUE=N.fromBits(-1,2147483647,!1);N.MIN_VALUE=N.fromBits(0,-2147483648,!1);var ud=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Od=/^(\+|-)?(Infinity|inf)$/i,kd=/^(\+|-)?NaN$/i,I9=6111,K8=-6176,aW=6176,rW=34,oJ=f.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),tW=f.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),oW=f.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),Sd=/^([-+])?(\d+)?$/,xd=31,eW=16383,fd=30,_d=31;function FK(F){return!isNaN(parseInt(F,10))}function gd(F){let A=N.fromNumber(1e9),B=N.fromNumber(0);if(!F.parts[0]&&!F.parts[1]&&!F.parts[2]&&!F.parts[3])return{quotient:F,rem:B};for(let D=0;D<=3;D++)B=B.shiftLeft(32),B=B.add(new N(F.parts[D],0)),F.parts[D]=B.div(A).low,B=B.modulo(A);return{quotient:F,rem:B}}function bd(F,A){if(!F&&!A)return{high:N.fromNumber(0),low:N.fromNumber(0)};let B=F.shiftRightUnsigned(32),D=new N(F.getLowBits(),0),J=A.shiftRightUnsigned(32),Z=new N(A.getLowBits(),0),X=B.multiply(J),Y=B.multiply(Z),$=D.multiply(J),G=D.multiply(Z);return X=X.add(Y.shiftRightUnsigned(32)),Y=new N(Y.getLowBits(),0).add($).add(G.shiftRightUnsigned(32)),X=X.add(Y.shiftRightUnsigned(32)),G=Y.shiftLeft(32).add(new N(G.getLowBits(),0)),{high:X,low:G}}function yd(F,A){let B=F.high>>>0,D=A.high>>>0;if(B<D)return!0;else if(B===D){let J=F.low>>>0,Z=A.low>>>0;if(J<Z)return!0}return!1}function R6(F,A){throw new y(`"${F}" is not a valid Decimal128 string - ${A}`)}class d0 extends D2{get _bsontype(){return"Decimal128"}constructor(F){super();if(typeof F==="string")this.bytes=d0.fromString(F).bytes;else if(N9(F)){if(F.byteLength!==16)throw new y("Decimal128 must take a Buffer of 16 bytes");this.bytes=F}else throw new y("Decimal128 must take a Buffer or string")}static fromString(F){return d0._fromString(F,{allowRounding:!1})}static fromStringWithRounding(F){return d0._fromString(F,{allowRounding:!0})}static _fromString(F,A){let B=!1,D=!1,J=!1,Z=!1,X=0,Y=0,$=0,G=0,E=0,C=[0],H=0,q=0,W=0,K=0,U=new N(0,0),Q=new N(0,0),L=0,V=0;if(F.length>=7000)throw new y(""+F+" not a valid Decimal128 string");let w=F.match(ud),j=F.match(Od),T=F.match(kd);if(!w&&!j&&!T||F.length===0)throw new y(""+F+" not a valid Decimal128 string");if(w){let u=w[2],k=w[4],O=w[5],b=w[6];if(k&&b===void 0)R6(F,"missing exponent power");if(k&&u===void 0)R6(F,"missing exponent base");if(k===void 0&&(O||b))R6(F,"missing e before exponent")}if(F[V]==="+"||F[V]==="-")D=!0,B=F[V++]==="-";if(!FK(F[V])&&F[V]!=="."){if(F[V]==="i"||F[V]==="I")return new d0(B?tW:oW);else if(F[V]==="N")return new d0(oJ)}while(FK(F[V])||F[V]==="."){if(F[V]==="."){if(J)R6(F,"contains multiple periods");J=!0,V=V+1;continue}if(H<rW){if(F[V]!=="0"||Z){if(!Z)E=Y;Z=!0,C[q++]=parseInt(F[V],10),H=H+1}}if(Z)$=$+1;if(J)G=G+1;Y=Y+1,V=V+1}if(J&&!Y)throw new y(""+F+" not a valid Decimal128 string");if(F[V]==="e"||F[V]==="E"){let u=F.substr(++V).match(Sd);if(!u||!u[2])return new d0(oJ);K=parseInt(u[0],10),V=V+u[0].length}if(F[V])return new d0(oJ);if(!H)C[0]=0,$=1,H=1,X=0;else if(W=H-1,X=$,X!==1)while(F[E+X-1+Number(D)+Number(J)]==="0")X=X-1;if(K<=G&&G>K+16384)K=K8;else K=K-G;while(K>I9){if(W=W+1,W>=rW){if(X===0){K=I9;break}R6(F,"overflow")}K=K-1}if(A.allowRounding){while(K<K8||H<$){if(W===0&&X<H){K=K8,X=0;break}if(H<$)$=$-1;else W=W-1;if(K<I9)K=K+1;else{if(C.join("").match(/^0+$/)){K=I9;break}R6(F,"overflow")}}if(W+1<X){let u=Y;if(J)E=E+1,u=u+1;if(D)E=E+1,u=u+1;let k=parseInt(F[E+W+1],10),O=0;if(k>=5){if(O=1,k===5){O=C[W]%2===1?1:0;for(let b=E+W+2;b<u;b++)if(parseInt(F[b],10)){O=1;break}}}if(O){let b=W;for(;b>=0;b--)if(++C[b]>9){if(C[b]=0,b===0)if(K<I9)K=K+1,C[b]=1;else return new d0(B?tW:oW)}else break}}}else{while(K<K8||H<$){if(W===0){if(X===0){K=K8;break}R6(F,"exponent underflow")}if(H<$){if(F[$-1+Number(D)+Number(J)]!=="0"&&X!==0)R6(F,"inexact rounding");$=$-1}else{if(C[W]!==0)R6(F,"inexact rounding");W=W-1}if(K<I9)K=K+1;else R6(F,"overflow")}if(W+1<X){if(J)E=E+1;if(D)E=E+1;if(parseInt(F[E+W+1],10)!==0)R6(F,"inexact rounding")}}if(U=N.fromNumber(0),Q=N.fromNumber(0),X===0)U=N.fromNumber(0),Q=N.fromNumber(0);else if(W<17){let u=0;Q=N.fromNumber(C[u++]),U=new N(0,0);for(;u<=W;u++)Q=Q.multiply(N.fromNumber(10)),Q=Q.add(N.fromNumber(C[u]))}else{let u=0;U=N.fromNumber(C[u++]);for(;u<=W-17;u++)U=U.multiply(N.fromNumber(10)),U=U.add(N.fromNumber(C[u]));Q=N.fromNumber(C[u++]);for(;u<=W;u++)Q=Q.multiply(N.fromNumber(10)),Q=Q.add(N.fromNumber(C[u]))}let M=bd(U,N.fromString("100000000000000000"));if(M.low=M.low.add(Q),yd(M.low,Q))M.high=M.high.add(N.fromNumber(1));L=K+aW;let x={low:N.fromNumber(0),high:N.fromNumber(0)};if(M.high.shiftRightUnsigned(49).and(N.fromNumber(1)).equals(N.fromNumber(1)))x.high=x.high.or(N.fromNumber(3).shiftLeft(61)),x.high=x.high.or(N.fromNumber(L).and(N.fromNumber(16383).shiftLeft(47))),x.high=x.high.or(M.high.and(N.fromNumber(140737488355327)));else x.high=x.high.or(N.fromNumber(L&16383).shiftLeft(49)),x.high=x.high.or(M.high.and(N.fromNumber(562949953421311)));if(x.low=M.low,B)x.high=x.high.or(N.fromString("9223372036854775808"));let m=f.allocateUnsafe(16);return V=0,m[V++]=x.low.low&255,m[V++]=x.low.low>>8&255,m[V++]=x.low.low>>16&255,m[V++]=x.low.low>>24&255,m[V++]=x.low.high&255,m[V++]=x.low.high>>8&255,m[V++]=x.low.high>>16&255,m[V++]=x.low.high>>24&255,m[V++]=x.high.low&255,m[V++]=x.high.low>>8&255,m[V++]=x.high.low>>16&255,m[V++]=x.high.low>>24&255,m[V++]=x.high.high&255,m[V++]=x.high.high>>8&255,m[V++]=x.high.high>>16&255,m[V++]=x.high.high>>24&255,new d0(m)}toString(){let F,A=0,B=new Array(36);for(let V=0;V<B.length;V++)B[V]=0;let D=0,J=!1,Z,X={parts:[0,0,0,0]},Y,$,G=[];D=0;let E=this.bytes,C=E[D++]|E[D++]<<8|E[D++]<<16|E[D++]<<24,H=E[D++]|E[D++]<<8|E[D++]<<16|E[D++]<<24,q=E[D++]|E[D++]<<8|E[D++]<<16|E[D++]<<24,W=E[D++]|E[D++]<<8|E[D++]<<16|E[D++]<<24;if(D=0,{low:new N(C,H),high:new N(q,W)}.high.lessThan(N.ZERO))G.push("-");let U=W>>26&xd;if(U>>3===3)if(U===fd)return G.join("")+"Infinity";else if(U===_d)return"NaN";else F=W>>15&eW,Z=8+(W>>14&1);else Z=W>>14&7,F=W>>17&eW;let Q=F-aW;if(X.parts[0]=(W&16383)+((Z&15)<<14),X.parts[1]=q,X.parts[2]=H,X.parts[3]=C,X.parts[0]===0&&X.parts[1]===0&&X.parts[2]===0&&X.parts[3]===0)J=!0;else for($=3;$>=0;$--){let V=0,w=gd(X);if(X=w.quotient,V=w.rem.low,!V)continue;for(Y=8;Y>=0;Y--)B[$*9+Y]=V%10,V=Math.floor(V/10)}if(J)A=1,B[D]=0;else{A=36;while(!B[D])A=A-1,D=D+1}let L=A-1+Q;if(L>=34||L<=-7||Q>0){if(A>34){if(G.push("0"),Q>0)G.push(`E+${Q}`);else if(Q<0)G.push(`E${Q}`);return G.join("")}if(G.push(`${B[D++]}`),A=A-1,A)G.push(".");for(let V=0;V<A;V++)G.push(`${B[D++]}`);if(G.push("E"),L>0)G.push(`+${L}`);else G.push(`${L}`)}else if(Q>=0)for(let V=0;V<A;V++)G.push(`${B[D++]}`);else{let V=A+Q;if(V>0)for(let w=0;w<V;w++)G.push(`${B[D++]}`);else G.push("0");G.push(".");while(V++<0)G.push("0");for(let w=0;w<A-Math.max(V-1,0);w++)G.push(`${B[D++]}`)}return G.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(F){return d0.fromString(F.$numberDecimal)}inspect(F,A,B){return B??=y2,`new Decimal128(${B(this.toString(),A)})`}}class o2 extends D2{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 o2(NaN);if(F==="Infinity")return new o2(1/0);if(F==="-Infinity")return new o2(-1/0);if(!Number.isFinite(A))throw new y(`Input: ${F} is not representable as a Double`);if(F.trim()!==F)throw new y(`Input: '${F}' contains whitespace`);if(F==="")throw new y("Input is an empty string");if(/[^-0-9.+eE]/.test(F))throw new y(`Input: '${F}' is not in decimal or exponential notation`);return new o2(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 B=parseFloat(F.$numberDouble);return A&&A.relaxed?B:new o2(B)}inspect(F,A,B){return B??=y2,`new Double(${B(this.value,A)})`}}class $3 extends D2{get _bsontype(){return"Int32"}constructor(F){super();if(F instanceof Number)F=F.valueOf();this.value=+F|0}static fromString(F){let A=NK(F),B=Number(F);if(V8<B)throw new y(`Input: '${F}' is larger than the maximum value for Int32`);else if(R8>B)throw new y(`Input: '${F}' is smaller than the minimum value for Int32`);else if(!Number.isSafeInteger(B))throw new y(`Input: '${F}' is not a safe integer`);else if(B.toString()!==A)throw new y(`Input: '${F}' is not a valid Int32 string`);return new $3(B)}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 $3(F.$numberInt)}inspect(F,A,B){return B??=y2,`new Int32(${B(this.value,A)})`}}class k4 extends D2{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new k4}inspect(){return"new MaxKey()"}}class S4 extends D2{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new S4}inspect(){return"new MinKey()"}}var j9=new Float64Array(1),P1=new Uint8Array(j9.buffer,0,8);j9[0]=-1;var AK=P1[7]===0,F1={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 B=F1.getUint32LE(F,A),D=F1.getUint32LE(F,A+4);return(BigInt(D)<<BigInt(32))+BigInt(B)},getFloat64LE:AK?(F,A)=>{return P1[7]=F[A],P1[6]=F[A+1],P1[5]=F[A+2],P1[4]=F[A+3],P1[3]=F[A+4],P1[2]=F[A+5],P1[1]=F[A+6],P1[0]=F[A+7],j9[0]}:(F,A)=>{return P1[0]=F[A],P1[1]=F[A+1],P1[2]=F[A+2],P1[3]=F[A+3],P1[4]=F[A+4],P1[5]=F[A+5],P1[6]=F[A+6],P1[7]=F[A+7],j9[0]},setInt32BE(F,A,B){return F[A+3]=B,B>>>=8,F[A+2]=B,B>>>=8,F[A+1]=B,B>>>=8,F[A]=B,4},setInt32LE(F,A,B){return F[A]=B,B>>>=8,F[A+1]=B,B>>>=8,F[A+2]=B,B>>>=8,F[A+3]=B,4},setBigInt64LE(F,A,B){let D=BigInt(4294967295),J=Number(B&D);F[A]=J,J>>=8,F[A+1]=J,J>>=8,F[A+2]=J,J>>=8,F[A+3]=J;let Z=Number(B>>BigInt(32)&D);return F[A+4]=Z,Z>>=8,F[A+5]=Z,Z>>=8,F[A+6]=Z,Z>>=8,F[A+7]=Z,8},setFloat64LE:AK?(F,A,B)=>{return j9[0]=B,F[A]=P1[7],F[A+1]=P1[6],F[A+2]=P1[5],F[A+3]=P1[4],F[A+4]=P1[3],F[A+5]=P1[2],F[A+6]=P1[1],F[A+7]=P1[0],8}:(F,A,B)=>{return j9[0]=B,F[A]=P1[0],F[A+1]=P1[1],F[A+2]=P1[2],F[A+3]=P1[3],F[A+4]=P1[4],F[A+5]=P1[5],F[A+6]=P1[6],F[A+7]=P1[7],8}},vd=new RegExp("^[0-9a-fA-F]{24}$"),u4=null;class D0 extends D2{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 y("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=D0.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(A.length===24&&vd.test(A))this.buffer=f.fromHex(A);else throw new y("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");else throw new y("Argument passed in does not match the accepted types");if(D0.cacheHexString)this.__id=f.toHex(this.id)}get id(){return this.buffer}set id(F){if(this.buffer=F,D0.cacheHexString)this.__id=f.toHex(F)}toHexString(){if(D0.cacheHexString&&this.__id)return this.__id;let F=f.toHex(this.id);if(D0.cacheHexString&&!this.__id)this.__id=F;return F}static getInc(){return D0.index=(D0.index+1)%16777215}static generate(F){if(typeof F!=="number")F=Math.floor(Date.now()/1000);let A=D0.getInc(),B=f.allocateUnsafe(12);if(F1.setInt32BE(B,0,F),u4===null)u4=f.randomBytes(5);return B[4]=u4[0],B[5]=u4[1],B[6]=u4[2],B[7]=u4[3],B[8]=u4[4],B[11]=A&255,B[10]=A>>8&255,B[9]=A>>16&255,B}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(D0.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(),B=this.toHexString();return typeof A==="string"&&A.toLowerCase()===B}return!1}getTimestamp(){let F=new Date,A=F1.getUint32BE(this.buffer,0);return F.setTime(Math.floor(A)*1000),F}static createPk(){return new D0}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 B=11;B>=4;B--)A[B]=0;return F1.setInt32BE(A,0,F),new D0(A)}static createFromHexString(F){if(F?.length!==24)throw new y("hex string must be 24 characters");return new D0(f.fromHex(F))}static createFromBase64(F){if(F?.length!==16)throw new y("base64 string must be 16 characters");return new D0(f.fromBase64(F))}static isValid(F){if(F==null)return!1;try{return new D0(F),!0}catch{return!1}}toExtendedJSON(){if(this.toHexString)return{$oid:this.toHexString()};return{$oid:this.toString("hex")}}static fromExtendedJSON(F){return new D0(F.$oid)}inspect(F,A,B){return B??=y2,`new ObjectId(${B(this.toHexString(),A)})`}}D0.index=Math.floor(Math.random()*16777215);function mF(F,A,B){let D=5;if(Array.isArray(F))for(let J=0;J<F.length;J++)D+=BK(J.toString(),F[J],A,!0,B);else{if(typeof F?.toBSON==="function")F=F.toBSON();for(let J of Object.keys(F))D+=BK(J,F[J],A,!1,B)}return D}function BK(F,A,B=!1,D=!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>=$K&&A<=YK)if(A>=R8&&A<=V8)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(D||!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[Symbol.for("@@mdb.bson.version")]!==O4)throw new n3;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||M9(A))return(F!=null?f.utf8ByteLength(F)+1:0)+9;else if(ArrayBuffer.isView(A)||A instanceof ArrayBuffer||RZ(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+mF(A.scope,B,J);else return(F!=null?f.utf8ByteLength(F)+1:0)+1+4+f.utf8ByteLength(A.code.toString())+1;else if(A._bsontype==="Binary"){let Z=A;if(Z.sub_type===Q1.SUBTYPE_BYTE_ARRAY)return(F!=null?f.utf8ByteLength(F)+1:0)+(Z.position+1+4+1+4);else return(F!=null?f.utf8ByteLength(F)+1:0)+(Z.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 Z=Object.assign({$ref:A.collection,$id:A.oid},A.fields);if(A.db!=null)Z.$db=A.db;return(F!=null?f.utf8ByteLength(F)+1:0)+1+mF(Z,B,J)}else if(A instanceof RegExp||P9(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)+mF(A,B,J)+1;case"function":if(B)return(F!=null?f.utf8ByteLength(F)+1:0)+1+4+f.utf8ByteLength(A.toString())+1}return 0}function hd(F){return F.split("").sort().join("")}class F6 extends D2{get _bsontype(){return"BSONRegExp"}constructor(F,A){super();if(this.pattern=F,this.options=hd(A??""),this.pattern.indexOf("\x00")!==-1)throw new y(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(this.options.indexOf("\x00")!==-1)throw new y(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let B=0;B<this.options.length;B++)if(!(this.options[B]==="i"||this.options[B]==="m"||this.options[B]==="x"||this.options[B]==="l"||this.options[B]==="s"||this.options[B]==="u"))throw new y(`The regular expression option [${this.options[B]}] 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 F6(F.$regex,F6.parseOptions(F.$options));if("$regularExpression"in F)return new F6(F.$regularExpression.pattern,F6.parseOptions(F.$regularExpression.options));throw new y(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(F)}`)}inspect(F,A,B){let D=Hd(A)??((X)=>X);B??=y2;let J=D(B(this.pattern),"regexp"),Z=D(B(this.options),"regexp");return`new BSONRegExp(${J}, ${Z})`}}class x4 extends D2{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 x4(F.$symbol)}inspect(F,A,B){return B??=y2,`new BSONSymbol(${B(this.value,A)})`}}var md=N;class e2 extends md{get _bsontype(){return"Timestamp"}constructor(F){if(F==null)super(0,0,!0);else if(typeof F==="bigint")super(F,!0);else if(N.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 y("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 y("Timestamp constructed from { t, i } must provide i as a number");let A=Number(F.t),B=Number(F.i);if(A<0||Number.isNaN(A))throw new y("Timestamp constructed from { t, i } must provide a positive t");if(B<0||Number.isNaN(B))throw new y("Timestamp constructed from { t, i } must provide a positive i");if(A>4294967295)throw new y("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(B>4294967295)throw new y("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(B,A,!0)}else throw new y("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }")}toJSON(){return{$timestamp:this.toString()}}static fromInt(F){return new e2(N.fromInt(F,!0))}static fromNumber(F){return new e2(N.fromNumber(F,!0))}static fromBits(F,A){return new e2({i:F,t:A})}static fromString(F,A){return new e2(N.fromString(F,!0,A))}toExtendedJSON(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}}static fromExtendedJSON(F){let A=N.isLong(F.$timestamp.i)?F.$timestamp.i.getLowBitsUnsigned():F.$timestamp.i,B=N.isLong(F.$timestamp.t)?F.$timestamp.t.getLowBitsUnsigned():F.$timestamp.t;return new e2({t:B,i:A})}inspect(F,A,B){B??=y2;let D=B(this.high>>>0,A),J=B(this.low>>>0,A);return`new Timestamp({ t: ${D}, i: ${J} })`}}e2.MAX_VALUE=N.MAX_UNSIGNED_VALUE;var dd=N.fromNumber(YK),cd=N.fromNumber($K);function MK(F,A,B){A=A==null?{}:A;let D=A&&A.index?A.index:0,J=F1.getInt32LE(F,D);if(J<5)throw new y(`bson size must be >= 5, is ${J}`);if(A.allowObjectSmallerThanBufferSize&&F.length<J)throw new y(`buffer length ${F.length} must be >= bson size ${J}`);if(!A.allowObjectSmallerThanBufferSize&&F.length!==J)throw new y(`buffer length ${F.length} must === bson size ${J}`);if(J+D>F.byteLength)throw new y(`(bson size ${J} + options.index ${D} must be <= buffer length ${F.byteLength})`);if(F[D+J-1]!==0)throw new y("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return dF(F,D,A,B)}var ld=/^\$ref$|^\$id$|^\$db$/;function dF(F,A,B,D=!1){let J=B.fieldsAsRaw==null?null:B.fieldsAsRaw,Z=B.raw==null?!1:B.raw,X=typeof B.bsonRegExp==="boolean"?B.bsonRegExp:!1,Y=B.promoteBuffers??!1,$=B.promoteLongs??!0,G=B.promoteValues??!0,E=B.useBigInt64??!1;if(E&&!G)throw new y("Must either request bigint or Long for int64 deserialization");if(E&&!$)throw new y("Must either request bigint or Long for int64 deserialization");let C=B.validation==null?{utf8:!0}:B.validation,H=!0,q,W,K=C.utf8;if(typeof K==="boolean")q=K;else{H=!1;let T=Object.keys(K).map(function(M){return K[M]});if(T.length===0)throw new y("UTF-8 validation setting cannot be empty");if(typeof T[0]!=="boolean")throw new y("Invalid UTF-8 validation option, must specify boolean values");if(q=T[0],!T.every((M)=>M===q))throw new y("Invalid UTF-8 validation option - keys must be all true or all false")}if(!H){W=new Set;for(let T of Object.keys(K))W.add(T)}let U=A;if(F.length<5)throw new y("corrupt bson message < 5 bytes long");let Q=F1.getInt32LE(F,A);if(A+=4,Q<5||Q>F.length)throw new y("corrupt bson message");let L=D?[]:{},V=0,w=!1,j=D?!1:null;while(!w){let T=F[A++];if(T===0)break;let M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.byteLength)throw new y("Bad BSON Document: illegal CString");let x=D?V++:f.toUTF8(F,A,M,!1),m=!0;if(H||W?.has(x))m=q;else m=!q;if(j!==!1&&x[0]==="$")j=ld.test(x);let u;if(A=M+1,T===GK){let k=F1.getInt32LE(F,A);if(A+=4,k<=0||k>F.length-A||F[A+k-1]!==0)throw new y("bad string length in bson");u=f.toUTF8(F,A,A+k-1,m),A=A+k}else if(T===CK){let k=f.allocateUnsafe(12);for(let O=0;O<12;O++)k[O]=F[A+O];u=new D0(k),A=A+12}else if(T===U8&&G===!1)u=new $3(F1.getInt32LE(F,A)),A+=4;else if(T===U8)u=F1.getInt32LE(F,A),A+=4;else if(T===IZ){if(u=F1.getFloat64LE(F,A),A+=8,G===!1)u=new o2(u)}else if(T===qK){let k=F1.getInt32LE(F,A),O=F1.getInt32LE(F,A+4);A+=8,u=new Date(new N(k,O).toNumber())}else if(T===HK){if(F[A]!==0&&F[A]!==1)throw new y("illegal boolean type value");u=F[A++]===1}else if(T===NZ){let k=A,O=F1.getInt32LE(F,A);if(O<=0||O>F.length-A)throw new y("bad embedded document length in bson");if(Z)u=F.slice(A,A+O);else{let b=B;if(!H)b={...B,validation:{utf8:m}};u=dF(F,k,b,!1)}A=A+O}else if(T===EK){let k=A,O=F1.getInt32LE(F,A),b=B,s=A+O;if(J&&J[x])b={...B,raw:!0};if(!H)b={...b,validation:{utf8:m}};if(u=dF(F,k,b,!0),A=A+O,F[A-1]!==0)throw new y("invalid array terminator byte");if(A!==s)throw new y("corrupted array bson")}else if(T===qd)u=void 0;else if(T===MZ)u=null;else if(T===jZ)if(E)u=F1.getBigInt64LE(F,A),A+=8;else{let k=F1.getInt32LE(F,A),O=F1.getInt32LE(F,A+4);A+=8;let b=new N(k,O);if($&&G===!0)u=b.lessThanOrEqual(dd)&&b.greaterThanOrEqual(cd)?b.toNumber():b;else u=b}else if(T===UK){let k=f.allocateUnsafe(16);for(let O=0;O<16;O++)k[O]=F[A+O];A=A+16,u=new d0(k)}else if(T===PZ){let k=F1.getInt32LE(F,A);A+=4;let O=k,b=F[A++];if(k<0)throw new y("Negative binary type element size found");if(k>F.byteLength)throw new y("Binary type size larger than document size");if(F.slice!=null){if(b===Q1.SUBTYPE_BYTE_ARRAY){if(k=F1.getInt32LE(F,A),A+=4,k<0)throw new y("Negative binary type element size found for subtype 0x02");if(k>O-4)throw new y("Binary type with subtype 0x02 contains too long binary size");if(k<O-4)throw new y("Binary type with subtype 0x02 contains too short binary size")}if(Y&&G)u=f.toLocalBufferType(F.slice(A,A+k));else if(u=new Q1(F.slice(A,A+k),b),b===lF&&N0.isValid(u))u=u.toUUID()}else{if(b===Q1.SUBTYPE_BYTE_ARRAY){if(k=F1.getInt32LE(F,A),A+=4,k<0)throw new y("Negative binary type element size found for subtype 0x02");if(k>O-4)throw new y("Binary type with subtype 0x02 contains too long binary size");if(k<O-4)throw new y("Binary type with subtype 0x02 contains too short binary size")}if(Y&&G){u=f.allocateUnsafe(k);for(M=0;M<k;M++)u[M]=F[A+M]}else if(u=new Q1(F.slice(A,A+k),b),b===lF&&N0.isValid(u))u=u.toUUID()}A=A+k}else if(T===cF&&X===!1){M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new y("Bad BSON Document: illegal CString");let k=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 y("Bad BSON Document: illegal CString");let O=f.toUTF8(F,A,M,!1);A=M+1;let b=new Array(O.length);for(M=0;M<O.length;M++)switch(O[M]){case"m":b[M]="m";break;case"s":b[M]="g";break;case"i":b[M]="i";break}u=new RegExp(k,b.join(""))}else if(T===cF&&X===!0){M=A;while(F[M]!==0&&M<F.length)M++;if(M>=F.length)throw new y("Bad BSON Document: illegal CString");let k=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 y("Bad BSON Document: illegal CString");let O=f.toUTF8(F,A,M,!1);A=M+1,u=new F6(k,O)}else if(T===WK){let k=F1.getInt32LE(F,A);if(A+=4,k<=0||k>F.length-A||F[A+k-1]!==0)throw new y("bad string length in bson");let O=f.toUTF8(F,A,A+k-1,m);u=G?O:new x4(O),A=A+k}else if(T===zK)u=new e2({i:F1.getUint32LE(F,A),t:F1.getUint32LE(F,A+4)}),A+=8;else if(T===QK)u=new S4;else if(T===LK)u=new k4;else if(T===TZ){let k=F1.getInt32LE(F,A);if(A+=4,k<=0||k>F.length-A||F[A+k-1]!==0)throw new y("bad string length in bson");let O=f.toUTF8(F,A,A+k-1,m);u=new Y3(O),A=A+k}else if(T===KK){let k=F1.getInt32LE(F,A);if(A+=4,k<13)throw new y("code_w_scope total size shorter minimum expected length");let O=F1.getInt32LE(F,A);if(A+=4,O<=0||O>F.length-A||F[A+O-1]!==0)throw new y("bad string length in bson");let b=f.toUTF8(F,A,A+O-1,m);A=A+O;let s=A,N1=F1.getInt32LE(F,A),v0=dF(F,s,B,!1);if(A=A+N1,k<8+N1+O)throw new y("code_w_scope total size is too short, truncating scope");if(k>8+N1+O)throw new y("code_w_scope total size is too long, clips outer document");u=new Y3(b,v0)}else if(T===Wd){let k=F1.getInt32LE(F,A);if(A+=4,k<=0||k>F.length-A||F[A+k-1]!==0)throw new y("bad string length in bson");let O=f.toUTF8(F,A,A+k-1,m);A=A+k;let b=f.allocateUnsafe(12);for(let N1=0;N1<12;N1++)b[N1]=F[A+N1];let s=new D0(b);A=A+12,u=new c6(O,s)}else throw new y(`Detected unknown BSON type ${T.toString(16)} for fieldname "${x}"`);if(x==="__proto__")Object.defineProperty(L,x,{value:u,writable:!0,enumerable:!0,configurable:!0});else L[x]=u}if(Q!==A-U){if(D)throw new y("corrupt array bson");throw new y("corrupt object bson")}if(!j)return L;if(IK(L)){let T=Object.assign({},L);return delete T.$ref,delete T.$id,delete T.$db,new c6(L.$ref,L.$id,L.$db,T)}return L}var pF=/\x00/,DK=new Set(["$db","$ref","$id","$clusterTime"]);function eJ(F,A,B,D){F[D++]=GK;let J=f.encodeUTF8Into(F,A,D);D=D+J+1,F[D-1]=0;let Z=f.encodeUTF8Into(F,B,D+4);return F1.setInt32LE(F,D,Z+1),D=D+4+Z,F[D++]=0,D}function FZ(F,A,B,D){let Z=!Object.is(B,-0)&&Number.isSafeInteger(B)&&B<=V8&&B>=R8?U8:IZ;F[D++]=Z;let X=f.encodeUTF8Into(F,A,D);if(D=D+X,F[D++]=0,Z===U8)D+=F1.setInt32LE(F,D,B);else D+=F1.setFloat64LE(F,D,B);return D}function AZ(F,A,B,D){F[D++]=jZ;let J=f.encodeUTF8Into(F,A,D);return D+=J,F[D++]=0,D+=F1.setBigInt64LE(F,D,B),D}function z8(F,A,B,D){F[D++]=MZ;let J=f.encodeUTF8Into(F,A,D);return D=D+J,F[D++]=0,D}function BZ(F,A,B,D){F[D++]=HK;let J=f.encodeUTF8Into(F,A,D);return D=D+J,F[D++]=0,F[D++]=B?1:0,D}function DZ(F,A,B,D){F[D++]=qK;let J=f.encodeUTF8Into(F,A,D);D=D+J,F[D++]=0;let Z=N.fromNumber(B.getTime()),X=Z.getLowBits(),Y=Z.getHighBits();return D+=F1.setInt32LE(F,D,X),D+=F1.setInt32LE(F,D,Y),D}function JZ(F,A,B,D){F[D++]=cF;let J=f.encodeUTF8Into(F,A,D);if(D=D+J,F[D++]=0,B.source&&B.source.match(pF)!=null)throw new y("value "+B.source+" must not contain null bytes");if(D=D+f.encodeUTF8Into(F,B.source,D),F[D++]=0,B.ignoreCase)F[D++]=105;if(B.global)F[D++]=115;if(B.multiline)F[D++]=109;return F[D++]=0,D}function ZZ(F,A,B,D){F[D++]=cF;let J=f.encodeUTF8Into(F,A,D);if(D=D+J,F[D++]=0,B.pattern.match(pF)!=null)throw new y("pattern "+B.pattern+" must not contain null bytes");D=D+f.encodeUTF8Into(F,B.pattern,D),F[D++]=0;let Z=B.options.split("").sort().join("");return D=D+f.encodeUTF8Into(F,Z,D),F[D++]=0,D}function XZ(F,A,B,D){if(B===null)F[D++]=MZ;else if(B._bsontype==="MinKey")F[D++]=QK;else F[D++]=LK;let J=f.encodeUTF8Into(F,A,D);return D=D+J,F[D++]=0,D}function YZ(F,A,B,D){F[D++]=CK;let J=f.encodeUTF8Into(F,A,D);return D=D+J,F[D++]=0,D+=B.serializeInto(F,D),D}function $Z(F,A,B,D){F[D++]=PZ;let J=f.encodeUTF8Into(F,A,D);D=D+J,F[D++]=0;let Z=B.length;if(D+=F1.setInt32LE(F,D,Z),F[D++]=Kd,Z<=16)for(let X=0;X<Z;X++)F[D+X]=B[X];else F.set(B,D);return D=D+Z,D}function GZ(F,A,B,D,J,Z,X,Y,$){if($.has(B))throw new y("Cannot convert circular structure to BSON");$.add(B),F[D++]=Array.isArray(B)?EK:NZ;let G=f.encodeUTF8Into(F,A,D);D=D+G,F[D++]=0;let E=w8(F,B,J,D,Z+1,X,Y,$);return $.delete(B),E}function EZ(F,A,B,D){F[D++]=UK;let J=f.encodeUTF8Into(F,A,D);D=D+J,F[D++]=0;for(let Z=0;Z<16;Z++)F[D+Z]=B.bytes[Z];return D+16}function CZ(F,A,B,D){F[D++]=B._bsontype==="Long"?jZ:zK;let J=f.encodeUTF8Into(F,A,D);D=D+J,F[D++]=0;let Z=B.getLowBits(),X=B.getHighBits();return D+=F1.setInt32LE(F,D,Z),D+=F1.setInt32LE(F,D,X),D}function HZ(F,A,B,D){B=B.valueOf(),F[D++]=U8;let J=f.encodeUTF8Into(F,A,D);return D=D+J,F[D++]=0,D+=F1.setInt32LE(F,D,B),D}function qZ(F,A,B,D){F[D++]=IZ;let J=f.encodeUTF8Into(F,A,D);return D=D+J,F[D++]=0,D+=F1.setFloat64LE(F,D,B.value),D}function WZ(F,A,B,D){F[D++]=TZ;let J=f.encodeUTF8Into(F,A,D);D=D+J,F[D++]=0;let Z=B.toString(),X=f.encodeUTF8Into(F,Z,D+4)+1;return F1.setInt32LE(F,D,X),D=D+4+X-1,F[D++]=0,D}function KZ(F,A,B,D,J=!1,Z=0,X=!1,Y=!0,$){if(B.scope&&typeof B.scope==="object"){F[D++]=KK;let G=f.encodeUTF8Into(F,A,D);D=D+G,F[D++]=0;let E=D,C=B.code;D=D+4;let H=f.encodeUTF8Into(F,C,D+4)+1;F1.setInt32LE(F,D,H),F[D+4+H-1]=0,D=D+H+4;let q=w8(F,B.scope,J,D,Z+1,X,Y,$);D=q-1;let W=q-E;E+=F1.setInt32LE(F,E,W),F[D++]=0}else{F[D++]=TZ;let G=f.encodeUTF8Into(F,A,D);D=D+G,F[D++]=0;let E=B.code.toString(),C=f.encodeUTF8Into(F,E,D+4)+1;F1.setInt32LE(F,D,C),D=D+4+C-1,F[D++]=0}return D}function zZ(F,A,B,D){F[D++]=PZ;let J=f.encodeUTF8Into(F,A,D);D=D+J,F[D++]=0;let{buffer:Z,position:X}=B;if(B.sub_type===Q1.SUBTYPE_BYTE_ARRAY)X=X+4;if(D+=F1.setInt32LE(F,D,X),F[D++]=B.sub_type,B.sub_type===Q1.SUBTYPE_BYTE_ARRAY)X=X-4,D+=F1.setInt32LE(F,D,X);if(X<=16)for(let Y=0;Y<X;Y++)F[D+Y]=Z[Y];else F.set(Z,D);return D=D+B.position,D}function UZ(F,A,B,D){F[D++]=WK;let J=f.encodeUTF8Into(F,A,D);D=D+J,F[D++]=0;let Z=f.encodeUTF8Into(F,B.value,D+4)+1;return F1.setInt32LE(F,D,Z),D=D+4+Z-1,F[D++]=0,D}function QZ(F,A,B,D,J,Z,X){F[D++]=NZ;let Y=f.encodeUTF8Into(F,A,D);D=D+Y,F[D++]=0;let $=D,G={$ref:B.collection||B.namespace,$id:B.oid};if(B.db!=null)G.$db=B.db;G=Object.assign(G,B.fields);let E=w8(F,G,!1,D,J+1,Z,!0,X),C=E-$;return $+=F1.setInt32LE(F,D,C),E}function w8(F,A,B,D,J,Z,X,Y){if(Y==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 y("serialize does not support an array as the root input");if(typeof A!=="object")throw new y("serialize does not support non-object as the root input");else if("_bsontype"in A&&typeof A._bsontype==="string")throw new y("BSON types cannot be serialized as a document");else if(M9(A)||P9(A)||N9(A)||RZ(A))throw new y("date, regexp, typedarray, and arraybuffer cannot be BSON documents");Y=new Set}Y.add(A);let $=D+4;if(Array.isArray(A))for(let E=0;E<A.length;E++){let C=`${E}`,H=A[E];if(typeof H?.toBSON==="function")H=H.toBSON();if(typeof H==="string")$=eJ(F,C,H,$);else if(typeof H==="number")$=FZ(F,C,H,$);else if(typeof H==="bigint")$=AZ(F,C,H,$);else if(typeof H==="boolean")$=BZ(F,C,H,$);else if(H instanceof Date||M9(H))$=DZ(F,C,H,$);else if(H===void 0)$=z8(F,C,H,$);else if(H===null)$=z8(F,C,H,$);else if(N9(H))$=$Z(F,C,H,$);else if(H instanceof RegExp||P9(H))$=JZ(F,C,H,$);else if(typeof H==="object"&&H._bsontype==null)$=GZ(F,C,H,$,B,J,Z,X,Y);else if(typeof H==="object"&&H[Symbol.for("@@mdb.bson.version")]!==O4)throw new n3;else if(H._bsontype==="ObjectId")$=YZ(F,C,H,$);else if(H._bsontype==="Decimal128")$=EZ(F,C,H,$);else if(H._bsontype==="Long"||H._bsontype==="Timestamp")$=CZ(F,C,H,$);else if(H._bsontype==="Double")$=qZ(F,C,H,$);else if(typeof H==="function"&&Z)$=WZ(F,C,H,$);else if(H._bsontype==="Code")$=KZ(F,C,H,$,B,J,Z,X,Y);else if(H._bsontype==="Binary")$=zZ(F,C,H,$);else if(H._bsontype==="BSONSymbol")$=UZ(F,C,H,$);else if(H._bsontype==="DBRef")$=QZ(F,C,H,$,J,Z,Y);else if(H._bsontype==="BSONRegExp")$=ZZ(F,C,H,$);else if(H._bsontype==="Int32")$=HZ(F,C,H,$);else if(H._bsontype==="MinKey"||H._bsontype==="MaxKey")$=XZ(F,C,H,$);else if(typeof H._bsontype!=="undefined")throw new y(`Unrecognized or invalid _bsontype: ${String(H._bsontype)}`)}else if(A instanceof Map||wZ(A)){let E=A.entries(),C=!1;while(!C){let H=E.next();if(C=!!H.done,C)continue;let q=H.value[0],W=H.value[1];if(typeof W?.toBSON==="function")W=W.toBSON();let K=typeof W;if(typeof q==="string"&&!DK.has(q)){if(q.match(pF)!=null)throw new y("key "+q+" must not contain null bytes");if(B){if(q[0]==="$")throw new y("key "+q+" must not start with '$'");else if(q.includes("."))throw new y("key "+q+" must not contain '.'")}}if(K==="string")$=eJ(F,q,W,$);else if(K==="number")$=FZ(F,q,W,$);else if(K==="bigint")$=AZ(F,q,W,$);else if(K==="boolean")$=BZ(F,q,W,$);else if(W instanceof Date||M9(W))$=DZ(F,q,W,$);else if(W===null||W===void 0&&X===!1)$=z8(F,q,W,$);else if(N9(W))$=$Z(F,q,W,$);else if(W instanceof RegExp||P9(W))$=JZ(F,q,W,$);else if(K==="object"&&W._bsontype==null)$=GZ(F,q,W,$,B,J,Z,X,Y);else if(typeof W==="object"&&W[Symbol.for("@@mdb.bson.version")]!==O4)throw new n3;else if(W._bsontype==="ObjectId")$=YZ(F,q,W,$);else if(K==="object"&&W._bsontype==="Decimal128")$=EZ(F,q,W,$);else if(W._bsontype==="Long"||W._bsontype==="Timestamp")$=CZ(F,q,W,$);else if(W._bsontype==="Double")$=qZ(F,q,W,$);else if(W._bsontype==="Code")$=KZ(F,q,W,$,B,J,Z,X,Y);else if(typeof W==="function"&&Z)$=WZ(F,q,W,$);else if(W._bsontype==="Binary")$=zZ(F,q,W,$);else if(W._bsontype==="BSONSymbol")$=UZ(F,q,W,$);else if(W._bsontype==="DBRef")$=QZ(F,q,W,$,J,Z,Y);else if(W._bsontype==="BSONRegExp")$=ZZ(F,q,W,$);else if(W._bsontype==="Int32")$=HZ(F,q,W,$);else if(W._bsontype==="MinKey"||W._bsontype==="MaxKey")$=XZ(F,q,W,$);else if(typeof W._bsontype!=="undefined")throw new y(`Unrecognized or invalid _bsontype: ${String(W._bsontype)}`)}}else{if(typeof A?.toBSON==="function"){if(A=A.toBSON(),A!=null&&typeof A!=="object")throw new y("toBSON function did not return an object")}for(let E of Object.keys(A)){let C=A[E];if(typeof C?.toBSON==="function")C=C.toBSON();let H=typeof C;if(typeof E==="string"&&!DK.has(E)){if(E.match(pF)!=null)throw new y("key "+E+" must not contain null bytes");if(B){if(E[0]==="$")throw new y("key "+E+" must not start with '$'");else if(E.includes("."))throw new y("key "+E+" must not contain '.'")}}if(H==="string")$=eJ(F,E,C,$);else if(H==="number")$=FZ(F,E,C,$);else if(H==="bigint")$=AZ(F,E,C,$);else if(H==="boolean")$=BZ(F,E,C,$);else if(C instanceof Date||M9(C))$=DZ(F,E,C,$);else if(C===void 0){if(X===!1)$=z8(F,E,C,$)}else if(C===null)$=z8(F,E,C,$);else if(N9(C))$=$Z(F,E,C,$);else if(C instanceof RegExp||P9(C))$=JZ(F,E,C,$);else if(H==="object"&&C._bsontype==null)$=GZ(F,E,C,$,B,J,Z,X,Y);else if(typeof C==="object"&&C[Symbol.for("@@mdb.bson.version")]!==O4)throw new n3;else if(C._bsontype==="ObjectId")$=YZ(F,E,C,$);else if(H==="object"&&C._bsontype==="Decimal128")$=EZ(F,E,C,$);else if(C._bsontype==="Long"||C._bsontype==="Timestamp")$=CZ(F,E,C,$);else if(C._bsontype==="Double")$=qZ(F,E,C,$);else if(C._bsontype==="Code")$=KZ(F,E,C,$,B,J,Z,X,Y);else if(typeof C==="function"&&Z)$=WZ(F,E,C,$);else if(C._bsontype==="Binary")$=zZ(F,E,C,$);else if(C._bsontype==="BSONSymbol")$=UZ(F,E,C,$);else if(C._bsontype==="DBRef")$=QZ(F,E,C,$,J,Z,Y);else if(C._bsontype==="BSONRegExp")$=ZZ(F,E,C,$);else if(C._bsontype==="Int32")$=HZ(F,E,C,$);else if(C._bsontype==="MinKey"||C._bsontype==="MaxKey")$=XZ(F,E,C,$);else if(typeof C._bsontype!=="undefined")throw new y(`Unrecognized or invalid _bsontype: ${String(C._bsontype)}`)}}Y.delete(A),F[$++]=0;let G=$-D;return D+=F1.setInt32LE(F,D,G),$}function pd(F){return F!=null&&typeof F==="object"&&"_bsontype"in F&&typeof F._bsontype==="string"}var id={$oid:D0,$binary:Q1,$uuid:Q1,$symbol:x4,$numberInt:$3,$numberDecimal:d0,$numberDouble:o2,$numberLong:N,$minKey:S4,$maxKey:k4,$regex:F6,$regularExpression:F6,$timestamp:e2};function TK(F,A={}){if(typeof F==="number"){let D=F<=V8&&F>=R8,J=F<=ZK&&F>=XK;if(A.relaxed||A.legacy)return F;if(Number.isInteger(F)&&!Object.is(F,-0)){if(D)return new $3(F);if(J){if(A.useBigInt64)return BigInt(F);return N.fromNumber(F)}}return new o2(F)}if(F==null||typeof F!=="object")return F;if(F.$undefined)return null;let B=Object.keys(F).filter((D)=>D.startsWith("$")&&F[D]!=null);for(let D=0;D<B.length;D++){let J=id[B[D]];if(J)return J.fromExtendedJSON(F,A)}if(F.$date!=null){let D=F.$date,J=new Date;if(A.legacy)if(typeof D==="number")J.setTime(D);else if(typeof D==="string")J.setTime(Date.parse(D));else if(typeof D==="bigint")J.setTime(Number(D));else throw new Q8(`Unrecognized type for EJSON date: ${typeof D}`);else if(typeof D==="string")J.setTime(Date.parse(D));else if(N.isLong(D))J.setTime(D.toNumber());else if(typeof D==="number"&&A.relaxed)J.setTime(D);else if(typeof D==="bigint")J.setTime(Number(D));else throw new Q8(`Unrecognized type for EJSON date: ${typeof D}`);return J}if(F.$code!=null){let D=Object.assign({},F);if(F.$scope)D.$scope=TK(F.$scope);return Y3.fromExtendedJSON(F)}if(IK(F)||F.$dbPointer){let D=F.$ref?F:F.$dbPointer;if(D instanceof c6)return D;let J=Object.keys(D).filter((X)=>X.startsWith("$")),Z=!0;if(J.forEach((X)=>{if(["$ref","$id","$db"].indexOf(X)===-1)Z=!1}),Z)return c6.fromExtendedJSON(D)}return F}function nd(F,A){return F.map((B,D)=>{A.seenObjects.push({propertyName:`index ${D}`,obj:null});try{return X3(B,A)}finally{A.seenObjects.pop()}})}function JK(F){let A=F.toISOString();return F.getUTCMilliseconds()!==0?A:A.slice(0,-5)+"Z"}function X3(F,A){if(F instanceof Map||wZ(F)){let B=Object.create(null);for(let[D,J]of F){if(typeof D!=="string")throw new y("Can only serialize maps with string keys");B[D]=J}return X3(B,A)}if((typeof F==="object"||typeof F==="function")&&F!==null){let B=A.seenObjects.findIndex((D)=>D.obj===F);if(B!==-1){let D=A.seenObjects.map((E)=>E.propertyName),J=D.slice(0,B).map((E)=>`${E} -> `).join(""),Z=D[B],X=" -> "+D.slice(B+1,D.length-1).map((E)=>`${E} -> `).join(""),Y=D[D.length-1],$=" ".repeat(J.length+Z.length/2),G="-".repeat(X.length+(Z.length+Y.length)/2-1);throw new y(`Converting circular structure to EJSON:
|
|
24
|
+
${J}${Z}${X}${Y}
|
|
25
|
+
${$}\\${G}/`)}A.seenObjects[A.seenObjects.length-1].obj=F}if(Array.isArray(F))return nd(F,A);if(F===void 0)return null;if(F instanceof Date||M9(F)){let B=F.getTime(),D=B>-1&&B<253402318800000;if(A.legacy)return A.relaxed&&D?{$date:F.getTime()}:{$date:JK(F)};return A.relaxed&&D?{$date:JK(F)}:{$date:{$numberLong:F.getTime().toString()}}}if(typeof F==="number"&&(!A.relaxed||!isFinite(F))){if(Number.isInteger(F)&&!Object.is(F,-0)){if(F>=R8&&F<=V8)return{$numberInt:F.toString()};if(F>=XK&&F<=ZK)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||P9(F)){let B=F.flags;if(B===void 0){let J=F.toString().match(/[gimuy]*$/);if(J)B=J[0]}return new F6(F.source,B).toExtendedJSON(A)}if(F!=null&&typeof F==="object")return ad(F,A);return F}var sd={Binary:(F)=>new Q1(F.value(),F.sub_type),Code:(F)=>new Y3(F.code,F.scope),DBRef:(F)=>new c6(F.collection||F.namespace,F.oid,F.db,F.fields),Decimal128:(F)=>new d0(F.bytes),Double:(F)=>new o2(F.value),Int32:(F)=>new $3(F.value),Long:(F)=>N.fromBits(F.low!=null?F.low:F.low_,F.low!=null?F.high:F.high_,F.low!=null?F.unsigned:F.unsigned_),MaxKey:()=>new k4,MinKey:()=>new S4,ObjectId:(F)=>new D0(F),BSONRegExp:(F)=>new F6(F.pattern,F.options),BSONSymbol:(F)=>new x4(F.value),Timestamp:(F)=>e2.fromBits(F.low,F.high)};function ad(F,A){if(F==null||typeof F!=="object")throw new y("not an object instance");let B=F._bsontype;if(typeof B==="undefined"){let D={};for(let J of Object.keys(F)){A.seenObjects.push({propertyName:J,obj:null});try{let Z=X3(F[J],A);if(J==="__proto__")Object.defineProperty(D,J,{value:Z,writable:!0,enumerable:!0,configurable:!0});else D[J]=Z}finally{A.seenObjects.pop()}}return D}else if(F!=null&&typeof F==="object"&&typeof F._bsontype==="string"&&F[Symbol.for("@@mdb.bson.version")]!==O4)throw new n3;else if(pd(F)){let D=F;if(typeof D.toExtendedJSON!=="function"){let J=sd[F._bsontype];if(!J)throw new y("Unrecognized or invalid _bsontype: "+F._bsontype);D=J(D)}if(B==="Code"&&D.scope)D=new Y3(D.code,X3(D.scope,A));else if(B==="DBRef"&&D.oid)D=new c6(X3(D.collection,A),X3(D.oid,A),X3(D.db,A),X3(D.fields,A));return D.toExtendedJSON(A)}else throw new y("_bsontype must be a string, but was: "+typeof B)}function jK(F,A){let B={useBigInt64:A?.useBigInt64??!1,relaxed:A?.relaxed??!0,legacy:A?.legacy??!1};return JSON.parse(F,(D,J)=>{if(D.indexOf("\x00")!==-1)throw new y(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(D)}`);return TK(J,B)})}function uK(F,A,B,D){if(B!=null&&typeof B==="object")D=B,B=0;if(A!=null&&typeof A==="object"&&!Array.isArray(A))D=A,A=void 0,B=0;let J=Object.assign({relaxed:!0,legacy:!1},D,{seenObjects:[{propertyName:"(root)",obj:null}]}),Z=X3(F,J);return JSON.stringify(Z,A,B)}function rd(F,A){return A=A||{},JSON.parse(uK(F,A))}function td(F,A){return A=A||{},jK(JSON.stringify(F),A)}var f4=Object.create(null);f4.parse=jK;f4.stringify=uK;f4.serialize=rd;f4.deserialize=td;Object.freeze(f4);function LZ(F,A){try{return F1.getNonnegativeInt32LE(F,A)}catch(B){throw new w6("BSON size cannot be negative",A,{cause:B})}}function VZ(F,A){let B=A;for(;F[B]!==0;B++);if(B===F.length-1)throw new w6("Null terminator not found",A);return B}function od(F,A=0){if(A??=0,F.length<5)throw new w6(`Input must be at least 5 bytes, got ${F.length} bytes`,A);let B=LZ(F,A);if(B>F.length-A)throw new w6(`Parsed documentSize (${B} bytes) does not match input length (${F.length} bytes)`,A);if(F[A+B-1]!==0)throw new w6("BSON documents must end in 0x00",A+B);let D=[],J=A+4;while(J<=B+A){let Z=F[J];if(J+=1,Z===0){if(J-A!==B)throw new w6("Invalid 0x00 type byte",J);break}let X=J,Y=VZ(F,J)-X;J+=Y+1;let $;if(Z===1||Z===18||Z===9||Z===17)$=8;else if(Z===16)$=4;else if(Z===7)$=12;else if(Z===19)$=16;else if(Z===8)$=1;else if(Z===10||Z===6||Z===127||Z===255)$=0;else if(Z===11)$=VZ(F,VZ(F,J)+1)+1-J;else if(Z===3||Z===4||Z===15)$=LZ(F,J);else if(Z===2||Z===5||Z===12||Z===13||Z===14){if($=LZ(F,J)+4,Z===5)$+=1;if(Z===12)$+=12}else throw new w6(`Invalid 0x${Z.toString(16).padStart(2,"0")} type byte`,J);if($>B)throw new w6("value reports length larger than document",J);D.push([Z,X,Y,J,$]),J+=$}return D}var u9=Object.create(null);u9.parseToElements=od;u9.ByteUtils=f;u9.NumberUtils=F1;Object.freeze(u9);var OK=17825792,i3=f.allocate(OK);function kK(F){if(i3.length<F)i3=f.allocate(F)}function SK(F,A={}){let B=typeof A.checkKeys==="boolean"?A.checkKeys:!1,D=typeof A.serializeFunctions==="boolean"?A.serializeFunctions:!1,J=typeof A.ignoreUndefined==="boolean"?A.ignoreUndefined:!0,Z=typeof A.minInternalBufferSize==="number"?A.minInternalBufferSize:OK;if(i3.length<Z)i3=f.allocate(Z);let X=w8(i3,F,B,0,0,D,J,null),Y=f.allocateUnsafe(X);return Y.set(i3.subarray(0,X),0),Y}function xK(F,A,B={}){let D=typeof B.checkKeys==="boolean"?B.checkKeys:!1,J=typeof B.serializeFunctions==="boolean"?B.serializeFunctions:!1,Z=typeof B.ignoreUndefined==="boolean"?B.ignoreUndefined:!0,X=typeof B.index==="number"?B.index:0,Y=w8(i3,F,D,0,0,J,Z,null);return A.set(i3.subarray(0,Y),X),X+Y-1}function fK(F,A={}){return MK(f.toLocalBufferType(F),A)}function _K(F,A={}){A=A||{};let B=typeof A.serializeFunctions==="boolean"?A.serializeFunctions:!1,D=typeof A.ignoreUndefined==="boolean"?A.ignoreUndefined:!0;return mF(F,B,D)}function gK(F,A,B,D,J,Z){let X=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},Z),Y=f.toLocalBufferType(F),$=A;for(let G=0;G<B;G++){let E=F1.getInt32LE(Y,$);X.index=$,D[J+G]=MK(Y,X),$=$+E}return $}var ed=Object.freeze({__proto__:null,BSONError:y,BSONOffsetError:w6,BSONRegExp:F6,BSONRuntimeError:Q8,BSONSymbol:x4,BSONType:VK,BSONValue:D2,BSONVersionError:n3,Binary:Q1,Code:Y3,DBRef:c6,Decimal128:d0,Double:o2,EJSON:f4,Int32:$3,Long:N,MaxKey:k4,MinKey:S4,ObjectId:D0,Timestamp:e2,UUID:N0,calculateObjectSize:_K,deserialize:fK,deserializeStream:gK,onDemand:u9,serialize:SK,serializeWithBufferAndIndex:xK,setInternalBufferSize:kK});Fc.BSON=ed;Fc.BSONError=y;Fc.BSONOffsetError=w6;Fc.BSONRegExp=F6;Fc.BSONRuntimeError=Q8;Fc.BSONSymbol=x4;Fc.BSONType=VK;Fc.BSONValue=D2;Fc.BSONVersionError=n3;Fc.Binary=Q1;Fc.Code=Y3;Fc.DBRef=c6;Fc.Decimal128=d0;Fc.Double=o2;Fc.EJSON=f4;Fc.Int32=$3;Fc.Long=N;Fc.MaxKey=k4;Fc.MinKey=S4;Fc.ObjectId=D0;Fc.Timestamp=e2;Fc.UUID=N0;Fc.calculateObjectSize=_K;Fc.deserialize=fK;Fc.deserializeStream=gK;Fc.onDemand=u9;Fc.serialize=SK;Fc.serializeWithBufferAndIndex=xK;Fc.setInternalBufferSize=kK});var w1=z((J0)=>{Object.defineProperty(J0,"__esModule",{value:!0});J0.toUTF8=J0.getBigInt64LE=J0.getFloat64LE=J0.getInt32LE=J0.UUID=J0.Timestamp=J0.serialize=J0.ObjectId=J0.MinKey=J0.MaxKey=J0.Long=J0.Int32=J0.EJSON=J0.Double=J0.deserialize=J0.Decimal128=J0.DBRef=J0.Code=J0.calculateObjectSize=J0.BSONType=J0.BSONSymbol=J0.BSONRegExp=J0.BSONError=J0.BSON=J0.Binary=void 0;J0.parseToElementsToArray=Oc;J0.pluckBSONSerializeOptions=kc;J0.resolveBSONOptions=Sc;J0.parseUtf8ValidationOption=xc;var I8=l6(),q0=l6();Object.defineProperty(J0,"Binary",{enumerable:!0,get:function(){return q0.Binary}});Object.defineProperty(J0,"BSON",{enumerable:!0,get:function(){return q0.BSON}});Object.defineProperty(J0,"BSONError",{enumerable:!0,get:function(){return q0.BSONError}});Object.defineProperty(J0,"BSONRegExp",{enumerable:!0,get:function(){return q0.BSONRegExp}});Object.defineProperty(J0,"BSONSymbol",{enumerable:!0,get:function(){return q0.BSONSymbol}});Object.defineProperty(J0,"BSONType",{enumerable:!0,get:function(){return q0.BSONType}});Object.defineProperty(J0,"calculateObjectSize",{enumerable:!0,get:function(){return q0.calculateObjectSize}});Object.defineProperty(J0,"Code",{enumerable:!0,get:function(){return q0.Code}});Object.defineProperty(J0,"DBRef",{enumerable:!0,get:function(){return q0.DBRef}});Object.defineProperty(J0,"Decimal128",{enumerable:!0,get:function(){return q0.Decimal128}});Object.defineProperty(J0,"deserialize",{enumerable:!0,get:function(){return q0.deserialize}});Object.defineProperty(J0,"Double",{enumerable:!0,get:function(){return q0.Double}});Object.defineProperty(J0,"EJSON",{enumerable:!0,get:function(){return q0.EJSON}});Object.defineProperty(J0,"Int32",{enumerable:!0,get:function(){return q0.Int32}});Object.defineProperty(J0,"Long",{enumerable:!0,get:function(){return q0.Long}});Object.defineProperty(J0,"MaxKey",{enumerable:!0,get:function(){return q0.MaxKey}});Object.defineProperty(J0,"MinKey",{enumerable:!0,get:function(){return q0.MinKey}});Object.defineProperty(J0,"ObjectId",{enumerable:!0,get:function(){return q0.ObjectId}});Object.defineProperty(J0,"serialize",{enumerable:!0,get:function(){return q0.serialize}});Object.defineProperty(J0,"Timestamp",{enumerable:!0,get:function(){return q0.Timestamp}});Object.defineProperty(J0,"UUID",{enumerable:!0,get:function(){return q0.UUID}});function Oc(F,A){let B=I8.BSON.onDemand.parseToElements(F,A);return Array.isArray(B)?B:[...B]}J0.getInt32LE=I8.BSON.onDemand.NumberUtils.getInt32LE;J0.getFloat64LE=I8.BSON.onDemand.NumberUtils.getFloat64LE;J0.getBigInt64LE=I8.BSON.onDemand.NumberUtils.getBigInt64LE;J0.toUTF8=I8.BSON.onDemand.ByteUtils.toUTF8;function kc(F){let{fieldsAsRaw:A,useBigInt64:B,promoteValues:D,promoteBuffers:J,promoteLongs:Z,serializeFunctions:X,ignoreUndefined:Y,bsonRegExp:$,raw:G,enableUtf8Validation:E}=F;return{fieldsAsRaw:A,useBigInt64:B,promoteValues:D,promoteBuffers:J,promoteLongs:Z,serializeFunctions:X,ignoreUndefined:Y,bsonRegExp:$,raw:G,enableUtf8Validation:E}}function Sc(F,A){let B=A?.bsonOptions;return{raw:F?.raw??B?.raw??!1,useBigInt64:F?.useBigInt64??B?.useBigInt64??!1,promoteLongs:F?.promoteLongs??B?.promoteLongs??!0,promoteValues:F?.promoteValues??B?.promoteValues??!0,promoteBuffers:F?.promoteBuffers??B?.promoteBuffers??!1,ignoreUndefined:F?.ignoreUndefined??B?.ignoreUndefined??!1,bsonRegExp:F?.bsonRegExp??B?.bsonRegExp??!1,serializeFunctions:F?.serializeFunctions??B?.serializeFunctions??!1,fieldsAsRaw:F?.fieldsAsRaw??B?.fieldsAsRaw??{},enableUtf8Validation:F?.enableUtf8Validation??B?.enableUtf8Validation??!0}}function xc(F){if(F?.enableUtf8Validation===!1)return{utf8:!1};return{utf8:{writeErrors:!1}}}});var p=z((Kz)=>{Object.defineProperty(Kz,"__esModule",{value:!0});Kz.MongoWriteConcernError=Kz.MongoServerSelectionError=Kz.MongoSystemError=Kz.MongoMissingDependencyError=Kz.MongoMissingCredentialsError=Kz.MongoCompatibilityError=Kz.MongoInvalidArgumentError=Kz.MongoParseError=Kz.MongoNetworkTimeoutError=Kz.MongoNetworkError=Kz.MongoTopologyClosedError=Kz.MongoCursorExhaustedError=Kz.MongoServerClosedError=Kz.MongoCursorInUseError=Kz.MongoUnexpectedServerResponseError=Kz.MongoGridFSChunkError=Kz.MongoGridFSStreamError=Kz.MongoTailableCursorError=Kz.MongoChangeStreamError=Kz.MongoClientBulkWriteExecutionError=Kz.MongoClientBulkWriteCursorError=Kz.MongoClientBulkWriteError=Kz.MongoGCPError=Kz.MongoAzureError=Kz.MongoOIDCError=Kz.MongoAWSError=Kz.MongoKerberosError=Kz.MongoExpiredSessionError=Kz.MongoTransactionError=Kz.MongoNotConnectedError=Kz.MongoDecompressionError=Kz.MongoBatchReExecutionError=Kz.MongoRuntimeError=Kz.MongoAPIError=Kz.MongoDriverError=Kz.MongoServerError=Kz.MongoError=Kz.MongoErrorLabel=Kz.GET_MORE_RESUMABLE_CODES=Kz.MONGODB_ERROR_CODES=Kz.NODE_IS_RECOVERING_ERROR_MESSAGE=Kz.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=Kz.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=void 0;Kz.isNetworkErrorBeforeHandshake=dc;Kz.needsRetryableWriteLabel=cc;Kz.isRetryableWriteError=qz;Kz.isRetryableReadError=lc;Kz.isNodeShuttingDownError=ac;Kz.isSDAMUnrecoverableError=rc;Kz.isNetworkTimeoutError=tc;Kz.isResumableError=oc;var N8=Symbol("errorLabels");Kz.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=new RegExp("not master","i");Kz.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=new RegExp("not master or secondary","i");Kz.NODE_IS_RECOVERING_ERROR_MESSAGE=new RegExp("node is recovering","i");Kz.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});Kz.GET_MORE_RESUMABLE_CODES=new Set([Kz.MONGODB_ERROR_CODES.HostUnreachable,Kz.MONGODB_ERROR_CODES.HostNotFound,Kz.MONGODB_ERROR_CODES.NetworkTimeout,Kz.MONGODB_ERROR_CODES.ShutdownInProgress,Kz.MONGODB_ERROR_CODES.PrimarySteppedDown,Kz.MONGODB_ERROR_CODES.ExceededTimeLimit,Kz.MONGODB_ERROR_CODES.SocketException,Kz.MONGODB_ERROR_CODES.NotWritablePrimary,Kz.MONGODB_ERROR_CODES.InterruptedAtShutdown,Kz.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,Kz.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,Kz.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,Kz.MONGODB_ERROR_CODES.StaleShardVersion,Kz.MONGODB_ERROR_CODES.StaleEpoch,Kz.MONGODB_ERROR_CODES.StaleConfig,Kz.MONGODB_ERROR_CODES.RetryChangeStream,Kz.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference,Kz.MONGODB_ERROR_CODES.CursorNotFound]);Kz.MongoErrorLabel=Object.freeze({RetryableWriteError:"RetryableWriteError",TransientTransactionError:"TransientTransactionError",UnknownTransactionCommitResult:"UnknownTransactionCommitResult",ResumableChangeStreamError:"ResumableChangeStreamError",HandshakeError:"HandshakeError",ResetPool:"ResetPool",PoolRequstedRetry:"PoolRequstedRetry",InterruptInUseConnections:"InterruptInUseConnections",NoWritesPerformed:"NoWritesPerformed"});function mc(F){return F!=null&&typeof F==="object"&&"errors"in F&&Array.isArray(F.errors)}class p6 extends Error{constructor(F,A){super(F,A);this[N8]=new Set}static buildErrorMessage(F){if(typeof F==="string")return F;if(mc(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[N8].has(F)}addErrorLabel(F){this[N8].add(F)}get errorLabels(){return Array.from(this[N8])}}Kz.MongoError=p6;class iF extends p6{constructor(F){super(F.message||F.errmsg||F.$err||"n/a");if(F.errorLabels)this[N8]=new Set(F.errorLabels);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"}}Kz.MongoServerError=iF;class M8 extends p6{constructor(F,A){super(F,A)}get name(){return"MongoDriverError"}}Kz.MongoDriverError=M8;class J2 extends M8{constructor(F,A){super(F,A)}get name(){return"MongoAPIError"}}Kz.MongoAPIError=J2;class A6 extends M8{constructor(F,A){super(F,A)}get name(){return"MongoRuntimeError"}}Kz.MongoRuntimeError=A6;class yK extends J2{constructor(F="This batch has already been executed, create new batch to execute"){super(F)}get name(){return"MongoBatchReExecutionError"}}Kz.MongoBatchReExecutionError=yK;class vK extends A6{constructor(F){super(F)}get name(){return"MongoDecompressionError"}}Kz.MongoDecompressionError=vK;class hK extends J2{constructor(F){super(F)}get name(){return"MongoNotConnectedError"}}Kz.MongoNotConnectedError=hK;class mK extends J2{constructor(F){super(F)}get name(){return"MongoTransactionError"}}Kz.MongoTransactionError=mK;class dK extends J2{constructor(F="Cannot use a session that has ended"){super(F)}get name(){return"MongoExpiredSessionError"}}Kz.MongoExpiredSessionError=dK;class cK extends A6{constructor(F){super(F)}get name(){return"MongoKerberosError"}}Kz.MongoKerberosError=cK;class lK extends A6{constructor(F,A){super(F,A)}get name(){return"MongoAWSError"}}Kz.MongoAWSError=lK;class nF extends A6{constructor(F){super(F)}get name(){return"MongoOIDCError"}}Kz.MongoOIDCError=nF;class pK extends nF{constructor(F){super(F)}get name(){return"MongoAzureError"}}Kz.MongoAzureError=pK;class iK extends nF{constructor(F){super(F)}get name(){return"MongoGCPError"}}Kz.MongoGCPError=iK;class nK extends iF{constructor(F){super(F);this.writeConcernErrors=[],this.writeErrors=new Map}get name(){return"MongoClientBulkWriteError"}}Kz.MongoClientBulkWriteError=nK;class sK extends A6{constructor(F){super(F)}get name(){return"MongoClientBulkWriteCursorError"}}Kz.MongoClientBulkWriteCursorError=sK;class aK extends A6{constructor(F){super(F)}get name(){return"MongoClientBulkWriteExecutionError"}}Kz.MongoClientBulkWriteExecutionError=aK;class rK extends A6{constructor(F){super(F)}get name(){return"MongoChangeStreamError"}}Kz.MongoChangeStreamError=rK;class tK extends J2{constructor(F="Tailable cursor does not support this operation"){super(F)}get name(){return"MongoTailableCursorError"}}Kz.MongoTailableCursorError=tK;class oK extends A6{constructor(F){super(F)}get name(){return"MongoGridFSStreamError"}}Kz.MongoGridFSStreamError=oK;class eK extends A6{constructor(F){super(F)}get name(){return"MongoGridFSChunkError"}}Kz.MongoGridFSChunkError=eK;class Fz extends A6{constructor(F,A){super(F,A)}get name(){return"MongoUnexpectedServerResponseError"}}Kz.MongoUnexpectedServerResponseError=Fz;class Az extends J2{constructor(F="Cursor is already initialized"){super(F)}get name(){return"MongoCursorInUseError"}}Kz.MongoCursorInUseError=Az;class Bz extends J2{constructor(F="Server is closed"){super(F)}get name(){return"MongoServerClosedError"}}Kz.MongoServerClosedError=Bz;class Dz extends J2{constructor(F){super(F||"Cursor is exhausted")}get name(){return"MongoCursorExhaustedError"}}Kz.MongoCursorExhaustedError=Dz;class Jz extends J2{constructor(F="Topology is closed"){super(F)}get name(){return"MongoTopologyClosedError"}}Kz.MongoTopologyClosedError=Jz;var Zz=Symbol("beforeHandshake");function dc(F){return F[Zz]===!0}class _4 extends p6{constructor(F,A){super(F,{cause:A?.cause});if(A&&typeof A.beforeHandshake==="boolean")this[Zz]=A.beforeHandshake}get name(){return"MongoNetworkError"}}Kz.MongoNetworkError=_4;class Xz extends _4{constructor(F,A){super(F,A)}get name(){return"MongoNetworkTimeoutError"}}Kz.MongoNetworkTimeoutError=Xz;class OZ extends M8{constructor(F){super(F)}get name(){return"MongoParseError"}}Kz.MongoParseError=OZ;class Yz extends J2{constructor(F,A){super(F,A)}get name(){return"MongoInvalidArgumentError"}}Kz.MongoInvalidArgumentError=Yz;class $z extends J2{constructor(F){super(F)}get name(){return"MongoCompatibilityError"}}Kz.MongoCompatibilityError=$z;class Gz extends J2{constructor(F){super(F)}get name(){return"MongoMissingCredentialsError"}}Kz.MongoMissingCredentialsError=Gz;class Ez extends J2{constructor(F,A){super(F,A);this.dependencyName=A.dependencyName}get name(){return"MongoMissingDependencyError"}}Kz.MongoMissingDependencyError=Ez;class kZ extends p6{constructor(F,A){if(A&&A.error)super(p6.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"}}Kz.MongoSystemError=kZ;class Cz extends kZ{constructor(F,A){super(F,A)}get name(){return"MongoServerSelectionError"}}Kz.MongoServerSelectionError=Cz;class SZ extends iF{constructor(F){super({...F.writeConcernError,...F});this.errInfo=F.writeConcernError.errInfo,this.result=F}get name(){return"MongoWriteConcernError"}}Kz.MongoWriteConcernError=SZ;var Hz=new Set([Kz.MONGODB_ERROR_CODES.HostUnreachable,Kz.MONGODB_ERROR_CODES.HostNotFound,Kz.MONGODB_ERROR_CODES.NetworkTimeout,Kz.MONGODB_ERROR_CODES.ShutdownInProgress,Kz.MONGODB_ERROR_CODES.PrimarySteppedDown,Kz.MONGODB_ERROR_CODES.SocketException,Kz.MONGODB_ERROR_CODES.NotWritablePrimary,Kz.MONGODB_ERROR_CODES.InterruptedAtShutdown,Kz.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,Kz.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,Kz.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,Kz.MONGODB_ERROR_CODES.ExceededTimeLimit,Kz.MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet]),uZ=Hz;function cc(F,A,B){if(F instanceof _4)return!0;if(F instanceof p6){if((A>=9||qz(F))&&!F.hasErrorLabel(Kz.MongoErrorLabel.HandshakeError))return!1}if(F instanceof SZ){if(B==="Mongos"&&A<9)return uZ.has(F.result.code??0);let Z=F.result.writeConcernError.code??Number(F.code);return uZ.has(Number.isNaN(Z)?0:Z)}if(F instanceof p6)return uZ.has(Number(F.code));if(Kz.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(F.message))return!0;if(Kz.NODE_IS_RECOVERING_ERROR_MESSAGE.test(F.message))return!0;return!1}function qz(F){return F.hasErrorLabel(Kz.MongoErrorLabel.RetryableWriteError)||F.hasErrorLabel(Kz.MongoErrorLabel.PoolRequstedRetry)}function lc(F){if(typeof F.code==="number"?Hz.has(F.code):!1)return!0;if(F instanceof _4)return!0;if(Kz.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(F.message))return!0;if(Kz.NODE_IS_RECOVERING_ERROR_MESSAGE.test(F.message))return!0;return!1}var pc=new Set([Kz.MONGODB_ERROR_CODES.ShutdownInProgress,Kz.MONGODB_ERROR_CODES.PrimarySteppedDown,Kz.MONGODB_ERROR_CODES.InterruptedAtShutdown,Kz.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,Kz.MONGODB_ERROR_CODES.NotPrimaryOrSecondary]),ic=new Set([Kz.MONGODB_ERROR_CODES.NotWritablePrimary,Kz.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,Kz.MONGODB_ERROR_CODES.LegacyNotPrimary]),nc=new Set([Kz.MONGODB_ERROR_CODES.InterruptedAtShutdown,Kz.MONGODB_ERROR_CODES.ShutdownInProgress]);function Wz(F){if(typeof F.code==="number")return pc.has(F.code);return Kz.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(F.message)||Kz.NODE_IS_RECOVERING_ERROR_MESSAGE.test(F.message)}function sc(F){if(typeof F.code==="number")return ic.has(F.code);if(Wz(F))return!1;return Kz.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(F.message)}function ac(F){return!!(typeof F.code==="number"&&nc.has(F.code))}function rc(F){if(F instanceof OZ||F==null)return!0;return Wz(F)||sc(F)}function tc(F){return!!(F instanceof _4&&F.message.match(/timed out/))}function oc(F,A){if(F==null||!(F instanceof p6))return!1;if(F instanceof _4)return!0;if(A!=null&&A>=9){if(F.code===Kz.MONGODB_ERROR_CODES.CursorNotFound)return!0;return F.hasErrorLabel(Kz.MongoErrorLabel.ResumableChangeStreamError)}if(typeof F.code==="number")return Kz.GET_MORE_RESUMABLE_CODES.has(F.code);return!1}});var P0=z((Lz)=>{Object.defineProperty(Lz,"__esModule",{value:!0});Lz.ReadPreference=Lz.ReadPreferenceMode=void 0;var g4=p();Lz.ReadPreferenceMode=Object.freeze({primary:"primary",primaryPreferred:"primaryPreferred",secondary:"secondary",secondaryPreferred:"secondaryPreferred",nearest:"nearest"});class K1{constructor(F,A,B){if(!K1.isValid(F))throw new g4.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(F)}`);if(B==null&&typeof A==="object"&&!Array.isArray(A))B=A,A=void 0;else if(A&&!Array.isArray(A))throw new g4.MongoInvalidArgumentError("ReadPreference tags must be an array");if(this.mode=F,this.tags=A,this.hedge=B?.hedge,this.maxStalenessSeconds=void 0,this.minWireVersion=void 0,B=B??{},B.maxStalenessSeconds!=null){if(B.maxStalenessSeconds<=0)throw new g4.MongoInvalidArgumentError("maxStalenessSeconds must be a positive integer");this.maxStalenessSeconds=B.maxStalenessSeconds,this.minWireVersion=5}if(this.mode===K1.PRIMARY){if(this.tags&&Array.isArray(this.tags)&&this.tags.length>0)throw new g4.MongoInvalidArgumentError("Primary read preference cannot be combined with tags");if(this.maxStalenessSeconds)throw new g4.MongoInvalidArgumentError("Primary read preference cannot be combined with maxStalenessSeconds");if(this.hedge)throw new g4.MongoInvalidArgumentError("Primary read preference cannot be combined with hedge")}}get preference(){return this.mode}static fromString(F){return new K1(F)}static fromOptions(F){if(!F)return;let A=F.readPreference??F.session?.transaction.options.readPreference,B=F.readPreferenceTags;if(A==null)return;if(typeof A==="string")return new K1(A,B,{maxStalenessSeconds:F.maxStalenessSeconds,hedge:F.hedge});else if(!(A instanceof K1)&&typeof A==="object"){let D=A.mode||A.preference;if(D&&typeof D==="string")return new K1(D,A.tags??B,{maxStalenessSeconds:A.maxStalenessSeconds,hedge:F.hedge})}if(B)A.tags=B;return A}static translate(F){if(F.readPreference==null)return F;let A=F.readPreference;if(typeof A==="string")F.readPreference=new K1(A);else if(A&&!(A instanceof K1)&&typeof A==="object"){let B=A.mode||A.preference;if(B&&typeof B==="string")F.readPreference=new K1(B,A.tags,{maxStalenessSeconds:A.maxStalenessSeconds})}else if(!(A instanceof K1))throw new g4.MongoInvalidArgumentError(`Invalid read preference: ${A}`);return F}static isValid(F){return new Set([K1.PRIMARY,K1.PRIMARY_PREFERRED,K1.SECONDARY,K1.SECONDARY_PREFERRED,K1.NEAREST,null]).has(F)}isValid(F){return K1.isValid(typeof F==="string"?F:this.mode)}secondaryOk(){return new Set([K1.PRIMARY_PREFERRED,K1.SECONDARY,K1.SECONDARY_PREFERRED,K1.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=K1;K1.PRIMARY=Lz.ReadPreferenceMode.primary;K1.PRIMARY_PREFERRED=Lz.ReadPreferenceMode.primaryPreferred;K1.SECONDARY=Lz.ReadPreferenceMode.secondary;K1.SECONDARY_PREFERRED=Lz.ReadPreferenceMode.secondaryPreferred;K1.NEAREST=Lz.ReadPreferenceMode.nearest;K1.primary=new K1(Lz.ReadPreferenceMode.primary);K1.primaryPreferred=new K1(Lz.ReadPreferenceMode.primaryPreferred);K1.secondary=new K1(Lz.ReadPreferenceMode.secondary);K1.secondaryPreferred=new K1(Lz.ReadPreferenceMode.secondaryPreferred);K1.nearest=new K1(Lz.ReadPreferenceMode.nearest)});var v2=z((Rz)=>{Object.defineProperty(Rz,"__esModule",{value:!0});Rz.ServerType=Rz.TopologyType=Rz.STATE_CONNECTED=Rz.STATE_CONNECTING=Rz.STATE_CLOSED=Rz.STATE_CLOSING=void 0;Rz.drainTimerQueue=ll;Rz._advanceClusterTime=pl;var cl=import.meta.require("timers");Rz.STATE_CLOSING="closing";Rz.STATE_CLOSED="closed";Rz.STATE_CONNECTING="connecting";Rz.STATE_CONNECTED="connected";Rz.TopologyType=Object.freeze({Single:"Single",ReplicaSetNoPrimary:"ReplicaSetNoPrimary",ReplicaSetWithPrimary:"ReplicaSetWithPrimary",Sharded:"Sharded",Unknown:"Unknown",LoadBalanced:"LoadBalanced"});Rz.ServerType=Object.freeze({Standalone:"Standalone",Mongos:"Mongos",PossiblePrimary:"PossiblePrimary",RSPrimary:"RSPrimary",RSSecondary:"RSSecondary",RSArbiter:"RSArbiter",RSOther:"RSOther",RSGhost:"RSGhost",Unknown:"Unknown",LoadBalancer:"LoadBalancer"});function ll(F){F.forEach(cl.clearTimeout),F.clear()}function pl(F,A){if(F.clusterTime==null)F.clusterTime=A;else if(A.clusterTime.greaterThan(F.clusterTime.clusterTime))F.clusterTime=A}});var j8=z((Pz)=>{Object.defineProperty(Pz,"__esModule",{value:!0});Pz.MIN_SECONDARY_WRITE_WIRE_VERSION=void 0;Pz.writableServerSelector=Fp;Pz.sameServerSelector=Ap;Pz.secondaryWritableServerSelector=Bp;Pz.readPreferenceServerSelector=xZ;var oF=p(),T8=P0(),h2=v2(),el=1e4,Iz=90;Pz.MIN_SECONDARY_WRITE_WIRE_VERSION=13;function Fp(){return function F(A,B){return rF(A,B.filter((D)=>D.isWritable))}}function Ap(F){return function A(B,D){if(!F)return[];return D.filter((J)=>{return J.address===F.address&&J.type!==h2.ServerType.Unknown})}}function Bp(F,A){if(!A||!F||F&&F<Pz.MIN_SECONDARY_WRITE_WIRE_VERSION)return xZ(T8.ReadPreference.primary);return xZ(A)}function Dp(F,A,B){if(F.maxStalenessSeconds==null||F.maxStalenessSeconds<0)return B;let D=F.maxStalenessSeconds,J=(A.heartbeatFrequencyMS+el)/1000;if(D<J)throw new oF.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${J} seconds`);if(D<Iz)throw new oF.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${Iz} seconds`);if(A.type===h2.TopologyType.ReplicaSetWithPrimary){let Z=Array.from(A.servers.values()).filter(tF)[0];return B.reduce((X,Y)=>{let G=(Y.lastUpdateTime-Y.lastWriteDate-(Z.lastUpdateTime-Z.lastWriteDate)+A.heartbeatFrequencyMS)/1000,E=F.maxStalenessSeconds??0;if(G<=E)X.push(Y);return X},[])}if(A.type===h2.TopologyType.ReplicaSetNoPrimary){if(B.length===0)return B;let Z=B.reduce((X,Y)=>Y.lastWriteDate>X.lastWriteDate?Y:X);return B.reduce((X,Y)=>{let G=(Z.lastWriteDate-Y.lastWriteDate+A.heartbeatFrequencyMS)/1000,E=F.maxStalenessSeconds??0;if(G<=E)X.push(Y);return X},[])}return B}function Jp(F,A){let B=Object.keys(F),D=Object.keys(A);for(let J=0;J<B.length;++J){let Z=B[J];if(D.indexOf(Z)===-1||A[Z]!==F[Z])return!1}return!0}function Zp(F,A){if(F.tags==null||Array.isArray(F.tags)&&F.tags.length===0)return A;for(let B=0;B<F.tags.length;++B){let D=F.tags[B],J=A.reduce((Z,X)=>{if(Jp(D,X.tags))Z.push(X);return Z},[]);if(J.length)return J}return[]}function rF(F,A){let B=A.reduce((J,Z)=>Math.min(Z.roundTripTime,J),1/0),D=B+F.localThresholdMS;return A.reduce((J,Z)=>{if(Z.roundTripTime<=D&&Z.roundTripTime>=B)J.push(Z);return J},[])}function tF(F){return F.type===h2.ServerType.RSPrimary}function Xp(F){return F.type===h2.ServerType.RSSecondary}function Yp(F){return F.type===h2.ServerType.RSSecondary||F.type===h2.ServerType.RSPrimary}function Nz(F){return F.type!==h2.ServerType.Unknown}function $p(F){return F.type===h2.ServerType.LoadBalancer}function xZ(F){if(!F.isValid())throw new oF.MongoInvalidArgumentError("Invalid read preference specified");return function A(B,D,J=[]){let Z=B.commonWireVersion;if(Z&&F.minWireVersion&&F.minWireVersion>Z)throw new oF.MongoCompatibilityError(`Minimum wire version '${F.minWireVersion}' required, but found '${Z}'`);if(B.type===h2.TopologyType.LoadBalanced)return D.filter($p);if(B.type===h2.TopologyType.Unknown)return[];if(B.type===h2.TopologyType.Single)return rF(B,D.filter(Nz));if(B.type===h2.TopologyType.Sharded){let G=D.filter((C)=>{return!J.includes(C)}),E=G.length>0?G:J;return rF(B,E.filter(Nz))}let X=F.mode;if(X===T8.ReadPreference.PRIMARY)return D.filter(tF);if(X===T8.ReadPreference.PRIMARY_PREFERRED){let G=D.filter(tF);if(G.length)return G}let Y=X===T8.ReadPreference.NEAREST?Yp:Xp,$=rF(B,Zp(F,Dp(F,B,D.filter(Y))));if(X===T8.ReadPreference.SECONDARY_PREFERRED&&$.length===0)return D.filter(tF);return $}}});var b4=z((Mz)=>{Object.defineProperty(Mz,"__esModule",{value:!0});Mz.OP_MSG=Mz.OP_COMPRESSED=Mz.OP_DELETE=Mz.OP_QUERY=Mz.OP_INSERT=Mz.OP_UPDATE=Mz.OP_REPLY=Mz.MIN_SUPPORTED_QE_SERVER_VERSION=Mz.MIN_SUPPORTED_QE_WIRE_VERSION=Mz.MAX_SUPPORTED_WIRE_VERSION=Mz.MIN_SUPPORTED_WIRE_VERSION=Mz.MAX_SUPPORTED_SERVER_VERSION=Mz.MIN_SUPPORTED_SERVER_VERSION=void 0;Mz.MIN_SUPPORTED_SERVER_VERSION="4.0";Mz.MAX_SUPPORTED_SERVER_VERSION="8.0";Mz.MIN_SUPPORTED_WIRE_VERSION=7;Mz.MAX_SUPPORTED_WIRE_VERSION=25;Mz.MIN_SUPPORTED_QE_WIRE_VERSION=21;Mz.MIN_SUPPORTED_QE_SERVER_VERSION="7.0";Mz.OP_REPLY=1;Mz.OP_UPDATE=2001;Mz.OP_INSERT=2002;Mz.OP_QUERY=2004;Mz.OP_DELETE=2006;Mz.OP_COMPRESSED=2012;Mz.OP_MSG=2013});var W0=z((jz)=>{Object.defineProperty(jz,"__esModule",{value:!0});jz.END=jz.CHANGE=jz.INIT=jz.MORE=jz.RESPONSE=jz.SERVER_HEARTBEAT_FAILED=jz.SERVER_HEARTBEAT_SUCCEEDED=jz.SERVER_HEARTBEAT_STARTED=jz.COMMAND_FAILED=jz.COMMAND_SUCCEEDED=jz.COMMAND_STARTED=jz.CLUSTER_TIME_RECEIVED=jz.CONNECTION_CHECKED_IN=jz.CONNECTION_CHECKED_OUT=jz.CONNECTION_CHECK_OUT_FAILED=jz.CONNECTION_CHECK_OUT_STARTED=jz.CONNECTION_CLOSED=jz.CONNECTION_READY=jz.CONNECTION_CREATED=jz.CONNECTION_POOL_READY=jz.CONNECTION_POOL_CLEARED=jz.CONNECTION_POOL_CLOSED=jz.CONNECTION_POOL_CREATED=jz.WAITING_FOR_SUITABLE_SERVER=jz.SERVER_SELECTION_SUCCEEDED=jz.SERVER_SELECTION_FAILED=jz.SERVER_SELECTION_STARTED=jz.TOPOLOGY_DESCRIPTION_CHANGED=jz.TOPOLOGY_CLOSED=jz.TOPOLOGY_OPENING=jz.SERVER_DESCRIPTION_CHANGED=jz.SERVER_CLOSED=jz.SERVER_OPENING=jz.DESCRIPTION_RECEIVED=jz.UNPINNED=jz.PINNED=jz.MESSAGE=jz.ENDED=jz.CLOSED=jz.CONNECT=jz.OPEN=jz.CLOSE=jz.TIMEOUT=jz.ERROR=jz.SYSTEM_JS_COLLECTION=jz.SYSTEM_COMMAND_COLLECTION=jz.SYSTEM_USER_COLLECTION=jz.SYSTEM_PROFILE_COLLECTION=jz.SYSTEM_INDEX_COLLECTION=jz.SYSTEM_NAMESPACE_COLLECTION=void 0;jz.kDecoratedKeys=jz.kDecorateResult=jz.LEGACY_HELLO_COMMAND_CAMEL_CASE=jz.LEGACY_HELLO_COMMAND=jz.MONGO_CLIENT_EVENTS=jz.LOCAL_SERVER_EVENTS=jz.SERVER_RELAY_EVENTS=jz.APM_EVENTS=jz.TOPOLOGY_EVENTS=jz.CMAP_EVENTS=jz.HEARTBEAT_EVENTS=jz.RESUME_TOKEN_CHANGED=void 0;jz.SYSTEM_NAMESPACE_COLLECTION="system.namespaces";jz.SYSTEM_INDEX_COLLECTION="system.indexes";jz.SYSTEM_PROFILE_COLLECTION="system.profile";jz.SYSTEM_USER_COLLECTION="system.users";jz.SYSTEM_COMMAND_COLLECTION="$cmd";jz.SYSTEM_JS_COLLECTION="system.js";jz.ERROR="error";jz.TIMEOUT="timeout";jz.CLOSE="close";jz.OPEN="open";jz.CONNECT="connect";jz.CLOSED="closed";jz.ENDED="ended";jz.MESSAGE="message";jz.PINNED="pinned";jz.UNPINNED="unpinned";jz.DESCRIPTION_RECEIVED="descriptionReceived";jz.SERVER_OPENING="serverOpening";jz.SERVER_CLOSED="serverClosed";jz.SERVER_DESCRIPTION_CHANGED="serverDescriptionChanged";jz.TOPOLOGY_OPENING="topologyOpening";jz.TOPOLOGY_CLOSED="topologyClosed";jz.TOPOLOGY_DESCRIPTION_CHANGED="topologyDescriptionChanged";jz.SERVER_SELECTION_STARTED="serverSelectionStarted";jz.SERVER_SELECTION_FAILED="serverSelectionFailed";jz.SERVER_SELECTION_SUCCEEDED="serverSelectionSucceeded";jz.WAITING_FOR_SUITABLE_SERVER="waitingForSuitableServer";jz.CONNECTION_POOL_CREATED="connectionPoolCreated";jz.CONNECTION_POOL_CLOSED="connectionPoolClosed";jz.CONNECTION_POOL_CLEARED="connectionPoolCleared";jz.CONNECTION_POOL_READY="connectionPoolReady";jz.CONNECTION_CREATED="connectionCreated";jz.CONNECTION_READY="connectionReady";jz.CONNECTION_CLOSED="connectionClosed";jz.CONNECTION_CHECK_OUT_STARTED="connectionCheckOutStarted";jz.CONNECTION_CHECK_OUT_FAILED="connectionCheckOutFailed";jz.CONNECTION_CHECKED_OUT="connectionCheckedOut";jz.CONNECTION_CHECKED_IN="connectionCheckedIn";jz.CLUSTER_TIME_RECEIVED="clusterTimeReceived";jz.COMMAND_STARTED="commandStarted";jz.COMMAND_SUCCEEDED="commandSucceeded";jz.COMMAND_FAILED="commandFailed";jz.SERVER_HEARTBEAT_STARTED="serverHeartbeatStarted";jz.SERVER_HEARTBEAT_SUCCEEDED="serverHeartbeatSucceeded";jz.SERVER_HEARTBEAT_FAILED="serverHeartbeatFailed";jz.RESPONSE="response";jz.MORE="more";jz.INIT="init";jz.CHANGE="change";jz.END="end";jz.RESUME_TOKEN_CHANGED="resumeTokenChanged";jz.HEARTBEAT_EVENTS=Object.freeze([jz.SERVER_HEARTBEAT_STARTED,jz.SERVER_HEARTBEAT_SUCCEEDED,jz.SERVER_HEARTBEAT_FAILED]);jz.CMAP_EVENTS=Object.freeze([jz.CONNECTION_POOL_CREATED,jz.CONNECTION_POOL_READY,jz.CONNECTION_POOL_CLEARED,jz.CONNECTION_POOL_CLOSED,jz.CONNECTION_CREATED,jz.CONNECTION_READY,jz.CONNECTION_CLOSED,jz.CONNECTION_CHECK_OUT_STARTED,jz.CONNECTION_CHECK_OUT_FAILED,jz.CONNECTION_CHECKED_OUT,jz.CONNECTION_CHECKED_IN]);jz.TOPOLOGY_EVENTS=Object.freeze([jz.SERVER_OPENING,jz.SERVER_CLOSED,jz.SERVER_DESCRIPTION_CHANGED,jz.TOPOLOGY_OPENING,jz.TOPOLOGY_CLOSED,jz.TOPOLOGY_DESCRIPTION_CHANGED,jz.ERROR,jz.TIMEOUT,jz.CLOSE]);jz.APM_EVENTS=Object.freeze([jz.COMMAND_STARTED,jz.COMMAND_SUCCEEDED,jz.COMMAND_FAILED]);jz.SERVER_RELAY_EVENTS=Object.freeze([jz.SERVER_HEARTBEAT_STARTED,jz.SERVER_HEARTBEAT_SUCCEEDED,jz.SERVER_HEARTBEAT_FAILED,jz.COMMAND_STARTED,jz.COMMAND_SUCCEEDED,jz.COMMAND_FAILED,...jz.CMAP_EVENTS]);jz.LOCAL_SERVER_EVENTS=Object.freeze([jz.CONNECT,jz.DESCRIPTION_RECEIVED,jz.CLOSED,jz.ENDED]);jz.MONGO_CLIENT_EVENTS=Object.freeze([...jz.CMAP_EVENTS,...jz.APM_EVENTS,...jz.TOPOLOGY_EVENTS,...jz.HEARTBEAT_EVENTS]);jz.LEGACY_HELLO_COMMAND="ismaster";jz.LEGACY_HELLO_COMMAND_CAMEL_CASE="isMaster";jz.kDecorateResult=Symbol.for("@@mdb.decorateDecryptionResult");jz.kDecoratedKeys=Symbol.for("@@mdb.decryptedKeys")});var B6=z((JU)=>{Object.defineProperty(JU,"__esModule",{value:!0});JU.ReadConcern=JU.ReadConcernLevel=void 0;JU.ReadConcernLevel=Object.freeze({local:"local",majority:"majority",linearizable:"linearizable",available:"available",snapshot:"snapshot"});class k9{constructor(F){this.level=JU.ReadConcernLevel[F]??F}static fromOptions(F){if(F==null)return;if(F.readConcern){let{readConcern:A}=F;if(A instanceof k9)return A;else if(typeof A==="string")return new k9(A);else if("level"in A&&A.level)return new k9(A.level)}if(F.level)return new k9(F.level);return}static get MAJORITY(){return JU.ReadConcernLevel.majority}static get AVAILABLE(){return JU.ReadConcernLevel.available}static get LINEARIZABLE(){return JU.ReadConcernLevel.linearizable}static get SNAPSHOT(){return JU.ReadConcernLevel.snapshot}toJSON(){return{level:this.level}}}JU.ReadConcern=k9});var $U=z((XU)=>{Object.defineProperty(XU,"__esModule",{value:!0});XU.OnDemandDocument=void 0;var W1=w1();class eF{constructor(F,A=0,B=!1,D){this.bson=F,this.offset=A,this.isArray=B,this.cache=Object.create(null),this.indexFound=Object.create(null),this.elements=D??W1.parseToElementsToArray(this.bson,A)}isElementName(F,A){let B=A[2],D=A[1];if(F.length!==B)return!1;let J=D+B;for(let Z=D,X=0;X<F.length&&Z<J;X++,Z++)if(this.bson[Z]!==F.charCodeAt(X))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 D={element:this.elements[F],value:void 0};return this.cache[F]=D,this.indexFound[F]=!0,D}else return null;else return null;for(let B=0;B<this.elements.length;B++){let D=this.elements[B];if(!(B in this.indexFound)&&this.isElementName(F,D)){let J={element:D,value:void 0};return this.cache[F]=J,this.indexFound[B]=!0,J}}return this.cache[F]=!1,null}toJSValue(F,A){let B=F[0],D=F[3],J=F[4];if(A!==B)return null;switch(A){case W1.BSONType.null:case W1.BSONType.undefined:return null;case W1.BSONType.double:return W1.getFloat64LE(this.bson,D);case W1.BSONType.int:return W1.getInt32LE(this.bson,D);case W1.BSONType.long:return W1.getBigInt64LE(this.bson,D);case W1.BSONType.bool:return Boolean(this.bson[D]);case W1.BSONType.objectId:return new W1.ObjectId(this.bson.subarray(D,D+12));case W1.BSONType.timestamp:return new W1.Timestamp(W1.getBigInt64LE(this.bson,D));case W1.BSONType.string:return W1.toUTF8(this.bson,D+4,D+J-1,!1);case W1.BSONType.binData:{let Z=W1.getInt32LE(this.bson,D),X=this.bson[D+4];if(X===2){let Y=W1.getInt32LE(this.bson,D+1+4);if(Y<0)throw new W1.BSONError("Negative binary type element size found for subtype 0x02");if(Y>Z-4)throw new W1.BSONError("Binary type with subtype 0x02 contains too long binary size");if(Y<Z-4)throw new W1.BSONError("Binary type with subtype 0x02 contains too short binary size");return new W1.Binary(this.bson.subarray(D+1+4+4,D+1+4+4+Y),2)}return new W1.Binary(this.bson.subarray(D+1+4,D+1+4+Z),X)}case W1.BSONType.date:return new Date(Number(W1.getBigInt64LE(this.bson,D)));case W1.BSONType.object:return new eF(this.bson,D);case W1.BSONType.array:return new eF(this.bson,D,!0);default:throw new W1.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,B){let D=this.getElement(F);if(D==null)if(B===!0)throw new W1.BSONError(`BSON element "${F}" is missing`);else return null;if(D.value==null){let J=this.toJSValue(D.element,A);if(J==null)if(B===!0)throw new W1.BSONError(`BSON element "${F}" is missing`);else return null;D.value=J}return D.value}getNumber(F,A){let B=this.get(F,W1.BSONType.bool),D=B==null?null:B?1:0,J=this.get(F,W1.BSONType.long),Z=J==null?null:Number(J),X=D??Z??this.get(F,W1.BSONType.int)??this.get(F,W1.BSONType.double);if(A===!0&&X==null)throw new W1.BSONError(`BSON element "${F}" is missing`);return X}toObject(F){return W1.deserialize(this.bson,{...F,index:this.offset,allowObjectSmallerThanBufferSize:!0})}toBytes(){let F=W1.getInt32LE(this.bson,this.offset);return this.bson.subarray(this.offset,this.offset+F)}}XU.OnDemandDocument=eF});var N6=z((qU)=>{Object.defineProperty(qU,"__esModule",{value:!0});qU.ClientBulkWriteCursorResponse=qU.ExplainedCursorResponse=qU.CursorResponse=qU.MongoDBResponse=void 0;qU.isErrorResponse=EU;var M1=w1(),FA=p(),GU=a(),tp=$U();function EU(F,A){for(let B=0;B<A.length;B++){let D=A[B];if(D[2]===2){let J=D[1];if(F[J]===111&&F[J+1]===107){let Z=D[3],X=D[4];for(let Y=Z;Y<Z+X;Y++)if(F[Y]!==0)return!1;return!0}}}return!0}class y4 extends tp.OnDemandDocument{get(F,A,B){try{return super.get(F,A,B)}catch(D){throw new FA.MongoUnexpectedServerResponseError(D.message,{cause:D})}}static is(F){return F instanceof y4}static make(F){let A=M1.parseToElementsToArray(F,0);return EU(F,A)?new y4(F,0,!1,A):new this(F,0,!1,A)}get recoveryToken(){return this.get("recoveryToken",M1.BSONType.object)?.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}})??null}get atClusterTime(){return this.get("cursor",M1.BSONType.object)?.get("atClusterTime",M1.BSONType.timestamp)??this.get("atClusterTime",M1.BSONType.timestamp)}get operationTime(){return this.get("operationTime",M1.BSONType.timestamp)}get ok(){return this.getNumber("ok")?1:0}get $err(){return this.get("$err",M1.BSONType.string)}get errmsg(){return this.get("errmsg",M1.BSONType.string)}get code(){return this.getNumber("code")}get $clusterTime(){if(!("clusterTime"in this)){let F=this.get("$clusterTime",M1.BSONType.object);if(F==null)return this.clusterTime=null,null;let A=F.get("clusterTime",M1.BSONType.timestamp,!0),B=F.get("signature",M1.BSONType.object)?.toObject();this.clusterTime={clusterTime:A,signature:B}}return this.clusterTime??null}toObject(F){let A={...M1.pluckBSONSerializeOptions(F??{}),validation:M1.parseUtf8ValidationOption(F)};return super.toObject(A)}}qU.MongoDBResponse=y4;y4.empty=new y4(new Uint8Array([13,0,0,0,16,111,107,0,1,0,0,0,0]));class v4 extends y4{constructor(){super(...arguments);this._batch=null,this.iterated=0,this._encryptedBatch=null}static is(F){return F instanceof v4||F===v4.emptyGetMore}get cursor(){return this.get("cursor",M1.BSONType.object,!0)}get id(){try{return M1.Long.fromBigInt(this.cursor.get("id",M1.BSONType.long,!0))}catch(F){throw new FA.MongoUnexpectedServerResponseError(F.message,{cause:F})}}get ns(){let F=this.cursor.get("ns",M1.BSONType.string);if(F!=null)return GU.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",M1.BSONType.object);if(F?.has("firstBatch"))this._encryptedBatch=F.get("firstBatch",M1.BSONType.array,!0);else if(F?.has("nextBatch"))this._encryptedBatch=F.get("nextBatch",M1.BSONType.array,!0);else throw new FA.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",M1.BSONType.array,!0);else if(F.has("nextBatch"))this._batch=F.get("nextBatch",M1.BSONType.array,!0);else throw new FA.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._batch}get batchSize(){return this.batch?.size()}get postBatchResumeToken(){return this.cursor.get("postBatchResumeToken",M1.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,M1.BSONType.object,!0)??null,B=this.encryptedBatch?.get(this.iterated,M1.BSONType.object,!0)??null;if(this.iterated+=1,F?.raw)return A.toBytes();else{let D=A.toObject(F);if(B)GU.decorateDecryptionResult(D,B.toObject(F),!0);return D}}clear(){this.iterated=this.batchSize}}qU.CursorResponse=v4;v4.emptyGetMore={id:new M1.Long(0),length:0,shift:()=>null};class CU extends v4{constructor(){super(...arguments);this.isExplain=!0,this._length=1}get id(){return M1.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)}}qU.ExplainedCursorResponse=CU;class HU extends v4{get insertedCount(){return this.get("nInserted",M1.BSONType.int,!0)}get upsertedCount(){return this.get("nUpserted",M1.BSONType.int,!0)}get matchedCount(){return this.get("nMatched",M1.BSONType.int,!0)}get modifiedCount(){return this.get("nModified",M1.BSONType.int,!0)}get deletedCount(){return this.get("nDeleted",M1.BSONType.int,!0)}get writeConcernError(){return this.get("writeConcernError",M1.BSONType.object,!1)}}qU.ClientBulkWriteCursorResponse=HU});var c0=z((zU)=>{Object.defineProperty(zU,"__esModule",{value:!0});zU.WriteConcern=zU.WRITE_CONCERN_KEYS=void 0;zU.throwIfWriteConcernError=Di;var KU=N6(),Bi=p();zU.WRITE_CONCERN_KEYS=["w","wtimeout","j","journal","fsync"];class u8{constructor(F,A,B,D){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(B!=null)this.journal=this.j=B;if(D!=null)this.journal=this.j=D?!0:!1}static apply(F,A){let B={};if(A.w!=null)B.w=A.w;if(A.wtimeoutMS!=null)B.wtimeout=A.wtimeoutMS;if(A.journal!=null)B.j=A.j;return F.writeConcern=B,F}static fromOptions(F,A){if(F==null)return;A=A??{};let B;if(typeof F==="string"||typeof F==="number")B={w:F};else if(F instanceof u8)B=F;else B=F.writeConcern;let D=A instanceof u8?A:A.writeConcern,{w:J=void 0,wtimeout:Z=void 0,j:X=void 0,fsync:Y=void 0,journal:$=void 0,wtimeoutMS:G=void 0}={...D,...B};if(J!=null||Z!=null||G!=null||X!=null||$!=null||Y!=null)return new u8(J,Z??G,X??$,Y);return}}zU.WriteConcern=u8;function Di(F){if(typeof F==="object"&&F!=null){let A=KU.MongoDBResponse.is(F)&&F.has("writeConcernError")?F.toObject():!KU.MongoDBResponse.is(F)&&("writeConcernError"in F)?F:null;if(A!=null)throw new Bi.MongoWriteConcernError(A)}}});var a=z((kU)=>{Object.defineProperty(kU,"__esModule",{value:!0});kU.randomBytes=kU.COSMOS_DB_MSG=kU.DOCUMENT_DB_MSG=kU.COSMOS_DB_CHECK=kU.DOCUMENT_DB_CHECK=kU.MONGODB_WARNING_CODE=kU.DEFAULT_PK_FACTORY=kU.HostAddress=kU.BufferPool=kU.List=kU.MongoDBCollectionNamespace=kU.MongoDBNamespace=kU.ByteUtils=void 0;kU.isUint8Array=Ki;kU.hostMatchesWildcards=zi;kU.normalizeHintField=Ui;kU.isObject=cZ;kU.mergeOptions=Li;kU.filterOptions=Vi;kU.applyRetryableWrites=Ri;kU.isPromiseLike=wi;kU.decorateWithCollation=Ii;kU.decorateWithReadConcern=Ni;kU.decorateWithExplain=Pi;kU.getTopology=RU;kU.ns=Mi;kU.makeCounter=Ti;kU.uuidV4=ji;kU.maxWireVersion=ui;kU.arrayStrictEqual=Oi;kU.errorStrictEqual=ki;kU.makeStateMachine=Si;kU.now=wU;kU.calculateDurationInMs=xi;kU.hasAtomicOperators=IU;kU.resolveOptions=fi;kU.isSuperset=NU;kU.isHello=_i;kU.setDifference=gi;kU.isRecord=PU;kU.deepCopy=lZ;kU.emitWarning=TU;kU.emitWarningOnce=yi;kU.enumToString=vi;kU.supportsRetryableWrites=hi;kU.shuffle=mi;kU.commandSupportsReadConcern=di;kU.compareObjectId=ci;kU.parseInteger=jU;kU.parseUnsignedInteger=li;kU.checkParentDomainMatch=pi;kU.get=ii;kU.request=ni;kU.isHostMatch=si;kU.promiseWithResolvers=uU;kU.squashError=ai;kU.once=ri;kU.maybeAddIdToDocuments=ti;kU.fileIsAccessible=oi;kU.noop=ei;kU.decorateDecryptionResult=OU;var LU=import.meta.require("crypto"),Xi=import.meta.require("fs"),VU=import.meta.require("http"),dZ=import.meta.require("timers"),Yi=import.meta.require("url"),$i=import.meta.require("url"),Gi=import.meta.require("util"),pZ=w1(),Ei=b4(),AA=W0(),V2=p(),Ci=B6(),Hi=P0(),qi=v2(),Wi=c0();kU.ByteUtils={toLocalBufferType(F){return Buffer.isBuffer(F)?F:Buffer.from(F.buffer,F.byteOffset,F.byteLength)},equals(F,A){return kU.ByteUtils.toLocalBufferType(F).equals(A)},compare(F,A){return kU.ByteUtils.toLocalBufferType(F).compare(A)},toBase64(F){return kU.ByteUtils.toLocalBufferType(F).toString("base64")}};function Ki(F){return F!=null&&typeof F==="object"&&Symbol.toStringTag in F&&F[Symbol.toStringTag]==="Uint8Array"}function zi(F,A){for(let B of A)if(F===B||B.startsWith("*.")&&F?.endsWith(B.substring(2,B.length))||B.startsWith("*/")&&F?.endsWith(B.substring(2,B.length)))return!0;return!1}function Ui(F){let A=void 0;if(typeof F==="string")A=F;else if(Array.isArray(F))A={},F.forEach((B)=>{A[B]=1});else if(F!=null&&typeof F==="object"){A={};for(let B in F)A[B]=F[B]}return A}var Qi=(F)=>Object.prototype.toString.call(F);function cZ(F){return Qi(F)==="[object Object]"}function Li(F,A){return{...F,...A}}function Vi(F,A){let B={};for(let D in F)if(A.includes(D))B[D]=F[D];return B}function Ri(F,A){if(A&&A.s.options?.retryWrites)F.retryWrites=!0;return F}function wi(F){return F!=null&&typeof F==="object"&&"then"in F&&typeof F.then==="function"}function Ii(F,A,B){let D=RU(A).capabilities;if(B.collation&&typeof B.collation==="object")if(D&&D.commandsTakeCollation)F.collation=B.collation;else throw new V2.MongoCompatibilityError("Current topology does not support collation")}function Ni(F,A,B){if(B&&B.session&&B.session.inTransaction())return;let D=Object.assign({},F.readConcern||{});if(A.s.readConcern)Object.assign(D,A.s.readConcern);if(Object.keys(D).length>0)Object.assign(F,{readConcern:D})}function Pi(F,A){let{verbosity:B,maxTimeMS:D}=A,J={explain:F,verbosity:B};if(typeof D==="number")J.maxTimeMS=D;return J}function RU(F){if("topology"in F&&F.topology)return F.topology;else if("client"in F&&F.client.topology)return F.client.topology;throw new V2.MongoNotConnectedError("MongoClient must be connected to perform this operation")}function Mi(F){return S8.fromString(F)}class S8{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 iZ(this.db,F)}static fromString(F){if(typeof F!=="string"||F==="")throw new V2.MongoRuntimeError(`Cannot parse namespace from "${F}"`);let[A,...B]=F.split("."),D=B.join(".");return new S8(A,D===""?void 0:D)}}kU.MongoDBNamespace=S8;class iZ extends S8{constructor(F,A){super(F,A);this.collection=A}static fromString(F){return super.fromString(F)}}kU.MongoDBCollectionNamespace=iZ;function*Ti(F=0){let A=F;while(!0){let B=A;A+=1,yield B}}function ji(){let F=LU.randomBytes(16);return F[6]=F[6]&15|64,F[8]=F[8]&63|128,F}function ui(F){if(F){if(F.loadBalanced||F.serverApi?.version)return Ei.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 Oi(F,A){if(!Array.isArray(F)||!Array.isArray(A))return!1;return F.length===A.length&&F.every((B,D)=>B===A[D])}function ki(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 Si(F){return function A(B,D){let J=F[B.s.state];if(J&&J.indexOf(D)<0)throw new V2.MongoRuntimeError(`illegal state transition from [${B.s.state}] => [${D}], allowed: [${J}]`);B.emit("stateChanged",B.s.state,D),B.s.state=D}}function wU(){let F=process.hrtime();return Math.floor(F[0]*1000+F[1]/1e6)}function xi(F){if(typeof F!=="number")return-1;let A=wU()-F;return A<0?0:A}function IU(F){if(Array.isArray(F)){for(let B of F)if(IU(B))return!0;return!1}let A=Object.keys(F);return A.length>0&&A[0][0]==="$"}function fi(F,A){let B=Object.assign({},A,pZ.resolveBSONOptions(A,F));if(!A?.session?.inTransaction()){let Z=Ci.ReadConcern.fromOptions(A)??F?.readConcern;if(Z)B.readConcern=Z;let X=Wi.WriteConcern.fromOptions(A)??F?.writeConcern;if(X)B.writeConcern=X}let J=Hi.ReadPreference.fromOptions(A)??F?.readPreference;if(J)B.readPreference=J;return B}function NU(F,A){F=Array.isArray(F)?new Set(F):F,A=Array.isArray(A)?new Set(A):A;for(let B of A)if(!F.has(B))return!1;return!0}function _i(F){return F[AA.LEGACY_HELLO_COMMAND]||F.hello?!0:!1}function gi(F,A){let B=new Set(F);for(let D of A)B.delete(D);return B}var bi=(F,A)=>Object.prototype.hasOwnProperty.call(F,A);function PU(F,A=void 0){if(!cZ(F))return!1;let B=F.constructor;if(B&&B.prototype){if(!cZ(B.prototype))return!1;if(!bi(B.prototype,"isPrototypeOf"))return!1}if(A){let D=Object.keys(F);return NU(D,A)}return!0}function lZ(F){if(F==null)return F;else if(Array.isArray(F))return F.map((B)=>lZ(B));else if(PU(F)){let B={};for(let D in F)B[D]=lZ(F[D]);return B}let A=F.constructor;if(A)switch(A.name.toLowerCase()){case"date":return new A(Number(F));case"map":return new Map(F);case"set":return new Set(F);case"buffer":return Buffer.from(F)}return F}class nZ{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:B}=F;return A.next=B,B.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}}kU.List=nZ;class MU{constructor(){this.buffers=new nZ,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),B=A.readInt32LE(0);return this.totalByteLength+=4,this.buffers.unshift(A),B}read(F){if(typeof F!=="number"||F<0)throw new V2.MongoInvalidArgumentError('Argument "size" must be a non-negative number');if(F>this.totalByteLength)return Buffer.alloc(0);let A=Buffer.allocUnsafe(F);for(let B=0;B<F;){let D=this.buffers.shift();if(D==null)break;let J=F-B,Z=Math.min(J,D.byteLength),X=D.subarray(0,Z);if(A.set(X,B),B+=Z,this.totalByteLength-=Z,Z<D.byteLength)this.buffers.unshift(D.subarray(Z))}return A}}kU.BufferPool=MU;class k8{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 B=`iLoveJS://${A}`,D;try{D=new $i.URL(B)}catch(Y){let $=new V2.MongoRuntimeError(`Unable to parse ${A} with URL`);throw $.cause=Y,$}let{hostname:J,port:Z}=D,X=decodeURIComponent(J).toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))this.isIPv6=!0,X=X.substring(1,J.length-1);if(this.host=X.toLowerCase(),typeof Z==="number")this.port=Z;else if(typeof Z==="string"&&Z!=="")this.port=Number.parseInt(Z,10);else this.port=27017;if(this.port===0)throw new V2.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 k8(F)}static fromHostPort(F,A){if(F.includes(":"))F=`[${F}]`;return k8.fromString(`${F}:${A}`)}static fromSrvRecord({name:F,port:A}){return k8.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}}}kU.HostAddress=k8;kU.DEFAULT_PK_FACTORY={createPk(){return new pZ.ObjectId}};kU.MONGODB_WARNING_CODE="MONGODB DRIVER";function TU(F){return process.emitWarning(F,{code:kU.MONGODB_WARNING_CODE})}var QU=new Set;function yi(F){if(!QU.has(F))return QU.add(F),TU(F)}function vi(F){return Object.values(F).join(", ")}function hi(F){if(!F)return!1;if(F.loadBalanced)return!0;if(F.description.logicalSessionTimeoutMinutes!=null){if(F.description.type!==qi.ServerType.Standalone)return!0}return!1}function mi(F,A=0){let B=Array.from(F);if(A>B.length)throw new V2.MongoRuntimeError("Limit must be less than the number of items");let D=B.length,J=A%B.length===0?1:B.length-A;while(D>J){let Z=Math.floor(Math.random()*D);D-=1;let X=B[D];B[D]=B[Z],B[Z]=X}return A%B.length===0?B:B.slice(J)}function di(F){if(F.aggregate||F.count||F.distinct||F.find||F.geoNear)return!0;return!1}function ci(F,A){if(F==null&&A==null)return 0;if(F==null)return-1;if(A==null)return 1;return kU.ByteUtils.compare(F.id,A.id)}function jU(F){if(typeof F==="number")return Math.trunc(F);let A=Number.parseInt(String(F),10);return Number.isNaN(A)?null:A}function li(F){let A=jU(F);return A!=null&&A>=0?A:null}function pi(F,A){let B=F.endsWith(".")?F.slice(0,F.length-1):F,D=A.endsWith(".")?A.slice(0,A.length-1):A,J=/^.*?\./,Z=D.split(".").length<3,X=`.${B.replace(J,"")}`,Y=Z?D:`.${D.replace(J,"")}`;if(!Y.startsWith("."))Y="."+Y;if(Z&&B.split(".").length<=D.split(".").length)throw new V2.MongoAPIError("Server record does not have at least one more domain level than parent URI");if(!X.endsWith(Y))throw new V2.MongoAPIError("Server record does not share hostname with parent URI")}function ii(F,A={}){return new Promise((B,D)=>{let J,Z=VU.get(F,A,(X)=>{X.setEncoding("utf8");let Y="";X.on("data",($)=>Y+=$),X.on("end",()=>{dZ.clearTimeout(J),B({status:X.statusCode,body:Y})})}).on("error",(X)=>{dZ.clearTimeout(J),D(X)}).end();J=dZ.setTimeout(()=>{Z.destroy(new V2.MongoNetworkTimeoutError("request timed out after 10 seconds"))},1e4)})}async function ni(F,A={}){return await new Promise((B,D)=>{let J={method:"GET",timeout:1e4,json:!0,...Yi.parse(F),...A},Z=VU.request(J,(X)=>{X.setEncoding("utf8");let Y="";X.on("data",($)=>{Y+=$}),X.once("end",()=>{if(A.json===!1){B(Y);return}try{let $=JSON.parse(Y);B($)}catch{D(new V2.MongoRuntimeError(`Invalid JSON response: "${Y}"`))}})});Z.once("timeout",()=>Z.destroy(new V2.MongoNetworkTimeoutError(`Network request to ${F} timed out after ${A.timeout} ms`))),Z.once("error",(X)=>D(X)),Z.end()})}kU.DOCUMENT_DB_CHECK=/(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/;kU.COSMOS_DB_CHECK=/\.cosmos\.azure\.com$/;kU.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";kU.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 si(F,A){return A&&F.test(A.toLowerCase())?!0:!1}function uU(){let F,A;return{promise:new Promise(function D(J,Z){F=J,A=Z}),resolve:F,reject:A}}function ai(F){return}kU.randomBytes=Gi.promisify(LU.randomBytes);async function ri(F,A){let{promise:B,resolve:D,reject:J}=uU(),Z=(Y)=>D(Y),X=(Y)=>J(Y);F.once(A,Z).once("error",X);try{let Y=await B;return F.off("error",X),Y}catch(Y){throw F.off(A,Z),Y}}function ti(F,A,B){if((typeof B.forceServerObjectId==="boolean"?B.forceServerObjectId:F.s.db.options?.forceServerObjectId)===!0)return A;let J=(Z)=>{if(Z._id==null)Z._id=F.s.pkFactory.createPk();return Z};return Array.isArray(A)?A.map(J):J(A)}async function oi(F,A){try{return await Xi.promises.access(F,A),!0}catch{return!1}}function ei(){return}function OU(F,A,B=!0){if(B){if(Buffer.isBuffer(A))A=pZ.deserialize(A);if(Buffer.isBuffer(F))throw new V2.MongoRuntimeError("Expected result of decryption to be deserialized BSON object")}if(!F||typeof F!=="object")return;for(let D of Object.keys(F)){let J=A[D];if(J&&J._bsontype==="Binary"&&J.sub_type===6){if(!F[AA.kDecoratedKeys])Object.defineProperty(F,AA.kDecoratedKeys,{value:[],configurable:!0,enumerable:!1,writable:!1});F[AA.kDecoratedKeys].push(D);continue}OU(F[D],J,!1)}}});var O1=z((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});_U.AbstractOperation=_U.Aspect=void 0;_U.defineAspects=Xs;var Zs=w1(),sZ=P0();_U.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")};var aZ=Symbol("session");class fU{constructor(F={}){this.readPreference=this.hasAspect(_U.Aspect.WRITE_OPERATION)?sZ.ReadPreference.primary:sZ.ReadPreference.fromOptions(F)??sZ.ReadPreference.primary,this.bsonOptions=Zs.resolveBSONOptions(F),this[aZ]=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[aZ]}clearSession(){this[aZ]=void 0}resetBatch(){return!0}get canRetryRead(){return this.hasAspect(_U.Aspect.RETRYABLE)&&this.hasAspect(_U.Aspect.READ_OPERATION)}get canRetryWrite(){return this.hasAspect(_U.Aspect.RETRYABLE)&&this.hasAspect(_U.Aspect.WRITE_OPERATION)}}_U.AbstractOperation=fU;function Xs(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 l0=z((mU)=>{Object.defineProperty(mU,"__esModule",{value:!0});mU.executeOperation=Gs;var j0=p(),bU=P0(),yU=j8(),vU=a(),G3=O1(),$s=j0.MONGODB_ERROR_CODES.IllegalOperation,hU="This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.";async function Gs(F,A){if(!(A instanceof G3.AbstractOperation))throw new j0.MongoRuntimeError("This method requires a valid operation instance");let B=await Es(F),D=A.session,J;if(D==null)J=Symbol(),D=F.startSession({owner:J,explicit:!1});else if(D.hasEnded)throw new j0.MongoExpiredSessionError("Use of expired sessions is not permitted");else if(D.snapshotEnabled&&!B.capabilities.supportsSnapshotReads)throw new j0.MongoCompatibilityError("Snapshot reads require MongoDB 5.0 or later");else if(D.client!==F)throw new j0.MongoInvalidArgumentError("ClientSession must be from the same MongoClient");if(D.explicit&&D?.timeoutMS!=null&&A.options.timeoutMS!=null)throw new j0.MongoInvalidArgumentError("Do not specify timeoutMS on operation if already specified on an explicit session");let Z=A.readPreference??bU.ReadPreference.primary,X=!!D?.inTransaction(),Y=A.hasAspect(G3.Aspect.READ_OPERATION);if(X&&!Z.equals(bU.ReadPreference.primary)&&(Y||A.commandName==="runCommand"))throw new j0.MongoTransactionError(`Read preference in a transaction must be primary, not: ${Z.mode}`);if(D?.isPinned&&D.transaction.isCommitted&&!A.bypassPinningCheck)D.unpin();try{return await Cs(A,{topology:B,session:D,readPreference:Z})}finally{if(D?.owner!=null&&D.owner===J)await D.endSession()}}async function Es(F){if(F.topology==null){if(F.s.hasBeenClosed)throw new j0.MongoNotConnectedError("Client must be connected before running operations");F.s.options[Symbol.for("@@mdb.skipPingOnConnect")]=!0;try{if(await F.connect(),F.topology==null)throw new j0.MongoRuntimeError("client.connect did not create a topology but also did not throw");return F.topology}finally{delete F.s.options[Symbol.for("@@mdb.skipPingOnConnect")]}}return F.topology}async function Cs(F,{topology:A,session:B,readPreference:D}){let J;if(F.hasAspect(G3.Aspect.MUST_SELECT_SAME_SERVER))J=yU.sameServerSelector(F.server?.description);else if(F.trySecondaryWrite)J=yU.secondaryWritableServerSelector(A.commonWireVersion,D);else J=D;let Z=await A.selectServer(J,{session:B,operationName:F.commandName}),X=F.hasAspect(G3.Aspect.READ_OPERATION),Y=F.hasAspect(G3.Aspect.WRITE_OPERATION),$=B?.inTransaction()??!1,G=A.s.options.retryReads&&!$&&F.canRetryRead,E=A.s.options.retryWrites&&!$&&vU.supportsRetryableWrites(Z)&&F.canRetryWrite,C=F.hasAspect(G3.Aspect.RETRYABLE)&&B!=null&&(X&&G||Y&&E);if(Y&&E&&B!=null)F.options.willRetryWrite=!0,B.incrementTransactionNumber();let H=C?2:1,q,W;for(let K=0;K<H;K++){if(q){if(Y&&q.code===$s)throw new j0.MongoServerError({message:hU,errmsg:hU,originalError:q});if(F.hasAspect(G3.Aspect.COMMAND_BATCHING)&&!F.canRetryWrite)throw q;if(Y&&!j0.isRetryableWriteError(q))throw q;if(X&&!j0.isRetryableReadError(q))throw q;if(q instanceof j0.MongoNetworkError&&F.hasAspect(G3.Aspect.CURSOR_CREATING)&&B!=null&&B.isPinned&&!B.inTransaction())B.unpin({force:!0,forceClear:!0});if(Z=await A.selectServer(J,{session:B,operationName:F.commandName,previousServer:W}),Y&&!vU.supportsRetryableWrites(Z))throw new j0.MongoUnexpectedServerResponseError("Selected server does not support retryable writes")}try{if(K>0&&F.hasAspect(G3.Aspect.COMMAND_BATCHING))F.resetBatch();return await F.execute(Z,B)}catch(U){if(!(U instanceof j0.MongoError))throw U;if(q!=null&&U.hasErrorLabel(j0.MongoErrorLabel.NoWritesPerformed))throw q;W=Z.description,q=U}}throw q??new j0.MongoRuntimeError("Tried to propagate retryability error, but no error was found.")}});var tZ=z((dU)=>{Object.defineProperty(dU,"__esModule",{value:!0});dU.Explain=dU.ExplainVerbosity=void 0;dU.ExplainVerbosity=Object.freeze({queryPlanner:"queryPlanner",queryPlannerExtended:"queryPlannerExtended",executionStats:"executionStats",allPlansExecution:"allPlansExecution"});class BA{constructor(F,A){if(typeof F==="boolean")this.verbosity=F?dU.ExplainVerbosity.allPlansExecution:dU.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 BA(F);let{verbosity:A,maxTimeMS:B}=F;return new BA(A,B)}}dU.Explain=BA});var Y0=z((iU)=>{Object.defineProperty(iU,"__esModule",{value:!0});iU.CommandOperation=void 0;var qs=p(),Ws=tZ(),Ks=B6(),zs=j8(),x8=a(),lU=c0(),x9=O1();class pU extends x9.AbstractOperation{constructor(F,A){super(A);this.options=A??{};let B=A?.dbName||A?.authdb;if(B)this.ns=new x8.MongoDBNamespace(B,"$cmd");else this.ns=F?F.s.namespace.withCollection("$cmd"):new x8.MongoDBNamespace("admin","$cmd");if(this.readConcern=Ks.ReadConcern.fromOptions(A),this.writeConcern=lU.WriteConcern.fromOptions(A),this.hasAspect(x9.Aspect.EXPLAINABLE))this.explain=Ws.Explain.fromOptions(A);else if(A?.explain!=null)throw new qs.MongoInvalidArgumentError('Option "explain" is not supported on this command')}get canRetryWrite(){if(this.hasAspect(x9.Aspect.EXPLAINABLE))return this.explain==null;return super.canRetryWrite}async executeCommand(F,A,B,D){this.server=F;let J={...this.options,...this.bsonOptions,readPreference:this.readPreference,session:A},Z=x8.maxWireVersion(F),X=this.session&&this.session.inTransaction();if(this.readConcern&&x8.commandSupportsReadConcern(B)&&!X)Object.assign(B,{readConcern:this.readConcern});if(this.trySecondaryWrite&&Z<zs.MIN_SECONDARY_WRITE_WIRE_VERSION)J.omitReadPreference=!0;if(this.writeConcern&&this.hasAspect(x9.Aspect.WRITE_OPERATION)&&!X)lU.WriteConcern.apply(B,this.writeConcern);if(J.collation&&typeof J.collation==="object"&&!this.hasAspect(x9.Aspect.SKIP_COLLATION))Object.assign(B,{collation:J.collation});if(typeof J.maxTimeMS==="number")B.maxTimeMS=J.maxTimeMS;if(this.hasAspect(x9.Aspect.EXPLAINABLE)&&this.explain)B=x8.decorateWithExplain(B,this.explain);return await F.command(this.ns,B,J,D)}}iU.CommandOperation=pU});var tU=z((aU)=>{Object.defineProperty(aU,"__esModule",{value:!0});aU.ListDatabasesOperation=void 0;var sU=a(),Us=Y0(),oZ=O1();class eZ extends Us.CommandOperation{constructor(F,A){super(F,A);this.options=A??{},this.ns=new sU.MongoDBNamespace("admin","$cmd")}get commandName(){return"listDatabases"}async execute(F,A){let B={listDatabases:1};if(typeof this.options.nameOnly==="boolean")B.nameOnly=this.options.nameOnly;if(this.options.filter)B.filter=this.options.filter;if(typeof this.options.authorizedDatabases==="boolean")B.authorizedDatabases=this.options.authorizedDatabases;if(sU.maxWireVersion(F)>=9&&this.options.comment!==void 0)B.comment=this.options.comment;return await super.executeCommand(F,A,B)}}aU.ListDatabasesOperation=eZ;oZ.defineAspects(eZ,[oZ.Aspect.READ_OPERATION,oZ.Aspect.RETRYABLE])});var AX=z((eU)=>{Object.defineProperty(eU,"__esModule",{value:!0});eU.RemoveUserOperation=void 0;var Qs=Y0(),oU=O1();class FX extends Qs.CommandOperation{constructor(F,A,B){super(F,B);this.options=B,this.username=A}get commandName(){return"dropUser"}async execute(F,A){return await super.executeCommand(F,A,{dropUser:this.username}),!0}}eU.RemoveUserOperation=FX;oU.defineAspects(FX,[oU.Aspect.WRITE_OPERATION])});var f9=z((JQ)=>{Object.defineProperty(JQ,"__esModule",{value:!0});JQ.RunAdminCommandOperation=JQ.RunCommandOperation=void 0;var Ls=a(),AQ=O1();class BQ extends AQ.AbstractOperation{constructor(F,A,B){super(B);this.command=A,this.options=B,this.ns=F.s.namespace.withCollection("$cmd")}get commandName(){return"runCommand"}async execute(F,A){return this.server=F,await F.command(this.ns,this.command,{...this.options,readPreference:this.readPreference,session:A},this.options.responseType)}}JQ.RunCommandOperation=BQ;class DQ extends AQ.AbstractOperation{constructor(F,A){super(A);this.command=F,this.options=A,this.ns=new Ls.MongoDBNamespace("admin","$cmd")}get commandName(){return"runCommand"}async execute(F,A){return this.server=F,await F.command(this.ns,this.command,{...this.options,readPreference:this.readPreference,session:A})}}JQ.RunAdminCommandOperation=DQ});var GQ=z((YQ)=>{Object.defineProperty(YQ,"__esModule",{value:!0});YQ.ValidateCollectionOperation=void 0;var BX=p(),Rs=Y0();class XQ extends Rs.CommandOperation{constructor(F,A,B){let D={validate:A},J=Object.keys(B);for(let Z=0;Z<J.length;Z++)if(Object.prototype.hasOwnProperty.call(B,J[Z])&&J[Z]!=="session")D[J[Z]]=B[J[Z]];super(F.s.db,B);this.options=B,this.command=D,this.collectionName=A}get commandName(){return"validate"}async execute(F,A){let B=this.collectionName,D=await super.executeCommand(F,A,this.command);if(D.result!=null&&typeof D.result!=="string")throw new BX.MongoUnexpectedServerResponseError("Error with validation data");if(D.result!=null&&D.result.match(/exception|corrupt/)!=null)throw new BX.MongoUnexpectedServerResponseError(`Invalid collection ${B}`);if(D.valid!=null&&!D.valid)throw new BX.MongoUnexpectedServerResponseError(`Invalid collection ${B}`);return D}}YQ.ValidateCollectionOperation=XQ});var DX=z((CQ)=>{Object.defineProperty(CQ,"__esModule",{value:!0});CQ.Admin=void 0;var ws=w1(),DA=l0(),Is=tU(),Ns=AX(),Ps=f9(),Ms=GQ();class EQ{constructor(F){this.s={db:F}}async command(F,A){return await DA.executeOperation(this.s.db.client,new Ps.RunAdminCommandOperation(F,{...ws.resolveBSONOptions(A),session:A?.session,readPreference:A?.readPreference}))}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 DA.executeOperation(this.s.db.client,new Ns.RemoveUserOperation(this.s.db,F,{dbName:"admin",...A}))}async validateCollection(F,A={}){return await DA.executeOperation(this.s.db.client,new Ms.ValidateCollectionOperation(this,F,A))}async listDatabases(F){return await DA.executeOperation(this.s.db.client,new Is.ListDatabasesOperation(this.s.db,F))}async replSetGetStatus(F){return await this.command({replSetGetStatus:1},F)}}CQ.Admin=EQ});var YX=z((qQ)=>{Object.defineProperty(qQ,"__esModule",{value:!0});qQ.DeleteManyOperation=qQ.DeleteOneOperation=qQ.DeleteOperation=void 0;qQ.makeDeleteStatement=XX;var f8=p(),Ts=Y0(),D6=O1();class _8 extends Ts.CommandOperation{constructor(F,A,B){super(void 0,B);this.options=B,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){let B=this.options??{},D=typeof B.ordered==="boolean"?B.ordered:!0,J={delete:this.ns.collection,deletes:this.statements,ordered:D};if(B.let)J.let=B.let;if(B.comment!==void 0)J.comment=B.comment;if(this.writeConcern&&this.writeConcern.w===0){if(this.statements.find((Y)=>Y.hint))throw new f8.MongoCompatibilityError("hint is not supported with unacknowledged writes")}return await super.executeCommand(F,A,J)}}qQ.DeleteOperation=_8;class JX extends _8{constructor(F,A,B){super(F.s.namespace,[XX(A,{...B,limit:1})],B)}async execute(F,A){let B=await super.execute(F,A);if(this.explain)return B;if(B.code)throw new f8.MongoServerError(B);if(B.writeErrors)throw new f8.MongoServerError(B.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:B.n}}}qQ.DeleteOneOperation=JX;class ZX extends _8{constructor(F,A,B){super(F.s.namespace,[XX(A,B)],B)}async execute(F,A){let B=await super.execute(F,A);if(this.explain)return B;if(B.code)throw new f8.MongoServerError(B);if(B.writeErrors)throw new f8.MongoServerError(B.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:B.n}}}qQ.DeleteManyOperation=ZX;function XX(F,A){let B={q:F,limit:typeof A.limit==="number"?A.limit:0};if(A.collation)B.collation=A.collation;if(A.hint)B.hint=A.hint;return B}D6.defineAspects(_8,[D6.Aspect.RETRYABLE,D6.Aspect.WRITE_OPERATION]);D6.defineAspects(JX,[D6.Aspect.RETRYABLE,D6.Aspect.WRITE_OPERATION,D6.Aspect.EXPLAINABLE,D6.Aspect.SKIP_COLLATION]);D6.defineAspects(ZX,[D6.Aspect.WRITE_OPERATION,D6.Aspect.EXPLAINABLE,D6.Aspect.SKIP_COLLATION])});var EX=z((KQ)=>{Object.defineProperty(KQ,"__esModule",{value:!0});KQ.BulkWriteOperation=void 0;var $X=O1();class GX extends $X.AbstractOperation{constructor(F,A,B){super(B);this.options=B,this.collection=F,this.operations=A}get commandName(){return"bulkWrite"}async execute(F,A){let B=this.collection,D=this.operations,J={...this.options,...this.bsonOptions,readPreference:this.readPreference},Z=J.ordered===!1?B.initializeUnorderedBulkOp(J):B.initializeOrderedBulkOp(J);for(let X=0;X<D.length;X++)Z.raw(D[X]);return await Z.execute({...J,session:A})}}KQ.BulkWriteOperation=GX;$X.defineAspects(GX,[$X.Aspect.WRITE_OPERATION])});var qX=z((UQ)=>{Object.defineProperty(UQ,"__esModule",{value:!0});UQ.InsertManyOperation=UQ.InsertOneOperation=UQ.InsertOperation=void 0;var JA=p(),ks=a(),Ss=c0(),xs=EX(),fs=Y0(),E3=O1();class ZA extends fs.CommandOperation{constructor(F,A,B){super(void 0,B);this.options={...B,checkKeys:B.checkKeys??!1},this.ns=F,this.documents=A}get commandName(){return"insert"}async execute(F,A){let B=this.options??{},D=typeof B.ordered==="boolean"?B.ordered:!0,J={insert:this.ns.collection,documents:this.documents,ordered:D};if(typeof B.bypassDocumentValidation==="boolean")J.bypassDocumentValidation=B.bypassDocumentValidation;if(B.comment!==void 0)J.comment=B.comment;return await super.executeCommand(F,A,J)}}UQ.InsertOperation=ZA;class CX extends ZA{constructor(F,A,B){super(F.s.namespace,ks.maybeAddIdToDocuments(F,[A],B),B)}async execute(F,A){let B=await super.execute(F,A);if(B.code)throw new JA.MongoServerError(B);if(B.writeErrors)throw new JA.MongoServerError(B.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,insertedId:this.documents[0]._id}}}UQ.InsertOneOperation=CX;class HX extends E3.AbstractOperation{constructor(F,A,B){super(B);if(!Array.isArray(A))throw new JA.MongoInvalidArgumentError('Argument "docs" must be an array of documents');this.options=B,this.collection=F,this.docs=A}get commandName(){return"insert"}async execute(F,A){let B=this.collection,D={...this.options,...this.bsonOptions,readPreference:this.readPreference},J=Ss.WriteConcern.fromOptions(D),Z=new xs.BulkWriteOperation(B,this.docs.map((X)=>({insertOne:{document:X}})),D);try{let X=await Z.execute(F,A);return{acknowledged:J?.w!==0,insertedCount:X.insertedCount,insertedIds:X.insertedIds}}catch(X){if(X&&X.message==="Operation must be an object with an operation key")throw new JA.MongoInvalidArgumentError("Collection.insertMany() cannot be called with an array that has null/undefined values");throw X}}}UQ.InsertManyOperation=HX;E3.defineAspects(ZA,[E3.Aspect.RETRYABLE,E3.Aspect.WRITE_OPERATION]);E3.defineAspects(CX,[E3.Aspect.RETRYABLE,E3.Aspect.WRITE_OPERATION]);E3.defineAspects(HX,[E3.Aspect.WRITE_OPERATION])});var QX=z((LQ)=>{Object.defineProperty(LQ,"__esModule",{value:!0});LQ.ReplaceOneOperation=LQ.UpdateManyOperation=LQ.UpdateOneOperation=LQ.UpdateOperation=void 0;LQ.makeUpdateStatement=XA;var J6=p(),WX=a(),bs=Y0(),u0=O1();class _9 extends bs.CommandOperation{constructor(F,A,B){super(void 0,B);this.options=B,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){let B=this.options??{},D=typeof B.ordered==="boolean"?B.ordered:!0,J={update:this.ns.collection,updates:this.statements,ordered:D};if(typeof B.bypassDocumentValidation==="boolean")J.bypassDocumentValidation=B.bypassDocumentValidation;if(B.let)J.let=B.let;if(B.comment!==void 0)J.comment=B.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,J)}}LQ.UpdateOperation=_9;class KX extends _9{constructor(F,A,B,D){super(F.s.namespace,[XA(A,B,{...D,multi:!1})],D);if(!WX.hasAtomicOperators(B))throw new J6.MongoInvalidArgumentError("Update document requires atomic operators")}async execute(F,A){let B=await super.execute(F,A);if(this.explain!=null)return B;if(B.code)throw new J6.MongoServerError(B);if(B.writeErrors)throw new J6.MongoServerError(B.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:B.nModified??B.n,upsertedId:Array.isArray(B.upserted)&&B.upserted.length>0?B.upserted[0]._id:null,upsertedCount:Array.isArray(B.upserted)&&B.upserted.length?B.upserted.length:0,matchedCount:Array.isArray(B.upserted)&&B.upserted.length>0?0:B.n}}}LQ.UpdateOneOperation=KX;class zX extends _9{constructor(F,A,B,D){super(F.s.namespace,[XA(A,B,{...D,multi:!0})],D);if(!WX.hasAtomicOperators(B))throw new J6.MongoInvalidArgumentError("Update document requires atomic operators")}async execute(F,A){let B=await super.execute(F,A);if(this.explain!=null)return B;if(B.code)throw new J6.MongoServerError(B);if(B.writeErrors)throw new J6.MongoServerError(B.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:B.nModified??B.n,upsertedId:Array.isArray(B.upserted)&&B.upserted.length>0?B.upserted[0]._id:null,upsertedCount:Array.isArray(B.upserted)&&B.upserted.length?B.upserted.length:0,matchedCount:Array.isArray(B.upserted)&&B.upserted.length>0?0:B.n}}}LQ.UpdateManyOperation=zX;class UX extends _9{constructor(F,A,B,D){super(F.s.namespace,[XA(A,B,{...D,multi:!1})],D);if(WX.hasAtomicOperators(B))throw new J6.MongoInvalidArgumentError("Replacement document must not contain atomic operators")}async execute(F,A){let B=await super.execute(F,A);if(this.explain!=null)return B;if(B.code)throw new J6.MongoServerError(B);if(B.writeErrors)throw new J6.MongoServerError(B.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:B.nModified??B.n,upsertedId:Array.isArray(B.upserted)&&B.upserted.length>0?B.upserted[0]._id:null,upsertedCount:Array.isArray(B.upserted)&&B.upserted.length?B.upserted.length:0,matchedCount:Array.isArray(B.upserted)&&B.upserted.length>0?0:B.n}}}LQ.ReplaceOneOperation=UX;function XA(F,A,B){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 D={q:F,u:A};if(typeof B.upsert==="boolean")D.upsert=B.upsert;if(B.multi)D.multi=B.multi;if(B.hint)D.hint=B.hint;if(B.arrayFilters)D.arrayFilters=B.arrayFilters;if(B.collation)D.collation=B.collation;return D}u0.defineAspects(_9,[u0.Aspect.RETRYABLE,u0.Aspect.WRITE_OPERATION,u0.Aspect.SKIP_COLLATION]);u0.defineAspects(KX,[u0.Aspect.RETRYABLE,u0.Aspect.WRITE_OPERATION,u0.Aspect.EXPLAINABLE,u0.Aspect.SKIP_COLLATION]);u0.defineAspects(zX,[u0.Aspect.WRITE_OPERATION,u0.Aspect.EXPLAINABLE,u0.Aspect.SKIP_COLLATION]);u0.defineAspects(UX,[u0.Aspect.RETRYABLE,u0.Aspect.WRITE_OPERATION,u0.Aspect.SKIP_COLLATION])});var h8=z((TQ)=>{Object.defineProperty(TQ,"__esModule",{value:!0});TQ.BulkOperationBase=TQ.BulkWriteShimOperation=TQ.FindOperators=TQ.MongoBulkWriteError=TQ.WriteError=TQ.WriteConcernError=TQ.BulkWriteResult=TQ.Batch=TQ.BatchType=void 0;TQ.mergeBatchResults=LX;var wQ=w1(),w0=p(),y8=YX(),IQ=l0(),ds=qX(),cs=O1(),h4=QX(),i6=a(),RQ=c0(),g8=Symbol("serverError");TQ.BatchType=Object.freeze({INSERT:1,UPDATE:2,DELETE:3});class NQ{constructor(F,A){this.originalZeroIndex=A,this.currentIndex=0,this.originalIndexes=[],this.batchType=F,this.operations=[],this.size=0,this.sizeBytes=0}}TQ.Batch=NQ;class C3{static generateIdMap(F){let A={};for(let B of F)A[B.index]=B._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=C3.generateIdMap(this.result.upserted),this.insertedIds=C3.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:B})=>!F.writeErrors.some((D)=>B===D.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 B=this.result.writeConcernErrors[A];if(F=F+B.errmsg,A===0)F=F+" and "}return new v8({errmsg:F,code:w0.MONGODB_ERROR_CODES.WriteConcernFailed})}}toString(){return`BulkWriteResult(${wQ.EJSON.stringify(this.result)})`}isOk(){return this.result.ok===1}}TQ.BulkWriteResult=C3;class v8{constructor(F){this[g8]=F}get code(){return this[g8].code}get errmsg(){return this[g8].errmsg}get errInfo(){return this[g8].errInfo}toJSON(){return this[g8]}toString(){return`WriteConcernError(${this.errmsg})`}}TQ.WriteConcernError=v8;class YA{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())})`}}TQ.WriteError=YA;function LX(F,A,B,D){if(B)D=B;else if(D&&D.result)D=D.result;if(D==null)return;if(D.ok===0&&A.ok===1){A.ok=0;let Z={index:0,code:D.code||0,errmsg:D.message,errInfo:D.errInfo,op:F.operations[0]};A.writeErrors.push(new YA(Z));return}else if(D.ok===0&&A.ok===0)return;if(MQ(F)&&D.n)A.nInserted=A.nInserted+D.n;if(RX(F)&&D.n)A.nRemoved=A.nRemoved+D.n;let J=0;if(Array.isArray(D.upserted)){J=D.upserted.length;for(let Z=0;Z<D.upserted.length;Z++)A.upserted.push({index:D.upserted[Z].index+F.originalZeroIndex,_id:D.upserted[Z]._id})}else if(D.upserted)J=1,A.upserted.push({index:F.originalZeroIndex,_id:D.upserted});if(VX(F)&&D.n){let Z=D.nModified;if(A.nUpserted=A.nUpserted+J,A.nMatched=A.nMatched+(D.n-J),typeof Z==="number")A.nModified=A.nModified+Z;else A.nModified=0}if(Array.isArray(D.writeErrors))for(let Z=0;Z<D.writeErrors.length;Z++){let X={index:F.originalIndexes[D.writeErrors[Z].index],code:D.writeErrors[Z].code,errmsg:D.writeErrors[Z].errmsg,errInfo:D.writeErrors[Z].errInfo,op:F.operations[D.writeErrors[Z].index]};A.writeErrors.push(new YA(X))}if(D.writeConcernError)A.writeConcernErrors.push(new v8(D.writeConcernError))}async function ls(F,A){if(F.s.batches.length===0)return new C3(F.s.bulkResult,F.isOrdered);for(let D of F.s.batches){let J=i6.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(VX(D))J.retryWrites=J.retryWrites&&!D.operations.some((G)=>G.multi);if(RX(D))J.retryWrites=J.retryWrites&&!D.operations.some((G)=>G.limit===0)}let Z=MQ(D)?new ds.InsertOperation(F.s.namespace,D.operations,J):VX(D)?new h4.UpdateOperation(F.s.namespace,D.operations,J):RX(D)?new y8.DeleteOperation(F.s.namespace,D.operations,J):null;if(Z==null)throw new w0.MongoRuntimeError(`Unknown batchType: ${D.batchType}`);let X=null,Y;try{Y=await IQ.executeOperation(F.s.collection.client,Z)}catch(G){X=G}if(X!=null)if(X instanceof w0.MongoWriteConcernError){LX(D,F.s.bulkResult,X,Y);let G=new C3(F.s.bulkResult,F.isOrdered);throw new g9({message:X.result.writeConcernError.errmsg,code:X.result.writeConcernError.code},G)}else throw new g9(X,new C3(F.s.bulkResult,F.isOrdered));LX(D,F.s.bulkResult,X,Y);let $=new C3(F.s.bulkResult,F.isOrdered);F.handleWriteError($)}F.s.batches.length=0;let B=new C3(F.s.bulkResult,F.isOrdered);return F.handleWriteError(B),B}class g9 extends w0.MongoServerError{constructor(F,A){super(F);if(this.writeErrors=[],F instanceof v8)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}}TQ.MongoBulkWriteError=g9;class wX{constructor(F){this.bulkOperation=F}update(F){let A=b8(this.bulkOperation);return this.bulkOperation.addToOperationsList(TQ.BatchType.UPDATE,h4.makeUpdateStatement(A.selector,F,{...A,multi:!0}))}updateOne(F){if(!i6.hasAtomicOperators(F))throw new w0.MongoInvalidArgumentError("Update document requires atomic operators");let A=b8(this.bulkOperation);return this.bulkOperation.addToOperationsList(TQ.BatchType.UPDATE,h4.makeUpdateStatement(A.selector,F,{...A,multi:!1}))}replaceOne(F){if(i6.hasAtomicOperators(F))throw new w0.MongoInvalidArgumentError("Replacement document must not use atomic operators");let A=b8(this.bulkOperation);return this.bulkOperation.addToOperationsList(TQ.BatchType.UPDATE,h4.makeUpdateStatement(A.selector,F,{...A,multi:!1}))}deleteOne(){let F=b8(this.bulkOperation);return this.bulkOperation.addToOperationsList(TQ.BatchType.DELETE,y8.makeDeleteStatement(F.selector,{...F,limit:1}))}delete(){let F=b8(this.bulkOperation);return this.bulkOperation.addToOperationsList(TQ.BatchType.DELETE,y8.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}}TQ.FindOperators=wX;class IX extends cs.AbstractOperation{constructor(F,A){super(A);this.bulkOperation=F}get commandName(){return"bulkWrite"}async execute(F,A){if(this.options.session==null)this.options.session=A;return await ls(this.bulkOperation,this.options)}}TQ.BulkWriteShimOperation=IX;class PQ{constructor(F,A,B){this.collection=F,this.isOrdered=B;let D=i6.getTopology(F);A=A==null?{}:A;let J=F.s.namespace,Z=!1,X=void 0,Y=D.lastHello(),$=!!(D.s.options&&D.s.options.autoEncrypter),G=Y&&Y.maxBsonObjectSize?Y.maxBsonObjectSize:16777216,E=$?2097152:G,C=Y&&Y.maxWriteBatchSize?Y.maxWriteBatchSize:1000,H=(C-1).toString(10).length+2,q=Object.assign({},A);q=i6.applyRetryableWrites(q,F.s.db);let W={ok:1,writeErrors:[],writeConcernErrors:[],insertedIds:[],nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[]};if(this.s={bulkResult:W,currentBatch:void 0,currentIndex:0,currentBatchSize:0,currentBatchSizeBytes:0,currentInsertBatch:void 0,currentUpdateBatch:void 0,currentRemoveBatch:void 0,batches:[],writeConcern:RQ.WriteConcern.fromOptions(A),maxBsonObjectSize:G,maxBatchSizeBytes:E,maxWriteBatchSize:C,maxKeySize:H,namespace:J,topology:D,options:q,bsonOptions:wQ.resolveBSONOptions(A),currentOp:X,executed:Z,collection:F,err:void 0,checkKeys:typeof A.checkKeys==="boolean"?A.checkKeys:!1},A.bypassDocumentValidation===!0)this.s.bypassDocumentValidation=!0}insert(F){return i6.maybeAddIdToDocuments(this.collection,F,{forceServerObjectId:this.shouldForceServerObjectId()}),this.addToOperationsList(TQ.BatchType.INSERT,F)}find(F){if(!F)throw new w0.MongoInvalidArgumentError("Bulk find operation must specify a selector");return this.s.currentOp={selector:F},new wX(this)}raw(F){if(F==null||typeof F!=="object")throw new w0.MongoInvalidArgumentError("Operation must be an object with an operation key");if("insertOne"in F){let A=this.shouldForceServerObjectId(),B=F.insertOne&&F.insertOne.document==null?F.insertOne:F.insertOne.document;return i6.maybeAddIdToDocuments(this.collection,B,{forceServerObjectId:A}),this.addToOperationsList(TQ.BatchType.INSERT,B)}if("replaceOne"in F||"updateOne"in F||"updateMany"in F){if("replaceOne"in F){if("q"in F.replaceOne)throw new w0.MongoInvalidArgumentError("Raw operations are not allowed");let A=h4.makeUpdateStatement(F.replaceOne.filter,F.replaceOne.replacement,{...F.replaceOne,multi:!1});if(i6.hasAtomicOperators(A.u))throw new w0.MongoInvalidArgumentError("Replacement document must not use atomic operators");return this.addToOperationsList(TQ.BatchType.UPDATE,A)}if("updateOne"in F){if("q"in F.updateOne)throw new w0.MongoInvalidArgumentError("Raw operations are not allowed");let A=h4.makeUpdateStatement(F.updateOne.filter,F.updateOne.update,{...F.updateOne,multi:!1});if(!i6.hasAtomicOperators(A.u))throw new w0.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(TQ.BatchType.UPDATE,A)}if("updateMany"in F){if("q"in F.updateMany)throw new w0.MongoInvalidArgumentError("Raw operations are not allowed");let A=h4.makeUpdateStatement(F.updateMany.filter,F.updateMany.update,{...F.updateMany,multi:!0});if(!i6.hasAtomicOperators(A.u))throw new w0.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(TQ.BatchType.UPDATE,A)}}if("deleteOne"in F){if("q"in F.deleteOne)throw new w0.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(TQ.BatchType.DELETE,y8.makeDeleteStatement(F.deleteOne.filter,{...F.deleteOne,limit:1}))}if("deleteMany"in F){if("q"in F.deleteMany)throw new w0.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(TQ.BatchType.DELETE,y8.makeDeleteStatement(F.deleteMany.filter,{...F.deleteMany,limit:0}))}throw new w0.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 w0.MongoBatchReExecutionError;let A=RQ.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 w0.MongoInvalidArgumentError("Invalid BulkOperation, Batch cannot be empty");this.s.executed=!0;let B={...this.s.options,...F},D=new IX(this,B);return await IQ.executeOperation(this.s.collection.client,D)}handleWriteError(F){if(this.s.bulkResult.writeErrors.length>0){let B=this.s.bulkResult.writeErrors[0].errmsg?this.s.bulkResult.writeErrors[0].errmsg:"write operation failed";throw new g9({message:B,code:this.s.bulkResult.writeErrors[0].code,writeErrors:this.s.bulkResult.writeErrors},F)}let A=F.getWriteConcernError();if(A)throw new g9(A,F)}shouldForceServerObjectId(){return this.s.options.forceServerObjectId===!0||this.s.collection.s.db.options?.forceServerObjectId===!0}}TQ.BulkOperationBase=PQ;function MQ(F){return F.batchType===TQ.BatchType.INSERT}function VX(F){return F.batchType===TQ.BatchType.UPDATE}function RX(F){return F.batchType===TQ.BatchType.DELETE}function b8(F){let{currentOp:A}=F.s;if(F.s.currentOp=void 0,!A)A={};return A}});var NX=z((kQ)=>{Object.defineProperty(kQ,"__esModule",{value:!0});kQ.OrderedBulkOperation=void 0;var Fa=w1(),uQ=p(),$A=h8();class OQ extends $A.BulkOperationBase{constructor(F,A){super(F,A,!0)}addToOperationsList(F,A){let B=Fa.calculateObjectSize(A,{checkKeys:!1,ignoreUndefined:!1});if(B>=this.s.maxBsonObjectSize)throw new uQ.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch==null)this.s.currentBatch=new $A.Batch(F,this.s.currentIndex);let D=this.s.maxKeySize;if(this.s.currentBatchSize+1>=this.s.maxWriteBatchSize||this.s.currentBatchSize>0&&this.s.currentBatchSizeBytes+D+B>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==F)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new $A.Batch(F,this.s.currentIndex),this.s.currentBatchSize=0,this.s.currentBatchSizeBytes=0;if(F===$A.BatchType.INSERT)this.s.bulkResult.insertedIds.push({index:this.s.currentIndex,_id:A._id});if(Array.isArray(A))throw new uQ.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+=D+B,this.s.currentIndex+=1,this}}kQ.OrderedBulkOperation=OQ});var PX=z((_Q)=>{Object.defineProperty(_Q,"__esModule",{value:!0});_Q.UnorderedBulkOperation=void 0;var Aa=w1(),xQ=p(),H3=h8();class fQ extends H3.BulkOperationBase{constructor(F,A){super(F,A,!1)}handleWriteError(F){if(this.s.batches.length)return;return super.handleWriteError(F)}addToOperationsList(F,A){let B=Aa.calculateObjectSize(A,{checkKeys:!1,ignoreUndefined:!1});if(B>=this.s.maxBsonObjectSize)throw new xQ.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch=void 0,F===H3.BatchType.INSERT)this.s.currentBatch=this.s.currentInsertBatch;else if(F===H3.BatchType.UPDATE)this.s.currentBatch=this.s.currentUpdateBatch;else if(F===H3.BatchType.DELETE)this.s.currentBatch=this.s.currentRemoveBatch;let D=this.s.maxKeySize;if(this.s.currentBatch==null)this.s.currentBatch=new H3.Batch(F,this.s.currentIndex);if(this.s.currentBatch.size+1>=this.s.maxWriteBatchSize||this.s.currentBatch.size>0&&this.s.currentBatch.sizeBytes+D+B>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==F)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new H3.Batch(F,this.s.currentIndex);if(Array.isArray(A))throw new xQ.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===H3.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===H3.BatchType.UPDATE)this.s.currentUpdateBatch=this.s.currentBatch;else if(F===H3.BatchType.DELETE)this.s.currentRemoveBatch=this.s.currentBatch;return this.s.currentBatch.size+=1,this.s.currentBatch.sizeBytes+=D+B,this}}_Q.UnorderedBulkOperation=fQ});var TX=z((vQ)=>{Object.defineProperty(vQ,"__esModule",{value:!0});vQ.AggregateOperation=vQ.DB_AGGREGATE_COLLECTION=void 0;var bQ=N6(),yQ=p(),Ba=a(),Da=c0(),Ja=Y0(),m8=O1();vQ.DB_AGGREGATE_COLLECTION=1;var Za=8;class MX extends Ja.CommandOperation{constructor(F,A,B){super(void 0,{...B,dbName:F.db});if(this.options={...B},this.target=F.collection||vQ.DB_AGGREGATE_COLLECTION,this.pipeline=A,this.hasWriteStage=!1,typeof B?.out==="string")this.pipeline=this.pipeline.concat({$out:B.out}),this.hasWriteStage=!0;else if(A.length>0){let D=A[A.length-1];if(D.$out||D.$merge)this.hasWriteStage=!0}if(this.hasWriteStage)this.trySecondaryWrite=!0;else delete this.options.writeConcern;if(this.explain&&this.writeConcern)throw new yQ.MongoInvalidArgumentError('Option "explain" cannot be used on an aggregate call with writeConcern');if(B?.cursor!=null&&typeof B.cursor!=="object")throw new yQ.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){let B=this.options,D=Ba.maxWireVersion(F),J={aggregate:this.target,pipeline:this.pipeline};if(this.hasWriteStage&&D<Za)this.readConcern=void 0;if(this.hasWriteStage&&this.writeConcern)Da.WriteConcern.apply(J,this.writeConcern);if(B.bypassDocumentValidation===!0)J.bypassDocumentValidation=B.bypassDocumentValidation;if(typeof B.allowDiskUse==="boolean")J.allowDiskUse=B.allowDiskUse;if(B.hint)J.hint=B.hint;if(B.let)J.let=B.let;if(B.comment!==void 0)J.comment=B.comment;if(J.cursor=B.cursor||{},B.batchSize&&!this.hasWriteStage)J.cursor.batchSize=B.batchSize;return await super.executeCommand(F,A,J,this.explain?bQ.ExplainedCursorResponse:bQ.CursorResponse)}}vQ.AggregateOperation=MX;m8.defineAspects(MX,[m8.Aspect.READ_OPERATION,m8.Aspect.RETRYABLE,m8.Aspect.EXPLAINABLE,m8.Aspect.CURSOR_CREATING])});var d4=z((iQ)=>{Object.defineProperty(iQ,"__esModule",{value:!0});iQ.MongoLogger=iQ.MongoLoggableComponent=iQ.SEVERITY_LEVEL_MAP=iQ.DEFAULT_MAX_DOCUMENT_LENGTH=iQ.SeverityLevel=void 0;iQ.parseSeverityFromString=OX;iQ.createStdioLogger=m4;iQ.stringifyWithMaxLen=a3;iQ.defaultLogTransform=lQ;var dQ=import.meta.require("util"),Xa=w1(),p1=W0(),y9=a();iQ.SeverityLevel=Object.freeze({EMERGENCY:"emergency",ALERT:"alert",CRITICAL:"critical",ERROR:"error",WARNING:"warn",NOTICE:"notice",INFORMATIONAL:"info",DEBUG:"debug",TRACE:"trace",OFF:"off"});iQ.DEFAULT_MAX_DOCUMENT_LENGTH=1000;class cQ extends Map{constructor(F){let A=[];for(let[B,D]of F)A.push([D,B]);A.push(...F);super(A)}getNumericSeverityLevel(F){return this.get(F)}getSeverityLevelName(F){return this.get(F)}}iQ.SEVERITY_LEVEL_MAP=new cQ([[iQ.SeverityLevel.OFF,-1/0],[iQ.SeverityLevel.EMERGENCY,0],[iQ.SeverityLevel.ALERT,1],[iQ.SeverityLevel.CRITICAL,2],[iQ.SeverityLevel.ERROR,3],[iQ.SeverityLevel.WARNING,4],[iQ.SeverityLevel.NOTICE,5],[iQ.SeverityLevel.INFORMATIONAL,6],[iQ.SeverityLevel.DEBUG,7],[iQ.SeverityLevel.TRACE,8]]);iQ.MongoLoggableComponent=Object.freeze({COMMAND:"command",TOPOLOGY:"topology",SERVER_SELECTION:"serverSelection",CONNECTION:"connection",CLIENT:"client"});function OX(F){let A=Object.values(iQ.SeverityLevel),B=F?.toLowerCase();if(B!=null&&A.includes(B))return B;return null}function m4(F){return{write:dQ.promisify((A,B)=>{let D=dQ.inspect(A,{compact:!0,breakLength:1/0});F.write(`${D}
|
|
26
|
+
`,"utf-8",B);return})}}function Ya({MONGODB_LOG_PATH:F},{mongodbLogPath:A}){if(typeof A==="string"&&/^stderr$/i.test(A))return{mongodbLogPath:m4(process.stderr),mongodbLogPathIsStdErr:!0};if(typeof A==="string"&&/^stdout$/i.test(A))return{mongodbLogPath:m4(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:m4(process.stderr),mongodbLogPathIsStdErr:!0};if(F&&/^stdout$/i.test(F))return{mongodbLogPath:m4(process.stdout),mongodbLogPathIsStdErr:!1};return{mongodbLogPath:m4(process.stderr),mongodbLogPathIsStdErr:!0}}function b9(F,A,B){return OX(F)??OX(A)??B}function $a(F,A){let B=iQ.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(F),D=iQ.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(A);return B<D?-1:B>D?1:0}function a3(F,A,B={}){let D="";if(typeof F==="string")D=F;else if(typeof F==="function")D=F.name;else try{D=Xa.EJSON.stringify(F,B)}catch(J){D=`Extended JSON serialization failed with: ${J.message}`}if(A!==0&&D.length>A&&D.charCodeAt(A-1)!==D.codePointAt(A-1)){if(A--,A===0)return""}return A!==0&&D.length>A?`${D.slice(0,A)}...`:D}function Ga(F){let A=F;return A.toLog!==void 0&&typeof A.toLog==="function"}function GA(F,A,B=iQ.DEFAULT_MAX_DOCUMENT_LENGTH){let{selector:D,operation:J,topologyDescription:Z,message:X}=A;return F.selector=a3(D,B),F.operation=J,F.topologyDescription=a3(Z,B),F.message=X,F}function jX(F,A){F.commandName=A.commandName,F.requestId=A.requestId,F.driverConnectionId=A.connectionId;let{host:B,port:D}=y9.HostAddress.fromString(A.address).toHostPort();if(F.serverHost=B,F.serverPort=D,A?.serviceId)F.serviceId=A.serviceId.toHexString();return F.databaseName=A.databaseName,F.serverConnectionId=A.serverConnectionId,F}function m2(F,A){let{host:B,port:D}=y9.HostAddress.fromString(A.address).toHostPort();return F.serverHost=B,F.serverPort=D,F}function s3(F,A){return F.topologyId=A.topologyId,F}function uX(F,A){let{awaited:B,connectionId:D}=A;F.awaited=B,F.driverConnectionId=A.connectionId;let{host:J,port:Z}=y9.HostAddress.fromString(D).toHostPort();return F.serverHost=J,F.serverPort=Z,F}function lQ(F,A=iQ.DEFAULT_MAX_DOCUMENT_LENGTH){let B=Object.create(null);switch(F.name){case p1.SERVER_SELECTION_STARTED:return B=GA(B,F,A),B;case p1.SERVER_SELECTION_FAILED:return B=GA(B,F,A),B.failure=F.failure?.message,B;case p1.SERVER_SELECTION_SUCCEEDED:return B=GA(B,F,A),B.serverHost=F.serverHost,B.serverPort=F.serverPort,B;case p1.WAITING_FOR_SUITABLE_SERVER:return B=GA(B,F,A),B.remainingTimeMS=F.remainingTimeMS,B;case p1.COMMAND_STARTED:return B=jX(B,F),B.message="Command started",B.command=a3(F.command,A,{relaxed:!0}),B.databaseName=F.databaseName,B;case p1.COMMAND_SUCCEEDED:return B=jX(B,F),B.message="Command succeeded",B.durationMS=F.duration,B.reply=a3(F.reply,A,{relaxed:!0}),B;case p1.COMMAND_FAILED:return B=jX(B,F),B.message="Command failed",B.durationMS=F.duration,B.failure=F.failure?.message??"(redacted)",B;case p1.CONNECTION_POOL_CREATED:if(B=m2(B,F),B.message="Connection pool created",F.options){let{maxIdleTimeMS:D,minPoolSize:J,maxPoolSize:Z,maxConnecting:X,waitQueueTimeoutMS:Y}=F.options;B={...B,maxIdleTimeMS:D,minPoolSize:J,maxPoolSize:Z,maxConnecting:X,waitQueueTimeoutMS:Y}}return B;case p1.CONNECTION_POOL_READY:return B=m2(B,F),B.message="Connection pool ready",B;case p1.CONNECTION_POOL_CLEARED:if(B=m2(B,F),B.message="Connection pool cleared",F.serviceId?._bsontype==="ObjectId")B.serviceId=F.serviceId?.toHexString();return B;case p1.CONNECTION_POOL_CLOSED:return B=m2(B,F),B.message="Connection pool closed",B;case p1.CONNECTION_CREATED:return B=m2(B,F),B.message="Connection created",B.driverConnectionId=F.connectionId,B;case p1.CONNECTION_READY:return B=m2(B,F),B.message="Connection ready",B.driverConnectionId=F.connectionId,B.durationMS=F.durationMS,B;case p1.CONNECTION_CLOSED:switch(B=m2(B,F),B.message="Connection closed",B.driverConnectionId=F.connectionId,F.reason){case"stale":B.reason="Connection became stale because the pool was cleared";break;case"idle":B.reason="Connection has been available but unused for longer than the configured max idle time";break;case"error":if(B.reason="An error occurred while using the connection",F.error)B.error=F.error;break;case"poolClosed":B.reason="Connection pool was closed";break;default:B.reason=`Unknown close reason: ${F.reason}`}return B;case p1.CONNECTION_CHECK_OUT_STARTED:return B=m2(B,F),B.message="Connection checkout started",B;case p1.CONNECTION_CHECK_OUT_FAILED:switch(B=m2(B,F),B.message="Connection checkout failed",F.reason){case"poolClosed":B.reason="Connection pool was closed";break;case"timeout":B.reason="Wait queue timeout elapsed without a connection becoming available";break;case"connectionError":if(B.reason="An error occurred while trying to establish a new connection",F.error)B.error=F.error;break;default:B.reason=`Unknown close reason: ${F.reason}`}return B.durationMS=F.durationMS,B;case p1.CONNECTION_CHECKED_OUT:return B=m2(B,F),B.message="Connection checked out",B.driverConnectionId=F.connectionId,B.durationMS=F.durationMS,B;case p1.CONNECTION_CHECKED_IN:return B=m2(B,F),B.message="Connection checked in",B.driverConnectionId=F.connectionId,B;case p1.SERVER_OPENING:return B=s3(B,F),B=m2(B,F),B.message="Starting server monitoring",B;case p1.SERVER_CLOSED:return B=s3(B,F),B=m2(B,F),B.message="Stopped server monitoring",B;case p1.SERVER_HEARTBEAT_STARTED:return B=s3(B,F),B=uX(B,F),B.message="Server heartbeat started",B;case p1.SERVER_HEARTBEAT_SUCCEEDED:return B=s3(B,F),B=uX(B,F),B.message="Server heartbeat succeeded",B.durationMS=F.duration,B.serverConnectionId=F.serverConnectionId,B.reply=a3(F.reply,A,{relaxed:!0}),B;case p1.SERVER_HEARTBEAT_FAILED:return B=s3(B,F),B=uX(B,F),B.message="Server heartbeat failed",B.durationMS=F.duration,B.failure=F.failure?.message,B;case p1.TOPOLOGY_OPENING:return B=s3(B,F),B.message="Starting topology monitoring",B;case p1.TOPOLOGY_CLOSED:return B=s3(B,F),B.message="Stopped topology monitoring",B;case p1.TOPOLOGY_DESCRIPTION_CHANGED:return B=s3(B,F),B.message="Topology description changed",B.previousDescription=B.reply=a3(F.previousDescription,A),B.newDescription=B.reply=a3(F.newDescription,A),B;default:for(let[D,J]of Object.entries(F))if(J!=null)B[D]=J}return B}class pQ{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(iQ.MongoLoggableComponent)){F[A]={};for(let B of Object.values(iQ.SeverityLevel))F[A][B]=$a(B,this.componentSeverities[A])<=0}return F}turnOffSeverities(){for(let F of Object.values(iQ.MongoLoggableComponent)){this.componentSeverities[F]=iQ.SeverityLevel.OFF;for(let A of Object.values(iQ.SeverityLevel))this.severities[F][A]=!1}}logWriteFailureHandler(F){if(this.logDestinationIsStdErr){this.turnOffSeverities(),this.clearPendingLog();return}this.logDestination=m4(process.stderr),this.logDestinationIsStdErr=!0,this.clearPendingLog(),this.error(iQ.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===iQ.SeverityLevel.OFF)return!1;return this.severities[F][A]}log(F,A,B){if(!this.willLog(A,F))return;let D={t:new Date,c:A,s:F};if(typeof B==="string")D.message=B;else if(typeof B==="object")if(Ga(B))D={...D,...B.toLog()};else D={...D,...lQ(B,this.maxDocumentLength)};if(y9.isPromiseLike(this.pendingLog)){this.pendingLog=this.pendingLog.then(()=>this.logDestination.write(D)).then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this));return}try{let J=this.logDestination.write(D);if(y9.isPromiseLike(J))this.pendingLog=J.then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this))}catch(J){this.logWriteFailureHandler(J)}}static resolveOptions(F,A){let B=Ya(F,A),D={...F,...A,mongodbLogPath:B.mongodbLogPath,mongodbLogPathIsStdErr:B.mongodbLogPathIsStdErr},J=b9(D.mongodbLogComponentSeverities?.default,D.MONGODB_LOG_ALL,iQ.SeverityLevel.OFF);return{componentSeverities:{command:b9(D.mongodbLogComponentSeverities?.command,D.MONGODB_LOG_COMMAND,J),topology:b9(D.mongodbLogComponentSeverities?.topology,D.MONGODB_LOG_TOPOLOGY,J),serverSelection:b9(D.mongodbLogComponentSeverities?.serverSelection,D.MONGODB_LOG_SERVER_SELECTION,J),connection:b9(D.mongodbLogComponentSeverities?.connection,D.MONGODB_LOG_CONNECTION,J),client:b9(D.mongodbLogComponentSeverities?.client,D.MONGODB_LOG_CLIENT,J),default:J},maxDocumentLength:D.mongodbLogMaxDocumentLength??y9.parseUnsignedInteger(D.MONGODB_LOG_MAX_DOCUMENT_LENGTH)??1000,logDestination:D.mongodbLogPath,logDestinationIsStdErr:D.mongodbLogPathIsStdErr}}}iQ.MongoLogger=pQ});var d2=z((aQ)=>{Object.defineProperty(aQ,"__esModule",{value:!0});aQ.CancellationToken=aQ.TypedEventEmitter=void 0;var Wa=import.meta.require("events"),Ka=d4();class xX extends Wa.EventEmitter{emitAndLog(F,...A){if(this.emit(F,...A),this.component)this.mongoLogger?.debug(this.component,A[0])}emitAndLogHeartbeat(F,A,B,...D){if(this.emit(F,...D),this.component){let J={topologyId:A,serverConnectionId:B??null,...D[0]};this.mongoLogger?.debug(this.component,J)}}emitAndLogCommand(F,A,B,D,...J){if(F)this.emit(A,...J);if(D){let Z={databaseName:B,...J[0]};this.mongoLogger?.debug(Ka.MongoLoggableComponent.COMMAND,Z)}}}aQ.TypedEventEmitter=xX;class sQ extends xX{}aQ.CancellationToken=sQ});var gX=z((tQ)=>{Object.defineProperty(tQ,"__esModule",{value:!0});tQ.GetMoreOperation=void 0;var Ua=N6(),fX=p(),Qa=a(),CA=O1();class _X extends CA.AbstractOperation{constructor(F,A,B,D){super(D);this.options=D,this.ns=F,this.cursorId=A,this.server=B}get commandName(){return"getMore"}async execute(F,A){if(F!==this.server)throw new fX.MongoRuntimeError("Getmore must run on the same server operation began on");if(this.cursorId==null||this.cursorId.isZero())throw new fX.MongoRuntimeError("Unable to iterate cursor with no id");let B=this.ns.collection;if(B==null)throw new fX.MongoRuntimeError("A collection name must be determined before getMore");let D={getMore:this.cursorId,collection:B};if(typeof this.options.batchSize==="number")D.batchSize=Math.abs(this.options.batchSize);if(typeof this.options.maxAwaitTimeMS==="number")D.maxTimeMS=this.options.maxAwaitTimeMS;if(this.options.comment!==void 0&&Qa.maxWireVersion(F)>=9)D.comment=this.options.comment;let J={returnFieldSelector:null,documentsReturnedIn:"nextBatch",...this.options};return await F.command(this.ns,D,J,Ua.CursorResponse)}}tQ.GetMoreOperation=_X;CA.defineAspects(_X,[CA.Aspect.READ_OPERATION,CA.Aspect.MUST_SELECT_SAME_SERVER])});var BL=z((FL)=>{Object.defineProperty(FL,"__esModule",{value:!0});FL.KillCursorsOperation=void 0;var eQ=p(),La=a(),bX=O1();class yX extends bX.AbstractOperation{constructor(F,A,B,D){super(D);this.ns=A,this.cursorId=F,this.server=B}get commandName(){return"killCursors"}async execute(F,A){if(F!==this.server)throw new eQ.MongoRuntimeError("Killcursor must run on the same server operation began on");let B=this.ns.collection;if(B==null)throw new eQ.MongoRuntimeError("A collection name must be determined before killCursors");let D={killCursors:B,cursors:[this.cursorId]};try{await F.command(this.ns,D,{session:A})}catch(J){La.squashError(J)}}}FL.KillCursorsOperation=yX;bX.defineAspects(yX,[bX.Aspect.MUST_SELECT_SAME_SERVER])});var P6=z((DL)=>{Object.defineProperty(DL,"__esModule",{value:!0});DL.aws4=void 0;DL.getKerberos=Va;DL.getZstdLibrary=Ra;DL.getAwsCredentialProvider=wa;DL.getGcpMetadata=Ia;DL.getSnappy=Na;DL.getSocks=Pa;DL.getMongoDBClientEncryption=Ta;var r3=p();function d8(F){return new Proxy(F?{kModuleError:F}:{},{get:(B,D)=>{if(D==="kModuleError")return F;throw F},set:()=>{throw F}})}function Va(){let F;try{F=(()=>{throw new Error("Cannot require module "+"kerberos");})()}catch(A){F=d8(new r3.MongoMissingDependencyError("Optional module `kerberos` not found. Please install it to enable kerberos authentication",{cause:A,dependencyName:"kerberos"}))}return F}function Ra(){let F;try{F=(()=>{throw new Error("Cannot require module "+"@mongodb-js/zstd");})()}catch(A){F=d8(new r3.MongoMissingDependencyError("Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression",{cause:A,dependencyName:"zstd"}))}return F}function wa(){try{return (()=>{throw new Error("Cannot require module "+"@aws-sdk/credential-providers");})()}catch(F){return d8(new r3.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 Ia(){try{return (()=>{throw new Error("Cannot require module "+"gcp-metadata");})()}catch(F){return d8(new r3.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 Na(){try{return (()=>{throw new Error("Cannot require module "+"snappy");})()}catch(F){return{kModuleError:new r3.MongoMissingDependencyError("Optional module `snappy` not found. Please install it to enable snappy compression",{cause:F,dependencyName:"snappy"})}}}function Pa(){try{return (()=>{throw new Error("Cannot require module "+"socks");})()}catch(F){return{kModuleError:new r3.MongoMissingDependencyError("Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy",{cause:F,dependencyName:"socks"})}}}DL.aws4=Ma();function Ma(){let F;try{F=(()=>{throw new Error("Cannot require module "+"aws4");})()}catch(A){F=d8(new r3.MongoMissingDependencyError("Optional module `aws4` not found. Please install it to enable AWS authentication",{cause:A,dependencyName:"aws4"}))}return F}function Ta(){let F=null;try{F=(()=>{throw new Error("Cannot require module "+"mongodb-client-encryption");})()}catch(A){return{kModuleError:new r3.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 t3=z((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});YL.AuthProvider=YL.AuthContext=void 0;var _a=p();class ZL{constructor(F,A,B){this.reauthenticating=!1,this.connection=F,this.credentials=A,this.options=B}}YL.AuthContext=ZL;class XL{async prepare(F,A){return F}async reauth(F){if(F.reauthenticating)throw new _a.MongoRuntimeError("Reauthentication already in progress.");try{F.reauthenticating=!0,await this.auth(F)}finally{F.reauthenticating=!1}}}YL.AuthProvider=XL});var qA=z((qL)=>{Object.defineProperty(qL,"__esModule",{value:!0});qL.GSSAPI=qL.GSSAPICanonicalizationValue=void 0;qL.performGSSAPICanonicalizeHostName=HL;qL.resolveCname=mX;var hX=import.meta.require("dns"),ba=P6(),GL=p(),ya=a(),va=t3();qL.GSSAPICanonicalizationValue=Object.freeze({on:!0,off:!1,none:"none",forward:"forward",forwardAndReverse:"forwardAndReverse"});async function vX(F,A){return await F.command(ya.ns("$external.$cmd"),A)}var c8;class EL extends va.AuthProvider{async auth(F){let{connection:A,credentials:B}=F;if(B==null)throw new GL.MongoMissingCredentialsError("Credentials required for GSSAPI authentication");let{username:D}=B,J=await ha(F),Z=await J.step(""),X=await vX(A,ma(Z)),Y=await CL(J,10,X.payload),$=await vX(A,da(Y,X.conversationId)),G=await ca(J,D,$.payload);await vX(A,{saslContinue:1,conversationId:$.conversationId,payload:G})}}qL.GSSAPI=EL;async function ha(F){let{hostAddress:A}=F.options,{credentials:B}=F;if(!A||typeof A.host!=="string"||!B)throw new GL.MongoInvalidArgumentError("Connection must have host and port and credentials defined.");if(la(),"kModuleError"in c8)throw c8.kModuleError;let{initializeClient:D}=c8,{username:J,password:Z}=B,X=B.mechanismProperties,Y=X.SERVICE_NAME??"mongodb",$=await HL(A.host,X),G={};if(Z!=null)Object.assign(G,{user:J,password:Z});let E=X.SERVICE_HOST??$,C=`${Y}${process.platform==="win32"?"/":"@"}${E}`;if("SERVICE_REALM"in X)C=`${C}@${X.SERVICE_REALM}`;return await D(C,G)}function ma(F){return{saslStart:1,mechanism:"GSSAPI",payload:F,autoAuthorize:1}}function da(F,A){return{saslContinue:1,conversationId:A,payload:F}}async function CL(F,A,B){try{return await F.step(B)||""}catch(D){if(A===0)throw D;return await CL(F,A-1,B)}}async function ca(F,A,B){let D=await F.unwrap(B);return await F.wrap(D||"",{user:A})}async function HL(F,A){let B=A.CANONICALIZE_HOST_NAME;if(!B||B===qL.GSSAPICanonicalizationValue.none)return F;if(B===qL.GSSAPICanonicalizationValue.on||B===qL.GSSAPICanonicalizationValue.forwardAndReverse){let{address:D}=await hX.promises.lookup(F);try{let J=await hX.promises.resolvePtr(D);return J.length>0?J[0]:F}catch{return await mX(F)}}else return await mX(F)}async function mX(F){try{let A=await hX.promises.resolveCname(F);return A.length>0?A[0]:F}catch{return F}}function la(){if(!c8)c8=ba.getKerberos()}});var n6=z((KL)=>{Object.defineProperty(KL,"__esModule",{value:!0});KL.AUTH_MECHS_AUTH_SRC_EXTERNAL=KL.AuthMechanism=void 0;KL.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"});KL.AUTH_MECHS_AUTH_SRC_EXTERNAL=new Set([KL.AuthMechanism.MONGODB_GSSAPI,KL.AuthMechanism.MONGODB_AWS,KL.AuthMechanism.MONGODB_OIDC,KL.AuthMechanism.MONGODB_X509])});var KA=z((LL)=>{Object.defineProperty(LL,"__esModule",{value:!0});LL.MongoCredentials=LL.DEFAULT_ALLOWED_HOSTS=void 0;var Z6=p(),na=qA(),Z2=n6();function sa(F){if(F){if(Array.isArray(F.saslSupportedMechs))return F.saslSupportedMechs.includes(Z2.AuthMechanism.MONGODB_SCRAM_SHA256)?Z2.AuthMechanism.MONGODB_SCRAM_SHA256:Z2.AuthMechanism.MONGODB_SCRAM_SHA1}return Z2.AuthMechanism.MONGODB_SCRAM_SHA256}var UL=["test","azure","gcp"],QL="Auth mechanism property ALLOWED_HOSTS must be an array of strings.";LL.DEFAULT_ALLOWED_HOSTS=["*.mongodb.net","*.mongodb-qa.net","*.mongodb-dev.net","*.mongodbgov.net","localhost","127.0.0.1","::1"];var aa="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.";class WA{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||Z2.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===Z2.AuthMechanism.MONGODB_OIDC&&!this.mechanismProperties.ALLOWED_HOSTS)this.mechanismProperties={...this.mechanismProperties,ALLOWED_HOSTS:LL.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 WA({username:this.username,password:this.password,source:this.source,mechanism:sa(F),mechanismProperties:this.mechanismProperties});return this}validate(){if((this.mechanism===Z2.AuthMechanism.MONGODB_GSSAPI||this.mechanism===Z2.AuthMechanism.MONGODB_PLAIN||this.mechanism===Z2.AuthMechanism.MONGODB_SCRAM_SHA1||this.mechanism===Z2.AuthMechanism.MONGODB_SCRAM_SHA256)&&!this.username)throw new Z6.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`);if(this.mechanism===Z2.AuthMechanism.MONGODB_OIDC){if(this.username&&this.mechanismProperties.ENVIRONMENT&&this.mechanismProperties.ENVIRONMENT!=="azure")throw new Z6.MongoInvalidArgumentError(`username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.`);if(this.username&&this.password)throw new Z6.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 Z6.MongoInvalidArgumentError(aa);if(this.mechanismProperties.ENVIRONMENT&&!UL.includes(this.mechanismProperties.ENVIRONMENT))throw new Z6.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${UL.join(",")} is supported for mechanism '${this.mechanism}'.`);if(!this.mechanismProperties.ENVIRONMENT&&!this.mechanismProperties.OIDC_CALLBACK&&!this.mechanismProperties.OIDC_HUMAN_CALLBACK)throw new Z6.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 Z6.MongoInvalidArgumentError(QL);for(let B of A)if(typeof B!=="string")throw new Z6.MongoInvalidArgumentError(QL)}}if(Z2.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)){if(this.source!=null&&this.source!=="$external")throw new Z6.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`)}if(this.mechanism===Z2.AuthMechanism.MONGODB_PLAIN&&this.source==null)throw new Z6.MongoAPIError("PLAIN Authentication Mechanism needs an auth source");if(this.mechanism===Z2.AuthMechanism.MONGODB_X509&&this.password!=null){if(this.password===""){Reflect.set(this,"password",void 0);return}throw new Z6.MongoAPIError("Password not allowed for mechanism MONGODB-X509")}let F=this.mechanismProperties.CANONICALIZE_HOST_NAME??!1;if(!Object.values(na.GSSAPICanonicalizationValue).includes(F))throw new Z6.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${F}`)}static merge(F,A){return new WA({username:A.username??F?.username??"",password:A.password??F?.password??"",mechanism:A.mechanism??F?.mechanism??Z2.AuthMechanism.MONGODB_DEFAULT,mechanismProperties:A.mechanismProperties??F?.mechanismProperties??{},source:A.source??A.db??F?.source??"admin"})}}LL.MongoCredentials=WA});var UA=z((PL)=>{function b1(F,A,B){if(B.globals)F=B.globals[F.name];return new F(`${B.context?B.context:"Value"} ${A}.`)}function m9(F,A){if(typeof F==="bigint")throw b1(TypeError,"is a BigInt which cannot be converted to a number",A);if(!A.globals)return Number(F);return A.globals.Number(F)}function IL(F){if(F>0&&F%1===0.5&&(F&1)===0||F<0&&F%1===-0.5&&(F&1)===1)return p8(Math.floor(F));return p8(Math.round(F))}function zA(F){return p8(Math.trunc(F))}function wL(F){return F<0?-1:1}function ra(F,A){let B=F%A;if(wL(A)!==wL(B))return B+A;return B}function p8(F){return F===0?0:F}function d9(F,{unsigned:A}){let B,D;if(A)B=0,D=2**F-1;else B=-(2**(F-1)),D=2**(F-1)-1;let J=2**F,Z=2**(F-1);return(X,Y={})=>{let $=m9(X,Y);if($=p8($),Y.enforceRange){if(!Number.isFinite($))throw b1(TypeError,"is not a finite number",Y);if($=zA($),$<B||$>D)throw b1(TypeError,`is outside the accepted range of ${B} to ${D}, inclusive`,Y);return $}if(!Number.isNaN($)&&Y.clamp)return $=Math.min(Math.max($,B),D),$=IL($),$;if(!Number.isFinite($)||$===0)return 0;if($=zA($),$>=B&&$<=D)return $;if($=ra($,J),!A&&$>=Z)return $-J;return $}}function NL(F,{unsigned:A}){let B=Number.MAX_SAFE_INTEGER,D=A?0:Number.MIN_SAFE_INTEGER,J=A?BigInt.asUintN:BigInt.asIntN;return(Z,X={})=>{let Y=m9(Z,X);if(Y=p8(Y),X.enforceRange){if(!Number.isFinite(Y))throw b1(TypeError,"is not a finite number",X);if(Y=zA(Y),Y<D||Y>B)throw b1(TypeError,`is outside the accepted range of ${D} to ${B}, inclusive`,X);return Y}if(!Number.isNaN(Y)&&X.clamp)return Y=Math.min(Math.max(Y,D),B),Y=IL(Y),Y;if(!Number.isFinite(Y)||Y===0)return 0;let $=BigInt(zA(Y));return $=J(F,$),Number($)}}PL.any=(F)=>{return F};PL.undefined=()=>{return};PL.boolean=(F)=>{return Boolean(F)};PL.byte=d9(8,{unsigned:!1});PL.octet=d9(8,{unsigned:!0});PL.short=d9(16,{unsigned:!1});PL["unsigned short"]=d9(16,{unsigned:!0});PL.long=d9(32,{unsigned:!1});PL["unsigned long"]=d9(32,{unsigned:!0});PL["long long"]=NL(64,{unsigned:!1});PL["unsigned long long"]=NL(64,{unsigned:!0});PL.double=(F,A={})=>{let B=m9(F,A);if(!Number.isFinite(B))throw b1(TypeError,"is not a finite floating-point value",A);return B};PL["unrestricted double"]=(F,A={})=>{return m9(F,A)};PL.float=(F,A={})=>{let B=m9(F,A);if(!Number.isFinite(B))throw b1(TypeError,"is not a finite floating-point value",A);if(Object.is(B,-0))return B;let D=Math.fround(B);if(!Number.isFinite(D))throw b1(TypeError,"is outside the range of a single-precision floating-point value",A);return D};PL["unrestricted float"]=(F,A={})=>{let B=m9(F,A);if(isNaN(B))return B;if(Object.is(B,-0))return B;return Math.fround(B)};PL.DOMString=(F,A={})=>{if(A.treatNullAsEmptyString&&F===null)return"";if(typeof F==="symbol")throw b1(TypeError,"is a symbol, which cannot be converted to a string",A);return(A.globals?A.globals.String:String)(F)};PL.ByteString=(F,A={})=>{let B=PL.DOMString(F,A),D;for(let J=0;(D=B.codePointAt(J))!==void 0;++J)if(D>255)throw b1(TypeError,"is not a valid ByteString",A);return B};PL.USVString=(F,A={})=>{let B=PL.DOMString(F,A),D=B.length,J=[];for(let Z=0;Z<D;++Z){let X=B.charCodeAt(Z);if(X<55296||X>57343)J.push(String.fromCodePoint(X));else if(56320<=X&&X<=57343)J.push(String.fromCodePoint(65533));else if(Z===D-1)J.push(String.fromCodePoint(65533));else{let Y=B.charCodeAt(Z+1);if(56320<=Y&&Y<=57343){let $=X&1023,G=Y&1023;J.push(String.fromCodePoint(65536+1024*$+G)),++Z}else J.push(String.fromCodePoint(65533))}}return J.join("")};PL.object=(F,A={})=>{if(F===null||typeof F!=="object"&&typeof F!=="function")throw b1(TypeError,"is not an object",A);return F};var ta=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,oa=typeof SharedArrayBuffer==="function"?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get:null;function dX(F){try{return ta.call(F),!0}catch{return!1}}function v9(F){try{return oa.call(F),!0}catch{return!1}}function h9(F){try{return new Uint8Array(F),!1}catch{return!0}}PL.ArrayBuffer=(F,A={})=>{if(!dX(F)){if(A.allowShared&&!v9(F))throw b1(TypeError,"is not an ArrayBuffer or SharedArrayBuffer",A);throw b1(TypeError,"is not an ArrayBuffer",A)}if(h9(F))throw b1(TypeError,"is a detached ArrayBuffer",A);return F};var ea=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;PL.DataView=(F,A={})=>{try{ea.call(F)}catch(B){throw b1(TypeError,"is not a DataView",A)}if(!A.allowShared&&v9(F.buffer))throw b1(TypeError,"is backed by a SharedArrayBuffer, which is not allowed",A);if(h9(F.buffer))throw b1(TypeError,"is backed by a detached ArrayBuffer",A);return F};var Fr=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach((F)=>{let{name:A}=F,B=/^[AEIOU]/u.test(A)?"an":"a";PL[A]=(D,J={})=>{if(!ArrayBuffer.isView(D)||Fr.call(D)!==A)throw b1(TypeError,`is not ${B} ${A} object`,J);if(!J.allowShared&&v9(D.buffer))throw b1(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",J);if(h9(D.buffer))throw b1(TypeError,"is a view on a detached ArrayBuffer",J);return D}});PL.ArrayBufferView=(F,A={})=>{if(!ArrayBuffer.isView(F))throw b1(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",A);if(!A.allowShared&&v9(F.buffer))throw b1(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",A);if(h9(F.buffer))throw b1(TypeError,"is a view on a detached ArrayBuffer",A);return F};PL.BufferSource=(F,A={})=>{if(ArrayBuffer.isView(F)){if(!A.allowShared&&v9(F.buffer))throw b1(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",A);if(h9(F.buffer))throw b1(TypeError,"is a view on a detached ArrayBuffer",A);return F}if(!A.allowShared&&!dX(F))throw b1(TypeError,"is not an ArrayBuffer or a view on one",A);if(A.allowShared&&!v9(F)&&!dX(F))throw b1(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",A);if(h9(F))throw b1(TypeError,"is a detached ArrayBuffer",A);return F};PL.DOMTimeStamp=PL["unsigned long long"]});var LA=z((xL,fL)=>{function Ir(F){return typeof F==="object"&&F!==null||typeof F==="function"}var TL=Function.prototype.call.bind(Object.prototype.hasOwnProperty);function Nr(F,A){for(let B of Reflect.ownKeys(A)){let D=Reflect.getOwnPropertyDescriptor(A,B);if(D&&!Reflect.defineProperty(F,B,D))throw new TypeError(`Cannot redefine property: ${String(B)}`)}}function Pr(F,A){let B=OL(F);return Object.defineProperties(Object.create(B["%Object.prototype%"]),Object.getOwnPropertyDescriptors(A))}var jL=Symbol("wrapper"),uL=Symbol("impl"),c9=Symbol("SameObject caches"),QA=Symbol.for("[webidl2js] constructor registry"),Mr=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function OL(F){if(TL(F,QA))return F[QA];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%"]=Mr}return F[QA]=A,A}function Tr(F,A,B){if(!F[c9])F[c9]=Object.create(null);if(A in F[c9])return F[c9][A];return F[c9][A]=B(),F[c9][A]}function kL(F){return F?F[jL]:null}function SL(F){return F?F[uL]:null}function jr(F){let A=kL(F);return A?A:F}function ur(F){let A=SL(F);return A?A:F}var Or=Symbol("internal");function kr(F){if(typeof F!=="string")return!1;let A=F>>>0;if(A===4294967295)return!1;let B=`${A}`;if(F!==B)return!1;return!0}var Sr=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function xr(F){try{return Sr.call(F),!0}catch(A){return!1}}function fr([F,A],B){let D;switch(B){case"key":D=F;break;case"value":D=A;break;case"key+value":D=[F,A];break}return{value:D,done:!1}}var _r=Symbol("supports property index"),gr=Symbol("supported property indices"),br=Symbol("supports property name"),yr=Symbol("supported property names"),vr=Symbol("indexed property get"),hr=Symbol("indexed property set new"),mr=Symbol("indexed property set existing"),dr=Symbol("named property get"),cr=Symbol("named property set new"),lr=Symbol("named property set existing"),pr=Symbol("named property delete"),ir=Symbol("async iterator get the next iteration result"),nr=Symbol("async iterator return steps"),sr=Symbol("async iterator initialization steps"),ar=Symbol("async iterator end of iteration");fL.exports=xL={isObject:Ir,hasOwn:TL,define:Nr,newObjectInRealm:Pr,wrapperSymbol:jL,implSymbol:uL,getSameObject:Tr,ctorRegistrySymbol:QA,initCtorRegistry:OL,wrapperForImpl:kL,implForWrapper:SL,tryWrapperForImpl:jr,tryImplForWrapper:ur,iterInternalSymbol:Or,isArrayBuffer:xr,isArrayIndexPropName:kr,supportsPropertyIndex:_r,supportedPropertyIndices:gr,supportsPropertyName:br,supportedPropertyNames:yr,indexedGet:vr,indexedSetNew:hr,indexedSetExisting:mr,namedGet:dr,namedSetNew:cr,namedSetExisting:lr,namedDelete:pr,asyncIteratorNext:ir,asyncIteratorReturn:nr,asyncIteratorInit:sr,asyncIteratorEOI:ar,iteratorResult:fr}});var dL=z((Wz1,mL)=>{var rr=/^xn--/,tr=/[^\0-\x7F]/,or=/[\x2E\u3002\uFF0E\uFF61]/g,er={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},s6=Math.floor,lX=String.fromCharCode;function o3(F){throw new RangeError(er[F])}function Ft(F,A){let B=[],D=F.length;while(D--)B[D]=A(F[D]);return B}function gL(F,A){let B=F.split("@"),D="";if(B.length>1)D=B[0]+"@",F=B[1];F=F.replace(or,".");let J=F.split("."),Z=Ft(J,A).join(".");return D+Z}function bL(F){let A=[],B=0,D=F.length;while(B<D){let J=F.charCodeAt(B++);if(J>=55296&&J<=56319&&B<D){let Z=F.charCodeAt(B++);if((Z&64512)==56320)A.push(((J&1023)<<10)+(Z&1023)+65536);else A.push(J),B--}else A.push(J)}return A}var At=(F)=>String.fromCodePoint(...F),Bt=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},_L=function(F,A){return F+22+75*(F<26)-((A!=0)<<5)},yL=function(F,A,B){let D=0;F=B?s6(F/700):F>>1,F+=s6(F/A);for(;F>455;D+=36)F=s6(F/35);return s6(D+36*F/(F+38))},vL=function(F){let A=[],B=F.length,D=0,J=128,Z=72,X=F.lastIndexOf("-");if(X<0)X=0;for(let Y=0;Y<X;++Y){if(F.charCodeAt(Y)>=128)o3("not-basic");A.push(F.charCodeAt(Y))}for(let Y=X>0?X+1:0;Y<B;){let $=D;for(let E=1,C=36;;C+=36){if(Y>=B)o3("invalid-input");let H=Bt(F.charCodeAt(Y++));if(H>=36)o3("invalid-input");if(H>s6((2147483647-D)/E))o3("overflow");D+=H*E;let q=C<=Z?1:C>=Z+26?26:C-Z;if(H<q)break;let W=36-q;if(E>s6(2147483647/W))o3("overflow");E*=W}let G=A.length+1;if(Z=yL(D-$,G,$==0),s6(D/G)>2147483647-J)o3("overflow");J+=s6(D/G),D%=G,A.splice(D++,0,J)}return String.fromCodePoint(...A)},hL=function(F){let A=[];F=bL(F);let B=F.length,D=128,J=0,Z=72;for(let $ of F)if($<128)A.push(lX($));let X=A.length,Y=X;if(X)A.push("-");while(Y<B){let $=2147483647;for(let E of F)if(E>=D&&E<$)$=E;let G=Y+1;if($-D>s6((2147483647-J)/G))o3("overflow");J+=($-D)*G,D=$;for(let E of F){if(E<D&&++J>2147483647)o3("overflow");if(E===D){let C=J;for(let H=36;;H+=36){let q=H<=Z?1:H>=Z+26?26:H-Z;if(C<q)break;let W=C-q,K=36-q;A.push(lX(_L(q+W%K,0))),C=s6(W/K)}A.push(lX(_L(C,0))),Z=yL(J,G,Y===X),J=0,++Y}}++J,++D}return A.join("")},Dt=function(F){return gL(F,function(A){return rr.test(A)?vL(A.slice(4).toLowerCase()):A})},Jt=function(F){return gL(F,function(A){return tr.test(A)?"xn--"+hL(A):A})},Zt={version:"2.3.1",ucs2:{decode:bL,encode:At},decode:vL,encode:hL,toASCII:Jt,toUnicode:Dt};mL.exports=Zt});var lL=z((Kz1,cL)=>{var Xt=/[\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,Yt=/[\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,$t=/[\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,Gt=/[\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,Et=/[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,Ct=/[\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,Ht=/^[\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,qt=/[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,Wt=/[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,Kt=/[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}]/u,zt=/^[\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,Ut=/[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;cL.exports={combiningMarks:Xt,combiningClassVirama:Yt,validZWNJ:$t,bidiDomain:Gt,bidiS1LTR:Et,bidiS1RTL:Ct,bidiS2:Ht,bidiS3:qt,bidiS4EN:Wt,bidiS4AN:Kt,bidiS5:zt,bidiS6:Ut}});var pL=z((zz1,Qt)=>{Qt.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 nL=z((Lt,iL)=>{Lt.STATUS_MAPPING={mapped:1,valid:2,disallowed:3,disallowed_STD3_valid:4,disallowed_STD3_mapped:5,deviation:6,ignored:7}});var oL=z((Uz1,tL)=>{var pX=dL(),X6=lL(),sL=pL(),{STATUS_MAPPING:X2}=nL();function Rt(F){return/[^\x00-\x7F]/u.test(F)}function aL(F,{useSTD3ASCIIRules:A}){let B=0,D=sL.length-1;while(B<=D){let J=Math.floor((B+D)/2),Z=sL[J],X=Array.isArray(Z[0])?Z[0][0]:Z[0],Y=Array.isArray(Z[0])?Z[0][1]:Z[0];if(X<=F&&Y>=F){if(A&&(Z[1]===X2.disallowed_STD3_valid||Z[1]===X2.disallowed_STD3_mapped))return[X2.disallowed,...Z.slice(2)];else if(Z[1]===X2.disallowed_STD3_valid)return[X2.valid,...Z.slice(2)];else if(Z[1]===X2.disallowed_STD3_mapped)return[X2.mapped,...Z.slice(2)];return Z.slice(1)}else if(X>F)D=J-1;else B=J+1}return null}function wt(F,{useSTD3ASCIIRules:A,processingOption:B}){let D=!1,J="";for(let Z of F){let[X,Y]=aL(Z.codePointAt(0),{useSTD3ASCIIRules:A});switch(X){case X2.disallowed:D=!0,J+=Z;break;case X2.ignored:break;case X2.mapped:J+=Y;break;case X2.deviation:if(B==="transitional")J+=Y;else J+=Z;break;case X2.valid:J+=Z;break}}return{string:J,error:D}}function It(F,{checkHyphens:A,checkBidi:B,checkJoiners:D,processingOption:J,useSTD3ASCIIRules:Z}){if(F.normalize("NFC")!==F)return!1;let X=Array.from(F);if(A){if(X[2]==="-"&&X[3]==="-"||(F.startsWith("-")||F.endsWith("-")))return!1}if(F.includes(".")||X.length>0&&X6.combiningMarks.test(X[0]))return!1;for(let Y of X){let[$]=aL(Y.codePointAt(0),{useSTD3ASCIIRules:Z});if(J==="transitional"&&$!==X2.valid||J==="nontransitional"&&$!==X2.valid&&$!==X2.deviation)return!1}if(D){let Y=0;for(let[$,G]of X.entries())if(G==="\u200C"||G==="\u200D"){if($>0){if(X6.combiningClassVirama.test(X[$-1]))continue;if(G==="\u200C"){let E=X.indexOf("\u200C",$+1),C=E<0?X.slice(Y):X.slice(Y,E);if(X6.validZWNJ.test(C.join(""))){Y=$+1;continue}}}return!1}}if(B&&X.length>0){let Y;if(X6.bidiS1LTR.test(X[0]))Y=!1;else if(X6.bidiS1RTL.test(X[0]))Y=!0;else return!1;if(Y){if(!X6.bidiS2.test(F)||!X6.bidiS3.test(F)||X6.bidiS4EN.test(F)&&X6.bidiS4AN.test(F))return!1}else if(!X6.bidiS5.test(F)||!X6.bidiS6.test(F))return!1}return!0}function Nt(F){let A=F.map((B)=>{if(B.startsWith("xn--"))try{return pX.decode(B.substring(4))}catch(D){return""}return B}).join(".");return X6.bidiDomain.test(A)}function rL(F,A){let{processingOption:B}=A,{string:D,error:J}=wt(F,A);D=D.normalize("NFC");let Z=D.split("."),X=Nt(Z);for(let[Y,$]of Z.entries()){let G=$,E=B;if(G.startsWith("xn--")){try{G=pX.decode(G.substring(4)),Z[Y]=G}catch(H){J=!0;continue}E="nontransitional"}if(J)continue;if(!It(G,{...A,processingOption:E,checkBidi:A.checkBidi&&X}))J=!0}return{string:Z.join("."),error:J}}function Pt(F,{checkHyphens:A=!1,checkBidi:B=!1,checkJoiners:D=!1,useSTD3ASCIIRules:J=!1,processingOption:Z="nontransitional",verifyDNSLength:X=!1}={}){if(Z!=="transitional"&&Z!=="nontransitional")throw new RangeError("processingOption must be either transitional or nontransitional");let Y=rL(F,{processingOption:Z,checkHyphens:A,checkBidi:B,checkJoiners:D,useSTD3ASCIIRules:J}),$=Y.string.split(".");if($=$.map((G)=>{if(Rt(G))try{return`xn--${pX.encode(G)}`}catch(E){Y.error=!0}return G}),X){let G=$.join(".").length;if(G>253||G===0)Y.error=!0;for(let E=0;E<$.length;++E)if($[E].length>63||$[E].length===0){Y.error=!0;break}}if(Y.error)return null;return $.join(".")}function Mt(F,{checkHyphens:A=!1,checkBidi:B=!1,checkJoiners:D=!1,useSTD3ASCIIRules:J=!1,processingOption:Z="nontransitional"}={}){let X=rL(F,{processingOption:Z,checkHyphens:A,checkBidi:B,checkJoiners:D,useSTD3ASCIIRules:J});return{domain:X.string,error:X.error}}tL.exports={toASCII:Pt,toUnicode:Mt}});var nX=z((Qz1,FV)=>{function iX(F){return F>=48&&F<=57}function eL(F){return F>=65&&F<=90||F>=97&&F<=122}function Tt(F){return eL(F)||iX(F)}function jt(F){return iX(F)||F>=65&&F<=70||F>=97&&F<=102}FV.exports={isASCIIDigit:iX,isASCIIAlpha:eL,isASCIIAlphanumeric:Tt,isASCIIHex:jt}});var VA=z((Lz1,AV)=>{var ut=new TextEncoder,Ot=new TextDecoder("utf-8",{ignoreBOM:!0});function kt(F){return ut.encode(F)}function St(F){return Ot.decode(F)}AV.exports={utf8Encode:kt,utf8DecodeWithoutBOM:St}});var RA=z((Vz1,$V)=>{var{isASCIIHex:BV}=nX(),{utf8Encode:DV}=VA();function R1(F){return F.codePointAt(0)}function xt(F){let A=F.toString(16).toUpperCase();if(A.length===1)A=`0${A}`;return`%${A}`}function JV(F){let A=new Uint8Array(F.byteLength),B=0;for(let D=0;D<F.byteLength;++D){let J=F[D];if(J!==37)A[B++]=J;else if(J===37&&(!BV(F[D+1])||!BV(F[D+2])))A[B++]=J;else{let Z=parseInt(String.fromCodePoint(F[D+1],F[D+2]),16);A[B++]=Z,D+=2}}return A.slice(0,B)}function ft(F){let A=DV(F);return JV(A)}function sX(F){return F<=31||F>126}var _t=new Set([R1(" "),R1('"'),R1("<"),R1(">"),R1("`")]);function gt(F){return sX(F)||_t.has(F)}var bt=new Set([R1(" "),R1('"'),R1("#"),R1("<"),R1(">")]);function aX(F){return sX(F)||bt.has(F)}function yt(F){return aX(F)||F===R1("'")}var vt=new Set([R1("?"),R1("`"),R1("{"),R1("}")]);function ZV(F){return aX(F)||vt.has(F)}var ht=new Set([R1("/"),R1(":"),R1(";"),R1("="),R1("@"),R1("["),R1("\\"),R1("]"),R1("^"),R1("|")]);function XV(F){return ZV(F)||ht.has(F)}var mt=new Set([R1("$"),R1("%"),R1("&"),R1("+"),R1(",")]);function dt(F){return XV(F)||mt.has(F)}var ct=new Set([R1("!"),R1("'"),R1("("),R1(")"),R1("~")]);function lt(F){return dt(F)||ct.has(F)}function YV(F,A){let B=DV(F),D="";for(let J of B)if(!A(J))D+=String.fromCharCode(J);else D+=xt(J);return D}function pt(F,A){return YV(String.fromCodePoint(F),A)}function it(F,A,B=!1){let D="";for(let J of F)if(B&&J===" ")D+="+";else D+=YV(J,A);return D}$V.exports={isC0ControlPercentEncode:sX,isFragmentPercentEncode:gt,isQueryPercentEncode:aX,isSpecialQueryPercentEncode:yt,isPathPercentEncode:ZV,isUserinfoPercentEncode:XV,isURLEncodedPercentEncode:lt,percentDecodeString:ft,percentDecodeBytes:JV,utf8PercentEncodeString:it,utf8PercentEncodeCodePoint:pt}});var AY=z((Lo,Y2)=>{var nt=oL(),S0=nX(),{utf8DecodeWithoutBOM:st}=VA(),{percentDecodeString:at,utf8PercentEncodeCodePoint:IA,utf8PercentEncodeString:NA,isC0ControlPercentEncode:qV,isFragmentPercentEncode:rt,isQueryPercentEncode:tt,isSpecialQueryPercentEncode:ot,isPathPercentEncode:et,isUserinfoPercentEncode:oX}=RA();function c(F){return F.codePointAt(0)}var WV={ftp:21,file:null,http:80,https:443,ws:80,wss:443},$1=Symbol("failure");function GV(F){return[...F].length}function EV(F,A){let B=F[A];return isNaN(B)?void 0:String.fromCodePoint(B)}function CV(F){return F==="."||F.toLowerCase()==="%2e"}function Fo(F){return F=F.toLowerCase(),F===".."||F==="%2e."||F===".%2e"||F==="%2e%2e"}function Ao(F,A){return S0.isASCIIAlpha(F)&&(A===c(":")||A===c("|"))}function KV(F){return F.length===2&&S0.isASCIIAlpha(F.codePointAt(0))&&(F[1]===":"||F[1]==="|")}function Bo(F){return F.length===2&&S0.isASCIIAlpha(F.codePointAt(0))&&F[1]===":"}function zV(F){return F.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)!==-1}function Do(F){return zV(F)||F.search(/[\u0000-\u001F]|%|\u007F/u)!==-1}function wA(F){return WV[F]!==void 0}function k0(F){return wA(F.scheme)}function rX(F){return!wA(F.scheme)}function UV(F){return WV[F]}function QV(F){if(F==="")return $1;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 B=/[^0-7]/u;if(A===10)B=/[^0-9]/u;if(A===16)B=/[^0-9A-Fa-f]/u;if(B.test(F))return $1;return parseInt(F,A)}function Jo(F){let A=F.split(".");if(A[A.length-1]===""){if(A.length>1)A.pop()}if(A.length>4)return $1;let B=[];for(let Z of A){let X=QV(Z);if(X===$1)return $1;B.push(X)}for(let Z=0;Z<B.length-1;++Z)if(B[Z]>255)return $1;if(B[B.length-1]>=256**(5-B.length))return $1;let D=B.pop(),J=0;for(let Z of B)D+=Z*256**(3-J),++J;return D}function Zo(F){let A="",B=F;for(let D=1;D<=4;++D){if(A=String(B%256)+A,D!==4)A=`.${A}`;B=Math.floor(B/256)}return A}function Xo(F){let A=[0,0,0,0,0,0,0,0],B=0,D=null,J=0;if(F=Array.from(F,(Z)=>Z.codePointAt(0)),F[J]===c(":")){if(F[J+1]!==c(":"))return $1;J+=2,++B,D=B}while(J<F.length){if(B===8)return $1;if(F[J]===c(":")){if(D!==null)return $1;++J,++B,D=B;continue}let Z=0,X=0;while(X<4&&S0.isASCIIHex(F[J]))Z=Z*16+parseInt(EV(F,J),16),++J,++X;if(F[J]===c(".")){if(X===0)return $1;if(J-=X,B>6)return $1;let Y=0;while(F[J]!==void 0){let $=null;if(Y>0)if(F[J]===c(".")&&Y<4)++J;else return $1;if(!S0.isASCIIDigit(F[J]))return $1;while(S0.isASCIIDigit(F[J])){let G=parseInt(EV(F,J));if($===null)$=G;else if($===0)return $1;else $=$*10+G;if($>255)return $1;++J}if(A[B]=A[B]*256+$,++Y,Y===2||Y===4)++B}if(Y!==4)return $1;break}else if(F[J]===c(":")){if(++J,F[J]===void 0)return $1}else if(F[J]!==void 0)return $1;A[B]=Z,++B}if(D!==null){let Z=B-D;B=7;while(B!==0&&Z>0){let X=A[D+Z-1];A[D+Z-1]=A[B],A[B]=X,--B,--Z}}else if(D===null&&B!==8)return $1;return A}function Yo(F){let A="",B=Eo(F),D=!1;for(let J=0;J<=7;++J){if(D&&F[J]===0)continue;else if(D)D=!1;if(B===J){A+=J===0?"::":":",D=!0;continue}if(A+=F[J].toString(16),J!==7)A+=":"}return A}function tX(F,A=!1){if(F[0]==="["){if(F[F.length-1]!=="]")return $1;return Xo(F.substring(1,F.length-1))}if(A)return Go(F);let B=st(at(F)),D=Co(B);if(D===$1)return $1;if(Do(D))return $1;if($o(D))return Jo(D);return D}function $o(F){let A=F.split(".");if(A[A.length-1]===""){if(A.length===1)return!1;A.pop()}let B=A[A.length-1];if(QV(B)!==$1)return!0;if(/^[0-9]+$/u.test(B))return!0;return!1}function Go(F){if(zV(F))return $1;return NA(F,qV)}function Eo(F){let A=null,B=1,D=null,J=0;for(let Z=0;Z<F.length;++Z)if(F[Z]!==0){if(J>B)A=D,B=J;D=null,J=0}else{if(D===null)D=Z;++J}if(J>B)return D;return A}function eX(F){if(typeof F==="number")return Zo(F);if(F instanceof Array)return`[${Yo(F)}]`;return F}function Co(F,A=!1){let B=nt.toASCII(F,{checkBidi:!0,checkHyphens:!1,checkJoiners:!0,useSTD3ASCIIRules:A,verifyDNSLength:A});if(B===null||B==="")return $1;return B}function Ho(F){return F.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug,"")}function qo(F){return F.replace(/\u0009|\u000A|\u000D/ug,"")}function LV(F){let{path:A}=F;if(A.length===0)return;if(F.scheme==="file"&&A.length===1&&Ko(A[0]))return;A.pop()}function VV(F){return F.username!==""||F.password!==""}function Wo(F){return F.host===null||F.host===""||F.scheme==="file"}function i8(F){return typeof F.path==="string"}function Ko(F){return/^[A-Za-z]:$/u.test(F)}function $0(F,A,B,D,J){if(this.pointer=0,this.input=F,this.base=A||null,this.encodingOverride=B||"utf-8",this.stateOverride=J,this.url=D,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};let X=Ho(this.input);if(X!==this.input)this.parseError=!0;this.input=X}let Z=qo(this.input);if(Z!==this.input)this.parseError=!0;this.input=Z,this.state=J||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=Array.from(this.input,(X)=>X.codePointAt(0));for(;this.pointer<=this.input.length;++this.pointer){let X=this.input[this.pointer],Y=isNaN(X)?void 0:String.fromCodePoint(X),$=this[`parse ${this.state}`](X,Y);if(!$)break;else if($===$1){this.failure=!0;break}}}$0.prototype["parse scheme start"]=function F(A,B){if(S0.isASCIIAlpha(A))this.buffer+=B.toLowerCase(),this.state="scheme";else if(!this.stateOverride)this.state="no scheme",--this.pointer;else return this.parseError=!0,$1;return!0};$0.prototype["parse scheme"]=function F(A,B){if(S0.isASCIIAlphanumeric(A)||A===c("+")||A===c("-")||A===c("."))this.buffer+=B.toLowerCase();else if(A===c(":")){if(this.stateOverride){if(k0(this.url)&&!wA(this.buffer))return!1;if(!k0(this.url)&&wA(this.buffer))return!1;if((VV(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===UV(this.url.scheme))this.url.port=null;return!1}if(this.buffer="",this.url.scheme==="file"){if(this.input[this.pointer+1]!==c("/")||this.input[this.pointer+2]!==c("/"))this.parseError=!0;this.state="file"}else if(k0(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme)this.state="special relative or authority";else if(k0(this.url))this.state="special authority slashes";else if(this.input[this.pointer+1]===c("/"))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,$1;return!0};$0.prototype["parse no scheme"]=function F(A){if(this.base===null||i8(this.base)&&A!==c("#"))return $1;else if(i8(this.base)&&A===c("#"))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};$0.prototype["parse special relative or authority"]=function F(A){if(A===c("/")&&this.input[this.pointer+1]===c("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="relative",--this.pointer;return!0};$0.prototype["parse path or authority"]=function F(A){if(A===c("/"))this.state="authority";else this.state="path",--this.pointer;return!0};$0.prototype["parse relative"]=function F(A){if(this.url.scheme=this.base.scheme,A===c("/"))this.state="relative slash";else if(k0(this.url)&&A===c("\\"))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===c("?"))this.url.query="",this.state="query";else if(A===c("#"))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};$0.prototype["parse relative slash"]=function F(A){if(k0(this.url)&&(A===c("/")||A===c("\\"))){if(A===c("\\"))this.parseError=!0;this.state="special authority ignore slashes"}else if(A===c("/"))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};$0.prototype["parse special authority slashes"]=function F(A){if(A===c("/")&&this.input[this.pointer+1]===c("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="special authority ignore slashes",--this.pointer;return!0};$0.prototype["parse special authority ignore slashes"]=function F(A){if(A!==c("/")&&A!==c("\\"))this.state="authority",--this.pointer;else this.parseError=!0;return!0};$0.prototype["parse authority"]=function F(A,B){if(A===c("@")){if(this.parseError=!0,this.atFlag)this.buffer=`%40${this.buffer}`;this.atFlag=!0;let D=GV(this.buffer);for(let J=0;J<D;++J){let Z=this.buffer.codePointAt(J);if(Z===c(":")&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}let X=IA(Z,oX);if(this.passwordTokenSeenFlag)this.url.password+=X;else this.url.username+=X}this.buffer=""}else if(isNaN(A)||A===c("/")||A===c("?")||A===c("#")||k0(this.url)&&A===c("\\")){if(this.atFlag&&this.buffer==="")return this.parseError=!0,$1;this.pointer-=GV(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=B;return!0};$0.prototype["parse hostname"]=$0.prototype["parse host"]=function F(A,B){if(this.stateOverride&&this.url.scheme==="file")--this.pointer,this.state="file host";else if(A===c(":")&&!this.arrFlag){if(this.buffer==="")return this.parseError=!0,$1;if(this.stateOverride==="hostname")return!1;let D=tX(this.buffer,rX(this.url));if(D===$1)return $1;this.url.host=D,this.buffer="",this.state="port"}else if(isNaN(A)||A===c("/")||A===c("?")||A===c("#")||k0(this.url)&&A===c("\\")){if(--this.pointer,k0(this.url)&&this.buffer==="")return this.parseError=!0,$1;else if(this.stateOverride&&this.buffer===""&&(VV(this.url)||this.url.port!==null))return this.parseError=!0,!1;let D=tX(this.buffer,rX(this.url));if(D===$1)return $1;if(this.url.host=D,this.buffer="",this.state="path start",this.stateOverride)return!1}else{if(A===c("["))this.arrFlag=!0;else if(A===c("]"))this.arrFlag=!1;this.buffer+=B}return!0};$0.prototype["parse port"]=function F(A,B){if(S0.isASCIIDigit(A))this.buffer+=B;else if(isNaN(A)||A===c("/")||A===c("?")||A===c("#")||k0(this.url)&&A===c("\\")||this.stateOverride){if(this.buffer!==""){let D=parseInt(this.buffer);if(D>65535)return this.parseError=!0,$1;this.url.port=D===UV(this.url.scheme)?null:D,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}else return this.parseError=!0,$1;return!0};var zo=new Set([c("/"),c("\\"),c("?"),c("#")]);function RV(F,A){let B=F.length-A;return B>=2&&Ao(F[A],F[A+1])&&(B===2||zo.has(F[A+2]))}$0.prototype["parse file"]=function F(A){if(this.url.scheme="file",this.url.host="",A===c("/")||A===c("\\")){if(A===c("\\"))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===c("?"))this.url.query="",this.state="query";else if(A===c("#"))this.url.fragment="",this.state="fragment";else if(!isNaN(A)){if(this.url.query=null,!RV(this.input,this.pointer))LV(this.url);else this.parseError=!0,this.url.path=[];this.state="path",--this.pointer}}else this.state="path",--this.pointer;return!0};$0.prototype["parse file slash"]=function F(A){if(A===c("/")||A===c("\\")){if(A===c("\\"))this.parseError=!0;this.state="file host"}else{if(this.base!==null&&this.base.scheme==="file"){if(!RV(this.input,this.pointer)&&Bo(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};$0.prototype["parse file host"]=function F(A,B){if(isNaN(A)||A===c("/")||A===c("\\")||A===c("?")||A===c("#"))if(--this.pointer,!this.stateOverride&&KV(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 D=tX(this.buffer,rX(this.url));if(D===$1)return $1;if(D==="localhost")D="";if(this.url.host=D,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=B;return!0};$0.prototype["parse path start"]=function F(A){if(k0(this.url)){if(A===c("\\"))this.parseError=!0;if(this.state="path",A!==c("/")&&A!==c("\\"))--this.pointer}else if(!this.stateOverride&&A===c("?"))this.url.query="",this.state="query";else if(!this.stateOverride&&A===c("#"))this.url.fragment="",this.state="fragment";else if(A!==void 0){if(this.state="path",A!==c("/"))--this.pointer}else if(this.stateOverride&&this.url.host===null)this.url.path.push("");return!0};$0.prototype["parse path"]=function F(A){if(isNaN(A)||A===c("/")||k0(this.url)&&A===c("\\")||!this.stateOverride&&(A===c("?")||A===c("#"))){if(k0(this.url)&&A===c("\\"))this.parseError=!0;if(Fo(this.buffer)){if(LV(this.url),A!==c("/")&&!(k0(this.url)&&A===c("\\")))this.url.path.push("")}else if(CV(this.buffer)&&A!==c("/")&&!(k0(this.url)&&A===c("\\")))this.url.path.push("");else if(!CV(this.buffer)){if(this.url.scheme==="file"&&this.url.path.length===0&&KV(this.buffer))this.buffer=`${this.buffer[0]}:`;this.url.path.push(this.buffer)}if(this.buffer="",A===c("?"))this.url.query="",this.state="query";if(A===c("#"))this.url.fragment="",this.state="fragment"}else{if(A===c("%")&&(!S0.isASCIIHex(this.input[this.pointer+1])||!S0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=IA(A,et)}return!0};$0.prototype["parse opaque path"]=function F(A){if(A===c("?"))this.url.query="",this.state="query";else if(A===c("#"))this.url.fragment="",this.state="fragment";else{if(!isNaN(A)&&A!==c("%"))this.parseError=!0;if(A===c("%")&&(!S0.isASCIIHex(this.input[this.pointer+1])||!S0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;if(!isNaN(A))this.url.path+=IA(A,qV)}return!0};$0.prototype["parse query"]=function F(A,B){if(!k0(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss")this.encodingOverride="utf-8";if(!this.stateOverride&&A===c("#")||isNaN(A)){let D=k0(this.url)?ot:tt;if(this.url.query+=NA(this.buffer,D),this.buffer="",A===c("#"))this.url.fragment="",this.state="fragment"}else if(!isNaN(A)){if(A===c("%")&&(!S0.isASCIIHex(this.input[this.pointer+1])||!S0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=B}return!0};$0.prototype["parse fragment"]=function F(A){if(!isNaN(A)){if(A===c("%")&&(!S0.isASCIIHex(this.input[this.pointer+1])||!S0.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.url.fragment+=IA(A,rt)}return!0};function Uo(F,A){let B=`${F.scheme}:`;if(F.host!==null){if(B+="//",F.username!==""||F.password!==""){if(B+=F.username,F.password!=="")B+=`:${F.password}`;B+="@"}if(B+=eX(F.host),F.port!==null)B+=`:${F.port}`}if(F.host===null&&!i8(F)&&F.path.length>1&&F.path[0]==="")B+="/.";if(B+=FY(F),F.query!==null)B+=`?${F.query}`;if(!A&&F.fragment!==null)B+=`#${F.fragment}`;return B}function Qo(F){let A=`${F.scheme}://`;if(A+=eX(F.host),F.port!==null)A+=`:${F.port}`;return A}function FY(F){if(i8(F))return F.path;let A="";for(let B of F.path)A+=`/${B}`;return A}Lo.serializeURL=Uo;Lo.serializePath=FY;Lo.serializeURLOrigin=function(F){switch(F.scheme){case"blob":{let A=Lo.parseURL(FY(F));if(A===null)return"null";if(A.scheme!=="http"&&A.scheme!=="https")return"null";return Lo.serializeURLOrigin(A)}case"ftp":case"http":case"https":case"ws":case"wss":return Qo({scheme:F.scheme,host:F.host,port:F.port});case"file":return"null";default:return"null"}};Lo.basicURLParse=function(F,A){if(A===void 0)A={};let B=new $0(F,A.baseURL,A.encodingOverride,A.url,A.stateOverride);if(B.failure)return null;return B.url};Lo.setTheUsername=function(F,A){F.username=NA(A,oX)};Lo.setThePassword=function(F,A){F.password=NA(A,oX)};Lo.serializeHost=eX;Lo.cannotHaveAUsernamePasswordPort=Wo;Lo.hasAnOpaquePath=i8;Lo.serializeInteger=function(F){return String(F)};Lo.parseURL=function(F,A){if(A===void 0)A={};return Lo.basicURLParse(F,{baseURL:A.baseURL,encodingOverride:A.encodingOverride})}});var BY=z((Rz1,uV)=>{var{utf8Encode:uo,utf8DecodeWithoutBOM:IV}=VA(),{percentDecodeBytes:NV,utf8PercentEncodeString:PV,isURLEncodedPercentEncode:MV}=RA();function TV(F){return F.codePointAt(0)}function Oo(F){let A=xo(F,TV("&")),B=[];for(let D of A){if(D.length===0)continue;let J,Z,X=D.indexOf(TV("="));if(X>=0)J=D.slice(0,X),Z=D.slice(X+1);else J=D,Z=new Uint8Array(0);J=jV(J,43,32),Z=jV(Z,43,32);let Y=IV(NV(J)),$=IV(NV(Z));B.push([Y,$])}return B}function ko(F){return Oo(uo(F))}function So(F,A=void 0){let B="utf-8";if(A!==void 0)B=A;let D="";for(let[J,Z]of F.entries()){let X=PV(Z[0],MV,!0),Y=Z[1];if(Z.length>2&&Z[2]!==void 0){if(Z[2]==="hidden"&&X==="_charset_")Y=B;else if(Z[2]==="file")Y=Y.name}if(Y=PV(Y,MV,!0),J!==0)D+="&";D+=`${X}=${Y}`}return D}function xo(F,A){let B=[],D=0,J=F.indexOf(A);while(J>=0)B.push(F.slice(D,J)),D=J+1,J=F.indexOf(A,D);if(D!==F.length)B.push(F.slice(D));return B}function jV(F,A,B){let D=F.indexOf(A);while(D>=0)F[D]=B,D=F.indexOf(A,D+1);return F}uV.exports={parseUrlencodedString:ko,serializeUrlencoded:So}});var kV=z((fo)=>{var OV=UA(),PA=LA();fo.convert=(F,A,{context:B="The provided value"}={})=>{if(typeof A!=="function")throw new F.TypeError(B+" is not a function");function D(...J){let Z=PA.tryWrapperForImpl(this),X;for(let Y=0;Y<J.length;Y++)J[Y]=PA.tryWrapperForImpl(J[Y]);return X=Reflect.apply(A,Z,J),X=OV.any(X,{context:B,globals:F}),X}return D.construct=(...J)=>{for(let X=0;X<J.length;X++)J[X]=PA.tryWrapperForImpl(J[X]);let Z=Reflect.construct(A,J);return Z=OV.any(Z,{context:B,globals:F}),Z},D[PA.wrapperSymbol]=A,D.objectReference=A,D}});var SV=z((go)=>{var DY=BY();go.implementation=class F{constructor(A,B,{doNotStripQMark:D=!1}){let J=B[0];if(this._list=[],this._url=null,!D&&typeof J==="string"&&J[0]==="?")J=J.slice(1);if(Array.isArray(J))for(let Z of J){if(Z.length!==2)throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");this._list.push([Z[0],Z[1]])}else if(typeof J==="object"&&Object.getPrototypeOf(J)===null)for(let Z of Object.keys(J)){let X=J[Z];this._list.push([Z,X])}else this._list=DY.parseUrlencodedString(J)}_updateSteps(){if(this._url!==null){let A=DY.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,B){this._list.push([A,B]),this._updateSteps()}delete(A,B){let D=0;while(D<this._list.length)if(this._list[D][0]===A&&(B===void 0||this._list[D][1]===B))this._list.splice(D,1);else D++;this._updateSteps()}get(A){for(let B of this._list)if(B[0]===A)return B[1];return null}getAll(A){let B=[];for(let D of this._list)if(D[0]===A)B.push(D[1]);return B}has(A,B){for(let D of this._list)if(D[0]===A&&(B===void 0||D[1]===B))return!0;return!1}set(A,B){let D=!1,J=0;while(J<this._list.length)if(this._list[J][0]===A)if(D)this._list.splice(J,1);else D=!0,this._list[J][1]=B,J++;else J++;if(!D)this._list.push([A,B]);this._updateSteps()}sort(){this._list.sort((A,B)=>{if(A[0]<B[0])return-1;if(A[0]>B[0])return 1;return 0}),this._updateSteps()}[Symbol.iterator](){return this._list[Symbol.iterator]()}toString(){return DY.serializeUrlencoded(this._list)}}});var ZY=z((ho)=>{var R2=UA(),m1=LA(),yo=kV(),xV=m1.newObjectInRealm,K0=m1.implSymbol,fV=m1.ctorRegistrySymbol;ho.is=(F)=>{return m1.isObject(F)&&m1.hasOwn(F,K0)&&F[K0]instanceof e3.implementation};ho.isImpl=(F)=>{return m1.isObject(F)&&F instanceof e3.implementation};ho.convert=(F,A,{context:B="The provided value"}={})=>{if(ho.is(A))return m1.implForWrapper(A);throw new F.TypeError(`${B} is not of type 'URLSearchParams'.`)};ho.createDefaultIterator=(F,A,B)=>{let J=F[fV]["URLSearchParams Iterator"],Z=Object.create(J);return Object.defineProperty(Z,m1.iterInternalSymbol,{value:{target:A,kind:B,index:0},configurable:!0}),Z};function _V(F,A){let B;if(A!==void 0)B=A.prototype;if(!m1.isObject(B))B=F[fV].URLSearchParams.prototype;return Object.create(B)}ho.create=(F,A,B)=>{let D=_V(F);return ho.setup(D,F,A,B)};ho.createImpl=(F,A,B)=>{let D=ho.create(F,A,B);return m1.implForWrapper(D)};ho._internalSetup=(F,A)=>{};ho.setup=(F,A,B=[],D={})=>{if(D.wrapper=F,ho._internalSetup(F,A),Object.defineProperty(F,K0,{value:new e3.implementation(A,B,D),configurable:!0}),F[K0][m1.wrapperSymbol]=F,e3.init)e3.init(F[K0]);return F};ho.new=(F,A)=>{let B=_V(F,A);if(ho._internalSetup(B,F),Object.defineProperty(B,K0,{value:Object.create(e3.implementation.prototype),configurable:!0}),B[K0][m1.wrapperSymbol]=B,e3.init)e3.init(B[K0]);return B[K0]};var vo=new Set(["Window","Worker"]);ho.install=(F,A)=>{if(!A.some((J)=>vo.has(J)))return;let B=m1.initCtorRegistry(F);class D{constructor(){let J=[];{let Z=arguments[0];if(Z!==void 0)if(m1.isObject(Z))if(Z[Symbol.iterator]!==void 0)if(!m1.isObject(Z))throw new F.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");else{let X=[],Y=Z;for(let $ of Y){if(!m1.isObject($))throw new F.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");else{let G=[],E=$;for(let C of E)C=R2.USVString(C,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:F}),G.push(C);$=G}X.push($)}Z=X}else if(!m1.isObject(Z))throw new F.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");else{let X=Object.create(null);for(let Y of Reflect.ownKeys(Z)){let $=Object.getOwnPropertyDescriptor(Z,Y);if($&&$.enumerable){let G=Y;G=R2.USVString(G,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:F});let E=Z[Y];E=R2.USVString(E,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:F}),X[G]=E}}Z=X}else Z=R2.USVString(Z,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:F});else Z="";J.push(Z)}return ho.setup(Object.create(new.target.prototype),F,J)}append(J,Z){let X=this!==null&&this!==void 0?this:F;if(!ho.is(X))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 Y=[];{let $=arguments[0];$=R2.USVString($,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:F}),Y.push($)}{let $=arguments[1];$=R2.USVString($,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:F}),Y.push($)}return m1.tryWrapperForImpl(X[K0].append(...Y))}delete(J){let Z=this!==null&&this!==void 0?this:F;if(!ho.is(Z))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 X=[];{let Y=arguments[0];Y=R2.USVString(Y,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:F}),X.push(Y)}{let Y=arguments[1];if(Y!==void 0)Y=R2.USVString(Y,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:F});X.push(Y)}return m1.tryWrapperForImpl(Z[K0].delete(...X))}get(J){let Z=this!==null&&this!==void 0?this:F;if(!ho.is(Z))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 X=[];{let Y=arguments[0];Y=R2.USVString(Y,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:F}),X.push(Y)}return Z[K0].get(...X)}getAll(J){let Z=this!==null&&this!==void 0?this:F;if(!ho.is(Z))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 X=[];{let Y=arguments[0];Y=R2.USVString(Y,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:F}),X.push(Y)}return m1.tryWrapperForImpl(Z[K0].getAll(...X))}has(J){let Z=this!==null&&this!==void 0?this:F;if(!ho.is(Z))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 X=[];{let Y=arguments[0];Y=R2.USVString(Y,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:F}),X.push(Y)}{let Y=arguments[1];if(Y!==void 0)Y=R2.USVString(Y,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:F});X.push(Y)}return Z[K0].has(...X)}set(J,Z){let X=this!==null&&this!==void 0?this:F;if(!ho.is(X))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 Y=[];{let $=arguments[0];$=R2.USVString($,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:F}),Y.push($)}{let $=arguments[1];$=R2.USVString($,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:F}),Y.push($)}return m1.tryWrapperForImpl(X[K0].set(...Y))}sort(){let J=this!==null&&this!==void 0?this:F;if(!ho.is(J))throw new F.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return m1.tryWrapperForImpl(J[K0].sort())}toString(){let J=this!==null&&this!==void 0?this:F;if(!ho.is(J))throw new F.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return J[K0].toString()}keys(){if(!ho.is(this))throw new F.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return ho.createDefaultIterator(F,this,"key")}values(){if(!ho.is(this))throw new F.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return ho.createDefaultIterator(F,this,"value")}entries(){if(!ho.is(this))throw new F.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return ho.createDefaultIterator(F,this,"key+value")}forEach(J){if(!ho.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=yo.convert(F,J,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});let Z=arguments[1],X=Array.from(this[K0]),Y=0;while(Y<X.length){let[$,G]=X[Y].map(m1.tryWrapperForImpl);J.call(Z,G,$,this),X=Array.from(this[K0]),Y++}}get size(){let J=this!==null&&this!==void 0?this:F;if(!ho.is(J))throw new F.TypeError("'get size' called on an object that is not a valid instance of URLSearchParams.");return J[K0].size}}Object.defineProperties(D.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:D.prototype.entries,configurable:!0,writable:!0}}),B.URLSearchParams=D,B["URLSearchParams Iterator"]=Object.create(B["%IteratorPrototype%"],{[Symbol.toStringTag]:{configurable:!0,value:"URLSearchParams Iterator"}}),m1.define(B["URLSearchParams Iterator"],{next(){let J=this&&this[m1.iterInternalSymbol];if(!J)throw new F.TypeError("next() called on a value that is not a URLSearchParams iterator object");let{target:Z,kind:X,index:Y}=J,$=Array.from(Z[K0]),G=$.length;if(Y>=G)return xV(F,{value:void 0,done:!0});let E=$[Y];return J.index=Y+1,xV(F,m1.iteratorResult(E.map(m1.tryWrapperForImpl),X))}}),Object.defineProperty(F,"URLSearchParams",{configurable:!0,writable:!0,value:D})};var e3=SV()});var vV=z((so)=>{var _1=AY(),yV=BY(),no=ZY();so.implementation=class F{constructor(A,B){let D=B[0],J=B[1],Z=null;if(J!==void 0){if(Z=_1.basicURLParse(J),Z===null)throw new TypeError(`Invalid base URL: ${J}`)}let X=_1.basicURLParse(D,{baseURL:Z});if(X===null)throw new TypeError(`Invalid URL: ${D}`);let Y=X.query!==null?X.query:"";this._url=X,this._query=no.createImpl(A,[Y],{doNotStripQMark:!0}),this._query._url=this}static canParse(A,B){let D=null;if(B!==void 0){if(D=_1.basicURLParse(B),D===null)return!1}if(_1.basicURLParse(A,{baseURL:D})===null)return!1;return!0}get href(){return _1.serializeURL(this._url)}set href(A){let B=_1.basicURLParse(A);if(B===null)throw new TypeError(`Invalid URL: ${A}`);this._url=B,this._query._list.splice(0);let{query:D}=B;if(D!==null)this._query._list=yV.parseUrlencodedString(D)}get origin(){return _1.serializeURLOrigin(this._url)}get protocol(){return`${this._url.scheme}:`}set protocol(A){_1.basicURLParse(`${A}:`,{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(A){if(_1.cannotHaveAUsernamePasswordPort(this._url))return;_1.setTheUsername(this._url,A)}get password(){return this._url.password}set password(A){if(_1.cannotHaveAUsernamePasswordPort(this._url))return;_1.setThePassword(this._url,A)}get host(){let A=this._url;if(A.host===null)return"";if(A.port===null)return _1.serializeHost(A.host);return`${_1.serializeHost(A.host)}:${_1.serializeInteger(A.port)}`}set host(A){if(_1.hasAnOpaquePath(this._url))return;_1.basicURLParse(A,{url:this._url,stateOverride:"host"})}get hostname(){if(this._url.host===null)return"";return _1.serializeHost(this._url.host)}set hostname(A){if(_1.hasAnOpaquePath(this._url))return;_1.basicURLParse(A,{url:this._url,stateOverride:"hostname"})}get port(){if(this._url.port===null)return"";return _1.serializeInteger(this._url.port)}set port(A){if(_1.cannotHaveAUsernamePasswordPort(this._url))return;if(A==="")this._url.port=null;else _1.basicURLParse(A,{url:this._url,stateOverride:"port"})}get pathname(){return _1.serializePath(this._url)}set pathname(A){if(_1.hasAnOpaquePath(this._url))return;this._url.path=[],_1.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 B=this._url;if(A===""){B.query=null,this._query._list=[],this._potentiallyStripTrailingSpacesFromAnOpaquePath();return}let D=A[0]==="?"?A.substring(1):A;B.query="",_1.basicURLParse(D,{url:B,stateOverride:"query"}),this._query._list=yV.parseUrlencodedString(D)}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 B=A[0]==="#"?A.substring(1):A;this._url.fragment="",_1.basicURLParse(B,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}_potentiallyStripTrailingSpacesFromAnOpaquePath(){if(!_1.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 cV=z((oo)=>{var w2=UA(),c2=LA(),T1=c2.implSymbol,ro=c2.ctorRegistrySymbol;oo.is=(F)=>{return c2.isObject(F)&&c2.hasOwn(F,T1)&&F[T1]instanceof q3.implementation};oo.isImpl=(F)=>{return c2.isObject(F)&&F instanceof q3.implementation};oo.convert=(F,A,{context:B="The provided value"}={})=>{if(oo.is(A))return c2.implForWrapper(A);throw new F.TypeError(`${B} is not of type 'URL'.`)};function hV(F,A){let B;if(A!==void 0)B=A.prototype;if(!c2.isObject(B))B=F[ro].URL.prototype;return Object.create(B)}oo.create=(F,A,B)=>{let D=hV(F);return oo.setup(D,F,A,B)};oo.createImpl=(F,A,B)=>{let D=oo.create(F,A,B);return c2.implForWrapper(D)};oo._internalSetup=(F,A)=>{};oo.setup=(F,A,B=[],D={})=>{if(D.wrapper=F,oo._internalSetup(F,A),Object.defineProperty(F,T1,{value:new q3.implementation(A,B,D),configurable:!0}),F[T1][c2.wrapperSymbol]=F,q3.init)q3.init(F[T1]);return F};oo.new=(F,A)=>{let B=hV(F,A);if(oo._internalSetup(B,F),Object.defineProperty(B,T1,{value:Object.create(q3.implementation.prototype),configurable:!0}),B[T1][c2.wrapperSymbol]=B,q3.init)q3.init(B[T1]);return B[T1]};var to=new Set(["Window","Worker"]);oo.install=(F,A)=>{if(!A.some((J)=>to.has(J)))return;let B=c2.initCtorRegistry(F);class D{constructor(J){if(arguments.length<1)throw new F.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);let Z=[];{let X=arguments[0];X=w2.USVString(X,{context:"Failed to construct 'URL': parameter 1",globals:F}),Z.push(X)}{let X=arguments[1];if(X!==void 0)X=w2.USVString(X,{context:"Failed to construct 'URL': parameter 2",globals:F});Z.push(X)}return oo.setup(Object.create(new.target.prototype),F,Z)}toJSON(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return J[T1].toJSON()}get href(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get href' called on an object that is not a valid instance of URL.");return J[T1].href}set href(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set href' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:F}),Z[T1].href=J}toString(){let J=this;if(!oo.is(J))throw new F.TypeError("'toString' called on an object that is not a valid instance of URL.");return J[T1].href}get origin(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get origin' called on an object that is not a valid instance of URL.");return J[T1].origin}get protocol(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return J[T1].protocol}set protocol(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set protocol' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:F}),Z[T1].protocol=J}get username(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get username' called on an object that is not a valid instance of URL.");return J[T1].username}set username(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set username' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:F}),Z[T1].username=J}get password(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get password' called on an object that is not a valid instance of URL.");return J[T1].password}set password(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set password' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:F}),Z[T1].password=J}get host(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get host' called on an object that is not a valid instance of URL.");return J[T1].host}set host(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set host' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:F}),Z[T1].host=J}get hostname(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return J[T1].hostname}set hostname(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set hostname' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:F}),Z[T1].hostname=J}get port(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get port' called on an object that is not a valid instance of URL.");return J[T1].port}set port(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set port' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:F}),Z[T1].port=J}get pathname(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return J[T1].pathname}set pathname(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set pathname' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:F}),Z[T1].pathname=J}get search(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get search' called on an object that is not a valid instance of URL.");return J[T1].search}set search(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set search' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:F}),Z[T1].search=J}get searchParams(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return c2.getSameObject(this,"searchParams",()=>{return c2.tryWrapperForImpl(J[T1].searchParams)})}get hash(){let J=this!==null&&this!==void 0?this:F;if(!oo.is(J))throw new F.TypeError("'get hash' called on an object that is not a valid instance of URL.");return J[T1].hash}set hash(J){let Z=this!==null&&this!==void 0?this:F;if(!oo.is(Z))throw new F.TypeError("'set hash' called on an object that is not a valid instance of URL.");J=w2.USVString(J,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:F}),Z[T1].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 Z=[];{let X=arguments[0];X=w2.USVString(X,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:F}),Z.push(X)}{let X=arguments[1];if(X!==void 0)X=w2.USVString(X,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:F});Z.push(X)}return q3.implementation.canParse(...Z)}}if(Object.defineProperties(D.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(D,{canParse:{enumerable:!0}}),B.URL=D,Object.defineProperty(F,"URL",{configurable:!0,writable:!0,value:D}),A.includes("Window"))Object.defineProperty(F,"webkitURL",{configurable:!0,writable:!0,value:D})};var q3=vV()});var lV=z((Xe)=>{var Je=cV(),Ze=ZY();Xe.URL=Je;Xe.URLSearchParams=Ze});var iV=z((Ce)=>{var{URL:Ge,URLSearchParams:Ee}=lV(),M6=AY(),pV=RA(),TA={Array,Object,Promise,String,TypeError};Ge.install(TA,["Window"]);Ee.install(TA,["Window"]);Ce.URL=TA.URL;Ce.URLSearchParams=TA.URLSearchParams;Ce.parseURL=M6.parseURL;Ce.basicURLParse=M6.basicURLParse;Ce.serializeURL=M6.serializeURL;Ce.serializePath=M6.serializePath;Ce.serializeHost=M6.serializeHost;Ce.serializeInteger=M6.serializeInteger;Ce.serializeURLOrigin=M6.serializeURLOrigin;Ce.setTheUsername=M6.setTheUsername;Ce.setThePassword=M6.setThePassword;Ce.cannotHaveAUsernamePasswordPort=M6.cannotHaveAUsernamePasswordPort;Ce.hasAnOpaquePath=M6.hasAnOpaquePath;Ce.percentDecodeString=pV.percentDecodeString;Ce.percentDecodeBytes=pV.percentDecodeBytes});var sV=z((Y6)=>{var Te=Y6&&Y6.__createBinding||(Object.create?function(F,A,B,D){if(D===void 0)D=B;var J=Object.getOwnPropertyDescriptor(A,B);if(!J||("get"in J?!A.__esModule:J.writable||J.configurable))J={enumerable:!0,get:function(){return A[B]}};Object.defineProperty(F,D,J)}:function(F,A,B,D){if(D===void 0)D=B;F[D]=A[B]}),je=Y6&&Y6.__setModuleDefault||(Object.create?function(F,A){Object.defineProperty(F,"default",{enumerable:!0,value:A})}:function(F,A){F.default=A}),ue=Y6&&Y6.__importStar||function(F){if(F&&F.__esModule)return F;var A={};if(F!=null){for(var B in F)if(B!=="default"&&Object.prototype.hasOwnProperty.call(F,B))Te(A,F,B)}return je(A,F),A};Object.defineProperty(Y6,"__esModule",{value:!0});Y6.redactConnectionString=Y6.redactValidConnectionString=void 0;var nV=ue(YY());function Oe(F,A){var B,D;let J=F.clone(),Z=(B=A===null||A===void 0?void 0:A.replacementString)!==null&&B!==void 0?B:"_credentials_",X=(D=A===null||A===void 0?void 0:A.redactUsernames)!==null&&D!==void 0?D:!0;if((J.username||J.password)&&X)J.username=Z,J.password="";else if(J.password)J.password=Z;if(J.searchParams.has("authMechanismProperties")){let Y=new nV.CommaAndColonSeparatedRecord(J.searchParams.get("authMechanismProperties"));if(Y.get("AWS_SESSION_TOKEN"))Y.set("AWS_SESSION_TOKEN",Z),J.searchParams.set("authMechanismProperties",Y.toString())}if(J.searchParams.has("tlsCertificateKeyFilePassword"))J.searchParams.set("tlsCertificateKeyFilePassword",Z);if(J.searchParams.has("proxyUsername")&&X)J.searchParams.set("proxyUsername",Z);if(J.searchParams.has("proxyPassword"))J.searchParams.set("proxyPassword",Z);return J}Y6.redactValidConnectionString=Oe;function ke(F,A){var B,D;let J=(B=A===null||A===void 0?void 0:A.replacementString)!==null&&B!==void 0?B:"<credentials>",Z=(D=A===null||A===void 0?void 0:A.redactUsernames)!==null&&D!==void 0?D:!0,X;try{X=new nV.default(F)}catch(G){}if(X)return A={...A,replacementString:"___credentials___"},X.redact(A).toString().replace(/___credentials___/g,J);let Y=J,$=[(G)=>G.replace(Z?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${Y}$3`),(G)=>G.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${Y}`),(G)=>G.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${Y}`),(G)=>Z?G.replace(/(proxyUsername=)([^&]+)/gi,`$1${Y}`):G,(G)=>G.replace(/(proxyPassword=)([^&]+)/gi,`$1${Y}`)];for(let G of $)F=G(F);return F}Y6.redactConnectionString=ke});var YY=z((GY)=>{Object.defineProperty(GY,"__esModule",{value:!0});GY.CommaAndColonSeparatedRecord=GY.ConnectionString=GY.redactConnectionString=void 0;var Se=iV(),aV=sV();Object.defineProperty(GY,"redactConnectionString",{enumerable:!0,get:function(){return aV.redactConnectionString}});var n8="__this_is_a_placeholder__";function xe(F){return F.startsWith("mongodb://")||F.startsWith("mongodb+srv://")}var fe=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class $Y 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 _e(F){return class A extends F{append(B,D){return super.append(this._normalizeKey(B),D)}delete(B){return super.delete(this._normalizeKey(B))}get(B){return super.get(this._normalizeKey(B))}getAll(B){return super.getAll(this._normalizeKey(B))}has(B){return super.has(this._normalizeKey(B))}set(B,D){return super.set(this._normalizeKey(B),D)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(B){return $Y.prototype._normalizeKey.call(this,B)}}}class rV extends Se.URL{}class a6 extends Error{get name(){return"MongoParseError"}}class s8 extends rV{constructor(F,A={}){var B;let{looseValidation:D}=A;if(!D&&!xe(F))throw new a6('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');let J=F.match(fe);if(!J)throw new a6(`Invalid connection string "${F}"`);let{protocol:Z,username:X,password:Y,hosts:$,rest:G}=(B=J.groups)!==null&&B!==void 0?B:{};if(!D){if(!Z||!$)throw new a6(`Protocol and host list are required in "${F}"`);try{decodeURIComponent(X!==null&&X!==void 0?X:""),decodeURIComponent(Y!==null&&Y!==void 0?Y:"")}catch(H){throw new a6(H.message)}let C=/[:/?#[\]@]/gi;if(X===null||X===void 0?void 0:X.match(C))throw new a6(`Username contains unescaped characters ${X}`);if(!X||!Y){let H=F.replace(`${Z}://`,"");if(H.startsWith("@")||H.startsWith(":"))throw new a6("URI contained empty userinfo section")}if(Y===null||Y===void 0?void 0:Y.match(C))throw new a6("Password contains unescaped characters")}let E="";if(typeof X==="string")E+=X;if(typeof Y==="string")E+=`:${Y}`;if(E)E+="@";try{super(`${Z.toLowerCase()}://${E}${n8}${G}`)}catch(C){if(D)new s8(F,{...A,looseValidation:!1});if(typeof C.message==="string")C.message=C.message.replace(n8,$);throw C}if(this._hosts=$.split(","),!D){if(this.isSRV&&this.hosts.length!==1)throw new a6("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((C)=>C.includes(":")))throw new a6("mongodb+srv URI cannot have port number")}if(!this.pathname)this.pathname="/";Object.setPrototypeOf(this.searchParams,_e(this.searchParams.constructor).prototype)}get host(){return n8}set host(F){throw new Error("No single host for connection string")}get hostname(){return n8}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(n8,this.hosts.join(","))}clone(){return new s8(this.toString(),{looseValidation:!0})}redact(F){return aV.redactValidConnectionString(this,F)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){let{href:F,origin:A,protocol:B,username:D,password:J,hosts:Z,pathname:X,search:Y,searchParams:$,hash:G}=this;return{href:F,origin:A,protocol:B,username:D,password:J,hosts:Z,pathname:X,search:Y,searchParams:$,hash:G}}}GY.ConnectionString=s8;class tV extends $Y{constructor(F){super();for(let A of(F!==null&&F!==void 0?F:"").split(",")){if(!A)continue;let B=A.indexOf(":");if(B===-1)this.set(A,"");else this.set(A.slice(0,B),A.slice(B+1))}}toString(){return[...this].map((F)=>F.join(":")).join(",")}}GY.CommaAndColonSeparatedRecord=tV;GY.default=s8});var eV=z((Sz1,ye)=>{ye.exports={name:"mongodb",version:"6.10.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.5",bson:"^6.7.0","mongodb-connection-string-url":"^3.0.0"},peerDependencies:{"@aws-sdk/credential-providers":"^3.188.0","@mongodb-js/zstd":"^1.1.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.47.5","@microsoft/tsdoc-config":"^0.17.0","@mongodb-js/zstd":"^1.2.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.7","@types/node":"^22.4.1","@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.2.0","@typescript-eslint/parser":"^8.2.0",chai:"^4.4.1","chai-subset":"^1.6.0",chalk:"^4.1.2",eslint:"^9.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-mocha":"^10.4.1","eslint-plugin-prettier":"^5.2.1","eslint-plugin-simple-import-sort":"^12.1.1","eslint-plugin-tsdoc":"^0.3.0","eslint-plugin-unused-imports":"^4.0.0",express:"^4.19.2","gcp-metadata":"^5.3.0","js-yaml":"^4.1.0",mocha:"^10.4.0","mocha-sinon":"^2.1.2","mongodb-client-encryption":"^6.1.0","mongodb-legacy":"^6.1.0",nyc:"^15.1.0",prettier:"^3.3.3",semver:"^7.6.3",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.1",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":"node test/benchmarks/driverBench","check:coverage":"nyc npm run test:all","check:integration-coverage":"nyc npm run check:test","check:lambda":"mocha --config test/mocha_lambda.json test/integration/node-specific/examples/handler.test.js","check:lambda:aws":"mocha --config test/mocha_lambda.json 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.json test/manual/search-index-management.prose.test.ts","check:test":"mocha --config test/mocha_mongodb.json 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.json test/manual/atlas_connectivity.test.ts","check:resource-management":"mocha --config test/manual/mocharc.json test/manual/resource_management.test.ts","check:drivers-atlas-testing":"mocha --config test/mocha_mongodb.json test/atlas/drivers_atlas_testing.test.ts","check:adl":"mocha --config test/mocha_mongodb.json test/manual/atlas-data-lake-testing","check:aws":"nyc mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_aws.test.ts","check:oidc-auth":"mocha --config test/mocha_mongodb.json test/integration/auth/auth.spec.test.ts","check:oidc-test":"mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc.prose.test.ts","check:oidc-azure":"mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_azure.prose.05.test.ts","check:oidc-gcp":"mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts","check:ocsp":"mocha --config test/manual/mocharc.json test/manual/ocsp_support.test.js","check:kerberos":"nyc mocha --config test/manual/mocharc.json test/manual/kerberos.test.ts","check:tls":"mocha --config test/manual/mocharc.json test/manual/tls_support.test.ts","check:ldap":"nyc mocha --config test/manual/mocharc.json test/manual/ldap.test.js","check:socks5":"mocha --config test/manual/mocharc.json test/manual/socks5.test.ts","check:csfle":"mocha --config test/mocha_mongodb.json 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 EY=z((JR)=>{Object.defineProperty(JR,"__esModule",{value:!0});JR.LimitedSizeDocument=void 0;JR.makeClientMetadata=he;JR.addContainerMetadata=de;JR.getFAASEnv=DR;var a8=import.meta.require("os"),r8=import.meta.require("process"),l9=w1(),FR=p(),ve=a(),AR=eV().version;class jA{constructor(F){this.maxSize=F,this.document=new Map,this.documentSize=5}ifItFitsItSits(F,A){let B=l9.BSON.serialize(new Map().set(F,A)).byteLength-5;if(B+this.documentSize>this.maxSize)return!1;return this.documentSize+=B,this.document.set(F,A),!0}toObject(){return l9.BSON.deserialize(l9.BSON.serialize(this.document),{promoteLongs:!1,promoteBuffers:!1,promoteValues:!1,useBigInt64:!1})}}JR.LimitedSizeDocument=jA;function he(F){let A=new jA(512),{appName:B=""}=F;if(B.length>0){let E=Buffer.byteLength(B,"utf8")<=128?F.appName:Buffer.from(B,"utf8").subarray(0,128).toString("utf8");A.ifItFitsItSits("application",{name:E})}let{name:D="",version:J="",platform:Z=""}=F.driverInfo,X={name:D.length>0?`nodejs|${D}`:"nodejs",version:J.length>0?`${AR}|${J}`:AR};if(!A.ifItFitsItSits("driver",X))throw new FR.MongoInvalidArgumentError("Unable to include driverInfo name and version, metadata cannot exceed 512 bytes");let Y=ce();if(Z.length>0)Y=`${Y}|${Z}`;if(!A.ifItFitsItSits("platform",Y))throw new FR.MongoInvalidArgumentError("Unable to include driverInfo platform, metadata cannot exceed 512 bytes");let $=new Map().set("name",r8.platform).set("architecture",r8.arch).set("version",a8.release()).set("type",a8.type());if(!A.ifItFitsItSits("os",$))for(let E of $.keys()){if($.delete(E),$.size===0)break;if(A.ifItFitsItSits("os",$))break}let G=DR();if(G!=null){if(!A.ifItFitsItSits("env",G))for(let E of G.keys()){if(G.delete(E),G.size===0)break;if(A.ifItFitsItSits("env",G))break}}return A.toObject()}var BR;async function me(){let F={};BR??=ve.fileIsAccessible("/.dockerenv");let A=await BR,{KUBERNETES_SERVICE_HOST:B=""}=r8.env,D=B.length>0?!0:!1;if(A)F.runtime="docker";if(D)F.orchestrator="kubernetes";return F}async function de(F){let A=await me();if(Object.keys(A).length===0)return F;let B=new jA(512),D={...F?.env,container:A};for(let[J,Z]of Object.entries(F))if(J!=="env")B.ifItFitsItSits(J,Z);else if(!B.ifItFitsItSits("env",D))B.ifItFitsItSits("env",Z);if(!("env"in F))B.ifItFitsItSits("env",D);return B.toObject()}function DR(){let{AWS_EXECUTION_ENV:F="",AWS_LAMBDA_RUNTIME_API:A="",FUNCTIONS_WORKER_RUNTIME:B="",K_SERVICE:D="",FUNCTION_NAME:J="",VERCEL:Z="",AWS_LAMBDA_FUNCTION_MEMORY_SIZE:X="",AWS_REGION:Y="",FUNCTION_MEMORY_MB:$="",FUNCTION_REGION:G="",FUNCTION_TIMEOUT_SEC:E="",VERCEL_REGION:C=""}=r8.env,H=F.startsWith("AWS_Lambda_")||A.length>0,q=B.length>0,W=D.length>0||J.length>0,K=Z.length>0,U=new Map;if(K&&!(q||W)){if(C.length>0)U.set("region",C);return U.set("name","vercel"),U}if(H&&!(q||W||K)){if(Y.length>0)U.set("region",Y);if(X.length>0&&Number.isInteger(+X))U.set("memory_mb",new l9.Int32(X));return U.set("name","aws.lambda"),U}if(q&&!(W||H||K))return U.set("name","azure.func"),U;if(W&&!(q||H||K)){if(G.length>0)U.set("region",G);if($.length>0&&Number.isInteger(+$))U.set("memory_mb",new l9.Int32($));if(E.length>0&&Number.isInteger(+E))U.set("timeout_sec",new l9.Int32(E));return U.set("name","gcp.func"),U}return null}function ce(){if("Deno"in globalThis)return`Deno v${typeof Deno?.version?.deno==="string"?Deno?.version?.deno:"0.0.0-unknown"}, ${a8.endianness()}`;if("Bun"in globalThis)return`Bun v${typeof Bun?.version==="string"?Bun?.version:"0.0.0-unknown"}, ${a8.endianness()}`;return`Node.js ${r8.version}, ${a8.endianness()}`}});var o8=z((qR)=>{Object.defineProperty(qR,"__esModule",{value:!0});qR.OpCompressedRequest=qR.OpMsgResponse=qR.OpMsgRequest=qR.DocumentSequence=qR.OpReply=qR.OpQueryRequest=void 0;var n9=w1(),t8=p(),CY=e8(),p9=b4(),i9=0,ne=2,se=4,ae=8,re=16,te=32,oe=64,ee=128,F11=1,A11=2,B11=4,D11=8,J11=n9.BSON.onDemand.ByteUtils.encodeUTF8Into;class qY{constructor(F,A,B){this.databaseName=F,this.query=A,this.moreToCome=!1;let D=`${F}.$cmd`;if(typeof F!=="string")throw new t8.MongoRuntimeError("Database name must be a string for a query");if(A==null)throw new t8.MongoRuntimeError("A query document must be specified for query");if(D.indexOf("\x00")!==-1)throw new t8.MongoRuntimeError("Namespace cannot contain a null character");this.ns=D,this.numberToSkip=B.numberToSkip||0,this.numberToReturn=B.numberToReturn||0,this.returnFieldSelector=B.returnFieldSelector||void 0,this.requestId=B.requestId??qY.getRequestId(),this.pre32Limit=B.pre32Limit,this.serializeFunctions=typeof B.serializeFunctions==="boolean"?B.serializeFunctions:!1,this.ignoreUndefined=typeof B.ignoreUndefined==="boolean"?B.ignoreUndefined:!1,this.maxBsonSize=B.maxBsonSize||16777216,this.checkKeys=typeof B.checkKeys==="boolean"?B.checkKeys:!1,this.batchSize=this.numberToReturn,this.tailable=!1,this.secondaryOk=typeof B.secondaryOk==="boolean"?B.secondaryOk:!1,this.oplogReplay=!1,this.noCursorTimeout=!1,this.awaitData=!1,this.exhaust=!1,this.partial=!1}incRequestId(){this.requestId=i9++}nextRequestId(){return i9+1}static getRequestId(){return++i9}toBin(){let F=[],A=null,B=0;if(this.tailable)B|=ne;if(this.secondaryOk)B|=se;if(this.oplogReplay)B|=ae;if(this.noCursorTimeout)B|=re;if(this.awaitData)B|=te;if(this.exhaust)B|=oe;if(this.partial)B|=ee;if(this.batchSize!==this.numberToReturn)this.numberToReturn=this.batchSize;let D=Buffer.alloc(20+Buffer.byteLength(this.ns)+1+4+4);F.push(D);let J=n9.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=n9.serialize(this.returnFieldSelector,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined}),F.push(A);let Z=D.length+J.length+(A?A.length:0),X=4;return D[3]=Z>>24&255,D[2]=Z>>16&255,D[1]=Z>>8&255,D[0]=Z&255,D[X+3]=this.requestId>>24&255,D[X+2]=this.requestId>>16&255,D[X+1]=this.requestId>>8&255,D[X]=this.requestId&255,X=X+4,D[X+3]=0,D[X+2]=0,D[X+1]=0,D[X]=0,X=X+4,D[X+3]=p9.OP_QUERY>>24&255,D[X+2]=p9.OP_QUERY>>16&255,D[X+1]=p9.OP_QUERY>>8&255,D[X]=p9.OP_QUERY&255,X=X+4,D[X+3]=B>>24&255,D[X+2]=B>>16&255,D[X+1]=B>>8&255,D[X]=B&255,X=X+4,X=X+D.write(this.ns,X,"utf8")+1,D[X-1]=0,D[X+3]=this.numberToSkip>>24&255,D[X+2]=this.numberToSkip>>16&255,D[X+1]=this.numberToSkip>>8&255,D[X]=this.numberToSkip&255,X=X+4,D[X+3]=this.numberToReturn>>24&255,D[X+2]=this.numberToReturn>>16&255,D[X+1]=this.numberToReturn>>8&255,D[X]=this.numberToReturn&255,X=X+4,F}}qR.OpQueryRequest=qY;class YR{constructor(F,A,B,D){this.index=0,this.sections=[],this.moreToCome=!1,this.parsed=!1,this.raw=F,this.data=B,this.opts=D??{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 n9.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&F11)!==0,this.queryFailure=(this.responseFlags&A11)!==0,this.shardConfigStale=(this.responseFlags&B11)!==0,this.awaitCapable=(this.responseFlags&D11)!==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,B=this.data.subarray(this.index,this.index+A);this.sections.push(B),this.index=this.index+A}return this.parsed=!0,this.sections[0]}}qR.OpReply=YR;var $R=1,GR=2,ER=65536;class WY{constructor(F,A){this.field=F,this.documents=[],this.chunks=[],this.serializedDocumentsLength=0;let B=Buffer.allocUnsafe(5+this.field.length+1);if(B[0]=1,J11(B,`${this.field}\x00`,5),this.chunks.push(B),this.header=B,A)for(let D of A)this.push(D,n9.serialize(D))}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)}}qR.DocumentSequence=WY;class uA{constructor(F,A,B){if(this.databaseName=F,this.command=A,this.options=B,A==null)throw new t8.MongoInvalidArgumentError("Query document must be specified for query");this.command.$db=F,this.options=B??{},this.requestId=B.requestId?B.requestId:uA.getRequestId(),this.serializeFunctions=typeof B.serializeFunctions==="boolean"?B.serializeFunctions:!1,this.ignoreUndefined=typeof B.ignoreUndefined==="boolean"?B.ignoreUndefined:!1,this.checkKeys=typeof B.checkKeys==="boolean"?B.checkKeys:!1,this.maxBsonSize=B.maxBsonSize||16777216,this.checksumPresent=!1,this.moreToCome=B.moreToCome??A.writeConcern?.w===0,this.exhaustAllowed=typeof B.exhaustAllowed==="boolean"?B.exhaustAllowed:!1}toBin(){let F=[],A=0;if(this.checksumPresent)A|=$R;if(this.moreToCome)A|=GR;if(this.exhaustAllowed)A|=ER;let B=Buffer.alloc(20);F.push(B);let D=B.length,J=this.command;return D+=this.makeSections(F,J),B.writeInt32LE(D,0),B.writeInt32LE(this.requestId,4),B.writeInt32LE(0,8),B.writeInt32LE(p9.OP_MSG,12),B.writeUInt32LE(A,16),F}makeSections(F,A){let B=this.extractDocumentSequences(A),D=Buffer.allocUnsafe(1);D[0]=0;let J=this.serializeBson(A);return F.push(D),F.push(J),F.push(B),D.length+J.length+B.length}extractDocumentSequences(F){let A=[];for(let[B,D]of Object.entries(F))if(D instanceof WY)A.push(D.toBin()),delete F[B];if(A.length>0)return Buffer.concat(A);return Buffer.alloc(0)}serializeBson(F){return n9.serialize(F,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined})}static getRequestId(){return i9=i9+1&2147483647,i9}}qR.OpMsgRequest=uA;class CR{constructor(F,A,B,D){this.index=0,this.sections=[],this.parsed=!1,this.raw=F,this.data=B,this.opts=D??{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=B.readInt32LE(0),this.checksumPresent=(this.responseFlags&$R)!==0,this.moreToCome=(this.responseFlags&GR)!==0,this.exhaustAllowed=(this.responseFlags&ER)!==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),B=this.data.subarray(this.index,this.index+A);this.sections.push(B),this.index+=A}else if(F===1)throw new t8.MongoRuntimeError("OP_MSG Payload Type 1 detected unsupported protocol")}return this.parsed=!0,this.sections[0]}}qR.OpMsgResponse=CR;var HY=16,XR=9;class HR{constructor(F,A){this.command=F,this.options=A}static canCompress(F){let A=F instanceof uA?F.command:F.query,B=Object.keys(A)[0];return!CY.uncompressibleCommands.has(B)}async toBin(){let F=Buffer.concat(this.command.toBin()),A=F.slice(HY),B=F.readInt32LE(12),D=await CY.compress(this.options,A),J=Buffer.alloc(HY);J.writeInt32LE(HY+XR+D.length,0),J.writeInt32LE(this.command.requestId,4),J.writeInt32LE(0,8),J.writeInt32LE(p9.OP_COMPRESSED,12);let Z=Buffer.alloc(XR);return Z.writeInt32LE(B,0),Z.writeInt32LE(A.length,4),Z.writeUInt8(CY.Compressor[this.options.agreedCompressor],8),[J,Z,D]}}qR.OpCompressedRequest=HR});var e8=z((VR)=>{Object.defineProperty(VR,"__esModule",{value:!0});VR.uncompressibleCommands=VR.Compressor=void 0;VR.compress=W11;VR.decompress=QR;VR.compressCommand=K11;VR.decompressResponse=z11;var KR=import.meta.require("util"),OA=import.meta.require("zlib"),E11=W0(),zR=P6(),zY=p(),s9=o8(),KY=b4();VR.Compressor=Object.freeze({none:0,snappy:1,zlib:2,zstd:3});VR.uncompressibleCommands=new Set([E11.LEGACY_HELLO_COMMAND,"saslStart","saslContinue","getnonce","authenticate","createUser","updateUser","copydbSaslStart","copydbgetnonce","copydb"]);var C11=3,H11=KR.promisify(OA.inflate.bind(OA)),q11=KR.promisify(OA.deflate.bind(OA)),A4,c4=null;function UR(){if(c4==null){let F=zR.getSnappy();if("kModuleError"in F)throw F.kModuleError;c4=F}return c4}async function W11(F,A){let B={};switch(F.agreedCompressor){case"snappy":return c4??=UR(),await c4.compress(A);case"zstd":{if(LR(),"kModuleError"in A4)throw A4.kModuleError;return await A4.compress(A,C11)}case"zlib":{if(F.zlibCompressionLevel)B.level=F.zlibCompressionLevel;return await q11(A,B)}default:throw new zY.MongoInvalidArgumentError(`Unknown compressor ${F.agreedCompressor} failed to compress`)}}async function QR(F,A){if(F!==VR.Compressor.snappy&&F!==VR.Compressor.zstd&&F!==VR.Compressor.zlib&&F!==VR.Compressor.none)throw new zY.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${F})`);switch(F){case VR.Compressor.snappy:return c4??=UR(),await c4.uncompress(A,{asBuffer:!0});case VR.Compressor.zstd:{if(LR(),"kModuleError"in A4)throw A4.kModuleError;return await A4.decompress(A)}case VR.Compressor.zlib:return await H11(A);default:return A}}function LR(){if(!A4)A4=zR.getZstdLibrary()}var F5=16;async function K11(F,A){let D=await(A.agreedCompressor==="none"||!s9.OpCompressedRequest.canCompress(F)?F:new s9.OpCompressedRequest(F,{agreedCompressor:A.agreedCompressor??"none",zlibCompressionLevel:A.zlibCompressionLevel??0})).toBin();return Buffer.concat(D)}async function z11(F){let A={length:F.readInt32LE(0),requestId:F.readInt32LE(4),responseTo:F.readInt32LE(8),opCode:F.readInt32LE(12)};if(A.opCode!==KY.OP_COMPRESSED){let Y=A.opCode===KY.OP_MSG?s9.OpMsgResponse:s9.OpReply,$=F.subarray(F5);return new Y(F,A,$)}let B={...A,fromCompressed:!0,opCode:F.readInt32LE(F5),length:F.readInt32LE(F5+4)},D=F[F5+8],J=F.slice(F5+9),Z=B.opCode===KY.OP_MSG?s9.OpMsgResponse:s9.OpReply,X=await QR(D,J);if(X.length!==B.length)throw new zY.MongoDecompressionError("Message body and message header must be the same length");return new Z(F,B,X)}});var QY=z((wR)=>{Object.defineProperty(wR,"__esModule",{value:!0});wR.hmacSha256Hook=wR.hmacSha512Hook=wR.aes256CtrDecryptHook=wR.aes256CtrEncryptHook=wR.aes256CbcDecryptHook=wR.aes256CbcEncryptHook=void 0;wR.makeAES256Hook=B5;wR.randomHook=R11;wR.sha256Hook=w11;wR.makeHmacHook=UY;wR.signRsaSha256Hook=I11;var A5=import.meta.require("crypto");function B5(F,A){return function(B,D,J,Z){let X;try{let Y=A5[F](A,B,D);Y.setAutoPadding(!1),X=Y.update(J);let $=Y.final();if($.length>0)X=Buffer.concat([X,$])}catch(Y){return Y}return X.copy(Z),X.length}}function R11(F,A){try{A5.randomFillSync(F,0,A)}catch(B){return B}return A}function w11(F,A){let B;try{B=A5.createHash("sha256").update(F).digest()}catch(D){return D}return B.copy(A),B.length}function UY(F){return(A,B,D)=>{let J;try{J=A5.createHmac(F,A).update(B).digest()}catch(Z){return Z}return J.copy(D),J.length}}function I11(F,A,B){let D;try{let J=A5.createSign("sha256WithRSAEncryption"),Z=Buffer.from(`-----BEGIN PRIVATE KEY-----
|
|
27
|
+
${F.toString("base64")}
|
|
28
|
+
-----END PRIVATE KEY-----
|
|
29
|
+
`);D=J.update(A).end().sign(Z)}catch(J){return J}return D.copy(B),D.length}wR.aes256CbcEncryptHook=B5("createCipheriv","aes-256-cbc");wR.aes256CbcDecryptHook=B5("createDecipheriv","aes-256-cbc");wR.aes256CtrEncryptHook=B5("createCipheriv","aes-256-ctr");wR.aes256CtrDecryptHook=B5("createDecipheriv","aes-256-ctr");wR.hmacSha512Hook=UY("sha512");wR.hmacSha256Hook=UY("sha256")});var a9=z((uR)=>{Object.defineProperty(uR,"__esModule",{value:!0});uR.MongoCryptKMSRequestNetworkTimeoutError=uR.MongoCryptAzureKMSRequestError=uR.MongoCryptCreateEncryptedCollectionError=uR.MongoCryptCreateDataKeyError=uR.MongoCryptInvalidArgumentError=uR.MongoCryptError=void 0;var f11=p();class l4 extends f11.MongoError{constructor(F,A={}){super(F,A)}get name(){return"MongoCryptError"}}uR.MongoCryptError=l4;class NR extends l4{constructor(F){super(F)}get name(){return"MongoCryptInvalidArgumentError"}}uR.MongoCryptInvalidArgumentError=NR;class PR extends l4{constructor(F,{cause:A}){super(`Unable to complete creating data keys: ${A.message}`,{cause:A});this.encryptedFields=F}get name(){return"MongoCryptCreateDataKeyError"}}uR.MongoCryptCreateDataKeyError=PR;class MR extends l4{constructor(F,{cause:A}){super(`Unable to create collection: ${A.message}`,{cause:A});this.encryptedFields=F}get name(){return"MongoCryptCreateEncryptedCollectionError"}}uR.MongoCryptCreateEncryptedCollectionError=MR;class TR extends l4{constructor(F,A){super(F);this.body=A}get name(){return"MongoCryptAzureKMSRequestError"}}uR.MongoCryptAzureKMSRequestError=TR;class jR extends l4{get name(){return"MongoCryptKMSRequestNetworkTimeoutError"}}uR.MongoCryptKMSRequestNetworkTimeoutError=jR});var VY=z((fR)=>{Object.defineProperty(fR,"__esModule",{value:!0});fR.LegacyAWSTemporaryCredentialProvider=fR.AWSSDKCredentialProvider=fR.AWSTemporaryCredentialProvider=void 0;var h11=P6(),m11=p(),kA=a(),d11="http://169.254.170.2",LY="http://169.254.169.254",kR="/latest/meta-data/iam/security-credentials";class T6{static get awsSDK(){return T6._awsSDK??=h11.getAwsCredentialProvider(),T6._awsSDK}static get isAWSSDKInstalled(){return!("kModuleError"in T6.awsSDK)}}fR.AWSTemporaryCredentialProvider=T6;class SR extends T6{get provider(){if("kModuleError"in T6.awsSDK)throw T6.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 B=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=B&&J?T6.awsSDK.fromNodeProviderChain({clientConfig:{region:A}}):T6.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 m11.MongoAWSError(F.message,{cause:F})}}}fR.AWSSDKCredentialProvider=SR;class xR extends T6{async getCredentials(){if(process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI)return await kA.request(`${d11}${process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}`);let F=await kA.request(`${LY}/latest/api/token`,{method:"PUT",json:!1,headers:{"X-aws-ec2-metadata-token-ttl-seconds":30}}),A=await kA.request(`${LY}/${kR}`,{json:!1,headers:{"X-aws-ec2-metadata-token":F}});return await kA.request(`${LY}/${kR}/${A}`,{headers:{"X-aws-ec2-metadata-token":F}})}}fR.LegacyAWSTemporaryCredentialProvider=xR});var bR=z((gR)=>{Object.defineProperty(gR,"__esModule",{value:!0});gR.loadAWSCredentials=i11;var p11=VY();async function i11(F){let A=new p11.AWSSDKCredentialProvider,{SecretAccessKey:B="",AccessKeyId:D="",Token:J}=await A.getCredentials(),Z={secretAccessKey:B,accessKeyId:D};return J!=null&&(Z.sessionToken=J),{...F,aws:Z}}});var IY=z((mR)=>{Object.defineProperty(mR,"__esModule",{value:!0});mR.tokenCache=mR.AzureCredentialCache=mR.AZURE_BASE_URL=void 0;mR.addAzureParams=yR;mR.prepareRequest=vR;mR.fetchAzureKMSToken=hR;mR.loadAzureCredentials=o11;var s11=p(),a11=a(),r9=a9(),r11=6000;mR.AZURE_BASE_URL="http://169.254.169.254/metadata/identity/oauth2/token?";class RY{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()<=r11}resetCache(){this.cachedToken=null}_getToken(){return hR()}}mR.AzureCredentialCache=RY;mR.tokenCache=new RY;async function t11(F){let{status:A,body:B}=F,D=(()=>{try{return JSON.parse(B)}catch{throw new r9.MongoCryptAzureKMSRequestError("Malformed JSON body in GET request.")}})();if(A!==200)throw new r9.MongoCryptAzureKMSRequestError("Unable to complete request.",D);if(!D.access_token)throw new r9.MongoCryptAzureKMSRequestError("Malformed response body - missing field `access_token`.");if(!D.expires_in)throw new r9.MongoCryptAzureKMSRequestError("Malformed response body - missing field `expires_in`.");let J=Number(D.expires_in)*1000;if(Number.isNaN(J))throw new r9.MongoCryptAzureKMSRequestError("Malformed response body - unable to parse int from `expires_in` field.");return{accessToken:D.access_token,expiresOnTimestamp:Date.now()+J}}function yR(F,A,B){if(F.searchParams.append("api-version","2018-02-01"),F.searchParams.append("resource",A),B)F.searchParams.append("client_id",B);return F}function vR(F){let A=new URL(F.url?.toString()??mR.AZURE_BASE_URL);return yR(A,"https://vault.azure.net"),{headers:{...F.headers,"Content-Type":"application/json",Metadata:!0},url:A}}async function hR(F={}){let{headers:A,url:B}=vR(F);try{let D=await a11.get(B,{headers:A});return await t11(D)}catch(D){if(D instanceof s11.MongoNetworkTimeoutError)throw new r9.MongoCryptAzureKMSRequestError(`[Azure KMS] ${D.message}`);throw D}}async function o11(F){let A=await mR.tokenCache.getToken();return{...F,azure:A}}});var lR=z((cR)=>{Object.defineProperty(cR,"__esModule",{value:!0});cR.loadGCPCredentials=Z01;var J01=P6();async function Z01(F){let A=J01.getGcpMetadata();if("kModuleError"in A)return F;let{access_token:B}=await A.instance({property:"service-accounts/default/token"});return{...F,gcp:{accessToken:B}}}});var NY=z((pR)=>{Object.defineProperty(pR,"__esModule",{value:!0});pR.isEmptyCredentials=SA;pR.refreshKMSCredentials=E01;var Y01=bR(),$01=IY(),G01=lR();function SA(F,A){let B=A[F];if(B==null)return!1;return typeof B==="object"&&Object.keys(B).length===0}async function E01(F){let A=F;if(SA("aws",F))A=await Y01.loadAWSCredentials(A);if(SA("gcp",F))A=await G01.loadGCPCredentials(A);if(SA("azure",F))A=await $01.loadAzureCredentials(A);return A}});var PY=z((Bw)=>{Object.defineProperty(Bw,"__esModule",{value:!0});Bw.StateMachine=void 0;var iR=import.meta.require("fs/promises"),q01=import.meta.require("net"),W01=import.meta.require("tls"),W3=w1(),K01=P6(),t9=a(),z01=fA(),K3=a9(),D5=null;function U01(){if(D5==null){let F=K01.getSocks();if("kModuleError"in F)throw F.kModuleError;D5=F}return D5}var xA=0,sR=1,aR=2,rR=3,tR=7,oR=4,eR=5,Fw=6,Q01=443,L01=new Map([[xA,"MONGOCRYPT_CTX_ERROR"],[sR,"MONGOCRYPT_CTX_NEED_MONGO_COLLINFO"],[aR,"MONGOCRYPT_CTX_NEED_MONGO_MARKINGS"],[rR,"MONGOCRYPT_CTX_NEED_MONGO_KEYS"],[tR,"MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS"],[oR,"MONGOCRYPT_CTX_NEED_KMS"],[eR,"MONGOCRYPT_CTX_READY"],[Fw,"MONGOCRYPT_CTX_DONE"]]),V01=["tlsInsecure","tlsAllowInvalidCertificates","tlsAllowInvalidHostnames","tlsDisableOCSPEndpointCheck","tlsDisableCertificateRevocationCheck"];function nR(F){if(process.env.MONGODB_CRYPT_DEBUG)console.error(F)}var R01;class Aw{constructor(F,A=W3.pluckBSONSerializeOptions(F)){this.options=F,this.bsonOptions=A}async execute(F,A){let{_keyVaultNamespace:B,_keyVaultClient:D,_metaDataClient:J,_mongocryptdClient:Z,_mongocryptdManager:X}=F,Y=null;while(A.state!==Fw&&A.state!==xA)switch(nR(`[context#${A.id}] ${L01.get(A.state)||A.state}`),A.state){case sR:{let $=W3.deserialize(A.nextMongoOperation());if(!J)throw new K3.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined");let G=await this.fetchCollectionInfo(J,A.ns,$);if(G)A.addMongoOperationResponse(G);A.finishMongoOperation();break}case aR:{let $=A.nextMongoOperation();if(!Z)throw new K3.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined");let G=X?await X.withRespawn(this.markCommand.bind(this,Z,A.ns,$)):await this.markCommand(Z,A.ns,$);A.addMongoOperationResponse(G),A.finishMongoOperation();break}case rR:{let $=A.nextMongoOperation(),G=await this.fetchKeys(D,B,$);if(G.length===0)Y=R01??=W3.serialize({v:[]});for await(let E of G)A.addMongoOperationResponse(W3.serialize(E));A.finishMongoOperation();break}case tR:{let $=await F.askForKMSCredentials();A.provideKMSProviders(W3.serialize($));break}case oR:{let $=Array.from(this.requests(A));await Promise.all($),A.finishKMSRequests();break}case eR:{let $=A.finalize();if(A.state===xA){let G=A.status.message||"Finalization error";throw new K3.MongoCryptError(G)}Y=$;break}default:throw new K3.MongoCryptError(`Unknown state: ${A.state}`)}if(A.state===xA||Y==null){let $=A.status.message;if(!$)nR("unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.");throw new K3.MongoCryptError($??"unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.")}return Y}async kmsRequest(F){let A=F.endpoint.split(":"),B=A[1]!=null?Number.parseInt(A[1],10):Q01,D=z01.autoSelectSocketOptions(this.options.socketOptions||{}),J={host:A[0],servername:A[0],port:B,...D},Z=F.message,X=new t9.BufferPool,Y=new q01.Socket,$;function G(){for(let Q of[$,Y])if(Q)Q.removeAllListeners(),Q.destroy()}function E(){return new K3.MongoCryptError("KMS request timed out")}function C(Q){return new K3.MongoCryptError("KMS request failed",{cause:Q})}function H(){return new K3.MongoCryptError("KMS request closed")}let q=this.options.tlsOptions;if(q){let Q=F.kmsProvider,L=q[Q];if(L){let V=this.validateTlsOptions(Q,L);if(V)throw V;try{await this.setTlsOptions(L,J)}catch(w){throw C(w)}}}let{promise:W,reject:K,resolve:U}=t9.promiseWithResolvers();Y.once("timeout",()=>K(E())).once("error",(Q)=>K(C(Q))).once("close",()=>K(H())).once("connect",()=>U());try{if(this.options.proxyOptions&&this.options.proxyOptions.proxyHost){let w={host:this.options.proxyOptions.proxyHost,port:this.options.proxyOptions.proxyPort||1080,...D};Y.connect(w),await W;try{D5??=U01(),J.socket=(await D5.SocksClient.createConnection({existing_socket:Y,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(j){throw C(j)}}$=W01.connect(J,()=>{$.write(Z)});let{promise:Q,reject:L,resolve:V}=t9.promiseWithResolvers();$.once("timeout",()=>L(E())).once("error",(w)=>L(C(w))).once("close",()=>L(H())).on("data",(w)=>{X.append(w);while(F.bytesNeeded>0&&X.length){let j=Math.min(F.bytesNeeded,X.length);F.addResponse(X.read(j))}if(F.bytesNeeded<=0)V()}),await Q}finally{G()}}*requests(F){for(let A=F.nextKMSRequest();A!=null;A=F.nextKMSRequest())yield this.kmsRequest(A)}validateTlsOptions(F,A){let B=Object.keys(A);for(let D of V01)if(B.includes(D))return new K3.MongoCryptError(`Insecure TLS options prohibited for ${F}: ${D}`)}async setTlsOptions(F,A){if(F.tlsCertificateKeyFile){let B=await iR.readFile(F.tlsCertificateKeyFile);A.cert=A.key=B}if(F.tlsCAFile)A.ca=await iR.readFile(F.tlsCAFile);if(F.tlsCertificateKeyFilePassword)A.passphrase=F.tlsCertificateKeyFilePassword}async fetchCollectionInfo(F,A,B){let{db:D}=t9.MongoDBCollectionNamespace.fromString(A),J=await F.db(D).listCollections(B,{promoteLongs:!1,promoteValues:!1}).toArray();return J.length>0?W3.serialize(J[0]):null}async markCommand(F,A,B){let D={promoteLongs:!1,promoteValues:!1},{db:J}=t9.MongoDBCollectionNamespace.fromString(A),Z=W3.deserialize(B,D),X=await F.db(J).command(Z,D);return W3.serialize(X,this.bsonOptions)}fetchKeys(F,A,B){let{db:D,collection:J}=t9.MongoDBCollectionNamespace.fromString(A);return F.db(D).collection(J,{readConcern:{level:"majority"}}).find(W3.deserialize(B)).toArray()}}Bw.StateMachine=Aw});var fA=z((Jw)=>{Object.defineProperty(Jw,"__esModule",{value:!0});Jw.ClientEncryption=void 0;Jw.autoSelectSocketOptions=J5;var I2=w1(),w01=P6(),B4=a(),I01=QY(),p4=a9(),N01=NY(),_A=PY();class gA{static getMongoCrypt(){let F=w01.getMongoDBClientEncryption();if("kModuleError"in F)throw F.kModuleError;return F.MongoCrypt}constructor(F,A){if(this._client=F,this._proxyOptions=A.proxyOptions??{},this._tlsOptions=A.tlsOptions??{},this._kmsProviders=A.kmsProviders||{},A.keyVaultNamespace==null)throw new p4.MongoCryptInvalidArgumentError("Missing required option `keyVaultNamespace`");let B={...A,cryptoCallbacks:I01,kmsProviders:!Buffer.isBuffer(this._kmsProviders)?I2.serialize(this._kmsProviders):this._kmsProviders};this._keyVaultNamespace=A.keyVaultNamespace,this._keyVaultClient=A.keyVaultClient||F;let D=gA.getMongoCrypt();this._mongoCrypt=new D(B)}async createDataKey(F,A={}){if(A.keyAltNames&&!Array.isArray(A.keyAltNames))throw new p4.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof A.keyAltNames}.`);let B=void 0;if(A.keyAltNames&&A.keyAltNames.length>0)B=A.keyAltNames.map((C,H)=>{if(typeof C!=="string")throw new p4.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${H} was of type ${typeof C}`);return I2.serialize({keyAltName:C})});let D=void 0;if(A.keyMaterial)D=I2.serialize({keyMaterial:A.keyMaterial});let J=I2.serialize({provider:F,...A.masterKey}),Z=this._mongoCrypt.makeDataKeyContext(J,{keyAltNames:B,keyMaterial:D}),X=new _A.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:J5(this._client.options)}),Y=I2.deserialize(await X.execute(this,Z)),{db:$,collection:G}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),{insertedId:E}=await this._keyVaultClient.db($).collection(G).insertOne(Y,{writeConcern:{w:"majority"}});return E}async rewrapManyDataKey(F,A){let B=void 0;if(A){let C=Object.assign({provider:A.provider},A.masterKey);B=I2.serialize(C)}let D=I2.serialize(F),J=this._mongoCrypt.makeRewrapManyDataKeyContext(D,B),Z=new _A.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:J5(this._client.options)}),{v:X}=I2.deserialize(await Z.execute(this,J));if(X.length===0)return{};let{db:Y,collection:$}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),G=X.map((C)=>({updateOne:{filter:{_id:C._id},update:{$set:{masterKey:C.masterKey,keyMaterial:C.keyMaterial},$currentDate:{updateDate:!0}}}}));return{bulkWriteResult:await this._keyVaultClient.db(Y).collection($).bulkWrite(G,{writeConcern:{w:"majority"}})}}async deleteKey(F){let{db:A,collection:B}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(A).collection(B).deleteOne({_id:F},{writeConcern:{w:"majority"}})}getKeys(){let{db:F,collection:A}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return this._keyVaultClient.db(F).collection(A).find({},{readConcern:{level:"majority"}})}async getKey(F){let{db:A,collection:B}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(A).collection(B).findOne({_id:F},{readConcern:{level:"majority"}})}async getKeyByAltName(F){let{db:A,collection:B}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(A).collection(B).findOne({keyAltNames:F},{readConcern:{level:"majority"}})}async addKeyAltName(F,A){let{db:B,collection:D}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(B).collection(D).findOneAndUpdate({_id:F},{$addToSet:{keyAltNames:A}},{writeConcern:{w:"majority"},returnDocument:"before"})}async removeKeyAltName(F,A){let{db:B,collection:D}=B4.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),J=[{$set:{keyAltNames:{$cond:[{$eq:["$keyAltNames",[A]]},"$$REMOVE",{$filter:{input:"$keyAltNames",cond:{$ne:["$$this",A]}}}]}}}];return await this._keyVaultClient.db(B).collection(D).findOneAndUpdate({_id:F},J,{writeConcern:{w:"majority"},returnDocument:"before"})}async createEncryptedCollection(F,A,B){let{provider:D,masterKey:J,createCollectionOptions:{encryptedFields:{...Z},...X}}=B;if(Array.isArray(Z.fields)){let Y=Z.fields.map(async(E)=>E==null||typeof E!=="object"||E.keyId!=null?E:{...E,keyId:await this.createDataKey(D,{masterKey:J})}),$=await Promise.allSettled(Y);Z.fields=$.map((E,C)=>E.status==="fulfilled"?E.value:Z.fields[C]);let G=$.find((E)=>E.status==="rejected");if(G!=null)throw new p4.MongoCryptCreateDataKeyError(Z,{cause:G.reason})}try{return{collection:await F.createCollection(A,{...X,encryptedFields:Z}),encryptedFields:Z}}catch(Y){throw new p4.MongoCryptCreateEncryptedCollectionError(Z,{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=I2.serialize({v:F}),B=this._mongoCrypt.makeExplicitDecryptionContext(A),D=new _A.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:J5(this._client.options)}),{v:J}=I2.deserialize(await D.execute(this,B));return J}async askForKMSCredentials(){return await N01.refreshKMSCredentials(this._kmsProviders)}static get libmongocryptVersion(){return gA.getMongoCrypt().libmongocryptVersion}async _encrypt(F,A,B){let{algorithm:D,keyId:J,keyAltName:Z,contentionFactor:X,queryType:Y,rangeOptions:$}=B,G={expressionMode:A,algorithm:D};if(J)G.keyId=J.buffer;if(Z){if(J)throw new p4.MongoCryptInvalidArgumentError('"options" cannot contain both "keyId" and "keyAltName"');if(typeof Z!=="string")throw new p4.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof Z}`);G.keyAltName=I2.serialize({keyAltName:Z})}if(typeof X==="number"||typeof X==="bigint")G.contentionFactor=X;if(typeof Y==="string")G.queryType=Y;if(typeof $==="object")G.rangeOptions=I2.serialize($);let E=I2.serialize({v:F}),C=new _A.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:J5(this._client.options)}),H=this._mongoCrypt.makeExplicitEncryptionContext(E,G),{v:q}=I2.deserialize(await C.execute(this,H));return q}}Jw.ClientEncryption=gA;function J5(F){let A={autoSelectFamily:!0};if("autoSelectFamily"in F)A.autoSelectFamily=F.autoSelectFamily;if("autoSelectFamilyAttemptTimeout"in F)A.autoSelectFamilyAttemptTimeout=F.autoSelectFamilyAttemptTimeout;return A}});var $w=z((Xw)=>{Object.defineProperty(Xw,"__esModule",{value:!0});Xw.MongocryptdManager=void 0;var M01=p();class bA{constructor(F={}){if(this.spawnPath="",this.spawnArgs=[],this.uri=typeof F.mongocryptdURI==="string"&&F.mongocryptdURI.length>0?F.mongocryptdURI:bA.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}=import.meta.require("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(B){if(!(B instanceof M01.MongoNetworkTimeoutError&&!this.bypassSpawn))throw B}return await this.spawn(),await F()}}Xw.MongocryptdManager=bA;bA.DEFAULT_MONGOCRYPTD_URI="mongodb://localhost:27020"});var jY=z((Hw)=>{var Cw;Object.defineProperty(Hw,"__esModule",{value:!0});Hw.AutoEncrypter=Hw.AutoEncryptionLoggerLevel=void 0;var Gw=import.meta.require("net"),Z5=w1(),T01=W0(),j01=P6(),MY=p(),u01=D4(),O01=a(),TY=fA(),k01=QY(),S01=a9(),x01=$w(),f01=NY(),Ew=PY();Hw.AutoEncryptionLoggerLevel=Object.freeze({FatalError:0,Error:1,Warning:2,Info:3,Trace:4});class yA{static getMongoCrypt(){let F=j01.getMongoDBClientEncryption();if("kModuleError"in F)throw F.kModuleError;return F.MongoCrypt}constructor(F,A){this[Cw]=!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||{};let B={cryptoCallbacks:k01};if(A.schemaMap)B.schemaMap=Buffer.isBuffer(A.schemaMap)?A.schemaMap:Z5.serialize(A.schemaMap);if(A.encryptedFieldsMap)B.encryptedFieldsMap=Buffer.isBuffer(A.encryptedFieldsMap)?A.encryptedFieldsMap:Z5.serialize(A.encryptedFieldsMap);if(B.kmsProviders=!Buffer.isBuffer(this._kmsProviders)?Z5.serialize(this._kmsProviders):this._kmsProviders,A.options?.logger)B.logger=A.options.logger;if(A.extraOptions&&A.extraOptions.cryptSharedLibPath)B.cryptSharedLibPath=A.extraOptions.cryptSharedLibPath;if(A.bypassQueryAnalysis)B.bypassQueryAnalysis=A.bypassQueryAnalysis;if(this._bypassMongocryptdAndCryptShared=this._bypassEncryption||!!A.bypassQueryAnalysis,A.extraOptions&&A.extraOptions.cryptSharedLibSearchPaths)B.cryptSharedLibSearchPaths=A.extraOptions.cryptSharedLibSearchPaths;else if(!this._bypassMongocryptdAndCryptShared)B.cryptSharedLibSearchPaths=["$SYSTEM"];let D=yA.getMongoCrypt();if(this._mongocrypt=new D(B),this._contextCounter=0,A.extraOptions&&A.extraOptions.cryptSharedLibRequired&&!this.cryptSharedLibVersionInfo)throw new S01.MongoCryptInvalidArgumentError("`cryptSharedLibRequired` set but no crypt_shared library loaded");if(!this._bypassMongocryptdAndCryptShared&&!this.cryptSharedLibVersionInfo){this._mongocryptdManager=new x01.MongocryptdManager(A.extraOptions);let J={serverSelectionTimeoutMS:1e4};if((A.extraOptions==null||typeof A.extraOptions.mongocryptdURI!=="string")&&!Gw.getDefaultAutoSelectFamily)J.family=4;if(Gw.getDefaultAutoSelectFamily)Object.assign(J,TY.autoSelectSocketOptions(this._client.options));this._mongocryptdClient=new u01.MongoClient(this._mongocryptdManager.uri,J)}}async init(){if(this._bypassMongocryptdAndCryptShared||this.cryptSharedLibVersionInfo)return;if(!this._mongocryptdManager)throw new MY.MongoRuntimeError("Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdClient)throw new MY.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 MY.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,B={}){if(this._bypassEncryption)return A;let D=Buffer.isBuffer(A)?A:Z5.serialize(A,B),J=this._mongocrypt.makeEncryptionContext(O01.MongoDBCollectionNamespace.fromString(F).db,D);J.id=this._contextCounter++,J.ns=F,J.document=A;let Z=new Ew.StateMachine({promoteValues:!1,promoteLongs:!1,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:TY.autoSelectSocketOptions(this._client.options)});return Z5.deserialize(await Z.execute(this,J),{promoteValues:!1,promoteLongs:!1})}async decrypt(F,A={}){let B=this._mongocrypt.makeDecryptionContext(F);return B.id=this._contextCounter++,await new Ew.StateMachine({...A,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:TY.autoSelectSocketOptions(this._client.options)}).execute(this,B)}async askForKMSCredentials(){return await f01.refreshKMSCredentials(this._kmsProviders)}get cryptSharedLibVersionInfo(){return this._mongocrypt.cryptSharedLibVersionInfo}static get libmongocryptVersion(){return yA.getMongoCrypt().libmongocryptVersion}}Hw.AutoEncrypter=yA;Cw=T01.kDecorateResult});var Qw=z((zw)=>{Object.defineProperty(zw,"__esModule",{value:!0});zw.Encrypter=void 0;var g01=import.meta.require("util"),b01=jY(),y01=W0(),v01=P6(),Ww=p(),h01=D4(),X5=Symbol("internalClient");class Kw{constructor(F,A,B){if(typeof B.autoEncryption!=="object")throw new Ww.MongoInvalidArgumentError('Option "autoEncryption" must be specified');if(this[X5]=null,this.bypassAutoEncryption=!!B.autoEncryption.bypassAutoEncryption,this.needsConnecting=!1,B.maxPoolSize===0&&B.autoEncryption.keyVaultClient==null)B.autoEncryption.keyVaultClient=F;else if(B.autoEncryption.keyVaultClient==null)B.autoEncryption.keyVaultClient=this.getInternalClient(F,A,B);if(this.bypassAutoEncryption)B.autoEncryption.metadataClient=void 0;else if(B.maxPoolSize===0)B.autoEncryption.metadataClient=F;else B.autoEncryption.metadataClient=this.getInternalClient(F,A,B);if(B.proxyHost)B.autoEncryption.proxyOptions={proxyHost:B.proxyHost,proxyPort:B.proxyPort,proxyUsername:B.proxyUsername,proxyPassword:B.proxyPassword};this.autoEncrypter=new b01.AutoEncrypter(F,B.autoEncryption)}getInternalClient(F,A,B){let D=this[X5];if(D==null){let J={};for(let Z of[...Object.getOwnPropertyNames(B),...Object.getOwnPropertySymbols(B)]){if(["autoEncryption","minPoolSize","servers","caseTranslate","dbName"].includes(Z))continue;Reflect.set(J,Z,Reflect.get(B,Z))}J.minPoolSize=0,D=new h01.MongoClient(A,J),this[X5]=D;for(let Z of y01.MONGO_CLIENT_EVENTS)for(let X of F.listeners(Z))D.on(Z,X);F.on("newListener",(Z,X)=>{D?.on(Z,X)}),this.needsConnecting=!0}return D}async connectInternalClient(){let F=this[X5];if(this.needsConnecting&&F!=null)this.needsConnecting=!1,await F.connect()}closeCallback(F,A,B){g01.callbackify(this.close.bind(this))(F,A,B)}async close(F,A){let B;try{await this.autoEncrypter.teardown(A)}catch(J){B=J}let D=this[X5];if(D!=null&&F!==D)return await D.close(A);if(B!=null)throw B}static checkForMongoCrypt(){let F=v01.getMongoDBClientEncryption();if("kModuleError"in F)throw new Ww.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"})}}zw.Encrypter=Kw});var uY=z((Lw)=>{Object.defineProperty(Lw,"__esModule",{value:!0});Lw.ConnectionPoolMetrics=void 0;class z3{constructor(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}markPinned(F){if(F===z3.TXN)this.txnConnections+=1;else if(F===z3.CURSOR)this.cursorConnections+=1;else this.otherConnections+=1}markUnpinned(F){if(F===z3.TXN)this.txnConnections-=1;else if(F===z3.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}}Lw.ConnectionPoolMetrics=z3;z3.TXN="txn";z3.CURSOR="cursor";z3.OTHER="other"});var Y5=z((Nw)=>{Object.defineProperty(Nw,"__esModule",{value:!0});Nw.ServerDescription=void 0;Nw.parseServerType=ww;Nw.compareTopologyVersion=Iw;var o9=w1(),m01=p(),e9=a(),V0=v2(),d01=new Set([V0.ServerType.RSPrimary,V0.ServerType.Standalone,V0.ServerType.Mongos,V0.ServerType.LoadBalancer]),c01=new Set([V0.ServerType.RSPrimary,V0.ServerType.RSSecondary,V0.ServerType.Mongos,V0.ServerType.Standalone,V0.ServerType.LoadBalancer]);class Rw{constructor(F,A,B={}){if(F==null||F==="")throw new m01.MongoRuntimeError("ServerDescription must be provided with a non-empty address");this.address=typeof F==="string"?e9.HostAddress.fromString(F).toString():F.toString(),this.type=ww(A,B),this.hosts=A?.hosts?.map((D)=>D.toLowerCase())??[],this.passives=A?.passives?.map((D)=>D.toLowerCase())??[],this.arbiters=A?.arbiters?.map((D)=>D.toLowerCase())??[],this.tags=A?.tags??{},this.minWireVersion=A?.minWireVersion??0,this.maxWireVersion=A?.maxWireVersion??0,this.roundTripTime=B?.roundTripTime??-1,this.minRoundTripTime=B?.minRoundTripTime??0,this.lastUpdateTime=e9.now(),this.lastWriteDate=A?.lastWrite?.lastWriteDate??0,this.error=B.error??null,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}get hostAddress(){return e9.HostAddress.fromString(this.address)}get allHosts(){return this.hosts.concat(this.arbiters).concat(this.passives)}get isReadable(){return this.type===V0.ServerType.RSSecondary||this.isWritable}get isDataBearing(){return c01.has(this.type)}get isWritable(){return d01.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||Iw(this.topologyVersion,F?.topologyVersion)===0,B=this.electionId!=null&&F?.electionId!=null?e9.compareObjectId(this.electionId,F.electionId)===0:this.electionId===F?.electionId;return F!=null&&e9.errorStrictEqual(this.error,F.error)&&this.type===F.type&&this.minWireVersion===F.minWireVersion&&e9.arrayStrictEqual(this.hosts,F.hosts)&&l01(this.tags,F.tags)&&this.setName===F.setName&&this.setVersion===F.setVersion&&B&&this.primary===F.primary&&this.logicalSessionTimeoutMinutes===F.logicalSessionTimeoutMinutes&&A}}Nw.ServerDescription=Rw;function ww(F,A){if(A?.loadBalanced)return V0.ServerType.LoadBalancer;if(!F||!F.ok)return V0.ServerType.Unknown;if(F.isreplicaset)return V0.ServerType.RSGhost;if(F.msg&&F.msg==="isdbgrid")return V0.ServerType.Mongos;if(F.setName)if(F.hidden)return V0.ServerType.RSOther;else if(F.isWritablePrimary)return V0.ServerType.RSPrimary;else if(F.secondary)return V0.ServerType.RSSecondary;else if(F.arbiterOnly)return V0.ServerType.RSArbiter;else return V0.ServerType.RSOther;return V0.ServerType.Standalone}function l01(F,A){let B=Object.keys(F),D=Object.keys(A);return B.length===D.length&&B.every((J)=>A[J]===F[J])}function Iw(F,A){if(F==null||A==null)return-1;if(!F.processId.equals(A.processId))return-1;let B=typeof F.counter==="bigint"?o9.Long.fromBigInt(F.counter):o9.Long.isLong(F.counter)?F.counter:o9.Long.fromNumber(F.counter),D=typeof A.counter==="bigint"?o9.Long.fromBigInt(A.counter):o9.Long.isLong(A.counter)?A.counter:o9.Long.fromNumber(A.counter);return B.compare(D)}});var kY=z((kw)=>{Object.defineProperty(kw,"__esModule",{value:!0});kw.TopologyDescription=void 0;var n01=w1(),vA=b4(),s01=p(),OY=a(),L1=v2(),J4=Y5(),a01=vA.MIN_SUPPORTED_SERVER_VERSION,r01=vA.MAX_SUPPORTED_SERVER_VERSION,Mw=vA.MIN_SUPPORTED_WIRE_VERSION,Tw=vA.MAX_SUPPORTED_WIRE_VERSION,t01=new Set([L1.ServerType.Mongos,L1.ServerType.Unknown]),jw=new Set([L1.ServerType.Mongos,L1.ServerType.Standalone]),uw=new Set([L1.ServerType.RSSecondary,L1.ServerType.RSArbiter,L1.ServerType.RSOther]);class $5{constructor(F,A=null,B=null,D=null,J=null,Z=null,X=null){X=X??{},this.type=F??L1.TopologyType.Unknown,this.servers=A??new Map,this.stale=!1,this.compatible=!0,this.heartbeatFrequencyMS=X.heartbeatFrequencyMS??0,this.localThresholdMS=X.localThresholdMS??15,this.setName=B??null,this.maxElectionId=J??null,this.maxSetVersion=D??null,this.commonWireVersion=Z??0;for(let Y of this.servers.values()){if(Y.type===L1.ServerType.Unknown||Y.type===L1.ServerType.LoadBalancer)continue;if(Y.minWireVersion>Tw)this.compatible=!1,this.compatibilityError=`Server at ${Y.address} requires wire version ${Y.minWireVersion}, but this version of the driver only supports up to ${Tw} (MongoDB ${r01})`;if(Y.maxWireVersion<Mw){this.compatible=!1,this.compatibilityError=`Server at ${Y.address} reports wire version ${Y.maxWireVersion}, but this version of the driver requires at least ${Mw} (MongoDB ${a01}).`;break}}this.logicalSessionTimeoutMinutes=null;for(let[,Y]of this.servers)if(Y.isReadable){if(Y.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=null;break}if(this.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=Y.logicalSessionTimeoutMinutes;continue}this.logicalSessionTimeoutMinutes=Math.min(this.logicalSessionTimeoutMinutes,Y.logicalSessionTimeoutMinutes)}}updateFromSrvPollingEvent(F,A=0){let B=F.hostnames(),D=new Set(this.servers.keys()),J=new Set(B),Z=new Set;for(let Y of D)if(J.delete(Y),!B.has(Y))Z.add(Y);if(J.size===0&&Z.size===0)return this;let X=new Map(this.servers);for(let Y of Z)X.delete(Y);if(J.size>0){if(A===0)for(let Y of J)X.set(Y,new J4.ServerDescription(Y));else if(X.size<A){let Y=OY.shuffle(J,A-X.size);for(let $ of Y)X.set($,new J4.ServerDescription($))}}return new $5(this.type,X,this.setName,this.maxSetVersion,this.maxElectionId,this.commonWireVersion,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}update(F){let A=F.address,{type:B,setName:D,maxSetVersion:J,maxElectionId:Z,commonWireVersion:X}=this,Y=F.type,$=new Map(this.servers);if(F.maxWireVersion!==0)if(X==null)X=F.maxWireVersion;else X=Math.min(X,F.maxWireVersion);if(typeof F.setName==="string"&&typeof D==="string"&&F.setName!==D)if(B===L1.TopologyType.Single)F=new J4.ServerDescription(A);else $.delete(A);if($.set(A,F),B===L1.TopologyType.Single)return new $5(L1.TopologyType.Single,$,D,J,Z,X,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS});if(B===L1.TopologyType.Unknown)if(Y===L1.ServerType.Standalone&&this.servers.size!==1)$.delete(A);else B=o01(Y);if(B===L1.TopologyType.Sharded){if(!t01.has(Y))$.delete(A)}if(B===L1.TopologyType.ReplicaSetNoPrimary){if(jw.has(Y))$.delete(A);if(Y===L1.ServerType.RSPrimary){let G=Ow($,F,D,J,Z);B=G[0],D=G[1],J=G[2],Z=G[3]}else if(uw.has(Y)){let G=F21($,F,D);B=G[0],D=G[1]}}if(B===L1.TopologyType.ReplicaSetWithPrimary)if(jw.has(Y))$.delete(A),B=i4($);else if(Y===L1.ServerType.RSPrimary){let G=Ow($,F,D,J,Z);B=G[0],D=G[1],J=G[2],Z=G[3]}else if(uw.has(Y))B=e01($,F,D);else B=i4($);return new $5(B,$,D,J,Z,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!==L1.ServerType.Unknown)}get hasDataBearingServers(){return Array.from(this.servers.values()).some((F)=>F.isDataBearing)}hasServer(F){return this.servers.has(F)}toJSON(){return n01.EJSON.serialize(this)}}kw.TopologyDescription=$5;function o01(F){switch(F){case L1.ServerType.Standalone:return L1.TopologyType.Single;case L1.ServerType.Mongos:return L1.TopologyType.Sharded;case L1.ServerType.RSPrimary:return L1.TopologyType.ReplicaSetWithPrimary;case L1.ServerType.RSOther:case L1.ServerType.RSSecondary:return L1.TopologyType.ReplicaSetNoPrimary;default:return L1.TopologyType.Unknown}}function Ow(F,A,B=null,D=null,J=null){if(B=B||A.setName,B!==A.setName)return F.delete(A.address),[i4(F),B,D,J];if(A.maxWireVersion>=17){let Y=OY.compareObjectId(J,A.electionId),$=Y===0,G=Y===-1,E=(D??-1)<=(A.setVersion??-1);if(G||$&&E)J=A.electionId,D=A.setVersion;else return F.set(A.address,new J4.ServerDescription(A.address)),[i4(F),B,D,J]}else{let Y=A.electionId?A.electionId:null;if(A.setVersion&&Y){if(D&&J){if(D>A.setVersion||OY.compareObjectId(J,Y)>0)return F.set(A.address,new J4.ServerDescription(A.address)),[i4(F),B,D,J]}J=A.electionId}if(A.setVersion!=null&&(D==null||A.setVersion>D))D=A.setVersion}for(let[Y,$]of F)if($.type===L1.ServerType.RSPrimary&&$.address!==A.address){F.set(Y,new J4.ServerDescription($.address));break}A.allHosts.forEach((Y)=>{if(!F.has(Y))F.set(Y,new J4.ServerDescription(Y))});let Z=Array.from(F.keys()),X=A.allHosts;return Z.filter((Y)=>X.indexOf(Y)===-1).forEach((Y)=>{F.delete(Y)}),[i4(F),B,D,J]}function e01(F,A,B=null){if(B==null)throw new s01.MongoRuntimeError('Argument "setName" is required if connected to a replica set');if(B!==A.setName||A.me&&A.address!==A.me)F.delete(A.address);return i4(F)}function F21(F,A,B=null){let D=L1.TopologyType.ReplicaSetNoPrimary;if(B=B??A.setName,B!==A.setName)return F.delete(A.address),[D,B];if(A.allHosts.forEach((J)=>{if(!F.has(J))F.set(J,new J4.ServerDescription(J))}),A.me&&A.address!==A.me)F.delete(A.address);return[D,B]}function i4(F){for(let A of F.values())if(A.type===L1.ServerType.RSPrimary)return L1.TopologyType.ReplicaSetWithPrimary;return L1.TopologyType.ReplicaSetNoPrimary}});var xY=z((fw)=>{Object.defineProperty(fw,"__esModule",{value:!0});fw.getReadPreference=D21;fw.isSharded=J21;var A21=p(),SY=P0(),xw=v2(),B21=kY();function D21(F){let A=F?.readPreference??SY.ReadPreference.primary;if(typeof A==="string")A=SY.ReadPreference.fromString(A);if(!(A instanceof SY.ReadPreference))throw new A21.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance');return A}function J21(F){if(F==null)return!1;if(F.description&&F.description.type===xw.ServerType.Mongos)return!0;if(F.description&&F.description instanceof B21.TopologyDescription)return Array.from(F.description.servers.values()).some((B)=>B.type===xw.ServerType.Mongos);return!1}});var fY=z((bw)=>{Object.defineProperty(bw,"__esModule",{value:!0});bw.Transaction=bw.TxnState=void 0;bw.isTransactionCommand=q21;var _w=p(),Y21=B6(),$21=P0(),G21=c0();bw.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 E21={[bw.TxnState.NO_TRANSACTION]:[bw.TxnState.NO_TRANSACTION,bw.TxnState.STARTING_TRANSACTION],[bw.TxnState.STARTING_TRANSACTION]:[bw.TxnState.TRANSACTION_IN_PROGRESS,bw.TxnState.TRANSACTION_COMMITTED,bw.TxnState.TRANSACTION_COMMITTED_EMPTY,bw.TxnState.TRANSACTION_ABORTED],[bw.TxnState.TRANSACTION_IN_PROGRESS]:[bw.TxnState.TRANSACTION_IN_PROGRESS,bw.TxnState.TRANSACTION_COMMITTED,bw.TxnState.TRANSACTION_ABORTED],[bw.TxnState.TRANSACTION_COMMITTED]:[bw.TxnState.TRANSACTION_COMMITTED,bw.TxnState.TRANSACTION_COMMITTED_EMPTY,bw.TxnState.STARTING_TRANSACTION,bw.TxnState.NO_TRANSACTION],[bw.TxnState.TRANSACTION_ABORTED]:[bw.TxnState.STARTING_TRANSACTION,bw.TxnState.NO_TRANSACTION],[bw.TxnState.TRANSACTION_COMMITTED_EMPTY]:[bw.TxnState.TRANSACTION_COMMITTED_EMPTY,bw.TxnState.NO_TRANSACTION]},C21=new Set([bw.TxnState.STARTING_TRANSACTION,bw.TxnState.TRANSACTION_IN_PROGRESS]),H21=new Set([bw.TxnState.TRANSACTION_COMMITTED,bw.TxnState.TRANSACTION_COMMITTED_EMPTY,bw.TxnState.TRANSACTION_ABORTED]);class gw{constructor(F){F=F??{},this.state=bw.TxnState.NO_TRANSACTION,this.options={};let A=G21.WriteConcern.fromOptions(F);if(A){if(A.w===0)throw new _w.MongoTransactionError("Transactions do not support unacknowledged write concern");this.options.writeConcern=A}if(F.readConcern)this.options.readConcern=Y21.ReadConcern.fromOptions(F);if(F.readPreference)this.options.readPreference=$21.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===bw.TxnState.STARTING_TRANSACTION}get isActive(){return C21.has(this.state)}get isCommitted(){return H21.has(this.state)}transition(F){let A=E21[this.state];if(A&&A.includes(F)){if(this.state=F,this.state===bw.TxnState.NO_TRANSACTION||this.state===bw.TxnState.STARTING_TRANSACTION||this.state===bw.TxnState.TRANSACTION_ABORTED)this.unpinServer();return}throw new _w.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${F}]`)}pinServer(F){if(this.isActive)this._pinnedServer=F}unpinServer(){this._pinnedServer=void 0}}bw.Transaction=gw;function q21(F){return!!(F.commitTransaction||F.abortTransaction)}});var D7=z((lw)=>{var mw;Object.defineProperty(lw,"__esModule",{value:!0});lw.ServerSessionPool=lw.ServerSession=lw.ClientSession=void 0;lw.maybeClearPinnedConnection=cA;lw.applySession=R21;lw.updateSessionFromResponse=w21;var dA=w1(),lA=uY(),K21=xY(),dw=W0(),D1=p(),z21=d2(),hA=l0(),_Y=f9(),U21=B6(),gY=P0(),Q21=J7(),bY=v2(),y1=fY(),N2=a(),mA=c0(),L21=8,F7=Symbol("serverSession"),pA=Symbol("snapshotTime"),B7=Symbol("snapshotEnabled"),A7=Symbol("pinnedConnection"),iA=Symbol("txnNumberIncrement");class nA extends z21.TypedEventEmitter{constructor(F,A,B,D){super();if(this[mw]=!1,F==null)throw new D1.MongoRuntimeError("ClientSession requires a MongoClient");if(A==null||!(A instanceof yY))throw new D1.MongoRuntimeError("ClientSession requires a ServerSessionPool");if(B=B??{},B.snapshot===!0){if(this[B7]=!0,B.causalConsistency===!0)throw new D1.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive')}this.client=F,this.sessionPool=A,this.hasEnded=!1,this.clientOptions=D,this.timeoutMS=B.defaultTimeoutMS??F.s.options?.timeoutMS,this.explicit=!!B.explicit,this[F7]=this.explicit?this.sessionPool.acquire():null,this[iA]=0;let J=this.explicit&&B.snapshot!==!0;this.supports={causalConsistency:B.causalConsistency??J},this.clusterTime=B.initialClusterTime,this.operationTime=void 0,this.owner=B.owner,this.defaultTransactionOptions={...B.defaultTransactionOptions},this.transaction=new y1.Transaction}get id(){return this[F7]?.id}get serverSession(){let F=this[F7];if(F==null){if(this.explicit)throw new D1.MongoRuntimeError("Unexpected null serverSession for an explicit session");if(this.hasEnded)throw new D1.MongoRuntimeError("Unexpected null serverSession for an ended implicit session");F=this.sessionPool.acquire(),this[F7]=F}return F}get snapshotEnabled(){return this[B7]}get loadBalanced(){return this.client.topology?.description.type===bY.TopologyType.LoadBalanced}get pinnedConnection(){return this[A7]}pin(F){if(this[A7])throw TypeError("Cannot pin multiple connections to the same session");this[A7]=F,F.emit(dw.PINNED,this.inTransaction()?lA.ConnectionPoolMetrics.TXN:lA.ConnectionPoolMetrics.CURSOR)}unpin(F){if(this.loadBalanced)return cA(this,F);this.transaction.unpinServer()}get isPinned(){return this.loadBalanced?!!this[A7]:this.transaction.isPinned}async endSession(F){try{if(this.inTransaction())await this.abortTransaction();if(!this.hasEnded){let A=this[F7];if(A!=null)this.sessionPool.release(A),Object.defineProperty(this,F7,{value:G5.clone(A),writable:!1});this.hasEnded=!0,this.emit("ended",this)}}catch(A){N2.squashError(A)}finally{cA(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 D1.MongoInvalidArgumentError("input cluster time must be an object");if(!F.clusterTime||F.clusterTime._bsontype!=="Timestamp")throw new D1.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 D1.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId');bY._advanceClusterTime(this,F)}equals(F){if(!(F instanceof nA))return!1;if(this.id==null||F.id==null)return!1;return N2.ByteUtils.equals(this.id.id.buffer,F.id.id.buffer)}incrementTransactionNumber(){this[iA]+=1}inTransaction(){return this.transaction.isActive}startTransaction(F){if(this[B7])throw new D1.MongoCompatibilityError("Transactions are not supported in snapshot sessions");if(this.inTransaction())throw new D1.MongoTransactionError("Transaction already in progress");if(this.isPinned&&this.transaction.isCommitted)this.unpin();let A=N2.maxWireVersion(this.client.topology);if(K21.isSharded(this.client.topology)&&A!=null&&A<L21)throw new D1.MongoCompatibilityError("Transactions are not supported on sharded clusters in MongoDB < 4.2.");this.commitAttempted=!1,this.incrementTransactionNumber(),this.transaction=new y1.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(y1.TxnState.STARTING_TRANSACTION)}async commitTransaction(){if(this.transaction.state===y1.TxnState.NO_TRANSACTION)throw new D1.MongoTransactionError("No transaction started");if(this.transaction.state===y1.TxnState.STARTING_TRANSACTION||this.transaction.state===y1.TxnState.TRANSACTION_COMMITTED_EMPTY){this.transaction.transition(y1.TxnState.TRANSACTION_COMMITTED_EMPTY);return}if(this.transaction.state===y1.TxnState.TRANSACTION_ABORTED)throw new D1.MongoTransactionError("Cannot call commitTransaction after calling abortTransaction");let F={commitTransaction:1},A=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(A!=null)mA.WriteConcern.apply(F,{wtimeoutMS:1e4,w:"majority",...A});if(this.transaction.state===y1.TxnState.TRANSACTION_COMMITTED||this.commitAttempted)mA.WriteConcern.apply(F,{wtimeoutMS:1e4,...A,w:"majority"});if(typeof this.transaction.options.maxTimeMS==="number")F.maxTimeMS=this.transaction.options.maxTimeMS;if(this.transaction.recoveryToken)F.recoveryToken=this.transaction.recoveryToken;let B=new _Y.RunAdminCommandOperation(F,{session:this,readPreference:gY.ReadPreference.primary,bypassPinningCheck:!0});try{await hA.executeOperation(this.client,B),this.commitAttempted=void 0;return}catch(D){if(this.commitAttempted=!0,D instanceof D1.MongoError&&D1.isRetryableWriteError(D)){mA.WriteConcern.apply(F,{wtimeoutMS:1e4,...A,w:"majority"}),this.unpin({force:!0});try{await hA.executeOperation(this.client,new _Y.RunAdminCommandOperation(F,{session:this,readPreference:gY.ReadPreference.primary,bypassPinningCheck:!0}));return}catch(J){if(hw(J))J.addErrorLabel(D1.MongoErrorLabel.UnknownTransactionCommitResult);if(vw(J))this.unpin({error:J});throw J}}if(hw(D))D.addErrorLabel(D1.MongoErrorLabel.UnknownTransactionCommitResult);if(vw(D))this.unpin({error:D});throw D}finally{this.transaction.transition(y1.TxnState.TRANSACTION_COMMITTED)}}async abortTransaction(){if(this.transaction.state===y1.TxnState.NO_TRANSACTION)throw new D1.MongoTransactionError("No transaction started");if(this.transaction.state===y1.TxnState.STARTING_TRANSACTION){this.transaction.transition(y1.TxnState.TRANSACTION_ABORTED);return}if(this.transaction.state===y1.TxnState.TRANSACTION_ABORTED)throw new D1.MongoTransactionError("Cannot call abortTransaction twice");if(this.transaction.state===y1.TxnState.TRANSACTION_COMMITTED||this.transaction.state===y1.TxnState.TRANSACTION_COMMITTED_EMPTY)throw new D1.MongoTransactionError("Cannot call abortTransaction after calling commitTransaction");let F={abortTransaction:1},A=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(A!=null)mA.WriteConcern.apply(F,{wtimeoutMS:1e4,w:"majority",...A});if(this.transaction.recoveryToken)F.recoveryToken=this.transaction.recoveryToken;let B=new _Y.RunAdminCommandOperation(F,{session:this,readPreference:gY.ReadPreference.primary,bypassPinningCheck:!0});try{await hA.executeOperation(this.client,B),this.unpin();return}catch(D){if(this.unpin(),D instanceof D1.MongoError&&D1.isRetryableWriteError(D))try{await hA.executeOperation(this.client,B);return}catch{}}finally{if(this.transaction.transition(y1.TxnState.TRANSACTION_ABORTED),this.loadBalanced)cA(this,{force:!1})}}toBSON(){throw new D1.MongoRuntimeError("ClientSession cannot be serialized to BSON.")}async withTransaction(F,A){let D=N2.now(),J=!1,Z;while(!J){this.startTransaction(A);try{let X=F(this);if(!N2.isPromiseLike(X))throw new D1.MongoInvalidArgumentError("Function provided to `withTransaction` must return a Promise");if(Z=await X,this.transaction.state===y1.TxnState.NO_TRANSACTION||this.transaction.state===y1.TxnState.TRANSACTION_COMMITTED||this.transaction.state===y1.TxnState.TRANSACTION_ABORTED)return Z}catch(X){if(!(X instanceof D1.MongoError)||X instanceof D1.MongoInvalidArgumentError)throw await this.abortTransaction(),X;if(this.transaction.state===y1.TxnState.STARTING_TRANSACTION||this.transaction.state===y1.TxnState.TRANSACTION_IN_PROGRESS)await this.abortTransaction();if(X.hasErrorLabel(D1.MongoErrorLabel.TransientTransactionError)&&N2.now()-D<120000)continue;throw X}while(!J)try{await this.commitTransaction(),J=!0}catch(X){if(!sA(X)&&X.hasErrorLabel(D1.MongoErrorLabel.UnknownTransactionCommitResult)&&N2.now()-D<120000)continue;if(X.hasErrorLabel(D1.MongoErrorLabel.TransientTransactionError)&&N2.now()-D<120000)break;throw X}}return Z}}lw.ClientSession=nA;mw=B7;Q21.configureResourceManagement(nA.prototype);var V21=new Set(["CannotSatisfyWriteConcern","UnknownReplWriteConcern","UnsatisfiableWriteConcern"]);function vw(F){if(F instanceof D1.MongoError){if(D1.isRetryableWriteError(F)||F instanceof D1.MongoWriteConcernError||sA(F)){if(cw(F))return!0}else if(F.hasErrorLabel(D1.MongoErrorLabel.TransientTransactionError))return!0}return!1}function hw(F){let A=D1.isRetryableWriteError(F);return A||=F instanceof D1.MongoWriteConcernError,A||=sA(F),A&&=cw(F),A}function cw(F){let A=F instanceof D1.MongoServerError&&F.codeName&&V21.has(F.codeName);return sA(F)||!A&&F.code!==D1.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern&&F.code!==D1.MONGODB_ERROR_CODES.UnknownReplWriteConcern}function cA(F,A){let B=F[A7],D=A?.error;if(F.inTransaction()&&D&&D instanceof D1.MongoError&&D.hasErrorLabel(D1.MongoErrorLabel.TransientTransactionError))return;let J=F.client.topology;if(B&&J!=null){let X=Array.from(J.s.servers.values())[0];if(A?.error==null||A?.force){if(X.pool.checkIn(B),F[A7]=void 0,B.emit(dw.UNPINNED,F.transaction.state!==y1.TxnState.NO_TRANSACTION?lA.ConnectionPoolMetrics.TXN:lA.ConnectionPoolMetrics.CURSOR),A?.forceClear)X.pool.clear({serviceId:B.serviceId})}}}function sA(F){if(F==null||!(F instanceof D1.MongoServerError))return!1;return F.code===D1.MONGODB_ERROR_CODES.MaxTimeMSExpired||F.writeConcernError?.code===D1.MONGODB_ERROR_CODES.MaxTimeMSExpired}class G5{constructor(){this.id={id:new dA.Binary(N2.uuidV4(),dA.Binary.SUBTYPE_UUID)},this.lastUse=N2.now(),this.txnNumber=0,this.isDirty=!1}hasTimedOut(F){return Math.round(N2.calculateDurationInMs(this.lastUse)%86400000%3600000/60000)>F-1}static clone(F){let A=new ArrayBuffer(16),B=Buffer.from(A);B.set(F.id.id.buffer);let D=new dA.Binary(B,F.id.id.sub_type);return Object.setPrototypeOf({id:{id:D},lastUse:F.lastUse,txnNumber:F.txnNumber,isDirty:F.isDirty},G5.prototype)}}lw.ServerSession=G5;class yY{constructor(F){if(F==null)throw new D1.MongoRuntimeError("ServerSessionPool requires a MongoClient");this.client=F,this.sessions=new N2.List}acquire(){let F=this.client.topology?.logicalSessionTimeoutMinutes??10,A=null;while(this.sessions.length>0){let B=this.sessions.shift();if(B!=null&&(!!this.client.topology?.loadBalanced||!B.hasTimedOut(F))){A=B;break}}if(A==null)A=new G5;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((B)=>B.hasTimedOut(A)),!F.hasTimedOut(A)){if(F.isDirty)return;this.sessions.unshift(F)}}}lw.ServerSessionPool=yY;function R21(F,A,B){if(F.hasEnded)return new D1.MongoExpiredSessionError;let D=F.serverSession;if(D==null)return new D1.MongoRuntimeError("Unable to acquire server session");if(B.writeConcern?.w===0){if(F&&F.explicit)return new D1.MongoAPIError("Cannot have explicit session with unacknowledged writes");return}D.lastUse=N2.now(),A.lsid=D.id;let J=F.inTransaction()||y1.isTransactionCommand(A);if(!!B.willRetryWrite||J)D.txnNumber+=F[iA],F[iA]=0,A.txnNumber=dA.Long.fromNumber(D.txnNumber);if(!J){if(F.transaction.state!==y1.TxnState.NO_TRANSACTION)F.transaction.transition(y1.TxnState.NO_TRANSACTION);if(F.supports.causalConsistency&&F.operationTime&&N2.commandSupportsReadConcern(A))A.readConcern=A.readConcern||{},Object.assign(A.readConcern,{afterClusterTime:F.operationTime});else if(F[B7]){if(A.readConcern=A.readConcern||{level:U21.ReadConcernLevel.snapshot},F[pA]!=null)Object.assign(A.readConcern,{atClusterTime:F[pA]})}return}if(A.autocommit=!1,F.transaction.state===y1.TxnState.STARTING_TRANSACTION){F.transaction.transition(y1.TxnState.TRANSACTION_IN_PROGRESS),A.startTransaction=!0;let X=F.transaction.options.readConcern||F?.clientOptions?.readConcern;if(X)A.readConcern=X;if(F.supports.causalConsistency&&F.operationTime)A.readConcern=A.readConcern||{},Object.assign(A.readConcern,{afterClusterTime:F.operationTime})}return}function w21(F,A){if(A.$clusterTime)bY._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?.[B7]&&F[pA]==null){let B=A.atClusterTime;if(B)F[pA]=B}}});var cY=z((tw)=>{Object.defineProperty(tw,"__esModule",{value:!0});tw.SENSITIVE_COMMANDS=tw.CommandFailedEvent=tw.CommandSucceededEvent=tw.CommandStartedEvent=void 0;var E5=W0(),j6=a(),aA=o8();class sw{constructor(F,A,B){this.name=E5.COMMAND_STARTED;let D=mY(A),J=vY(D),{address:Z,connectionId:X,serviceId:Y}=dY(F);if(tw.SENSITIVE_COMMANDS.has(J))this.commandObj={},this.commandObj[J]=!0;this.address=Z,this.connectionId=X,this.serviceId=Y,this.requestId=A.requestId,this.databaseName=A.databaseName,this.commandName=J,this.command=hY(J,D,D),this.serverConnectionId=B}get hasServiceId(){return!!this.serviceId}}tw.CommandStartedEvent=sw;class aw{constructor(F,A,B,D,J){this.name=E5.COMMAND_SUCCEEDED;let Z=mY(A),X=vY(Z),{address:Y,connectionId:$,serviceId:G}=dY(F);this.address=Y,this.connectionId=$,this.serviceId=G,this.requestId=A.requestId,this.commandName=X,this.duration=j6.calculateDurationInMs(D),this.reply=hY(X,Z,S21(A,B)),this.serverConnectionId=J}get hasServiceId(){return!!this.serviceId}}tw.CommandSucceededEvent=aw;class rw{constructor(F,A,B,D,J){this.name=E5.COMMAND_FAILED;let Z=mY(A),X=vY(Z),{address:Y,connectionId:$,serviceId:G}=dY(F);this.address=Y,this.connectionId=$,this.serviceId=G,this.requestId=A.requestId,this.commandName=X,this.duration=j6.calculateDurationInMs(D),this.failure=hY(X,Z,B),this.serverConnectionId=J}get hasServiceId(){return!!this.serviceId}}tw.CommandFailedEvent=rw;tw.SENSITIVE_COMMANDS=new Set(["authenticate","saslStart","saslContinue","getnonce","createUser","updateUser","copydbgetnonce","copydbsaslstart","copydb"]);var j21=new Set(["hello",E5.LEGACY_HELLO_COMMAND,E5.LEGACY_HELLO_COMMAND_CAMEL_CASE]),vY=(F)=>Object.keys(F)[0],u21=(F)=>F.ns,O21=(F)=>F.ns.split(".")[1],hY=(F,A,B)=>tw.SENSITIVE_COMMANDS.has(F)||j21.has(F)&&A.speculativeAuthenticate?{}:B,iw={$query:"filter",$orderby:"sort",$hint:"hint",$comment:"comment",$maxScan:"maxScan",$max:"max",$min:"min",$returnKey:"returnKey",$showDiskLoc:"showRecordId",$maxTimeMS:"maxTimeMS",$snapshot:"snapshot"},nw={numberToSkip:"skip",numberToReturn:"batchSize",returnFieldSelector:"projection"},k21=["tailable","oplogReplay","noCursorTimeout","awaitData","partial","exhaust"];function mY(F){if(F instanceof aA.OpMsgRequest){let D=j6.deepCopy(F.command);if(D.ops instanceof aA.DocumentSequence)D.ops=D.ops.documents;if(D.nsInfo instanceof aA.DocumentSequence)D.nsInfo=D.nsInfo.documents;return D}if(F.query?.$query){let D;if(F.ns==="admin.$cmd")D=Object.assign({},F.query.$query);else D={find:O21(F)},Object.keys(iw).forEach((J)=>{if(F.query[J]!=null)D[iw[J]]=j6.deepCopy(F.query[J])});if(Object.keys(nw).forEach((J)=>{let Z=J;if(F[Z]!=null)D[nw[Z]]=j6.deepCopy(F[Z])}),k21.forEach((J)=>{if(F[J])D[J]=F[J]}),F.pre32Limit!=null)D.limit=F.pre32Limit;if(F.query.$explain)return{explain:D};return D}let A={},B={};if(F.query){for(let D in F.query)A[D]=j6.deepCopy(F.query[D]);B.query=A}for(let D in F){if(D==="query")continue;B[D]=j6.deepCopy(F[D])}return F.query?A:B}function S21(F,A){if(!A)return A;if(F instanceof aA.OpMsgRequest)return j6.deepCopy(A.result?A.result:A);if(F.query&&F.query.$query!=null)return{ok:1,cursor:{id:j6.deepCopy(A.cursorId),ns:u21(F),firstBatch:j6.deepCopy(A.documents)}};return j6.deepCopy(A.result?A.result:A)}function dY(F){let A;if("id"in F)A=F.id;return{address:F.address,serviceId:F.serviceId,connectionId:A}}});var AI=z((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});ew.StreamDescription=void 0;var g21=w1(),b21=v2(),y21=Y5(),v21=["minWireVersion","maxWireVersion","maxBsonObjectSize","maxMessageSizeBytes","maxWriteBatchSize","logicalSessionTimeoutMinutes"];class ow{constructor(F,A){this.hello=null,this.address=F,this.type=b21.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=y21.parseServerType(F),"connectionId"in F)this.serverConnectionId=this.parseServerConnectionID(F.connectionId);else this.serverConnectionId=null;for(let A of v21){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 g21.Long.isLong(F)?F.toBigInt():BigInt(F)}}ew.StreamDescription=ow});var DI=z((BI)=>{Object.defineProperty(BI,"__esModule",{value:!0});BI.onData=h21;var lY=a();function h21(F){let A=new lY.List,B=new lY.List,D=null,J=!1,Z={next(){let G=A.shift();if(G!=null)return Promise.resolve({value:G,done:!1});if(D!=null){let q=Promise.reject(D);return D=null,q}if(J)return $();let{promise:E,resolve:C,reject:H}=lY.promiseWithResolvers();return B.push({resolve:C,reject:H}),E},return(){return $()},throw(G){return Y(G),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this}};return F.on("data",X),F.on("error",Y),Z;function X(G){let E=B.shift();if(E!=null)E.resolve({value:G,done:!1});else A.push(G)}function Y(G){let E=B.shift();if(E!=null)E.reject(G);else D=G;$()}function $(){F.off("data",X),F.off("error",Y),J=!0;let G={value:void 0,done:J};for(let E of B)E.resolve(G);return Promise.resolve(G)}}});var eA=z(($I)=>{Object.defineProperty($I,"__esModule",{value:!0});$I.CryptoConnection=$I.SizedMessageTransform=$I.Connection=void 0;$I.hasSessionSupport=r21;var d21=import.meta.require("stream"),XI=import.meta.require("timers"),c21=w1(),Z4=W0(),r6=p(),JI=d4(),l21=d2(),p21=P0(),i21=v2(),ZI=D7(),$6=a(),pY=cY(),tA=o8(),n21=AI(),s21=e8(),a21=DI(),oA=N6(),iY=xY();function r21(F){return F.description.logicalSessionTimeoutMinutes!=null}function t21(F,A){if(A.proxyHost)return A.hostAddress.toString();let{remoteAddress:B,remotePort:D}=F;if(typeof B==="string"&&typeof D==="number")return $6.HostAddress.fromHostPort(B,D).toString();return $6.uuidV4().toString("hex")}class x0 extends l21.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.socket=F,this.id=A.id,this.address=t21(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 n21.StreamDescription(this.address,A),this.generation=A.generation,this.lastUseTime=$6.now(),this.messageStream=this.socket.on("error",this.onError.bind(this)).pipe(new nY({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 $6.calculateDurationInMs(this.lastUseTime)}get hasSessionSupport(){return this.description.logicalSessionTimeoutMinutes!=null}get supportsOpMsg(){return this.description!=null&&$6.maxWireVersion(this)>=6&&!this.description.__nodejs_mock_server__}get shouldEmitAndLogCommand(){return(this.monitorCommands||this.established&&!this.authContext?.reauthenticating&&this.mongoLogger?.willLog(JI.MongoLoggableComponent.COMMAND,JI.SeverityLevel.DEBUG))??!1}markAvailable(){this.lastUseTime=$6.now()}onError(F){this.cleanup(F)}onClose(){let F=`connection ${this.id} to ${this.address} closed`;this.cleanup(new r6.MongoNetworkError(F))}onTimeout(){this.delayedTimeoutId=XI.setTimeout(()=>{let F=`connection ${this.id} to ${this.address} timed out`,A=this.hello==null;this.cleanup(new r6.MongoNetworkTimeoutError(F,{beforeHandshake:A}))},1).unref()}destroy(){if(this.closed)return;this.removeAllListeners(x0.PINNED),this.removeAllListeners(x0.UNPINNED);let F=`connection ${this.id} to ${this.address} closed`;this.cleanup(new r6.MongoNetworkError(F))}cleanup(F){if(this.closed)return;this.socket.destroy(),this.error=F,this.dataEvents?.throw(F).then(void 0,$6.squashError),this.closed=!0,this.emit(x0.CLOSE)}prepareCommand(F,A,B){let D={...A},J=iY.getReadPreference(B),Z=B?.session,X=this.clusterTime;if(this.serverApi){let{version:G,strict:E,deprecationErrors:C}=this.serverApi;if(D.apiVersion=G,E!=null)D.apiStrict=E;if(C!=null)D.apiDeprecationErrors=C}if(this.hasSessionSupport&&Z){if(Z.clusterTime&&X&&Z.clusterTime.clusterTime.greaterThan(X.clusterTime))X=Z.clusterTime;let G=ZI.applySession(Z,D,B);if(G)throw G}else if(Z?.explicit)throw new r6.MongoCompatibilityError("Current topology does not support sessions");if(X)D.$clusterTime=X;if(this.description.type!==i21.ServerType.Standalone){if(!iY.isSharded(this)&&!this.description.loadBalanced&&this.supportsOpMsg&&B.directConnection===!0&&J?.mode==="primary")D.$readPreference=p21.ReadPreference.primaryPreferred.toJSON();else if(iY.isSharded(this)&&!this.supportsOpMsg&&J?.mode!=="primary")D={$query:D,$readPreference:J.toJSON()};else if(J?.mode!=="primary")D.$readPreference=J.toJSON()}let Y={numberToSkip:0,numberToReturn:-1,checkKeys:!1,secondaryOk:J.secondaryOk(),...B};return this.supportsOpMsg?new tA.OpMsgRequest(F,D,Y):new tA.OpQueryRequest(F,D,Y)}async*sendWire(F,A,B){if(this.throwIfAborted(),typeof A.socketTimeoutMS==="number")this.socket.setTimeout(A.socketTimeoutMS);else if(this.socketTimeoutMS!==0)this.socket.setTimeout(this.socketTimeoutMS);try{if(await this.writeCommand(F,{agreedCompressor:this.description.compressor??"none",zlibCompressionLevel:this.description.zlibCompressionLevel}),A.noResponse||F.moreToCome){yield oA.MongoDBResponse.empty;return}this.throwIfAborted();for await(let D of this.readMany()){this.socket.setTimeout(0);let J=D.parse();if(yield(B??oA.MongoDBResponse).make(J),this.throwIfAborted(),typeof A.socketTimeoutMS==="number")this.socket.setTimeout(A.socketTimeoutMS);else if(this.socketTimeoutMS!==0)this.socket.setTimeout(this.socketTimeoutMS)}}finally{this.socket.setTimeout(0)}}async*sendCommand(F,A,B,D){let J=this.prepareCommand(F.db,A,B),Z=0;if(this.shouldEmitAndLogCommand)Z=$6.now(),this.emitAndLogCommand(this.monitorCommands,x0.COMMAND_STARTED,J.databaseName,this.established,new pY.CommandStartedEvent(this,J,this.description.serverConnectionId));let X=B.documentsReturnedIn==null||!B.raw?B:{...B,raw:!1,fieldsAsRaw:{[B.documentsReturnedIn]:!0}},Y=void 0,$=void 0;try{this.throwIfAborted();for await(Y of this.sendWire(J,B,D)){if($=void 0,B.session!=null)ZI.updateSessionFromResponse(B.session,Y);if(Y.$clusterTime)this.clusterTime=Y.$clusterTime,this.emit(x0.CLUSTER_TIME_RECEIVED,Y.$clusterTime);if(Y.ok===0)throw new r6.MongoServerError($??=Y.toObject(X));if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,x0.COMMAND_SUCCEEDED,J.databaseName,this.established,new pY.CommandSucceededEvent(this,J,B.noResponse?void 0:J.moreToCome?{ok:1}:$??=Y.toObject(X),Z,this.description.serverConnectionId));if(D==null)yield $??=Y.toObject(X);else yield Y;this.throwIfAborted()}}catch(G){if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,x0.COMMAND_FAILED,J.databaseName,this.established,new pY.CommandFailedEvent(this,J,G,Z,this.description.serverConnectionId));throw G}}async command(F,A,B={},D){this.throwIfAborted();for await(let J of this.sendCommand(F,A,B,D))return J;throw new r6.MongoUnexpectedServerResponseError("Unable to get response from server")}exhaustCommand(F,A,B,D){(async()=>{this.throwIfAborted();for await(let Z of this.sendCommand(F,A,B))D(void 0,Z),this.throwIfAborted();throw new r6.MongoUnexpectedServerResponseError("Server ended moreToCome unexpectedly")})().then(void 0,D)}throwIfAborted(){if(this.error)throw this.error}async writeCommand(F,A){let B=A.agreedCompressor==="none"||!tA.OpCompressedRequest.canCompress(F)?F:new tA.OpCompressedRequest(F,{agreedCompressor:A.agreedCompressor??"none",zlibCompressionLevel:A.zlibCompressionLevel??0}),D=Buffer.concat(await B.toBin());if(this.socket.write(D))return;return await $6.once(this.socket,"drain")}async*readMany(){try{this.dataEvents=a21.onData(this.messageStream),this.messageStream.resume();for await(let F of this.dataEvents){let A=await s21.decompressResponse(F);if(yield A,!A.moreToCome)return}}finally{this.dataEvents=null,this.messageStream.pause(),this.throwIfAborted()}}}$I.Connection=x0;x0.COMMAND_STARTED=Z4.COMMAND_STARTED;x0.COMMAND_SUCCEEDED=Z4.COMMAND_SUCCEEDED;x0.COMMAND_FAILED=Z4.COMMAND_FAILED;x0.CLUSTER_TIME_RECEIVED=Z4.CLUSTER_TIME_RECEIVED;x0.CLOSE=Z4.CLOSE;x0.PINNED=Z4.PINNED;x0.UNPINNED=Z4.UNPINNED;class nY extends d21.Transform{constructor({connection:F}){super({objectMode:!1});this.bufferPool=new $6.BufferPool,this.connection=F}_transform(F,A,B){if(this.connection.delayedTimeoutId!=null)XI.clearTimeout(this.connection.delayedTimeoutId),this.connection.delayedTimeoutId=null;this.bufferPool.append(F);let D=this.bufferPool.getInt32();if(D==null)return B();if(D<0)return B(new r6.MongoParseError(`Invalid message size: ${D}, too small`));if(D>this.bufferPool.length)return B();let J=this.bufferPool.read(D);return B(null,J)}}$I.SizedMessageTransform=nY;class YI extends x0{constructor(F,A){super(F,A);this.autoEncrypter=A.autoEncrypter}async command(F,A,B,D){let{autoEncrypter:J}=this;if(!J)throw new r6.MongoMissingDependencyError("No AutoEncrypter available for encryption",{dependencyName:"n/a"});let Z=$6.maxWireVersion(this);if(Z===0)return await super.command(F,A,B,D);if(Z<8)throw new r6.MongoCompatibilityError("Auto-encryption requires a minimum MongoDB version of 4.2");let X=A.find||A.findAndModify?A.sort:null,Y=A.createIndexes?A.indexes.map((H)=>H.key):null,$=await J.encrypt(F.toString(),A,B);if(X!=null&&(A.find||A.findAndModify))$.sort=X;if(Y!=null&&A.createIndexes)for(let[H,q]of Y.entries())$.indexes[H].key=q;let G=await super.command(F,$,B,D??oA.MongoDBResponse),E=await J.decrypt(G.toBytes(),B),C=D?.make(E)??c21.deserialize(E,B);if(J[Z4.kDecorateResult]){if(D==null)$6.decorateDecryptionResult(C,G.toObject(),!0);else if(C instanceof oA.CursorResponse)C.encryptedResponse=G}return C}}$I.CryptoConnection=YI});var tY=z((zI)=>{Object.defineProperty(zI,"__esModule",{value:!0});zI.LEGAL_TCP_SOCKET_OPTIONS=zI.LEGAL_TLS_SOCKET_OPTIONS=void 0;zI.connect=J61;zI.makeConnection=qI;zI.performInitialHandshake=WI;zI.prepareHandshakeDocument=KI;zI.makeSocket=AB;var CI=import.meta.require("net"),A61=import.meta.require("tls"),HI=W0(),B61=P6(),R0=p(),sY=a(),D61=t3(),FB=n6(),EI=eA(),Z7=b4();async function J61(F){let A=null;try{let B=await AB(F);return A=qI(F,B),await WI(A,F),A}catch(B){throw A?.destroy(),B}}function qI(F,A){let B=F.connectionType??EI.Connection;if(F.autoEncrypter)B=EI.CryptoConnection;return new B(A,F)}function Z61(F,A){let B=Number(F.maxWireVersion),D=Number(F.minWireVersion),J=!Number.isNaN(B)&&B>=Z7.MIN_SUPPORTED_WIRE_VERSION,Z=!Number.isNaN(D)&&D<=Z7.MAX_SUPPORTED_WIRE_VERSION;if(J){if(Z)return null;let Y=`Server at ${A.hostAddress} reports minimum wire version ${JSON.stringify(F.minWireVersion)}, but this version of the Node.js Driver requires at most ${Z7.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${Z7.MAX_SUPPORTED_SERVER_VERSION})`;return new R0.MongoCompatibilityError(Y)}let X=`Server at ${A.hostAddress} reports maximum wire version ${JSON.stringify(F.maxWireVersion)??0}, but this version of the Node.js Driver requires at least ${Z7.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${Z7.MIN_SUPPORTED_SERVER_VERSION})`;return new R0.MongoCompatibilityError(X)}async function WI(F,A){let B=A.credentials;if(B){if(B.mechanism!==FB.AuthMechanism.MONGODB_DEFAULT&&!A.authProviders.getOrCreateProvider(B.mechanism,B.mechanismProperties))throw new R0.MongoInvalidArgumentError(`AuthMechanism '${B.mechanism}' not supported`)}let D=new D61.AuthContext(F,B,A);F.authContext=D;let J=await KI(D),Z={...A,raw:!1};if(typeof A.connectTimeoutMS==="number")Z.socketTimeoutMS=A.connectTimeoutMS;let X=new Date().getTime(),Y=await F.command(sY.ns("admin.$cmd"),J,Z);if(!("isWritablePrimary"in Y))Y.isWritablePrimary=Y[HI.LEGACY_HELLO_COMMAND];if(Y.helloOk)F.helloOk=!0;let $=Z61(Y,A);if($)throw $;if(A.loadBalanced){if(!Y.serviceId)throw new R0.MongoCompatibilityError("Driver attempted to initialize in load balancing mode, but the server does not support this mode.")}if(F.hello=Y,F.lastHelloMS=new Date().getTime()-X,!Y.arbiterOnly&&B){D.response=Y;let G=B.resolveAuthMechanism(Y),E=A.authProviders.getOrCreateProvider(G.mechanism,G.mechanismProperties);if(!E)throw new R0.MongoInvalidArgumentError(`No AuthProvider for ${G.mechanism} defined.`);try{await E.auth(D)}catch(C){if(C instanceof R0.MongoError){if(C.addErrorLabel(R0.MongoErrorLabel.HandshakeError),R0.needsRetryableWriteLabel(C,Y.maxWireVersion,F.description.type))C.addErrorLabel(R0.MongoErrorLabel.RetryableWriteError)}throw C}}F.established=!0}async function KI(F){let A=F.options,B=A.compressors?A.compressors:[],{serverApi:D}=F.connection,J=await A.extendedMetadata,Z={[D?.version||A.loadBalanced===!0?"hello":HI.LEGACY_HELLO_COMMAND]:1,helloOk:!0,client:J,compression:B};if(A.loadBalanced===!0)Z.loadBalanced=!0;let X=F.credentials;if(X){if(X.mechanism===FB.AuthMechanism.MONGODB_DEFAULT&&X.username){Z.saslSupportedMechs=`${X.source}.${X.username}`;let $=F.options.authProviders.getOrCreateProvider(FB.AuthMechanism.MONGODB_SCRAM_SHA256,X.mechanismProperties);if(!$)throw new R0.MongoInvalidArgumentError(`No AuthProvider for ${FB.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`);return await $.prepare(Z,F)}let Y=F.options.authProviders.getOrCreateProvider(X.mechanism,X.mechanismProperties);if(!Y)throw new R0.MongoInvalidArgumentError(`No AuthProvider for ${X.mechanism} defined.`);return await Y.prepare(Z,F)}return Z}zI.LEGAL_TLS_SOCKET_OPTIONS=["allowPartialTrustChain","ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","ecdhCurve","key","minDHSize","passphrase","pfx","rejectUnauthorized","secureContext","secureProtocol","servername","session"];zI.LEGAL_TCP_SOCKET_OPTIONS=["autoSelectFamily","autoSelectFamilyAttemptTimeout","family","hints","localAddress","localPort","lookup"];function aY(F){let A=F.hostAddress;if(!A)throw new R0.MongoInvalidArgumentError('Option "hostAddress" is required');let B={};for(let D of zI.LEGAL_TCP_SOCKET_OPTIONS)if(F[D]!=null)B[D]=F[D];if(typeof A.socketPath==="string")return B.path=A.socketPath,B;else if(typeof A.host==="string")return B.host=A.host,B.port=A.port,B;else throw new R0.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(A)}`)}function X61(F){let A=aY(F);for(let B of zI.LEGAL_TLS_SOCKET_OPTIONS)if(F[B]!=null)A[B]=F[B];if(F.existingSocket)A.socket=F.existingSocket;if(A.servername==null&&A.host&&!CI.isIP(A.host))A.servername=A.host;return A}async function AB(F){let A=F.tls??!1,B=F.noDelay??!0,D=F.connectTimeoutMS??30000,J=F.existingSocket,Z;if(F.proxyHost!=null)return await $61({...F,connectTimeoutMS:D});if(A){let E=A61.connect(X61(F));if(typeof E.disableRenegotiation==="function")E.disableRenegotiation();Z=E}else if(J)Z=J;else Z=CI.createConnection(aY(F));Z.setKeepAlive(!0,300000),Z.setTimeout(D),Z.setNoDelay(B);let X=null,{promise:Y,resolve:$,reject:G}=sY.promiseWithResolvers();if(J)$(Z);else{let E=A?"secureConnect":"connect";if(Z.once(E,()=>$(Z)).once("error",(C)=>G(C5("error",C))).once("timeout",()=>G(C5("timeout"))).once("close",()=>G(C5("close"))),F.cancellationToken!=null)X=()=>G(C5("cancel")),F.cancellationToken.once("cancel",X)}try{return Z=await Y,Z}catch(E){throw Z.destroy(),E}finally{if(Z.setTimeout(0),Z.removeAllListeners(),X!=null)F.cancellationToken?.removeListener("cancel",X)}}var H5=null;function Y61(){if(H5==null){let F=B61.getSocks();if("kModuleError"in F)throw F.kModuleError;H5=F}return H5}async function $61(F){let A=sY.HostAddress.fromHostPort(F.proxyHost??"",F.proxyPort??1080),B=await AB({...F,hostAddress:A,tls:!1,proxyHost:void 0}),D=aY(F);if(typeof D.host!=="string"||typeof D.port!=="number")throw new R0.MongoInvalidArgumentError("Can only make Socks5 connections to TCP hosts");H5??=Y61();try{let{socket:J}=await H5.SocksClient.createConnection({existing_socket:B,timeout:F.connectTimeoutMS,command:"connect",destination:{host:D.host,port:D.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:F.proxyUsername||void 0,password:F.proxyPassword||void 0}});return await AB({...F,existingSocket:J,proxyHost:void 0})}catch(J){throw C5("error",J)}}function C5(F,A){switch(F){case"error":return new R0.MongoNetworkError(R0.MongoError.buildErrorMessage(A),{cause:A});case"timeout":return new R0.MongoNetworkTimeoutError("connection timed out");case"close":return new R0.MongoNetworkError("connection closed");case"cancel":return new R0.MongoNetworkError("connection establishment was cancelled");default:return new R0.MongoNetworkError("unknown network error")}}});var BB=z((TI)=>{Object.defineProperty(TI,"__esModule",{value:!0});TI.ServerHeartbeatFailedEvent=TI.ServerHeartbeatSucceededEvent=TI.ServerHeartbeatStartedEvent=TI.TopologyClosedEvent=TI.TopologyOpeningEvent=TI.TopologyDescriptionChangedEvent=TI.ServerClosedEvent=TI.ServerOpeningEvent=TI.ServerDescriptionChangedEvent=void 0;var U3=W0();class QI{constructor(F,A,B,D){this.name=U3.SERVER_DESCRIPTION_CHANGED,this.topologyId=F,this.address=A,this.previousDescription=B,this.newDescription=D}}TI.ServerDescriptionChangedEvent=QI;class LI{constructor(F,A){this.name=U3.SERVER_OPENING,this.topologyId=F,this.address=A}}TI.ServerOpeningEvent=LI;class VI{constructor(F,A){this.name=U3.SERVER_CLOSED,this.topologyId=F,this.address=A}}TI.ServerClosedEvent=VI;class RI{constructor(F,A,B){this.name=U3.TOPOLOGY_DESCRIPTION_CHANGED,this.topologyId=F,this.previousDescription=A,this.newDescription=B}}TI.TopologyDescriptionChangedEvent=RI;class wI{constructor(F){this.name=U3.TOPOLOGY_OPENING,this.topologyId=F}}TI.TopologyOpeningEvent=wI;class II{constructor(F){this.name=U3.TOPOLOGY_CLOSED,this.topologyId=F}}TI.TopologyClosedEvent=II;class NI{constructor(F,A){this.name=U3.SERVER_HEARTBEAT_STARTED,this.connectionId=F,this.awaited=A}}TI.ServerHeartbeatStartedEvent=NI;class PI{constructor(F,A,B,D){this.name=U3.SERVER_HEARTBEAT_SUCCEEDED,this.connectionId=F,this.duration=A,this.reply=B??{},this.awaited=D}}TI.ServerHeartbeatSucceededEvent=PI;class MI{constructor(F,A,B,D){this.name=U3.SERVER_HEARTBEAT_FAILED,this.connectionId=F,this.duration=A,this.failure=B,this.awaited=D}}TI.ServerHeartbeatFailedEvent=MI});var q5=z((OI)=>{Object.defineProperty(OI,"__esModule",{value:!0});OI.Timeout=OI.TimeoutError=void 0;var uI=import.meta.require("timers"),w61=p(),I61=a();class oY extends Error{get name(){return"TimeoutError"}constructor(F,A){super(F,A)}static is(F){return F!=null&&typeof F==="object"&&"name"in F&&F.name==="TimeoutError"}}OI.TimeoutError=oY;class eY extends Promise{get[Symbol.toStringTag](){return"MongoDBTimeout"}constructor(F=()=>null,A,B=!1){let D;if(A<0)throw new w61.MongoInvalidArgumentError("Cannot create a Timeout with a negative duration");super((J,Z)=>{D=Z,F(I61.noop,Z)});if(this.ended=null,this.timedOut=!1,this.duration=A,this.start=Math.trunc(performance.now()),this.duration>0){if(this.id=uI.setTimeout(()=>{this.ended=Math.trunc(performance.now()),this.timedOut=!0,D(new oY(`Expired after ${A}ms`))},this.duration),typeof this.id.unref==="function"&&B)this.id.unref()}}clear(){uI.clearTimeout(this.id),this.id=void 0}static expires(F,A){return new eY(void 0,F,A)}static is(F){return typeof F==="object"&&F!=null&&Symbol.toStringTag in F&&F[Symbol.toStringTag]==="MongoDBTimeout"&&"then"in F&&typeof F.then==="function"}}OI.Timeout=eY});var A$=z((cI)=>{Object.defineProperty(cI,"__esModule",{value:!0});cI.ConnectionPoolClearedEvent=cI.ConnectionCheckedInEvent=cI.ConnectionCheckedOutEvent=cI.ConnectionCheckOutFailedEvent=cI.ConnectionCheckOutStartedEvent=cI.ConnectionClosedEvent=cI.ConnectionReadyEvent=cI.ConnectionCreatedEvent=cI.ConnectionPoolClosedEvent=cI.ConnectionPoolReadyEvent=cI.ConnectionPoolCreatedEvent=cI.ConnectionPoolMonitoringEvent=void 0;var u6=W0(),F$=a();class l2{constructor(F){this.time=new Date,this.address=F.address}}cI.ConnectionPoolMonitoringEvent=l2;class SI extends l2{constructor(F){super(F);this.name=u6.CONNECTION_POOL_CREATED;let{maxConnecting:A,maxPoolSize:B,minPoolSize:D,maxIdleTimeMS:J,waitQueueTimeoutMS:Z}=F.options;this.options={maxConnecting:A,maxPoolSize:B,minPoolSize:D,maxIdleTimeMS:J,waitQueueTimeoutMS:Z}}}cI.ConnectionPoolCreatedEvent=SI;class xI extends l2{constructor(F){super(F);this.name=u6.CONNECTION_POOL_READY}}cI.ConnectionPoolReadyEvent=xI;class fI extends l2{constructor(F){super(F);this.name=u6.CONNECTION_POOL_CLOSED}}cI.ConnectionPoolClosedEvent=fI;class _I extends l2{constructor(F,A){super(F);this.name=u6.CONNECTION_CREATED,this.connectionId=A.id}}cI.ConnectionCreatedEvent=_I;class gI extends l2{constructor(F,A,B){super(F);this.name=u6.CONNECTION_READY,this.durationMS=F$.now()-B,this.connectionId=A.id}}cI.ConnectionReadyEvent=gI;class bI extends l2{constructor(F,A,B,D){super(F);this.name=u6.CONNECTION_CLOSED,this.connectionId=A.id,this.reason=B,this.serviceId=A.serviceId,this.error=D??null}}cI.ConnectionClosedEvent=bI;class yI extends l2{constructor(F){super(F);this.name=u6.CONNECTION_CHECK_OUT_STARTED}}cI.ConnectionCheckOutStartedEvent=yI;class vI extends l2{constructor(F,A,B,D){super(F);this.name=u6.CONNECTION_CHECK_OUT_FAILED,this.durationMS=F$.now()-B,this.reason=A,this.error=D}}cI.ConnectionCheckOutFailedEvent=vI;class hI extends l2{constructor(F,A,B){super(F);this.name=u6.CONNECTION_CHECKED_OUT,this.durationMS=F$.now()-B,this.connectionId=A.id}}cI.ConnectionCheckedOutEvent=hI;class mI extends l2{constructor(F,A){super(F);this.name=u6.CONNECTION_CHECKED_IN,this.connectionId=A.id}}cI.ConnectionCheckedInEvent=mI;class dI extends l2{constructor(F,A={}){super(F);this.name=u6.CONNECTION_POOL_CLEARED,this.serviceId=A.serviceId,this.interruptInUseConnections=A.interruptInUseConnections}}cI.ConnectionPoolClearedEvent=dI});var D$=z((sI)=>{Object.defineProperty(sI,"__esModule",{value:!0});sI.WaitQueueTimeoutError=sI.PoolClearedOnNetworkError=sI.PoolClearedError=sI.PoolClosedError=void 0;var DB=p();class pI extends DB.MongoDriverError{constructor(F){super("Attempted to check out a connection from closed connection pool");this.address=F.address}get name(){return"MongoPoolClosedError"}}sI.PoolClosedError=pI;class B$ extends DB.MongoNetworkError{constructor(F,A){let B=A?A:`Connection pool for ${F.address} was cleared because another operation failed with: "${F.serverError?.message}"`;super(B,F.serverError?{cause:F.serverError}:void 0);this.address=F.address,this.addErrorLabel(DB.MongoErrorLabel.PoolRequstedRetry)}get name(){return"MongoPoolClearedError"}}sI.PoolClearedError=B$;class iI extends B${constructor(F){super(F,`Connection to ${F.address} interrupted due to server monitor timeout`)}get name(){return"PoolClearedOnNetworkError"}}sI.PoolClearedOnNetworkError=iI;class nI extends DB.MongoDriverError{constructor(F,A){super(F);this.address=A}get name(){return"MongoWaitQueueTimeoutError"}}sI.WaitQueueTimeoutError=nI});var AN=z((eI)=>{Object.defineProperty(eI,"__esModule",{value:!0});eI.ConnectionPool=eI.PoolState=void 0;var X7=import.meta.require("timers"),E6=W0(),Q3=p(),rI=d2(),tI=q5(),Y7=a(),v61=tY(),JB=eA(),f0=A$(),$7=D$(),h61=uY(),G7=Symbol("server"),L3=Symbol("connections"),E7=Symbol("pending"),X4=Symbol("checkedOut"),n4=Symbol("minPoolSizeTimer"),C7=Symbol("generation"),oI=Symbol("serviceGenerations"),ZB=Symbol("connectionCounter"),XB=Symbol("cancellationToken"),V3=Symbol("waitQueue"),YB=Symbol("cancelled"),$B=Symbol("metrics"),GB=Symbol("processingWaitQueue"),O6=Symbol("poolState");eI.PoolState=Object.freeze({paused:"paused",ready:"ready",closed:"closed"});class S1 extends rI.TypedEventEmitter{constructor(F,A){super();if(this.options=Object.freeze({connectionType:JB.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 Q3.MongoInvalidArgumentError("Connection pool minimum size must not be greater than maximum pool size");this[O6]=eI.PoolState.paused,this[G7]=F,this[L3]=new Y7.List,this[E7]=0,this[X4]=new Set,this[n4]=void 0,this[C7]=0,this[oI]=new Map,this[ZB]=Y7.makeCounter(1),this[XB]=new rI.CancellationToken,this[XB].setMaxListeners(1/0),this[V3]=new Y7.List,this[$B]=new h61.ConnectionPoolMetrics,this[GB]=!1,this.mongoLogger=this[G7].topology.client?.mongoLogger,this.component="connection",process.nextTick(()=>{this.emitAndLog(S1.CONNECTION_POOL_CREATED,new f0.ConnectionPoolCreatedEvent(this))})}get address(){return this.options.hostAddress.toString()}get closed(){return this[O6]===eI.PoolState.closed}get generation(){return this[C7]}get totalConnectionCount(){return this.availableConnectionCount+this.pendingConnectionCount+this.currentCheckedOutCount}get availableConnectionCount(){return this[L3].length}get pendingConnectionCount(){return this[E7]}get currentCheckedOutCount(){return this[X4].size}get waitQueueSize(){return this[V3].length}get loadBalanced(){return this.options.loadBalanced}get serviceGenerations(){return this[oI]}get serverError(){return this[G7].description.error}get checkedOutConnections(){return this[X4]}waitQueueErrorMetrics(){return this[$B].info(this.options.maxPoolSize)}ready(){if(this[O6]!==eI.PoolState.paused)return;this[O6]=eI.PoolState.ready,this.emitAndLog(S1.CONNECTION_POOL_READY,new f0.ConnectionPoolReadyEvent(this)),X7.clearTimeout(this[n4]),this.ensureMinPoolSize()}async checkOut(){let F=Y7.now();this.emitAndLog(S1.CONNECTION_CHECK_OUT_STARTED,new f0.ConnectionCheckOutStartedEvent(this));let A=this.options.waitQueueTimeoutMS,{promise:B,resolve:D,reject:J}=Y7.promiseWithResolvers(),Z=tI.Timeout.expires(A),X={resolve:D,reject:J,timeout:Z,checkoutTime:F};this[V3].push(X),process.nextTick(()=>this.processWaitQueue());try{return await Promise.race([B,X.timeout])}catch(Y){if(tI.TimeoutError.is(Y))throw X[YB]=!0,X.timeout.clear(),this.emitAndLog(S1.CONNECTION_CHECK_OUT_FAILED,new f0.ConnectionCheckOutFailedEvent(this,"timeout",X.checkoutTime)),new $7.WaitQueueTimeoutError(this.loadBalanced?this.waitQueueErrorMetrics():"Timed out while checking out a connection from connection pool",this.address);throw Y}}checkIn(F){if(!this[X4].has(F))return;let A=this.closed,B=this.connectionIsStale(F),D=!!(A||B||F.closed);if(!D)F.markAvailable(),this[L3].unshift(F);if(this[X4].delete(F),this.emitAndLog(S1.CONNECTION_CHECKED_IN,new f0.ConnectionCheckedInEvent(this,F)),D){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 Q3.MongoRuntimeError("ConnectionPool.clear() called in load balanced mode with no serviceId.");let Z=J.toHexString(),X=this.serviceGenerations.get(Z);if(X==null)throw new Q3.MongoRuntimeError("Service generations are required in load balancer mode.");else this.serviceGenerations.set(Z,X+1);this.emitAndLog(S1.CONNECTION_POOL_CLEARED,new f0.ConnectionPoolClearedEvent(this,{serviceId:J}));return}let A=F.interruptInUseConnections??!1,B=this[C7];this[C7]+=1;let D=this[O6]===eI.PoolState.paused;if(this[O6]=eI.PoolState.paused,this.clearMinPoolSizeTimer(),!D)this.emitAndLog(S1.CONNECTION_POOL_CLEARED,new f0.ConnectionPoolClearedEvent(this,{interruptInUseConnections:A}));if(A)process.nextTick(()=>this.interruptInUseConnections(B));this.processWaitQueue()}interruptInUseConnections(F){for(let A of this[X4])if(A.generation<=F)A.onError(new $7.PoolClearedOnNetworkError(this)),this.checkIn(A)}close(){if(this.closed)return;if(this[XB].emit("cancel"),typeof this[ZB].return==="function")this[ZB].return(void 0);this[O6]=eI.PoolState.closed,this.clearMinPoolSizeTimer(),this.processWaitQueue();for(let F of this[L3])this.emitAndLog(S1.CONNECTION_CLOSED,new f0.ConnectionClosedEvent(this,F,"poolClosed")),F.destroy();this[L3].clear(),this.emitAndLog(S1.CONNECTION_POOL_CLOSED,new f0.ConnectionPoolClosedEvent(this))}async reauthenticate(F){let A=F.authContext;if(!A)throw new Q3.MongoRuntimeError("No auth context found on connection.");let B=A.credentials;if(!B)throw new Q3.MongoMissingCredentialsError("Connection is missing credentials when asked to reauthenticate");let D=B.resolveAuthMechanism(F.hello),J=this[G7].topology.client.s.authProviders.getOrCreateProvider(D.mechanism,D.mechanismProperties);if(!J)throw new Q3.MongoMissingCredentialsError(`Reauthenticate failed due to no auth provider for ${B.mechanism}`);await J.reauth(A);return}clearMinPoolSizeTimer(){let F=this[n4];if(F)X7.clearTimeout(F)}destroyConnection(F,A){this.emitAndLog(S1.CONNECTION_CLOSED,new f0.ConnectionClosedEvent(this,F,A)),F.destroy()}connectionIsStale(F){let A=F.serviceId;if(this.loadBalanced&&A){let B=A.toHexString(),D=this.serviceGenerations.get(B);return F.generation!==D}return F.generation!==this[C7]}connectionIsIdle(F){return!!(this.options.maxIdleTimeMS&&F.idleTime>this.options.maxIdleTimeMS)}destroyConnectionIfPerished(F){let A=this.connectionIsStale(F),B=this.connectionIsIdle(F);if(!A&&!B&&!F.closed)return!1;let D=F.closed?"error":A?"stale":"idle";return this.destroyConnection(F,D),!0}createConnection(F){let A={...this.options,id:this[ZB].next().value,generation:this[C7],cancellationToken:this[XB],mongoLogger:this.mongoLogger,authProviders:this[G7].topology.client.s.authProviders};this[E7]++;let B=Y7.now();this.emitAndLog(S1.CONNECTION_CREATED,new f0.ConnectionCreatedEvent(this,{id:A.id})),v61.connect(A).then((D)=>{if(this[O6]!==eI.PoolState.ready){this[E7]--,D.destroy(),F(this.closed?new $7.PoolClosedError(this):new $7.PoolClearedError(this));return}for(let J of[...E6.APM_EVENTS,JB.Connection.CLUSTER_TIME_RECEIVED])D.on(J,(Z)=>this.emit(J,Z));if(this.loadBalanced){D.on(JB.Connection.PINNED,(Z)=>this[$B].markPinned(Z)),D.on(JB.Connection.UNPINNED,(Z)=>this[$B].markUnpinned(Z));let J=D.serviceId;if(J){let Z,X=J.toHexString();if(Z=this.serviceGenerations.get(X))D.generation=Z;else this.serviceGenerations.set(X,0),D.generation=0}}D.markAvailable(),this.emitAndLog(S1.CONNECTION_READY,new f0.ConnectionReadyEvent(this,D,B)),this[E7]--,F(void 0,D)},(D)=>{if(this[E7]--,this.emitAndLog(S1.CONNECTION_CLOSED,new f0.ConnectionClosedEvent(this,{id:A.id,serviceId:void 0},"error",D)),D instanceof Q3.MongoNetworkError||D instanceof Q3.MongoServerError)D.connectionGeneration=A.generation;F(D??new Q3.MongoRuntimeError("Connection creation failed without error"))})}ensureMinPoolSize(){let F=this.options.minPoolSize;if(this[O6]!==eI.PoolState.ready||F===0)return;if(this[L3].prune((A)=>this.destroyConnectionIfPerished(A)),this.totalConnectionCount<F&&this.pendingConnectionCount<this.options.maxConnecting)this.createConnection((A,B)=>{if(A)this[G7].handleError(A);if(!A&&B)this[L3].push(B),process.nextTick(()=>this.processWaitQueue());if(this[O6]===eI.PoolState.ready)X7.clearTimeout(this[n4]),this[n4]=X7.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)});else X7.clearTimeout(this[n4]),this[n4]=X7.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)}processWaitQueue(){if(this[GB])return;this[GB]=!0;while(this.waitQueueSize){let B=this[V3].first();if(!B){this[V3].shift();continue}if(B[YB]){this[V3].shift();continue}if(this[O6]!==eI.PoolState.ready){let J=this.closed?"poolClosed":"connectionError",Z=this.closed?new $7.PoolClosedError(this):new $7.PoolClearedError(this);this.emitAndLog(S1.CONNECTION_CHECK_OUT_FAILED,new f0.ConnectionCheckOutFailedEvent(this,J,B.checkoutTime,Z)),B.timeout.clear(),this[V3].shift(),B.reject(Z);continue}if(!this.availableConnectionCount)break;let D=this[L3].shift();if(!D)break;if(!this.destroyConnectionIfPerished(D))this[X4].add(D),this.emitAndLog(S1.CONNECTION_CHECKED_OUT,new f0.ConnectionCheckedOutEvent(this,D,B.checkoutTime)),B.timeout.clear(),this[V3].shift(),B.resolve(D)}let{maxPoolSize:F,maxConnecting:A}=this.options;while(this.waitQueueSize>0&&this.pendingConnectionCount<A&&(F===0||this.totalConnectionCount<F)){let B=this[V3].shift();if(!B||B[YB])continue;this.createConnection((D,J)=>{if(B[YB]){if(!D&&J)this[L3].push(J)}else{if(D)this.emitAndLog(S1.CONNECTION_CHECK_OUT_FAILED,new f0.ConnectionCheckOutFailedEvent(this,"connectionError",B.checkoutTime,D)),B.reject(D);else if(J)this[X4].add(J),this.emitAndLog(S1.CONNECTION_CHECKED_OUT,new f0.ConnectionCheckedOutEvent(this,J,B.checkoutTime)),B.resolve(J);B.timeout.clear()}process.nextTick(()=>this.processWaitQueue())})}this[GB]=!1}}eI.ConnectionPool=S1;S1.CONNECTION_POOL_CREATED=E6.CONNECTION_POOL_CREATED;S1.CONNECTION_POOL_CLOSED=E6.CONNECTION_POOL_CLOSED;S1.CONNECTION_POOL_CLEARED=E6.CONNECTION_POOL_CLEARED;S1.CONNECTION_POOL_READY=E6.CONNECTION_POOL_READY;S1.CONNECTION_CREATED=E6.CONNECTION_CREATED;S1.CONNECTION_READY=E6.CONNECTION_READY;S1.CONNECTION_CLOSED=E6.CONNECTION_CLOSED;S1.CONNECTION_CHECK_OUT_STARTED=E6.CONNECTION_CHECK_OUT_STARTED;S1.CONNECTION_CHECK_OUT_FAILED=E6.CONNECTION_CHECK_OUT_FAILED;S1.CONNECTION_CHECKED_OUT=E6.CONNECTION_CHECKED_OUT;S1.CONNECTION_CHECKED_IN=E6.CONNECTION_CHECKED_IN});var $$=z((JN)=>{Object.defineProperty(JN,"__esModule",{value:!0});JN.Server=void 0;var m61=eA(),d61=AN(),c61=D$(),t6=W0(),t1=p(),l61=d2(),X$=fY(),EB=a(),BN=c0(),d1=v2(),p61=G$(),Y$=Y5(),W5=EB.makeStateMachine({[d1.STATE_CLOSED]:[d1.STATE_CLOSED,d1.STATE_CONNECTING],[d1.STATE_CONNECTING]:[d1.STATE_CONNECTING,d1.STATE_CLOSING,d1.STATE_CONNECTED,d1.STATE_CLOSED],[d1.STATE_CONNECTED]:[d1.STATE_CONNECTED,d1.STATE_CLOSING,d1.STATE_CLOSED],[d1.STATE_CLOSING]:[d1.STATE_CLOSING,d1.STATE_CLOSED]});class P2 extends l61.TypedEventEmitter{constructor(F,A,B){super();this.serverApi=B.serverApi;let D={hostAddress:A.hostAddress,...B};this.topology=F,this.pool=new d61.ConnectionPool(this,D),this.s={description:A,options:B,state:d1.STATE_CLOSED,operationCount:0};for(let J of[...t6.CMAP_EVENTS,...t6.APM_EVENTS])this.pool.on(J,(Z)=>this.emit(J,Z));if(this.pool.on(m61.Connection.CLUSTER_TIME_RECEIVED,(J)=>{this.clusterTime=J}),this.loadBalanced){this.monitor=null;return}this.monitor=new p61.Monitor(this,this.s.options);for(let J of t6.HEARTBEAT_EVENTS)this.monitor.on(J,(Z)=>this.emit(J,Z));this.monitor.on("resetServer",(J)=>J$(this,J)),this.monitor.on(P2.SERVER_HEARTBEAT_SUCCEEDED,(J)=>{if(this.emit(P2.DESCRIPTION_RECEIVED,new Y$.ServerDescription(this.description.hostAddress,J.reply,{roundTripTime:this.monitor?.roundTripTime,minRoundTripTime:this.monitor?.minRoundTripTime})),this.s.state===d1.STATE_CONNECTING)W5(this,d1.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===d1.TopologyType.LoadBalanced}connect(){if(this.s.state!==d1.STATE_CLOSED)return;if(W5(this,d1.STATE_CONNECTING),!this.loadBalanced)this.monitor?.connect();else W5(this,d1.STATE_CONNECTED),this.emit(P2.CONNECT,this)}destroy(){if(this.s.state===d1.STATE_CLOSED)return;if(W5(this,d1.STATE_CLOSING),!this.loadBalanced)this.monitor?.close();this.pool.close(),W5(this,d1.STATE_CLOSED),this.emit("closed")}requestCheck(){if(!this.loadBalanced)this.monitor?.requestCheck()}async command(F,A,B,D){if(F.db==null||typeof F==="string")throw new t1.MongoInvalidArgumentError("Namespace must not be a string");if(this.s.state===d1.STATE_CLOSING||this.s.state===d1.STATE_CLOSED)throw new t1.MongoServerClosedError;let J=Object.assign({},B,{wireProtocolCommand:!1,directConnection:this.topology.s.options.directConnection});if(J.omitReadPreference)delete J.readPreference;let Z=J.session,X=Z?.pinnedConnection;if(this.incrementOperationCount(),X==null)try{if(X=await this.pool.checkOut(),this.loadBalanced&&i61(A,Z))Z?.pin(X)}catch(Y){if(this.decrementOperationCount(),!(Y instanceof c61.PoolClearedError))this.handleError(Y);throw Y}try{try{let Y=await X.command(F,A,J,D);return BN.throwIfWriteConcernError(Y),Y}catch(Y){throw this.decorateCommandError(X,A,J,Y)}}catch(Y){if(Y instanceof t1.MongoError&&Y.code===t1.MONGODB_ERROR_CODES.Reauthenticate){await this.pool.reauthenticate(X);try{let $=await X.command(F,A,J,D);return BN.throwIfWriteConcernError($),$}catch($){throw this.decorateCommandError(X,A,J,$)}}else throw Y}finally{if(this.decrementOperationCount(),Z?.pinnedConnection!==X)this.pool.checkIn(X)}}handleError(F,A){if(!(F instanceof t1.MongoError))return;if(F.connectionGeneration&&F.connectionGeneration<this.pool.generation)return;let D=F instanceof t1.MongoNetworkError&&!(F instanceof t1.MongoNetworkTimeoutError),J=t1.isNetworkErrorBeforeHandshake(F),Z=F.hasErrorLabel(t1.MongoErrorLabel.HandshakeError);if(D||J||Z){if(!this.loadBalanced)F.addErrorLabel(t1.MongoErrorLabel.ResetPool),J$(this,F);else if(A)this.pool.clear({serviceId:A.serviceId})}else if(t1.isSDAMUnrecoverableError(F)){if(s61(this,F)){let X=EB.maxWireVersion(this)<=7||t1.isNodeShuttingDownError(F);if(this.loadBalanced&&A&&X)this.pool.clear({serviceId:A.serviceId});if(!this.loadBalanced){if(X)F.addErrorLabel(t1.MongoErrorLabel.ResetPool);J$(this,F),process.nextTick(()=>this.requestCheck())}}}}decorateCommandError(F,A,B,D){if(typeof D!=="object"||D==null||!("name"in D))throw new t1.MongoRuntimeError("An unexpected error type: "+typeof D);if(D.name==="AbortError"&&"cause"in D&&D.cause instanceof t1.MongoError)D=D.cause;if(!(D instanceof t1.MongoError))return D;if(n61(this.pool,F))return D;let J=B?.session;if(D instanceof t1.MongoNetworkError){if(J&&!J.hasEnded&&J.serverSession)J.serverSession.isDirty=!0;if(Z$(J,A)&&!D.hasErrorLabel(t1.MongoErrorLabel.TransientTransactionError))D.addErrorLabel(t1.MongoErrorLabel.TransientTransactionError);if((DN(this.topology)||X$.isTransactionCommand(A))&&EB.supportsRetryableWrites(this)&&!Z$(J,A))D.addErrorLabel(t1.MongoErrorLabel.RetryableWriteError)}else if((DN(this.topology)||X$.isTransactionCommand(A))&&t1.needsRetryableWriteLabel(D,EB.maxWireVersion(this),this.description.type)&&!Z$(J,A))D.addErrorLabel(t1.MongoErrorLabel.RetryableWriteError);if(J&&J.isPinned&&D.hasErrorLabel(t1.MongoErrorLabel.TransientTransactionError))J.unpin({force:!0});return this.handleError(D,F),D}decrementOperationCount(){return this.s.operationCount-=1}incrementOperationCount(){return this.s.operationCount+=1}}JN.Server=P2;P2.SERVER_HEARTBEAT_STARTED=t6.SERVER_HEARTBEAT_STARTED;P2.SERVER_HEARTBEAT_SUCCEEDED=t6.SERVER_HEARTBEAT_SUCCEEDED;P2.SERVER_HEARTBEAT_FAILED=t6.SERVER_HEARTBEAT_FAILED;P2.CONNECT=t6.CONNECT;P2.DESCRIPTION_RECEIVED=t6.DESCRIPTION_RECEIVED;P2.CLOSED=t6.CLOSED;P2.ENDED=t6.ENDED;function J$(F,A){if(F.loadBalanced)return;if(A instanceof t1.MongoNetworkError&&!(A instanceof t1.MongoNetworkTimeoutError))F.monitor?.reset();F.emit(P2.DESCRIPTION_RECEIVED,new Y$.ServerDescription(F.description.hostAddress,void 0,{error:A}))}function i61(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 n61(F,A){if(A.serviceId)return A.generation!==F.serviceGenerations.get(A.serviceId.toHexString());return A.generation!==F.generation}function s61(F,A){let B=A.topologyVersion,D=F.description.topologyVersion;return Y$.compareTopologyVersion(D,B)<0}function Z$(F,A){return F&&F.inTransaction()&&!X$.isTransactionCommand(A)}function DN(F){return F.s.options.retryWrites!==!1}});var G$=z((CN)=>{Object.defineProperty(CN,"__esModule",{value:!0});CN.RTTSampler=CN.MonitorInterval=CN.RTTPinger=CN.Monitor=CN.ServerMonitoringMode=void 0;var Y4=import.meta.require("timers"),XN=w1(),CB=tY(),a61=EY(),E$=W0(),H7=p(),r61=d4(),YN=d2(),i0=a(),_0=v2(),K5=BB(),z5=$$(),o6=Symbol("server"),e6=Symbol("monitorId"),K7=Symbol("cancellationToken"),q7="idle",s4="monitoring",W7=i0.makeStateMachine({[_0.STATE_CLOSING]:[_0.STATE_CLOSING,q7,_0.STATE_CLOSED],[_0.STATE_CLOSED]:[_0.STATE_CLOSED,s4],[q7]:[q7,s4,_0.STATE_CLOSING],[s4]:[s4,q7,_0.STATE_CLOSING]}),t61=new Set([_0.STATE_CLOSING,_0.STATE_CLOSED,s4]);function U5(F){return F.s.state===_0.STATE_CLOSED||F.s.state===_0.STATE_CLOSING}CN.ServerMonitoringMode=Object.freeze({auto:"auto",poll:"poll",stream:"stream"});class EN extends YN.TypedEventEmitter{constructor(F,A){super();this.component=r61.MongoLoggableComponent.TOPOLOGY,this[o6]=F,this.connection=null,this[K7]=new YN.CancellationToken,this[K7].setMaxListeners(1/0),this[e6]=void 0,this.s={state:_0.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=a61.getFAASEnv()!=null,this.mongoLogger=this[o6].topology.client?.mongoLogger,this.rttSampler=new W$(10);let B=this[K7],D={id:"<monitor>",generation:F.pool.generation,cancellationToken:B,hostAddress:F.description.hostAddress,...A,raw:!1,useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!0};if(delete D.credentials,D.autoEncrypter)delete D.autoEncrypter;this.connectOptions=Object.freeze(D)}connect(){if(this.s.state!==_0.STATE_CLOSED)return;let F=this.options.heartbeatFrequencyMS,A=this.options.minHeartbeatFrequencyMS;this[e6]=new HB(GN(this),{heartbeatFrequencyMS:F,minHeartbeatFrequencyMS:A,immediate:!0})}requestCheck(){if(t61.has(this.s.state))return;this[e6]?.wake()}reset(){let F=this[o6].description.topologyVersion;if(U5(this)||F==null)return;W7(this,_0.STATE_CLOSING),$N(this),W7(this,q7);let A=this.options.heartbeatFrequencyMS,B=this.options.minHeartbeatFrequencyMS;this[e6]=new HB(GN(this),{heartbeatFrequencyMS:A,minHeartbeatFrequencyMS:B})}close(){if(U5(this))return;W7(this,_0.STATE_CLOSING),$N(this),this.emit("close"),W7(this,_0.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()}}CN.Monitor=EN;function $N(F){F[e6]?.stop(),F[e6]=void 0,F.rttPinger?.close(),F.rttPinger=void 0,F[K7].emit("cancel"),F.connection?.destroy(),F.connection=null,F.clearRttSamples()}function C$(F,A){if(A==null)return!1;let B=F.options.serverMonitoringMode;if(B===CN.ServerMonitoringMode.poll)return!1;if(B===CN.ServerMonitoringMode.stream)return!0;if(F.isRunningInFaasEnv)return!1;return!0}function o61(F,A){let B,D,J=F[o6].description.topologyVersion,Z=C$(F,J);F.emitAndLogHeartbeat(z5.Server.SERVER_HEARTBEAT_STARTED,F[o6].topology.s.id,void 0,new K5.ServerHeartbeatStartedEvent(F.address,Z));function X(G){F.connection?.destroy(),F.connection=null,F.emitAndLogHeartbeat(z5.Server.SERVER_HEARTBEAT_FAILED,F[o6].topology.s.id,void 0,new K5.ServerHeartbeatFailedEvent(F.address,i0.calculateDurationInMs(B),G,D));let E=!(G instanceof H7.MongoError)?new H7.MongoError(H7.MongoError.buildErrorMessage(G),{cause:G}):G;if(E.addErrorLabel(H7.MongoErrorLabel.ResetPool),E instanceof H7.MongoNetworkTimeoutError)E.addErrorLabel(H7.MongoErrorLabel.InterruptInUseConnections);F.emit("resetServer",E),A(G)}function Y(G){if(!("isWritablePrimary"in G))G.isWritablePrimary=G[E$.LEGACY_HELLO_COMMAND];let E=Z&&F.rttPinger?F.rttPinger.latestRtt??i0.calculateDurationInMs(B):i0.calculateDurationInMs(B);if(F.addRttSample(E),F.emitAndLogHeartbeat(z5.Server.SERVER_HEARTBEAT_SUCCEEDED,F[o6].topology.s.id,G.connectionId,new K5.ServerHeartbeatSucceededEvent(F.address,E,G,Z)),Z)F.emitAndLogHeartbeat(z5.Server.SERVER_HEARTBEAT_STARTED,F[o6].topology.s.id,void 0,new K5.ServerHeartbeatStartedEvent(F.address,!0)),B=i0.now();else F.rttPinger?.close(),F.rttPinger=void 0,A(void 0,G)}let{connection:$}=F;if($&&!$.closed){let{serverApi:G,helloOk:E}=$,C=F.options.connectTimeoutMS,H=F.options.heartbeatFrequencyMS,q={[G?.version||E?"hello":E$.LEGACY_HELLO_COMMAND]:1,...Z&&J?{maxAwaitTimeMS:H,topologyVersion:e61(J)}:{}},W=Z?{socketTimeoutMS:C?C+H:0,exhaustAllowed:!0}:{socketTimeoutMS:C};if(Z&&F.rttPinger==null)F.rttPinger=new q$(F);if(B=i0.now(),Z)return D=!0,$.exhaustCommand(i0.ns("admin.$cmd"),q,W,(K,U)=>{if(K)return X(K);return Y(U)});D=!1,$.command(i0.ns("admin.$cmd"),q,W).then(Y,X);return}(async()=>{let G=await CB.makeSocket(F.connectOptions),E=CB.makeConnection(F.connectOptions,G);B=i0.now();try{return await CB.performInitialHandshake(E,F.connectOptions),E}catch(C){throw E.destroy(),C}})().then((G)=>{if(U5(F)){G.destroy();return}let E=i0.calculateDurationInMs(B);F.addRttSample(E),F.connection=G,F.emitAndLogHeartbeat(z5.Server.SERVER_HEARTBEAT_SUCCEEDED,F[o6].topology.s.id,G.hello?.connectionId,new K5.ServerHeartbeatSucceededEvent(F.address,E,G.hello,C$(F,G.hello?.topologyVersion))),A(void 0,G.hello)},(G)=>{F.connection=null,D=!1,X(G)})}function GN(F){return(A)=>{if(F.s.state===s4){process.nextTick(A);return}W7(F,s4);function B(){if(!U5(F))W7(F,q7);A()}o61(F,(D,J)=>{if(D){if(F[o6].description.type===_0.ServerType.Unknown)return B()}if(C$(F,J?.topologyVersion))Y4.setTimeout(()=>{if(!U5(F))F[e6]?.wake()},0);B()})}}function e61(F){return{processId:F.processId,counter:XN.Long.isLong(F.counter)?F.counter:XN.Long.fromNumber(F.counter)}}class q${constructor(F){this.connection=void 0,this[K7]=F[K7],this.closed=!1,this.monitor=F,this.latestRtt=F.latestRtt??void 0;let A=F.options.heartbeatFrequencyMS;this[e6]=Y4.setTimeout(()=>this.measureRoundTripTime(),A)}get roundTripTime(){return this.monitor.roundTripTime}get minRoundTripTime(){return this.monitor.minRoundTripTime}close(){this.closed=!0,Y4.clearTimeout(this[e6]),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=i0.calculateDurationInMs(F),this[e6]=Y4.setTimeout(()=>this.measureRoundTripTime(),this.monitor.options.heartbeatFrequencyMS)}measureRoundTripTime(){let F=i0.now();if(this.closed)return;let A=this.connection;if(A==null){CB.connect(this.monitor.connectOptions).then((D)=>{this.measureAndReschedule(F,D)},()=>{this.connection=void 0});return}let B=A.serverApi?.version||A.helloOk?"hello":E$.LEGACY_HELLO_COMMAND;A.command(i0.ns("admin.$cmd"),{[B]:1},void 0).then(()=>this.measureAndReschedule(F),()=>{this.connection?.destroy(),this.connection=void 0;return})}}CN.RTTPinger=q$;class HB{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=i0.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=i0.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=i0.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)}}CN.MonitorInterval=HB;class W${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}}CN.RTTSampler=W$});var w$=z((LN)=>{Object.defineProperty(LN,"__esModule",{value:!0});LN.FEATURE_FLAGS=LN.DEFAULT_OPTIONS=LN.OPTIONS=void 0;LN.resolveSRVRecord=G31;LN.parseOptions=C31;var qN=import.meta.require("dns"),D31=YY(),J31=import.meta.require("url"),z7=KA(),F3=n6(),WN=EY(),KN=e8(),zN=Qw(),r=p(),qB=D4(),U$=d4(),K$=B6(),$4=P0(),Z31=G$(),g0=a(),R3=c0(),z$=["authSource","replicaSet","loadBalanced"],X31="loadBalanced option only supported with a single host in the URI",Y31="loadBalanced option not supported with a replicaSet option",$31="loadBalanced option not supported when directConnection is provided";async function G31(F){if(typeof F.srvHost!=="string")throw new r.MongoAPIError('Option "srvHost" must not be empty');let A=F.srvHost,B=qN.promises.resolveTxt(A);B.then(void 0,g0.squashError);let D=await qN.promises.resolveSrv(`_${F.srvServiceName}._tcp.${A}`);if(D.length===0)throw new r.MongoAPIError("No addresses found at host");for(let{name:C}of D)g0.checkParentDomainMatch(C,A);let J=D.map((C)=>g0.HostAddress.fromString(`${C.name}:${C.port??27017}`));Q$(J,F,!0);let Z;try{Z=await B}catch(C){if(C.code!=="ENODATA"&&C.code!=="ENOTFOUND")throw C;return J}if(Z.length>1)throw new r.MongoParseError("Multiple text records not allowed");let X=new J31.URLSearchParams(Z[0].join(""));if([...X.keys()].some((C)=>!z$.includes(C)))throw new r.MongoParseError(`Text record may only set any of: ${z$.join(", ")}`);if(z$.some((C)=>X.get(C)===""))throw new r.MongoParseError("Cannot have empty URI params in DNS TXT Record");let $=X.get("authSource")??void 0,G=X.get("replicaSet")??void 0,E=X.get("loadBalanced")??void 0;if(!F.userSpecifiedAuthSource&&$&&F.credentials&&!F3.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(F.credentials.mechanism))F.credentials=z7.MongoCredentials.merge(F.credentials,{source:$});if(!F.userSpecifiedReplicaSet&&G)F.replicaSet=G;if(E==="true")F.loadBalanced=!0;if(F.replicaSet&&F.srvMaxHosts>0)throw new r.MongoParseError("Cannot combine replicaSet option with srvMaxHosts");return Q$(J,F,!0),J}function E31(F){if(!F)return;let A=(B,D)=>{if(F.has(B)&&F.has(D))throw new r.MongoAPIError(`The '${B}' option cannot be used with the '${D}' option`)};A("tlsInsecure","tlsAllowInvalidCertificates"),A("tlsInsecure","tlsAllowInvalidHostnames"),A("tlsInsecure","tlsDisableCertificateRevocationCheck"),A("tlsInsecure","tlsDisableOCSPEndpointCheck"),A("tlsAllowInvalidCertificates","tlsDisableCertificateRevocationCheck"),A("tlsAllowInvalidCertificates","tlsDisableOCSPEndpointCheck"),A("tlsDisableCertificateRevocationCheck","tlsDisableOCSPEndpointCheck")}function w3(F,A){if(typeof A==="boolean")return A;switch(A){case"true":return!0;case"false":return!1;default:throw new r.MongoParseError(`${F} must be either "true" or "false"`)}}function V$(F,A){let B=g0.parseInteger(A);if(B!=null)return B;throw new r.MongoParseError(`Expected ${F} to be stringified int value, got: ${A}`)}function Q5(F,A){let B=V$(F,A);if(B<0)throw new r.MongoParseError(`${F} can only be a positive int value, got: ${A}`);return B}function*UN(F){if(F==="")return;let A=F.split(",");for(let B of A){let[D,J]=B.split(/:(.*)/);if(J==null)throw new r.MongoParseError("Cannot have undefined values in key value pairs");yield[D,J]}}class L5 extends Map{constructor(F=[]){super(F.map(([A,B])=>[A.toLowerCase(),B]))}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 C31(F,A=void 0,B={}){if(A!=null&&!(A instanceof qB.MongoClient))B=A,A=void 0;if(B.useBigInt64&&typeof B.promoteLongs==="boolean"&&!B.promoteLongs)throw new r.MongoAPIError("Must request either bigint or Long for int64 deserialization");if(B.useBigInt64&&typeof B.promoteValues==="boolean"&&!B.promoteValues)throw new r.MongoAPIError("Must request either bigint or Long for int64 deserialization");let D=new D31.default(F),{hosts:J,isSRV:Z}=D,X=Object.create(null);for(let Q of Object.getOwnPropertySymbols(B))if(LN.FEATURE_FLAGS.has(Q))X[Q]=B[Q];X.hosts=Z?[]:J.map(g0.HostAddress.fromString);let Y=new L5;if(D.pathname!=="/"&&D.pathname!==""){let Q=decodeURIComponent(D.pathname[0]==="/"?D.pathname.slice(1):D.pathname);if(Q)Y.set("dbName",[Q])}if(D.username!==""){let Q={username:decodeURIComponent(D.username)};if(typeof D.password==="string")Q.password=decodeURIComponent(D.password);Y.set("auth",[Q])}for(let Q of D.searchParams.keys()){let L=D.searchParams.getAll(Q),V=/readPreferenceTags/i.test(Q);if(!V&&L.length>1)throw new r.MongoInvalidArgumentError(`URI option "${Q}" cannot appear more than once in the connection string`);if(!V&&L.includes(""))throw new r.MongoAPIError(`URI option "${Q}" cannot be specified with no value`);if(!Y.has(Q))Y.set(Q,L)}let $=new L5(Object.entries(B).filter(([,Q])=>Q!=null));if(Y.has("serverApi"))throw new r.MongoParseError("URI cannot contain `serverApi`, it can only be passed to the client");let G=Y.get("authMechanismProperties");if(G){for(let Q of G)if(/(^|,)ALLOWED_HOSTS:/.test(Q))throw new r.MongoParseError("Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string.")}if($.has("loadBalanced"))throw new r.MongoParseError("loadBalanced is only a valid option in the URI");let E=new L5,C=new Set([...Y.keys(),...$.keys()]);for(let Q of C){let L=[],V=$.get(Q);if(V!=null)L.push(V);let w=Y.get(Q)??[];L.push(...w),E.set(Q,L)}if(E.has("tls")||E.has("ssl")){let Q=(E.get("tls")||[]).concat(E.get("ssl")||[]).map(w3.bind(null,"tls/ssl"));if(new Set(Q).size!==1)throw new r.MongoParseError("All values of tls/ssl must be the same.")}E31(E);let H=g0.setDifference(C,Array.from(Object.keys(LN.OPTIONS)).map((Q)=>Q.toLowerCase()));if(H.size!==0){let Q=H.size>1?"options":"option",L=H.size>1?"are":"is";throw new r.MongoParseError(`${Q} ${Array.from(H).join(", ")} ${L} not supported`)}for(let[Q,L]of Object.entries(LN.OPTIONS)){let V=E.get(Q);if(!V||V.length===0){if(LN.DEFAULT_OPTIONS.has(Q))QN(X,Q,L,[LN.DEFAULT_OPTIONS.get(Q)])}else{let{deprecated:w}=L;if(w){let j=typeof w==="string"?`: ${w}`:"";g0.emitWarning(`${Q} is a deprecated option${j}`)}QN(X,Q,L,V)}}if(X.credentials){let Q=X.credentials.mechanism===F3.AuthMechanism.MONGODB_GSSAPI,L=X.credentials.mechanism===F3.AuthMechanism.MONGODB_X509,V=X.credentials.mechanism===F3.AuthMechanism.MONGODB_AWS,w=X.credentials.mechanism===F3.AuthMechanism.MONGODB_OIDC;if((Q||L)&&E.has("authSource")&&X.credentials.source!=="$external")throw new r.MongoParseError(`authMechanism ${X.credentials.mechanism} requires an authSource of '$external'`);if(!(Q||L||V||w)&&X.dbName&&!E.has("authSource"))X.credentials=z7.MongoCredentials.merge(X.credentials,{source:X.dbName});if(V&&X.credentials.username&&!X.credentials.password)throw new r.MongoMissingCredentialsError(`When using ${X.credentials.mechanism} password must be set when a username is specified`);if(X.credentials.validate(),X.credentials.password===""&&X.credentials.username===""&&X.credentials.mechanism===F3.AuthMechanism.MONGODB_DEFAULT&&Object.keys(X.credentials.mechanismProperties).length===0)delete X.credentials}if(!X.dbName)X.dbName="test";if(Q$(J,X,Z),A&&X.autoEncryption)zN.Encrypter.checkForMongoCrypt(),X.encrypter=new zN.Encrypter(A,F,B),X.autoEncrypter=X.encrypter.autoEncrypter;if(X.userSpecifiedAuthSource=$.has("authSource")||Y.has("authSource"),X.userSpecifiedReplicaSet=$.has("replicaSet")||Y.has("replicaSet"),Z){if(X.srvHost=J[0],X.directConnection)throw new r.MongoAPIError("SRV URI does not support directConnection");if(X.srvMaxHosts>0&&typeof X.replicaSet==="string")throw new r.MongoParseError("Cannot use srvMaxHosts option with replicaSet");let Q=!$.has("tls")&&!Y.has("tls"),L=!$.has("ssl")&&!Y.has("ssl");if(Q&&L)X.tls=!0}else if(Y.has("srvMaxHosts")||$.has("srvMaxHosts")||Y.has("srvServiceName")||$.has("srvServiceName"))throw new r.MongoParseError("Cannot use srvMaxHosts or srvServiceName with a non-srv connection string");if(X.directConnection&&X.hosts.length!==1)throw new r.MongoParseError("directConnection option requires exactly one host");if(!X.proxyHost&&(X.proxyPort||X.proxyUsername||X.proxyPassword))throw new r.MongoParseError("Must specify proxyHost if other proxy options are passed");if(X.proxyUsername&&!X.proxyPassword||!X.proxyUsername&&X.proxyPassword)throw new r.MongoParseError("Can only specify both of proxy username/password or neither");if(["proxyHost","proxyPort","proxyUsername","proxyPassword"].map((Q)=>Y.get(Q)??[]).some((Q)=>Q.length>1))throw new r.MongoParseError("Proxy options cannot be specified multiple times in the connection string");let W=Symbol.for("@@mdb.enableMongoLogger");X[W]=X[W]??!1;let K={},U={};if(X[W])K={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,...X[Symbol.for("@@mdb.internalLoggerConfig")]},U={mongodbLogPath:X.mongodbLogPath,mongodbLogComponentSeverities:X.mongodbLogComponentSeverities,mongodbLogMaxDocumentLength:X.mongodbLogMaxDocumentLength};return X.mongoLoggerOptions=U$.MongoLogger.resolveOptions(K,U),X.metadata=WN.makeClientMetadata(X),X.extendedMetadata=WN.addContainerMetadata(X.metadata).then(void 0,g0.squashError),X}function Q$(F,A,B){if(A.loadBalanced){if(F.length>1)throw new r.MongoParseError(X31);if(A.replicaSet)throw new r.MongoParseError(Y31);if(A.directConnection)throw new r.MongoParseError($31);if(B&&A.srvMaxHosts>0)throw new r.MongoParseError("Cannot limit srv hosts with loadBalanced enabled")}return}function QN(F,A,B,D){let{target:J,type:Z,transform:X}=B,Y=J??A;switch(Z){case"boolean":F[Y]=w3(Y,D[0]);break;case"int":F[Y]=V$(Y,D[0]);break;case"uint":F[Y]=Q5(Y,D[0]);break;case"string":if(D[0]==null)break;F[Y]=String(D[0]);break;case"record":if(!g0.isRecord(D[0]))throw new r.MongoParseError(`${Y} must be an object`);F[Y]=D[0];break;case"any":F[Y]=D[0];break;default:{if(!X)throw new r.MongoParseError("Descriptors missing a type must define a transform");let $=X({name:Y,options:F,values:D});F[Y]=$;break}}}LN.OPTIONS={appName:{type:"string"},auth:{target:"credentials",transform({name:F,options:A,values:[B]}){if(!g0.isRecord(B,["username","password"]))throw new r.MongoParseError(`${F} must be an object with 'username' and 'password' properties`);return z7.MongoCredentials.merge(A.credentials,{username:B.username,password:B.password})}},authMechanism:{target:"credentials",transform({options:F,values:[A]}){let B=Object.values(F3.AuthMechanism),[D]=B.filter((X)=>X.match(RegExp(String.raw`\b${A}\b`,"i")));if(!D)throw new r.MongoParseError(`authMechanism one of ${B}, got ${A}`);let J=F.credentials?.source;if(D===F3.AuthMechanism.MONGODB_PLAIN||F3.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(D))J="$external";let Z=F.credentials?.password;if(D===F3.AuthMechanism.MONGODB_X509&&Z==="")Z=void 0;return z7.MongoCredentials.merge(F.credentials,{mechanism:D,source:J,password:Z})}},authMechanismProperties:{target:"credentials",transform({options:F,values:A}){let B=Object.create(null);for(let D of A)if(typeof D==="string")for(let[J,Z]of UN(D))try{B[J]=w3(J,Z)}catch{B[J]=Z}else{if(!g0.isRecord(D))throw new r.MongoParseError("AuthMechanismProperties must be an object");B={...D}}return z7.MongoCredentials.merge(F.credentials,{mechanismProperties:B})}},authSource:{target:"credentials",transform({options:F,values:[A]}){let B=String(A);return z7.MongoCredentials.merge(F.credentials,{source:B})}},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,B=A&&A.version;if(!B)throw new r.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(qB.ServerApiVersion).join('", "')}"]`);if(!Object.values(qB.ServerApiVersion).some((D)=>D===B))throw new r.MongoParseError(`Invalid server API version=${B}; must be in the following enum: ["${Object.values(qB.ServerApiVersion).join('", "')}"]`);return A}},checkKeys:{type:"boolean"},compressors:{default:"none",target:"compressors",transform({values:F}){let A=new Set;for(let B of F){let D=typeof B==="string"?B.split(","):B;if(!Array.isArray(D))throw new r.MongoInvalidArgumentError("compressors must be an array or a comma-delimited list of strings");for(let J of D)if(Object.keys(KN.Compressor).includes(String(J)))A.add(String(J));else throw new r.MongoInvalidArgumentError(`${J} is not a valid compression mechanism. Must be one of: ${Object.keys(KN.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 B=V$(F,A);if(B===4||B===6)return B;throw new r.MongoParseError(`Option 'family' must be 4 or 6 got ${B}.`)}},fieldsAsRaw:{type:"record"},forceServerObjectId:{default:!1,type:"boolean"},fsync:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:F,options:A,values:[B]}){let D=R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,fsync:w3(F,B)}});if(!D)throw new r.MongoParseError(`Unable to make a writeConcern from fsync=${B}`);return D}},heartbeatFrequencyMS:{default:1e4,type:"uint"},ignoreUndefined:{type:"boolean"},j:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:F,options:A,values:[B]}){let D=R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,journal:w3(F,B)}});if(!D)throw new r.MongoParseError(`Unable to make a writeConcern from journal=${B}`);return D}},journal:{target:"writeConcern",transform({name:F,options:A,values:[B]}){let D=R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,journal:w3(F,B)}});if(!D)throw new r.MongoParseError(`Unable to make a writeConcern from journal=${B}`);return D}},loadBalanced:{default:!1,type:"boolean"},localThresholdMS:{default:15,type:"uint"},maxConnecting:{default:2,transform({name:F,values:[A]}){let B=Q5(F,A);if(B===0)throw new r.MongoInvalidArgumentError("maxConnecting must be > 0 if specified");return B}},maxIdleTimeMS:{default:0,type:"uint"},maxPoolSize:{default:100,type:"uint"},maxStalenessSeconds:{target:"readPreference",transform({name:F,options:A,values:[B]}){let D=Q5(F,B);if(A.readPreference)return $4.ReadPreference.fromOptions({readPreference:{...A.readPreference,maxStalenessSeconds:D}});else return new $4.ReadPreference("secondary",void 0,{maxStalenessSeconds:D})}},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:g0.DEFAULT_PK_FACTORY,transform({values:[F]}){if(g0.isRecord(F,["createPk"])&&typeof F.createPk==="function")return F;throw new r.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 K$.ReadConcern||g0.isRecord(F,["level"]))return K$.ReadConcern.fromOptions({...A.readConcern,...F});throw new r.MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(F)}`)}},readConcernLevel:{target:"readConcern",transform({values:[F],options:A}){return K$.ReadConcern.fromOptions({...A.readConcern,level:F})}},readPreference:{default:$4.ReadPreference.primary,transform({values:[F],options:A}){if(F instanceof $4.ReadPreference)return $4.ReadPreference.fromOptions({readPreference:{...A.readPreference,...F},...F});if(g0.isRecord(F,["mode"])){let B=$4.ReadPreference.fromOptions({readPreference:{...A.readPreference,...F},...F});if(B)return B;else throw new r.MongoParseError(`Cannot make read preference from ${JSON.stringify(F)}`)}if(typeof F==="string"){let B={hedge:A.readPreference?.hedge,maxStalenessSeconds:A.readPreference?.maxStalenessSeconds};return new $4.ReadPreference(F,A.readPreference?.tags,B)}throw new r.MongoParseError(`Unknown ReadPreference value: ${F}`)}},readPreferenceTags:{target:"readPreference",transform({values:F,options:A}){let B=Array.isArray(F[0])?F[0]:F,D=[];for(let J of B){let Z=Object.create(null);if(typeof J==="string")for(let[X,Y]of UN(J))Z[X]=Y;if(g0.isRecord(J))for(let[X,Y]of Object.entries(J))Z[X]=Y;D.push(Z)}return $4.ReadPreference.fromOptions({readPreference:A.readPreference,readPreferenceTags:D})}},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(Z31.ServerMonitoringMode).includes(F))throw new r.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!w3(F,A)}},tlsAllowInvalidHostnames:{target:"checkServerIdentity",transform({name:F,values:[A]}){return w3(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:[B]}){let D=w3(F,B);if(D)A.checkServerIdentity=()=>{return},A.rejectUnauthorized=!1;else A.checkServerIdentity=A.tlsAllowInvalidHostnames?()=>{return}:void 0,A.rejectUnauthorized=A.tlsAllowInvalidCertificates?!1:!0;return D}},w:{target:"writeConcern",transform({values:[F],options:A}){return R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,w:F}})}},waitQueueTimeoutMS:{default:0,type:"uint"},writeConcern:{target:"writeConcern",transform({values:[F],options:A}){if(g0.isRecord(F)||F instanceof R3.WriteConcern)return R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,...F}});else if(F==="majority"||typeof F==="number")return R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,w:F}});throw new r.MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(F)}`)}},wtimeout:{deprecated:"Please use wtimeoutMS instead",target:"writeConcern",transform({values:[F],options:A}){let B=R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,wtimeout:Q5("wtimeout",F)}});if(B)return B;throw new r.MongoParseError("Cannot make WriteConcern from wtimeout")}},wtimeoutMS:{target:"writeConcern",transform({values:[F],options:A}){let B=R3.WriteConcern.fromOptions({writeConcern:{...A.writeConcern,wtimeoutMS:Q5("wtimeoutMS",F)}});if(B)return B;throw new r.MongoParseError("Cannot make WriteConcern from wtimeout")}},zlibCompressionLevel:{default:0,type:"int"},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"},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 r.MongoAPIError("Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable");return F}},mongodbLogComponentSeverities:{transform({values:[F]}){if(typeof F!=="object"||!F)throw new r.MongoAPIError("Option 'mongodbLogComponentSeverities' must be a non-null object");for(let[A,B]of Object.entries(F)){if(typeof B!=="string"||typeof A!=="string")throw new r.MongoAPIError("User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value");if(!Object.values(U$.MongoLoggableComponent).some((D)=>D===A)&&A!=="default")throw new r.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' contains invalid key: ${A}`);if(!Object.values(U$.SeverityLevel).some((D)=>D===B))throw new r.MongoAPIError(`Option 'mongodbLogComponentSeverities' does not support ${B} as a value for ${A}`)}return F}},mongodbLogMaxDocumentLength:{type:"uint"}};LN.DEFAULT_OPTIONS=new L5(Object.entries(LN.OPTIONS).filter(([,F])=>F.default!=null).map(([F,A])=>[F,A.default]));LN.FEATURE_FLAGS=new Set([Symbol.for("@@mdb.skipPingOnConnect"),Symbol.for("@@mdb.enableMongoLogger"),Symbol.for("@@mdb.internalLoggerConfig")])});var wN=z((VN)=>{Object.defineProperty(VN,"__esModule",{value:!0});VN.ListCollectionsOperation=void 0;var W31=N6(),K31=a(),z31=Y0(),KB=O1();class I$ extends z31.CommandOperation{constructor(F,A,B){super(F,B);if(this.options={...B},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){return await super.executeCommand(F,A,this.generateCommand(K31.maxWireVersion(F)),W31.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}}VN.ListCollectionsOperation=I$;KB.defineAspects(I$,[KB.Aspect.READ_OPERATION,KB.Aspect.RETRYABLE,KB.Aspect.CURSOR_CREATING])});var P$=z((IN)=>{Object.defineProperty(IN,"__esModule",{value:!0});IN.ListCollectionsCursor=void 0;var U31=l0(),Q31=wN(),L31=k6();class N$ extends L31.AbstractCursor{constructor(F,A,B){super(F.client,F.s.namespace,B);this.parent=F,this.filter=A,this.options=B}clone(){return new N$(this.parent,this.filter,{...this.options,...this.cursorOptions})}async _initialize(F){let A=new Q31.ListCollectionsOperation(this.parent,this.filter,{...this.cursorOptions,...this.options,session:F}),B=await U31.executeOperation(this.parent.client,A);return{server:A.server,session:F,response:B}}}IN.ListCollectionsCursor=N$});var uN=z((TN)=>{Object.defineProperty(TN,"__esModule",{value:!0});TN.RunCommandCursor=void 0;var V31=N6(),V5=p(),PN=l0(),R31=gX(),w31=f9(),I31=a(),N31=k6();class MN extends N31.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 V5.MongoAPIError("Clone not supported, create a new cursor with db.runCursorCommand")}withReadConcern(F){throw new V5.MongoAPIError("RunCommandCursor does not support readConcern it must be attached to the command being run")}addCursorFlag(F,A){throw new V5.MongoAPIError("RunCommandCursor does not support cursor flags, they must be attached to the command being run")}maxTimeMS(F){throw new V5.MongoAPIError("maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()")}batchSize(F){throw new V5.MongoAPIError("batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()")}constructor(F,A,B={}){super(F.client,I31.ns(F.namespace),B);this.getMoreOptions={},this.db=F,this.command=Object.freeze({...A})}async _initialize(F){let A=new w31.RunCommandOperation(this.db,this.command,{...this.cursorOptions,session:F,readPreference:this.cursorOptions.readPreference,responseType:V31.CursorResponse}),B=await PN.executeOperation(this.client,A);return{server:A.server,session:F,response:B}}async getMore(F){let A=new R31.GetMoreOperation(this.namespace,this.id,this.server,{...this.cursorOptions,session:this.session,...this.getMoreOptions});return await PN.executeOperation(this.client,A)}}TN.RunCommandCursor=MN});var xN=z((kN)=>{Object.defineProperty(kN,"__esModule",{value:!0});kN.CollectionsOperation=void 0;var P31=a4(),M31=O1();class ON extends M31.AbstractOperation{constructor(F,A){super(A);this.options=A,this.db=F}get commandName(){return"listCollections"}async execute(F,A){let B=await this.db.listCollections({},{...this.options,nameOnly:!0,readPreference:this.readPreference,session:A}).toArray(),D=[];for(let{name:J}of B)if(!J.includes("$"))D.push(new P31.Collection(this.db,J,this.db.s.options));return D}}kN.CollectionsOperation=ON});var w5=z((fN)=>{Object.defineProperty(fN,"__esModule",{value:!0});fN.ListIndexesOperation=fN.DropIndexOperation=fN.CreateIndexesOperation=void 0;var T31=N6(),j31=p(),M$=a(),T$=Y0(),G4=O1(),u31=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 O31(F){return typeof F==="number"||F==="2d"||F==="2dsphere"||F==="text"||F==="geoHaystack"}function k31(F){return Array.isArray(F)&&F.length===2&&O31(F[1])}function S31(F){let A=new Map,B=!Array.isArray(F)||k31(F)?[F]:F;for(let D of B)if(typeof D==="string")A.set(D,1);else if(Array.isArray(D))A.set(D[0],D[1]??1);else if(D instanceof Map)for(let[J,Z]of D)A.set(J,Z);else if(M$.isObject(D))for(let[J,Z]of Object.entries(D))A.set(J,Z);return A}function x31(F){let A=Object.entries(F).filter(([B])=>u31.has(B));return Object.fromEntries(A.map(([B,D])=>B==="version"?["v",D]:[B,D]))}class R5 extends T$.CommandOperation{constructor(F,A,B,D){super(F,D);this.options=D??{},this.collectionName=A,this.indexes=B.map((J)=>{let Z=J.key instanceof Map?J.key:new Map(Object.entries(J.key)),X=J.name??Array.from(Z).flat().join("_");return{...x31(J),name:X,key:Z}})}static fromIndexDescriptionArray(F,A,B,D){return new R5(F,A,B,D)}static fromIndexSpecification(F,A,B,D={}){let J=S31(B),Z={...D,key:J};return new R5(F,A,[Z],D)}get commandName(){return"createIndexes"}async execute(F,A){let B=this.options,D=this.indexes,J=M$.maxWireVersion(F),Z={createIndexes:this.collectionName,indexes:D};if(B.commitQuorum!=null){if(J<9)throw new j31.MongoCompatibilityError("Option `commitQuorum` for `createIndexes` not supported on servers < 4.4");Z.commitQuorum=B.commitQuorum}return this.options.collation=void 0,await super.executeCommand(F,A,Z),D.map((Y)=>Y.name||"")}}fN.CreateIndexesOperation=R5;class j$ extends T$.CommandOperation{constructor(F,A,B){super(F,B);this.options=B??{},this.collection=F,this.indexName=A}get commandName(){return"dropIndexes"}async execute(F,A){let B={dropIndexes:this.collection.collectionName,index:this.indexName};return await super.executeCommand(F,A,B)}}fN.DropIndexOperation=j$;class u$ extends T$.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){let B=M$.maxWireVersion(F),D=this.options.batchSize?{batchSize:this.options.batchSize}:{},J={listIndexes:this.collectionNamespace.collection,cursor:D};if(B>=9&&this.options.comment!==void 0)J.comment=this.options.comment;return await super.executeCommand(F,A,J,T31.CursorResponse)}}fN.ListIndexesOperation=u$;G4.defineAspects(u$,[G4.Aspect.READ_OPERATION,G4.Aspect.RETRYABLE,G4.Aspect.CURSOR_CREATING]);G4.defineAspects(R5,[G4.Aspect.WRITE_OPERATION]);G4.defineAspects(j$,[G4.Aspect.WRITE_OPERATION])});var hN=z((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});yN.CreateCollectionOperation=void 0;var gN=b4(),g31=a4(),b31=p(),y31=Y0(),v31=w5(),bN=O1(),h31=new Set(["w","wtimeout","j","fsync","autoIndexId","pkFactory","raw","readPreference","session","readConcern","writeConcern","raw","fieldsAsRaw","useBigInt64","promoteLongs","promoteValues","promoteBuffers","bsonRegExp","serializeFunctions","ignoreUndefined","enableUtf8Validation"]),m31="Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption.";class zB extends y31.CommandOperation{constructor(F,A,B={}){super(F,B);this.options=B,this.db=F,this.name=A}get commandName(){return"create"}async execute(F,A){let B=this.db,D=this.name,J=this.options,Z=J.encryptedFields??B.client.options.autoEncryption?.encryptedFieldsMap?.[`${B.databaseName}.${D}`];if(Z){if(!F.loadBalanced&&F.description.maxWireVersion<gN.MIN_SUPPORTED_QE_WIRE_VERSION)throw new b31.MongoCompatibilityError(`${m31} The minimum server version required is ${gN.MIN_SUPPORTED_QE_SERVER_VERSION}`);let Y=Z.escCollection??`enxcol_.${D}.esc`,$=Z.ecocCollection??`enxcol_.${D}.ecoc`;for(let G of[Y,$])await new zB(B,G,{clusteredIndex:{key:{_id:1},unique:!0}}).executeWithoutEncryptedFieldsCheck(F,A);if(!J.encryptedFields)this.options={...this.options,encryptedFields:Z}}let X=await this.executeWithoutEncryptedFieldsCheck(F,A);if(Z)await v31.CreateIndexesOperation.fromIndexSpecification(B,D,{__safeContent__:1},{}).execute(F,A);return X}async executeWithoutEncryptedFieldsCheck(F,A){let B=this.db,D=this.name,J=this.options,Z={create:D};for(let X in J)if(J[X]!=null&&typeof J[X]!=="function"&&!h31.has(X))Z[X]=J[X];return await super.executeCommand(F,A,Z),new g31.Collection(B,D,J)}}yN.CreateCollectionOperation=zB;bN.defineAspects(zB,[bN.Aspect.WRITE_OPERATION])});var k$=z((cN)=>{Object.defineProperty(cN,"__esModule",{value:!0});cN.DropDatabaseOperation=cN.DropCollectionOperation=void 0;var mN=p(),dN=Y0(),UB=O1();class QB extends dN.CommandOperation{constructor(F,A,B={}){super(F,B);this.db=F,this.options=B,this.name=A}get commandName(){return"drop"}async execute(F,A){let B=this.db,D=this.options,J=this.name,Z=B.client.options.autoEncryption?.encryptedFieldsMap,X=D.encryptedFields??Z?.[`${B.databaseName}.${J}`];if(!X&&Z)X=(await B.listCollections({name:J},{nameOnly:!1}).toArray())?.[0]?.options?.encryptedFields;if(X){let Y=X.escCollection||`enxcol_.${J}.esc`,$=X.ecocCollection||`enxcol_.${J}.ecoc`;for(let G of[Y,$]){let E=new QB(B,G);try{await E.executeWithoutEncryptedFieldsCheck(F,A)}catch(C){if(!(C instanceof mN.MongoServerError)||C.code!==mN.MONGODB_ERROR_CODES.NamespaceNotFound)throw C}}}return await this.executeWithoutEncryptedFieldsCheck(F,A)}async executeWithoutEncryptedFieldsCheck(F,A){return await super.executeCommand(F,A,{drop:this.name}),!0}}cN.DropCollectionOperation=QB;class O$ extends dN.CommandOperation{constructor(F,A){super(F,A);this.options=A}get commandName(){return"dropDatabase"}async execute(F,A){return await super.executeCommand(F,A,{dropDatabase:1}),!0}}cN.DropDatabaseOperation=O$;UB.defineAspects(QB,[UB.Aspect.WRITE_OPERATION]);UB.defineAspects(O$,[UB.Aspect.WRITE_OPERATION])});var aN=z((nN)=>{Object.defineProperty(nN,"__esModule",{value:!0});nN.ProfilingLevelOperation=void 0;var pN=p(),c31=Y0();class iN extends c31.CommandOperation{constructor(F,A){super(F,A);this.options=A}get commandName(){return"profile"}async execute(F,A){let B=await super.executeCommand(F,A,{profile:-1});if(B.ok===1){let D=B.was;if(D===0)return"off";if(D===1)return"slow_only";if(D===2)return"all";throw new pN.MongoUnexpectedServerResponseError(`Illegal profiling level value ${D}`)}else throw new pN.MongoUnexpectedServerResponseError("Error with profile command")}}nN.ProfilingLevelOperation=iN});var x$=z((tN)=>{Object.defineProperty(tN,"__esModule",{value:!0});tN.RenameOperation=void 0;var l31=a4(),p31=a(),i31=Y0(),rN=O1();class S$ extends i31.CommandOperation{constructor(F,A,B){super(F,B);this.collection=F,this.newName=A,this.options=B,this.ns=new p31.MongoDBNamespace("admin","$cmd")}get commandName(){return"renameCollection"}async execute(F,A){let B=this.collection.namespace,D=this.collection.s.namespace.withCollection(this.newName).toString(),J=typeof this.options.dropTarget==="boolean"?this.options.dropTarget:!1,Z={renameCollection:B,to:D,dropTarget:J};return await super.executeCommand(F,A,Z),new l31.Collection(this.collection.s.db,this.newName,this.collection.s.options)}}tN.RenameOperation=S$;rN.defineAspects(S$,[rN.Aspect.WRITE_OPERATION])});var f$=z((FP)=>{Object.defineProperty(FP,"__esModule",{value:!0});FP.SetProfilingLevelOperation=FP.ProfilingLevel=void 0;var n31=p(),s31=a(),a31=Y0(),r31=new Set(["off","slow_only","all"]);FP.ProfilingLevel=Object.freeze({off:"off",slowOnly:"slow_only",all:"all"});class eN extends a31.CommandOperation{constructor(F,A,B){super(F,B);switch(this.options=B,A){case FP.ProfilingLevel.off:this.profile=0;break;case FP.ProfilingLevel.slowOnly:this.profile=1;break;case FP.ProfilingLevel.all:this.profile=2;break;default:this.profile=0;break}this.level=A}get commandName(){return"profile"}async execute(F,A){let B=this.level;if(!r31.has(B))throw new n31.MongoInvalidArgumentError(`Profiling level must be one of "${s31.enumToString(FP.ProfilingLevel)}"`);return await super.executeCommand(F,A,{profile:this.profile}),B}}FP.SetProfilingLevelOperation=eN});var ZP=z((DP)=>{Object.defineProperty(DP,"__esModule",{value:!0});DP.DbStatsOperation=void 0;var t31=Y0(),BP=O1();class _$ extends t31.CommandOperation{constructor(F,A){super(F,A);this.options=A}get commandName(){return"dbStats"}async execute(F,A){let B={dbStats:!0};if(this.options.scale!=null)B.scale=this.options.scale;return await super.executeCommand(F,A,B)}}DP.DbStatsOperation=_$;BP.defineAspects(_$,[BP.Aspect.READ_OPERATION])});var LB=z((EP)=>{Object.defineProperty(EP,"__esModule",{value:!0});EP.Db=void 0;var o31=DX(),XP=w1(),e31=r4(),F41=a4(),U7=W0(),A41=N5(),B41=P$(),D41=uN(),YP=p(),J41=xN(),Z41=hN(),$P=k$(),S6=l0(),X41=w5(),Y41=aN(),$41=AX(),G41=x$(),E41=f9(),C41=f$(),H41=ZP(),q41=B6(),GP=P0(),n0=a(),W41=c0(),K41=["writeConcern","readPreference","readPreferenceTags","native_parser","forceServerObjectId","pkFactory","serializeFunctions","raw","authSource","ignoreUndefined","readConcern","retryMiliSeconds","numberOfRetries","useBigInt64","promoteBuffers","promoteLongs","bsonRegExp","enableUtf8Validation","promoteValues","compression","retryWrites","timeoutMS"];class E4{constructor(F,A,B){if(B=B??{},B=n0.filterOptions(B,K41),typeof A==="string"&&A.includes("."))throw new YP.MongoInvalidArgumentError("Database names cannot contain the character '.'");this.s={options:B,readPreference:GP.ReadPreference.fromOptions(B),bsonOptions:XP.resolveBSONOptions(B,F),pkFactory:B?.pkFactory??n0.DEFAULT_PK_FACTORY,readConcern:q41.ReadConcern.fromOptions(B),writeConcern:W41.WriteConcern.fromOptions(B),namespace:new n0.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()}async createCollection(F,A){return await S6.executeOperation(this.client,new Z41.CreateCollectionOperation(this,F,n0.resolveOptions(this,A)))}async command(F,A){return await S6.executeOperation(this.client,new E41.RunCommandOperation(this,F,{...XP.resolveBSONOptions(A),session:A?.session,readPreference:A?.readPreference}))}aggregate(F=[],A){return new A41.AggregationCursor(this.client,this.s.namespace,F,n0.resolveOptions(this,A))}admin(){return new o31.Admin(this)}collection(F,A={}){if(typeof A==="function")throw new YP.MongoInvalidArgumentError("The callback form of this helper has been removed.");return new F41.Collection(this,F,n0.resolveOptions(this,A))}async stats(F){return await S6.executeOperation(this.client,new H41.DbStatsOperation(this,n0.resolveOptions(this,F)))}listCollections(F={},A={}){return new B41.ListCollectionsCursor(this,F,n0.resolveOptions(this,A))}async renameCollection(F,A,B){return await S6.executeOperation(this.client,new G41.RenameOperation(this.collection(F),A,{...B,new_collection:!0,readPreference:GP.ReadPreference.primary}))}async dropCollection(F,A){return await S6.executeOperation(this.client,new $P.DropCollectionOperation(this,F,n0.resolveOptions(this,A)))}async dropDatabase(F){return await S6.executeOperation(this.client,new $P.DropDatabaseOperation(this,n0.resolveOptions(this,F)))}async collections(F){return await S6.executeOperation(this.client,new J41.CollectionsOperation(this,n0.resolveOptions(this,F)))}async createIndex(F,A,B){return(await S6.executeOperation(this.client,X41.CreateIndexesOperation.fromIndexSpecification(this,F,A,B)))[0]}async removeUser(F,A){return await S6.executeOperation(this.client,new $41.RemoveUserOperation(this,F,n0.resolveOptions(this,A)))}async setProfilingLevel(F,A){return await S6.executeOperation(this.client,new C41.SetProfilingLevelOperation(this,F,n0.resolveOptions(this,A)))}async profilingLevel(F){return await S6.executeOperation(this.client,new Y41.ProfilingLevelOperation(this,n0.resolveOptions(this,F)))}async indexInformation(F,A){return await this.collection(F).indexInformation(n0.resolveOptions(this,A))}watch(F=[],A={}){if(!Array.isArray(F))A=F,F=[];return new e31.ChangeStream(this,F,n0.resolveOptions(this,A))}runCursorCommand(F,A){return new D41.RunCommandCursor(this,F,A)}}EP.Db=E4;E4.SYSTEM_NAMESPACE_COLLECTION=U7.SYSTEM_NAMESPACE_COLLECTION;E4.SYSTEM_INDEX_COLLECTION=U7.SYSTEM_INDEX_COLLECTION;E4.SYSTEM_PROFILE_COLLECTION=U7.SYSTEM_PROFILE_COLLECTION;E4.SYSTEM_USER_COLLECTION=U7.SYSTEM_USER_COLLECTION;E4.SYSTEM_COMMAND_COLLECTION=U7.SYSTEM_COMMAND_COLLECTION;E4.SYSTEM_JS_COLLECTION=U7.SYSTEM_JS_COLLECTION});var KP=z((qP)=>{Object.defineProperty(qP,"__esModule",{value:!0});qP.MongoDBAWS=void 0;var g$=w1(),b$=P6(),L7=p(),Q7=a(),z41=t3(),y$=VY(),U41=KA(),Q41=n6(),L41=110,v$={useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1};class HP extends z41.AuthProvider{constructor(){super();this.credentialFetcher=y$.AWSTemporaryCredentialProvider.isAWSSDKInstalled?new y$.AWSSDKCredentialProvider:new y$.LegacyAWSTemporaryCredentialProvider}async auth(F){let{connection:A}=F;if(!F.credentials)throw new L7.MongoMissingCredentialsError("AuthContext must provide credentials.");if("kModuleError"in b$.aws4)throw b$.aws4.kModuleError;let{sign:B}=b$.aws4;if(Q7.maxWireVersion(A)<9)throw new L7.MongoCompatibilityError("MONGODB-AWS authentication requires MongoDB version 4.4 or later");if(!F.credentials.username)F.credentials=await V41(F.credentials,this.credentialFetcher);let{credentials:D}=F,J=D.username,Z=D.password,X=D.mechanismProperties.AWS_SESSION_TOKEN,Y=J&&Z&&X?{accessKeyId:J,secretAccessKey:Z,sessionToken:X}:J&&Z?{accessKeyId:J,secretAccessKey:Z}:void 0,$=D.source,G=await Q7.randomBytes(32),E={saslStart:1,mechanism:"MONGODB-AWS",payload:g$.serialize({r:G,p:L41},v$)},C=await A.command(Q7.ns(`${$}.$cmd`),E,void 0),H=g$.deserialize(C.payload.buffer,v$),q=H.h,W=H.s.buffer;if(W.length!==64)throw new L7.MongoRuntimeError(`Invalid server nonce length ${W.length}, expected 64`);if(!Q7.ByteUtils.equals(W.subarray(0,G.byteLength),G))throw new L7.MongoRuntimeError("Server nonce does not begin with client nonce");if(q.length<1||q.length>255||q.indexOf("..")!==-1)throw new L7.MongoRuntimeError(`Server returned an invalid host: "${q}"`);let K="Action=GetCallerIdentity&Version=2011-06-15",U=B({method:"POST",host:q,region:R41(H.h),service:"sts",headers:{"Content-Type":"application/x-www-form-urlencoded","Content-Length":K.length,"X-MongoDB-Server-Nonce":Q7.ByteUtils.toBase64(W),"X-MongoDB-GS2-CB-Flag":"n"},path:"/",body:K},Y),Q={a:U.headers.Authorization,d:U.headers["X-Amz-Date"]};if(X)Q.t=X;let L={saslContinue:1,conversationId:1,payload:g$.serialize(Q,v$)};await A.command(Q7.ns(`${$}.$cmd`),L,void 0)}}qP.MongoDBAWS=HP;async function V41(F,A){function B(J){if(!J.AccessKeyId||!J.SecretAccessKey)throw new L7.MongoMissingCredentialsError("Could not obtain temporary MONGODB-AWS credentials");return new U41.MongoCredentials({username:J.AccessKeyId,password:J.SecretAccessKey,source:F.source,mechanism:Q41.AuthMechanism.MONGODB_AWS,mechanismProperties:{AWS_SESSION_TOKEN:J.Token}})}let D=await A.getCredentials();return B(D)}function R41(F){let A=F.split(".");if(A.length===1||A[1]==="amazonaws")return"us-east-1";return A[1]}});var h$=z((UP)=>{Object.defineProperty(UP,"__esModule",{value:!0});UP.finishCommandDocument=w41;UP.startCommandDocument=I41;var V7=w1(),zP=n6();function w41(F,A){if(A!=null)return{saslContinue:1,conversationId:A,payload:new V7.Binary(V7.BSON.serialize({jwt:F}))};return{saslStart:1,mechanism:zP.AuthMechanism.MONGODB_OIDC,payload:new V7.Binary(V7.BSON.serialize({jwt:F}))}}function I41(F){let A={};if(F.username)A.n=F.username;return{saslStart:1,autoAuthorize:1,mechanism:zP.AuthMechanism.MONGODB_OIDC,payload:new V7.Binary(V7.BSON.serialize(A))}}});var VB=z((VP)=>{Object.defineProperty(VP,"__esModule",{value:!0});VP.MachineWorkflow=void 0;var M41=import.meta.require("timers/promises"),T41=a(),QP=h$(),m$=100;class LP{constructor(F){this.cache=F,this.callback=this.withLock(this.getToken.bind(this)),this.lastExecutionTime=Date.now()-m$}async execute(F,A){let B=await this.getTokenFromCacheOrEnv(F,A),D=QP.finishCommandDocument(B);await F.command(T41.ns(A.source),D,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 B=await this.getTokenFromCacheOrEnv(F,A),D=QP.finishCommandDocument(B);return D.db=A.source,{speculativeAuthenticate:D}}async getTokenFromCacheOrEnv(F,A){if(this.cache.hasAccessToken)return this.cache.getAccessToken();else{let B=await this.callback(A);return this.cache.put({accessToken:B.access_token,expiresInSeconds:B.expires_in}),F.accessToken=B.access_token,B.access_token}}withLock(F){let A=Promise.resolve();return async(B)=>{return await A,A=A.catch(()=>null).then(async()=>{let D=Date.now()-this.lastExecutionTime;if(D<=m$)await M41.setTimeout(m$-D);return this.lastExecutionTime=Date.now(),await F(B)}),await A}}}VP.MachineWorkflow=LP});var MP=z((NP)=>{Object.defineProperty(NP,"__esModule",{value:!0});NP.AzureMachineWorkflow=void 0;var wP=IY(),d$=p(),j41=a(),u41=VB(),O41=Object.freeze({Metadata:"true",Accept:"application/json"}),k41="Azure endpoint did not return a value with only access_token and expires_in properties",S41="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.";class IP extends u41.MachineWorkflow{constructor(F){super(F)}async getToken(F){let A=F?.mechanismProperties.TOKEN_RESOURCE,B=F?.username;if(!A)throw new d$.MongoAzureError(S41);let D=await x41(A,B);if(!f41(D))throw new d$.MongoAzureError(k41);return D}}NP.AzureMachineWorkflow=IP;async function x41(F,A){let B=new URL(wP.AZURE_BASE_URL);wP.addAzureParams(B,F,A);let D=await j41.get(B,{headers:O41});if(D.status!==200)throw new d$.MongoAzureError(`Status code ${D.status} returned from the Azure endpoint. Response body: ${D.body}`);let J=JSON.parse(D.body);return{access_token:J.access_token,expires_in:Number(J.expires_in)}}function f41(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 kP=z((uP)=>{Object.defineProperty(uP,"__esModule",{value:!0});uP.GCPMachineWorkflow=void 0;var TP=p(),_41=a(),g41=VB(),b41="http://metadata/computeMetadata/v1/instance/service-accounts/default/identity",y41=Object.freeze({"Metadata-Flavor":"Google"}),v41="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp.";class jP extends g41.MachineWorkflow{constructor(F){super(F)}async getToken(F){let A=F?.mechanismProperties.TOKEN_RESOURCE;if(!A)throw new TP.MongoGCPError(v41);return await h41(A)}}uP.GCPMachineWorkflow=jP;async function h41(F){let A=new URL(b41);A.searchParams.append("audience",F);let B=await _41.get(A,{headers:y41});if(B.status!==200)throw new TP.MongoGCPError(`Status code ${B.status} returned from the GCP endpoint. Response body: ${B.body}`);return{access_token:B.body}}});var c$=z((xP)=>{Object.defineProperty(xP,"__esModule",{value:!0});xP.TokenCache=void 0;var m41=p();class RB extends m41.MongoDriverError{}class SP{get hasAccessToken(){return!!this.accessToken}get hasRefreshToken(){return!!this.refreshToken}get hasIdpInfo(){return!!this.idpInfo}getAccessToken(){if(!this.accessToken)throw new RB("Attempted to get an access token when none exists.");return this.accessToken}getRefreshToken(){if(!this.refreshToken)throw new RB("Attempted to get a refresh token when none exists.");return this.refreshToken}getIdpInfo(){if(!this.idpInfo)throw new RB("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}}xP.TokenCache=SP});var yP=z((gP)=>{Object.defineProperty(gP,"__esModule",{value:!0});gP.TokenMachineWorkflow=void 0;var d41=import.meta.require("fs"),c41=p(),l41=VB(),p41="OIDC_TOKEN_FILE must be set in the environment.";class _P extends l41.MachineWorkflow{constructor(F){super(F)}async getToken(){let F=process.env.OIDC_TOKEN_FILE;if(!F)throw new c41.MongoAWSError(p41);return{access_token:await d41.promises.readFile(F,"utf8")}}}gP.TokenMachineWorkflow=_P});var IB=z((dP)=>{Object.defineProperty(dP,"__esModule",{value:!0});dP.MongoDBOIDC=dP.OIDC_WORKFLOWS=dP.OIDC_VERSION=void 0;var hP=p(),i41=t3(),n41=MP(),s41=kP(),l$=c$(),a41=yP(),r41="AuthContext must provide credentials.";dP.OIDC_VERSION=1;dP.OIDC_WORKFLOWS=new Map;dP.OIDC_WORKFLOWS.set("test",()=>new a41.TokenMachineWorkflow(new l$.TokenCache));dP.OIDC_WORKFLOWS.set("azure",()=>new n41.AzureMachineWorkflow(new l$.TokenCache));dP.OIDC_WORKFLOWS.set("gcp",()=>new s41.GCPMachineWorkflow(new l$.TokenCache));class mP extends i41.AuthProvider{constructor(F){super();if(!F)throw new hP.MongoInvalidArgumentError("No workflow provided to the OIDC auth provider.");this.workflow=F}async auth(F){let{connection:A,reauthenticating:B,response:D}=F;if(D?.speculativeAuthenticate?.done)return;let J=vP(F);if(B)await this.workflow.reauthenticate(A,J);else await this.workflow.execute(A,J,D)}async prepare(F,A){let{connection:B}=A,D=vP(A),J=await this.workflow.speculativeAuth(B,D);return{...F,...J}}}dP.MongoDBOIDC=mP;function vP(F){let{credentials:A}=F;if(!A)throw new hP.MongoMissingCredentialsError(r41);return A}});var n$=z((iP)=>{Object.defineProperty(iP,"__esModule",{value:!0});iP.CallbackWorkflow=iP.AUTOMATED_TIMEOUT_MS=iP.HUMAN_TIMEOUT_MS=void 0;var o41=import.meta.require("timers/promises"),e41=p(),lP=a(),p$=h$();iP.HUMAN_TIMEOUT_MS=300000;iP.AUTOMATED_TIMEOUT_MS=60000;var F91=["accessToken","expiresInSeconds","refreshToken"],A91="User provided OIDC callbacks must return a valid object with an accessToken.",i$=100;class pP{constructor(F,A){this.cache=F,this.callback=this.withLock(A),this.lastExecutionTime=Date.now()-i$}async speculativeAuth(F,A){if(this.cache.hasAccessToken){let B=this.cache.getAccessToken();F.accessToken=B;let D=p$.finishCommandDocument(B);return D.db=A.source,{speculativeAuthenticate:D}}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,B){let D;if(B?.speculativeAuthenticate)D=B.speculativeAuthenticate;else D=await F.command(lP.ns(A.source),p$.startCommandDocument(A),void 0);return D}async finishAuthentication(F,A,B,D){await F.command(lP.ns(A.source),p$.finishCommandDocument(B,D),void 0)}async executeAndValidateCallback(F){let A=await this.callback(F);if(B91(A))throw new e41.MongoMissingCredentialsError(A91);return A}withLock(F){let A=Promise.resolve();return async(B)=>{return await A,A=A.catch(()=>null).then(async()=>{let D=Date.now()-this.lastExecutionTime;if(D<=i$)await o41.setTimeout(i$-D,{signal:B.timeoutContext});return this.lastExecutionTime=Date.now(),await F(B)}),await A}}}iP.CallbackWorkflow=pP;function B91(F){if(F==null||typeof F!=="object")return!0;if(!("accessToken"in F))return!0;return!Object.getOwnPropertyNames(F).every((A)=>F91.includes(A))}});var oP=z((rP)=>{Object.defineProperty(rP,"__esModule",{value:!0});rP.AutomatedCallbackWorkflow=void 0;var s$=p(),sP=q5(),Z91=IB(),a$=n$();class aP extends a$.CallbackWorkflow{constructor(F,A){super(F,A)}async execute(F,A){if(this.cache.hasAccessToken){let D=this.cache.getAccessToken();try{return await this.finishAuthentication(F,A,D)}catch(J){if(J instanceof s$.MongoError&&J.code===s$.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),await this.execute(F,A);else throw J}}let B=await this.fetchAccessToken(A);this.cache.put(B),F.accessToken=B.accessToken,await this.finishAuthentication(F,A,B.accessToken)}async fetchAccessToken(F){let A=new AbortController,B={timeoutContext:A.signal,version:Z91.OIDC_VERSION};if(F.username)B.username=F.username;let D=sP.Timeout.expires(a$.AUTOMATED_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(B),D])}catch(J){if(sP.TimeoutError.is(J))throw A.abort(),new s$.MongoOIDCError(`OIDC callback timed out after ${a$.AUTOMATED_TIMEOUT_MS}ms.`);throw J}finally{D.clear()}}}rP.AutomatedCallbackWorkflow=aP});var DM=z((AM)=>{Object.defineProperty(AM,"__esModule",{value:!0});AM.HumanCallbackWorkflow=void 0;var X91=w1(),P5=p(),eP=q5(),Y91=IB(),r$=n$();class FM extends r$.CallbackWorkflow{constructor(F,A){super(F,A)}async execute(F,A){if(this.cache.hasAccessToken){let X=this.cache.getAccessToken();F.accessToken=X;try{return await this.finishAuthentication(F,A,X)}catch(Y){if(Y instanceof P5.MongoError&&Y.code===P5.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),delete F.accessToken,await this.execute(F,A);else throw Y}}if(this.cache.hasRefreshToken){let X=this.cache.getRefreshToken(),Y=await this.fetchAccessToken(this.cache.getIdpInfo(),A,X);this.cache.put(Y),F.accessToken=Y.accessToken;try{return await this.finishAuthentication(F,A,Y.accessToken)}catch($){if($ instanceof P5.MongoError&&$.code===P5.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeRefreshToken(),delete F.accessToken,await this.execute(F,A);else throw $}}let B=await this.startAuthentication(F,A),D=B.conversationId,J=X91.BSON.deserialize(B.payload.buffer),Z=await this.fetchAccessToken(J,A);return this.cache.put(Z,J),F.accessToken=Z.accessToken,await this.finishAuthentication(F,A,Z.accessToken,D)}async fetchAccessToken(F,A,B){let D=new AbortController,J={timeoutContext:D.signal,version:Y91.OIDC_VERSION,idpInfo:F};if(A.username)J.username=A.username;if(B)J.refreshToken=B;let Z=eP.Timeout.expires(r$.HUMAN_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(J),Z])}catch(X){if(eP.TimeoutError.is(X))throw D.abort(),new P5.MongoOIDCError(`OIDC callback timed out after ${r$.HUMAN_TIMEOUT_MS}ms.`);throw X}finally{Z.clear()}}}AM.HumanCallbackWorkflow=FM});var YM=z((ZM)=>{Object.defineProperty(ZM,"__esModule",{value:!0});ZM.Plain=void 0;var $91=w1(),G91=p(),E91=a(),C91=t3();class JM extends C91.AuthProvider{async auth(F){let{connection:A,credentials:B}=F;if(!B)throw new G91.MongoMissingCredentialsError("AuthContext must provide credentials.");let{username:D,password:J}=B,X={saslStart:1,mechanism:"PLAIN",payload:new $91.Binary(Buffer.from(`\x00${D}\x00${J}`)),autoAuthorize:1};await A.command(E91.ns("$external.$cmd"),X,void 0)}}ZM.Plain=JM});var CM=z((bU1,EM)=>{var $M=(F)=>F.codePointAt(0),H91=(F)=>F[0],q91=(F)=>F[F.length-1];function GM(F){let A=[],B=F.length;for(let D=0;D<B;D+=1){let J=F.charCodeAt(D);if(J>=55296&&J<=56319&&B>D+1){let Z=F.charCodeAt(D+1);if(Z>=56320&&Z<=57343){A.push((J-55296)*1024+Z-56320+65536),D+=1;continue}}A.push(J)}return A}function M5({unassigned_code_points:F,commonly_mapped_to_nothing:A,non_ASCII_space_characters:B,prohibited_characters:D,bidirectional_r_al:J,bidirectional_l:Z},X,Y={}){let $=B,G=A;if(typeof X!=="string")throw new TypeError("Expected string.");if(X.length===0)return"";let E=GM(X).map((L)=>$.get(L)?32:L).filter((L)=>!G.get(L)),C=String.fromCodePoint.apply(null,E).normalize("NFKC"),H=GM(C);if(H.some((L)=>D.get(L)))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(Y.allowUnassigned!==!0){if(H.some((V)=>F.get(V)))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}let W=H.some((L)=>J.get(L)),K=H.some((L)=>Z.get(L));if(W&&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($M(H91(C))),Q=J.get($M(q91(C)));if(W&&!(U&&Q))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 C}M5.saslprep=M5;M5.default=M5;EM.exports=M5});var WM=z((yU1,qM)=>{qM.exports=I3;function I3(F,A){if(!(this instanceof I3))return new I3(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?NB(this.deduplicate.length):null}I3.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)};I3.prototype.lastUpdate=function(){if(!this.updates||!this.updates.length)return null;var F=this.updates.pop();return F.updated=!1,F};I3.prototype._array=function(F,A){if(F>=this.maxPages){if(A)return;W91(this,F)}U91(F,this.path);var B=this.pages;for(var D=this.level;D>0;D--){var J=this.path[D],Z=B[J];if(!Z){if(A)return;Z=B[J]=new Array(32768)}B=Z}return B};I3.prototype.get=function(F,A){var B=this._array(F,A),D=this.path[0],J=B&&B[D];if(!J&&!A){if(J=B[D]=new HM(F,NB(this.pageSize)),F>=this.length)this.length=F+1}if(J&&J.buffer===this.deduplicate&&this.deduplicate&&!A)J.buffer=z91(J.buffer),J.deduplicate=0;return J};I3.prototype.set=function(F,A){var B=this._array(F,!1),D=this.path[0];if(F>=this.length)this.length=F+1;if(!A||this.zeros&&A.equals&&A.equals(this.zeros)){B[D]=void 0;return}if(this.deduplicate&&A.equals&&A.equals(this.deduplicate))A=this.deduplicate;var J=B[D],Z=K91(A,this.pageSize);if(J)J.buffer=Z;else B[D]=new HM(F,Z)};I3.prototype.toBuffer=function(){var F=new Array(this.length),A=NB(this.pageSize),B=0;while(B<F.length){var D=this._array(B,!0);for(var J=0;J<32768&&B<F.length;J++)F[B++]=D&&D[J]?D[J].buffer:A}return Buffer.concat(F)};function W91(F,A){while(F.maxPages<A){var B=F.pages;F.pages=new Array(32768),F.pages[0]=B,F.level++,F.maxPages*=32768}}function K91(F,A){if(F.length===A)return F;if(F.length>A)return F.slice(0,A);var B=NB(A);return F.copy(B),B}function NB(F){if(Buffer.alloc)return Buffer.alloc(F);var A=new Buffer(F);return A.fill(0),A}function z91(F){var A=Buffer.allocUnsafe?Buffer.allocUnsafe(F.length):new Buffer(F.length);return F.copy(A),A}function HM(F,A){this.offset=F*A.length,this.buffer=A,this.updated=!1,this.deduplicate=0}function U91(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 zM=z((vU1,KM)=>{var Q91=WM();KM.exports=C4;function C4(F){if(!(this instanceof C4))return new C4(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||Q91(this.pageSize),this.byteLength=this.pages.length*this.pageSize,this.length=8*this.byteLength,!V91(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}}C4.prototype.get=function(F){var A=F&7,B=(F-A)/8;return!!(this.getByte(B)&128>>A)};C4.prototype.getByte=function(F){var A=F&this._pageMask,B=(F-A)/this.pageSize,D=this.pages.get(B,!0);return D?D.buffer[A+this.pageOffset]:0};C4.prototype.set=function(F,A){var B=F&7,D=(F-B)/8,J=this.getByte(D);return this.setByte(D,A?J|128>>B:J&(255^128>>B))};C4.prototype.toBuffer=function(){var F=L91(this.pages.length*this.pageSize);for(var A=0;A<this.pages.length;A++){var B=this.pages.get(A,!0),D=A*this.pageSize;if(B)B.buffer.copy(F,D,this.pageOffset,this.pageOffset+this.pageSize)}return F};C4.prototype.setByte=function(F,A){var B=F&this._pageMask,D=(F-B)/this.pageSize,J=this.pages.get(D,!1);if(B+=this.pageOffset,J.buffer[B]===A)return!1;if(J.buffer[B]=A,F>=this.byteLength)this.byteLength=F+1,this.length=this.byteLength*8;if(this._trackUpdates)this.pages.updated(J);return!0};function L91(F){if(Buffer.alloc)return Buffer.alloc(F);var A=new Buffer(F);return A.fill(0),A}function V91(F){return!(F&F-1)}});var UM=z((R7)=>{var R91=R7&&R7.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(R7,"__esModule",{value:!0});R7.createMemoryCodePoints=void 0;var w91=R91(zM());function I91(F){let A=0;function B(){let G=F.readUInt32BE(A);A+=4;let E=F.slice(A,A+G);return A+=G,w91.default({buffer:E})}let D=B(),J=B(),Z=B(),X=B(),Y=B(),$=B();return{unassigned_code_points:D,commonly_mapped_to_nothing:J,non_ASCII_space_characters:Z,prohibited_characters:X,bidirectional_r_al:Y,bidirectional_l:$}}R7.createMemoryCodePoints=I91});var LM=z((QM)=>{Object.defineProperty(QM,"__esModule",{value:!0});var N91=import.meta.require("zlib");QM.default=N91.gunzipSync(Buffer.from("H4sIAAAAAAACA+3dTYgcWR0A8FfTnekQ47aCkBxiZpYV8RhwYQM7bA/ksoLgSRD0IOSiePAkLrowvWSF4CkHEW856MlTQHA9RKZ1ZJODsEcVcTOyhxUEbXdXtpPp1PNVV39Uz4czEyaTVOb3G6a7XtWrr/devX49/+qekG2Go7Aa2jHGyozG+Dmrzi2mP/xb/zMhLI+WlRm2byubm2h0ivVi7BYzusVjuNkt1l9uFWsutWL8OP4rzV9KeXdsKx1HFhbSc6vIG0fKBZ14UNfLFS6FRrGRtXh98ZvphL/x4uLV/IOzaat/vlikv/TixavxR8PQitfPpKNbffXSwgtr8fV07GX+L1967urwg5W0/t0LV37y/oWFlQtX8ping7reXE3LT680r9yPKyn/3Vn64SwdVs6m/KN0yHrp9D+RvXsqpe6MSia5mH6LSog//Xq/++O74YVTjfDFWK2VIuNSemiPppphcVYeyzcudKqFMiq6cs3vVkrzlcnE0mxeZ1Jf2ZXsSvk8TmRZWYdpalydxd5bc8eUkt1wlEbtqTVLr8XQLFpKMb+dpr9SbSOt4ozTgXUq8+Ihm8cTt0shtCvT6dwao6sxPf5ydmU208/Z0yH8IZtlvZi3e5fG12yn3PLSdPvnQ7vsK9rxyKpqevzFZGVfu3YHezvbnbvit9Xdm5fGbf/MZ7PuuNrTjLJnaofH7gm0h+VKU/g/tdUocrer3cO4yOcuycGoyLrba6Ta+lrlnkZ5ntvWCrfV39wLTuNg9QvsvHb37P8BAGCP0eNTOH5szf154JmnNQIcn7b+FziyAfX4eWnn+C6Lm4M0mj31ubkViiDV4WLvs56qN54xGS3HWER5su6nQtZubl9tcY/4atbr9e5kWewew/g2a8fdy2Yaa97+pgQAAAAAAIBHtt+dYmWwaN/byI5g/9PYVfMvb4YvvDpOLJxvFgueP9VbPXh8/yCZViZxNYATaejmDQAAAACgfjJ/3QUA4JD3Px1InT+5PtQCAAAAAAAAAKD2xP8BAAAAAAAAoP7E/wEAAAAAAACg/sT/AQAAAAAAAKD+xP8BAAAAAAAAoP7E/wEAAAAAAACg/sT/AQAAAAAAAKD+xP8BAAAAAAAAoP7E/wEAAAAAAACg/sT/AQAAAAAAAKD+xP8BAAAAAAAAoP6G6+khVCgSAAAAAAAAAKidYQjLYVfNcPSyAE+dhQsnvAAq59/VHAAAAAAAAOCJmv8E/w4HiLqf3nWuWCB1pe0esg/pT3sKd+m4XjhpFpZH3/1THTcU6cfRLnrHf3ZNPZs+bf9rwPuIUPYAWb+j/Zy0EaAxAAAAAADwrPJ1IMBenu6ea99M+0W/17wCAAAAAAAAnGRLm8oA4JnQUAQAAAAAAAAAUHvi/wAAAAAAAABQf+L/AAAAAAAAAFB/4v8AAAAAAAAAUH/i/wAAAAAAAABQf+L/AAAAAAAAAFB/4v8AAAAAAAAAUH/i/wAAAAAAAABQf+L/AAAAAAAAAFB/4v8AAAAAAAAAUH/i/wAAAAAAAABQf+L/AAAAAAAAAFB/jdX0ECsUCQAAAAAAAADUTiMCAAAAAAAAAHU3VAQAAAAAAAAAUH8hLNf1uwsWbhT/uWBzUEx/ei1Nxc001VqrnN2wuRjCK3G4HuNgtuJoSVj17Q9QyBQBAAAAAAAAHMKpuJ4/+Otc5L2XZi8dJlQ/LCPXhc4keJ9UI9uFre3rDfY9uoXZPQBFHL34HSWWm8sx5rH83d967IfZMRZHHG/2Qi8MFnbscXnhnzHei5NND8P2bW2OT3G8vFeebBHbz9dGEf5jDt+fK4/mTve1bnwndsNL92+mE/75xhs/yz65Ed/ZbP29SP96oxvCDxrxcjj333R262/d6X6tG66lYy/z/+rtMn83nHvv9nfOv/dw4+pvspCl4v7+1npa/nHvtbSvjSJ/mf79/VuLC7N03LiW8o/SMU8ldO+jPOul1OVQ3vVwK+TZqBLCt3/RXvveS7eaD0L8YyhrJeV/cC0WGTdD1hzlCo2H98vzK9a+963V7qRVTeaNa+ZGpWp+N62jSmOetJD8dn67fB4n8nzchG7n4+os2tcgzLWUQVg70rta8lE7nqW7IW710v7eDsV1F7e6433njYfd9j9Gl2KIveptMePVamOXQuhXO5tUk6Pv+kiPX43T7/3YevDy4MN+HLw8CHPX6OqOOwKe73z0+pnf3rvT6pX76j/SUU7/3UjqX5r7ZW7PdZU8Vq2id+29Pphdh3n1Tqp/t0aXaWVOPnsFGre+waRdpKf/TK+7fiX3bOWluVeJg77AAPNDwr37fwAA2GP0+BSOHwcn6/231ghwfPr6X+DIBtTj582d47s8LD3xMeYktt+YHXHe6XQuH9P4Nu+H3ctmGmve/qYEAAAAAACAR7bfnWJlsGgSNNoM54tPZ23EI4vYzPY1/fzq1ud/GP/01jjx8P2tYsG7DzrrB4/vHySTz5YB+n8AAAAAgJrJ/XEXAIDHEf/2yXUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGdABAAAAAAAAADqbqgIAAAAAAAAAKD2hv8DWK79UBhoBgA=","base64"))});var wM=z((t$,RM)=>{var VM=t$&&t$.__importDefault||function(F){return F&&F.__esModule?F:{default:F}},M91=VM(CM()),T91=UM(),j91=VM(LM()),u91=T91.createMemoryCodePoints(j91.default);function T5(F,A){return M91.default(u91,F,A)}T5.saslprep=T5;T5.default=T5;RM.exports=T5});var xM=z((kM)=>{Object.defineProperty(kM,"__esModule",{value:!0});kM.ScramSHA256=kM.ScramSHA1=void 0;var O91=wM(),t4=import.meta.require("crypto"),o$=w1(),x6=p(),TB=a(),k91=t3(),IM=n6();class FG extends k91.AuthProvider{constructor(F){super();this.cryptoMethod=F||"sha1"}async prepare(F,A){let B=this.cryptoMethod,D=A.credentials;if(!D)throw new x6.MongoMissingCredentialsError("AuthContext must provide credentials.");let J=await TB.randomBytes(24);return A.nonce=J,{...F,speculativeAuthenticate:{...TM(B,D,J),db:D.source}}}async auth(F){let{reauthenticating:A,response:B}=F;if(B?.speculativeAuthenticate&&!A)return await jM(this.cryptoMethod,B.speculativeAuthenticate,F);return await S91(this.cryptoMethod,F)}}function PM(F){return F.replace("=","=3D").replace(",","=2C")}function MM(F,A){return Buffer.concat([Buffer.from("n=","utf8"),Buffer.from(F,"utf8"),Buffer.from(",r=","utf8"),Buffer.from(A.toString("base64"),"utf8")])}function TM(F,A,B){let D=PM(A.username);return{saslStart:1,mechanism:F==="sha1"?IM.AuthMechanism.MONGODB_SCRAM_SHA1:IM.AuthMechanism.MONGODB_SCRAM_SHA256,payload:new o$.Binary(Buffer.concat([Buffer.from("n,,","utf8"),MM(D,B)])),autoAuthorize:1,options:{skipEmptyExchange:!0}}}async function S91(F,A){let{connection:B,credentials:D}=A;if(!D)throw new x6.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!A.nonce)throw new x6.MongoInvalidArgumentError("AuthContext must contain a valid nonce property");let J=A.nonce,Z=D.source,X=TM(F,D,J),Y=await B.command(TB.ns(`${Z}.$cmd`),X,void 0);await jM(F,Y,A)}async function jM(F,A,B){let{connection:D,credentials:J}=B;if(!J)throw new x6.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!B.nonce)throw new x6.MongoInvalidArgumentError("Unable to continue SCRAM without valid nonce");let Z=B.nonce,X=J.source,Y=PM(J.username),$=J.password,G=F==="sha256"?O91.saslprep($):x91(Y,$),E=Buffer.isBuffer(A.payload)?new o$.Binary(A.payload):A.payload,C=NM(E),H=parseInt(C.i,10);if(H&&H<4096)throw new x6.MongoRuntimeError(`Server returned an invalid iteration count ${H}`);let{s:q,r:W}=C;if(W.startsWith("nonce"))throw new x6.MongoRuntimeError(`Server returned an invalid nonce: ${W}`);let K=`c=biws,r=${W}`,U=y91(G,Buffer.from(q,"base64"),H,F),Q=PB(F,U,"Client Key"),L=PB(F,U,"Server Key"),V=_91(F,Q),w=[MM(Y,Z),E.toString("utf8"),K].join(","),j=PB(F,V,w),T=`p=${f91(Q,j)}`,M=[K,T].join(","),x=PB(F,L,w),m={saslContinue:1,conversationId:A.conversationId,payload:new o$.Binary(Buffer.from(M))},u=await D.command(TB.ns(`${X}.$cmd`),m,void 0),k=NM(u.payload);if(!v91(Buffer.from(k.v,"base64"),x))throw new x6.MongoRuntimeError("Server returned an invalid signature");if(u.done!==!1)return;let O={saslContinue:1,conversationId:u.conversationId,payload:Buffer.alloc(0)};await D.command(TB.ns(`${X}.$cmd`),O,void 0)}function NM(F){let A=F.toString("utf8"),B={},D=A.split(",");for(let J=0;J<D.length;J++){let Z=(D[J].match(/^([^=]*)=(.*)$/)??[]).slice(1);B[Z[0]]=Z[1]}return B}function x91(F,A){if(typeof F!=="string")throw new x6.MongoInvalidArgumentError("Username must be a string");if(typeof A!=="string")throw new x6.MongoInvalidArgumentError("Password must be a string");if(A.length===0)throw new x6.MongoInvalidArgumentError("Password cannot be empty");let B;try{B=t4.createHash("md5")}catch(D){if(t4.getFips())throw new Error("Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode");throw D}return B.update(`${F}:mongo:${A}`,"utf8"),B.digest("hex")}function f91(F,A){if(!Buffer.isBuffer(F))F=Buffer.from(F);if(!Buffer.isBuffer(A))A=Buffer.from(A);let B=Math.max(F.length,A.length),D=[];for(let J=0;J<B;J+=1)D.push(F[J]^A[J]);return Buffer.from(D).toString("base64")}function _91(F,A){return t4.createHash(F).update(A).digest()}function PB(F,A,B){return t4.createHmac(F,A).update(B).digest()}var MB={},e$=0;function g91(){MB={},e$=0}var b91={sha256:32,sha1:20};function y91(F,A,B,D){let J=[F,A.toString("base64"),B].join("_");if(MB[J]!=null)return MB[J];let Z=t4.pbkdf2Sync(F,A,B,b91[D],D);if(e$>=200)g91();return MB[J]=Z,e$+=1,Z}function v91(F,A){if(F.length!==A.length)return!1;if(typeof t4.timingSafeEqual==="function")return t4.timingSafeEqual(F,A);let B=0;for(let D=0;D<F.length;D++)B|=F[D]^A[D];return B===0}class uM extends FG{constructor(){super("sha1")}}kM.ScramSHA1=uM;class OM extends FG{constructor(){super("sha256")}}kM.ScramSHA256=OM});var vM=z((bM)=>{Object.defineProperty(bM,"__esModule",{value:!0});bM.X509=void 0;var fM=p(),m91=a(),d91=t3();class gM extends d91.AuthProvider{async prepare(F,A){let{credentials:B}=A;if(!B)throw new fM.MongoMissingCredentialsError("AuthContext must provide credentials.");return{...F,speculativeAuthenticate:_M(B)}}async auth(F){let{connection:A,credentials:B}=F;if(!B)throw new fM.MongoMissingCredentialsError("AuthContext must provide credentials.");if(F.response?.speculativeAuthenticate)return;await A.command(m91.ns("$external.$cmd"),_M(B),void 0)}}bM.X509=gM;function _M(F){let A={authenticate:1,mechanism:"MONGODB-X509"};if(F.username)A.user=F.username;return A}});var BG=z((lM)=>{Object.defineProperty(lM,"__esModule",{value:!0});lM.MongoClientAuthProviders=void 0;var c91=qA(),l91=KP(),dM=IB(),p91=oP(),i91=DM(),hM=c$(),n91=YM(),N3=n6(),mM=xM(),s91=vM(),AG=p(),a91=new Map([[N3.AuthMechanism.MONGODB_AWS,()=>new l91.MongoDBAWS],[N3.AuthMechanism.MONGODB_CR,()=>{throw new AG.MongoInvalidArgumentError("MONGODB-CR is no longer a supported auth mechanism in MongoDB 4.0+")}],[N3.AuthMechanism.MONGODB_GSSAPI,()=>new c91.GSSAPI],[N3.AuthMechanism.MONGODB_OIDC,(F)=>new dM.MongoDBOIDC(F)],[N3.AuthMechanism.MONGODB_PLAIN,()=>new n91.Plain],[N3.AuthMechanism.MONGODB_SCRAM_SHA1,()=>new mM.ScramSHA1],[N3.AuthMechanism.MONGODB_SCRAM_SHA256,()=>new mM.ScramSHA256],[N3.AuthMechanism.MONGODB_X509,()=>new s91.X509]]);class cM{constructor(){this.existingProviders=new Map}getOrCreateProvider(F,A){let B=this.existingProviders.get(F);if(B)return B;let D=a91.get(F);if(!D)throw new AG.MongoInvalidArgumentError(`authMechanism ${F} not supported`);let J;if(F===N3.AuthMechanism.MONGODB_OIDC)J=D(this.getWorkflow(A));else J=D();return this.existingProviders.set(F,J),J}getWorkflow(F){if(F.OIDC_HUMAN_CALLBACK)return new i91.HumanCallbackWorkflow(new hM.TokenCache,F.OIDC_HUMAN_CALLBACK);else if(F.OIDC_CALLBACK)return new p91.AutomatedCallbackWorkflow(new hM.TokenCache,F.OIDC_CALLBACK);else{let A=F.ENVIRONMENT,B=dM.OIDC_WORKFLOWS.get(A)?.();if(!B)throw new AG.MongoInvalidArgumentError(`Could not load workflow for environment ${F.ENVIRONMENT}`);return B}}}lM.MongoClientAuthProviders=cM});var iM=z((jB)=>{Object.defineProperty(jB,"__esModule",{value:!0});r91(o4(),jB);function r91(F){for(let A of Object.keys(F))Object.defineProperty(jB,A,{enumerable:!0,get:function(){return F[A]}})}});var ZG=z((nM)=>{Object.defineProperty(nM,"__esModule",{value:!0});nM.ClientBulkWriteOperation=void 0;var DG=iM(),t91=N6(),o91=a(),e91=Y0(),w7=O1();class JG extends e91.CommandOperation{get commandName(){return"bulkWrite"}constructor(F,A){super(void 0,A);this.commandBuilder=F,this.options=A,this.ns=new o91.MongoDBNamespace("admin","$cmd")}resetBatch(){return this.commandBuilder.resetBatch()}get canRetryWrite(){return this.commandBuilder.isBatchRetryable}async execute(F,A){let B;if(F.description.type===DG.ServerType.LoadBalancer)if(A){let D;if(!A.pinnedConnection)D=await F.pool.checkOut(),A.pin(D);else D=A.pinnedConnection;B=this.commandBuilder.buildBatch(D.hello?.maxMessageSizeBytes,D.hello?.maxWriteBatchSize,D.hello?.maxBsonObjectSize)}else throw new DG.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 DG.MongoClientBulkWriteExecutionError("In order to execute a client bulk write, both maxWriteBatchSize, maxMessageSizeBytes and maxBsonObjectSize must be provided by the servers hello response.");B=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,B,t91.ClientBulkWriteCursorResponse)}}nM.ClientBulkWriteOperation=JG;w7.defineAspects(JG,[w7.Aspect.WRITE_OPERATION,w7.Aspect.SKIP_COLLATION,w7.Aspect.CURSOR_CREATING,w7.Aspect.RETRYABLE,w7.Aspect.COMMAND_BATCHING])});var oM=z((rM)=>{Object.defineProperty(rM,"__esModule",{value:!0});rM.ClientBulkWriteCursor=void 0;var F71=ZG(),A71=l0(),aM=a(),B71=k6();class XG extends B71.AbstractCursor{constructor(F,A,B={}){super(F,new aM.MongoDBNamespace("admin","$cmd"),B);this.commandBuilder=A,this.clientBulkWriteOptions=B}get response(){if(this.cursorResponse)return this.cursorResponse;return null}get operations(){return this.commandBuilder.lastOperations}clone(){let F=aM.mergeOptions({},this.clientBulkWriteOptions);return delete F.session,new XG(this.client,this.commandBuilder,{...F})}async _initialize(F){let A=new F71.ClientBulkWriteOperation(this.commandBuilder,{...this.clientBulkWriteOptions,...this.cursorOptions,session:F}),B=await A71.executeOperation(this.client,A);return this.cursorResponse=B,{server:A.server,session:F,response:B}}}rM.ClientBulkWriteCursor=XG});var ET=z((JT)=>{Object.defineProperty(JT,"__esModule",{value:!0});JT.buildReplaceOneOperation=JT.buildUpdateManyOperation=JT.buildUpdateOneOperation=JT.buildDeleteManyOperation=JT.buildDeleteOneOperation=JT.buildInsertOneOperation=JT.ClientBulkWriteCommandBuilder=void 0;JT.buildOperation=GG;var YG=w1(),eM=o8(),j5=p(),EG=a(),FT=1000;class AT{constructor(F,A,B){this.models=F,this.options=A,this.pkFactory=B??EG.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,B){this.isBatchRetryable=!0;let D=0,J=0,Z=this.baseCommand(),X=new Map;this.previousModelIndex=this.currentModelIndex;while(this.currentModelIndex<this.models.length){let Y=this.models[this.currentModelIndex],$=Y.namespace,G=X.get($);if(Y.name==="deleteMany"||Y.name==="updateMany")this.isBatchRetryable=!1;if(G!=null){let E=GG(Y,G,this.pkFactory),C;try{C=YG.BSON.serialize(E)}catch(H){throw new j5.MongoInvalidArgumentError("Could not serialize operation to BSON",{cause:H})}if($G("ops",C,B),D+C.length<F&&Z.ops.documents.length<A)D=FT+Z.ops.push(E,C),this.currentModelIndex++;else break}else{X.set($,J);let E={ns:$},C=GG(Y,J,this.pkFactory),H,q;try{H=YG.BSON.serialize(E),q=YG.BSON.serialize(C)}catch(W){throw new j5.MongoInvalidArgumentError("Could not serialize ns info to BSON",{cause:W})}if($G("nsInfo",H,B),$G("ops",q,B),D+H.length+q.length<F&&Z.ops.documents.length<A)D=FT+Z.nsInfo.push(E,H)+Z.ops.push(C,q),J++,this.currentModelIndex++;else break}}return this.lastOperations=Z.ops.documents,Z}baseCommand(){let F={bulkWrite:1,errorsOnly:this.errorsOnly,ordered:this.options.ordered??!0,ops:new eM.DocumentSequence("ops"),nsInfo:new eM.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}}JT.ClientBulkWriteCommandBuilder=AT;function $G(F,A,B){if(A.length>B)throw new j5.MongoInvalidArgumentError(`Client bulk write operation ${F} of length ${A.length} exceeds the max bson object size of ${B}`)}var D71=(F,A,B)=>{let D={insert:A,document:F.document};return D.document._id=F.document._id??B.createPk(),D};JT.buildInsertOneOperation=D71;var J71=(F,A)=>{return BT(F,A,!1)};JT.buildDeleteOneOperation=J71;var Z71=(F,A)=>{return BT(F,A,!0)};JT.buildDeleteManyOperation=Z71;function BT(F,A,B){let D={delete:A,multi:B,filter:F.filter};if(F.hint)D.hint=F.hint;if(F.collation)D.collation=F.collation;return D}var X71=(F,A)=>{return DT(F,A,!1)};JT.buildUpdateOneOperation=X71;var Y71=(F,A)=>{return DT(F,A,!0)};JT.buildUpdateManyOperation=Y71;function $71(F){if(!EG.hasAtomicOperators(F))throw new j5.MongoAPIError("Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty.")}function DT(F,A,B){$71(F.update);let D={update:A,multi:B,filter:F.filter,updateMods:F.update};if(F.hint)D.hint=F.hint;if(F.upsert)D.upsert=F.upsert;if(F.arrayFilters)D.arrayFilters=F.arrayFilters;if(F.collation)D.collation=F.collation;return D}var G71=(F,A)=>{if(EG.hasAtomicOperators(F.replacement))throw new j5.MongoAPIError("Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty.");let B={update:A,multi:!1,filter:F.filter,updateMods:F.replacement};if(F.hint)B.hint=F.hint;if(F.upsert)B.upsert=F.upsert;if(F.collation)B.collation=F.collation;return B};JT.buildReplaceOneOperation=G71;function GG(F,A,B){switch(F.name){case"insertOne":return JT.buildInsertOneOperation(F,A,B);case"deleteOne":return JT.buildDeleteOneOperation(F,A);case"deleteMany":return JT.buildDeleteManyOperation(F,A);case"updateOne":return JT.buildUpdateOneOperation(F,A);case"updateMany":return JT.buildUpdateManyOperation(F,A);case"replaceOne":return JT.buildReplaceOneOperation(F,A)}}});var WT=z((HT)=>{Object.defineProperty(HT,"__esModule",{value:!0});HT.ClientBulkWriteResultsMerger=void 0;var H71=o4(),q71=p(),W71={acknowledged:!1,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0};class CT{static unacknowledged(){return W71}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 B of F)if(B.ok===1){if(this.options.verboseResults)this.processDocument(F,B)}else if(this.options.ordered){let D=new q71.MongoClientBulkWriteError({message:"Mongo client ordered bulk write encountered a write error."});throw D.writeErrors.set(B.idx+this.currentBatchOffset,{code:B.code,message:B.errmsg}),D.partialResult=this.result,D}else this.writeErrors.set(B.idx+this.currentBatchOffset,{code:B.code,message:B.errmsg})}catch(B){if(B instanceof H71.MongoWriteConcernError){let D=B.result;if(A={insertedCount:D.nInserted,upsertedCount:D.nUpserted,matchedCount:D.nMatched,modifiedCount:D.nModified,deletedCount:D.nDeleted,writeConcernError:D.writeConcernError},this.options.verboseResults&&D.cursor.firstBatch){for(let J of D.cursor.firstBatch)if(J.ok===1)this.processDocument(F,J)}}else throw B}finally{if(F.response){let B=F.response;this.incrementCounts(B)}this.currentBatchOffset+=F.operations.length}if(A){let B=A.writeConcernError;this.incrementCounts(A),this.writeConcernErrors.push({code:B.code,message:B.errmsg})}return this.result}processDocument(F,A){let B=F.operations[A.idx];if("insert"in B)this.result.insertResults?.set(A.idx+this.currentBatchOffset,{insertedId:B.document._id});if("update"in B){let D={matchedCount:A.n,modifiedCount:A.nModified??0,didUpsert:A.upserted!=null};if(A.upserted)D.upsertedId=A.upserted._id;this.result.updateResults?.set(A.idx+this.currentBatchOffset,D)}if("delete"in B)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}}HT.ClientBulkWriteResultsMerger=CT});var LT=z((UT)=>{Object.defineProperty(UT,"__esModule",{value:!0});UT.ClientBulkWriteExecutor=void 0;var K71=oM(),e4=p(),z71=c0(),U71=l0(),Q71=ZG(),L71=ET(),KT=WT();class zT{constructor(F,A,B){if(A.length===0)throw new e4.MongoClientBulkWriteExecutionError("No client bulk write models were provided.");if(this.client=F,this.operations=A,this.options={ordered:!0,bypassDocumentValidation:!1,verboseResults:!1,...B},!this.options.writeConcern)this.options.writeConcern=z71.WriteConcern.fromOptions(this.client.options);if(this.options.writeConcern?.w===0){if(this.options.verboseResults)throw new e4.MongoInvalidArgumentError("Cannot request unacknowledged write concern and verbose results");if(this.options.ordered)throw new e4.MongoInvalidArgumentError("Cannot request unacknowledged write concern and ordered writes")}}async execute(){let F=this.client.s.options.pkFactory,A=new L71.ClientBulkWriteCommandBuilder(this.operations,this.options,F);if(this.options.writeConcern?.w===0){while(A.hasNextBatch()){let B=new Q71.ClientBulkWriteOperation(A,this.options);await U71.executeOperation(this.client,B)}return KT.ClientBulkWriteResultsMerger.unacknowledged()}else{let B=new KT.ClientBulkWriteResultsMerger(this.options);while(A.hasNextBatch()){let D=new K71.ClientBulkWriteCursor(this.client,A,this.options);try{await B.merge(D)}catch(J){if(J instanceof e4.MongoServerError&&!(J instanceof e4.MongoClientBulkWriteError)){let Z=new e4.MongoClientBulkWriteError({message:"Mongo client bulk write encountered an error during execution"});throw Z.cause=J,Z.partialResult=B.bulkWriteResult,Z}else throw J}}if(B.writeConcernErrors.length>0||B.writeErrors.size>0){let D=new e4.MongoClientBulkWriteError({message:"Mongo client bulk write encountered errors during execution."});throw D.writeConcernErrors=B.writeConcernErrors,D.writeErrors=B.writeErrors,D.partialResult=B.bulkWriteResult,D}return B.bulkWriteResult}}}UT.ClientBulkWriteExecutor=zT});var HG=z((NT)=>{Object.defineProperty(NT,"__esModule",{value:!0});NT.WaitingForSuitableServerEvent=NT.ServerSelectionSucceededEvent=NT.ServerSelectionFailedEvent=NT.ServerSelectionStartedEvent=NT.ServerSelectionEvent=void 0;var V71=a(),uB=W0();class I7{constructor(F,A,B){this.selector=F,this.operation=B,this.topologyDescription=A}}NT.ServerSelectionEvent=I7;class VT extends I7{constructor(F,A,B){super(F,A,B);this.name=uB.SERVER_SELECTION_STARTED,this.message="Server selection started"}}NT.ServerSelectionStartedEvent=VT;class RT extends I7{constructor(F,A,B,D){super(F,A,D);this.name=uB.SERVER_SELECTION_FAILED,this.message="Server selection failed",this.failure=B}}NT.ServerSelectionFailedEvent=RT;class wT extends I7{constructor(F,A,B,D){super(F,A,D);this.name=uB.SERVER_SELECTION_SUCCEEDED,this.message="Server selection succeeded";let{host:J,port:Z}=V71.HostAddress.fromString(B).toHostPort();this.serverHost=J,this.serverPort=Z}}NT.ServerSelectionSucceededEvent=wT;class IT extends I7{constructor(F,A,B,D){super(F,A,D);this.name=uB.WAITING_FOR_SUITABLE_SERVER,this.message="Waiting for suitable server to become available",this.remainingTimeMS=B}}NT.WaitingForSuitableServerEvent=IT});var KG=z((MT)=>{Object.defineProperty(MT,"__esModule",{value:!0});MT.SrvPoller=MT.SrvPollingEvent=void 0;var P71=import.meta.require("dns"),qG=import.meta.require("timers"),M71=p(),T71=d2(),OB=a();class WG{constructor(F){this.srvRecords=F}hostnames(){return new Set(this.srvRecords.map((F)=>OB.HostAddress.fromSrvRecord(F).toString()))}}MT.SrvPollingEvent=WG;class kB extends T71.TypedEventEmitter{constructor(F){super();if(!F||!F.srvHost)throw new M71.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)qG.clearTimeout(this._timeout),this.generation+=1,this._timeout=void 0}schedule(){if(this._timeout)qG.clearTimeout(this._timeout);this._timeout=qG.setTimeout(()=>{this._poll().then(void 0,OB.squashError)},this.intervalMS)}success(F){this.haMode=!1,this.schedule(),this.emit(kB.SRV_RECORD_DISCOVERY,new WG(F))}failure(){this.haMode=!0,this.schedule()}async _poll(){let F=this.generation,A;try{A=await P71.promises.resolveSrv(this.srvAddress)}catch{this.failure();return}if(F!==this.generation)return;let B=[];for(let D of A)try{OB.checkParentDomainMatch(D.name,this.srvHost),B.push(D)}catch(J){OB.squashError(J)}if(!B.length){this.failure();return}this.success(B)}}MT.SrvPoller=kB;kB.SRV_RECORD_DISCOVERY="srvRecordDiscovery"});var vT=z((bT)=>{Object.defineProperty(bT,"__esModule",{value:!0});bT.ServerCapabilities=bT.Topology=void 0;var jT=w$(),M2=W0(),M3=p(),e1=d4(),u71=d2(),u5=P0(),uT=q5(),C6=a(),E1=v2(),H4=BB(),OT=$$(),UG=Y5(),zG=j8(),q4=HG(),SB=KG(),kT=kY(),O71=0,O5=C6.makeStateMachine({[E1.STATE_CLOSED]:[E1.STATE_CLOSED,E1.STATE_CONNECTING],[E1.STATE_CONNECTING]:[E1.STATE_CONNECTING,E1.STATE_CLOSING,E1.STATE_CONNECTED,E1.STATE_CLOSED],[E1.STATE_CONNECTED]:[E1.STATE_CONNECTED,E1.STATE_CLOSING,E1.STATE_CLOSED],[E1.STATE_CLOSING]:[E1.STATE_CLOSING,E1.STATE_CLOSED]}),QG=Symbol("cancelled"),P3=Symbol("waitQueue");class v1 extends u71.TypedEventEmitter{constructor(F,A,B){super();if(this.client=F,B=B??{hosts:[C6.HostAddress.fromString("localhost:27017")],...Object.fromEntries(jT.DEFAULT_OPTIONS.entries()),...Object.fromEntries(jT.FEATURE_FLAGS.entries())},typeof A==="string")A=[C6.HostAddress.fromString(A)];else if(!Array.isArray(A))A=[A];let D=[];for(let $ of A)if(typeof $==="string")D.push(C6.HostAddress.fromString($));else if($ instanceof C6.HostAddress)D.push($);else throw new M3.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify($)}`);let J=k71(B),Z=O71++,X=B.srvMaxHosts==null||B.srvMaxHosts===0||B.srvMaxHosts>=D.length?D:C6.shuffle(D,B.srvMaxHosts),Y=new Map;for(let $ of X)Y.set($.toString(),new UG.ServerDescription($));if(this[P3]=new C6.List,this.s={id:Z,options:B,seedlist:D,state:E1.STATE_CLOSED,description:new kT.TopologyDescription(J,Y,B.replicaSet,void 0,void 0,void 0,B),serverSelectionTimeoutMS:B.serverSelectionTimeoutMS,heartbeatFrequencyMS:B.heartbeatFrequencyMS,minHeartbeatFrequencyMS:B.minHeartbeatFrequencyMS,servers:new Map,credentials:B?.credentials,clusterTime:void 0,connectionTimers:new Set,detectShardedTopology:($)=>this.detectShardedTopology($),detectSrvRecords:($)=>this.detectSrvRecords($)},this.mongoLogger=F.mongoLogger,this.component="topology",B.srvHost&&!B.loadBalanced)this.s.srvPoller=B.srvPoller??new SB.SrvPoller({heartbeatFrequencyMS:this.s.heartbeatFrequencyMS,srvHost:B.srvHost,srvMaxHosts:B.srvMaxHosts,srvServiceName:B.srvServiceName}),this.on(v1.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology);this.connectionLock=void 0}detectShardedTopology(F){let A=F.previousDescription.type,B=F.newDescription.type,D=A!==E1.TopologyType.Sharded&&B===E1.TopologyType.Sharded,Z=!!this.s.srvPoller?.listeners(SB.SrvPoller.SRV_RECORD_DISCOVERY)?.includes(this.s.detectSrvRecords);if(D&&!Z)this.s.srvPoller?.on(SB.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;ST(this),this.emitAndLog(v1.TOPOLOGY_DESCRIPTION_CHANGED,new H4.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 LG(this.lastHello())}async connect(F){this.connectionLock??=this._connect(F);try{return await this.connectionLock,this}finally{this.connectionLock=void 0}return this}async _connect(F){if(F=F??{},this.s.state===E1.STATE_CONNECTED)return this;O5(this,E1.STATE_CONNECTING),this.emitAndLog(v1.TOPOLOGY_OPENING,new H4.TopologyOpeningEvent(this.s.id)),this.emitAndLog(v1.TOPOLOGY_DESCRIPTION_CHANGED,new H4.TopologyDescriptionChangedEvent(this.s.id,new kT.TopologyDescription(E1.TopologyType.Unknown),this.s.description));let A=Array.from(this.s.description.servers.values());if(this.s.servers=new Map(A.map((J)=>[J.address,_T(this,J)])),this.s.options.loadBalanced)for(let J of A){let Z=new UG.ServerDescription(J.hostAddress,void 0,{loadBalanced:this.s.options.loadBalanced});this.serverUpdateHandler(Z)}let B=F.readPreference??u5.ReadPreference.primary,D={operationName:"ping",...F};try{let J=await this.selectServer(zG.readPreferenceServerSelector(B),D);if(this.s.options[Symbol.for("@@mdb.skipPingOnConnect")]!==!0&&J&&this.s.credentials)return await J.command(C6.ns("admin.$cmd"),{ping:1},{}),O5(this,E1.STATE_CONNECTED),this.emit(v1.OPEN,this),this.emit(v1.CONNECT,this),this;return O5(this,E1.STATE_CONNECTED),this.emit(v1.OPEN,this),this.emit(v1.CONNECT,this),this}catch(J){throw this.close(),J}}close(){if(this.s.state===E1.STATE_CLOSED||this.s.state===E1.STATE_CLOSING)return;for(let F of this.s.servers.values())fT(F,this);if(this.s.servers.clear(),O5(this,E1.STATE_CLOSING),gT(this[P3],new M3.MongoTopologyClosedError),E1.drainTimerQueue(this.s.connectionTimers),this.s.srvPoller)this.s.srvPoller.stop(),this.s.srvPoller.removeListener(SB.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords);this.removeListener(v1.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology),O5(this,E1.STATE_CLOSED),this.emitAndLog(v1.TOPOLOGY_CLOSED,new H4.TopologyClosedEvent(this.s.id))}async selectServer(F,A){let B;if(typeof F!=="function")if(typeof F==="string")B=zG.readPreferenceServerSelector(u5.ReadPreference.fromString(F));else{let C;if(F instanceof u5.ReadPreference)C=F;else u5.ReadPreference.translate(A),C=A.readPreference||u5.ReadPreference.primary;B=zG.readPreferenceServerSelector(C)}else B=F;if(A={serverSelectionTimeoutMS:this.s.serverSelectionTimeoutMS,...A},this.client.mongoLogger?.willLog(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.ServerSelectionStartedEvent(F,this.description,A.operationName));let D=this.description.type===E1.TopologyType.Sharded,J=A.session,Z=J&&J.transaction;if(D&&Z&&Z.server){if(this.client.mongoLogger?.willLog(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.ServerSelectionSucceededEvent(F,this.description,Z.server.pool.address,A.operationName));return Z.server}let{promise:X,resolve:Y,reject:$}=C6.promiseWithResolvers(),G=uT.Timeout.expires(A.serverSelectionTimeoutMS??0),E={serverSelector:B,topologyDescription:this.description,mongoLogger:this.client.mongoLogger,transaction:Z,resolve:Y,reject:$,timeout:G,startTime:C6.now(),operationName:A.operationName,waitingLogged:!1,previousServer:A.previousServer};this[P3].push(E),xT(this);try{return await Promise.race([X,E.timeout])}catch(C){if(uT.TimeoutError.is(C)){E[QG]=!0,G.clear();let H=new M3.MongoServerSelectionError(`Server selection timed out after ${A.serverSelectionTimeoutMS} ms`,this.description);if(this.client.mongoLogger?.willLog(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.ServerSelectionFailedEvent(F,this.description,H,A.operationName));throw H}throw C}}serverUpdateHandler(F){if(!this.s.description.hasServer(F.address))return;if(S71(this.s.description,F))return;let A=this.s.description,B=this.s.description.servers.get(F.address);if(!B)return;let D=F.$clusterTime;if(D)E1._advanceClusterTime(this,D);let J=B&&B.equals(F);if(this.s.description=this.s.description.update(F),this.s.description.compatibilityError){this.emit(v1.ERROR,new M3.MongoCompatibilityError(this.s.description.compatibilityError));return}if(!J){let Z=this.s.description.servers.get(F.address);if(Z)this.emit(v1.SERVER_DESCRIPTION_CHANGED,new H4.ServerDescriptionChangedEvent(this.s.id,F.address,B,Z))}if(ST(this,F),this[P3].length>0)xT(this);if(!J)this.emitAndLog(v1.TOPOLOGY_DESCRIPTION_CHANGED,new H4.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===E1.STATE_CONNECTED}isDestroyed(){return this.s.state===E1.STATE_CLOSED}lastHello(){let F=Array.from(this.description.servers.values());if(F.length===0)return{};return F.filter((D)=>D.type!==E1.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}}bT.Topology=v1;v1.SERVER_OPENING=M2.SERVER_OPENING;v1.SERVER_CLOSED=M2.SERVER_CLOSED;v1.SERVER_DESCRIPTION_CHANGED=M2.SERVER_DESCRIPTION_CHANGED;v1.TOPOLOGY_OPENING=M2.TOPOLOGY_OPENING;v1.TOPOLOGY_CLOSED=M2.TOPOLOGY_CLOSED;v1.TOPOLOGY_DESCRIPTION_CHANGED=M2.TOPOLOGY_DESCRIPTION_CHANGED;v1.ERROR=M2.ERROR;v1.OPEN=M2.OPEN;v1.CONNECT=M2.CONNECT;v1.CLOSE=M2.CLOSE;v1.TIMEOUT=M2.TIMEOUT;function fT(F,A){for(let B of M2.LOCAL_SERVER_EVENTS)F.removeAllListeners(B);F.destroy(),A.emitAndLog(v1.SERVER_CLOSED,new H4.ServerClosedEvent(A.s.id,F.description.address));for(let B of M2.SERVER_RELAY_EVENTS)F.removeAllListeners(B)}function k71(F){if(F?.directConnection)return E1.TopologyType.Single;if(F?.replicaSet)return E1.TopologyType.ReplicaSetNoPrimary;if(F?.loadBalanced)return E1.TopologyType.LoadBalanced;return E1.TopologyType.Unknown}function _T(F,A){F.emitAndLog(v1.SERVER_OPENING,new H4.ServerOpeningEvent(F.s.id,A.address));let B=new OT.Server(F,A,F.s.options);for(let D of M2.SERVER_RELAY_EVENTS)B.on(D,(J)=>F.emit(D,J));return B.on(OT.Server.DESCRIPTION_RECEIVED,(D)=>F.serverUpdateHandler(D)),B.connect(),B}function ST(F,A){if(A&&F.s.servers.has(A.address)){let B=F.s.servers.get(A.address);if(B){if(B.s.description=A,A.error instanceof M3.MongoError&&A.error.hasErrorLabel(M3.MongoErrorLabel.ResetPool)){let D=A.error.hasErrorLabel(M3.MongoErrorLabel.InterruptInUseConnections);B.pool.clear({interruptInUseConnections:D})}else if(A.error==null){let D=F.s.description.type;if(A.isDataBearing||A.type!==E1.ServerType.Unknown&&D===E1.TopologyType.Single)B.pool.ready()}}}for(let B of F.description.servers.values())if(!F.s.servers.has(B.address)){let D=_T(F,B);F.s.servers.set(B.address,D)}for(let B of F.s.servers){let D=B[0];if(F.description.hasServer(D))continue;if(!F.s.servers.has(D))continue;let J=F.s.servers.get(D);if(F.s.servers.delete(D),J)fT(J,F)}}function gT(F,A){while(F.length){let B=F.shift();if(!B)continue;if(B.timeout.clear(),!B[QG]){if(B.mongoLogger?.willLog(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.DEBUG))B.mongoLogger?.debug(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.ServerSelectionFailedEvent(B.serverSelector,B.topologyDescription,A,B.operationName));B.reject(A)}}}function xT(F){if(F.s.state===E1.STATE_CLOSED){gT(F[P3],new M3.MongoTopologyClosedError);return}let A=F.description.type===E1.TopologyType.Sharded,B=Array.from(F.description.servers.values()),D=F[P3].length;for(let J=0;J<D;++J){let Z=F[P3].shift();if(!Z)continue;if(Z[QG])continue;let X;try{let{serverSelector:G,previousServer:E}=Z;X=G?G(F.description,B,E?[E]:[]):B}catch(G){if(Z.timeout.clear(),F.client.mongoLogger?.willLog(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.DEBUG))F.client.mongoLogger?.debug(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.ServerSelectionFailedEvent(Z.serverSelector,F.description,G,Z.operationName));Z.reject(G);continue}let Y;if(X.length===0){if(!Z.waitingLogged){if(F.client.mongoLogger?.willLog(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.INFORMATIONAL))F.client.mongoLogger?.info(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.WaitingForSuitableServerEvent(Z.serverSelector,F.description,F.s.serverSelectionTimeoutMS!==0?F.s.serverSelectionTimeoutMS-(C6.now()-Z.startTime):-1,Z.operationName));Z.waitingLogged=!0}F[P3].push(Z);continue}else if(X.length===1)Y=F.s.servers.get(X[0].address);else{let G=C6.shuffle(X,2),E=F.s.servers.get(G[0].address),C=F.s.servers.get(G[1].address);Y=E&&C&&E.s.operationCount<C.s.operationCount?E:C}if(!Y){let G=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(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.DEBUG))F.client.mongoLogger?.debug(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.ServerSelectionFailedEvent(Z.serverSelector,F.description,G,Z.operationName));Z.reject(G);return}let $=Z.transaction;if(A&&$&&$.isActive&&Y)$.pinServer(Y);if(Z.timeout.clear(),F.client.mongoLogger?.willLog(e1.MongoLoggableComponent.SERVER_SELECTION,e1.SeverityLevel.DEBUG))F.client.mongoLogger?.debug(e1.MongoLoggableComponent.SERVER_SELECTION,new q4.ServerSelectionSucceededEvent(Z.serverSelector,Z.topologyDescription,Y.pool.address,Z.operationName));Z.resolve(Y)}if(F[P3].length>0)for(let[,J]of F.s.servers)process.nextTick(function Z(){return J.requestCheck()})}function S71(F,A){let D=F.servers.get(A.address)?.topologyVersion;return UG.compareTopologyVersion(D,A.topologyVersion)>0}class LG{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}}bT.ServerCapabilities=LG});var D4=z((pT)=>{Object.defineProperty(pT,"__esModule",{value:!0});pT.MongoClient=pT.ServerApiVersion=void 0;var VG=import.meta.require("fs"),f71=w1(),_71=r4(),g71=KA(),b71=n6(),hT=w$(),y71=W0(),v71=LB(),RG=p(),h71=BG(),mT=d4(),m71=d2(),d71=LT(),c71=l0(),l71=f9(),dT=P0(),p71=J7(),i71=j8(),cT=vT(),lT=D7(),s0=a();pT.ServerApiVersion=Object.freeze({v1:"1"});var G0=Symbol("options");class wG extends m71.TypedEventEmitter{constructor(F,A){super();this[G0]=hT.parseOptions(F,this,A);let B=Object.values(this[G0].mongoLoggerOptions.componentSeverities).some((J)=>J!==mT.SeverityLevel.OFF);this.mongoLogger=B?new mT.MongoLogger(this[G0].mongoLoggerOptions):void 0;let D=this;this.s={url:F,bsonOptions:f71.resolveBSONOptions(this[G0]),namespace:s0.ns("admin"),hasBeenClosed:!1,sessionPool:new lT.ServerSessionPool(this),activeSessions:new Set,authProviders:new h71.MongoClientAuthProviders,get options(){return D[G0]},get readConcern(){return D[G0].readConcern},get writeConcern(){return D[G0].writeConcern},get readPreference(){return D[G0].readPreference},get isMongoClient(){return!0}},this.checkForNonGenuineHosts()}async asyncDispose(){await this.close()}checkForNonGenuineHosts(){let F=this[G0].hosts.filter((J)=>s0.isHostMatch(s0.DOCUMENT_DB_CHECK,J.host)),A=s0.isHostMatch(s0.DOCUMENT_DB_CHECK,this[G0].srvHost),B=this[G0].hosts.filter((J)=>s0.isHostMatch(s0.COSMOS_DB_CHECK,J.host)),D=s0.isHostMatch(s0.COSMOS_DB_CHECK,this[G0].srvHost);if(F.length!==0||A)this.mongoLogger?.info("client",s0.DOCUMENT_DB_MSG);else if(B.length!==0||D)this.mongoLogger?.info("client",s0.COSMOS_DB_MSG)}get options(){return Object.freeze({...this[G0]})}get serverApi(){return this[G0].serverApi&&Object.freeze({...this[G0].serverApi})}get monitorCommands(){return this[G0].monitorCommands}set monitorCommands(F){this[G0].monitorCommands=F}get autoEncrypter(){return this[G0].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}async bulkWrite(F,A){if(this.autoEncrypter)throw new RG.MongoInvalidArgumentError("MongoClient bulkWrite does not currently support automatic encryption.");return await new d71.ClientBulkWriteExecutor(this,F,s0.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[G0];if(F.tls){if(typeof F.tlsCAFile==="string")F.ca??=await VG.promises.readFile(F.tlsCAFile);if(typeof F.tlsCRLFile==="string")F.crl??=await VG.promises.readFile(F.tlsCRLFile);if(typeof F.tlsCertificateKeyFile==="string"){if(!F.key||!F.cert){let B=await VG.promises.readFile(F.tlsCertificateKeyFile);F.key??=B,F.cert??=B}}}if(typeof F.srvHost==="string"){let B=await hT.resolveSRVRecord(F);for(let[D,J]of B.entries())F.hosts[D]=J}if(F.credentials?.mechanism===b71.AuthMechanism.MONGODB_OIDC){let B=F.credentials?.mechanismProperties?.ALLOWED_HOSTS||g71.DEFAULT_ALLOWED_HOSTS;if(!F.credentials?.mechanismProperties?.ENVIRONMENT){for(let J of F.hosts)if(!s0.hostMatchesWildcards(J.toHostPort().host,B))throw new RG.MongoInvalidArgumentError(`Host '${J}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${B.join(",")}'`)}}this.topology=new cT.Topology(this,F.hosts,F),this.topology.once(cT.Topology.OPEN,()=>this.emit("open",this));for(let B of y71.MONGO_CLIENT_EVENTS)this.topology.on(B,(...D)=>this.emit(B,...D));let A=async()=>{try{await this.topology?.connect(F)}catch(B){throw this.topology?.close(),B}};if(this.autoEncrypter)await this.autoEncrypter?.init(),await A(),await F.encrypter.connectInternalClient();else await A();return this}async close(F=!1){Object.defineProperty(this.s,"hasBeenClosed",{value:!0,enumerable:!0,configurable:!1,writable:!1});let A=Array.from(this.s.activeSessions,($)=>$.endSession());if(this.s.activeSessions.clear(),await Promise.all(A),this.topology==null)return;let B=i71.readPreferenceServerSelector(dT.ReadPreference.primaryPreferred),D=this.topology.description,J=Array.from(D.servers.values());if(B(D,J).length!==0){let $=Array.from(this.s.sessionPool.sessions,({id:G})=>G);if($.length!==0)try{await c71.executeOperation(this,new l71.RunAdminCommandOperation({endSessions:$},{readPreference:dT.ReadPreference.primaryPreferred,noResponse:!0}))}catch(G){s0.squashError(G)}}let X=this.topology;this.topology=void 0,X.close();let{encrypter:Y}=this[G0];if(Y)await Y.close(this,F)}db(F,A){if(A=A??{},!F)F=this.options.dbName;let B=Object.assign({},this[G0],A);return new v71.Db(this,F,B)}static async connect(F,A){return await new this(F,A).connect()}startSession(F){let A=new lT.ClientSession(this,this.s.sessionPool,{explicit:!0,...F},this[G0]);return this.s.activeSessions.add(A),A.once("ended",()=>{this.s.activeSessions.delete(A)}),A}async withSession(F,A){let B={owner:Symbol(),...typeof F==="object"?F:{}},D=typeof F==="function"?F:A;if(D==null)throw new RG.MongoInvalidArgumentError("Missing required callback parameter");let J=this.startSession(B);try{return await D(J)}finally{try{await J.endSession()}catch(Z){s0.squashError(Z)}}}watch(F=[],A={}){if(!Array.isArray(F))A=F,F=[];return new _71.ChangeStream(this,F,s0.resolveOptions(this,A))}}pT.MongoClient=wG;p71.configureResourceManagement(wG.prototype)});var J7=z((nT)=>{Object.defineProperty(nT,"__esModule",{value:!0});nT.configureResourceManagement=k5;nT.configureExplicitResourceManagement=s71;function k5(F){Symbol.asyncDispose&&Object.defineProperty(F,Symbol.asyncDispose,{value:async function A(){await this.asyncDispose()},enumerable:!1,configurable:!0,writable:!0})}function s71(){let{MongoClient:F}=D4(),{ClientSession:A}=D7(),{AbstractCursor:B}=k6(),{ChangeStream:D}=r4();k5(F.prototype),k5(A.prototype),k5(B.prototype),k5(D.prototype)}});var k6=z((oT)=>{Object.defineProperty(oT,"__esModule",{value:!0});oT.AbstractCursor=oT.CURSOR_FLAGS=void 0;var tT=import.meta.require("stream"),N7=w1(),T2=p(),t71=d2(),sT=l0(),o71=gX(),e71=BL(),aT=B6(),xB=P0(),F81=J7(),rT=D7(),F9=a();oT.CURSOR_FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];class fB extends t71.TypedEventEmitter{constructor(F,A,B={}){super();if(this.documents=null,this.hasEmittedClose=!1,!F.s.isMongoClient)throw new T2.MongoRuntimeError("Cursor must be constructed with MongoClient");this.cursorClient=F,this.cursorNamespace=A,this.cursorId=null,this.initialized=!1,this.isClosed=!1,this.isKilled=!1,this.cursorOptions={readPreference:B.readPreference&&B.readPreference instanceof xB.ReadPreference?B.readPreference:xB.ReadPreference.primary,...N7.pluckBSONSerializeOptions(B)},this.cursorOptions.timeoutMS=B.timeoutMS;let D=aT.ReadConcern.fromOptions(B);if(D)this.cursorOptions.readConcern=D;if(typeof B.batchSize==="number")this.cursorOptions.batchSize=B.batchSize;if(B.comment!==void 0)this.cursorOptions.comment=B.comment;if(typeof B.maxTimeMS==="number")this.cursorOptions.maxTimeMS=B.maxTimeMS;if(typeof B.maxAwaitTimeMS==="number")this.cursorOptions.maxAwaitTimeMS=B.maxAwaitTimeMS;if(B.session instanceof rT.ClientSession)this.cursorSession=B.session;else this.cursorSession=this.cursorClient.startSession({owner:this,explicit:!1});this.deserializationOptions={...this.cursorOptions,validation:{utf8:B?.enableUtf8Validation===!1?!1:!0}}}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()}bufferedCount(){return this.documents?.length??0}readBufferedDocuments(F){let A=[],B=Math.min(F??this.documents?.length??0,this.documents?.length??0);for(let D=0;D<B;D++){let J=this.documents?.shift(this.deserializationOptions);if(J!=null)A.push(J)}return A}async*[Symbol.asyncIterator](){if(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}}finally{if(!this.isClosed)try{await this.close()}catch(F){F9.squashError(F)}}}stream(F){if(F?.transform){let A=F.transform,B=new IG(this),D=B.pipe(new tT.Transform({objectMode:!0,highWaterMark:1,transform(J,Z,X){try{let Y=A(J);X(void 0,Y)}catch(Y){X(Y)}}}));return B.on("error",(J)=>D.emit("error",J)),D}return new IG(this)}async hasNext(){if(this.cursorId===N7.Long.ZERO)return!1;do{if((this.documents?.length??0)!==0)return!0;await this.fetchBatch()}while(!this.isDead||(this.documents?.length??0)!==0);return!1}async next(){if(this.cursorId===N7.Long.ZERO)throw new T2.MongoCursorExhaustedError;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);return null}async tryNext(){if(this.cursorId===N7.Long.ZERO)throw new T2.MongoCursorExhaustedError;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}return null}async forEach(F){if(typeof F!=="function")throw new T2.MongoInvalidArgumentError('Argument "iterator" must be a function');for await(let A of this)if(F(A)===!1)break}async close(){await this.cleanup()}async toArray(){let F=[];for await(let A of this){F.push(A);let B=this.readBufferedDocuments();if(this.transform!=null)for(let D of B)F.push(await this.transformDocument(D));else F.push(...B)}return F}addCursorFlag(F,A){if(this.throwIfInitialized(),!oT.CURSOR_FLAGS.includes(F))throw new T2.MongoInvalidArgumentError(`Flag ${F} is not one of ${oT.CURSOR_FLAGS}`);if(typeof A!=="boolean")throw new T2.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=(B)=>{return F(A(B))};else this.transform=F;return this}withReadPreference(F){if(this.throwIfInitialized(),F instanceof xB.ReadPreference)this.cursorOptions.readPreference=F;else if(typeof F==="string")this.cursorOptions.readPreference=xB.ReadPreference.fromString(F);else throw new T2.MongoInvalidArgumentError(`Invalid read preference: ${F}`);return this}withReadConcern(F){this.throwIfInitialized();let A=aT.ReadConcern.fromOptions({readConcern:F});if(A)this.cursorOptions.readConcern=A;return this}maxTimeMS(F){if(this.throwIfInitialized(),typeof F!=="number")throw new T2.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.cursorOptions.maxTimeMS=F,this}batchSize(F){if(this.throwIfInitialized(),this.cursorOptions.tailable)throw new T2.MongoTailableCursorError("Tailable cursor does not support batchSize");if(typeof F!=="number")throw new T2.MongoInvalidArgumentError('Operation "batchSize" requires an integer');return this.cursorOptions.batchSize=F,this}rewind(){if(!this.initialized)return;this.cursorId=null,this.documents?.clear(),this.isClosed=!1,this.isKilled=!1,this.initialized=!1;let F=this.cursorSession;if(F){if(F.explicit===!1){if(!F.hasEnded)F.endSession().then(void 0,F9.squashError);this.cursorSession=this.cursorClient.startSession({owner:this,explicit:!1})}}}async getMore(F){if(this.cursorId==null)throw new T2.MongoRuntimeError("Unexpected null cursor id. A cursor creating command should have set this");if(this.selectedServer==null)throw new T2.MongoRuntimeError("Unexpected null selectedServer. A cursor creating command should have set this");let A=new o71.GetMoreOperation(this.cursorNamespace,this.cursorId,this.selectedServer,{...this.cursorOptions,session:this.cursorSession,batchSize:F});return await sT.executeOperation(this.cursorClient,A)}async cursorInit(){try{let F=await this._initialize(this.cursorSession),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(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(A)}catch(B){F9.squashError(B)}throw A}if(this.isDead)await this.cleanup()}async cleanup(F){this.isClosed=!0;let A=this.cursorSession;try{if(!this.isKilled&&this.cursorId&&!this.cursorId.isZero()&&this.cursorNamespace&&this.selectedServer&&!A.hasEnded){this.isKilled=!0;let B=this.cursorId;this.cursorId=N7.Long.ZERO,await sT.executeOperation(this.cursorClient,new e71.KillCursorsOperation(B,this.cursorNamespace,this.selectedServer,{session:A}))}}catch(B){F9.squashError(B)}finally{if(A?.owner===this)await A.endSession({error:F});if(!A?.inTransaction())rT.maybeClearPinnedConnection(A,{error:F});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 T2.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(B){F9.squashError(B)}throw A}}throwIfInitialized(){if(this.initialized)throw new T2.MongoCursorInUseError}}oT.AbstractCursor=fB;fB.CLOSE="close";class IG extends tT.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),(B)=>A(B))}_readNext(){if(this._cursor.id===N7.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,F9.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,F9.squashError),this.push(null);if(F.message.match(/operation was interrupted/))return this.push(null);return this.destroy(F)})}}F81.configureResourceManagement(fB.prototype)});var N5=z((Bj)=>{Object.defineProperty(Bj,"__esModule",{value:!0});Bj.AggregationCursor=void 0;var Fj=TX(),Aj=l0(),A81=a(),B81=k6();class PG extends B81.AbstractCursor{constructor(F,A,B=[],D={}){super(F,A,D);this.pipeline=B,this.aggregateOptions=D}clone(){let F=A81.mergeOptions({},this.aggregateOptions);return delete F.session,new PG(this.client,this.namespace,this.pipeline,{...F})}map(F){return super.map(F)}async _initialize(F){let A=new Fj.AggregateOperation(this.namespace,this.pipeline,{...this.aggregateOptions,...this.cursorOptions,session:F}),B=await Aj.executeOperation(this.client,A);return{server:A.server,session:F,response:B}}async explain(F){return(await Aj.executeOperation(this.client,new Fj.AggregateOperation(this.namespace,this.pipeline,{...this.aggregateOptions,...this.cursorOptions,explain:F??!0}))).shift(this.deserializationOptions)}addStage(F){return this.throwIfInitialized(),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})}}Bj.AggregationCursor=PG});var jG=z((Jj)=>{Object.defineProperty(Jj,"__esModule",{value:!0});Jj.CountOperation=void 0;var D81=Y0(),MG=O1();class TG extends D81.CommandOperation{constructor(F,A,B){super({s:{namespace:F}},B);this.options=B,this.collectionName=F.collection,this.query=A}get commandName(){return"count"}async execute(F,A){let B=this.options,D={count:this.collectionName,query:this.query};if(typeof B.limit==="number")D.limit=B.limit;if(typeof B.skip==="number")D.skip=B.skip;if(B.hint!=null)D.hint=B.hint;if(typeof B.maxTimeMS==="number")D.maxTimeMS=B.maxTimeMS;let J=await super.executeCommand(F,A,D);return J?J.n:0}}Jj.CountOperation=TG;MG.defineAspects(TG,[MG.Aspect.READ_OPERATION,MG.Aspect.RETRYABLE])});var _B=z((Yj)=>{Object.defineProperty(Yj,"__esModule",{value:!0});Yj.formatSort=q81;var Xj=p();function P7(F=1){let A=`${F}`.toLowerCase();if(J81(F))return F;switch(A){case"ascending":case"asc":case"1":return 1;case"descending":case"desc":case"-1":return-1;default:throw new Xj.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(F)}`)}}function J81(F){return typeof F==="object"&&F!=null&&"$meta"in F&&typeof F.$meta==="string"}function Z81(F){if(Array.isArray(F)&&F.length===2)try{return P7(F[1]),!0}catch{return!1}return!1}function X81(F){return Array.isArray(F)&&Array.isArray(F[0])}function Y81(F){return F instanceof Map&&F.size>0}function $81(F){return new Map([[`${F[0]}`,P7([F[1]])]])}function G81(F){let A=F.map(([B,D])=>[`${B}`,P7(D)]);return new Map(A)}function E81(F){let A=F.map((B)=>[`${B}`,1]);return new Map(A)}function C81(F){let A=Object.entries(F).map(([B,D])=>[`${B}`,P7(D)]);return new Map(A)}function H81(F){let A=Array.from(F).map(([B,D])=>[`${B}`,P7(D)]);return new Map(A)}function q81(F,A){if(F==null)return;if(typeof F==="string")return new Map([[F,P7(A)]]);if(typeof F!=="object")throw new Xj.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(F)} Sort must be a valid object`);if(!Array.isArray(F))return Y81(F)?H81(F):Object.keys(F).length?C81(F):void 0;if(!F.length)return;if(X81(F))return G81(F);if(Z81(F))return $81(F);return E81(F)}});var Hj=z((Ej)=>{Object.defineProperty(Ej,"__esModule",{value:!0});Ej.FindOperation=void 0;var $j=N6(),K81=p(),z81=B6(),U81=_B(),Gj=a(),Q81=Y0(),S5=O1();class uG extends Q81.CommandOperation{constructor(F,A={},B={}){super(void 0,B);if(this.options={...B},delete this.options.writeConcern,this.ns=F,typeof A!=="object"||Array.isArray(A))throw new K81.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){this.server=F;let B=this.options,D=L81(this.ns,this.filter,B);if(this.explain)D=Gj.decorateWithExplain(D,this.explain);return await F.command(this.ns,D,{...this.options,...this.bsonOptions,documentsReturnedIn:"firstBatch",session:A},this.explain?$j.ExplainedCursorResponse:$j.CursorResponse)}}Ej.FindOperation=uG;function L81(F,A,B){let D={find:F.collection,filter:A};if(B.sort)D.sort=U81.formatSort(B.sort);if(B.projection){let Z=B.projection;if(Z&&Array.isArray(Z))Z=Z.length?Z.reduce((X,Y)=>{return X[Y]=1,X},{}):{_id:1};D.projection=Z}if(B.hint)D.hint=Gj.normalizeHintField(B.hint);if(typeof B.skip==="number")D.skip=B.skip;if(typeof B.limit==="number")if(B.limit<0)D.limit=-B.limit,D.singleBatch=!0;else D.limit=B.limit;if(typeof B.batchSize==="number")if(B.batchSize<0){if(B.limit&&B.limit!==0&&Math.abs(B.batchSize)<Math.abs(B.limit))D.limit=-B.batchSize;D.singleBatch=!0}else D.batchSize=B.batchSize;if(typeof B.singleBatch==="boolean")D.singleBatch=B.singleBatch;if(B.comment!==void 0)D.comment=B.comment;if(typeof B.maxTimeMS==="number")D.maxTimeMS=B.maxTimeMS;let J=z81.ReadConcern.fromOptions(B);if(J)D.readConcern=J.toJSON();if(B.max)D.max=B.max;if(B.min)D.min=B.min;if(typeof B.returnKey==="boolean")D.returnKey=B.returnKey;if(typeof B.showRecordId==="boolean")D.showRecordId=B.showRecordId;if(typeof B.tailable==="boolean")D.tailable=B.tailable;if(typeof B.oplogReplay==="boolean")D.oplogReplay=B.oplogReplay;if(typeof B.timeout==="boolean")D.noCursorTimeout=!B.timeout;else if(typeof B.noCursorTimeout==="boolean")D.noCursorTimeout=B.noCursorTimeout;if(typeof B.awaitData==="boolean")D.awaitData=B.awaitData;if(typeof B.allowPartialResults==="boolean")D.allowPartialResults=B.allowPartialResults;if(B.collation)D.collation=B.collation;if(typeof B.allowDiskUse==="boolean")D.allowDiskUse=B.allowDiskUse;if(B.let)D.let=B.let;return D}S5.defineAspects(uG,[S5.Aspect.READ_OPERATION,S5.Aspect.RETRYABLE,S5.Aspect.EXPLAINABLE,S5.Aspect.CURSOR_CREATING])});var fG=z((Wj)=>{Object.defineProperty(Wj,"__esModule",{value:!0});Wj.FindCursor=Wj.FLAGS=void 0;var V81=N6(),f6=p(),R81=jG(),OG=l0(),qj=Hj(),kG=_B(),SG=a(),w81=k6();Wj.FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];class xG extends w81.AbstractCursor{constructor(F,A,B={},D={}){super(F,A,D);if(this.numReturned=0,this.cursorFilter=B,this.findOptions=D,D.sort!=null)this.findOptions.sort=kG.formatSort(D.sort)}clone(){let F=SG.mergeOptions({},this.findOptions);return delete F.session,new xG(this.client,this.namespace,this.cursorFilter,{...F})}map(F){return super.map(F)}async _initialize(F){let A=new qj.FindOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,session:F}),B=await OG.executeOperation(this.client,A);return this.numReturned=B.batchSize,{server:A.server,session:F,response:B}}async getMore(F){let A=this.numReturned;if(A){let D=this.findOptions.limit;if(F=D&&D>0&&A+F>D?D-A:F,F<=0){try{await this.close()}catch(J){SG.squashError(J)}return V81.CursorResponse.emptyGetMore}}let B=await super.getMore(F);return this.numReturned=this.numReturned+B.batchSize,B}async count(F){if(SG.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 f6.MongoInvalidArgumentError("Invalid first parameter to count");return await OG.executeOperation(this.client,new R81.CountOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...F}))}async explain(F){return(await OG.executeOperation(this.client,new qj.FindOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,explain:F??!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 f6.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=kG.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 f6.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 f6.MongoInvalidArgumentError("Argument for maxAwaitTimeMS must be a number");return this.findOptions.maxAwaitTimeMS=F,this}maxTimeMS(F){if(this.throwIfInitialized(),typeof F!=="number")throw new f6.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 f6.MongoTailableCursorError("Tailable cursor does not support sorting");return this.findOptions.sort=kG.formatSort(F,A),this}allowDiskUse(F=!0){if(this.throwIfInitialized(),!this.findOptions.sort)throw new f6.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 f6.MongoTailableCursorError("Tailable cursor does not support limit");if(typeof F!=="number")throw new f6.MongoInvalidArgumentError('Operation "limit" requires an integer');return this.findOptions.limit=F,this}skip(F){if(this.throwIfInitialized(),this.findOptions.tailable)throw new f6.MongoTailableCursorError("Tailable cursor does not support skip");if(typeof F!=="number")throw new f6.MongoInvalidArgumentError('Operation "skip" requires an integer');return this.findOptions.skip=F,this}}Wj.FindCursor=xG});var gG=z((zj)=>{Object.defineProperty(zj,"__esModule",{value:!0});zj.ListIndexesCursor=void 0;var N81=l0(),P81=w5(),M81=k6();class _G extends M81.AbstractCursor{constructor(F,A){super(F.client,F.s.namespace,A);this.parent=F,this.options=A}clone(){return new _G(this.parent,{...this.options,...this.cursorOptions})}async _initialize(F){let A=new P81.ListIndexesOperation(this.parent,{...this.cursorOptions,...this.options,session:F}),B=await N81.executeOperation(this.parent.client,A);return{server:A.server,session:F,response:B}}}zj.ListIndexesCursor=_G});var Rj=z((Lj)=>{Object.defineProperty(Lj,"__esModule",{value:!0});Lj.ListSearchIndexesCursor=void 0;var T81=N5();class Qj extends T81.AggregationCursor{constructor({fullNamespace:F,client:A},B,D={}){let J=B==null?[{$listSearchIndexes:{}}]:[{$listSearchIndexes:{name:B}}];super(A,F,J,D)}}Lj.ListSearchIndexesCursor=Qj});var Pj=z((Ij)=>{Object.defineProperty(Ij,"__esModule",{value:!0});Ij.DistinctOperation=void 0;var wj=a(),j81=Y0(),gB=O1();class bG extends j81.CommandOperation{constructor(F,A,B,D){super(F,D);this.options=D??{},this.collection=F,this.key=A,this.query=B}get commandName(){return"distinct"}async execute(F,A){let B=this.collection,D=this.key,J=this.query,Z=this.options,X={distinct:B.collectionName,key:D,query:J};if(typeof Z.maxTimeMS==="number")X.maxTimeMS=Z.maxTimeMS;if(typeof Z.comment!=="undefined")X.comment=Z.comment;wj.decorateWithReadConcern(X,B,Z),wj.decorateWithCollation(X,B,Z);let Y=await super.executeCommand(F,A,X);return this.explain?Y:Y.values}}Ij.DistinctOperation=bG;gB.defineAspects(bG,[gB.Aspect.READ_OPERATION,gB.Aspect.RETRYABLE,gB.Aspect.EXPLAINABLE])});var jj=z((Mj)=>{Object.defineProperty(Mj,"__esModule",{value:!0});Mj.EstimatedDocumentCountOperation=void 0;var u81=Y0(),bB=O1();class yG extends u81.CommandOperation{constructor(F,A={}){super(F,A);this.options=A,this.collectionName=F.collectionName}get commandName(){return"count"}async execute(F,A){let B={count:this.collectionName};if(typeof this.options.maxTimeMS==="number")B.maxTimeMS=this.options.maxTimeMS;if(this.options.comment!==void 0)B.comment=this.options.comment;return(await super.executeCommand(F,A,B))?.n||0}}Mj.EstimatedDocumentCountOperation=yG;bB.defineAspects(yG,[bB.Aspect.READ_OPERATION,bB.Aspect.RETRYABLE,bB.Aspect.CURSOR_CREATING])});var vG=z((xj)=>{Object.defineProperty(xj,"__esModule",{value:!0});xj.FindOneAndUpdateOperation=xj.FindOneAndReplaceOperation=xj.FindOneAndDeleteOperation=xj.FindAndModifyOperation=xj.ReturnDocument=void 0;var W4=p(),O81=P0(),k81=_B(),vB=a(),S81=Y0(),yB=O1();xj.ReturnDocument=Object.freeze({BEFORE:"before",AFTER:"after"});function uj(F,A){if(F.new=A.returnDocument===xj.ReturnDocument.AFTER,F.upsert=A.upsert===!0,A.bypassDocumentValidation===!0)F.bypassDocumentValidation=A.bypassDocumentValidation;return F}class M7 extends S81.CommandOperation{constructor(F,A,B){super(F,B);this.options=B??{},this.cmdBase={remove:!1,new:!1,upsert:!1},B.includeResultMetadata??=!1;let D=k81.formatSort(B.sort);if(D)this.cmdBase.sort=D;if(B.projection)this.cmdBase.fields=B.projection;if(B.maxTimeMS)this.cmdBase.maxTimeMS=B.maxTimeMS;if(B.writeConcern)this.cmdBase.writeConcern=B.writeConcern;if(B.let)this.cmdBase.let=B.let;if(B.comment!==void 0)this.cmdBase.comment=B.comment;this.readPreference=O81.ReadPreference.primary,this.collection=F,this.query=A}get commandName(){return"findAndModify"}async execute(F,A){let B=this.collection,D=this.query,J={...this.options,...this.bsonOptions},Z={findAndModify:B.collectionName,query:D,...this.cmdBase};if(vB.decorateWithCollation(Z,B,J),J.hint){if(this.writeConcern?.w===0||vB.maxWireVersion(F)<8)throw new W4.MongoCompatibilityError("The current topology does not support a hint on findAndModify commands");Z.hint=J.hint}let X=await super.executeCommand(F,A,Z);return J.includeResultMetadata?X:X.value??null}}xj.FindAndModifyOperation=M7;class Oj extends M7{constructor(F,A,B){if(A==null||typeof A!=="object")throw new W4.MongoInvalidArgumentError('Argument "filter" must be an object');super(F,A,B);this.cmdBase.remove=!0}}xj.FindOneAndDeleteOperation=Oj;class kj extends M7{constructor(F,A,B,D){if(A==null||typeof A!=="object")throw new W4.MongoInvalidArgumentError('Argument "filter" must be an object');if(B==null||typeof B!=="object")throw new W4.MongoInvalidArgumentError('Argument "replacement" must be an object');if(vB.hasAtomicOperators(B))throw new W4.MongoInvalidArgumentError("Replacement document must not contain atomic operators");super(F,A,D);this.cmdBase.update=B,uj(this.cmdBase,D)}}xj.FindOneAndReplaceOperation=kj;class Sj extends M7{constructor(F,A,B,D){if(A==null||typeof A!=="object")throw new W4.MongoInvalidArgumentError('Argument "filter" must be an object');if(B==null||typeof B!=="object")throw new W4.MongoInvalidArgumentError('Argument "update" must be an object');if(!vB.hasAtomicOperators(B))throw new W4.MongoInvalidArgumentError("Update document requires atomic operators");super(F,A,D);if(this.cmdBase.update=B,uj(this.cmdBase,D),D.arrayFilters)this.cmdBase.arrayFilters=D.arrayFilters}}xj.FindOneAndUpdateOperation=Sj;yB.defineAspects(M7,[yB.Aspect.WRITE_OPERATION,yB.Aspect.RETRYABLE,yB.Aspect.EXPLAINABLE])});var vj=z((bj)=>{Object.defineProperty(bj,"__esModule",{value:!0});bj.IsCappedOperation=void 0;var g81=p(),b81=O1();class gj extends b81.AbstractOperation{constructor(F,A){super(A);this.options=A,this.collection=F}get commandName(){return"listCollections"}async execute(F,A){let B=this.collection,[D]=await B.s.db.listCollections({name:B.collectionName},{...this.options,nameOnly:!1,readPreference:this.readPreference,session:A}).toArray();if(D==null||D.options==null)throw new g81.MongoAPIError(`collection ${B.namespace} not found`);return!!D.options?.capped}}bj.IsCappedOperation=gj});var cj=z((mj)=>{Object.defineProperty(mj,"__esModule",{value:!0});mj.OptionsOperation=void 0;var y81=p(),v81=O1();class hj extends v81.AbstractOperation{constructor(F,A){super(A);this.options=A,this.collection=F}get commandName(){return"listCollections"}async execute(F,A){let B=this.collection,[D]=await B.s.db.listCollections({name:B.collectionName},{...this.options,nameOnly:!1,readPreference:this.readPreference,session:A}).toArray();if(D==null||D.options==null)throw new y81.MongoAPIError(`collection ${B.namespace} not found`);return D.options}}mj.OptionsOperation=hj});var nj=z((pj)=>{Object.defineProperty(pj,"__esModule",{value:!0});pj.CreateSearchIndexesOperation=void 0;var h81=O1();class lj extends h81.AbstractOperation{constructor(F,A){super();this.collection=F,this.descriptions=A}get commandName(){return"createSearchIndexes"}async execute(F,A){let B=this.collection.fullNamespace,D={createSearchIndexes:B.collection,indexes:this.descriptions};return((await F.command(B,D,{session:A}))?.indexesCreated??[]).map(({name:X})=>X)}}pj.CreateSearchIndexesOperation=lj});var oj=z((rj)=>{Object.defineProperty(rj,"__esModule",{value:!0});rj.DropSearchIndexOperation=void 0;var sj=p(),m81=O1();class aj extends m81.AbstractOperation{constructor(F,A){super();this.collection=F,this.name=A}get commandName(){return"dropSearchIndex"}async execute(F,A){let B=this.collection.fullNamespace,D={dropSearchIndex:B.collection};if(typeof this.name==="string")D.name=this.name;try{await F.command(B,D,{session:A})}catch(J){if(!(J instanceof sj.MongoServerError&&J.code===sj.MONGODB_ERROR_CODES.NamespaceNotFound))throw J}}}rj.DropSearchIndexOperation=aj});var Bu=z((Fu)=>{Object.defineProperty(Fu,"__esModule",{value:!0});Fu.UpdateSearchIndexOperation=void 0;var d81=O1();class ej extends d81.AbstractOperation{constructor(F,A,B){super();this.collection=F,this.name=A,this.definition=B}get commandName(){return"updateSearchIndex"}async execute(F,A){let B=this.collection.fullNamespace,D={updateSearchIndex:B.collection,name:this.name,definition:this.definition};await F.command(B,D,{session:A});return}}Fu.UpdateSearchIndexOperation=ej});var a4=z((Yu)=>{Object.defineProperty(Yu,"__esModule",{value:!0});Yu.Collection=void 0;var c81=w1(),l81=NX(),p81=PX(),i81=r4(),n81=N5(),s81=fG(),a81=gG(),r81=Rj(),Du=p(),t81=EX(),o81=jG(),Ju=YX(),e81=Pj(),F51=k$(),A51=jj(),o1=l0(),hG=vG(),hB=w5(),Zu=qX(),B51=vj(),D51=cj(),J51=x$(),Z51=nj(),X51=oj(),Y51=Bu(),mG=QX(),$51=B6(),dG=P0(),g1=a(),G51=c0();class Xu{constructor(F,A,B){this.s={db:F,options:B,namespace:new g1.MongoDBCollectionNamespace(F.databaseName,A),pkFactory:F.options?.pkFactory??g1.DEFAULT_PK_FACTORY,readPreference:dG.ReadPreference.fromOptions(B),bsonOptions:c81.resolveBSONOptions(B,F),readConcern:$51.ReadConcern.fromOptions(B),writeConcern:G51.WriteConcern.fromOptions(B)},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=g1.normalizeHintField(F)}async insertOne(F,A){return await o1.executeOperation(this.client,new Zu.InsertOneOperation(this,F,g1.resolveOptions(this,A)))}async insertMany(F,A){return await o1.executeOperation(this.client,new Zu.InsertManyOperation(this,F,g1.resolveOptions(this,A??{ordered:!0})))}async bulkWrite(F,A){if(!Array.isArray(F))throw new Du.MongoInvalidArgumentError('Argument "operations" must be an array of documents');return await o1.executeOperation(this.client,new t81.BulkWriteOperation(this,F,g1.resolveOptions(this,A??{ordered:!0})))}async updateOne(F,A,B){return await o1.executeOperation(this.client,new mG.UpdateOneOperation(this,F,A,g1.resolveOptions(this,B)))}async replaceOne(F,A,B){return await o1.executeOperation(this.client,new mG.ReplaceOneOperation(this,F,A,g1.resolveOptions(this,B)))}async updateMany(F,A,B){return await o1.executeOperation(this.client,new mG.UpdateManyOperation(this,F,A,g1.resolveOptions(this,B)))}async deleteOne(F={},A={}){return await o1.executeOperation(this.client,new Ju.DeleteOneOperation(this,F,g1.resolveOptions(this,A)))}async deleteMany(F={},A={}){return await o1.executeOperation(this.client,new Ju.DeleteManyOperation(this,F,g1.resolveOptions(this,A)))}async rename(F,A){return await o1.executeOperation(this.client,new J51.RenameOperation(this,F,{...A,readPreference:dG.ReadPreference.PRIMARY}))}async drop(F){return await o1.executeOperation(this.client,new F51.DropCollectionOperation(this.s.db,this.collectionName,F))}async findOne(F={},A={}){let B=this.find(F,A).limit(-1).batchSize(1),D=await B.next();return await B.close(),D}find(F={},A={}){return new s81.FindCursor(this.client,this.s.namespace,F,g1.resolveOptions(this,A))}async options(F){return await o1.executeOperation(this.client,new D51.OptionsOperation(this,g1.resolveOptions(this,F)))}async isCapped(F){return await o1.executeOperation(this.client,new B51.IsCappedOperation(this,g1.resolveOptions(this,F)))}async createIndex(F,A){return(await o1.executeOperation(this.client,hB.CreateIndexesOperation.fromIndexSpecification(this,this.collectionName,F,g1.resolveOptions(this,A))))[0]}async createIndexes(F,A){return await o1.executeOperation(this.client,hB.CreateIndexesOperation.fromIndexDescriptionArray(this,this.collectionName,F,g1.resolveOptions(this,{...A,maxTimeMS:void 0})))}async dropIndex(F,A){return await o1.executeOperation(this.client,new hB.DropIndexOperation(this,F,{...g1.resolveOptions(this,A),readPreference:dG.ReadPreference.primary}))}async dropIndexes(F){try{return await o1.executeOperation(this.client,new hB.DropIndexOperation(this,"*",g1.resolveOptions(this,F))),!0}catch{return!1}}listIndexes(F){return new a81.ListIndexesCursor(this,g1.resolveOptions(this,F))}async indexExists(F,A){let B=Array.isArray(F)?F:[F],D=new Set(await this.listIndexes(A).map(({name:J})=>J).toArray());return B.every((J)=>D.has(J))}async indexInformation(F){return await this.indexes({...F,full:F?.full??!1})}async estimatedDocumentCount(F){return await o1.executeOperation(this.client,new A51.EstimatedDocumentCountOperation(this,g1.resolveOptions(this,F)))}async countDocuments(F={},A={}){let B=[];if(B.push({$match:F}),typeof A.skip==="number")B.push({$skip:A.skip});if(typeof A.limit==="number")B.push({$limit:A.limit});B.push({$group:{_id:1,n:{$sum:1}}});let D=this.aggregate(B,A),J=await D.next();return await D.close(),J?.n??0}async distinct(F,A={},B={}){return await o1.executeOperation(this.client,new e81.DistinctOperation(this,F,A,g1.resolveOptions(this,B)))}async indexes(F){let A=await this.listIndexes(F).toArray();if(F?.full??!0)return A;return Object.fromEntries(A.map(({name:J,key:Z})=>[J,Object.entries(Z)]))}async findOneAndDelete(F,A){return await o1.executeOperation(this.client,new hG.FindOneAndDeleteOperation(this,F,g1.resolveOptions(this,A)))}async findOneAndReplace(F,A,B){return await o1.executeOperation(this.client,new hG.FindOneAndReplaceOperation(this,F,A,g1.resolveOptions(this,B)))}async findOneAndUpdate(F,A,B){return await o1.executeOperation(this.client,new hG.FindOneAndUpdateOperation(this,F,A,g1.resolveOptions(this,B)))}aggregate(F=[],A){if(!Array.isArray(F))throw new Du.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages');return new n81.AggregationCursor(this.client,this.s.namespace,F,g1.resolveOptions(this,A))}watch(F=[],A={}){if(!Array.isArray(F))A=F,F=[];return new i81.ChangeStream(this,F,g1.resolveOptions(this,A))}initializeUnorderedBulkOp(F){return new p81.UnorderedBulkOperation(this,g1.resolveOptions(this,F))}initializeOrderedBulkOp(F){return new l81.OrderedBulkOperation(this,g1.resolveOptions(this,F))}async count(F={},A={}){return await o1.executeOperation(this.client,new o81.CountOperation(this.fullNamespace,F,g1.resolveOptions(this,A)))}listSearchIndexes(F,A){A=typeof F==="object"?F:A==null?{}:A;let B=F==null?null:typeof F==="object"?null:F;return new r81.ListSearchIndexesCursor(this,B,A)}async createSearchIndex(F){let[A]=await this.createSearchIndexes([F]);return A}async createSearchIndexes(F){return await o1.executeOperation(this.client,new Z51.CreateSearchIndexesOperation(this,F))}async dropSearchIndex(F){return await o1.executeOperation(this.client,new X51.DropSearchIndexOperation(this,F))}async updateSearchIndex(F,A){return await o1.executeOperation(this.client,new Y51.UpdateSearchIndexOperation(this,F,A))}}Yu.Collection=Xu});var iG=z((Eu)=>{Object.defineProperty(Eu,"__esModule",{value:!0});Eu.ChangeStreamCursor=void 0;var cG=r4(),Gu=W0(),E51=TX(),C51=l0(),lG=a(),H51=k6();class pG extends H51.AbstractCursor{constructor(F,A,B=[],D={}){super(F,A,D);if(this.pipeline=B,this.changeStreamCursorOptions=D,this._resumeToken=null,this.startAtOperationTime=D.startAtOperationTime??null,D.startAfter)this.resumeToken=D.startAfter;else if(D.resumeAfter)this.resumeToken=D.resumeAfter}set resumeToken(F){this._resumeToken=F,this.emit(cG.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&&lG.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 pG(this.client,this.namespace,this.pipeline,{...this.cursorOptions})}async _initialize(F){let A=new E51.AggregateOperation(this.namespace,this.pipeline,{...this.cursorOptions,...this.changeStreamCursorOptions,session:F}),B=await C51.executeOperation(F.client,A),D=A.server;if(this.maxWireVersion=lG.maxWireVersion(D),this.startAtOperationTime==null&&this.changeStreamCursorOptions.resumeAfter==null&&this.changeStreamCursorOptions.startAfter==null&&this.maxWireVersion>=7)this.startAtOperationTime=B.operationTime;return this._processBatch(B),this.emit(Gu.INIT,B),this.emit(Gu.RESPONSE),{server:D,session:F,response:B}}async getMore(F){let A=await super.getMore(F);return this.maxWireVersion=lG.maxWireVersion(this.server),this._processBatch(A),this.emit(cG.ChangeStream.MORE,A),this.emit(cG.ChangeStream.RESPONSE),A}}Eu.ChangeStreamCursor=pG});var r4=z((Hu)=>{Object.defineProperty(Hu,"__esModule",{value:!0});Hu.ChangeStream=void 0;var q51=a4(),b6=W0(),W51=iG(),K51=LB(),_6=p(),z51=D4(),U51=d2(),Q51=J7(),g6=a(),T7=Symbol("cursorStream"),j7=Symbol("closed"),x5=Symbol("mode"),L51=["resumeAfter","startAfter","startAtOperationTime","fullDocument","fullDocumentBeforeChange","showExpandedEvents"],A9={COLLECTION:Symbol("Collection"),DATABASE:Symbol("Database"),CLUSTER:Symbol("Cluster")},V51=[b6.RESUME_TOKEN_CHANGED,b6.END,b6.CLOSE],R51="A change stream document has been received that lacks a resume token (_id).",mB="ChangeStream is closed";class G2 extends U51.TypedEventEmitter{async asyncDispose(){await this.close()}constructor(F,A=[],B={}){super();if(this.pipeline=A,this.options={...B},delete this.options.writeConcern,F instanceof q51.Collection)this.type=A9.COLLECTION;else if(F instanceof K51.Db)this.type=A9.DATABASE;else if(F instanceof z51.MongoClient)this.type=A9.CLUSTER;else throw new _6.MongoChangeStreamError("Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient");if(this.parent=F,this.namespace=F.s.namespace,!this.options.readPreference&&F.readPreference)this.options.readPreference=F.readPreference;this.cursor=this._createChangeStreamCursor(B),this[j7]=!1,this[x5]=!1,this.on("newListener",(D)=>{if(D==="change"&&this.cursor&&this.listenerCount("change")===0)this._streamEvents(this.cursor)}),this.on("removeListener",(D)=>{if(D==="change"&&this.listenerCount("change")===0&&this.cursor)this[T7]?.removeAllListeners("data")})}get cursorStream(){return this[T7]}get resumeToken(){return this.cursor?.resumeToken}async hasNext(){this._setIsIterator();while(!0)try{return await this.cursor.hasNext()}catch(F){try{await this._processErrorIteratorMode(F)}catch(A){try{await this.close()}catch(B){g6.squashError(B)}throw A}}}async next(){this._setIsIterator();while(!0)try{let F=await this.cursor.next();return this._processChange(F??null)}catch(F){try{await this._processErrorIteratorMode(F)}catch(A){try{await this.close()}catch(B){g6.squashError(B)}throw A}}}async tryNext(){this._setIsIterator();while(!0)try{return await this.cursor.tryNext()??null}catch(F){try{await this._processErrorIteratorMode(F)}catch(A){try{await this.close()}catch(B){g6.squashError(B)}throw A}}}async*[Symbol.asyncIterator](){if(this.closed)return;try{while(!0)yield await this.next()}finally{try{await this.close()}catch(F){g6.squashError(F)}}}get closed(){return this[j7]||this.cursor.closed}async close(){this[j7]=!0;let F=this.cursor;try{await F.close()}finally{this._endStream()}}stream(F){if(this.closed)throw new _6.MongoChangeStreamError(mB);return this.streamOptions=F,this.cursor.stream(F)}_setIsEmitter(){if(this[x5]==="iterator")throw new _6.MongoAPIError("ChangeStream cannot be used as an EventEmitter after being used as an iterator");this[x5]="emitter"}_setIsIterator(){if(this[x5]==="emitter")throw new _6.MongoAPIError("ChangeStream cannot be used as an iterator after being used as an EventEmitter");this[x5]="iterator"}_createChangeStreamCursor(F){let A=g6.filterOptions(F,L51);if(this.type===A9.CLUSTER)A.allChangesForCluster=!0;let B=[{$changeStream:A},...this.pipeline],D=this.type===A9.CLUSTER?this.parent:this.type===A9.DATABASE?this.parent.client:this.type===A9.COLLECTION?this.parent.client:null;if(D==null)throw new _6.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`);let J=new W51.ChangeStreamCursor(D,this.namespace,B,F);for(let Z of V51)J.on(Z,(X)=>this.emit(Z,X));if(this.listenerCount(G2.CHANGE)>0)this._streamEvents(J);return J}_closeEmitterModeWithError(F){this.emit(G2.ERROR,F),this.close().then(void 0,g6.squashError)}_streamEvents(F){this._setIsEmitter();let A=this[T7]??F.stream();this[T7]=A,A.on("data",(B)=>{try{let D=this._processChange(B);this.emit(G2.CHANGE,D)}catch(D){this.emit(G2.ERROR,D)}}),A.on("error",(B)=>this._processErrorStreamMode(B))}_endStream(){let F=this[T7];if(F)["data","close","end","error"].forEach((A)=>F.removeAllListeners(A)),F.destroy();this[T7]=void 0}_processChange(F){if(this[j7])throw new _6.MongoAPIError(mB);if(F==null)throw new _6.MongoRuntimeError(mB);if(F&&!F._id)throw new _6.MongoChangeStreamError(R51);return this.cursor.cacheResumeToken(F._id),this.options.startAtOperationTime=void 0,F}_processErrorStreamMode(F){if(this[j7])return;if(this.cursor.id!=null&&_6.isResumableError(F,this.cursor.maxWireVersion))this._endStream(),this.cursor.close().then(void 0,g6.squashError),g6.getTopology(this.parent).selectServer(this.cursor.readPreference,{operationName:"reconnect topology in change stream"}).then(()=>{this.cursor=this._createChangeStreamCursor(this.cursor.resumeOptions)},()=>this._closeEmitterModeWithError(F));else this._closeEmitterModeWithError(F)}async _processErrorIteratorMode(F){if(this[j7])throw new _6.MongoAPIError(mB);if(this.cursor.id==null||!_6.isResumableError(F,this.cursor.maxWireVersion)){try{await this.close()}catch(B){g6.squashError(B)}throw F}try{await this.cursor.close()}catch(B){g6.squashError(B)}let A=g6.getTopology(this.parent);try{await A.selectServer(this.cursor.readPreference,{operationName:"reconnect topology in change stream"}),this.cursor=this._createChangeStreamCursor(this.cursor.resumeOptions)}catch{throw await this.close(),F}}}Hu.ChangeStream=G2;G2.RESPONSE=b6.RESPONSE;G2.MORE=b6.MORE;G2.INIT=b6.INIT;G2.CLOSE=b6.CLOSE;G2.CHANGE=b6.CHANGE;G2.END=b6.END;G2.ERROR=b6.ERROR;G2.RESUME_TOKEN_CHANGED=b6.RESUME_TOKEN_CHANGED;Q51.configureResourceManagement(G2.prototype)});var nG=z((Ku)=>{Object.defineProperty(Ku,"__esModule",{value:!0});Ku.GridFSBucketReadStream=void 0;var w51=import.meta.require("stream"),p2=p();class dB extends w51.Readable{constructor(F,A,B,D,J){super({emitClose:!0});this.s={bytesToTrim:0,bytesToSkip:0,bytesRead:0,chunks:F,expected:0,files:A,filter:D,init:!1,expectedEnd:0,options:{start:0,end:0,...J},readPreference:B}}_read(){if(this.destroyed)return;P51(this,()=>I51(this))}start(F=0){return Wu(this),this.s.options.start=F,this}end(F=0){return Wu(this),this.s.options.end=F,this}async abort(){this.push(null),this.destroy(),await this.s.cursor?.close()}}Ku.GridFSBucketReadStream=dB;dB.FILE="file";function Wu(F){if(F.s.init)throw new p2.MongoGridFSStreamError("Options cannot be changed after the stream is initialized")}function I51(F){if(F.destroyed)return;if(!F.s.cursor)return;if(!F.s.file)return;let A=(B)=>{if(F.destroyed)return;if(!B){F.push(null),F.s.cursor?.close().then(void 0,(C)=>F.destroy(C));return}if(!F.s.file)return;let D=F.s.file.length-F.s.bytesRead,J=F.s.expected++,Z=Math.min(F.s.file.chunkSize,D);if(B.n>J)return F.destroy(new p2.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${B.n}, expected: ${J}`));if(B.n<J)return F.destroy(new p2.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${B.n}, expected: ${J}`));let X=Buffer.isBuffer(B.data)?B.data:B.data.buffer;if(X.byteLength!==Z){if(D<=0)return F.destroy(new p2.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${B.n}, expected file length ${F.s.file.length} bytes but already read ${F.s.bytesRead} bytes`));return F.destroy(new p2.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${X.byteLength}, expected: ${Z}`))}if(F.s.bytesRead+=X.byteLength,X.byteLength===0)return F.push(null);let Y=null,$=null;if(F.s.bytesToSkip!=null)Y=F.s.bytesToSkip,F.s.bytesToSkip=0;let G=J===F.s.expectedEnd-1,E=F.s.options.end-F.s.bytesToSkip;if(G&&F.s.bytesToTrim!=null)$=F.s.file.chunkSize-F.s.bytesToTrim;else if(F.s.options.end&&E<B.data.byteLength)$=E;if(Y!=null||$!=null)X=X.slice(Y||0,$||X.byteLength);F.push(X);return};F.s.cursor.next().then(A,(B)=>{if(F.destroyed)return;F.destroy(B)})}function N51(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 B=(D)=>{if(F.destroyed)return;if(!D){let X=`FileNotFound: file ${F.s.filter._id?F.s.filter._id.toString():F.s.filter.filename} was not found`,Y=new p2.MongoRuntimeError(X);return Y.code="ENOENT",F.destroy(Y)}if(D.length<=0){F.push(null);return}if(F.destroyed){F.destroy();return}try{F.s.bytesToSkip=M51(F,D,F.s.options)}catch(Z){return F.destroy(Z)}let J={files_id:D._id};if(F.s.options&&F.s.options.start!=null){let Z=Math.floor(F.s.options.start/D.chunkSize);if(Z>0)J.n={$gte:Z}}if(F.s.cursor=F.s.chunks.find(J).sort({n:1}),F.s.readPreference)F.s.cursor.withReadPreference(F.s.readPreference);F.s.expectedEnd=Math.ceil(D.length/D.chunkSize),F.s.file=D;try{F.s.bytesToTrim=T51(F,D,F.s.cursor,F.s.options)}catch(Z){return F.destroy(Z)}F.emit(dB.FILE,D);return};F.s.files.findOne(F.s.filter,A).then(B,(D)=>{if(F.destroyed)return;F.destroy(D)})}function P51(F,A){if(F.s.file)return A();if(!F.s.init)N51(F),F.s.init=!0;F.once("file",()=>{A()})}function M51(F,A,B){if(B&&B.start!=null){if(B.start>A.length)throw new p2.MongoInvalidArgumentError(`Stream start (${B.start}) must not be more than the length of the file (${A.length})`);if(B.start<0)throw new p2.MongoInvalidArgumentError(`Stream start (${B.start}) must not be negative`);if(B.end!=null&&B.end<B.start)throw new p2.MongoInvalidArgumentError(`Stream start (${B.start}) must not be greater than stream end (${B.end})`);return F.s.bytesRead=Math.floor(B.start/A.chunkSize)*A.chunkSize,F.s.expected=Math.floor(B.start/A.chunkSize),B.start-F.s.bytesRead}throw new p2.MongoInvalidArgumentError("Start option must be defined")}function T51(F,A,B,D){if(D&&D.end!=null){if(D.end>A.length)throw new p2.MongoInvalidArgumentError(`Stream end (${D.end}) must not be more than the length of the file (${A.length})`);if(D.start==null||D.start<0)throw new p2.MongoInvalidArgumentError(`Stream end (${D.end}) must not be negative`);let J=D.start!=null?Math.floor(D.start/A.chunkSize):0;return B.limit(Math.ceil(D.end/A.chunkSize)-J),F.s.expectedEnd=Math.ceil(D.end/A.chunkSize),Math.ceil(D.end/A.chunkSize)*A.chunkSize-D.end}throw new p2.MongoInvalidArgumentError("End option must be defined")}});var rG=z((Vu)=>{Object.defineProperty(Vu,"__esModule",{value:!0});Vu.GridFSBucketWriteStream=void 0;var j51=import.meta.require("stream"),Uu=w1(),B9=p(),u51=a(),O51=c0();class Qu extends j51.Writable{constructor(F,A,B){super();if(this.gridFSFile=null,B=B??{},this.bucket=F,this.chunks=F.s._chunksCollection,this.filename=A,this.files=F.s._filesCollection,this.options=B,this.writeConcern=O51.WriteConcern.fromOptions(B)||F.s.options.writeConcern,this.done=!1,this.id=B.id?B.id:new Uu.ObjectId,this.chunkSizeBytes=B.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},!this.bucket.s.calledOpenUploadStream)this.bucket.s.calledOpenUploadStream=!0,S51(this).then(()=>{this.bucket.s.checkedIndexes=!0,this.bucket.emit("index")},u51.squashError)}_construct(F){if(this.bucket.s.checkedIndexes)return process.nextTick(F);this.bucket.once("index",F)}_write(F,A,B){f51(this,F,A,B)}_final(F){if(this.state.streamEnd)return process.nextTick(F);this.state.streamEnd=!0,_51(this,F)}async abort(){if(this.state.streamEnd)throw new B9.MongoAPIError("Cannot abort a stream that has already completed");if(this.state.aborted)throw new B9.MongoAPIError("Cannot call abort() on a stream twice");this.state.aborted=!0,await this.chunks.deleteMany({files_id:this.id})}}Vu.GridFSBucketWriteStream=Qu;function aG(F,A,B){if(F.state.errored){process.nextTick(B);return}F.state.errored=!0,process.nextTick(B,A)}function Lu(F,A,B){return{_id:new Uu.ObjectId,files_id:F,n:A,data:B}}async function k51(F){let A={files_id:1,n:1},B;try{B=await F.chunks.listIndexes().toArray()}catch(J){if(J instanceof B9.MongoError&&J.code===B9.MONGODB_ERROR_CODES.NamespaceNotFound)B=[];else throw J}if(!B.find((J)=>{if(Object.keys(J.key).length===2&&J.key.files_id===1&&J.key.n===1)return!0;return!1}))await F.chunks.createIndex(A,{...F.writeConcern,background:!0,unique:!0})}function sG(F,A){if(F.done)return process.nextTick(A);if(F.state.streamEnd&&F.state.outstandingRequests===0&&!F.state.errored){F.done=!0;let B=x51(F.id,F.length,F.chunkSizeBytes,F.filename,F.options.contentType,F.options.aliases,F.options.metadata);if(cB(F,A))return;F.files.insertOne(B,{writeConcern:F.writeConcern}).then(()=>{F.gridFSFile=B,A()},(D)=>aG(F,D,A));return}process.nextTick(A)}async function S51(F){if(await F.files.findOne({},{projection:{_id:1}})!=null)return;let B={filename:1,uploadDate:1},D;try{D=await F.files.listIndexes().toArray()}catch(Z){if(Z instanceof B9.MongoError&&Z.code===B9.MONGODB_ERROR_CODES.NamespaceNotFound)D=[];else throw Z}if(!D.find((Z)=>{if(Object.keys(Z.key).length===2&&Z.key.filename===1&&Z.key.uploadDate===1)return!0;return!1}))await F.files.createIndex(B,{background:!1});await k51(F)}function x51(F,A,B,D,J,Z,X){let Y={_id:F,length:A,chunkSize:B,uploadDate:new Date,filename:D};if(J)Y.contentType=J;if(Z)Y.aliases=Z;if(X)Y.metadata=X;return Y}function f51(F,A,B,D){if(cB(F,D))return;let J=Buffer.isBuffer(A)?A:Buffer.from(A,B);if(F.length+=J.length,F.pos+J.length<F.chunkSizeBytes){J.copy(F.bufToStore,F.pos),F.pos+=J.length,process.nextTick(D);return}let Z=J.length,X=F.chunkSizeBytes-F.pos,Y=Math.min(X,J.length),$=0;while(Z>0){let G=J.length-Z;J.copy(F.bufToStore,F.pos,G,G+Y),F.pos+=Y,X-=Y;let E;if(X===0){if(E=Lu(F.id,F.n,Buffer.from(F.bufToStore)),++F.state.outstandingRequests,++$,cB(F,D))return;F.chunks.insertOne(E,{writeConcern:F.writeConcern}).then(()=>{if(--F.state.outstandingRequests,--$,!$)sG(F,D)},(C)=>aG(F,C,D)),X=F.chunkSizeBytes,F.pos=0,++F.n}Z-=Y,Y=Math.min(X,Z)}}function _51(F,A){if(F.pos===0)return sG(F,A);++F.state.outstandingRequests;let B=Buffer.alloc(F.pos);F.bufToStore.copy(B,0,0,F.pos);let D=Lu(F.id,F.n,B);if(cB(F,A))return;F.chunks.insertOne(D,{writeConcern:F.writeConcern}).then(()=>{--F.state.outstandingRequests,sG(F,A)},(J)=>aG(F,J,A))}function cB(F,A){if(F.state.aborted)return process.nextTick(A,new B9.MongoAPIError("Stream has been aborted")),!0;return!1}});var Tu=z((Pu)=>{Object.defineProperty(Pu,"__esModule",{value:!0});Pu.GridFSBucket=void 0;var wu=p(),g51=d2(),b51=c0(),Iu=nG(),Nu=rG(),y51={bucketName:"fs",chunkSizeBytes:261120};class tG extends g51.TypedEventEmitter{constructor(F,A){super();this.setMaxListeners(0);let B={...y51,...A,writeConcern:b51.WriteConcern.fromOptions(A)};this.s={db:F,options:B,_chunksCollection:F.collection(B.bucketName+".chunks"),_filesCollection:F.collection(B.bucketName+".files"),checkedIndexes:!1,calledOpenUploadStream:!1}}openUploadStream(F,A){return new Nu.GridFSBucketWriteStream(this,F,A)}openUploadStreamWithId(F,A,B){return new Nu.GridFSBucketWriteStream(this,A,{...B,id:F})}openDownloadStream(F,A){return new Iu.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{_id:F},A)}async delete(F){let{deletedCount:A}=await this.s._filesCollection.deleteOne({_id:F});if(await this.s._chunksCollection.deleteMany({files_id:F}),A===0)throw new wu.MongoRuntimeError(`File not found for id ${F}`)}find(F={},A={}){return this.s._filesCollection.find(F,A)}openDownloadStreamByName(F,A){let B={uploadDate:-1},D=void 0;if(A&&A.revision!=null)if(A.revision>=0)B={uploadDate:1},D=A.revision;else D=-A.revision-1;return new Iu.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{filename:F},{...A,sort:B,skip:D})}async rename(F,A){let B={_id:F},D={$set:{filename:A}},{matchedCount:J}=await this.s._filesCollection.updateOne(B,D);if(J===0)throw new wu.MongoRuntimeError(`File with id ${F} not found`)}async drop(){await this.s._filesCollection.drop(),await this.s._chunksCollection.drop()}}Pu.GridFSBucket=tG;tG.INDEX="index"});var o4=z((_)=>{Object.defineProperty(_,"__esModule",{value:!0});_.MongoServerSelectionError=_.MongoServerError=_.MongoServerClosedError=_.MongoRuntimeError=_.MongoParseError=_.MongoOIDCError=_.MongoNotConnectedError=_.MongoNetworkTimeoutError=_.MongoNetworkError=_.MongoMissingDependencyError=_.MongoMissingCredentialsError=_.MongoKerberosError=_.MongoInvalidArgumentError=_.MongoGridFSStreamError=_.MongoGridFSChunkError=_.MongoGCPError=_.MongoExpiredSessionError=_.MongoError=_.MongoDriverError=_.MongoDecompressionError=_.MongoCursorInUseError=_.MongoCursorExhaustedError=_.MongoCompatibilityError=_.MongoClientBulkWriteExecutionError=_.MongoClientBulkWriteError=_.MongoClientBulkWriteCursorError=_.MongoChangeStreamError=_.MongoBatchReExecutionError=_.MongoAzureError=_.MongoAWSError=_.MongoAPIError=_.ChangeStreamCursor=_.ClientEncryption=_.MongoBulkWriteError=_.UUID=_.Timestamp=_.ObjectId=_.MinKey=_.MaxKey=_.Long=_.Int32=_.Double=_.Decimal128=_.DBRef=_.Code=_.BSONType=_.BSONSymbol=_.BSONRegExp=_.Binary=_.BSON=void 0;_.ConnectionClosedEvent=_.ConnectionCheckOutStartedEvent=_.ConnectionCheckOutFailedEvent=_.ConnectionCheckedOutEvent=_.ConnectionCheckedInEvent=_.CommandSucceededEvent=_.CommandStartedEvent=_.CommandFailedEvent=_.WriteConcern=_.ReadPreference=_.ReadConcern=_.TopologyType=_.ServerType=_.ReadPreferenceMode=_.ReadConcernLevel=_.ProfilingLevel=_.ReturnDocument=_.ServerApiVersion=_.ExplainVerbosity=_.MongoErrorLabel=_.CURSOR_FLAGS=_.Compressor=_.AuthMechanism=_.GSSAPICanonicalizationValue=_.AutoEncryptionLoggerLevel=_.BatchType=_.UnorderedBulkOperation=_.OrderedBulkOperation=_.MongoClient=_.ListIndexesCursor=_.ListCollectionsCursor=_.GridFSBucketWriteStream=_.GridFSBucketReadStream=_.GridFSBucket=_.FindCursor=_.Db=_.Collection=_.ClientSession=_.ChangeStream=_.CancellationToken=_.AggregationCursor=_.Admin=_.AbstractCursor=_.configureExplicitResourceManagement=_.MongoWriteConcernError=_.MongoUnexpectedServerResponseError=_.MongoTransactionError=_.MongoTopologyClosedError=_.MongoTailableCursorError=_.MongoSystemError=void 0;_.MongoClientAuthProviders=_.MongoCryptKMSRequestNetworkTimeoutError=_.MongoCryptInvalidArgumentError=_.MongoCryptError=_.MongoCryptCreateEncryptedCollectionError=_.MongoCryptCreateDataKeyError=_.MongoCryptAzureKMSRequestError=_.SrvPollingEvent=_.WaitingForSuitableServerEvent=_.ServerSelectionSucceededEvent=_.ServerSelectionStartedEvent=_.ServerSelectionFailedEvent=_.ServerSelectionEvent=_.TopologyOpeningEvent=_.TopologyDescriptionChangedEvent=_.TopologyClosedEvent=_.ServerOpeningEvent=_.ServerHeartbeatSucceededEvent=_.ServerHeartbeatStartedEvent=_.ServerHeartbeatFailedEvent=_.ServerDescriptionChangedEvent=_.ServerClosedEvent=_.ConnectionReadyEvent=_.ConnectionPoolReadyEvent=_.ConnectionPoolMonitoringEvent=_.ConnectionPoolCreatedEvent=_.ConnectionPoolClosedEvent=_.ConnectionPoolClearedEvent=_.ConnectionCreatedEvent=void 0;var v51=DX();Object.defineProperty(_,"Admin",{enumerable:!0,get:function(){return v51.Admin}});var h51=NX();Object.defineProperty(_,"OrderedBulkOperation",{enumerable:!0,get:function(){return h51.OrderedBulkOperation}});var m51=PX();Object.defineProperty(_,"UnorderedBulkOperation",{enumerable:!0,get:function(){return m51.UnorderedBulkOperation}});var d51=r4();Object.defineProperty(_,"ChangeStream",{enumerable:!0,get:function(){return d51.ChangeStream}});var c51=a4();Object.defineProperty(_,"Collection",{enumerable:!0,get:function(){return c51.Collection}});var l51=k6();Object.defineProperty(_,"AbstractCursor",{enumerable:!0,get:function(){return l51.AbstractCursor}});var p51=N5();Object.defineProperty(_,"AggregationCursor",{enumerable:!0,get:function(){return p51.AggregationCursor}});var i51=fG();Object.defineProperty(_,"FindCursor",{enumerable:!0,get:function(){return i51.FindCursor}});var n51=P$();Object.defineProperty(_,"ListCollectionsCursor",{enumerable:!0,get:function(){return n51.ListCollectionsCursor}});var s51=gG();Object.defineProperty(_,"ListIndexesCursor",{enumerable:!0,get:function(){return s51.ListIndexesCursor}});var a51=LB();Object.defineProperty(_,"Db",{enumerable:!0,get:function(){return a51.Db}});var r51=Tu();Object.defineProperty(_,"GridFSBucket",{enumerable:!0,get:function(){return r51.GridFSBucket}});var t51=nG();Object.defineProperty(_,"GridFSBucketReadStream",{enumerable:!0,get:function(){return t51.GridFSBucketReadStream}});var o51=rG();Object.defineProperty(_,"GridFSBucketWriteStream",{enumerable:!0,get:function(){return o51.GridFSBucketWriteStream}});var e51=D4();Object.defineProperty(_,"MongoClient",{enumerable:!0,get:function(){return e51.MongoClient}});var FF1=d2();Object.defineProperty(_,"CancellationToken",{enumerable:!0,get:function(){return FF1.CancellationToken}});var AF1=D7();Object.defineProperty(_,"ClientSession",{enumerable:!0,get:function(){return AF1.ClientSession}});var BF1=w1();Object.defineProperty(_,"BSON",{enumerable:!0,get:function(){return BF1.BSON}});var E2=w1();Object.defineProperty(_,"Binary",{enumerable:!0,get:function(){return E2.Binary}});Object.defineProperty(_,"BSONRegExp",{enumerable:!0,get:function(){return E2.BSONRegExp}});Object.defineProperty(_,"BSONSymbol",{enumerable:!0,get:function(){return E2.BSONSymbol}});Object.defineProperty(_,"BSONType",{enumerable:!0,get:function(){return E2.BSONType}});Object.defineProperty(_,"Code",{enumerable:!0,get:function(){return E2.Code}});Object.defineProperty(_,"DBRef",{enumerable:!0,get:function(){return E2.DBRef}});Object.defineProperty(_,"Decimal128",{enumerable:!0,get:function(){return E2.Decimal128}});Object.defineProperty(_,"Double",{enumerable:!0,get:function(){return E2.Double}});Object.defineProperty(_,"Int32",{enumerable:!0,get:function(){return E2.Int32}});Object.defineProperty(_,"Long",{enumerable:!0,get:function(){return E2.Long}});Object.defineProperty(_,"MaxKey",{enumerable:!0,get:function(){return E2.MaxKey}});Object.defineProperty(_,"MinKey",{enumerable:!0,get:function(){return E2.MinKey}});Object.defineProperty(_,"ObjectId",{enumerable:!0,get:function(){return E2.ObjectId}});Object.defineProperty(_,"Timestamp",{enumerable:!0,get:function(){return E2.Timestamp}});Object.defineProperty(_,"UUID",{enumerable:!0,get:function(){return E2.UUID}});var DF1=h8();Object.defineProperty(_,"MongoBulkWriteError",{enumerable:!0,get:function(){return DF1.MongoBulkWriteError}});var JF1=fA();Object.defineProperty(_,"ClientEncryption",{enumerable:!0,get:function(){return JF1.ClientEncryption}});var ZF1=iG();Object.defineProperty(_,"ChangeStreamCursor",{enumerable:!0,get:function(){return ZF1.ChangeStreamCursor}});var z1=p();Object.defineProperty(_,"MongoAPIError",{enumerable:!0,get:function(){return z1.MongoAPIError}});Object.defineProperty(_,"MongoAWSError",{enumerable:!0,get:function(){return z1.MongoAWSError}});Object.defineProperty(_,"MongoAzureError",{enumerable:!0,get:function(){return z1.MongoAzureError}});Object.defineProperty(_,"MongoBatchReExecutionError",{enumerable:!0,get:function(){return z1.MongoBatchReExecutionError}});Object.defineProperty(_,"MongoChangeStreamError",{enumerable:!0,get:function(){return z1.MongoChangeStreamError}});Object.defineProperty(_,"MongoClientBulkWriteCursorError",{enumerable:!0,get:function(){return z1.MongoClientBulkWriteCursorError}});Object.defineProperty(_,"MongoClientBulkWriteError",{enumerable:!0,get:function(){return z1.MongoClientBulkWriteError}});Object.defineProperty(_,"MongoClientBulkWriteExecutionError",{enumerable:!0,get:function(){return z1.MongoClientBulkWriteExecutionError}});Object.defineProperty(_,"MongoCompatibilityError",{enumerable:!0,get:function(){return z1.MongoCompatibilityError}});Object.defineProperty(_,"MongoCursorExhaustedError",{enumerable:!0,get:function(){return z1.MongoCursorExhaustedError}});Object.defineProperty(_,"MongoCursorInUseError",{enumerable:!0,get:function(){return z1.MongoCursorInUseError}});Object.defineProperty(_,"MongoDecompressionError",{enumerable:!0,get:function(){return z1.MongoDecompressionError}});Object.defineProperty(_,"MongoDriverError",{enumerable:!0,get:function(){return z1.MongoDriverError}});Object.defineProperty(_,"MongoError",{enumerable:!0,get:function(){return z1.MongoError}});Object.defineProperty(_,"MongoExpiredSessionError",{enumerable:!0,get:function(){return z1.MongoExpiredSessionError}});Object.defineProperty(_,"MongoGCPError",{enumerable:!0,get:function(){return z1.MongoGCPError}});Object.defineProperty(_,"MongoGridFSChunkError",{enumerable:!0,get:function(){return z1.MongoGridFSChunkError}});Object.defineProperty(_,"MongoGridFSStreamError",{enumerable:!0,get:function(){return z1.MongoGridFSStreamError}});Object.defineProperty(_,"MongoInvalidArgumentError",{enumerable:!0,get:function(){return z1.MongoInvalidArgumentError}});Object.defineProperty(_,"MongoKerberosError",{enumerable:!0,get:function(){return z1.MongoKerberosError}});Object.defineProperty(_,"MongoMissingCredentialsError",{enumerable:!0,get:function(){return z1.MongoMissingCredentialsError}});Object.defineProperty(_,"MongoMissingDependencyError",{enumerable:!0,get:function(){return z1.MongoMissingDependencyError}});Object.defineProperty(_,"MongoNetworkError",{enumerable:!0,get:function(){return z1.MongoNetworkError}});Object.defineProperty(_,"MongoNetworkTimeoutError",{enumerable:!0,get:function(){return z1.MongoNetworkTimeoutError}});Object.defineProperty(_,"MongoNotConnectedError",{enumerable:!0,get:function(){return z1.MongoNotConnectedError}});Object.defineProperty(_,"MongoOIDCError",{enumerable:!0,get:function(){return z1.MongoOIDCError}});Object.defineProperty(_,"MongoParseError",{enumerable:!0,get:function(){return z1.MongoParseError}});Object.defineProperty(_,"MongoRuntimeError",{enumerable:!0,get:function(){return z1.MongoRuntimeError}});Object.defineProperty(_,"MongoServerClosedError",{enumerable:!0,get:function(){return z1.MongoServerClosedError}});Object.defineProperty(_,"MongoServerError",{enumerable:!0,get:function(){return z1.MongoServerError}});Object.defineProperty(_,"MongoServerSelectionError",{enumerable:!0,get:function(){return z1.MongoServerSelectionError}});Object.defineProperty(_,"MongoSystemError",{enumerable:!0,get:function(){return z1.MongoSystemError}});Object.defineProperty(_,"MongoTailableCursorError",{enumerable:!0,get:function(){return z1.MongoTailableCursorError}});Object.defineProperty(_,"MongoTopologyClosedError",{enumerable:!0,get:function(){return z1.MongoTopologyClosedError}});Object.defineProperty(_,"MongoTransactionError",{enumerable:!0,get:function(){return z1.MongoTransactionError}});Object.defineProperty(_,"MongoUnexpectedServerResponseError",{enumerable:!0,get:function(){return z1.MongoUnexpectedServerResponseError}});Object.defineProperty(_,"MongoWriteConcernError",{enumerable:!0,get:function(){return z1.MongoWriteConcernError}});var XF1=J7();Object.defineProperty(_,"configureExplicitResourceManagement",{enumerable:!0,get:function(){return XF1.configureExplicitResourceManagement}});var YF1=h8();Object.defineProperty(_,"BatchType",{enumerable:!0,get:function(){return YF1.BatchType}});var $F1=jY();Object.defineProperty(_,"AutoEncryptionLoggerLevel",{enumerable:!0,get:function(){return $F1.AutoEncryptionLoggerLevel}});var GF1=qA();Object.defineProperty(_,"GSSAPICanonicalizationValue",{enumerable:!0,get:function(){return GF1.GSSAPICanonicalizationValue}});var EF1=n6();Object.defineProperty(_,"AuthMechanism",{enumerable:!0,get:function(){return EF1.AuthMechanism}});var CF1=e8();Object.defineProperty(_,"Compressor",{enumerable:!0,get:function(){return CF1.Compressor}});var HF1=k6();Object.defineProperty(_,"CURSOR_FLAGS",{enumerable:!0,get:function(){return HF1.CURSOR_FLAGS}});var qF1=p();Object.defineProperty(_,"MongoErrorLabel",{enumerable:!0,get:function(){return qF1.MongoErrorLabel}});var WF1=tZ();Object.defineProperty(_,"ExplainVerbosity",{enumerable:!0,get:function(){return WF1.ExplainVerbosity}});var KF1=D4();Object.defineProperty(_,"ServerApiVersion",{enumerable:!0,get:function(){return KF1.ServerApiVersion}});var zF1=vG();Object.defineProperty(_,"ReturnDocument",{enumerable:!0,get:function(){return zF1.ReturnDocument}});var UF1=f$();Object.defineProperty(_,"ProfilingLevel",{enumerable:!0,get:function(){return UF1.ProfilingLevel}});var QF1=B6();Object.defineProperty(_,"ReadConcernLevel",{enumerable:!0,get:function(){return QF1.ReadConcernLevel}});var LF1=P0();Object.defineProperty(_,"ReadPreferenceMode",{enumerable:!0,get:function(){return LF1.ReadPreferenceMode}});var ju=v2();Object.defineProperty(_,"ServerType",{enumerable:!0,get:function(){return ju.ServerType}});Object.defineProperty(_,"TopologyType",{enumerable:!0,get:function(){return ju.TopologyType}});var VF1=B6();Object.defineProperty(_,"ReadConcern",{enumerable:!0,get:function(){return VF1.ReadConcern}});var RF1=P0();Object.defineProperty(_,"ReadPreference",{enumerable:!0,get:function(){return RF1.ReadPreference}});var wF1=c0();Object.defineProperty(_,"WriteConcern",{enumerable:!0,get:function(){return wF1.WriteConcern}});var oG=cY();Object.defineProperty(_,"CommandFailedEvent",{enumerable:!0,get:function(){return oG.CommandFailedEvent}});Object.defineProperty(_,"CommandStartedEvent",{enumerable:!0,get:function(){return oG.CommandStartedEvent}});Object.defineProperty(_,"CommandSucceededEvent",{enumerable:!0,get:function(){return oG.CommandSucceededEvent}});var H6=A$();Object.defineProperty(_,"ConnectionCheckedInEvent",{enumerable:!0,get:function(){return H6.ConnectionCheckedInEvent}});Object.defineProperty(_,"ConnectionCheckedOutEvent",{enumerable:!0,get:function(){return H6.ConnectionCheckedOutEvent}});Object.defineProperty(_,"ConnectionCheckOutFailedEvent",{enumerable:!0,get:function(){return H6.ConnectionCheckOutFailedEvent}});Object.defineProperty(_,"ConnectionCheckOutStartedEvent",{enumerable:!0,get:function(){return H6.ConnectionCheckOutStartedEvent}});Object.defineProperty(_,"ConnectionClosedEvent",{enumerable:!0,get:function(){return H6.ConnectionClosedEvent}});Object.defineProperty(_,"ConnectionCreatedEvent",{enumerable:!0,get:function(){return H6.ConnectionCreatedEvent}});Object.defineProperty(_,"ConnectionPoolClearedEvent",{enumerable:!0,get:function(){return H6.ConnectionPoolClearedEvent}});Object.defineProperty(_,"ConnectionPoolClosedEvent",{enumerable:!0,get:function(){return H6.ConnectionPoolClosedEvent}});Object.defineProperty(_,"ConnectionPoolCreatedEvent",{enumerable:!0,get:function(){return H6.ConnectionPoolCreatedEvent}});Object.defineProperty(_,"ConnectionPoolMonitoringEvent",{enumerable:!0,get:function(){return H6.ConnectionPoolMonitoringEvent}});Object.defineProperty(_,"ConnectionPoolReadyEvent",{enumerable:!0,get:function(){return H6.ConnectionPoolReadyEvent}});Object.defineProperty(_,"ConnectionReadyEvent",{enumerable:!0,get:function(){return H6.ConnectionReadyEvent}});var T3=BB();Object.defineProperty(_,"ServerClosedEvent",{enumerable:!0,get:function(){return T3.ServerClosedEvent}});Object.defineProperty(_,"ServerDescriptionChangedEvent",{enumerable:!0,get:function(){return T3.ServerDescriptionChangedEvent}});Object.defineProperty(_,"ServerHeartbeatFailedEvent",{enumerable:!0,get:function(){return T3.ServerHeartbeatFailedEvent}});Object.defineProperty(_,"ServerHeartbeatStartedEvent",{enumerable:!0,get:function(){return T3.ServerHeartbeatStartedEvent}});Object.defineProperty(_,"ServerHeartbeatSucceededEvent",{enumerable:!0,get:function(){return T3.ServerHeartbeatSucceededEvent}});Object.defineProperty(_,"ServerOpeningEvent",{enumerable:!0,get:function(){return T3.ServerOpeningEvent}});Object.defineProperty(_,"TopologyClosedEvent",{enumerable:!0,get:function(){return T3.TopologyClosedEvent}});Object.defineProperty(_,"TopologyDescriptionChangedEvent",{enumerable:!0,get:function(){return T3.TopologyDescriptionChangedEvent}});Object.defineProperty(_,"TopologyOpeningEvent",{enumerable:!0,get:function(){return T3.TopologyOpeningEvent}});var f5=HG();Object.defineProperty(_,"ServerSelectionEvent",{enumerable:!0,get:function(){return f5.ServerSelectionEvent}});Object.defineProperty(_,"ServerSelectionFailedEvent",{enumerable:!0,get:function(){return f5.ServerSelectionFailedEvent}});Object.defineProperty(_,"ServerSelectionStartedEvent",{enumerable:!0,get:function(){return f5.ServerSelectionStartedEvent}});Object.defineProperty(_,"ServerSelectionSucceededEvent",{enumerable:!0,get:function(){return f5.ServerSelectionSucceededEvent}});Object.defineProperty(_,"WaitingForSuitableServerEvent",{enumerable:!0,get:function(){return f5.WaitingForSuitableServerEvent}});var IF1=KG();Object.defineProperty(_,"SrvPollingEvent",{enumerable:!0,get:function(){return IF1.SrvPollingEvent}});var u7=a9();Object.defineProperty(_,"MongoCryptAzureKMSRequestError",{enumerable:!0,get:function(){return u7.MongoCryptAzureKMSRequestError}});Object.defineProperty(_,"MongoCryptCreateDataKeyError",{enumerable:!0,get:function(){return u7.MongoCryptCreateDataKeyError}});Object.defineProperty(_,"MongoCryptCreateEncryptedCollectionError",{enumerable:!0,get:function(){return u7.MongoCryptCreateEncryptedCollectionError}});Object.defineProperty(_,"MongoCryptError",{enumerable:!0,get:function(){return u7.MongoCryptError}});Object.defineProperty(_,"MongoCryptInvalidArgumentError",{enumerable:!0,get:function(){return u7.MongoCryptInvalidArgumentError}});Object.defineProperty(_,"MongoCryptKMSRequestNetworkTimeoutError",{enumerable:!0,get:function(){return u7.MongoCryptKMSRequestNetworkTimeoutError}});var NF1=BG();Object.defineProperty(_,"MongoClientAuthProviders",{enumerable:!0,get:function(){return NF1.MongoClientAuthProviders}})});var o=z((jF1)=>{jF1.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup");jF1.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics");jF1.arrayParentSymbol=Symbol("mongoose#Array#_parent");jF1.arrayPathSymbol=Symbol("mongoose#Array#_path");jF1.arraySchemaSymbol=Symbol("mongoose#Array#_schema");jF1.documentArrayParent=Symbol("mongoose#documentArrayParent");jF1.documentIsSelected=Symbol("mongoose#Document#isSelected");jF1.documentIsModified=Symbol("mongoose#Document#isModified");jF1.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths");jF1.documentSchemaSymbol=Symbol("mongoose#Document#schema");jF1.getSymbol=Symbol("mongoose#Document#get");jF1.modelSymbol=Symbol("mongoose#Model");jF1.objectIdSymbol=Symbol("mongoose#ObjectId");jF1.populateModelSymbol=Symbol("mongoose#PopulateOptions#Model");jF1.schemaTypeSymbol=Symbol("mongoose#schemaType");jF1.sessionNewDocuments=Symbol("mongoose#ClientSession#newDocuments");jF1.scopeSymbol=Symbol("mongoose#Document#scope");jF1.validatorErrorSymbol=Symbol("mongoose#validatorError")});var j3=z((lV1,uu)=>{var _5=l6().ObjectId,nF1=o().objectIdSymbol;Object.defineProperty(_5.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});/*!
|
|
30
|
+
* Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299
|
|
31
|
+
*/if(!_5.prototype.hasOwnProperty("valueOf"))_5.prototype.valueOf=function F(){return this.toString()};_5.prototype[nF1]=!0;uu.exports=_5});var C2=z((pV1,Ou)=>{Ou.exports=function F(A){if(A==null)return;if(typeof A.constructor!=="function")return;return A.constructor.name}});var y6=z((sF1)=>{/*!
|
|
32
|
+
* ignore
|
|
33
|
+
*/sF1.internalToObjectOptions={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1,versionKey:!0,flattenObjectIds:!1}});var lB=z((nV1,ku)=>{ku.exports=l6().Decimal128});var D9=z((sV1,Su)=>{Su.exports=new Set(["__proto__","constructor","prototype"])});var pB=z((rF1)=>{rF1.isMongooseArray=function(F){return Array.isArray(F)&&F.isMongooseArray}});var g5=z((rV1,xu)=>{var oF1=pB().isMongooseArray;xu.exports=function(F){return F!=null&&(oF1(F)||F.$__!=null||F.isMongooseBuffer||F.$isMongooseMap)}});var eG=z((tV1,fu)=>{var eF1=/^function\s*([^\s(]+)/;fu.exports=function(F){return F.name||(F.toString().trim().match(eF1)||[])[1]}});var H2=z((oV1,_u)=>{function FA1(F,A){return F!=null&&F._bsontype===A}_u.exports=FA1});var K4=z((eV1,gu)=>{gu.exports=function(F){return Buffer.isBuffer(F)||Object.prototype.toString.call(F)==="[object Object]"}});var O7=z((FR1,bu)=>{bu.exports=function F(A){if(A==null||typeof A!=="object")return!1;let B=Object.getPrototypeOf(A);return!B||B.constructor.name==="Object"}});var k7=z((AA1)=>{var yu=Symbol("mongoose#trustedSymbol");AA1.trustedSymbol=yu;AA1.trusted=function F(A){if(A==null||typeof A!=="object")return A;return A[yu]=!0,A}});var Z0=z((BR1,hu)=>{var JA1=lB(),ZA1=j3(),XA1=D9(),YA1=g5(),$A1=eG(),vu=H2(),GA1=pB().isMongooseArray,EA1=K4(),CA1=O7(),HA1=o(),FE=k7().trustedSymbol;function BE(F,A,B){if(F==null)return F;if(typeof F==="number"||typeof F==="string"||typeof F==="boolean"||typeof F==="bigint")return F;if(Array.isArray(F))return qA1(GA1(F)?F.__array:F,A);if(YA1(F)){if(A){if(A.retainDocuments&&F.$__!=null){let X=F.$clone();if(F.__index!=null)X.__index=F.__index;if(F.__parentArray!=null)X.__parentArray=F.__parentArray;return X.$__parent=F.$__parent,X}}let J=F.$isSingleNested;if(CA1(F)&&F.$__!=null&&F._doc!=null)return F._doc;let Z;if(A&&A.json&&typeof F.toJSON==="function")Z=F.toJSON(A);else Z=F.toObject(A);if(A&&A.minimize&&!F.constructor.$__required&&J&&Object.keys(Z).length===0)return;return Z}let D=F.constructor;if(D)switch($A1(D)){case"Object":return AE(F,A,B);case"Date":return new D(+F);case"RegExp":return WA1(F);default:break}if(vu(F,"ObjectId")){if(A&&A.flattenObjectIds)return F.toJSON();return new ZA1(F.id)}if(vu(F,"Decimal128")){if(A&&A.flattenDecimals)return F.toJSON();return JA1.fromString(F.toString())}if(!D&&EA1(F))return AE(F,A,B);if(typeof F==="object"&&F[HA1.schemaTypeSymbol])return F.clone();if(A&&A.bson&&typeof F.toBSON==="function")return F;if(typeof F.valueOf==="function")return F.valueOf();return AE(F,A,B)}hu.exports=BE;/*!
|
|
34
|
+
* ignore
|
|
35
|
+
*/function AE(F,A,B){let D=A&&A.minimize,J=A&&A.omitUndefined,Z=A&&A._seen,X={},Y;if(Z&&Z.has(F))return Z.get(F);else if(Z)Z.set(F,X);if(FE in F)X[FE]=F[FE];let $=Object.keys(F),G=$.length;for(let E=0;E<G;++E){let C=$[E];if(XA1.has(C))continue;let H=BE(F[C],A,!1);if((D===!1||J)&&typeof H==="undefined")delete X[C];else if(D!==!0||typeof H!=="undefined")Y||(Y=!0),X[C]=H}return D&&!B?Y&&X:X}function qA1(F,A){let B=0,D=F.length,J=new Array(D);for(B=0;B<D;++B)J[B]=BE(F[B],A,!0);return J}function WA1(F){let A=new RegExp(F.source,F.flags);if(A.lastIndex!==F.lastIndex)A.lastIndex=F.lastIndex;return A}});var cu=z((DR1,du)=>{/*!
|
|
36
|
+
* Module dependencies.
|
|
37
|
+
*/var iB=hW(),DE=C1(),JE=o4().Collection,KA1=j3(),mu=C2(),zA1=y6().internalToObjectOptions,UA1=import.meta.require("stream"),ZE=import.meta.require("util");function v6(F,A,B){this.collection=null,this.Promise=B.Promise||Promise,this.modelName=B.modelName,delete B.modelName,this._closed=!1,iB.apply(this,arguments)}/*!
|
|
38
|
+
* Inherit from abstract Collection.
|
|
39
|
+
*/Object.setPrototypeOf(v6.prototype,iB.prototype);v6.prototype.onOpen=function(){return this.collection=this.conn.db.collection(this.name),iB.prototype.onOpen.call(this),this.collection};v6.prototype.onClose=function(F){iB.prototype.onClose.call(this,F)};v6.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};/*!
|
|
40
|
+
* ignore
|
|
41
|
+
*/var b5={watch:!0,find:!0,aggregate:!0};function QA1(F){v6.prototype[F]=function(){let A=this._getCollection(),B=Array.from(arguments),D=this,J=D&&D.conn&&D.conn.base&&D.conn.base.options&&D.conn.base.options.debug,Z=D&&D.conn&&D.conn.options&&D.conn.options.debug,X=Z==null?J:Z,Y=arguments[arguments.length-1],$=new KA1;if(this.conn.$wasForceClosed){let C=new DE("Connection was force closed");if(B.length>0&&typeof B[B.length-1]==="function"){B[B.length-1](C);return}else throw C}let G=B,E=null;if(this._shouldBufferCommands()&&this.buffer){this.conn.emit("buffer",{_id:$,modelName:D.modelName,collectionName:D.name,method:F,args:B});let C,H=B,q=null,W=null;if(b5[F]&&typeof Y==="function")this.addQueue(F,H),C=Y;else if(b5[F])q=new this.Promise((U,Q)=>{C=function L(V,w){if(W!=null)clearTimeout(W);if(V!=null)return Q(V);U(w)},H=B.concat([C]),this.addQueue(F,H)});else if(typeof Y==="function")C=function U(){if(W!=null)clearTimeout(W);return Y.apply(this,arguments)},H=B.slice(0,B.length-1).concat([C]);else q=new Promise((U,Q)=>{C=function L(V,w){if(W!=null)clearTimeout(W);if(V!=null)return Q(V);U(w)},H=B.concat([C]),this.addQueue(F,H)});let K=this._getBufferTimeoutMS();if(W=setTimeout(()=>{if(this.removeQueue(F,H)){let Q="Operation `"+this.name+"."+F+"()` buffering timed out after "+K+"ms",L=new DE(Q);this.conn.emit("buffer-end",{_id:$,modelName:D.modelName,collectionName:D.name,method:F,error:L}),C(L)}},K),!b5[F]&&typeof Y==="function"){this.addQueue(F,H);return}return q}else if(!b5[F]&&typeof Y==="function")E=function C(H,q){if(H!=null)D.conn.emit("operation-end",{_id:$,modelName:D.modelName,collectionName:D.name,method:F,error:H});else D.conn.emit("operation-end",{_id:$,modelName:D.modelName,collectionName:D.name,method:F,result:q});return Y.apply(this,arguments)},G=B.slice(0,B.length-1).concat([E]);if(X)if(typeof X==="function"){let C=null;if(typeof B[B.length-1]=="function")C=B.slice(0,B.length-1);else C=B;X.apply(D,[D.name,F].concat(C))}else if(X instanceof UA1.Writable)this.$printToStream(D.name,F,B,X);else{let C=X.color==null?!0:X.color,H=X.shell==null?!1:X.shell;this.$print(D.name,F,B,C,H)}this.conn.emit("operation-start",{_id:$,modelName:D.modelName,collectionName:this.name,method:F,params:G});try{if(A==null){let H="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 DE(H)}if(b5[F]&&typeof Y==="function"){let H=A[F].apply(A,G.slice(0,G.length-1));return this.conn.emit("operation-end",{_id:$,modelName:D.modelName,collectionName:this.name,method:F,result:H}),Y.call(this,null,H)}let C=A[F].apply(A,G);if(C!=null&&typeof C.then==="function")return C.then((H)=>{if(typeof Y==="function")Y(null,H);else this.conn.emit("operation-end",{_id:$,modelName:D.modelName,collectionName:this.name,method:F,result:H});return H},(H)=>{if(typeof Y==="function"){Y(H);return}else this.conn.emit("operation-end",{_id:$,modelName:D.modelName,collectionName:this.name,method:F,error:H});throw H});return C}catch(C){if(typeof Y==="function")return Y(C);else throw this.conn.emit("operation-end",{_id:$,modelName:D.modelName,collectionName:this.name,method:F,error:C}),C}}}for(let F of Object.getOwnPropertyNames(JE.prototype)){if(Object.getOwnPropertyDescriptor(JE.prototype,F).get!==void 0)continue;if(typeof JE.prototype[F]!=="function")continue;QA1(F)}v6.prototype.$print=function(F,A,B,D,J){let Z=D?"\x1B[0;36mMongoose:\x1B[0m ":"Mongoose: ",X=[F,A].join("."),Y=[];for(let G=B.length-1;G>=0;--G)if(this.$format(B[G])||Y.length)Y.unshift(this.$format(B[G],D,J));let $="("+Y.join(", ")+")";console.info(Z+X+$)};v6.prototype.$printToStream=function(F,A,B,D){let J=[F,A].join("."),Z=[];for(let Y=B.length-1;Y>=0;--Y)if(this.$format(B[Y])||Z.length)Z.unshift(this.$format(B[Y]));let X="("+Z.join(", ")+")";D.write(J+X,"utf8")};v6.prototype.$format=function(F,A,B){let D=typeof F;if(D==="function"||D==="undefined")return"";return XE(F,!1,A,B)};function S7(F){let A={inspect:function(){return F}};if(ZE.inspect.custom)A[ZE.inspect.custom]=A.inspect;return A}function LA1(F){return XE(F,!0)}function VA1(F,A){F[A]=S7('ObjectId("'+F[A].toHexString()+'")')}function RA1(F,A,B){if(B)F[A]=S7('ISODate("'+F[A].toUTCString()+'")');else F[A]=S7('new Date("'+F[A].toUTCString()+'")')}function XE(F,A,B,D){if(F&&typeof F.toBSON==="function")F=F.toBSON();if(F==null)return F;let Z=Z0()(F,zA1),X=mu(Z);if(X==="Binary")Z="BinData("+Z.sub_type+', "'+Z.toString("base64")+'")';else if(X==="ObjectId")Z=S7('ObjectId("'+Z.toHexString()+'")');else if(X==="Date")Z=S7('new Date("'+Z.toUTCString()+'")');else if(X==="Object"){let Y=Object.keys(Z),$=Y.length,G;for(let E=0;E<$;++E)if(G=Y[E],Z[G]){let C;if(typeof Z[G].toBSON==="function")try{Z[G]=Z[G].toBSON()}catch(q){C=q}let H=mu(Z[G]);if(H==="Binary")Z[G]="BinData("+Z[G].sub_type+', "'+Z[G].buffer.toString("base64")+'")';else if(H==="Object")Z[G]=XE(Z[G],!0);else if(H==="ObjectId")VA1(Z,G);else if(H==="Date")RA1(Z,G,D);else if(H==="ClientSession")Z[G]=S7('ClientSession("'+(Z[G]&&Z[G].id&&Z[G].id.id&&Z[G].id.id.buffer||"").toString("hex")+'")');else if(Array.isArray(Z[G]))Z[G]=Z[G].map(LA1);else if(C!=null)throw C}}if(A)return Z;return ZE.inspect(Z,!1,10,B).replace(/\n/g,"").replace(/\s{2,}/g," ")}v6.prototype.getIndexes=v6.prototype.indexInformation;/*!
|
|
42
|
+
* Module exports.
|
|
43
|
+
*/du.exports=v6});var YE=z((JR1,iu)=>{/*!
|
|
44
|
+
* Module dependencies.
|
|
45
|
+
*/var wA1=import.meta.require("events").EventEmitter,y5=C1();/*!
|
|
46
|
+
* ignore
|
|
47
|
+
*/var lu=["close","change","end","error","resumeTokenChanged"];/*!
|
|
48
|
+
* ignore
|
|
49
|
+
*/class pu extends wA1{constructor(F,A,B){super();if(this.driverChangeStream=null,this.closed=!1,this.bindedEvents=!1,this.pipeline=A,this.options=B,this.errored=!1,B&&B.hydrate&&!B.model)throw new Error("Cannot create change stream with `hydrate: true` unless calling `Model.watch()`");let D=null;if(this.$driverChangeStreamPromise=new Promise((J,Z)=>{try{F((X,Y)=>{if(X!=null)return this.errored=!0,this.emit("error",X),Z(X);this.driverChangeStream=Y,this.emit("ready"),J()})}catch(X){D=X,this.errored=!0,this.emit("error",X),Z(X)}}),D!=null)throw D}_bindEvents(){if(this.bindedEvents)return;if(this.bindedEvents=!0,this.driverChangeStream==null){this.$driverChangeStreamPromise.then(()=>{this.driverChangeStream.on("close",()=>{this.closed=!0}),lu.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}),lu.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 y5("Cannot call hasNext() on errored ChangeStream");return this.driverChangeStream.hasNext(F)}next(F){if(this.errored)throw new y5("Cannot call next() on errored ChangeStream");if(this.options&&this.options.hydrate){if(F!=null){let B=F;F=(D,J)=>{if(D!=null)return B(D);if(J.fullDocument!=null)J.fullDocument=this.options.model.hydrate(J.fullDocument);return B(null,J)}}let A=this.driverChangeStream.next(F);if(A&&typeof A.then==="function")A=A.then((B)=>{if(B.fullDocument!=null)B.fullDocument=this.options.model.hydrate(B.fullDocument);return B});return A}return this.driverChangeStream.next(F)}addListener(F,A){if(this.errored)throw new y5("Cannot call addListener() on errored ChangeStream");return this._bindEvents(),super.addListener(F,A)}on(F,A){if(this.errored)throw new y5("Cannot call on() on errored ChangeStream");return this._bindEvents(),super.on(F,A)}once(F,A){if(this.errored)throw new y5("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(),()=>{})}}/*!
|
|
50
|
+
* ignore
|
|
51
|
+
*/iu.exports=pu});var x7=z((ZR1,au)=>{function x1(){this._pres=new Map,this._posts=new Map}x1.skipWrappedFunction=function F(){if(!(this instanceof x1.skipWrappedFunction))return new x1.skipWrappedFunction(...arguments);this.args=[...arguments]};x1.overwriteResult=function F(){if(!(this instanceof x1.overwriteResult))return new x1.overwriteResult(...arguments);this.args=[...arguments]};x1.prototype.execPre=function(F,A,B,D){if(arguments.length===3)D=B,B=[];let J=this._pres.get(F)||[],Z=J.length,X=J.numAsync||0,Y=0,$=X,G=!1,E=B,C=null;if(!Z)return h5(function(){D(null)});function H(){if(Y>=Z)return;let W=J[Y];if(W.isAsync){let K=[v5(q),v5(function(U){if(U){if(G)return;if(U instanceof x1.skipWrappedFunction)C=U;else return G=!0,D(U)}if(--$===0&&Y>=Z)return D(C)})];nB(W.fn,A,K,K[0])}else if(W.fn.length>0){let K=[v5(q)],U=arguments.length>=2?arguments:[null].concat(E);for(let Q=1;Q<U.length;++Q){if(Q===U.length-1&&typeof U[Q]==="function")continue;K.push(U[Q])}nB(W.fn,A,K,K[0])}else{let K=null;try{K=W.fn.call(A)}catch(U){if(U!=null)return D(U)}if(sB(K))K.then(()=>q(),(U)=>q(U));else{if(++Y>=Z)if($>0)return;else return h5(function(){D(C)});H()}}}H.apply(null,[null].concat(B));function q(W){if(W){if(G)return;if(W instanceof x1.skipWrappedFunction)C=W;else return G=!0,D(W)}if(++Y>=Z)if($>0)return;else return D(C);H.apply(A,arguments)}};x1.prototype.execPreSync=function(F,A,B){let D=this._pres.get(F)||[],J=D.length;for(let Z=0;Z<J;++Z)D[Z].fn.apply(A,B||[])};x1.prototype.execPost=function(F,A,B,D,J){if(arguments.length<5)J=D,D=null;let Z=this._posts.get(F)||[],X=Z.length,Y=0,$=null;if(D&&D.error)$=D.error;if(!X)return h5(function(){J.apply(null,[$].concat(B))});function G(){let E=Z[Y].fn,C=0,H=B.length,q=[];for(let W=0;W<H;++W)if(C+=B[W]&&B[W]._kareemIgnore?0:1,!B[W]||!B[W]._kareemIgnore)q.push(B[W]);if($)if(su(Z[Y],C)){let W=v5(function(K){if(K){if(K instanceof x1.overwriteResult){if(B=K.args,++Y>=X)return J.call(null,$);return G()}$=K}if(++Y>=X)return J.call(null,$);G()});nB(E,A,[$].concat(q).concat([W]),W)}else{if(++Y>=X)return J.call(null,$);G()}else{let W=v5(function(K){if(K){if(K instanceof x1.overwriteResult){if(B=K.args,++Y>=X)return J.apply(null,[null].concat(B));return G()}return $=K,G()}if(++Y>=X)return J.apply(null,[null].concat(B));G()});if(su(Z[Y],C)){if(++Y>=X)return J.apply(null,[null].concat(B));return G()}if(E.length===C+1)nB(E,A,q.concat([W]),W);else{let K,U;try{U=E.apply(A,q)}catch(Q){K=Q,$=Q}if(sB(U))return U.then((Q)=>{W(Q instanceof x1.overwriteResult?Q:null)},(Q)=>W(Q));if(U instanceof x1.overwriteResult)B=U.args;if(++Y>=X)return J.apply(null,[K].concat(B));G()}}}G()};x1.prototype.execPostSync=function(F,A,B){let D=this._posts.get(F)||[],J=D.length;for(let Z=0;Z<J;++Z){let X=D[Z].fn.apply(A,B||[]);if(X instanceof x1.overwriteResult)B=X.args}return B};x1.prototype.createWrapperSync=function(F,A){let B=this;return function D(){B.execPreSync(F,this,arguments);let J=A.apply(this,arguments);return B.execPostSync(F,this,[J])[0]}};function nu(F,A,B,D,J,Z,X){if(Z.useErrorHandlers)return F.execPost(B,D,J,{error:A},function(Y){return typeof X==="function"&&X(Y)});else return typeof X==="function"&&X(A)}x1.prototype.wrap=function(F,A,B,D,J){let Z=D.length>0?D[D.length-1]:null,X=Array.from(D);typeof Z==="function"&&X.pop();let Y=this;J=J||{};let $=J.checkForPromise;this.execPre(F,B,D,function(G){if(G&&!(G instanceof x1.skipWrappedFunction)){let q=J.numCallbackParams||0,W=J.contextParameter?[B]:[];for(let K=W.length;K<q;++K)W.push(null);return nu(Y,G,F,B,W,J,Z)}let E=A.length,C;if(G instanceof x1.skipWrappedFunction)return C=G.args[0],H(null,...G.args);else try{C=A.apply(B,X.concat(H))}catch(q){return H(q)}if($){if(sB(C))return C.then((q)=>H(null,q),(q)=>H(q));if(E<X.length+1)return H(null,C)}function H(){let q=Array.from(arguments);if(q.shift(),J.nullResultByDefault&&q.length===0)q.push(null);if(arguments[0])return nu(Y,arguments[0],F,B,q,J,Z);else Y.execPost(F,B,q,function(){if(Z===null)return;arguments[0]?Z(arguments[0]):Z.apply(B,arguments)})}})};x1.prototype.filter=function(F){let A=this.clone(),B=Array.from(A._pres.keys());for(let J of B){let Z=this._pres.get(J).map((X)=>Object.assign({},X,{name:J})).filter(F);if(Z.length===0){A._pres.delete(J);continue}Z.numAsync=Z.filter((X)=>X.isAsync).length,A._pres.set(J,Z)}let D=Array.from(A._posts.keys());for(let J of D){let Z=this._posts.get(J).map((X)=>Object.assign({},X,{name:J})).filter(F);if(Z.length===0){A._posts.delete(J);continue}A._posts.set(J,Z)}return A};x1.prototype.hasHooks=function(F){return this._pres.has(F)||this._posts.has(F)};x1.prototype.createWrapper=function(F,A,B,D){let J=this;if(!this.hasHooks(F))return function(){h5(()=>A.apply(this,arguments))};return function(){let Z=B||this;J.wrap(F,A,Z,Array.from(arguments),D)}};x1.prototype.pre=function(F,A,B,D,J){let Z={};if(typeof A==="object"&&A!==null)Z=A,A=Z.isAsync;else if(typeof arguments[1]!=="boolean")B=A,A=!1;let X=this._pres.get(F)||[];if(this._pres.set(F,X),A)X.numAsync=X.numAsync||0,++X.numAsync;if(typeof B!=="function")throw new Error('pre() requires a function, got "'+typeof B+'"');if(J)X.unshift(Object.assign({},Z,{fn:B,isAsync:A}));else X.push(Object.assign({},Z,{fn:B,isAsync:A}));return this};x1.prototype.post=function(F,A,B,D){let J=this._posts.get(F)||[];if(typeof A==="function")D=!!B,B=A,A={};if(typeof B!=="function")throw new Error('post() requires a function, got "'+typeof B+'"');if(D)J.unshift(Object.assign({},A,{fn:B}));else J.push(Object.assign({},A,{fn:B}));return this._posts.set(F,J),this};x1.prototype.clone=function(){let F=new x1;for(let A of this._pres.keys()){let B=this._pres.get(A).slice();B.numAsync=this._pres.get(A).numAsync,F._pres.set(A,B)}for(let A of this._posts.keys())F._posts.set(A,this._posts.get(A).slice());return F};x1.prototype.merge=function(F,A){A=arguments.length===1?!0:A;let B=A?this.clone():this;for(let D of F._pres.keys()){let J=B._pres.get(D)||[],Z=F._pres.get(D).filter((Y)=>J.map(($)=>$.fn).indexOf(Y.fn)===-1),X=J.concat(Z);X.numAsync=J.numAsync||0,X.numAsync+=Z.filter((Y)=>Y.isAsync).length,B._pres.set(D,X)}for(let D of F._posts.keys()){let J=B._posts.get(D)||[],Z=F._posts.get(D).filter((X)=>J.indexOf(X)===-1);B._posts.set(D,J.concat(Z))}return B};function nB(F,A,B,D){let J;try{J=F.apply(A,B)}catch(Z){return D(Z)}if(sB(J))J.then(()=>D(),(Z)=>D(Z))}function sB(F){return typeof F==="object"&&F!==null&&typeof F.then==="function"}function v5(F){let A=!1,B=this;return function(){if(A)return;return A=!0,h5(()=>F.apply(B,arguments))}}var h5=typeof process==="object"&&process!==null&&process.nextTick||function F(A){setTimeout(A,0)};function su(F,A){if(F.errorHandler)return!0;return F.fn.length===A+2}au.exports=x1});var ou=z((ru,tu)=>{var a0=tu.exports=ru={};a0.DocumentNotFoundError=null;a0.general={};a0.general.default="Validator failed for path `{PATH}` with value `{VALUE}`";a0.general.required="Path `{PATH}` is required.";a0.Number={};a0.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).";a0.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).";a0.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";a0.Date={};a0.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).";a0.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).";a0.String={};a0.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";a0.String.match="Path `{PATH}` is invalid ({VALUE}).";a0.String.minlength="Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).";a0.String.maxlength="Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH})."});var aB=z((XR1,FO)=>{/*!
|
|
52
|
+
* Module dependencies.
|
|
53
|
+
*/var eu=C1(),IA1=import.meta.require("util");class $E extends eu{constructor(F,A,B,D){let J,Z=eu.messages;if(Z.DocumentNotFoundError!=null)J=typeof Z.DocumentNotFoundError==="function"?Z.DocumentNotFoundError(F,A):Z.DocumentNotFoundError;else J='No document found for query "'+IA1.inspect(F)+'" on model "'+A+'"';super(J);this.result=D,this.numAffected=B,this.filter=F,this.query=F}}Object.defineProperty($E.prototype,"name",{value:"DocumentNotFoundError"});/*!
|
|
54
|
+
* exports
|
|
55
|
+
*/FO.exports=$E});var q2=z((YR1,DO)=>{/*!
|
|
56
|
+
* Module dependencies.
|
|
57
|
+
*/var NA1=C1(),PA1=import.meta.require("util");class CE extends NA1{constructor(F,A,B,D,J){if(arguments.length>0){let Z=AO(A),X=BO(J),Y=GE(null,F,A,B,X,Z,D);super(Y);this.init(F,A,B,D,J)}else super(GE())}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,B,D,J){/*!
|
|
58
|
+
* ignore
|
|
59
|
+
*/this.stringValue=EE(A),this.messageFormat=BO(J),this.kind=F,this.value=A,this.path=B,this.reason=D,this.valueType=AO(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){/*!
|
|
60
|
+
* ignore
|
|
61
|
+
*/this.message=GE(F,this.kind,this.value,this.path,this.messageFormat,this.valueType)}}Object.defineProperty(CE.prototype,"name",{value:"CastError"});function EE(F){let A=PA1.inspect(F);if(A=A.replace(/^'|'$/g,'"'),!A.startsWith('"'))A='"'+A+'"';return A}function AO(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 BO(F){let A=F&&F._castErrorMessage||null;if(typeof A==="string"||typeof A==="function")return A}/*!
|
|
62
|
+
* ignore
|
|
63
|
+
*/function GE(F,A,B,D,J,Z,X){if(typeof J==="string"){let Y=EE(B),$=J.replace("{KIND}",A).replace("{VALUE}",Y).replace("{PATH}",D);if(F!=null)$=$.replace("{MODEL}",F.modelName);return $}else if(typeof J==="function")return J(B,D,F,A);else{let Y=EE(B),$=Z?" (type "+Z+")":"",G="Cast to "+A+" failed for value "+Y+$+' at path "'+D+'"';if(F!=null)G+=' for model "'+F.modelName+'"';if(X!=null&&typeof X.constructor==="function"&&X.constructor.name!=="AssertionError"&&X.constructor.name!=="Error")G+=' because of "'+X.constructor.name+'"';return G}}/*!
|
|
64
|
+
* exports
|
|
65
|
+
*/DO.exports=CE});var HE=z(($R1,JO)=>{/*!
|
|
66
|
+
* ignore
|
|
67
|
+
*/JO.exports=function F(A){let B=Object.keys(A.errors||{}),D=B.length,J=[],Z;for(let X=0;X<D;++X){if(Z=B[X],A===A.errors[Z])continue;J.push(Z+": "+A.errors[Z].message)}return J.join(", ")}});var Z9=z((GR1,YO)=>{/*!
|
|
68
|
+
* Module requirements
|
|
69
|
+
*/var MA1=C1(),TA1=C2(),ZO=import.meta.require("util"),XO=HE();class J9 extends MA1{constructor(F){let A;if(TA1(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+": "+XO(this)}inspect(){return Object.assign(new Error(this.message),this)}addError(F,A){if(A instanceof J9){let{errors:B}=A;for(let D of Object.keys(B))this.addError(`${F}.${D}`,B[D]);return}this.errors[F]=A,this.message=this._message+": "+XO(this)}}if(ZO.inspect.custom)J9.prototype[ZO.inspect.custom]=J9.prototype.inspect;Object.defineProperty(J9.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(J9.prototype,"name",{value:"ValidationError"});/*!
|
|
70
|
+
* Module exports
|
|
71
|
+
*/YO.exports=J9});var qE=z((ER1,EO)=>{/*!
|
|
72
|
+
* Module dependencies.
|
|
73
|
+
*/var $O=C1();class m5 extends $O{constructor(F,A){let B=F.message;if(!B)B=$O.messages.general.default;let D=GO(B,F,A);super(D);F=Object.assign({},F,{message:D}),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(m5.prototype,"name",{value:"ValidatorError"});Object.defineProperty(m5.prototype,"properties",{enumerable:!1,writable:!0,value:null});m5.prototype.formatMessage=GO;function GO(F,A,B){if(typeof F==="function")return F(A,B);let D=Object.keys(A);for(let J of D){if(J==="message")continue;F=F.replace("{"+J.toUpperCase()+"}",A[J])}return F}/*!
|
|
74
|
+
* exports
|
|
75
|
+
*/EO.exports=m5});var KE=z((CR1,CO)=>{/*!
|
|
76
|
+
* Module dependencies.
|
|
77
|
+
*/var jA1=C1();class WE extends jA1{constructor(F,A,B){let D=B.join(", ");super('No matching document found for id "'+F._doc._id+'" version '+A+' modifiedPaths "'+D+'"');this.version=A,this.modifiedPaths=B}}Object.defineProperty(WE.prototype,"name",{value:"VersionError"});/*!
|
|
78
|
+
* exports
|
|
79
|
+
*/CO.exports=WE});var UE=z((HR1,HO)=>{/*!
|
|
80
|
+
* Module dependencies.
|
|
81
|
+
*/var uA1=C1();class zE extends uA1{constructor(F){super("Can't save() the same doc multiple times in parallel. Document: "+F._doc._id)}}Object.defineProperty(zE.prototype,"name",{value:"ParallelSaveError"});/*!
|
|
82
|
+
* exports
|
|
83
|
+
*/HO.exports=zE});var LE=z((qR1,qO)=>{/*!
|
|
84
|
+
* Module dependencies.
|
|
85
|
+
*/var OA1=C1();class QE extends OA1{constructor(F){super("Cannot overwrite `"+F+"` model once compiled.")}}Object.defineProperty(QE.prototype,"name",{value:"OverwriteModelError"});/*!
|
|
86
|
+
* exports
|
|
87
|
+
*/qO.exports=QE});var KO=z((WR1,WO)=>{/*!
|
|
88
|
+
* Module dependencies.
|
|
89
|
+
*/var kA1=C1();class VE extends kA1{constructor(F){let A=`Schema hasn't been registered for model "`+F+`".
|
|
90
|
+
Use mongoose.model(name, schema)`;super(A)}}Object.defineProperty(VE.prototype,"name",{value:"MissingSchemaError"});/*!
|
|
91
|
+
* exports
|
|
92
|
+
*/WO.exports=VE});var UO=z((KR1,zO)=>{var SA1=C2();zO.exports=function F(A){if(SA1(A)!=="TopologyDescription")return!1;let B=Array.from(A.servers.values());return B.length>0&&B.every((D)=>D.type==="Unknown")}});var LO=z((zR1,QO)=>{var xA1=C2();QO.exports=function F(A){if(xA1(A)!=="TopologyDescription")return!1;if(A.servers.size===0)return!1;for(let B of A.servers.values())if(B.host.endsWith(".mongodb.net")===!1||B.port!==27017)return!1;return!0}});var RO=z((UR1,VO)=>{var fA1=C2(),_A1="Client network socket disconnected before secure TLS connection was established";VO.exports=function F(A){if(fA1(A)!=="TopologyDescription")return!1;let B=Array.from(A.servers.values());return B.length>0&&B.every((D)=>D.error&&D.error.message.indexOf(_A1)!==-1)}});var wE=z((QR1,wO)=>{/*!
|
|
93
|
+
* Module dependencies.
|
|
94
|
+
*/var gA1=C1(),bA1=UO(),yA1=LO(),vA1=RO();/*!
|
|
95
|
+
* ignore
|
|
96
|
+
*/var hA1="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/",mA1="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 RE extends gA1{assimilateError(F){let A=F.reason;if(yA1(A)&&bA1(A)&&F.message.indexOf("bad auth")===-1&&F.message.indexOf("Authentication failed")===-1)this.message=hA1;else if(vA1(A))this.message=mA1;else this.message=F.message;for(let D in F)if(D!=="name")this[D]=F[D];return this}}Object.defineProperty(RE.prototype,"name",{value:"MongooseServerSelectionError"});wO.exports=RE});var NE=z((LR1,IO)=>{/*!
|
|
97
|
+
* Module dependencies.
|
|
98
|
+
*/var dA1=C1();class IE extends dA1{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(`
|
|
99
|
+
`)+`
|
|
100
|
+
Use Model.updateOne() to update these arrays instead.`;super(A)}}Object.defineProperty(IE.prototype,"name",{value:"DivergentArrayError"});/*!
|
|
101
|
+
* exports
|
|
102
|
+
*/IO.exports=IE});var z4=z((VR1,NO)=>{/*!
|
|
103
|
+
* Module dependencies.
|
|
104
|
+
*/var cA1=C1();class PE extends cA1{constructor(F,A,B){A=A||"Field `"+F+"` is not in schema and strict mode is set to throw.";super(A);this.isImmutableError=!!B,this.path=F}}Object.defineProperty(PE.prototype,"name",{value:"StrictModeError"});NO.exports=PE});var TE=z((RR1,PO)=>{/*!
|
|
105
|
+
* Module dependencies.
|
|
106
|
+
*/var lA1=C1();class ME extends lA1{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(ME.prototype,"name",{value:"StrictPopulateError"});PO.exports=ME});var W2=z((MO,TO)=>{var r0=C1();/*!
|
|
107
|
+
* Module exports.
|
|
108
|
+
*/TO.exports=MO=r0;r0.messages=ou();r0.Messages=r0.messages;r0.DocumentNotFoundError=aB();r0.CastError=q2();r0.ValidationError=Z9();r0.ValidatorError=qE();r0.VersionError=KE();r0.ParallelSaveError=UE();r0.OverwriteModelError=LE();r0.MissingSchemaError=KO();r0.MongooseServerSelectionError=wE();r0.DivergentArrayError=NE();r0.StrictModeError=z4();r0.StrictPopulateError=TE()});var q6=z((wR1,jO)=>{jO.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})});var i2=z((IR1,uO)=>{var pA1=Z0();class t0{constructor(F){if(F==null)return this;Object.assign(this,pA1(F))}}var j2=q6();Object.defineProperty(t0.prototype,"type",j2);Object.defineProperty(t0.prototype,"validate",j2);Object.defineProperty(t0.prototype,"cast",j2);Object.defineProperty(t0.prototype,"required",j2);Object.defineProperty(t0.prototype,"default",j2);Object.defineProperty(t0.prototype,"ref",j2);Object.defineProperty(t0.prototype,"refPath",j2);Object.defineProperty(t0.prototype,"select",j2);Object.defineProperty(t0.prototype,"index",j2);Object.defineProperty(t0.prototype,"unique",j2);Object.defineProperty(t0.prototype,"immutable",j2);Object.defineProperty(t0.prototype,"sparse",j2);Object.defineProperty(t0.prototype,"text",j2);Object.defineProperty(t0.prototype,"transform",j2);uO.exports=t0});var rB=z((NR1,f7)=>{var iA1=q2();f7.exports=function F(A,B){if(f7.exports.convertToTrue.has(A))return!0;if(f7.exports.convertToFalse.has(A))return!1;if(A==null)return A;throw new iA1("boolean",A,B)};f7.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]);f7.exports.convertToFalse=new Set([!1,"false",0,"0","no"])});var tB=z((PR1,OO)=>{var nA1=rB();/*!
|
|
109
|
+
* ignore
|
|
110
|
+
*/OO.exports=function(F){let A=this!=null?this.path:null;return nA1(F,A)}});var jE=z((MR1,kO)=>{/*!
|
|
111
|
+
* ignore
|
|
112
|
+
*/kO.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 xO=z((TR1,SO)=>{var sA1=z4();/*!
|
|
113
|
+
* ignore
|
|
114
|
+
*/SO.exports=function(F){if(F.$immutable)F.$immutableSetter=aA1(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 aA1(F,A){return function B(D,J,Z,X){if(this==null||this.$__==null)return D;if(this.isNew)return D;if(X&&X.overwriteImmutable)return D;if(!(typeof A==="function"?A.call(this,this):A))return D;let $=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(F):this.$__getValue(F);if(this.$__.strictMode==="throw"&&D!==$)throw new sA1(F,"Path `"+F+"` is immutable and strict mode is set to throw.",!0);return $}}});var _O=z((jR1,fO)=>{fO.exports=function F(A){return typeof A==="function"&&A.constructor&&A.constructor.name==="AsyncFunction"}});var bO=z((uR1,gO)=>{gO.exports=function F(A){let B=Object.keys(A),D=!0;for(let J=0,Z=B.length;J<Z;++J)if(typeof A[B[J]]==="object"&&A[B[J]]!==null){D=!1;break}return D}});var vO=z((OR1,yO)=>{var _7=1000,g7=_7*60,b7=g7*60,X9=b7*24,rA1=X9*7,tA1=X9*365.25;yO.exports=function(F,A){A=A||{};var B=typeof F;if(B==="string"&&F.length>0)return oA1(F);else if(B==="number"&&isFinite(F))return A.long?FB1(F):eA1(F);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(F))};function oA1(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 B=parseFloat(A[1]),D=(A[2]||"ms").toLowerCase();switch(D){case"years":case"year":case"yrs":case"yr":case"y":return B*tA1;case"weeks":case"week":case"w":return B*rA1;case"days":case"day":case"d":return B*X9;case"hours":case"hour":case"hrs":case"hr":case"h":return B*b7;case"minutes":case"minute":case"mins":case"min":case"m":return B*g7;case"seconds":case"second":case"secs":case"sec":case"s":return B*_7;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return B;default:return}}function eA1(F){var A=Math.abs(F);if(A>=X9)return Math.round(F/X9)+"d";if(A>=b7)return Math.round(F/b7)+"h";if(A>=g7)return Math.round(F/g7)+"m";if(A>=_7)return Math.round(F/_7)+"s";return F+"ms"}function FB1(F){var A=Math.abs(F);if(A>=X9)return oB(F,A,X9,"day");if(A>=b7)return oB(F,A,b7,"hour");if(A>=g7)return oB(F,A,g7,"minute");if(A>=_7)return oB(F,A,_7,"second");return F+" ms"}function oB(F,A,B,D){var J=A>=B*1.5;return Math.round(F/B)+" "+D+(J?"s":"")}});var mO=z((kR1,hO)=>{hO.exports=function F(A){let B=[],D="",J="DEFAULT";for(let Z=0;Z<A.length;++Z){if(J==="IN_SQUARE_BRACKETS"&&!/\d/.test(A[Z])&&A[Z]!=="]")J="DEFAULT",D=B[B.length-1]+"["+D,B.splice(B.length-1,1);if(A[Z]==="["){if(J!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")B.push(D),D="";J="IN_SQUARE_BRACKETS"}else if(A[Z]==="]")if(J==="IN_SQUARE_BRACKETS")J="IMMEDIATELY_AFTER_SQUARE_BRACKETS",B.push(D),D="";else J="DEFAULT",D+=A[Z];else if(A[Z]==="."){if(J!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")B.push(D),D="";J="DEFAULT"}else D+=A[Z]}if(J!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")B.push(D);return B}});var iO=z((AB1)=>{var d5=mO(),cO=["__proto__","constructor","prototype"];AB1.get=function(F,A,B,D){var J;if(typeof B=="function")if(B.length<2)D=B,B=void 0;else J=B,B=void 0;D||(D=pO);var Z=typeof F=="string"?d5(F):F;if(!Array.isArray(Z))throw new TypeError("Invalid `path`. Must be either string or array");var X=A,Y;for(var $=0;$<Z.length;++$){if(Y=Z[$],typeof Z[$]!=="string"&&typeof Z[$]!=="number")throw new TypeError("Each segment of path to `get()` must be a string or number, got "+typeof Z[$]);if(Array.isArray(X)&&!/^\d+$/.test(Y)){var G=Z.slice($);return[].concat(X).map(function(C){return C?AB1.get(G,C,B||J,D):D(void 0)})}if(J)X=J(X,Y);else{var E=B&&X[B]?X[B]:X;X=E instanceof Map?E.get(Y):E[Y]}if(!X)return D(X)}return D(X)};AB1.has=function(F,A){var B=typeof F==="string"?d5(F):F;if(!Array.isArray(B))throw new TypeError("Invalid `path`. Must be either string or array");var D=B.length,J=A;for(var Z=0;Z<D;++Z){if(typeof B[Z]!=="string"&&typeof B[Z]!=="number")throw new TypeError("Each segment of path to `has()` must be a string or number, got "+typeof B[Z]);if(J==null||typeof J!=="object"||!(B[Z]in J))return!1;J=J[B[Z]]}return!0};AB1.unset=function(F,A){var B=typeof F==="string"?d5(F):F;if(!Array.isArray(B))throw new TypeError("Invalid `path`. Must be either string or array");var D=B.length,J=A;for(var Z=0;Z<D;++Z){if(J==null||typeof J!=="object"||!(B[Z]in J))return!1;if(typeof B[Z]!=="string"&&typeof B[Z]!=="number")throw new TypeError("Each segment of path to `unset()` must be a string or number, got "+typeof B[Z]);if(cO.indexOf(B[Z])!==-1)return!1;if(Z===D-1)return delete J[B[Z]],!0;J=J instanceof Map?J.get(B[Z]):J[B[Z]]}return!0};AB1.set=function(F,A,B,D,J,Z){var X;if(typeof D=="function")if(D.length<2)J=D,D=void 0;else X=D,D=void 0;J||(J=pO);var Y=typeof F=="string"?d5(F):F;if(!Array.isArray(Y))throw new TypeError("Invalid `path`. Must be either string or array");if(B==null)return;for(var $=0;$<Y.length;++$){if(typeof Y[$]!=="string"&&typeof Y[$]!=="number")throw new TypeError("Each segment of path to `set()` must be a string or number, got "+typeof Y[$]);if(cO.indexOf(Y[$])!==-1)return}var G=Z||/\$/.test(F)&&Z!==!1,E=B,C;for(var $=0,H=Y.length-1;$<H;++$){if(C=Y[$],C=="$")if($==H-1)break;else continue;if(Array.isArray(E)&&!/^\d+$/.test(C)){var q=Y.slice($);if(!G&&Array.isArray(A))for(var W=0;W<E.length&&W<A.length;++W)AB1.set(q,A[W],E[W],D||X,J,G);else for(var W=0;W<E.length;++W)AB1.set(q,A,E[W],D||X,J,G);return}if(X)E=X(E,C);else{var K=D&&E[D]?E[D]:E;E=K instanceof Map?K.get(C):K[C]}if(!E)return}if(C=Y[H],D&&E[D])E=E[D];if(Array.isArray(E)&&!/^\d+$/.test(C))if(!G&&Array.isArray(A))lO(E,A,C,X,D,J);else for(var W=0;W<E.length;++W){var U=E[W];if(U)if(X)X(U,C,J(A));else{if(U[D])U=U[D];U[C]=J(A)}}else if(X)X(E,C,J(A));else if(E instanceof Map)E.set(C,J(A));else E[C]=J(A)};/*!
|
|
115
|
+
* Split a string path into components delimited by '.' or
|
|
116
|
+
* '[\d+]'
|
|
117
|
+
*
|
|
118
|
+
* #### Example:
|
|
119
|
+
* stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1']
|
|
120
|
+
*/AB1.stringToParts=d5;/*!
|
|
121
|
+
* Recursively set nested arrays
|
|
122
|
+
*/function lO(F,A,B,D,J,Z){for(var X,Y=0;Y<F.length&&Y<A.length;++Y)if(X=F[Y],Array.isArray(X)&&Array.isArray(A[Y]))lO(X,A[Y],B,D,J,Z);else if(X)if(D)D(X,B,Z(A[Y]));else{if(X[J])X=X[J];X[B]=Z(A[Y])}}/*!
|
|
123
|
+
* Returns the value passed to it.
|
|
124
|
+
*/function pO(F){return F}});var n2=z((nO,sO)=>{sO.exports=nO=iO()});var tO=z((xR1,rO)=>{var ZB1=Z0();class aO{constructor(F){if(this._docs={},this._childDocs=[],F==null)return;if(F=ZB1(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+"`.")}}rO.exports=aO});var oO=z((XB1)=>{XB1.isMongooseDocumentArray=function(F){return Array.isArray(F)&&F.isMongooseDocumentArray}});var eB=z((_R1,eO)=>{var $B1=r2(),y7=Symbol("mongoose#emitted");eO.exports=function F(A,B,D,J){if(typeof A==="function")try{return B(function(Z){if(Z!=null){if(D!=null&&D.listeners!=null&&D.listeners("error").length>0&&!Z[y7])Z[y7]=!0,D.emit("error",Z);try{A(Z)}catch(X){return $B1(()=>{throw X})}return}A.apply(this,arguments)})}catch(Z){if(D!=null&&D.listeners!=null&&D.listeners("error").length>0&&!Z[y7])Z[y7]=!0,D.emit("error",Z);return A(Z)}return J=J||global.Promise,new J((Z,X)=>{B(function(Y,$){if(Y!=null){if(D!=null&&D.listeners!=null&&D.listeners("error").length>0&&!Y[y7])Y[y7]=!0,D.emit("error",Y);return X(Y)}if(arguments.length>2)return Z(Array.prototype.slice.call(arguments,1));Z($)})})}});var FD=z((gR1,Fk)=>{Fk.exports=function F(A,B,D){let J=Object.keys(B.tree),Z={};for(let X of J){if(D&&(A.paths[X]||A.nested[X]||A.singleNestedPaths[X]))continue;Z[X]=B.tree[X]}A.options._isMerging=!0,A.add(Z,null),delete A.options._isMerging,A.callQueue=A.callQueue.concat(B.callQueue),A.method(B.methods),A.static(B.statics);for(let[X,Y]of Object.entries(B._userProvidedOptions))if(!(X in A._userProvidedOptions))A.set(X,Y);for(let X in B.query)A.query[X]=B.query[X];for(let X in B.virtuals)A.virtuals[X]=B.virtuals[X].clone();A._indexes=A._indexes.concat(B._indexes||[]),A.s.hooks.merge(B.s.hooks,!1)}});var Dk=z((Ak,Bk)=>{/*!
|
|
125
|
+
* Module dependencies.
|
|
126
|
+
*/var bR1=J1(),W6=Bk.exports=Ak=function F(){};W6.ctor=function(){let F=[...arguments],A=function(){W6.apply(this,arguments),this.paths={},this.states={}};return A.prototype=new W6,A.prototype.constructor=A,A.prototype.stateNames=F,F.forEach(function(B){A.prototype[B]=function(D){this._changeState(D,B)}}),A};W6.prototype._changeState=function F(A,B){let D=this.paths[A];if(D===B)return;let J=this.states[D];if(J)delete J[A];this.paths[A]=B,this.states[B]=this.states[B]||{},this.states[B][A]=!0};/*!
|
|
127
|
+
* ignore
|
|
128
|
+
*/W6.prototype.clear=function F(A){if(this.states[A]==null)return;let B=Object.keys(this.states[A]),D=B.length,J;while(D--)J=B[D],delete this.states[A][J],delete this.paths[J]};/*!
|
|
129
|
+
* ignore
|
|
130
|
+
*/W6.prototype.clearPath=function F(A){let B=this.paths[A];if(!B)return;delete this.paths[A],delete this.states[B][A]};W6.prototype.getStatePaths=function F(A){if(this.states[A]!=null)return this.states[A];return{}};W6.prototype.some=function F(){let A=this,B=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(B,function(D){if(A.states[D]==null)return!1;return Object.keys(A.states[D]).length})};W6.prototype._iter=function F(A){return function(){let B=[...arguments],D=B.pop();if(!B.length)B=this.stateNames;let J=this;return B.reduce(function(X,Y){if(J.states[Y]==null)return X;return X.concat(Object.keys(J.states[Y]))},[])[A](function(X,Y,$){return D(X,Y,$)})}};W6.prototype.forEach=function F(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)};W6.prototype.map=function F(){return this.map=this._iter("map"),this.map.apply(this,arguments)};W6.prototype.clone=function F(){let A=new this.constructor;A.paths={...this.paths};for(let B of this.stateNames){if(!(B in this.states))continue;A.states[B]=this.states[B]==null?this.states[B]:{...this.states[B]}}return A}});var Xk=z((Jk,Zk)=>{/*!
|
|
131
|
+
* Dependencies
|
|
132
|
+
*/var GB1=Dk(),EB1=GB1.ctor("require","modify","init","default","ignore");Zk.exports=Jk=E0;function E0(){this.activePaths=new EB1}E0.prototype.strictMode=!0;E0.prototype.fullPath=void 0;E0.prototype.selected=void 0;E0.prototype.shardval=void 0;E0.prototype.saveError=void 0;E0.prototype.validationError=void 0;E0.prototype.adhocPaths=void 0;E0.prototype.removing=void 0;E0.prototype.inserting=void 0;E0.prototype.saving=void 0;E0.prototype.version=void 0;E0.prototype._id=void 0;E0.prototype.ownerDocument=void 0;E0.prototype.populate=void 0;E0.prototype.populated=void 0;E0.prototype.primitiveAtomics=void 0;E0.prototype.wasPopulated=!1;E0.prototype.scope=void 0;E0.prototype.session=null;E0.prototype.pathsToScopes=null;E0.prototype.cachedRequired=null});var c5=z((yR1,Gk)=>{/*!
|
|
133
|
+
* Module dependencies.
|
|
134
|
+
*/var OE=l6().Binary,Yk=J1();function u2(F,A,B){let D=F;if(F==null)D=0;let J,Z,X;if(Array.isArray(A))Z=A[0],X=A[1];else J=A;let Y;if(typeof D==="number"||D instanceof Number)Y=Buffer.alloc(D);else Y=Buffer.from(D,J,B);return Yk.decorate(Y,u2.mixin),Y.isMongooseBuffer=!0,Y[u2.pathSymbol]=Z,Y[$k]=X,Y._subtype=0,Y}var CB1=Symbol.for("mongoose#Buffer#_path"),$k=Symbol.for("mongoose#Buffer#_parent");u2.pathSymbol=CB1;/*!
|
|
135
|
+
* Inherit from Buffer.
|
|
136
|
+
*/u2.mixin={_subtype:void 0,_markModified:function(){let F=this[$k];if(F)F.markModified(this[u2.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}};/*!
|
|
137
|
+
* Compile other Buffer methods marking this buffer as modified.
|
|
138
|
+
*/Yk.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;u2.mixin[F]=function(){let A=Buffer.prototype[F].apply(this,arguments);return this._markModified(),A}});u2.mixin.toObject=function(F){let A=typeof F==="number"?F:this._subtype||0;return new OE(Buffer.from(this),A)};u2.mixin.$toObject=u2.mixin.toObject;u2.mixin.toBSON=function(){return new OE(this,this._subtype||0)};u2.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};u2.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};/*!
|
|
139
|
+
* Module exports.
|
|
140
|
+
*/u2.Binary=OE;Gk.exports=u2});var Y9=z((HB1)=>{HB1.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed");HB1.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")});var $9=z((hR1,Ek)=>{/*!
|
|
141
|
+
* Module dependencies.
|
|
142
|
+
*/var AD=M0(),KB1=Y9(),zB1=K4(),UB1=J1();function h6(F,A){if(A&&A.default){let B=A.default;if(Array.isArray(B)&&B.length===0)A.default=Array;else if(!A.shared&&zB1(B)&&Object.keys(B).length===0)A.default=function(){return{}}}AD.call(this,F,A,"Mixed"),this[KB1.schemaMixedSymbol]=!0}h6.schemaName="Mixed";h6.defaultOptions={};/*!
|
|
143
|
+
* Inherits from SchemaType.
|
|
144
|
+
*/h6.prototype=Object.create(AD.prototype);h6.prototype.constructor=h6;h6.get=AD.get;h6.set=AD.set;h6.setters=[];h6.prototype.cast=function(F){if(F instanceof Error)return UB1.errorToPOJO(F);return F};h6.prototype.castForQuery=function(F,A){return A};/*!
|
|
145
|
+
* Module exports.
|
|
146
|
+
*/Ek.exports=h6});var Hk=z((mR1,Ck)=>{Ck.exports=class F{constructor(A,B,D){this.subdocSnapshot=A,this.activePaths=B,this.version=D}}});var SE=z((dR1,qk)=>{/*!
|
|
147
|
+
* Module dependencies.
|
|
148
|
+
*/var QB1=C1();class kE extends QB1{constructor(F,A){let B=Array.isArray(A)?"array":"primitive value";super("Tried to set nested object field `"+F+`\` to ${B} \``+A+"`");this.path=F}}Object.defineProperty(kE.prototype,"name",{value:"ObjectExpectedError"});qk.exports=kE});var BD=z((cR1,Wk)=>{/*!
|
|
149
|
+
* Module dependencies.
|
|
150
|
+
*/var LB1=C1();class xE extends LB1{constructor(F,A,B){super('Parameter "'+A+'" to '+B+'() must be an object, got "'+F.toString()+'" (type '+typeof F+")")}}Object.defineProperty(xE.prototype,"name",{value:"ObjectParameterError"});Wk.exports=xE});var zk=z((lR1,Kk)=>{/*!
|
|
151
|
+
* Module dependencies.
|
|
152
|
+
*/var VB1=C1();class fE extends VB1{constructor(F){super("Can't validate() the same doc multiple times in parallel. Document: "+F._doc._id)}}Object.defineProperty(fE.prototype,"name",{value:"ParallelValidateError"});/*!
|
|
153
|
+
* exports
|
|
154
|
+
*/Kk.exports=fE});var _E=z((pR1,Uk)=>{Uk.exports=function F(A){let B={},D=Object.keys(A);for(let J of D){if(J.indexOf(".")===-1){B[J]=1;continue}let Z=J.split("."),X=Z[0];for(let Y=0;Y<Z.length;++Y)if(B[X]=1,Y+1<Z.length)X=X+"."+Z[Y+1]}return B}});var Lk=z((iR1,Qk)=>{Qk.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 DD=z((nR1,Vk)=>{var RB1=Lk();Vk.exports=function F(A,B,D,J,Z,X,Y){let $=Object.keys(A.$__schema.paths),G=$.length,E=Y&&Y.skipParentChangeTracking;for(let C=0;C<G;++C){let H,q="",W=$[C];if(W==="_id"&&A.$__.skipId)continue;let K=A.$__schema.paths[W],U=K.splitPath(),Q=U.length,L=!1,V=A._doc;for(let w=0;w<Q;++w){if(V==null)break;let j=U[w];if(q+=(!q.length?"":".")+j,D===!0){if(q in B)break}else if(D===!1&&B&&!L){let T=K.$isSingleNested||K.$isMongooseDocumentArray;if(q in B&&!RB1(B[q])||w===Q-1&&T&&J!=null&&J[q])L=!0;else if(J!=null&&!J[q])break}if(w===Q-1){if(V[j]!==void 0)break;if(Z!=null){if(typeof K.defaultValue==="function"){if(!K.defaultValue.$runBeforeSetters&&Z)break;if(K.defaultValue.$runBeforeSetters&&!Z)break}else if(!Z)continue}if(X&&X[q])break;if(B&&D!==null){if(D===!0){if(W in B)continue;try{H=K.getDefault(A,!1)}catch(T){A.invalidate(W,T);break}if(typeof H!=="undefined")V[j]=H,gE(A,W,E)}else if(L){try{H=K.getDefault(A,!1)}catch(T){A.invalidate(W,T);break}if(typeof H!=="undefined")V[j]=H,gE(A,W,E)}}else{try{H=K.getDefault(A,!1)}catch(T){A.invalidate(W,T);break}if(typeof H!=="undefined")V[j]=H,gE(A,W,E)}}else V=V[j]}}};/*!
|
|
155
|
+
* ignore
|
|
156
|
+
*/function gE(F,A,B){if(F.$__.activePaths.default(A),!B&&F.$isSubdocument&&F.$isSingleNested&&F.$parent()!=null)F.$parent().$__.activePaths.default(F.$__pathRelativeToParent(A))}});var bE=z((sR1,wk)=>{/*!
|
|
157
|
+
* ignore
|
|
158
|
+
*/wk.exports=function F(A,B,D){D=D||{};let J=D.skipDocArrays,Z=0;if(!A)return Z;for(let X of Object.keys(A.$__.activePaths.getStatePaths("modify"))){if(J){let Y=A.$__schema.path(X);if(Y&&Y.$isMongooseDocumentArray)continue}if(X.startsWith(B+".")){if(A.$__.activePaths.clearPath(X),++Z,A.$isSubdocument)Rk(A,X)}}return Z};function Rk(F,A,B=new Set){if(B.has(F))throw new Error("Infinite subdocument loop: subdoc with _id "+F._id+" is a parent of itself");let D=F.$parent(),J=F.$__pathRelativeToParent(void 0,!1)+"."+A;if(D.$__.activePaths.clearPath(J),D.$isSubdocument)Rk(D,J,B)}});var ZD=z((OB1)=>{var wB1=Z0(),IB1=o().documentSchemaSymbol,NB1=y6().internalToObjectOptions,PB1=J1(),v7,MB1=o().getSymbol,JD=o().scopeSymbol,Ik=PB1.isPOJO;/*!
|
|
159
|
+
* exports
|
|
160
|
+
*/OB1.compile=Nk;OB1.defineKey=Pk;var TB1=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),jB1=Object.freeze({noDottedPath:!0});function Nk(F,A,B,D){v7=v7||O2();let J=D.typeKey;for(let Z of Object.keys(F)){let X=F[Z],$=Ik(X)&&Object.keys(X).length>0&&(!X[J]||J==="type"&&Ik(X.type)&&X.type.type)?X:null;Pk({prop:Z,subprops:$,prototype:A,prefix:B,options:D})}}function Pk({prop:F,subprops:A,prototype:B,prefix:D,options:J}){v7=v7||O2();let Z=(D?D+".":"")+F;D=D||"";let X=D?Object.freeze({}):jB1;if(A)Object.defineProperty(B,F,{enumerable:!0,configurable:!0,get:function(){let Y=this;if(!this.$__.getters)this.$__.getters={};if(!this.$__.getters[Z]){let $=Object.create(v7.prototype,uB1(this));if(!D)$.$__[JD]=this;$.$__.nestedPath=Z,Object.defineProperty($,"schema",{enumerable:!1,configurable:!0,writable:!1,value:B.schema}),Object.defineProperty($,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:B.schema}),Object.defineProperty($,IB1,{enumerable:!1,configurable:!0,writable:!1,value:B.schema}),Object.defineProperty($,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return wB1(Y.get(Z,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty($,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Y.get(Z,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null})}}),Object.defineProperty($,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Y.get(Z,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toJSON&&this.schema.options.toJSON.virtuals||null})}}),Object.defineProperty($,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty($,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Object.keys(this.get(Z,null,TB1)||{}).length===0}}),Object.defineProperty($,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),Nk(A,$,Z,J),this.$__.getters[Z]=$}return this.$__.getters[Z]},set:function(Y){if(Y!=null&&Y.$__isNested)Y=Y.$__get();else if(Y instanceof v7&&!Y.$__isNested)Y=Y.$toObject(NB1);(this.$__[JD]||this).$set(Z,Y)}});else Object.defineProperty(B,F,{enumerable:!0,configurable:!0,get:function(){return this[MB1].call(this.$__[JD]||this,Z,null,X)},set:function(Y){this.$set.call(this.$__[JD]||this,Z,Y)}})}function uB1(F){let A={};return Object.getOwnPropertyNames(F).forEach(function(B){if(["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(B)===-1)return;A[B]=Object.getOwnPropertyDescriptor(F,B),A[B].enumerable=!1}),A}});var Tk=z((rR1,Mk)=>{Mk.exports=function F(A){if(A==null)return null;return Object.keys(A)[0]}});var h7=z((gB1)=>{/*!
|
|
161
|
+
* Module dependencies.
|
|
162
|
+
*/var xB1=l6().Binary,jk=H2(),uk=g5(),fB1=W2(),_B1=import.meta.require("util");gB1.flatten=Ok;gB1.modifiedPaths=kk;/*!
|
|
163
|
+
* ignore
|
|
164
|
+
*/function Ok(F,A,B,D){let J;if(F&&uk(F)&&!Buffer.isBuffer(F))J=Object.keys(F.toObject({transform:!1,virtuals:!1})||{});else J=Object.keys(F||{});let Z=J.length,X={};A=A?A+".":"";for(let Y=0;Y<Z;++Y){let $=J[Y],G=F[$];X[A+$]=G;let E=D&&D.path&&D.path(A+$),C=D&&D.nested&&D.nested[A+$];if(E&&E.instance==="Mixed")continue;if(Sk(G)){if(B&&B.skipArrays&&Array.isArray(G))continue;let H=Ok(G,A+$,B,D);for(let q in H)X[q]=H[q];if(Array.isArray(G))X[A+$]=G}if(C){let H=Object.keys(D.paths);for(let q of H)if(q.startsWith(A+$+".")&&!X.hasOwnProperty(q))X[q]=void 0}}return X}/*!
|
|
165
|
+
* ignore
|
|
166
|
+
*/function kk(F,A,B,D=null){if(F==null||typeof F!=="object")return;if(D==null)D={raw:{update:F,path:A},trace:new WeakSet};if(D.trace.has(F))throw new fB1(`a circular reference in the update value, updateValue:
|
|
167
|
+
${_B1.inspect(D.raw.update,{showHidden:!1,depth:1})}
|
|
168
|
+
updatePath: '${D.raw.path}'`);D.trace.add(F);let J=Object.keys(F||{}),Z=J.length;B=B||{},A=A?A+".":"";for(let X=0;X<Z;++X){let Y=J[X],$=F[Y],G=A+Y;if(B[G]=!0,!Buffer.isBuffer($)&&uk($))$=$.toObject({transform:!1,virtuals:!1});if(Sk($))kk($,A+Y,B,D)}return D.trace.delete(F),B}/*!
|
|
169
|
+
* ignore
|
|
170
|
+
*/function Sk(F){return F&&typeof F==="object"&&!(F instanceof Date)&&!jk(F,"ObjectId")&&(!Array.isArray(F)||F.length!==0)&&!(F instanceof Buffer)&&!jk(F,"Decimal128")&&!(F instanceof xB1)}});var C0=z((oR1,xk)=>{xk.exports=function F(A,B,D){let J,Z=!1;if(typeof B==="string"){if(B.indexOf(".")===-1){let $=yE(A,B);if($==null)return D;return $}J=B.split(".")}else if(Z=!0,J=B,J.length===1){let $=yE(A,J[0]);if($==null)return D;return $}let X=B,Y=A;for(let $ of J){if(Y==null)return D;if(!Z&&Y[X]!=null)return Y[X];if(Y=yE(Y,$),!Z)X=X.substr($.length+1)}return Y==null?D:Y};function yE(F,A){if(F==null)return F;if(F instanceof Map)return F.get(A);return F[A]}});var vE=z((eR1,_k)=>{var fk=H2();_k.exports=function F(A,B){if(typeof A==="string"&&typeof B==="string")return A===B;if(typeof A==="number"&&typeof B==="number")return A===B;if(fk(A,"ObjectId")&&fk(B,"ObjectId"))return A.toString()===B.toString();return!1}});var XD=z((Fw1,gk)=>{var vB1=vE();gk.exports=function F(A,B){if(A==null||A.discriminators==null)return null;for(let D of Object.keys(A.discriminators)){let J=A.discriminators[D];if(J.discriminatorMapping==null)continue;if(vB1(J.discriminatorMapping.value,B))return J}return null}});var yk=z((Aw1,bk)=>{var hB1=C0(),mB1=XD();bk.exports=function F(A,B,D){D=D||{};let J=D.typeOnly,Z=Array.isArray(B)?B:B.indexOf(".")===-1?[B]:B.split("."),X=null,Y="adhocOrUndefined",$=mB1(A.schema,A.get(A.schema.options.discriminatorKey))||A.schema;for(let G=0;G<Z.length;++G){let E=Z.slice(0,G+1).join(".");if(X=$.path(E),X==null){Y="adhocOrUndefined";continue}if(X.instance==="Mixed")return J?"real":X;if(Y=$.pathType(E),(X.$isSingleNested||X.$isMongooseDocumentArrayElement)&&X.schema.discriminators!=null){let C=X.schema.discriminators,H=A.get(E+"."+hB1(X,"schema.options.discriminatorKey"));if(H==null||C[H]==null)continue;let q=Z.slice(G+1).join(".");return F(A.get(E),q,D)}}return J?Y:X}});var hk=z((Bw1,vk)=>{var dB1=C0();vk.exports=function F(A,B,D){let J=D!=null?Object.keys(dB1(A.tree,D,{})):Object.keys(A.tree),Z=new Set(Object.keys(B)),X;if(Z.size>1){X=new Set;for(let Y of J)if(Z.has(Y))X.add(Y);for(let Y of Z)if(!X.has(Y))X.add(Y);X=Array.from(X)}else X=Array.from(Z);return X}});var dk=z((Dw1,mk)=>{mk.exports=function F(A,B){if(B.length===1)return;let D=B[0],J=void 0;for(let Z=0;Z<B.length-1;++Z){let X=A.path(D);if(X&&X.schema)J=X.schema.options.strict,A=X.schema,D=X.$isMongooseDocumentArray&&!isNaN(B[Z+1])?"":B[Z+1];else D+=D.length?"."+B[Z+1]:B[Z+1]}return J}});var YD=z((Jw1,ck)=>{var cB1=J1(),lB1=new Set(["__index","__parentArray","_doc"]);ck.exports=function F(A,B){if(cB1.isPOJO(A)&&A.$__!=null&&A._doc!=null){if(B){let D={};for(let J of Object.keys(A)){if(typeof J==="symbol")continue;if(J[0]==="$")continue;if(lB1.has(J))continue;D[J]=A[J]}return{...A._doc,...D}}return A._doc}return A}});var m7=z((Zw1,lk)=>{/*!
|
|
171
|
+
* ignore
|
|
172
|
+
*/lk.exports=function F(A){if(A==null)return!0;if(typeof A==="object")return!("$meta"in A)&&!("$slice"in A);return!0}});var d7=z((Xw1,pk)=>{var pB1=m7(),iB1=O7();/*!
|
|
173
|
+
* ignore
|
|
174
|
+
*/pk.exports=function F(A){if(A==null)return null;let B=Object.keys(A),D=null;if(B.length===1&&B[0]==="_id")D=!A._id;else for(let J=0;J<B.length;++J){let Z=B[J];if(Z!=="_id"&&pB1(A[Z])){if(D=iB1(A[Z])?F(A[Z])??D:!A[Z],D!=null)break}}return D}});var hE=z((Yw1,ik)=>{var nB1=m7();ik.exports=function F(A,B){if(A==null)return!1;if(B==="_id")return A._id===0;let D=Object.keys(A),J=null;for(let Z of D)if(nB1(A[Z])){J=A[B]===1?"inclusive":"exclusive";break}if(J==="inclusive")return A[B]!==1;if(J==="exclusive")return A[B]===0;return!1}});var mE=z(($w1,nk)=>{var sB1=J1();nk.exports=function F(A,B){if(A._doc._id==null||B==null||B.length===0)return;let D=String(A._doc._id);for(let J of B){if(J.isVirtual)continue;let X=J.path.split(".");for(let Y=0;Y<X.length-1;++Y){let $=X.slice(0,Y+1).join("."),G=X.slice(Y+1).join("."),E=A.get($);if(E==null)continue;if(sB1.isMongooseDocumentArray(E)){for(let C=0;C<E.length;++C)if(E[C])E[C].populated(G,J._docs[D]==null?void 0:J._docs[D][C],J);break}}}}});var dE=z((Gw1,ak)=>{var{isPOJO:aB1}=J1();ak.exports=sk;function sk(F){let A=Object.keys(F),B=A.length,D,J,Z;while(B--){if(J=A[B],Z=F[J],aB1(Z))F[J]=sk(Z);if(F[J]===void 0){delete F[J];continue}D=!0}return D?F:void 0}});var cE=z((Ew1,rk)=>{var rB1=/\./g;rk.exports=function F(A){if(A.indexOf(".")===-1)return[A];let B=A.split(rB1),D=B.length,J=new Array(D),Z="";for(let X=0;X<D;++X)Z+=Z.length!==0?"."+B[X]:B[X],J[X]=Z;return J}});var ok=z((Cw1,tk)=>{tk.exports=function F(A,B,D,J,Z){let X=Object.keys(A).reduce(($,G)=>$||G.startsWith(B+"."),!1),Y=B+"."+D.options.discriminatorKey;if(!X&&Z.length===1&&Z[0]===Y)J.splice(J.indexOf(Y),1)}});var K6=z((Hw1,ek)=>{var tB1=vE();ek.exports=function F(A,B){if(A==null)return null;for(let D of Object.keys(A)){let J=A[D];if(J.schema&&J.schema.discriminatorMapping&&tB1(J.schema.discriminatorMapping.value,B))return J}return null}});var $D=z((qw1,FS)=>{/*!
|
|
175
|
+
* ignore
|
|
176
|
+
*/FS.exports=function F(A,B){let D=B.split("."),J="",Z,X,Y;for(let $=0;$<D.length;++$)if(J+=J.length?".":""+D[$],A[J]){X=Object.keys(A),Y=X.length;for(Z=0;Z<Y;++Z)if(X[$].indexOf(J+".")===0&&X[$].indexOf(B)!==0)continue;return!0}return!1}});var l5=z((DD1)=>{/*!
|
|
177
|
+
* Module dependencies
|
|
178
|
+
*/var oB1=ok(),AS=C0(),eB1=K6(),FD1=m7(),AD1=Z0(),BD1=$D();DD1.preparePopulationOptions=function F(A,B){let D=A.options.populate,J=Object.keys(D).reduce((Z,X)=>Z.concat([D[X]]),[]);if(B.lean!=null)J.filter((Z)=>(Z&&Z.options&&Z.options.lean)==null).forEach(BS(B.lean));return J.forEach((Z)=>{Z._localModel=A.model}),J};DD1.preparePopulationOptionsMQ=function F(A,B){let D=A._mongooseOptions.populate,J=Object.keys(D).reduce((Y,$)=>Y.concat([D[$]]),[]);if(B.lean!=null)J.filter((Y)=>(Y&&Y.options&&Y.options.lean)==null).forEach(BS(B.lean));let Z=A&&A.options&&A.options.session||null;if(Z!=null)J.forEach((Y)=>{if(Y.options==null){Y.options={session:Z};return}if(!("session"in Y.options))Y.options.session=Z});let X=A._fieldsForExec();return J.forEach((Y)=>{Y._queryProjection=X}),J.forEach((Y)=>{Y._localModel=A.model}),J};DD1.createModel=function F(A,B,D,J,Z){A.hooks.execPreSync("createModel",B);let X=A.schema?A.schema.discriminatorMapping:null,Y=X&&X.isRoot?X.key:null,$=B[Y];if(Y&&$&&A.discriminators){let E=A.discriminators[$]||eB1(A.discriminators,$);if(E){let C=AD1(J);return DD1.applyPaths(C,E.schema),new E(void 0,C,!0)}}let G={skipId:!0,isNew:!1,willInit:!0};if(Z!=null&&"defaults"in Z)G.defaults=Z.defaults;return new A(void 0,D,G)};/*!
|
|
179
|
+
* ignore
|
|
180
|
+
*/DD1.createModelAndInit=function F(A,B,D,J,Z,X,Y){let $=X?{populated:X}:void 0,G=DD1.createModel(A,B,D,J,Z);try{G.$init(B,$,Y)}catch(E){Y(E,G)}};/*!
|
|
181
|
+
* ignore
|
|
182
|
+
*/DD1.applyPaths=function F(A,B,D){let J,Z,X=new Set;if(A){Z=Object.keys(A);let H=[];for(let q=0;q<Z.length;++q){let W=Z[q];if(Z[q][0]!=="-")continue;if(delete A[W],W==="-_id")A._id=0;else H.push(W.slice(1))}Z=Object.keys(A);for(let q=0;q<Z.length;++q){if(Z[q][0]==="+")continue;let W=A[Z[q]];if(!FD1(W))continue;if(Z[q]==="_id"&&Z.length>1)continue;if(Z[q]===B.options.discriminatorKey&&Z.length>1&&W!=null&&!W)continue;J=!W;break}for(let q of H){let W=B.path(q);if(!W||!W.selected||J!==!1)A[q]=0,J=!0;else if(W&&W.selected&&J===!1)X.add(q)}}let Y=[],$=[],G=[];switch(E(B),J){case!0:for(let H of $)A[H]=0;break;case!1:if(B&&B.paths._id&&B.paths._id.options&&B.paths._id.options.select===!1)A._id=0;for(let H of Y){if(X.has(H))continue;if(BD1(A,H))continue;A[H]=A[H]||1}break;case void 0:if(A==null)break;for(let H of Object.keys(A||{}))if(H.startsWith("+"))delete A[H];for(let H of $){if(A[H]!=null)continue;A[H]=0}break}function E(H,q){if(q||(q=""),G.indexOf(H)!==-1)return[];G.push(H);let W=[];return H.eachPath(function(K,U){if(q)K=q+"."+K;if(U.$isSchemaMap||K.endsWith(".$*")){let L="+"+K,V=A&&L in A;if(U.options&&U.options.select===!1&&!V)$.push(K);return}let Q=C(K,U);if(Q==null&&!Array.isArray(U)&&U.$isMongooseArray&&!U.$isMongooseDocumentArray)Q=C(K,U.caster);if(Q!=null)W.push(Q);if(U.schema){let L=E(U.schema,K);if(J===!1)oB1(A,K,U.schema,Y,L)}}),G.pop(),W}function C(H,q){if(A==null)return;if(typeof q.selected!=="boolean")return;if(q.selected===!1&&A[H]){if(D)A[H]=0;return}if(!J&&q.selected&&H===B.options.discriminatorKey&&A[H]!=null&&!A[H]){delete A[H];return}if(J===!1&&q.selected&&A[H]!=null&&!A[H]){delete A[H];return}let W="+"+H;if(A&&W in A){if(delete A[W],J===!1&&Z.length>1&&!~Z.indexOf(H)&&!D)A[H]=1;else if(J==null&&D&&q.selected===!1)A[H]=0;return}let U=H.split("."),Q="";for(let L=0;L<U.length;++L)if(Q+=Q.length?"."+U[L]:U[L],$.indexOf(Q)!==-1)return;if(!J&&(q&&q.options&&q.options.$skipDiscriminatorCheck||!1)){let L="";for(let V=0;V<U.length;++V){L+=(L.length===0?"":".")+U[V];let w=AS(A,L,!1)||AS(A,L+".$",!1);if(w&&typeof w!=="object")return}}return(q.selected?Y:$).push(H),H}};function BS(F){return function(A){if(A.options||(A.options={}),F!=null&&Array.isArray(F.virtuals))F=Object.assign({},F),F.virtuals=F.virtuals.filter((B)=>typeof B==="string"&&B.startsWith(A.path+".")).map((B)=>B.slice(A.path.length+1));A.options.lean=F}}});var ZS=z((Kw1,JS)=>{function $D1(F){return!!F&&(typeof F==="object"||typeof F==="function")&&typeof F.then==="function"}JS.exports=$D1});var YS=z((zw1,XS)=>{XS.exports=function F(A,B,D){let J=B[0],Z=D,X=A;for(let Y=0;Y<B.length-1;++Y){let $=Z.path(J);if($&&$.schema){let G=X.get(J);if(Z=$.schema,J=B[Y+1],Array.isArray(G)&&!isNaN(J))G=G[J],J="";if(G==null)break;X=G}else J+=J.length?"."+B[Y+1]:B[Y+1]}return X}});var GD=z((Uw1,GS)=>{var U4=O2(),GD1=r2(),ED1=y6().internalToObjectOptions,$S=import.meta.require("util"),CD1=J1();GS.exports=c1;function c1(F,A,B,D,J){if(typeof D==="object"&&D!=null&&J==null)J=D,D=void 0;if(B!=null){let Z={isNew:B.isNew};if("defaults"in B.$__)Z.defaults=B.$__.defaults;J=Object.assign(Z,J)}if(J!=null&&J.path!=null)this.$basePath=J.path;U4.call(this,F,A,D,J),delete this.$__.priorDoc}c1.prototype=Object.create(U4.prototype);Object.defineProperty(c1.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0});Object.defineProperty(c1.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0});/*!
|
|
183
|
+
* ignore
|
|
184
|
+
*/c1.prototype.toBSON=function(){return this.toObject(ED1)};c1.prototype.save=async function F(A){if(A=A||{},!A.suppressWarning)CD1.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((B,D)=>{this.$__save((J)=>{if(J!=null)return D(J);B(this)})})};c1.prototype.$__fullPath=function(F){if(!this.$__.fullPath)this.ownerDocument();return F?this.$__.fullPath+"."+F:this.$__.fullPath};c1.prototype.$__pathRelativeToParent=function(F){if(F==null)return this.$basePath;return[this.$basePath,F].join(".")};c1.prototype.$__save=function(F){return GD1(()=>F(null,this))};/*!
|
|
185
|
+
* ignore
|
|
186
|
+
*/c1.prototype.$isValid=function(F){let A=this.$parent(),B=this.$__pathRelativeToParent(F);if(A!=null&&B!=null)return A.$isValid(B);return U4.prototype.$isValid.call(this,F)};/*!
|
|
187
|
+
* ignore
|
|
188
|
+
*/c1.prototype.markModified=function(F){U4.prototype.markModified.call(this,F);let A=this.$parent(),B=this.$__pathRelativeToParent(F);if(A==null||B==null)return;let D=this.$__pathRelativeToParent().replace(/\.$/,"");if(A.isDirectModified(D)||this.isNew)return;this.$__parent.markModified(B,this)};/*!
|
|
189
|
+
* ignore
|
|
190
|
+
*/c1.prototype.isModified=function(F,A,B){let D=this.$parent();if(D!=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 D.$isModified(F,A,B)}return U4.prototype.isModified.call(this,F,A,B)};c1.prototype.$markValid=function(F){U4.prototype.$markValid.call(this,F);let A=this.$parent(),B=this.$__pathRelativeToParent(F);if(A!=null&&B!=null)A.$markValid(B)};/*!
|
|
191
|
+
* ignore
|
|
192
|
+
*/c1.prototype.invalidate=function(F,A,B){U4.prototype.invalidate.call(this,F,A,B);let D=this.$parent(),J=this.$__pathRelativeToParent(F);if(D!=null&&J!=null)D.invalidate(J,A,B);else if(A.kind==="cast"||A.name==="CastError"||J==null)throw A;return this.ownerDocument().$__.validationError};/*!
|
|
193
|
+
* ignore
|
|
194
|
+
*/c1.prototype.$ignore=function(F){U4.prototype.$ignore.call(this,F);let A=this.$parent(),B=this.$__pathRelativeToParent(F);if(A!=null&&B!=null)A.$ignore(B)};c1.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;let F=this,A=[],B=new Set([F]);while(!0){if(typeof F.$__pathRelativeToParent!=="function")break;A.unshift(F.$__pathRelativeToParent(void 0,!0));let D=F.$parent();if(D==null)break;if(F=D,B.has(F))throw new Error("Infinite subdocument loop: subdoc with _id "+F._id+" is a parent of itself");B.add(F)}return this.$__.fullPath=A.join("."),this.$__.ownerDocument=F,this.$__.ownerDocument};/*!
|
|
195
|
+
* ignore
|
|
196
|
+
*/c1.prototype.$__fullPathWithIndexes=function(){let F=this,A=[],B=new Set([F]);while(!0){if(typeof F.$__pathRelativeToParent!=="function")break;A.unshift(F.$__pathRelativeToParent(void 0,!1));let D=F.$parent();if(D==null)break;if(F=D,B.has(F))throw new Error("Infinite subdocument loop: subdoc with _id "+F._id+" is a parent of itself");B.add(F)}return A.join(".")};c1.prototype.parent=function(){return this.$__parent};c1.prototype.$parent=c1.prototype.parent;c1.prototype.$__deleteOne=function(F){if(F==null)return;return F(null,this)};c1.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)};c1.prototype.deleteOne=function(F,A){if(typeof F==="function")A=F,F=null;if(HD1(this),!F||!F.noop){this.$__removeFromParent();let B=this.ownerDocument();B.$__.removedSubdocs=B.$__.removedSubdocs||[],B.$__.removedSubdocs.push(this)}return this.$__deleteOne(A)};/*!
|
|
197
|
+
* ignore
|
|
198
|
+
*/c1.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")`')};c1.prototype.inspect=function(){return this.toObject()};if($S.inspect.custom)c1.prototype[$S.inspect.custom]=c1.prototype.inspect;function HD1(F){let A=F.ownerDocument();function B(){A.$removeListener("save",B),A.$removeListener("deleteOne",B),F.emit("deleteOne",F),F.constructor.emit("deleteOne",F)}A.$on("save",B),A.$on("deleteOne",B)}});var c7=z((Qw1,HS)=>{/*!
|
|
199
|
+
* Module dependencies.
|
|
200
|
+
*/var ES=import.meta.require("events").EventEmitter,CS=GD(),qD1=J1(),p5=o().documentArrayParent;function k2(F,A,B,D,J){if(qD1.isMongooseDocumentArray(A))this.__parentArray=A,this[p5]=A.$parent();else this.__parentArray=void 0,this[p5]=void 0;this.$setIndex(J),this.$__parent=this[p5];let Z;if(typeof B==="object"&&B!=null)Z={isNew:!0,...B},B=void 0;else Z={isNew:!0};CS.call(this,F,D,this[p5],B,Z)}/*!
|
|
201
|
+
* Inherit from Subdocument
|
|
202
|
+
*/k2.prototype=Object.create(CS.prototype);k2.prototype.constructor=k2;Object.defineProperty(k2.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1});Object.defineProperty(k2.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0});for(let F in ES.prototype)k2[F]=ES.prototype[F];/*!
|
|
203
|
+
* ignore
|
|
204
|
+
*/k2.prototype.$setIndex=function(F){if(this.__index=F,this.$__!=null&&this.$__.validationError!=null){let A=Object.keys(this.$__.validationError.errors);for(let B of A)this.invalidate(B,this.$__.validationError.errors[B])}};/*!
|
|
205
|
+
* ignore
|
|
206
|
+
*/k2.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")`')};/*!
|
|
207
|
+
* ignore
|
|
208
|
+
*/k2.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})};k2.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};k2.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};k2.prototype.$parent=function(){return this[p5]};k2.prototype.parentArray=function(){return this.__parentArray};/*!
|
|
209
|
+
* Module exports.
|
|
210
|
+
*/HS.exports=k2});var HD=z((Lw1,VS)=>{var iE=O2(),lE=c7(),WD1=C1(),qS=bE(),KD1=Z0(),WS=y6().internalToObjectOptions,US=n2(),o0=J1(),pE=H2(),u3=o().arrayAtomicsSymbol,O3=o().arrayParentSymbol,k3=o().arrayPathSymbol,S2=o().arraySchemaSymbol,QS=o().populateModelSymbol,zD1=Symbol("mongoose#Array#sliced"),KS=Array.prototype.push;/*!
|
|
211
|
+
* ignore
|
|
212
|
+
*/var CD={$__getAtomics(){let F=[],A=Object.keys(this[u3]||{}),B=A.length,D=Object.assign({},WS,{_isNested:!0});if(B===0)return F[0]=["$set",this.toObject(D)],F;while(B--){let J=A[B],Z=this[u3][J];if(o0.isMongooseObject(Z))Z=Z.toObject(D);else if(Array.isArray(Z))Z=this.toObject.call(Z,D);else if(Z!=null&&Array.isArray(Z.$each))Z.$each=this.toObject.call(Z.$each,D);else if(Z!=null&&typeof Z.valueOf==="function")Z=Z.valueOf();if(J==="$addToSet")Z={$each:Z};F.push([J,Z])}return F},$atomics(){/*!
|
|
213
|
+
* ignore
|
|
214
|
+
*/return this[u3]},$parent(){/*!
|
|
215
|
+
* ignore
|
|
216
|
+
*/return this[O3]},$path(){/*!
|
|
217
|
+
* ignore
|
|
218
|
+
*/return this[k3]},$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(){/*!
|
|
219
|
+
* ignore
|
|
220
|
+
*/return this[S2]},_cast(F){let A=!1,B,D=this[O3];if(D)A=D.$populated(this[k3],!0);if(A&&F!==null&&F!==void 0){if(B=A.options[QS],B==null)throw new WD1("No populated model found for path `"+this[k3]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");if(Buffer.isBuffer(F)||pE(F,"ObjectId")||!o0.isObject(F))F={_id:F};if(!(F.schema&&F.schema.discriminatorMapping&&F.schema.discriminatorMapping.key!==void 0))F=new B(F);return this[S2].caster.applySetters(F,D,!0)}return this[S2].caster.applySetters(F,D,!1)},_mapCast(F,A){return this._cast(F,this.length+A)},_markModified(F){let A=this[O3],B;if(A){if(B=this[k3],arguments.length)B=B+"."+F;if(B!=null&&B.endsWith(".$"))return this;A.markModified(B,arguments.length!==0?F:A)}return this},_registerAtomic(F,A){if(this[zD1])return;if(F==="$set")return this[u3]={$set:A},qS(this[O3],this[k3]),this._markModified(),this;let B=this[u3];if(F==="$pop"&&!("$pop"in B)){let J=this;this[O3].once("save",function(){J._popped=J._shifted=null})}if(B.$set||Object.keys(B).length&&!(F in B))return this[u3]={$set:this},this;let D;if(F==="$pullAll"||F==="$addToSet")B[F]||(B[F]=[]),B[F]=B[F].concat(A);else if(F==="$pullDocs"){let J=B.$pull||(B.$pull={});if(A[0]instanceof lE)D=J.$or||(J.$or=[]),Array.prototype.push.apply(D,A.map((Z)=>{return Z.toObject({transform:(X,Y)=>{if(Z==null||Z.$__==null)return Y;return Object.keys(Z.$__.activePaths.getStatePaths("default")).forEach(($)=>{US.unset($,Y),LS(Y,$)}),Y},virtuals:!1})}));else D=J._id||(J._id={$in:[]}),D.$in=D.$in.concat(A)}else if(F==="$push")if(B.$push=B.$push||{$each:[]},A!=null&&o0.hasUserDefinedProperty(A,"$each"))B.$push=A;else if(A.length===1)B.$push.$each.push(A[0]);else if(A.length<1e4)B.$push.$each.push(...A);else for(let J of A)B.$push.$each.push(J);else B[F]=A;return this},addToSet(){ED(this,arguments),zS(this,arguments);let F=[].map.call(arguments,this._mapCast,this),A=[],B="";if(F[0]instanceof lE)B="doc";else if(F[0]instanceof Date)B="date";else if(pE(F[0],"ObjectId"))B="ObjectId";let D=o0.isMongooseArray(F)?F.__array:F,J=o0.isMongooseArray(this)?this.__array:this;return D.forEach(function(Z){let X,Y=+Z;switch(B){case"doc":X=this.some(function($){return $.equals(Z)});break;case"date":X=this.some(function($){return+$===Y});break;case"ObjectId":X=this.find(($)=>$.toString()===Z.toString());break;default:X=~this.indexOf(Z);break}if(!X)this._markModified(),J.push(Z),this._registerAtomic("$addToSet",Z),[].push.call(A,Z)},this),A},hasAtomics(){if(!o0.isPOJO(this[u3]))return 0;return Object.keys(this[u3]).length},includes(F,A){return this.indexOf(F,A)!==-1},indexOf(F,A){if(pE(F,"ObjectId"))F=F.toString();A=A==null?0:A;let B=this.length;for(let D=A;D<B;++D)if(F==this[D])return D;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,Z)=>this._cast(J,Z,{defaults:!1}),this),A=this[O3].get(this[k3]);if(o0.isMongooseArray(A))A=A.__array;let B=A.length,D;this._markModified();while(B--)if(D=A[B],D instanceof iE){if(F.some(function(Z){return D.equals(Z)}))A.splice(B,1)}else if(~this.indexOf.call(F,D))A.splice(B,1);if(F[0]instanceof lE)this._registerAtomic("$pullDocs",F.map(function(J){let Z=J.$__getValue("_id");if(Z===void 0||J.$isDefault("_id"))return J;return Z}));else this._registerAtomic("$pullAll",F);if(qS(this[O3],this[k3])>0)this._registerAtomic("$set",this);return this},push(){let F=arguments,A=F,B=F[0]!=null&&o0.hasUserDefinedProperty(F[0],"$each"),D=o0.isMongooseArray(this)?this.__array:this;if(B)A=F[0],F=F[0].$each;if(this[S2]==null)return KS.apply(this,F);ED(this,F),zS(this,F),F=[].map.call(F,this._mapCast,this);let J,Z=this[u3];if(this._markModified(),B)if(A.$each=F,(Z.$push&&Z.$push.$each&&Z.$push.$each.length||0)!==0&&Z.$push.$position!=A.$position){if(A.$position!=null)[].splice.apply(D,[A.$position,0].concat(F)),J=D.length;else J=[].push.apply(D,F);this._registerAtomic("$set",this)}else if(A.$position!=null)[].splice.apply(D,[A.$position,0].concat(F)),J=this.length;else J=[].push.apply(D,F);else A=F,J=KS.apply(D,F);return this._registerAtomic("$push",A),J},remove(){return this.pull.apply(this,arguments)},set(F,A,B){let D=this.__array;if(B)return D[F]=A,this;let J=CD._cast.call(this,A,F);return CD._markModified.call(this,F),D[F]=J,this},shift(){let F=o0.isMongooseArray(this)?this.__array:this;this._markModified();let A=[].shift.call(F);return this._registerAtomic("$set",this),A},sort(){let F=o0.isMongooseArray(this)?this.__array:this,A=[].sort.apply(F,arguments);return this._registerAtomic("$set",this),A},splice(){let F,A=o0.isMongooseArray(this)?this.__array:this;if(this._markModified(),ED(this,Array.prototype.slice.call(arguments,2)),arguments.length){let B;if(this[S2]==null)B=arguments;else{B=[];for(let D=0;D<arguments.length;++D)B[D]=D<2?arguments[D]:this._cast(arguments[D],arguments[0]+(D-2))}F=[].splice.apply(A,B),this._registerAtomic("$set",this)}return F},toBSON(){/*!
|
|
221
|
+
* ignore
|
|
222
|
+
*/return this.toObject(WS)},toObject(F){let A=o0.isMongooseArray(this)?this.__array:this;if(F&&F.depopulate)return F=KD1(F),F._isNested=!0,[].concat(A).map(function(B){return B instanceof iE?B.toObject(F):B});return[].concat(A)},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift(){ED(this,arguments);let F;if(this[S2]==null)F=arguments;else F=[].map.call(arguments,this._cast,this);let A=o0.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(A,F),this._registerAtomic("$set",this),this.length}};/*!
|
|
223
|
+
* ignore
|
|
224
|
+
*/function UD1(F,A){if(!A)return!1;for(let B of F){if(B==null)return!1;let D=B.constructor;if(!(B instanceof iE)||D.modelName!==A&&D.baseModelName!==A)return!1}return!0}/*!
|
|
225
|
+
* Minimize _just_ empty objects along the path chain specified
|
|
226
|
+
* by `parts`, ignoring all other paths. Useful in cases where
|
|
227
|
+
* you want to minimize after unsetting a path.
|
|
228
|
+
*
|
|
229
|
+
* #### Example:
|
|
230
|
+
*
|
|
231
|
+
* const obj = { foo: { bar: { baz: {} } }, a: {} };
|
|
232
|
+
* _minimizePath(obj, 'foo.bar.baz');
|
|
233
|
+
* obj; // { a: {} }
|
|
234
|
+
*/function LS(F,A,B){if(typeof A==="string"){if(A.indexOf(".")===-1)return;A=US.stringToParts(A)}if(B=B||0,B>=A.length)return;if(F==null||typeof F!=="object")return;if(LS(F[A[0]],A,B+1),F[A[0]]!=null&&typeof F[A[0]]==="object"&&Object.keys(F[A[0]]).length===0)delete F[A[0]]}/*!
|
|
235
|
+
* ignore
|
|
236
|
+
*/function ED(F,A){let B=F==null?null:F[S2]&&F[S2].caster&&F[S2].caster.options&&F[S2].caster.options.ref||null;if(F.length===0&&A.length!==0){if(UD1(A,B))F[O3].$populated(F[k3],[],{[QS]:A[0].constructor})}}/*!
|
|
237
|
+
* If `docs` isn't all instances of the right model, depopulate `arr`
|
|
238
|
+
*/function zS(F,A){let B=F==null?null:F[S2]&&F[S2].caster&&F[S2].caster.options&&F[S2].caster.options.ref||null,D=F[O3],J=F[k3];if(!B||!D.populated(J))return;for(let Z of A){if(Z==null)continue;if(typeof Z!=="object"||Z instanceof String||Z instanceof Number||Z instanceof Buffer||o0.isMongooseType(Z)){D.depopulate(J);break}}}var QD1=["filter","flat","flatMap","map","slice"];for(let F of QD1){if(Array.prototype[F]==null)continue;CD[F]=function(){let A=o0.isMongooseArray(this)?this.__array:this,B=[].concat(A);return B[F].apply(B,arguments)}}VS.exports=CD});var sE=z((PS,MS)=>{/*!
|
|
239
|
+
* Module dependencies.
|
|
240
|
+
*/var LD1=O2(),nE=HD(),qD=o().arrayAtomicsSymbol,VD1=o().arrayAtomicsBackupSymbol,RS=o().arrayParentSymbol,RD1=o().arrayPathSymbol,wS=o().arraySchemaSymbol,IS=Array.prototype.push,NS=/^\d+$/;function wD1(F,A,B,D){let J;if(Array.isArray(F)){let Y=F.length;if(Y===0)J=new Array;else if(Y===1)J=new Array(1),J[0]=F[0];else if(Y<1e4)J=new Array,IS.apply(J,F);else{J=new Array;for(let $=0;$<Y;++$)IS.call(J,F[$])}}else J=[];let Z={[qD]:{},[VD1]:void 0,[RD1]:A,[wS]:D,[RS]:void 0,isMongooseArray:!0,isMongooseArrayProxy:!0,__array:J};if(F&&F[qD]!=null)Z[qD]=F[qD];if(B!=null&&B instanceof LD1)Z[RS]=B,Z[wS]=D||B.schema.path(A);let X=new Proxy(J,{get:function(Y,$){if(Z.hasOwnProperty($))return Z[$];if(nE.hasOwnProperty($))return nE[$];if(D&&D.virtuals&&D.virtuals.hasOwnProperty($))return D.virtuals[$].applyGetters(void 0,Y);if(typeof $==="string"&&NS.test($)&&D?.$embeddedSchemaType!=null)return D.$embeddedSchemaType.applyGetters(J[$],B);return J[$]},set:function(Y,$,G){if(typeof $==="string"&&NS.test($))nE.set.call(X,$,G,!1);else if(Z.hasOwnProperty($))Z[$]=G;else if(D&&D.virtuals&&D.virtuals.hasOwnProperty($))D.virtuals[$].applySetters(G,Y);else J[$]=G;return!0}});return X}/*!
|
|
241
|
+
* Module exports.
|
|
242
|
+
*/MS.exports=PS=wD1});var rE=z((Vw1,jS)=>{var TS=H2(),aE=j3();jS.exports=function F(A){if(A==null)return A;if(TS(A,"ObjectId"))return A;if(A._id){if(TS(A._id,"ObjectId"))return A._id;if(A._id.toString instanceof Function)return new aE(A._id.toString())}if(A.toString instanceof Function)return new aE(A.toString());return new aE(A)}});var SS=z((Rw1,kS)=>{var WD=HD(),ID1=O2(),ND1=rE(),uS=K6(),PD1=y6().internalToObjectOptions,KD=J1(),tE=H2(),UD=o().arrayParentSymbol,eE=o().arrayPathSymbol,oE=o().arraySchemaSymbol,OS=o().documentArrayParent,MD1=Array.prototype.toString,FC={toBSON(){/*!
|
|
243
|
+
* ignore
|
|
244
|
+
*/return this.toObject(PD1)},toString(){return MD1.call(this.__array.map((F)=>{if(F!=null&&F.$__!=null)return F.toString();return F}))},getArrayParent(){/*!
|
|
245
|
+
* ignore
|
|
246
|
+
*/return this[UD]},_cast(F,A,B){if(this[oE]==null)return F;let D=this[oE].casterConstructor;if((D.$isMongooseDocumentArray?KD.isMongooseDocumentArray(F):F instanceof D)||F&&F.constructor&&F.constructor.baseCasterConstructor===D){if(!(F[OS]&&F.__parentArray))F[OS]=this[UD],F.__parentArray=this;return F.$setIndex(A),F}if(F===void 0||F===null)return null;if(Buffer.isBuffer(F)||tE(F,"ObjectId")||!KD.isObject(F))F={_id:F};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 X=uS(D.discriminators,F[D.schema.options.discriminatorKey]);if(X)D=X}if(D.$isMongooseDocumentArray)return D.cast(F,this,void 0,void 0,A);let Z=new D(F,this,B,void 0,A);return Z.isNew=!0,Z},id(F){let A,B,D;try{A=ND1(F).toString()}catch(J){A=null}for(let J of this){if(!J)continue;if(D=J.get("_id"),D===null||typeof D==="undefined")continue;else if(D instanceof ID1){if(B||(B=String(F)),B==D._id)return J}else if(!tE(F,"ObjectId")&&!tE(D,"ObjectId")){if(F==D||KD.deepEqual(F,D))return J}else if(A==D)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=WD.push.apply(this,arguments);return zD(this),F},pull(){let F=WD.pull.apply(this,arguments);return zD(this),F},shift(){let F=WD.shift.apply(this,arguments);return zD(this),F},splice(){let F=WD.splice.apply(this,arguments);return zD(this),F},inspect(){return this.toObject()},create(F){let A=this[oE].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 B=uS(A.discriminators,F[A.schema.options.discriminatorKey]);if(B)A=B}return new A(F,this)},notify(F){/*!
|
|
247
|
+
* ignore
|
|
248
|
+
*/let A=this;return function B(D,J){J=J||A;let Z=J.length;while(Z--){if(J[Z]==null)continue;switch(F){case"save":D=A[Z];break;default:break}if(KD.isMongooseArray(J[Z]))B(D,J[Z]);else if(J[Z])J[Z].emit(F,D)}}},set(F,A,B){let D=this.__array;if(B)return D[F]=A,this;let J=FC._cast.call(this,A,F);return FC._markModified.call(this,F),D[F]=J,this},_markModified(F,A){let B=this[UD],D;if(B){if(D=this[eE],arguments.length)if(A!=null){let J=F.__index;D=D+"."+J+"."+A}else D=D+"."+F;if(D!=null&&D.endsWith(".$"))return this;B.markModified(D,arguments.length!==0?F:B)}return this}};kS.exports=FC;function zD(F){let A=F[UD];if(!A||A.$__.populated==null)return;let B=Object.keys(A.$__.populated).filter((D)=>D.startsWith(F[eE]+"."));for(let D of B){let J=D.slice((F[eE]+".").length);if(!Array.isArray(A.$__.populated[D].value))continue;A.$__.populated[D].value=F.map((Z)=>Z.$populated(J))}}});var E9=z((ww1,fS)=>{/*!
|
|
249
|
+
* Module dependencies.
|
|
250
|
+
*/var xS=HD(),AC=SS(),TD1=O2(),BC=o().arrayAtomicsSymbol,jD1=o().arrayAtomicsBackupSymbol,DC=o().arrayParentSymbol,JC=o().arrayPathSymbol,G9=o().arraySchemaSymbol,uD1=Array.prototype.push,OD1=/^\d+$/;function kD1(F,A,B,D){let J=[],Z={[BC]:{},[jD1]:void 0,[JC]:A,[G9]:void 0,[DC]:void 0};if(Array.isArray(F)){if(F[JC]===A&&F[DC]===B)Z[BC]=Object.assign({},F[BC]);F.forEach((Y)=>{uD1.call(J,Y)})}if(Z[JC]=A,Z.__array=J,B&&B instanceof TD1){Z[DC]=B,Z[G9]=B.$__schema.path(A);while(Z[G9]!=null&&Z[G9].$isMongooseArray&&!Z[G9].$isMongooseDocumentArray)Z[G9]=Z[G9].casterConstructor}let X=new Proxy(J,{get:function(Y,$){if($==="isMongooseArray"||$==="isMongooseArrayProxy"||$==="isMongooseDocumentArray"||$==="isMongooseDocumentArrayProxy")return!0;if(Z.hasOwnProperty($))return Z[$];if(AC.hasOwnProperty($))return AC[$];if(D&&D.virtuals&&D.virtuals.hasOwnProperty($))return D.virtuals[$].applyGetters(void 0,Y);if(xS.hasOwnProperty($))return xS[$];return J[$]},set:function(Y,$,G){if(typeof $==="string"&&OD1.test($))AC.set.call(X,$,G,!1);else if(Z.hasOwnProperty($))Z[$]=G;else if(D&&D.virtuals&&D.virtuals.hasOwnProperty($))D.virtuals[$].applySetters(G,Y);else J[$]=G;return!0}});return X}/*!
|
|
251
|
+
* Module exports.
|
|
252
|
+
*/fS.exports=kD1});var O2=z((oS,eS)=>{/*!
|
|
253
|
+
* Module dependencies.
|
|
254
|
+
*/var SD1=NE(),YC=import.meta.require("events").EventEmitter,xD1=Xk(),fD1=c5(),x2=W2(),_S=$9(),_D1=Hk(),gD1=SE(),bD1=BD(),gS=zk(),yD1=l7(),$C=z4(),RD=Z9(),lS=qE(),pS=_E(),GC=DD(),ZC=bE(),A3=Z0(),vD1=ZD().compile,hD1=ZD().defineKey,mD1=Tk(),dD1=h7().flatten,XC=yk(),bS=hk(),cD1=dk(),lD1=YD(),yS=r2(),vS=H2(),iS=m7(),pD1=d7(),hS=hE(),EC=import.meta.require("util").inspect,nS=y6().internalToObjectOptions,iD1=mE(),nD1=dE(),sD1=n2(),CC=cE(),aD1=l5(),Y1=J1(),rD1=ZS(),LD=Y1.deepEqual,tD1=Y1.isMongooseObject,n5=o().arrayAtomicsBackupSymbol,K2=o().arrayAtomicsSymbol,oD1=o().documentArrayParent,eD1=o().documentIsModified,sS=o().documentModifiedPaths,FJ1=o().documentSchemaSymbol,AJ1=o().getSymbol,mS=o().populateModelSymbol,BJ1=o().scopeSymbol,DJ1=Y9().schemaMixedSymbol,JJ1=YS(),QD=o().sessionNewDocuments,VD,dS,i5,ZJ1=Y1.specialProperties;function g(F,A,B,D){if(typeof B==="object"&&B!=null)D=B,B=D.skipId;if(D=Object.assign({},D),this.$__schema==null){let G=Y1.isObject(A)&&!A.instanceOfSchema?new yD1(A):A;this.$__setSchema(G),A=B,B=D,D=arguments[4]||{}}if(this.$__=new xD1,D.isNew!=null&&D.isNew!==!0)this.$isNew=D.isNew;if(D.priorDoc!=null)this.$__.priorDoc=D.priorDoc;if(B)this.$__.skipId=B;if(F!=null&&typeof F!=="object")throw new bD1(F,"obj","Document");let J=!0;if(D.defaults!==void 0)this.$__.defaults=D.defaults,J=D.defaults;let Z=this.$__schema;if(typeof A==="boolean"||A==="throw"){if(A!==!0)this.$__.strictMode=A;A=void 0}else if(Z.options.strict!==!0)this.$__.strictMode=Z.options.strict;let X=Z.requiredPaths(!0);for(let G of X)this.$__.activePaths.require(G);let Y=null;if(Y1.isPOJO(A)&&Object.keys(A).length>0)Y=pD1(A),this.$__.selected=A,this.$__.exclude=Y;let $=Y===!1&&A?pS(A):null;if(this._doc==null){if(this.$__buildDoc(F,A,B,Y,$,!1),J)GC(this,A,Y,$,!0,null,{skipParentChangeTracking:!0})}if(F){if(this.$__original_set)this.$__original_set(F,void 0,!0,D);else this.$set(F,void 0,!0,D);if(F instanceof g)this.$isNew=F.$isNew}if(D.willInit&&J){if(D.skipDefaults)this.$__.skipDefaults=D.skipDefaults}else if(J)GC(this,A,Y,$,!1,D.skipDefaults);if(!this.$__.strictMode&&F){let G=this;Object.keys(this._doc).forEach(function(C){if(!(C in Z.tree)&&!(C in Z.methods)&&!(C in Z.virtuals)&&!C.startsWith("$"))hD1({prop:C,subprops:null,prototype:G})})}WJ1(this)}g.prototype.$isMongooseDocumentPrototype=!0;Object.defineProperty(g.prototype,"isNew",{get:function(){return this.$isNew},set:function(F){this.$isNew=F}});Object.defineProperty(g.prototype,"errors",{get:function(){return this.$errors},set:function(F){this.$errors=F}});/*!
|
|
255
|
+
* ignore
|
|
256
|
+
*/g.prototype.$isNew=!0;/*!
|
|
257
|
+
* Document exposes the NodeJS event emitter API, so you can use
|
|
258
|
+
* `on`, `once`, etc.
|
|
259
|
+
*/Y1.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(F){g.prototype[F]=function(){if(!this.$__.emitter){if(F==="emit")return;this.$__.emitter=new YC,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[F].apply(this.$__.emitter,arguments)},g.prototype[`$${F}`]=g.prototype[F]});g.prototype.constructor=g;for(let F in YC.prototype)g[F]=YC.prototype[F];g.prototype.$__schema;g.prototype.schema;Object.defineProperty(g.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){if(this.$__.locals==null)this.$__.locals={};return this.$__.locals},set:function(F){this.$__.locals=F}});g.prototype.isNew;Object.defineProperty(g.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0});g.prototype.id;g.prototype.$errors;Object.defineProperty(g.prototype,"$op",{get:function(){return this.$__.op||null},set:function(F){this.$__.op=F}});/*!
|
|
260
|
+
* ignore
|
|
261
|
+
*/function XJ1(F,A,B){if(F==null)return;let D=Object.keys(B.$__schema.paths),J=D.length,Z=A.indexOf(".")===-1?[A]:A.split(".");for(let X=0;X<J;++X){let Y="",$=D[X];if(!$.startsWith(A+"."))continue;let G=B.$__schema.paths[$],E=G.splitPath().slice(Z.length),C=E.length;if(G.defaultValue===void 0)continue;let H=F;for(let q=0;q<C;++q){if(H==null)break;let W=E[q];if(q===C-1){if(H[W]!==void 0)break;try{let K=G.getDefault(B,!1);if(K!==void 0)H[W]=K}catch(K){B.invalidate(A+"."+Y,K);break}break}Y+=(!Y.length?"":".")+W,H[W]=H[W]||{},H=H[W]}}}g.prototype.$__buildDoc=function(F,A,B,D,J){let Z={},X=Object.keys(this.$__schema.paths).filter((G)=>!G.includes("$*")),Y=X.length,$=0;for(;$<Y;++$){let G=X[$];if(G==="_id"){if(B)continue;if(F&&"_id"in F)continue}let E=this.$__schema.paths[G].splitPath(),C=E.length,H=C-1,q="",W=Z,K=!1;for(let U=0;U<C;++U){let Q=E[U];if(!q.length)q=Q;else q+="."+Q;if(D===!0){if(q in A)break}else if(D===!1&&A&&!K){if(q in A)K=!0;else if(!J[q])break}if(U<H)W=W[Q]||(W[Q]={})}}this._doc=Z};/*!
|
|
262
|
+
* Converts to POJO when you use the document for querying
|
|
263
|
+
*/g.prototype.toBSON=function(){return this.toObject(nS)};g.prototype.init=function(F,A,B){if(typeof A==="function")B=A,A=null;if(this.$__init(F,A),B)B(null,this);return this};g.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)};g.prototype.$__init=function(F,A){if(this.$isNew=!1,A=A||{},F._id!=null&&A.populated&&A.populated.length){let D=String(F._id);for(let J of A.populated){if(J.isVirtual)this.$populated(J.path,Y1.getValue(J.path,F),J);else this.$populated(J.path,J._docs[D],J);if(J._childDocs==null)continue;for(let Z of J._childDocs){if(Z==null||Z.$__==null)continue;Z.$__.parent=this}J._childDocs=[]}}aS(this,F,this._doc,A),iD1(this,A.populated),this.$emit("init",this),this.constructor.emit("init",this);let B=this.$__.exclude===!1&&this.$__.selected?pS(this.$__.selected):null;return GC(this,this.$__.selected,this.$__.exclude,B,!1,this.$__.skipDefaults),this};function aS(F,A,B,D,J){if(J=J||"",A.$__!=null)A=A._doc;let Z=Object.keys(A),X=Z.length,Y,$,G,E=0,C=F.$__.strictMode,H=F.$__schema;while(E<X)q(E++);function q(W){if(G=Z[W],G==="__proto__"||G==="constructor")return;if($=J?J+G:G,Y=H.path($),H.$isRootDiscriminator&&!F.$__isSelected($))return;let K=A[G];if(!Y&&Y1.isPOJO(K)){if(!B[G]){if(B[G]={},!C&&!(G in H.tree)&&!(G in H.methods)&&!(G in H.virtuals))F[G]=B[G]}aS(F,K,B[G],D,$+".")}else if(!Y){if(B[G]=K,!C&&!J)F[G]=K}else{if(B.hasOwnProperty(G)&&K!==void 0&&!D.hydratedPopulatedDocs)delete B[G];if(K===null)B[G]=Y._castNullish(null);else if(K!==void 0){let U=K.$__==null?null:K.$__.wasPopulated;if(Y&&!U&&!D.hydratedPopulatedDocs)try{if(D&&D.setters)B[G]=Y.applySetters(K,F,!1);else B[G]=Y.cast(K,F,!0)}catch(Q){F.invalidate(Q.path,new lS({path:Q.path,message:Q.message,type:"cast",value:Q.value,reason:Q}))}else B[G]=K}if(!F.$isModified($))F.$__.activePaths.init($)}}}g.prototype.updateOne=function F(A,B,D){let J=this.constructor.updateOne({_id:this._doc._id},A,B),Z=this;if(J.pre(function X(Y){Z.constructor._middleware.execPre("updateOne",Z,[Z],Y)}),J.post(function X(Y){Z.constructor._middleware.execPost("updateOne",Z,[Z],{},Y)}),this.$session()!=null){if(!("session"in J.options))J.options.session=this.$session()}if(D!=null)return J.exec(D);return J};g.prototype.replaceOne=function F(){let A=[...arguments];return A.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,A)};g.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 x2("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 B=this.$getAllSubdocs();for(let D of B)D.$session(A)}return A};g.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 B=this.$timestamps();if(A!==B)this.$__.timestamps=A;return this};g.prototype.overwrite=function F(A){let B=Array.from(new Set(Object.keys(this._doc).concat(Object.keys(A))));for(let D of B){if(D==="_id")continue;if(this.$__schema.options.versionKey&&D===this.$__schema.options.versionKey)continue;if(this.$__schema.options.discriminatorKey&&D===this.$__schema.options.discriminatorKey)continue;this.$set(D,A[D])}return this};g.prototype.$set=function F(A,B,D,J){if(Y1.isPOJO(D))J=D,D=void 0;let Z=J&&J.merge,X=D&&D!==!0,Y=D===!0,$,G,E=0,C,H,q,W=J&&"strict"in J,K=W?J.strict:this.$__.strictMode;if(X)$=this.$__.adhocPaths||(this.$__.adhocPaths={}),$[A]=this.$__schema.interpretAsType(A,D,this.$__schema.options);if(A==null)[A,B]=[B,A];else if(typeof A!=="string"){if(A instanceof g)if(A.$__isNested)A=A.toObject();else A=A.$__schema===this.$__schema?HC(A,{...A._doc}):A._doc;if(A==null)[A,B]=[B,A];q=B?B+".":"",G=bS(this.$__schema,A);let x=G.length,m=J&&J._skipMinimizeTopLevel||!1;if(x===0&&m){if(delete J._skipMinimizeTopLevel,B)this.$set(B,{});return this}J=Object.assign({},J,{_skipMinimizeTopLevel:!1});for(let O=0;O<x;++O){H=G[O];let b=q?q+H:H;C=this.$__schema.pathType(b);let s=A[H];if(D===!0&&!q&&s!=null&&C==="nested"&&this._doc[H]!=null)delete this._doc[H];if(Y1.isNonBuiltinObject(s)&&C==="nested"){this.$set(b,s,Y,Object.assign({},J,{_skipMarkModified:!0})),XJ1(this.$get(b),b,this);continue}else if(K){if(Y&&s===void 0&&this.$get(b)!==void 0)continue;if(C==="adhocOrUndefined")C=XC(this,b,{typeOnly:!0});if(C==="real"||C==="virtual")this.$set(b,s,Y,J);else if(C==="nested"&&s instanceof g)this.$set(b,s.toObject({transform:!1}),Y,J);else if(K==="throw")if(C==="nested")throw new gD1(H,s);else throw new $C(H);else if(C==="nested"&&s==null)this.$set(b,s,Y,J)}else if(s!==void 0)this.$set(b,s,Y,J)}let u={},k=Object.keys(this.$__schema.tree);for(let O=0,b=k.length;O<b;++O)(H=k[O])&&this._doc.hasOwnProperty(H)&&(u[H]=void 0);return this._doc=Object.assign(u,this._doc),this}let U=this.$__schema.pathType(A),Q=null;if(U==="adhocOrUndefined")Q=A.indexOf(".")===-1?[A]:A.split("."),U=XC(this,Q,{typeOnly:!0});if(U==="adhocOrUndefined"&&!W){if(Q==null)Q=A.indexOf(".")===-1?[A]:A.split(".");let x=cD1(this.$__schema,Q);if(x!==void 0)K=x}B=lD1(B,!0);let L=(()=>{if(this.$__.priorDoc!=null)return this.$__.priorDoc.$__getValue(A);if(Y)return;return this.$__getValue(A)})();if(U==="nested"&&B){if(typeof B==="object"&&B!=null){if(B.$__!=null)B=B.toObject(nS);if(B==null)return this.invalidate(A,new x2.CastError("Object",B,A)),this;let x=this.$isModified(A),m=this.$__.savedState!=null&&this.$__.savedState.hasOwnProperty(A);if(this.$__.savedState!=null&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(A)){let k=this.$__getValue(A);this.$__.savedState[A]=k;let O=Object.keys(k||{});for(let b of O)this.$__.savedState[A+"."+b]=k[b]}if(!Z)this.$__setValue(A,null),ZC(this,A);else return this.$set(B,A,Y,J);let u=bS(this.$__schema,B,A);this.$__setValue(A,{});for(let k of u)this.$set(A+"."+k,B[k],Y,{...J,_skipMarkModified:!0});if(L!=null&&(!x||m)&&Y1.deepEqual(m?this.$__.savedState[A]:L,B))this.unmarkModified(A);else this.markModified(A);return this}return this.invalidate(A,new x2.CastError("Object",B,A)),this}let V;if(Q==null)Q=A.indexOf(".")===-1?[A]:A.split(".");if(typeof this.$__schema.aliases[Q[0]]==="string")Q[0]=this.$__schema.aliases[Q[0]];if(U==="adhocOrUndefined"&&K){let x;for(E=0;E<Q.length;++E){let m=Q.slice(0,E+1).join(".");if(E+1<Q.length&&this.$__schema.pathType(m)==="virtual")return sD1.set(A,B,this),this;if(V=this.$__schema.path(m),V==null)continue;if(V instanceof _S){x=!0;break}else if(V.$isSchemaMap&&V.$__schemaType instanceof _S&&E<Q.length-1){x=!0,V=V.$__schemaType;break}}if(V==null)V=XC(this,A);if(!x&&!V){if(K==="throw")throw new $C(A);return this}}else if(U==="virtual")return V=this.$__schema.virtualpath(A),V.applySetters(B,this),this;else V=this.$__path(A);let w=this._doc,j="";for(E=0;E<Q.length-1;++E)if(w=w[Q[E]],j+=(j.length!==0?".":"")+Q[E],!w){if(this.$set(j,{}),!this.$__isSelected(j))this.unmarkModified(j);w=this.$__getValue(j)}let T;if(Q.length<=1)T=A;else{let x=Q.length;for(E=0;E<x;++E){let m=Q.slice(0,E+1).join(".");if(this.$get(m,null,{getters:!1})===null){T=m;break}}if(!T)T=A}if(!V){if(this.$__set(T,A,J,Y,Q,V,B,L),U==="nested"&&B==null)ZC(this,A);return this}if(V.$isSingleNested||V.$isMongooseArray)HJ1(this,A);if(B!=null&&Z&&V.$isSingleNested){if(B instanceof g)B=B.toObject({virtuals:!1,transform:!1});let x=Object.keys(B);for(let m of x)this.$set(A+"."+m,B[m],Y,J);return this}let M=!0;try{let x=(()=>{if(V.options==null)return!1;if(!(B instanceof g))return!1;let O=B.constructor,b=V.options.ref;if(b!=null&&(b===O.modelName||b===O.baseModelName))return!0;let s=V.options.refPath;if(s==null)return!1;let N1=B.get(s);return N1===O.modelName||N1===O.baseModelName})(),m=!1;if(x&&B instanceof g&&(!B.$__.wasPopulated||Y1.deepEqual(B.$__.wasPopulated.value,B._doc._id))){let O=V&&V.$isSingleNested?V.cast(B,this):B._doc._id;this.$populated(A,O,{[mS]:B.constructor}),B.$__.wasPopulated={value:O},m=!0}let u,k=this.$__schema.options.typeKey;if(V.options&&Array.isArray(V.options[k])&&V.options[k].length&&V.options[k][0]&&V.options[k][0].ref&&YJ1(B,V.options[k][0].ref)){u={[mS]:B[0].constructor},this.$populated(A,B.map(function(O){return O._doc._id}),u);for(let O of B)O.$__.wasPopulated={value:O._doc._id};m=!0}if(!x||!V.$isSingleNested||!B.$__){let O=this;if(this.$__schema.singleNestedPaths[A]!=null&&Q.length>1)O=JJ1(this,Q,this.schema);if(J!=null&&J.overwriteImmutable)B=V.applySetters(B,O,!1,L,{overwriteImmutable:!0});else B=V.applySetters(B,O,!1,L)}if(Array.isArray(B)&&!Array.isArray(V)&&V.$isMongooseDocumentArray&&B.length!==0&&B[0]!=null&&B[0].$__!=null&&B[0].$__.populated!=null){let O=Object.keys(B[0].$__.populated);for(let b of O)this.$populated(A+"."+b,B.map((s)=>s.$populated(b)),B[0].$__.populated[b].options);m=!0}if(!m&&this.$__.populated){if(Array.isArray(B)&&this.$__.populated[A]){for(let O=0;O<B.length;++O)if(B[O]instanceof g)B.set(O,B[O]._doc._id,!0)}delete this.$__.populated[A]}if(B!=null&&V.$isSingleNested)qJ1(B,V,L);this.$markValid(A)}catch(x){if(x instanceof x2.StrictModeError&&x.isImmutableError)this.invalidate(A,x);else if(x instanceof x2.CastError){if(this.invalidate(x.path,x),x.$originalErrorPath)this.invalidate(A,new x2.CastError(V.instance,B,A,x.$originalErrorPath))}else this.invalidate(A,new x2.CastError(V.instance,B,A,x));M=!1}if(M){let x=null,m=null;if(!Y){let O=this.$isSubdocument?this.ownerDocument():this;x=O.$__.savedState,m=this.$isSubdocument?this.$__.fullPath+"."+A:A,O.$__saveInitialState(m)}this.$__set(T,A,J,Y,Q,V,B,L);let u=!!this.$__.session?.transaction,k=this.$__.session&&this.$__.session[QD]&&this.$__.session[QD].has(this)&&this.$__.session[QD].get(this).modifiedPaths&&!this.$__.session[QD].get(this).modifiedPaths.has(m);if(x!=null&&x.hasOwnProperty(m)&&(!u||k)&&Y1.deepEqual(B,x[m]))this.unmarkModified(A)}if(V.$isSingleNested&&(this.isDirectModified(A)||B==null))ZC(this,A);return this};/*!
|
|
264
|
+
* ignore
|
|
265
|
+
*/function YJ1(F,A){if(!Array.isArray(F))return!1;if(F.length===0)return!1;for(let B of F){if(!(B instanceof g))return!1;if(B.constructor.modelName==null)return!1;if(B.constructor.modelName!=A&&B.constructor.baseModelName!=A)return!1}return!0}g.prototype.set=g.prototype.$set;g.prototype.$__shouldModify=function(F,A,B,D,J,Z,X,Y){if(B&&B._skipMarkModified)return!1;if(this.$isNew)return!0;if(A in this.$__.activePaths.getStatePaths("modify"))return!0;if(X===void 0&&!this.$__isSelected(A))return!0;if(X===void 0&&A in this.$__.activePaths.getStatePaths("default"))return!1;if(this.$populated(A)&&X instanceof g&&LD(X._doc._id,Y))return!1;if(!LD(X,Y!==void 0?Y:Y1.getValue(A,this)))return!0;if(!D&&X!==null&&X!==void 0&&A in this.$__.activePaths.getStatePaths("default")&&LD(X,Z.getDefault(this,D)))return!0;return!1};g.prototype.$__set=function(F,A,B,D,J,Z,X,Y){i5=i5||c7();let $=this.$__shouldModify(F,A,B,D,J,Z,X,Y);if($){if(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[A]){if(delete this.$__.primitiveAtomics[A],Object.keys(this.$__.primitiveAtomics).length===0)delete this.$__.primitiveAtomics}if(this.markModified(F),dS||(dS=sE()),X&&Y1.isMongooseArray(X)){if(X._registerAtomic("$set",X),Y1.isMongooseDocumentArray(X))X.forEach(function(q){q&&q.__parentArray&&(q.__parentArray=X)})}}else if(Array.isArray(X)&&Array.isArray(Y)&&Y1.isMongooseArray(X)&&Y1.isMongooseArray(Y)){if(X[K2]=Y[K2],X[n5]=Y[n5],Y1.isMongooseDocumentArray(X))X.forEach((q)=>{if(q!=null)q.$isNew=!1})}let G=this._doc,E=0,C=J.length,H="";for(;E<C;E++){let W=E+1===C;if(H+=H?"."+J[E]:J[E],ZJ1.has(J[E]))return;if(W)if(G instanceof Map)G.set(J[E],X);else if(G.$isSingleNested){if(!(J[E]in G))G[J[E]]=X,G._doc[J[E]]=X;else G._doc[J[E]]=X;if($)G.markModified(J[E])}else G[J[E]]=X;else{let K=G instanceof Map,U=K?G.get(J[E]):G[J[E]];if(Y1.isPOJO(U))G=U;else if(U&&U instanceof i5)G=U;else if(U&&!Array.isArray(U)&&U.$isSingleNested)G=U;else if(U&&Array.isArray(U))G=U;else if(U==null){if(U={},K)G.set(J[E],U);else G[J[E]]=U;G=U}else G=U}}};g.prototype.$__getValue=function(F){return Y1.getValue(F,this._doc)};g.prototype.$inc=function F(A,B){if(B==null)B=1;if(Array.isArray(A))return A.forEach(($)=>this.$inc($,B)),this;let D=this.$__path(A);if(D==null){if(this.$__.strictMode==="throw")throw new $C(A);else if(this.$__.strictMode===!0)return this}else if(D.instance!=="Number")return this.invalidate(A,new x2.CastError(D.instance,B,A)),this;let J=this.$__getValue(A)||0,Z=!1,X=null,Y=B;try{B=D.cast(B),X=D.applySetters(J+B,this),Y=X-J,Z=!0}catch($){this.invalidate(A,new x2.CastError("number",B,A,$))}if(Z){if(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},this.$__.primitiveAtomics[A]==null)this.$__.primitiveAtomics[A]={$inc:Y};else this.$__.primitiveAtomics[A].$inc+=Y;this.markModified(A),this.$__setValue(A,X)}return this};g.prototype.$__setValue=function(F,A){return Y1.setValue(F,A,this._doc),this};g.prototype.get=function(F,A,B){let D;if(B==null)B={};if(A)D=this.$__schema.interpretAsType(F,A,this.$__schema.options);let J=B.noDottedPath,Z=J?this.$__schema.paths[F]:this.$__path(F);if(Z==null){if(Z=this.$__schema.virtualpath(F),Z!=null)return Z.applyGetters(void 0,this)}if(J){let G=this._doc[F];if(D)G=D.cast(G);if(Z!=null&&B.getters!==!1)return Z.applyGetters(G,this);return G}if(Z!=null&&Z.instance==="Mixed"){let G=this.$__schema.virtualpath(F);if(G!=null)Z=G}let X=F.indexOf(".")!==-1,Y=this._doc,$=X?F.split("."):[F];if(typeof this.$__schema.aliases[$[0]]==="string")$[0]=this.$__schema.aliases[$[0]];for(let G=0,E=$.length;G<E;G++){if(Y&&Y._doc)Y=Y._doc;if(Y==null)Y=void 0;else if(Y instanceof Map)Y=Y.get($[G],{getters:!1});else if(G===E-1)Y=Y1.getValue($[G],Y);else Y=Y[$[G]]}if(D)Y=D.cast(Y);if(Z!=null&&B.getters!==!1)Y=Z.applyGetters(Y,this);else if(this.$__schema.nested[F]&&B.virtuals)return HC(this,A3(Y)||{},{path:F});return Y};/*!
|
|
266
|
+
* ignore
|
|
267
|
+
*/g.prototype[AJ1]=g.prototype.get;g.prototype.$get=g.prototype.get;g.prototype.$__path=function(F){let A=this.$__.adhocPaths,B=A&&A.hasOwnProperty(F)?A[F]:null;if(B)return B;return this.$__schema.path(F)};g.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};/*!
|
|
268
|
+
* ignore
|
|
269
|
+
*/g.prototype.$__saveInitialState=function F(A){let B=this.$__.savedState,D=A;if(B!=null){let J=D.indexOf("."),Z=J===-1?D:D.slice(0,J);if(!B.hasOwnProperty(Z))B[Z]=A3(this.$__getValue(Z))}};g.prototype.unmarkModified=function(F){if(this.$__.activePaths.init(F),this.$__.pathsToScopes!=null)delete this.$__.pathsToScopes[F]};g.prototype.$ignore=function(F){this.$__.activePaths.ignore(F)};g.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))};g.prototype.$isEmpty=function(F){let A={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(arguments.length!==0){let B=this.$get(F);if(B==null)return!0;if(typeof B!=="object")return!1;if(Y1.isPOJO(B))return rS(B);return Object.keys(B.toObject(A)).length===0}return Object.keys(this.toObject(A)).length===0};/*!
|
|
270
|
+
* ignore
|
|
271
|
+
*/function rS(F){if(F==null)return!0;if(typeof F!=="object"||Array.isArray(F))return!1;for(let A of Object.keys(F))if(!rS(F[A]))return!1;return!0}g.prototype.modifiedPaths=function(F){F=F||{};let A=Object.keys(this.$__.activePaths.getStatePaths("modify")),B=new Set,D=0,J=0,Z=A.length;for(D=0;D<Z;++D){let X=A[D],Y=CC(X),$=Y.length;for(J=0;J<$;++J)B.add(Y[J]);if(!F.includeChildren)continue;let G=0,E=this.$get(X);if(typeof E==="object"&&E!==null){if(E._doc)E=E._doc;let C=E.length;if(Array.isArray(E))for(G=0;G<C;++G){let H=X+"."+G;if(!B.has(H)){if(B.add(H),E[G]!=null&&E[G].$__){let q=E[G].modifiedPaths(),W=0,K=q.length;for(W=0;W<K;++W)B.add(H+"."+q[W])}}}else{let H=Object.keys(E),q=0,W=H.length;for(q=0;q<W;++q)B.add(X+"."+H[q])}}}return Array.from(B)};g.prototype[sS]=g.prototype.modifiedPaths;g.prototype.isModified=function(F,A,B){if(F){let D=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 $ of F)if(J[$]!=null)return!0;let Z=B||this[sS](),X=F.some(function($){return!!~Z.indexOf($)}),Y=Object.keys(J);if(D)Y=Y.filter(($)=>{let G=this.$__getValue($);if(G!=null&&G[K2]!=null&&G[K2].$set===void 0)return!1;return!0});return X||F.some(function($){return Y.some(function(G){return G===$||$.startsWith(G+".")})})}return this.$__.activePaths.some("modify")};g.prototype.$isModified=g.prototype.isModified;g.prototype[eD1]=g.prototype.isModified;g.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((B)=>this.$__.activePaths.getStatePaths("default").hasOwnProperty(B))};g.prototype.$isDeleted=function(F){if(arguments.length===0)return!!this.$__.isDeleted;return this.$__.isDeleted=!!F,this};g.prototype.isDirectModified=function(F){if(F==null)return this.$__.activePaths.some("modify");if(typeof F==="string"&&F.indexOf(" ")===-1){let B=this.$__.activePaths.getStatePaths("modify").hasOwnProperty(F);if(B||F.indexOf(".")===-1)return B;let D=F.split(".");for(let J=0;J<D.length-1;++J){let Z=D.slice(0,J+1).join("."),X=this.$get(Z);if(X!=null&&X.$__!=null&&X.isDirectModified(D.slice(J+1).join(".")))return!0}return!1}let A=F;if(typeof A==="string")A=A.split(" ");return A.some((B)=>this.isDirectModified(B))};g.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((B)=>this.$__.activePaths.getStatePaths("init").hasOwnProperty(B))};g.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((Z)=>this.$__isSelected(Z));let B=Object.keys(this.$__.selected),D=null;if(B.length===1&&B[0]==="_id")return this.$__.selected._id===0;for(let Z of B){if(Z==="_id")continue;if(!iS(this.$__.selected[Z]))continue;D=!!this.$__.selected[Z];break}if(D===null)return!0;if(A in this.$__.selected)return D;let J=A+".";for(let Z of B){if(Z==="_id")continue;if(Z.startsWith(J))return D||Z!==J;if(J.startsWith(Z+"."))return D}return!D};g.prototype.$__isSelected=g.prototype.isSelected;g.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 B=Object.keys(this.$__.selected),D=null;if(B.length===1&&B[0]==="_id")return this.$__.selected._id===0;for(let J of B){if(J==="_id")continue;if(!iS(this.$__.selected[J]))continue;D=!!this.$__.selected[J];break}if(D===null)return!0;if(this.$__.selected.hasOwnProperty(A))return D;return!D};g.prototype.validate=async function F(A,B){if(typeof A==="function"||typeof B==="function"||typeof arguments[2]==="function")throw new x2("Document.prototype.validate() no longer accepts a callback");let D;if(this.$op="validate",arguments.length===1){if(typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))B=arguments[0],A=null}if(B&&typeof B.pathsToSkip==="string"){let Z=B.pathsToSkip.indexOf(" ")===-1;B.pathsToSkip=Z?[B.pathsToSkip]:B.pathsToSkip.split(" ")}let J=B&&B._skipParallelValidateCheck;if(this.$isSubdocument!=null);else if(this.$__.validating&&!J)D=new gS(this,{parentStack:B&&B.parentStack,conflictStack:this.$__.validating.stack});else if(!J)this.$__.validating=new gS(this,{parentStack:B&&B.parentStack});if(D!=null)throw D;return new Promise((Z,X)=>{this.$__validate(A,B,(Y)=>{if(this.$op=null,this.$__.validating=null,Y!=null)return X(Y);Z()})})};g.prototype.$validate=g.prototype.validate;/*!
|
|
272
|
+
* ignore
|
|
273
|
+
*/function $J1(F){let A=Object.keys(F.$__.activePaths.getStatePaths("require")),B=0,D=A.length;for(B=0;B<D;++B){let J=A[B],Z=F.$__schema.path(J);if(Z!=null&&typeof Z.originalRequiredValue==="function"){F.$__.cachedRequired=F.$__.cachedRequired||{};try{F.$__.cachedRequired[J]=Z.originalRequiredValue.call(F,F)}catch(X){F.invalidate(J,X)}}}}/*!
|
|
274
|
+
* ignore
|
|
275
|
+
*/function tS(F,A,B,D){let J={};$J1(F);let Z=new Set(Object.keys(F.$__.activePaths.getStatePaths("require")).filter(function($){if(!F.$__isSelected($)&&!F.$isModified($))return!1;if(F.$__.cachedRequired!=null&&$ in F.$__.cachedRequired)return F.$__.cachedRequired[$];return!0}));Object.keys(F.$__.activePaths.getStatePaths("init")).forEach(X),Object.keys(F.$__.activePaths.getStatePaths("modify")).forEach(X),Object.keys(F.$__.activePaths.getStatePaths("default")).forEach(X);function X($){Z.add($)}if(!D){let $=F.$getAllSubdocs({useCache:!0}),G=F.modifiedPaths();for(let E of $)if(E.$basePath){let C=E.$isSingleNested?E.$__pathRelativeToParent():E.$__fullPathWithIndexes();for(let H of E.modifiedPaths())Z.delete(C+"."+H);if(F.$isModified(C,null,G)&&!F.$__.activePaths.getStatePaths("modify").hasOwnProperty(C)&&!F.$isDefault(C)){if(Z.add(C),F.$__.pathsToScopes==null)F.$__.pathsToScopes={};if(F.$__.pathsToScopes[C]=E.$isDocumentArrayElement?E.__parentArray:E.$parent(),J[C]={skipSchemaValidators:!0},E.$isDocumentArrayElement&&E.__index!=null)J[C].index=E.__index}}}for(let $ of Z){let G=F.$__schema.path($);if(!G)continue;if(G.$isMongooseDocumentArray){for(let E of Z)if(E==null||E.startsWith(G.path+"."))Z.delete(E)}if(!G.caster&&G.validators.length===0&&!G.$parentSchemaDocArray)Z.delete($);else if(G.$isMongooseArray&&!G.$isMongooseDocumentArray&&!G.$embeddedSchemaType.$isMongooseArray&&G.validators.length===0&&G.$embeddedSchemaType.validators.length===0)Z.delete($)}if(Array.isArray(A))Z=EJ1(Z,A);else if(Array.isArray(B))Z=CJ1(Z,B);GJ1(F,Z);let Y={skipArrays:!0};for(let $ of Z)if(F.$__schema.nested[$]){let G=F.$__getValue($);if(tD1(G))G=G.toObject({transform:!1});let E=dD1(G,$,Y,F.$__schema);Object.keys(E).filter((C)=>!F.$__schema.singleNestedPaths.hasOwnProperty(C)).forEach(X)}for(let $ of Z){let G=F.$__schema.path($);if(!G)continue;if(G.$parentSchemaDocArray&&typeof G.$parentSchemaDocArray.path==="string")Z.add(G.$parentSchemaDocArray.path);if(!G.$isSchemaMap)continue;let E=F.$__getValue($);if(E==null)continue;for(let C of E.keys())Z.add($+"."+C)}return Z=Array.from(Z),[Z,J]}function GJ1(F,A){for(let B of A){let D=F.$__schema.path(B);if(!D)continue;if(!D.$isMongooseArray||!Array.isArray(D)&&D.$isMongooseDocumentArray&&!(D&&D.schemaOptions&&D.schemaOptions.required))continue;if(D.$isMongooseArray&&!D.$isMongooseDocumentArray&&!D.$embeddedSchemaType.$isMongooseArray&&D.$embeddedSchemaType.validators.length===0)continue;let J=F.$__getValue(B);wD(J,A,B)}}function wD(F,A,B){if(F!=null){let D=F.length;for(let J=0;J<D;++J)if(Array.isArray(F[J]))wD(F[J],A,B+"."+J);else A.add(B+"."+J)}}/*!
|
|
276
|
+
* ignore
|
|
277
|
+
*/g.prototype.$__validate=function(F,A,B){if(this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!F)F=[...this.$__.saveOptions.pathsToSave];else if(typeof F==="function")B=F,A=null,F=null;else if(typeof A==="function")B=A,A=null;let D=A&&typeof A==="object"&&"validateModifiedOnly"in A,J=A&&A.pathsToSkip||null,Z;if(D)Z=!!A.validateModifiedOnly;else Z=this.$__schema.options.validateModifiedOnly;let X=A&&A.validateAllPaths;if(X){if(J)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(F)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(D&&Z)throw new TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}let Y=this,$=()=>{let U=this.$__.validationError;if(this.$__.validationError=null,this.$__.validating=null,Z&&U!=null){let Q=Object.keys(U.errors);for(let L of Q)if(!this.$isModified(L))delete U.errors[L];if(Object.keys(U.errors).length===0)U=void 0}if(this.$__.cachedRequired={},this.$emit("validate",Y),this.constructor.emit("validate",Y),U){for(let Q in U.errors)if(!this[oD1]&&U.errors[Q]instanceof x2.CastError)this.invalidate(Q,U.errors[Q]);return U}},G,E;if(X){G=new Set(Object.keys(this.$__schema.paths));for(let U of G){let Q=this.$__schema.path(U);if(!Q||!Q.$isMongooseArray)continue;let L=this.$__getValue(U);if(!L)continue;wD(L,G,U)}G=[...G],E={}}else{let U=tS(this,F,J,A&&A._nestedValidate);G=Z?U[0].filter((Q)=>this.$isModified(Q)):U[0],E=U[1]}if(typeof F==="string")F=F.split(" ");if(G.length===0)return yS(function(){let U=$();if(U)return Y.$__schema.s.hooks.execPost("validate:error",Y,[Y],{error:U},function(Q){B(Q)});B(null,Y)});let C={},H=0,q=this.$__.saveOptions?.pathsToSave;if(Array.isArray(q)){q=new Set(q);for(let U of G){if(!q.has(U))continue;W(U)}}else for(let U of G)W(U);function W(U){if(U==null||C[U])return;C[U]=!0,H++,yS(function(){let Q=Y.$__schema.path(U);if(!Q)return--H||K();if(!Y.$isValid(U)){--H||K();return}if(Q[DJ1]!=null&&U!==Q.path)return--H||K();let L=Y.$__getValue(U),V;if(V=Y.$populated(U))L=V;else if(L!=null&&L.$__!=null&&L.$__.wasPopulated)L=L._doc._id;let w=Y.$__.pathsToScopes!=null&&U in Y.$__.pathsToScopes?Y.$__.pathsToScopes[U]:Y,j={...E[U],path:U,validateAllPaths:X,_nestedValidate:!0};Q.doValidate(L,function(T){if(T){if((Q.$isSingleNested||Q.$isArraySubdocument||Q.$isMongooseDocumentArray)&&T instanceof RD)return--H||K();Y.invalidate(U,T,void 0,!0)}--H||K()},w,j)})}function K(){let U=$();if(U)return Y.$__schema.s.hooks.execPost("validate:error",Y,[Y],{error:U},function(Q){B(Q)});B(null,Y)}};/*!
|
|
278
|
+
* ignore
|
|
279
|
+
*/function EJ1(F,A){let B=new Set(A),D=new Map([]);for(let Z of A){if(Z.indexOf(".")===-1)continue;let X=Z.split("."),Y=X[0];for(let $=1;$<X.length;++$)D.set(Y,Z),Y=Y+"."+X[$]}let J=new Set;for(let Z of F)if(B.has(Z))J.add(Z);else if(D.has(Z))J.add(D.get(Z));return J}/*!
|
|
280
|
+
* ignore
|
|
281
|
+
*/function CJ1(F,A){return A=new Set(A),F=Array.from(F).filter((B)=>!A.has(B)),new Set(F)}g.prototype.validateSync=function(F,A){let B=this;if(arguments.length===1&&typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))A=arguments[0],F=null;let D=A&&typeof A==="object"&&"validateModifiedOnly"in A,J;if(D)J=!!A.validateModifiedOnly;else J=this.$__schema.options.validateModifiedOnly;let Z=A&&A.pathsToSkip,X=A&&A.validateAllPaths;if(X){if(Z)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 Z==="string"&&Z.indexOf(" ")!==-1)Z=Z.split(" ");let Y,$;if(X){Y=new Set(Object.keys(this.$__schema.paths));for(let C of Y){let H=this.$__schema.path(C);if(!H||!H.$isMongooseArray)continue;let q=this.$__getValue(C);if(!q)continue;wD(q,Y,C)}Y=[...Y],$={}}else{let C=tS(this,F,Z);Y=J?C[0].filter((H)=>this.$isModified(H)):C[0],$=C[1]}let G={};for(let C=0,H=Y.length;C<H;++C){let q=Y[C];if(G[q])continue;G[q]=!0;let W=B.$__schema.path(q);if(!W)continue;if(!B.$isValid(q))continue;let K=B.$__getValue(q),U=W.doValidateSync(K,B,{skipSchemaValidators:$[q],path:q,validateModifiedOnly:J,validateAllPaths:X});if(U){if((W.$isSingleNested||W.$isArraySubdocument||W.$isMongooseDocumentArray)&&U instanceof RD)continue;B.invalidate(q,U,void 0,!0)}}let E=B.$__.validationError;if(B.$__.validationError=void 0,B.$emit("validate",B),B.constructor.emit("validate",B),E){for(let C in E.errors)if(E.errors[C]instanceof x2.CastError)B.invalidate(C,E.errors[C])}return E};g.prototype.invalidate=function(F,A,B,D){if(!this.$__.validationError)this.$__.validationError=new RD(this);if(this.$__.validationError.errors[F])return;if(!A||typeof A==="string")A=new lS({path:F,message:A,type:D||"user defined",value:B});if(this.$__.validationError===A)return this.$__.validationError;return this.$__.validationError.addError(F,A),this.$__.validationError};g.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};/*!
|
|
282
|
+
* ignore
|
|
283
|
+
*/function HJ1(F,A){if(!F.$__.validationError)return;let B=Object.keys(F.$__.validationError.errors);for(let D of B)if(D.startsWith(A+"."))delete F.$__.validationError.errors[D];if(Object.keys(F.$__.validationError.errors).length===0)F.$__.validationError=null}/*!
|
|
284
|
+
* ignore
|
|
285
|
+
*/function qJ1(F,A,B){let D=A.schema;if(D==null)return;for(let J of Object.keys(D.paths)){let Z=D.paths[J];if(Z.$immutableSetter==null)continue;let X=B==null?void 0:B.$__getValue(J);Z.$immutableSetter.call(F,X)}}g.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};g.prototype.$__reset=function F(){let A=this,B=!this.$isSubdocument?this.$getAllSubdocs({useCache:!0}):null;if(B&&B.length>0)for(let D of B)D.$__reset();return this.$__dirty().forEach(function(D){let J=D.value;if(J&&J[K2])J[n5]=J[K2],J[K2]={}}),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(D){A.$__.activePaths.require(D)}),this};/*!
|
|
286
|
+
* ignore
|
|
287
|
+
*/g.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 B=A.value;if(B&&B[K2]&&B[n5])B[K2]=B[n5]}for(let A of this.$getAllSubdocs())A.$__undoReset()};g.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 B=new Map(A.filter((J)=>J!=null).map((J)=>[J.path,J.value])),D=[];return A.forEach(function(J){if(!J)return;let Z=null,X=CC(J.path);for(let Y=0;Y<X.length-1;Y++)if(B.has(X[Y])){Z=B.get(X[Y]);break}if(Z==null)D.push(J);else if(Z!=null&&Z[K2]!=null&&Z.hasAtomics())Z[K2]={},Z[K2].$set=Z}),D};g.prototype.$__setSchema=function(F){vD1(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[FJ1]=F};g.prototype.$__getArrayPathsToValidate=function(){return VD||(VD=E9()),this.$__.activePaths.map("init","modify",function(F){return this.$__getValue(F)}.bind(this)).filter(function(F){return F&&Array.isArray(F)&&Y1.isMongooseDocumentArray(F)&&F.length}).reduce(function(F,A){return F.concat(A)},[]).filter(function(F){return F})};g.prototype.$getAllSubdocs=function(F){if(F?.useCache&&this.$__.saveOptions?.__subdocs)return this.$__.saveOptions.__subdocs;VD||(VD=E9()),i5=i5||c7();let A=[];function B(D){let J=[];for(let{path:Z}of D.$__schema.childSchemas){let X=D.$__getValue(Z);if(X==null)continue;if(X.$__)J.push(X);if(Array.isArray(X)){for(let Y of X)if(Y!=null&&Y.$__)J.push(Y)}if(X instanceof Map){for(let Y of X.values())if(Y!=null&&Y.$__)J.push(Y)}}for(let Z of J)B(Z);A.push(...J)}if(B(this),this.$__.saveOptions)this.$__.saveOptions.__subdocs=A;return A};/*!
|
|
288
|
+
* Runs queued functions
|
|
289
|
+
*/function WJ1(F){let A=F.$__schema&&F.$__schema.callQueue;if(!A.length)return;for(let B of A)if(B[0]!=="pre"&&B[0]!=="post"&&B[0]!=="on")F[B[0]].apply(F,B[1])}/*!
|
|
290
|
+
* ignore
|
|
291
|
+
*/g.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)};g.prototype.$toObject=function(F,A){let B=this.$__schema._defaultToObjectOptions(A),D=this.$__hasOnlyPrimitiveValues();F=Y1.isPOJO(F)?{...F}:{},F._calledWithOptions=F._calledWithOptions||{...F};let J;if(F._calledWithOptions.minimize!=null)J=F.minimize;else if(B!=null&&B.minimize!=null)J=B.minimize;else J=this.$__schema.options.minimize;if(F.minimize=J,!D)F._seen=F._seen||new Map;let Z=F._calledWithOptions.depopulate??B?.depopulate??F.depopulate??!1;if(Z&&F._isNested&&this.$__.wasPopulated)return A3(this.$__.wasPopulated.value||this._doc._id,F);if(Z)F.depopulate=!0;if(B!=null){for(let H of Object.keys(B))if(F[H]==null)F[H]=B[H]}F._isNested=!0,F.json=A,F.minimize=J;let X=F._parentOptions;F._parentOptions=this.$isSubdocument?F:null;let Y;if(D&&!F.flattenObjectIds)Y=this.$__toObjectShallow();else Y=A3(this._doc,F)||{};let $=F._calledWithOptions.getters??F.getters??B.getters??!1;if($){if(KJ1(this,Y),F.minimize)Y=nD1(Y)||{}}let G=F._calledWithOptions.virtuals??B.virtuals??X?.virtuals??void 0;if(G||$&&G!==!1)HC(this,Y,F,F);if(F.versionKey===!1&&this.$__schema.options.versionKey)delete Y[this.$__schema.options.versionKey];let E=F._calledWithOptions.transform??!0,C=void 0;if(E===!0)C=B.transform;else if(typeof E==="function")C=E;if(E)zJ1(this,Y);if(F.useProjection)UJ1(this,Y);if(typeof C==="function"){let H=C(this,Y,F);if(typeof H!=="undefined")Y=H}return Y};/*!
|
|
292
|
+
* Internal shallow clone alternative to `$toObject()`: much faster, no options processing
|
|
293
|
+
*/g.prototype.$__toObjectShallow=function F(){let A={};if(this._doc!=null)for(let B of Object.keys(this._doc)){let D=this._doc[B];if(D instanceof Date)A[B]=new Date(D);else if(D!==void 0)A[B]=D}return A};g.prototype.toObject=function(F){return this.$toObject(F)};/*!
|
|
294
|
+
* Applies virtuals properties to `json`.
|
|
295
|
+
*/function HC(F,A,B,D){let J=F.$__schema,Z=J.virtuals,X=Object.keys(Z),Y=X.length,$=Y,G,E,C=F._doc,H,q=typeof(D&&D.aliases)==="boolean"?D.aliases:!0;B=B||{};let W=null;if(Array.isArray(B.virtuals))W=new Set(B.virtuals);else if(B.virtuals&&B.virtuals.pathsToSkip){W=new Set(X);for(let K=0;K<B.virtuals.pathsToSkip.length;K++)if(W.has(B.virtuals.pathsToSkip[K]))W.delete(B.virtuals.pathsToSkip[K])}if(!C)return A;for(Y=0;Y<$;++Y){if(G=X[Y],W!=null&&!W.has(G))continue;if(!q&&J.aliases.hasOwnProperty(G))continue;if(E=G,B.path!=null){if(!G.startsWith(B.path+"."))continue;E=G.substring(B.path.length+1)}if(E.indexOf(".")===-1&&E===G){if(H=Z[G].applyGetters(void 0,F),H===void 0)continue;H=A3(H,B),A[E]=H;continue}let K=E.split(".");if(H=A3(F.get(G),B),H===void 0)continue;let U=K.length;C=A;for(let Q=0;Q<U-1;++Q)C[K[Q]]=C[K[Q]]||{},C=C[K[Q]];C[K[U-1]]=H}return A}function KJ1(F,A){let B=F.$__schema,D=Object.keys(B.paths),J=D.length,Z,X=F._doc,Y;if(!X)return A;while(J--){Z=D[J];let $=Z.split("."),G=$.length,E=G-1,C=A,H;if(X=F._doc,!F.$__isSelected(Z))continue;for(let q=0;q<G;++q){if(H=$[q],Y=X[H],C!=null&&typeof C!=="object")break;else if(q===E){if(C[H]=B.paths[Z].applyGetters(C[H],F),Array.isArray(C[H])&&B.paths[Z].$embeddedSchemaType)for(let W=0;W<C[H].length;++W)C[H][W]=B.paths[Z].$embeddedSchemaType.applyGetters(C[H][W],F)}else if(Y==null){if(H in X)C[H]=Y;break}else C=C[H]||(C[H]={});X=Y}}return A}function zJ1(F,A){let B=F.$__schema,D=Object.keys(B.paths||{});if(!F._doc)return A;for(let Z of D){let X=B.paths[Z];if(typeof X.options.transform==="function"){let Y=F.$get(Z);if(Y===void 0)continue;let $=X.options.transform.call(F,Y);cS(Z,$),Y1.setValue(Z,$,A)}else if(X.$embeddedSchemaType!=null&&typeof X.$embeddedSchemaType.options.transform==="function"){let Y=F.$get(Z);if(Y===void 0)continue;let $=[].concat(Y),G=X.$embeddedSchemaType.options.transform;for(let E=0;E<$.length;++E){let C=G.call(F,$[E]);$[E]=C,cS(Z,C)}A[Z]=$}}return A}function cS(F,A){if(rD1(A))throw new Error("`transform` function must be synchronous, but the transform on path `"+F+"` returned a promise.")}/*!
|
|
296
|
+
* ignore
|
|
297
|
+
*/function UJ1(F,A){let B=F.$__schema,D=Object.keys(B.paths||{});if(!F._doc)return A;let Z=F.$__.selected;if(Z===void 0)Z={},aD1.applyPaths(Z,B);if(Z==null||Object.keys(Z).length===0)return A;for(let X of D)if(Z[X]!=null&&!Z[X])delete A[X];return A}g.prototype.toJSON=function(F){return this.$toObject(F,!0)};/*!
|
|
298
|
+
* ignore
|
|
299
|
+
*/g.prototype.ownerDocument=function(){return this};g.prototype.parent=function(){if(this.$isSubdocument||this.$__.wasPopulated)return this.$__.parent;return this};g.prototype.$parent=g.prototype.parent;g.prototype.inspect=function(F){let A=Y1.isPOJO(F),B;if(A)B=F,B.minimize=!1;let D=arguments.length>0?this.toObject(B):this.toObject();if(D==null)return"MongooseDocument { "+D+" }";return D};if(EC.custom)g.prototype[EC.custom]=g.prototype.inspect;g.prototype.toString=function(){let F=this.inspect();if(typeof F==="string")return F;return EC(F)};g.prototype.equals=function(F){if(!F)return!1;let A=this.$__getValue("_id"),B=F.$__!=null?F.$__getValue("_id"):F;if(!A&&!B)return LD(this,F);return A&&A.equals?A.equals(B):A===B};g.prototype.populate=async function F(){let A={},B=[...arguments];if(typeof B[B.length-1]==="function")throw new x2("Document.prototype.populate() no longer accepts a callback");if(B.length!==0){let Z=Y1.populate.apply(null,B);for(let X of Z)A[X.path]=X}let D=Y1.object.vals(A),J=this.constructor;if(this.$__isNested){J=this.$__[BJ1].constructor;let Z=this.$__.nestedPath;D.forEach(function(X){X.path=Z+"."+X.path})}if(this.$session()!=null){let Z=this.$session();D.forEach((X)=>{if(X.options==null){X.options={session:Z};return}if(!("session"in X.options))X.options.session=Z})}return D.forEach((Z)=>{Z._localModel=J}),J.populate(this,D)};g.prototype.$getPopulatedDocs=function F(){let A=[];if(this.$__.populated!=null)A=A.concat(Object.keys(this.$__.populated));let B=[];for(let D of A){let J=this.$get(D);if(Array.isArray(J))B=B.concat(J);else if(J instanceof g)B.push(J)}return B};g.prototype.populated=function(F,A,B){if(A==null||A===!0){if(!this.$__.populated)return;if(typeof F!=="string")return;let J=F.endsWith(".$*")?F.replace(/\.\$\*$/,""):F,Z=this.$__.populated[J];if(Z)return A===!0?Z:Z.value;return}this.$__.populated||(this.$__.populated={}),this.$__.populated[F]={value:A,options:B};let D=F.split(".");for(let J=0;J<D.length-1;++J){let Z=D.slice(0,J+1).join("."),X=this.$get(Z);if(X!=null&&X.$__!=null&&this.$populated(Z)){let Y=D.slice(J+1).join(".");X.$populated(Y,A,B);break}}return A};g.prototype.$populated=g.prototype.populated;g.prototype.$assertPopulated=function F(A,B){if(Array.isArray(A))return A.forEach((D)=>this.$assertPopulated(D,B)),this;if(arguments.length>1)this.$set(B);if(!this.$populated(A))throw new x2(`Expected path "${A}" to be populated`);return this};g.prototype.depopulate=function(F){if(typeof F==="string")F=F.indexOf(" ")===-1?[F]:F.split(" ");let A,B=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],D=this.$__&&this.$__.populated||{};if(arguments.length===0){for(let Z of B)delete this.$$populatedVirtuals[Z],delete this._doc[Z],delete D[Z];let J=Object.keys(D);for(let Z of J){if(A=this.$populated(Z),!A)continue;if(delete D[Z],Array.isArray(A)){let X=Y1.getValue(Z,this._doc);if(X.isMongooseArray){let Y=X.__array;for(let $=0;$<Y.length;++$){let G=Y[$];if(G==null)continue;Y[$]=G instanceof g?G._doc._id:G._id}}else Y1.setValue(Z,A,this._doc)}else Y1.setValue(Z,A,this._doc)}return this}for(let J of F)if(A=this.$populated(J),delete D[J],B.indexOf(J)!==-1)delete this.$$populatedVirtuals[J],delete this._doc[J];else if(A)if(Array.isArray(A)){let Z=Y1.getValue(J,this._doc);if(Z.isMongooseArray){let X=Z.__array;for(let Y=0;Y<X.length;++Y){let $=X[Y];if($==null)continue;X[Y]=$ instanceof g?$._doc._id:$._id}}else Y1.setValue(J,A,this._doc)}else Y1.setValue(J,A,this._doc);return this};g.prototype.$__fullPath=function(F){return F||""};g.prototype.getChanges=function(){let F=this.$__delta();return F?F[1]:{}};g.prototype.$__delta=function F(){let A=this.$__dirty(),B=this.$__schema.options.optimisticConcurrency;if(B)if(Array.isArray(B)){let $=new Set(B);if(this.modifiedPaths().find((E)=>$.has(E)))this.$__.version=A.length?3:1}else this.$__.version=A.length?3:1;if(!A.length&&this.$__.version!==3)return;let D={},J={},Z=A.length,X=[],Y=0;if(D._id=this._doc._id,(D&&D._id&&D._id.$__||null)!=null)D._id=D._id.toObject({transform:!1,depopulate:!0});for(;Y<Z;++Y){let $=A[Y],G=$.value,E=QJ1(this,$.path,G);if(E){X.push(E);continue}if(!this.$populated($.path,!0)&&this.$__.selected){let H=$.path.split("."),q=H[0];if(this.$__.selected[q]&&this.$__.selected[q].$elemMatch)if(H.length>1&&H[1]==0&&typeof D[q]==="undefined")D[q]=this.$__.selected[q],H[1]="$",$.path=H.join(".");else{X.push($.path);continue}}if(this.$isDefault($.path)&&this.$__.selected){if($.path.indexOf(".")===-1&&hS(this.$__.selected,$.path))continue;if(CC($.path).find((q)=>hS(this.$__.isSelected,q)))continue}if(X.length)continue;if(G===void 0)Q4(this,D,J,$,1,"$unset");else if(G===null)Q4(this,D,J,$,null);else if(Y1.isMongooseArray(G)&&G.$path()&&G[K2])LJ1(this,D,J,$,G);else if(G[fD1.pathSymbol]&&Buffer.isBuffer(G))G=G.toObject(),Q4(this,D,J,$,G);else if(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[$.path]!=null){let H=this.$__.primitiveAtomics[$.path],q=mD1(H);Q4(this,D,J,$,H[q],q)}else G=A3(G,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}),Q4(this,D,J,$,G)}if(X.length)return new SD1(X);if(this.$__.version)this.$__version(D,J);if(Object.keys(J).length===0)return[D,null];return[D,J]};function QJ1(F,A,B){let D=F.$populated(A,!0);if(!D&&F.$__.selected){let Z=A.split(".")[0];if(F.$__.selected[Z+".$"])return Z}if(!(D&&Y1.isMongooseArray(B)))return;if(D.options.match||D.options.options&&Y1.object.hasOwnProperty(D.options.options,"limit")||D.options.options&&D.options.options.skip||D.options.select&&(D.options.select._id===0||/\s?-_id\s?/.test(D.options.select))){let Z=B[K2];if(Object.keys(Z).length===0||Z.$set||Z.$pop)return A}}function Q4(F,A,B,D,J,Z){if(Z||(Z="$set"),!B[Z])B[Z]={};if(B[Z][D.path]=J,F.$__schema.options.versionKey===!1)return;if(VJ1(F,D.path))return;if((3&F.$__.version)===3)return;if(F.$__schema.options.optimisticConcurrency)return;switch(Z){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}if(Z==="$push"||Z==="$addToSet"||Z==="$pullAll"||Z==="$pull")if(/\.\d+\.|\.\d+$/.test(D.path))F.$__.version=3;else F.$__.version=2;else if(/^\$p/.test(Z))F.$__.version=3;else if(Array.isArray(J))F.$__.version=3;else if(/\.\d+\.|\.\d+$/.test(D.path))F.$__.version=1}function LJ1(F,A,B,D,J){if(B.$set&&B.$set[D.path])return;if(typeof J.$__getAtomics==="function"){J.$__getAtomics().forEach(function(C){let H=C[0],q=C[1];Q4(F,A,B,D,q,H)});return}let Z=J[K2],X=Object.keys(Z),Y=X.length,$,G;if(Y===0){if(Y1.isMongooseObject(J))J=J.toObject({depopulate:1,_isNested:!0});else if(J.valueOf)J=J.valueOf();return Q4(F,A,B,D,J)}function E(C){return Y1.isMongooseObject(C)?C.toObject({depopulate:1,_isNested:!0}):C}while(Y--){if(G=X[Y],$=Z[G],Y1.isMongooseObject($))$=$.toObject({depopulate:!0,transform:!1,_isNested:!0});else if(Array.isArray($))$=$.map(E);else if($.valueOf)$=$.valueOf();if(G==="$addToSet")$={$each:$};Q4(F,A,B,D,$,G)}}function VJ1(F,A){let B=F.$__schema.options.skipVersioning;if(!B)return!1;return A=A.replace(/\.\d+\./,"."),B[A]}g.prototype.$clone=function(){let A=new this.constructor;if(A.$isNew=this.$isNew,this._doc)A._doc=A3(this._doc,{retainDocuments:!0});if(this.$__){let D=new this.$__.constructor;for(let J of Object.getOwnPropertyNames(this.$__)){if(J==="activePaths")continue;D[J]=A3(this.$__[J])}Object.assign(D.activePaths,A3({...this.$__.activePaths})),A.$__=D}return A};g.prototype.$createModifiedPathsSnapshot=function F(){let A=new WeakMap;if(!this.$isSubdocument){let B=this.$getAllSubdocs();for(let D of B)A.set(D,D.$__.activePaths.clone())}return new _D1(A,this.$__.activePaths.clone(),this.$__.version)};g.prototype.$restoreModifiedPathsSnapshot=function F(A){if(this.$__.activePaths=A.activePaths.clone(),this.$__.version=A.version,!this.$isSubdocument){let B=this.$getAllSubdocs();for(let D of B)if(A.subdocSnapshot.has(D))D.$__.activePaths=A.subdocSnapshot.get(D)}return this};g.prototype.$clearModifiedPaths=function F(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){let A=this.$getAllSubdocs();for(let B of A)B.$clearModifiedPaths()}return this};/*!
|
|
300
|
+
* Check if the given document only has primitive values
|
|
301
|
+
*/g.prototype.$__hasOnlyPrimitiveValues=function F(){return!this.$__.populated&&!this.$__.wasPopulated&&(this._doc==null||Object.values(this._doc).every((A)=>{return A==null||typeof A!=="object"||Y1.isNativeObject(A)&&!Array.isArray(A)||vS(A,"ObjectId")||vS(A,"Decimal128")}))};/*!
|
|
302
|
+
* Module exports.
|
|
303
|
+
*/g.VERSION_WHERE=1;g.VERSION_INC=2;g.VERSION_ALL=3;g.ValidationError=RD;eS.exports=oS=g});var J1=z((_J1)=>{/*!
|
|
304
|
+
* Module dependencies.
|
|
305
|
+
*/var RJ1=l6().UUID,wJ1=vO(),Zx=n2(),IJ1=j3(),Xx=tO(),WC=Z0(),NJ1=r2(),PJ1=K4(),Yx=pB(),$x=oO(),L4=H2(),MJ1=O7(),TJ1=eG(),s5=g5(),jJ1=eB(),uJ1=FD(),a5=D9(),{trustedSymbol:i7}=k7(),qC;_J1.specialProperties=a5;_J1.isMongooseArray=Yx.isMongooseArray;_J1.isMongooseDocumentArray=$x.isMongooseDocumentArray;_J1.registerMongooseArray=Yx.registerMongooseArray;_J1.registerMongooseDocumentArray=$x.registerMongooseDocumentArray;var KC=/\s/,zC=/\s+/;_J1.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};_J1.deepEqual=function F(A,B){if(A===B)return!0;if(typeof A!=="object"||typeof B!=="object")return A===B;if(A instanceof Date&&B instanceof Date)return A.getTime()===B.getTime();if(L4(A,"ObjectId")&&L4(B,"ObjectId")||L4(A,"Decimal128")&&L4(B,"Decimal128"))return A.toString()===B.toString();if(A instanceof RegExp&&B instanceof RegExp)return A.source===B.source&&A.ignoreCase===B.ignoreCase&&A.multiline===B.multiline&&A.global===B.global&&A.dotAll===B.dotAll&&A.unicode===B.unicode&&A.sticky===B.sticky&&A.hasIndices===B.hasIndices;if(A==null||B==null)return!1;if(A.prototype!==B.prototype)return!1;if(A instanceof Map||B instanceof Map){if(!(A instanceof Map)||!(B instanceof Map))return!1;return F(Array.from(A.keys()),Array.from(B.keys()))&&F(Array.from(A.values()),Array.from(B.values()))}if(A instanceof Number&&B instanceof Number)return A.valueOf()===B.valueOf();if(Buffer.isBuffer(A))return _J1.buffer.areEqual(A,B);if(Array.isArray(A)||Array.isArray(B)){if(!Array.isArray(A)||!Array.isArray(B))return!1;let X=A.length;if(X!==B.length)return!1;for(let Y=0;Y<X;++Y)if(!F(A[Y],B[Y]))return!1;return!0}if(A.$__!=null)A=A._doc;else if(s5(A))A=A.toObject();if(B.$__!=null)B=B._doc;else if(s5(B))B=B.toObject();let D=Object.keys(A),J=Object.keys(B),Z=D.length;if(Z!==J.length)return!1;for(let X=Z-1;X>=0;X--)if(D[X]!==J[X])return!1;for(let X of D)if(!F(A[X],B[X]))return!1;return!0};_J1.last=function(F){if(F.length>0)return F[F.length-1];return};/*!
|
|
306
|
+
* ignore
|
|
307
|
+
*/_J1.promiseOrCallback=jJ1;/*!
|
|
308
|
+
* ignore
|
|
309
|
+
*/_J1.cloneArrays=function F(A){if(!Array.isArray(A))return A;return A.map((B)=>_J1.cloneArrays(B))};/*!
|
|
310
|
+
* ignore
|
|
311
|
+
*/_J1.omit=function F(A,B){if(B==null)return Object.assign({},A);if(!Array.isArray(B))B=[B];let D=Object.assign({},A);for(let J of B)delete D[J];return D};_J1.merge=function F(A,B,D,J){D=D||{};let Z=Object.keys(B),X=0,Y=Z.length,$;if(B[i7])A[i7]=B[i7];J=J||"";let G=D.omitNested||{};while(X<Y){if($=Z[X++],D.omit&&D.omit[$])continue;if(G[J])continue;if(a5.has($))continue;if(A[$]==null)if(MJ1(B[$]))A[$]={...B[$]};else if(Array.isArray(B[$]))A[$]=[...B[$]];else A[$]=B[$];else if(_J1.isObject(B[$])){if(!_J1.isObject(A[$]))A[$]={};if(B[$]!=null){if(D.isDiscriminatorSchemaMerge&&(B[$].$isSingleNested&&A[$].$isMongooseDocumentArray)||B[$].$isMongooseDocumentArray&&A[$].$isSingleNested)continue;else if(B[$].instanceOfSchema){if(A[$].instanceOfSchema)uJ1(A[$],B[$].clone(),D.isDiscriminatorSchemaMerge);else A[$]=B[$].clone();continue}else if(L4(B[$],"ObjectId")){A[$]=new IJ1(B[$]);continue}}F(A[$],B[$],D,J?J+"."+$:$)}else if(D.overwrite)A[$]=B[$]}return A};_J1.toObject=function F(A){qC||(qC=O2());let B;if(A==null)return A;if(A instanceof qC)return A.toObject();if(Array.isArray(A)){B=[];for(let D of A)B.push(F(D));return B}if(_J1.isPOJO(A)){if(B={},A[i7])B[i7]=A[i7];for(let D of Object.keys(A)){if(a5.has(D))continue;B[D]=F(A[D])}return B}return A};_J1.isObject=PJ1;_J1.isPOJO=O7();_J1.isNonBuiltinObject=function F(A){return typeof A==="object"&&!_J1.isNativeObject(A)&&!_J1.isMongooseType(A)&&!(A instanceof RJ1)&&A!=null};_J1.isNativeObject=function(F){return Array.isArray(F)||F instanceof Date||F instanceof Boolean||F instanceof Number||F instanceof String};_J1.isEmptyObject=function(F){return F!=null&&typeof F==="object"&&Object.keys(F).length===0};_J1.hasKey=function F(A,B){let D=Object.keys(A);for(let J of D){if(J===B)return!0;if(_J1.isPOJO(A[J])&&_J1.hasKey(A[J],B))return!0}return!1};_J1.tick=function F(A){if(typeof A!=="function")return;return function(){try{A.apply(this,arguments)}catch(B){NJ1(function(){throw B})}}};_J1.isMongooseType=function(F){return L4(F,"ObjectId")||L4(F,"Decimal128")||F instanceof Buffer};_J1.isMongooseObject=s5;_J1.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(wJ1(A.expires)/1000),delete A.expires};_J1.populate=function F(A,B,D,J,Z,X,Y,$){let G=null;if(arguments.length===1){if(A instanceof Xx)return A._docs={},A._childDocs=[],[A];if(Array.isArray(A))return E(A).map((H)=>_J1.populate(H)[0]);if(_J1.isObject(A))G=Object.assign({},A);else G={path:A}}else if(typeof D==="object")G={path:A,select:B,match:D,options:J};else G={path:A,select:B,model:D,match:J,options:Z,populate:X,justOne:Y,count:$};if(typeof G.path!=="string")throw new TypeError("utils.populate: invalid path. Expected string. Got typeof `"+typeof A+"`");return OJ1(G);function E(C){let H=[];return C.forEach(function(q){if(KC.test(q.path))q.path.split(zC).forEach(function(K){let U=Object.assign({},q);U.path=K,H.push(U)});else H.push(q)}),H}};function OJ1(F){if(Array.isArray(F.populate)){let D=[];F.populate.forEach(function(J){if(KC.test(J.path)){let Z=Object.assign({},J);Z.path.split(zC).forEach(function(Y){Z.path=Y,D.push(_J1.populate(Z)[0])})}else D.push(_J1.populate(J)[0])}),F.populate=_J1.populate(D)}else if(F.populate!=null&&typeof F.populate==="object")F.populate=_J1.populate(F.populate);let A=[],B=KC.test(F.path)?F.path.split(zC):[F.path];if(F.options!=null)F.options=WC(F.options);for(let D of B)A.push(new Xx(Object.assign({},F,{path:D})));return A}_J1.getValue=function(F,A,B){return Zx.get(F,A,SJ1,B)};/*!
|
|
312
|
+
* ignore
|
|
313
|
+
*/var kJ1=Object.freeze({getters:!1});function SJ1(F,A){let B=F?._doc||F;if(B!=null&&B.isMongooseArrayProxy)B=B.__array;return B instanceof Map?B.get(A,kJ1):B[A]}_J1.setValue=function(F,A,B,D,J){Zx.set(F,A,B,"_doc",D,J)};_J1.object={};_J1.object.vals=function F(A){let B=Object.keys(A),D=B.length,J=[];while(D--)J.push(A[B[D]]);return J};var xJ1=Object.prototype.hasOwnProperty;_J1.object.hasOwnProperty=function(F,A){return xJ1.call(F,A)};_J1.isNullOrUndefined=function(F){return F===null||F===void 0};/*!
|
|
314
|
+
* ignore
|
|
315
|
+
*/_J1.array={};_J1.array.flatten=function F(A,B,D){return D||(D=[]),A.forEach(function(J){if(Array.isArray(J))F(J,B,D);else if(!B||B(J))D.push(J)}),D};/*!
|
|
316
|
+
* ignore
|
|
317
|
+
*/var fJ1=Object.prototype.hasOwnProperty;_J1.hasUserDefinedProperty=function(F,A){if(F==null)return!1;if(Array.isArray(A)){for(let B of A)if(_J1.hasUserDefinedProperty(F,B))return!0;return!1}if(fJ1.call(F,A))return!0;if(typeof F==="object"&&A in F){let B=F[A];return B!==Object.prototype[A]&&B!==Array.prototype[A]}return!1};/*!
|
|
318
|
+
* ignore
|
|
319
|
+
*/var Fx=Math.pow(2,32)-1;_J1.isArrayIndex=function(F){if(typeof F==="number")return F>=0&&F<=Fx;if(typeof F==="string"){if(!/^\d+$/.test(F))return!1;return F=+F,F>=0&&F<=Fx}return!1};_J1.array.unique=function(F){let A=new Set,B=new Set,D=[];for(let J of F)if(typeof J==="number"||typeof J==="string"||J==null){if(A.has(J))continue;D.push(J),A.add(J)}else if(L4(J,"ObjectId")){if(B.has(J.toString()))continue;D.push(J),B.add(J.toString())}else D.push(J);return D};_J1.buffer={};_J1.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 B=0,D=F.length;B<D;++B)if(F[B]!==A[B])return!1;return!0};_J1.getFunctionName=TJ1;_J1.decorate=function(F,A){for(let B in A){if(a5.has(B))continue;F[B]=A[B]}};_J1.mergeClone=function(F,A){if(s5(A))A=A.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});let B=Object.keys(A),D=B.length,J=0,Z;while(J<D){if(Z=B[J++],a5.has(Z))continue;if(typeof F[Z]==="undefined")F[Z]=WC(A[Z],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{let X=A[Z];if(X!=null&&X.valueOf&&!(X instanceof Date))X=X.valueOf();if(_J1.isObject(X)){let Y=X;if(s5(X)&&!X.isMongooseBuffer)Y=Y.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});if(X.isMongooseBuffer)Y=Buffer.from(Y);_J1.mergeClone(F[Z],Y)}else F[Z]=WC(X,{flattenDecimals:!1})}}};_J1.each=function(F,A){for(let B of F)A(B)};_J1.renameObjKey=function(F,A,B){return Object.keys(F).reduce((J,Z)=>{if(Z===A)J[B]=F[A];else J[Z]=F[Z];return J},{})};/*!
|
|
320
|
+
* ignore
|
|
321
|
+
*/_J1.getOption=function(F){let A=Array.prototype.slice.call(arguments,1);for(let B of A){if(B==null)continue;if(B[F]!=null)return B[F]}return null};/*!
|
|
322
|
+
* ignore
|
|
323
|
+
*/_J1.noop=function(){};_J1.errorToPOJO=function F(A){if(!(A instanceof Error))throw new Error("`error` must be `instanceof Error`.");let D={};for(let J of Object.getOwnPropertyNames(A))D[J]=A[J];return D};/*!
|
|
324
|
+
* ignore
|
|
325
|
+
*/_J1.warn=function F(A){return process.emitWarning(A,{code:"MONGOOSE"})};_J1.injectTimestampsOption=function F(A,B){if(B==null)return;A.timestamps=B}});var M0=z((PD,Ux)=>{/*!
|
|
326
|
+
* Module dependencies.
|
|
327
|
+
*/var r5=W2(),Kx=i2(),WZ1=tB(),KZ1=jE(),ND=Z0(),LC=xO(),zZ1=_O(),VC=bO(),Cx=r2(),UZ1=o().schemaTypeSymbol,C9=J1(),zx=o().validatorErrorSymbol,QZ1=o().documentIsModified,LZ1=o().populateModelSymbol,RC=r5.CastError,wC=r5.ValidatorError,VZ1={_skipMarkModified:!0};function H1(F,A,B){this[UZ1]=!0,this.path=F,this.instance=B,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 D=this.constructor.defaultOptions||{},J=Object.keys(D);for(let Y of J)if(Y==="validate")this.validate(D.validate);else if(D.hasOwnProperty(Y)&&!Object.prototype.hasOwnProperty.call(A,Y))A[Y]=D[Y];if(A.select==null)delete A.select;let Z=this.OptionsConstructor||Kx;if(this.options=new Z(A),this._index=null,C9.hasUserDefinedProperty(this.options,"immutable"))this.$immutable=this.options.immutable,LC(this);let X=Object.keys(this.options);for(let Y of X){if(Y==="cast"){if(Array.isArray(this.options[Y]))this.castFunction.apply(this,this.options[Y]);else this.castFunction(this.options[Y]);continue}if(C9.hasUserDefinedProperty(this.options,Y)&&typeof this[Y]==="function"){if(Y==="index"&&this._index){if(A.index===!1){let E=this._index;if(typeof E==="object"&&E!=null){if(E.unique)throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(E.sparse)throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}let $=A[Y];if(Y==="default"){this.default($);continue}let G=Array.isArray($)?$:[$];this[Y].apply(this,G)}}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}H1.prototype.OptionsConstructor=Kx;H1.prototype.path;H1.prototype.validators;H1.prototype.isRequired;H1.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};H1.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=(B)=>B;return this._cast=A,this._cast};H1.prototype.castFunction=function F(A,B){if(arguments.length===0)return this._castFunction;if(A===!1)A=this.constructor._defaultCaster||((D)=>D);if(typeof A==="string")return this._castErrorMessage=A,this._castFunction;if(A!=null)this._castFunction=A;if(B!=null)this._castErrorMessage=B;return this._castFunction};H1.prototype.cast=function F(){throw new Error("Base SchemaType class does not implement a `cast()` function")};H1.set=function F(A,B){if(!this.hasOwnProperty("defaultOptions"))this.defaultOptions=Object.assign({},this.defaultOptions);this.defaultOptions[A]=B};H1.get=function(F){this.getters=this.hasOwnProperty("getters")?this.getters:[],this.getters.push(F)};H1.prototype.default=function(F){if(arguments.length===1){if(F===void 0){this.defaultValue=void 0;return}if(F!=null&&F.instanceOfSchema)throw new r5("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};H1.prototype.index=function(F){return this._index=F,C9.expires(this._index),this};H1.prototype.unique=function(F){if(this._index===!1){if(!F)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}if(!this.options.hasOwnProperty("index")&&F===!1)return this;if(this._index==null||this._index===!0)this._index={};else if(typeof this._index==="string")this._index={type:this._index};return this._index.unique=F,this};H1.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};H1.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};H1.prototype.immutable=function(F){return this.$immutable=F,LC(this),this};H1.prototype.transform=function(F){return this.options.transform=F,this};H1.prototype.set=function(F){if(typeof F!=="function")throw new TypeError("A setter must be a function.");return this.setters.push(F),this};H1.prototype.get=function(F){if(typeof F!=="function")throw new TypeError("A getter must be a function.");return this.getters.push(F),this};H1.prototype.validateAll=function(F){for(let A=0;A<F.length;A++)this.validate(F[A]);return this};H1.prototype.validate=function(F,A,B){if(typeof F==="function"||F&&C9.getFunctionName(F.constructor)==="RegExp"){let X;if(typeof A==="function")X={validator:F,message:A},X.type=B||"user defined";else if(A instanceof Object&&!B){if(X=VC(A)?Object.assign({},A):ND(A),!X.message)X.message=X.msg;X.validator=F,X.type=X.type||"user defined"}else{if(A==null)A=r5.messages.general.default;if(!B)B="user defined";X={message:A,type:B,validator:F}}return this.validators.push(X),this}let D,J,Z;for(D=0,J=arguments.length;D<J;D++){if(Z=arguments[D],!C9.isPOJO(Z)){let X="Invalid validator. Received ("+typeof Z+") "+Z+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()";throw new Error(X)}this.validate(Z.validator,Z)}return this};H1.prototype.required=function(F,A){let B={};if(arguments.length>0&&F==null)return this.validators=this.validators.filter(function(Z){return Z.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;if(typeof F==="object")B=F,A=B.message||A,F=F.isRequired;if(F===!1)return this.validators=this.validators.filter(function(Z){return Z.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;let D=this;if(this.isRequired=!0,this.requiredValidator=function(Z){let X=this&&this.$__&&this.$__.cachedRequired;if(X!=null&&!this.$__isSelected(D.path)&&!this[QZ1](D.path))return!0;if(X!=null&&D.path in X){let Y=X[D.path]?D.checkRequired(Z,this):!0;return delete X[D.path],Y}else if(typeof F==="function")return F.apply(this)?D.checkRequired(Z,this):!0;return D.checkRequired(Z,this)},this.originalRequiredValue=F,typeof F==="string")A=F,F=void 0;let J=A||r5.messages.general.required;return this.validators.unshift(Object.assign({},B,{validator:this.requiredValidator,message:J,type:"required"})),this};H1.prototype.ref=function(F){return this.options.ref=F,this};H1.prototype.getDefault=function(F,A,B){let D;if(typeof this.defaultValue==="function")if(this.defaultValue===Date.now||this.defaultValue===Array||this.defaultValue.name.toLowerCase()==="objectid")D=this.defaultValue.call(F);else D=this.defaultValue.call(F,F);else D=this.defaultValue;if(D!==null&&D!==void 0){if(typeof D==="object"&&(!this.options||!this.options.shared))D=ND(D);if(B&&B.skipCast)return this._applySetters(D,F);let J=this.applySetters(D,F,A,void 0,VZ1);if(J&&!Array.isArray(J)&&J.$isSingleNested)J.$__parent=F;return J}return D};H1.prototype._applySetters=function(F,A,B,D,J){let Z=F;if(B)return Z;let X=this.setters;for(let Y=X.length-1;Y>=0;Y--)Z=X[Y].call(A,Z,D,this,J);return Z};/*!
|
|
328
|
+
* ignore
|
|
329
|
+
*/H1.prototype._castNullish=function F(A){return A};H1.prototype.applySetters=function(F,A,B,D,J){let Z=this._applySetters(F,A,B,D,J);if(Z==null)return this._castNullish(Z);return Z=this.cast(Z,A,B,D,J),Z};H1.prototype.applyGetters=function(F,A){let B=F,D=this.getters,J=D.length;if(J===0)return B;for(let Z=0;Z<J;++Z)B=D[Z].call(A,B,this);return B};H1.prototype.select=function F(A){return this.selected=!!A,this};H1.prototype.doValidate=function(F,A,B,D){let J=!1,Z=this.path;if(typeof A!=="function")throw new TypeError(`Must pass callback function to doValidate(), got ${typeof A}`);let X=this.validators.filter((G)=>typeof G==="object"&&G!==null),Y=X.length;if(!Y)return A(null);for(let G=0,E=X.length;G<E;++G){if(J)break;let C=X[G],H=C.validator,q,W=VC(C)?Object.assign({},C):ND(C);if(W.path=D&&D.path?D.path:Z,W.fullPath=this.$fullPath,W.value=F,H instanceof RegExp){$(H.test(F),W,B);continue}if(typeof H!=="function")continue;if(F===void 0&&H!==this.requiredValidator){$(!0,W,B);continue}try{if(W.propsParameter)q=H.call(B,F,W);else q=H.call(B,F)}catch(K){if(q=!1,W.reason=K,K.message)W.message=K.message}if(q!=null&&typeof q.then==="function")q.then(function(K){$(K,W,B)},function(K){W.reason=K,W.message=K.message,q=!1,$(q,W,B)});else $(q,W,B)}function $(G,E,C){if(J)return;if(G===void 0||G){if(--Y<=0)Cx(function(){A(null)})}else J=new(E.ErrorConstructor||wC)(E,C),J[zx]=!0,Cx(function(){A(J)})}};function Hx(F,A){if(F!==void 0&&!F){let D=new(A.ErrorConstructor||wC)(A);return D[zx]=!0,D}}H1.prototype.doValidateSync=function(F,A,B){let D=this.path;if(!this.validators.length)return null;let Z=this.validators;if(F===void 0)if(this.validators.length!==0&&this.validators[0].type==="required")Z=[this.validators[0]];else return null;let X=null,Y=0,$=Z.length;for(Y=0;Y<$;++Y){let G=Z[Y];if(G===null||typeof G!=="object")continue;let E=G.validator,C=VC(G)?Object.assign({},G):ND(G);C.path=B&&B.path?B.path:D,C.fullPath=this.$fullPath,C.value=F;let H=!1;if(zZ1(E))continue;if(E instanceof RegExp){X=Hx(E.test(F),C);continue}if(typeof E!=="function")continue;try{if(C.propsParameter)H=E.call(A,F,C);else H=E.call(A,F)}catch(q){H=!1,C.reason=q}if(H!=null&&typeof H.then==="function")continue;if(X=Hx(H,C),X)break}return X};H1._isRef=function(F,A,B,D){let J=D&&F.options&&(F.options.ref||F.options.refPath);if(!J&&B&&B.$__!=null){let Z=B.$__fullPath(F.path,!0),X=B.ownerDocument();J=Z!=null&&X.$populated(Z)||B.$populated(F.path)}if(J){if(A==null)return!0;if(!Buffer.isBuffer(A)&&A._bsontype!=="Binary"&&C9.isObject(A))return!0;return D}return!1};/*!
|
|
330
|
+
* ignore
|
|
331
|
+
*/H1.prototype._castRef=function F(A,B,D){if(A==null)return A;if(A.$__!=null)return A.$__.wasPopulated=A.$__.wasPopulated||{value:A._doc._id},A;if(Buffer.isBuffer(A)||!C9.isObject(A)){if(D)return A;throw new RC(this.instance,A,this.path,null,this)}let J=B.$__fullPath(this.path,!0),X=B.ownerDocument().$populated(J,!0),Y=A;if(!B.$__.populated||!B.$__.populated[J]||!B.$__.populated[J].options||!B.$__.populated[J].options.options||!B.$__.populated[J].options.options.lean)Y=new X.options[LZ1](A),Y.$__.wasPopulated={value:Y._doc._id};return Y};/*!
|
|
332
|
+
* ignore
|
|
333
|
+
*/function qx(F,A){return this.castForQuery(null,F,A)}/*!
|
|
334
|
+
* ignore
|
|
335
|
+
*/function RZ1(F,A){let B=this;if(!Array.isArray(F))return[this.castForQuery(null,F,A)];return F.map(function(D){return B.castForQuery(null,D,A)})}function Wx(F,A){let B=this;if(!Array.isArray(F))return[this.castForQuery(null,F,A)];return F.map(function(D){if(Array.isArray(D)&&D.length===0)return D;return B.castForQuery(null,D,A)})}/*!
|
|
336
|
+
* ignore
|
|
337
|
+
*/H1.prototype.$conditionalHandlers={$all:RZ1,$eq:qx,$in:Wx,$ne:qx,$nin:Wx,$exists:WZ1,$type:KZ1};H1.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=this.$conditionalHandlers[F],!D)throw new Error("Can't use "+F);return D.call(this,A,B)}try{return this.applySetters(A,B)}catch(J){if(J instanceof RC&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};H1.checkRequired=function(F){if(arguments.length!==0)this._checkRequired=F;return this._checkRequired};H1.prototype.checkRequired=function(F){return F!=null};H1.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,LC(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};H1.prototype.getEmbeddedSchemaType=function F(){return this.$embeddedSchemaType};/*!
|
|
338
|
+
* Module exports.
|
|
339
|
+
*/Ux.exports=PD=H1;PD.CastError=RC;PD.ValidatorError=wC});var IC=z((Nw1,Qx)=>{var m6=q6();class s2{constructor(F){if(Object.assign(this,F),F!=null&&F.options!=null)this.options=Object.assign({},F.options)}}Object.defineProperty(s2.prototype,"ref",m6);Object.defineProperty(s2.prototype,"refPath",m6);Object.defineProperty(s2.prototype,"localField",m6);Object.defineProperty(s2.prototype,"foreignField",m6);Object.defineProperty(s2.prototype,"justOne",m6);Object.defineProperty(s2.prototype,"count",m6);Object.defineProperty(s2.prototype,"match",m6);Object.defineProperty(s2.prototype,"options",m6);Object.defineProperty(s2.prototype,"skip",m6);Object.defineProperty(s2.prototype,"limit",m6);Object.defineProperty(s2.prototype,"perDocumentLimit",m6);Qx.exports=s2});var MD=z((Pw1,Lx)=>{Lx.exports=function F(A,B,D){if(A==null)return A;if(A._doc!=null)A=A._doc;if(arguments.length>=3){if(typeof A!=="object")return;if(D===void 0)return;if(A instanceof Map)A.set(B,D);else A[B]=D;return D}if(B==="$*")return A instanceof Map?Array.from(A.values()):Object.keys(A).map((J)=>A[J]);if(A instanceof Map)return A.get(B);return A[B]}});var NC=z((Mw1,Ix)=>{var wZ1=C1(),IZ1=hE(),Vx=MD(),Rx=n2(),NZ1=import.meta.require("util"),PZ1=J1(),wx=/(\.\d+$|\.\d+\.)/g;Ix.exports=function F(A,B,D,J,Z){if(A==null)return[];if(typeof A==="string"&&Z!=null&&IZ1(Z,A))throw new wZ1("refPath `"+A+"` must not be excluded in projection, got "+NZ1.inspect(Z));if(wx.test(D)){let $=D.split(wx);if($[$.length-1]==="")throw new Error("Can't populate individual element in an array");let G="",E=A;for(let q=0;q<$.length;q+=2){let W=$[q];if(E.startsWith(W+"."))G+=E.substring(0,W.length)+$[q+1],E=E.substring(W.length+1);else if(q===$.length-1){G+=E,E="";break}else throw new Error("Could not normalize ref path, chunk "+W+" not in populated path")}let C=Rx.get(G,B,Vx),H=Array.isArray(C)?C:[C];return H=PZ1.array.flatten(H),H}let X=Rx.get(A,B,Vx),Y;if(J!=null&&J.virtuals.hasOwnProperty(A))Y=[J.virtuals[A].applyGetters(void 0,B)];else Y=Array.isArray(X)?X:[X];return Y}});var TD=z((Tw1,Nx)=>{var MZ1=NC(),TZ1=J1(),jZ1=o().modelSymbol;function S3(F,A){this.path=A,this.getters=[],this.setters=[],this.options=Object.assign({},F)}S3.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(B){this.$locals[A]=B})};/*!
|
|
340
|
+
* ignore
|
|
341
|
+
*/S3.prototype.clone=function(){let F=new S3(this.options,this.path);return F.getters=[].concat(this.getters),F.setters=[].concat(this.setters),F};S3.prototype.get=function(F){return this.getters.push(F),this};S3.prototype.set=function(F){return this.setters.push(F),this};S3.prototype.applyGetters=function(F,A){if(TZ1.hasUserDefinedProperty(this.options,["ref","refPath"])&&A.$$populatedVirtuals&&A.$$populatedVirtuals.hasOwnProperty(this.path))F=A.$$populatedVirtuals[this.path];let B=F;for(let D of this.getters)B=D.call(A,B,this,A);return B};S3.prototype.applySetters=function(F,A){let B=F;for(let D of this.setters)B=D.call(A,B,this,A);return B};S3.prototype._getModelNamesForPopulate=function F(A){if(this.options.refPath)return MZ1(this.options.refPath,A,this.path);let B=null;if(typeof this.options.ref==="function"&&!this.options.ref[jZ1])B=this.options.ref.call(A,A);else B=this.options.ref;if(B!=null&&!Array.isArray(B))return[B];return B};/*!
|
|
342
|
+
* exports
|
|
343
|
+
*/Nx.exports=S3});var PC=z((jw1,Px)=>{Px.exports=function F(A){let B={_id:{auto:!0}};B._id[A.options.typeKey]="ObjectId",A.add(B)}});var MC=z((uw1,Mx)=>{Mx.exports=function F(A,B){let D=A.discriminatorMapping&&A.discriminatorMapping.value;if(D&&!("sparse"in B)){let J=A.options.discriminatorKey;B.partialFilterExpression=B.partialFilterExpression||{},B.partialFilterExpression[J]=D}return B}});var jx=z((Ow1,Tx)=>{var TC=C0(),uZ1=K4(),OZ1=MC();Tx.exports=function F(A){let B=[],D=new WeakMap,J=A.constructor.indexTypes,Z=new Map;return X(A),B;function X($,G,E){if(D.has($))return;D.set($,!0),G=G||"";let C=Object.keys($.paths);for(let H of C){let q=$.paths[H];if(E!=null&&E.paths[H])continue;if(q.$isMongooseDocumentArray||q.$isSingleNested){if(TC(q,"options.excludeIndexes")!==!0&&TC(q,"schemaOptions.excludeIndexes")!==!0&&TC(q,"schema.options.excludeIndexes")!==!0)X(q.schema,G+H+".");if(q.schema.discriminators!=null){let K=q.schema.discriminators,U=Object.keys(K);for(let Q of U)X(K[Q],G+H+".",q.schema)}if(q.$isMongooseDocumentArray)continue}let W=q._index||q.caster&&q.caster._index;if(W!==!1&&W!==null&&W!==void 0){let K={},U=uZ1(W),Q=U?W:{},L=typeof W==="string"?W:U?W.type:!1;if(L&&J.indexOf(L)!==-1)K[G+H]=L;else if(Q.text)K[G+H]="text",delete Q.text;else{let w=!1;if(W==="descending"||W==="desc")w=!0;else if(W==="ascending"||W==="asc")w=!1;else w=Number(W)===-1;K[G+H]=w?-1:1}if(delete Q.type,!("background"in Q))Q.background=!0;if($.options.autoIndex!=null)Q._autoIndex=$.options.autoIndex;let V=Q&&Q.name;if(typeof V==="string")if(Z.has(V))Object.assign(Z.get(V),K);else B.push([K,Q]),Z.set(V,K);else B.push([K,Q]),Z.set(V,K)}}if(D.delete($),G)Y($,G);else $._indexes.forEach(function(H){let q=H[1];if(!("background"in q))q.background=!0;OZ1($,q)}),B=B.concat($._indexes)}function Y($,G){let E=$._indexes,C=E.length;for(let H=0;H<C;++H){let q=E[H][0],W=E[H][1],K=Object.keys(q),U=K.length,Q={};for(let V=0;V<U;++V){let w=K[V];Q[G+w]=q[w]}let L=Object.assign({},W);if(W!=null&&W.partialFilterExpression!=null){L.partialFilterExpression={};let V=W.partialFilterExpression;for(let w of Object.keys(V))L.partialFilterExpression[G+w]=V[w]}B.push([Q,L])}}}});var jC=z((kw1,ux)=>{ux.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 kx=z((Sw1,Ox)=>{/*!
|
|
344
|
+
* ignore
|
|
345
|
+
*/Ox.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(kZ1),A};function kZ1(){if(this._id!=null)return this._id.toString();return null}});var xx=z((xw1,Sx)=>{Sx.exports=function F(A,B,D,J){if(J.justOne||J.count){if(A[B]=Array.isArray(D)?D[0]:D,typeof A[B]!=="object")A[B]=J.count?D:null}else A[B]=Array.isArray(D)?D:D==null?[]:[D],A[B]=A[B].filter(function(Z){return Z&&typeof Z==="object"});return A[B]}});var t5=z((fw1,fx)=>{fx.exports=function F(A){return A.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}});var jD=z((_w1,_x)=>{_x.exports=SZ1;/*!
|
|
346
|
+
* ignore
|
|
347
|
+
*/function SZ1(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 OC=z((gw1,gx)=>{var xZ1=t5(),x3=jD();gx.exports=H9;/*!
|
|
348
|
+
* ignore
|
|
349
|
+
*/function H9(F,A,B){if(A==null)return;if(Object.keys(A).some((Y)=>Y[0]==="$")){if(A.$push)X(A.$push);if(A.$addToSet)X(A.$addToSet);if(A.$set!=null){let Y=Object.keys(A.$set);for(let $ of Y)uC(B,$,A.$set,F)}if(A.$setOnInsert!=null){let Y=Object.keys(A.$setOnInsert);for(let $ of Y)uC(B,$,A.$setOnInsert,F)}}let Z=Object.keys(A).filter((Y)=>Y[0]!=="$");for(let Y of Z)uC(B,Y,A,F);function X(Y){for(let $ of Object.keys(Y)){let G=B.path($.replace(/\.\$\./i,".").replace(/.\$$/,""));if(Y[$]&&G&&G.$isMongooseDocumentArray&&G.schema.options.timestamps){let E=G.schema.options.timestamps,C=x3(E,"createdAt"),H=x3(E,"updatedAt");if(Y[$].$each)Y[$].$each.forEach(function(q){if(H!=null)q[H]=F;if(C!=null)q[C]=F;H9(F,q,G.schema)});else{if(H!=null)Y[$][H]=F;if(C!=null)Y[$][C]=F;H9(F,Y[$],G.schema)}}}}}function fZ1(F,A,B){let D=A.schema.options.timestamps,J=F.length;if(!D){for(let Y=0;Y<J;++Y)H9(B,F[Y],A.schema);return}let Z=x3(D,"createdAt"),X=x3(D,"updatedAt");for(let Y=0;Y<J;++Y){if(X!=null)F[Y][X]=B;if(Z!=null)F[Y][Z]=B;H9(B,F[Y],A.schema)}}function _Z1(F,A,B){let D=A.schema.options.timestamps;if(!D){H9(B,F,A.schema);return}let J=x3(D,"createdAt"),Z=x3(D,"updatedAt");if(Z!=null)F[Z]=B;if(J!=null)F[J]=B;H9(B,F,A.schema)}function uC(F,A,B,D){let J=xZ1(A),Z=F.path(J);if(!Z)return;let X=[],Y=J.split(".");for(let $=Y.length-1;$>0;--$){let G=F.path(Y.slice(0,$).join("."));if(G!=null&&(G.$isMongooseDocumentArray||G.$isSingleNested))X.push({parentPath:A.split(".").slice(0,$).join("."),parentSchemaType:G})}if(Array.isArray(B[A])&&Z.$isMongooseDocumentArray)fZ1(B[A],Z,D);else if(B[A]&&Z.$isSingleNested)_Z1(B[A],Z,D);else if(X.length>0)for(let $ of X){let{parentPath:G,parentSchemaType:E}=$,C=E.schema.options.timestamps,H=x3(C,"updatedAt");if(!C||H==null)continue;if(E.$isSingleNested)B[G+"."+H]=D;else if(E.$isMongooseDocumentArray){let q=A.substring(G.length+1);if(/^\d+$/.test(q)){B[G+"."+q][H]=D;continue}let W=q.indexOf(".");q=W!==-1?q.substring(0,W):q,B[G+"."+q+"."+H]=D}}else if(Z.schema!=null&&Z.schema!=F&&B[A]){let $=Z.schema.options.timestamps,G=x3($,"createdAt"),E=x3($,"updatedAt");if(!$)return;if(E!=null)B[A][E]=D;if(G!=null)B[A][G]=D}}});var kC=z((bw1,bx)=>{/*!
|
|
350
|
+
* ignore
|
|
351
|
+
*/var gZ1=C0();bx.exports=bZ1;/*!
|
|
352
|
+
* ignore
|
|
353
|
+
*/function bZ1(F,A,B,D,J,Z){let X=D,Y=X,$=gZ1(J,"timestamps",!0);if(!$||X==null)return D;let G=$!=null&&$.createdAt===!1,E=$!=null&&$.updatedAt===!1;if(Z){if(D&&D.$set)D=D.$set,X.$set={},Y=X.$set;if(!E&&B&&!D[B])Y[B]=F;if(!G&&A&&!D[A])Y[A]=F;return X}if(D=D||{},Array.isArray(X)){if(B==null)return X;return X.push({$set:{[B]:F}}),X}if(X.$set=X.$set||{},!E&&B&&(!D.$currentDate||!D.$currentDate[B])){let C=!1;if(B.indexOf(".")!==-1){let H=B.split(".");for(let q=1;q<H.length;++q){let W=H.slice(-q).join("."),K=H.slice(0,-q).join(".");if(D[K]!=null){D[K][W]=F,C=!0;break}else if(D.$set&&D.$set[K]){D.$set[K][W]=F,C=!0;break}}}if(!C)X.$set[B]=F;if(X.hasOwnProperty(B))delete X[B]}if(!G&&A){if(D[A])delete D[A];if(D.$set&&D.$set[A])delete D.$set[A];let C=!1;if(A.indexOf(".")!==-1){let H=A.split(".");for(let q=1;q<H.length;++q){let W=H.slice(-q).join("."),K=H.slice(0,-q).join(".");if(D[K]!=null){D[K][W]=F,C=!0;break}else if(D.$set&&D.$set[K]){D.$set[K][W]=F,C=!0;break}}}if(!C)X.$setOnInsert=X.$setOnInsert||{},X.$setOnInsert[A]=F}if(Object.keys(X.$set).length===0)delete X.$set;return X}});var vx=z((yw1,yx)=>{yx.exports=function F(A,B,D,J,Z){let X=B!=null&&B.updatedAt===!1,Y=B!=null&&B.createdAt===!1,$=D!=null?D():A.ownerDocument().constructor.base.now();if(!Y&&(A.isNew||A.$isSubdocument)&&J&&!A.$__getValue(J)&&A.$__isSelected(J))A.$set(J,$,void 0,{overwriteImmutable:!0});if(!X&&Z&&(A.isNew||A.$isModified())){let G=$;if(A.isNew&&J!=null)G=A.$__getValue(J);A.$set(Z,G)}}});var cx=z((vw1,dx)=>{var yZ1=OC(),vZ1=kC(),hZ1=C0(),hx=jD(),mZ1=vx(),dZ1=Y9(),mx=new Set(["replaceOne","findOneAndReplace"]);dx.exports=function F(A,B){let D=A.childSchemas.find(J);function J(C){return!!C.schema.options.timestamps}if(!B&&!D)return;let Z=hx(B,"createdAt"),X=hx(B,"updatedAt"),Y=B!=null&&B.hasOwnProperty("currentTime")?B.currentTime:null,$={};if(A.$timestamps={createdAt:Z,updatedAt:X},Z&&!A.paths[Z]){let C=A.base!=null?A.base.get("timestamps.createdAt.immutable"):null,H=C!=null?C:!0;$[Z]={[A.options.typeKey||"type"]:Date,immutable:H}}if(X&&!A.paths[X])$[X]=Date;A.add($),A.pre("save",function C(H){let q=hZ1(this,"$__.saveOptions.timestamps");if(q===!1)return H();mZ1(this,q,Y,Z,X),H()}),A.methods.initializeTimestamps=function(){let C=Y!=null?Y():this.constructor.base.now();if(Z&&!this.get(Z))this.$set(Z,C);if(X&&!this.get(X))this.$set(X,C);if(this.$isSubdocument)return this;let H=this.$getAllSubdocs();for(let q of H)if(q.initializeTimestamps)q.initializeTimestamps();return this},E[dZ1.builtInMiddleware]=!0;let G={query:!0,model:!1};A.pre("findOneAndReplace",G,E),A.pre("findOneAndUpdate",G,E),A.pre("replaceOne",G,E),A.pre("update",G,E),A.pre("updateOne",G,E),A.pre("updateMany",G,E);function E(C){let H=Y!=null?Y():this.model.base.now();if(mx.has(this.op)&&this.getUpdate()==null)this.setUpdate({});vZ1(H,Z,X,this.getUpdate(),this._mongooseOptions,mx.has(this.op)),yZ1(H,this.getUpdate(),this.model.schema),C()}}});var px=z((hw1,lx)=>{var cZ1=C1(),lZ1=import.meta.require("util");lx.exports=pZ1;function pZ1(F,A){if(typeof F==="string")return;if(typeof F==="function")return;throw new cZ1('Invalid ref at path "'+A+'". Got '+lZ1.inspect(F,{depth:0}))}});var uD=z((rZ1)=>{/*!
|
|
354
|
+
* ignore
|
|
355
|
+
*/var ix=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]);rZ1.queryOperations=ix;/*!
|
|
356
|
+
* ignore
|
|
357
|
+
*/var iZ1=ix.concat(["validate"]);rZ1.queryMiddlewareFunctions=iZ1;/*!
|
|
358
|
+
* ignore
|
|
359
|
+
*/var nZ1=["aggregate"];rZ1.aggregateMiddlewareFunctions=nZ1;/*!
|
|
360
|
+
* ignore
|
|
361
|
+
*/var sZ1=["bulkWrite","createCollection","insertMany"];rZ1.modelMiddlewareFunctions=sZ1;/*!
|
|
362
|
+
* ignore
|
|
363
|
+
*/var aZ1=["validate","save","remove","updateOne","deleteOne","init"];rZ1.documentMiddlewareFunctions=aZ1});var OD=z((dw1,nx)=>{var BX1=Y9(),DX1=eB();/*!
|
|
364
|
+
* ignore
|
|
365
|
+
*/nx.exports=o5;/*!
|
|
366
|
+
* ignore
|
|
367
|
+
*/o5.middlewareFunctions=["deleteOne","save","validate","remove","updateOne","init"];/*!
|
|
368
|
+
* ignore
|
|
369
|
+
*/var JX1=new Set(o5.middlewareFunctions.flatMap((F)=>[F,`$__${F}`]));function o5(F,A,B){B=B||{};let D={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},J=B.decorateDoc?F:F.prototype;F.$appliedHooks=!0;for(let G of Object.keys(A.paths)){let E=A.paths[G],C=null;if(E.$isSingleNested)C=E.caster;else if(E.$isMongooseDocumentArray)C=E.Constructor;else continue;if(C.$appliedHooks)continue;if(o5(C,E.schema,{...B,isChildSchema:!0}),C.discriminators!=null){let H=Object.keys(C.discriminators);for(let q of H)o5(C.discriminators[q],C.discriminators[q].schema,B)}}let Z=A.s.hooks.filter((G)=>{if(G.name==="updateOne"||G.name==="deleteOne")return!!G.document;if(G.name==="remove"||G.name==="init")return G.document==null||!!G.document;if(G.query!=null||G.document!=null)return G.document!==!1;return!0}).filter((G)=>{if(A.methods[G.name])return!G.fn[BX1.builtInMiddleware];return!0});F._middleware=Z,J.$__originalValidate=J.$__originalValidate||J.$__validate;let X=B&&B.isChildSchema?["save","validate","deleteOne"]:["save","validate"];for(let G of X){let E=G==="validate"?"$__originalValidate":`$__${G}`,C=Z.createWrapper(G,J[E],null,D);J[`$__${G}`]=C}J.$__init=Z.createWrapperSync("init",J.$__init,null,D);let Y=Object.keys(A.methods),$=Object.assign({},D,{checkForPromise:!0});for(let G of Y){if(JX1.has(G))continue;if(!Z.hasHooks(G))continue;let E=J[G];J[G]=function(){let C=Array.prototype.slice.call(arguments),H=C.slice(-1).pop(),q=typeof H==="function"?C.slice(0,C.length-1):C;return DX1(H,(W)=>{return this[`$__${G}`].apply(this,q.concat([W]))},F.events)},J[`$__${G}`]=Z.createWrapper(G,E,null,$)}}});var kD=z((cw1,ox)=>{var ZX1=$9(),XX1=C1(),sx=Z0(),YX1=J1().deepEqual,$X1=C2(),GX1=YD(),ax=import.meta.require("util"),EX1=D9(),SC=H2(),rx=o().populateModelSymbol;/*!
|
|
370
|
+
* ignore
|
|
371
|
+
*/class B3 extends Map{constructor(F,A,B,D){if($X1(F)==="Object")F=Object.keys(F).reduce((J,Z)=>J.concat([[Z,F[Z]]]),[]);super(F);this.$__parent=B!=null&&B.$__!=null?B:null,this.$__path=A,this.$__schemaType=D==null?new ZX1(A):D,this.$__runDeferred()}$init(F,A){if(tx(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(SC(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(SC(F,"ObjectId"))F=F.toString();if(tx(F),A=GX1(A),this.$__schemaType==null){this.$__deferred=this.$__deferred||[],this.$__deferred.push({key:F,value:A});return}let B,D=this.$__parent,J=D!=null&&D.$__&&D.$__.populated?D.$populated(X.call(this),!0)||D.$populated(this.$__path,!0):null,Z=this.get(F);if(J!=null){if(this.$__schemaType.$isSingleNested)throw new XX1(`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((Y)=>{if(Y.$__==null)Y=new J.options[rx](Y);return Y.$__.wasPopulated={value:Y._doc._id},Y});else if(A!=null){if(A.$__==null)A=new J.options[rx](A);A.$__.wasPopulated={value:A._doc._id}}}else try{let Y=this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested?{path:X.call(this)}:null;A=this.$__schemaType.applySetters(A,this.$__parent,!1,this.get(F),Y)}catch(Y){if(this.$__parent!=null&&this.$__parent.$__!=null){this.$__parent.invalidate(X.call(this),Y);return}throw Y}if(super.set(F,A),D!=null&&D.$__!=null&&!YX1(A,Z))D.markModified(X.call(this));function X(){if(B)return B;return B=this.$__path+"."+F,B}}clear(){super.clear();let F=this.$__parent;if(F!=null)F.markModified(this.$__path)}delete(F){if(SC(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={},B=this.keys();for(let D of B)A[D]=sx(this.get(D),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={},B=this.keys();for(let D of B)A[D]=sx(this.get(D),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(ax.inspect.custom)Object.defineProperty(B3.prototype,ax.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:B3.prototype.inspect});Object.defineProperty(B3.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(B3.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(B3.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(B3.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(B3.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0});Object.defineProperty(B3.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0});function tx(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(EX1.has(F))throw new Error(`Mongoose maps do not support reserved key name "${F}"`)}ox.exports=B3});var Ff=z((lw1,ex)=>{ex.exports=l6().UUID});var n7=z((CX1)=>{/*!
|
|
372
|
+
* Module exports.
|
|
373
|
+
*/CX1.Array=sE();CX1.Buffer=c5();CX1.Document=CX1.Embedded=c7();CX1.DocumentArray=E9();CX1.Decimal128=lB();CX1.ObjectId=j3();CX1.Map=kD();CX1.Subdocument=GD();CX1.UUID=Ff()});var Bf=z((nw1,Af)=>{var RX1=i2();class e5 extends RX1{}var xC=q6();Object.defineProperty(e5.prototype,"enum",xC);Object.defineProperty(e5.prototype,"of",xC);Object.defineProperty(e5.prototype,"castNonArrays",xC);/*!
|
|
374
|
+
* ignore
|
|
375
|
+
*/Af.exports=e5});var Jf=z((sw1,Df)=>{Df.exports=fC;function fC(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=fC(F[0]);for(let B=1;B<F.length;++B){let D=fC(F[B]);if(D.min<A.min)A.min=D.min;if(D.max>A.max)A.max=D.max;A.containsNonArrayItem=A.containsNonArrayItem||D.containsNonArrayItem}return A.min=A.min+1,A.max=A.max+1,A}});var FF=z((aw1,Xf)=>{var Zf=import.meta.require("assert");Xf.exports=function F(A){if(A==null)return A;if(A==="")return null;if(typeof A==="string"||typeof A==="boolean")A=Number(A);if(Zf.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);Zf.ok(!1)}});var _C=z((rw1,Yf)=>{Yf.exports=function F(A){if(A==null||typeof A!=="object")return A;if(Array.isArray(A)){for(let B=A.length-1;B>=0;--B)if(A[B]===void 0)A.splice(B,1)}for(let B of Object.keys(A))if(A[B]===void 0)delete A[B];return A}});var Ef=z((tw1,Gf)=>{var s7=q2(),$f=z4(),SD=FF(),wX1=_C(),IX1=new Set(["$and","$or"]),NX1=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),PX1=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),MX1=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),TX1=new Set(["$arrayElemAt","$first","$last"]),jX1=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),uX1=new Set(["$not"]);Gf.exports=function F(A,B,D){if(typeof A!=="object"||A===null)throw new Error("`$expr` must be an object");return z6(A,B,D)};function z6(F,A,B){if(AF(F)||F===null)return F;if(F.$cond!=null)if(Array.isArray(F.$cond))F.$cond=F.$cond.map((J)=>z6(J,A,B));else F.$cond.if=z6(F.$cond.if,A,B),F.$cond.then=z6(F.$cond.then,A,B),F.$cond.else=z6(F.$cond.else,A,B);else if(F.$ifNull!=null)F.$ifNull.map((J)=>z6(J,A,B));else if(F.$switch!=null){if(Array.isArray(F.$switch.branches))F.$switch.branches=F.$switch.branches.map((J)=>z6(J,A,B));if("default"in F.$switch)F.$switch.default=z6(F.$switch.default,A,B)}let D=Object.keys(F);for(let J of D)if(IX1.has(J))F[J]=F[J].map((Z)=>z6(Z,A,B));else if(NX1.has(J))F[J]=SX1(F[J],A,B);else if(PX1.has(J))F[J]=kX1(F[J],A,B);else if(MX1.has(J))F[J]=gC(F[J],A,B);else if(uX1.has(J))F[J]=z6(F[J],A,B);if(F.$in)F.$in=OX1(F.$in,A,B);if(F.$size)F.$size=gC(F.$size,A,B);if(F.$round){let J=F.$round;if(!Array.isArray(J)||J.length<1||J.length>2)throw new s7("Array",J,"$round");F.$round=J.map((Z)=>gC(Z,A,B))}return wX1(F),F}function gC(F){if(!xD(F))return F;try{return SD(F)}catch(A){throw new s7("Number",F)}}function OX1(F,A,B){let D=F[1];if(!AF(D))return F;let J=F[0],Z=A.path(D.slice(1));if(Z===null){if(B===!1)return F;else if(B==="throw")throw new $f("$in");return}if(!Z.$isMongooseArray)throw new Error("Path must be an array for $in");return[Z.$isMongooseDocumentArray?Z.$embeddedSchemaType.cast(J):Z.caster.cast(J),D]}function kX1(F){if(!Array.isArray(F)){if(!xD(F))return F;try{return SD(F)}catch(A){throw new s7("Number",F)}}return F.map((A)=>{if(!xD(A))return A;try{return SD(A)}catch(B){throw new s7("Number",A)}})}function SX1(F,A,B){if(!Array.isArray(F)||F.length!==2)throw new Error("Comparison operator must be an array of length 2");F[0]=z6(F[0],A,B);let D=F[0];if(xD(F[1])){let J=null,Z=null,X=null;if(AF(D))J=D.slice(1),Z=A.path(J);else if(typeof D==="object"&&D!=null){for(let $ of Object.keys(D))if(jX1.has($)&&AF(D[$]))J=D[$].slice(1)+"."+$,X=SD;else if(TX1.has($)&&AF(D[$])){if(J=D[$].slice(1)+"."+$,Z=A.path(D[$].slice(1)),Z!=null){if(Z.$isMongooseDocumentArray)Z=Z.$embeddedSchemaType;else if(Z.$isMongooseArray)Z=Z.caster}}}let Y=typeof F[1]==="object"&&F[1]!=null&&F[1].$literal!=null;if(Z!=null)if(Y)F[1]={$literal:Z.cast(F[1].$literal)};else F[1]=Z.cast(F[1]);else if(X!=null)if(Y)try{F[1]={$literal:X(F[1].$literal)}}catch($){throw new s7(X.name.replace(/^cast/,""),F[1],J+".$literal")}else try{F[1]=X(F[1])}catch($){throw new s7(X.name.replace(/^cast/,""),F[1],J)}else if(J!=null&&B===!0)return;else if(J!=null&&B==="throw")throw new $f(J)}else F[1]=z6(F[1]);return F}function AF(F){return typeof F==="string"&&F[0]==="$"}function xD(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 fD=z((ow1,Cf)=>{var xX1=q2();Cf.exports=function F(A,B){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 xX1("string",A,B)}});var Kf=z((ew1,Wf)=>{var fX1=q2(),Hf=rB(),qf=fD();Wf.exports=function F(A,B){if(A==null||typeof A!=="object")throw new fX1("$text",A,B);if(A.$search!=null)A.$search=qf(A.$search,B+".$search");if(A.$language!=null)A.$language=qf(A.$language,B+".$language");if(A.$caseSensitive!=null)A.$caseSensitive=Hf(A.$caseSensitive,B+".$castSensitive");if(A.$diacriticSensitive!=null)A.$diacriticSensitive=Hf(A.$diacriticSensitive,B+".$diacriticSensitive");return A}});var BF=z((FI1,zf)=>{var _X1=new Set(["$ref","$id","$db"]);zf.exports=function F(A){return A[0]==="$"&&!_X1.has(A)}});var q9=z((AI1,Rf)=>{/*!
|
|
376
|
+
* Module dependencies.
|
|
377
|
+
*/var Uf=q2(),bC=z4(),gX1=DF(),bX1=Ef(),yX1=fD(),vX1=Kf(),hX1=C0(),Qf=XD(),Lf=BF(),mX1=import.meta.require("util"),vC=K4(),yC=g5(),Vf=J1(),dX1=["Polygon","MultiPolygon"];Rf.exports=function F(A,B,D,J){if(Array.isArray(B))throw new Error("Query filter must be an object, got an array ",mX1.inspect(B));if(B==null)return B;if(A!=null&&A.discriminators!=null&&B[A.options.discriminatorKey]!=null)A=Qf(A,B[A.options.discriminatorKey])||A;let Z=Object.keys(B),X=Z.length,Y,$,G,E,C,H,q;D=D||{};while(X--)if(C=Z[X],q=B[C],C==="$or"||C==="$nor"||C==="$and"){if(!Array.isArray(q))throw new Uf("Array",q,C);for(let W=q.length-1;W>=0;W--){if(q[W]==null||typeof q[W]!=="object")throw new Uf("Object",q[W],C+"."+W);let K=Object.keys(q[W]).length,U=q[W][A.options.discriminatorKey];if(U==null)q[W]=F(A,q[W],D,J);else{let Q=Qf(J.schema,U);q[W]=F(Q?Q:A,q[W],D,J)}if(Object.keys(q[W]).length===0&&K!==0)q.splice(W,1)}if(q.length===0)delete B[C]}else if(C==="$where"){if(H=typeof q,H!=="string"&&H!=="function")throw new Error("Must have a string or function for $where");if(H==="function")B[C]=q.toString();continue}else if(C==="$expr"){q=bX1(q,A);continue}else if(C==="$elemMatch")q=F(A,q,D,J);else if(C==="$text")q=vX1(q,C);else if(C==="$comment"&&!A.paths.hasOwnProperty("$comment"))q=yX1(q,C),B[C]=q;else{if(!A)continue;if(G=A.path(C),!G){let W=C.split("."),K=W.length;while(K--){let U=W.slice(0,K).join("."),Q=W.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&&Q!==V){let w=hX1(B,U+"."+V),j=L.schema.discriminators;if(typeof w==="string"&&j[w]!=null)G=j[w].path(Q);else if(w!=null&&Object.keys(w).length===1&&Array.isArray(w.$in)&&w.$in.length===1&&typeof w.$in[0]==="string"&&j[w.$in[0]]!=null)G=j[w.$in[0]].path(Q)}}}if(!G){let W=C.split("."),K=W.length,U,Q,L;while(K--)if(U=W.slice(0,K).join("."),G=A.path(U),G)break;if(G){if(G.caster&&G.caster.schema){L={},Q=W.slice(K).join("."),L[Q]=q;let j=F(G.caster.schema,L,D,J)[Q];if(j===void 0)delete B[C];else B[C]=j}else B[C]=q;continue}if(vC(q)){let j="";if(q.$near)j="$near";else if(q.$nearSphere)j="$nearSphere";else if(q.$within)j="$within";else if(q.$geoIntersects)j="$geoIntersects";else if(q.$geoWithin)j="$geoWithin";if(j){let T=new gX1.Number("__QueryCasting__"),M=q[j];if(q.$maxDistance!=null)q.$maxDistance=T.castForQuery(null,q.$maxDistance,J);if(q.$minDistance!=null)q.$minDistance=T.castForQuery(null,q.$minDistance,J);if(j==="$within"){let x=M.$center||M.$centerSphere||M.$box||M.$polygon;if(!x)throw new Error("Bad $within parameter: "+JSON.stringify(q));M=x}else if(j==="$near"&&typeof M.type==="string"&&Array.isArray(M.coordinates))M=M.coordinates;else if((j==="$near"||j==="$nearSphere"||j==="$geoIntersects")&&M.$geometry&&typeof M.$geometry.type==="string"&&Array.isArray(M.$geometry.coordinates)){if(M.$maxDistance!=null)M.$maxDistance=T.castForQuery(null,M.$maxDistance,J);if(M.$minDistance!=null)M.$minDistance=T.castForQuery(null,M.$minDistance,J);if(yC(M.$geometry))M.$geometry=M.$geometry.toObject({transform:!1,virtuals:!1});M=M.$geometry.coordinates}else if(j==="$geoWithin"){if(M.$geometry){if(yC(M.$geometry))M.$geometry=M.$geometry.toObject({virtuals:!1});let x=M.$geometry.type;if(dX1.indexOf(x)===-1)throw new Error('Invalid geoJSON type for $geoWithin "'+x+'", must be "Polygon" or "MultiPolygon"');M=M.$geometry.coordinates}else if(M=M.$box||M.$polygon||M.$center||M.$centerSphere,yC(M))M=M.toObject({virtuals:!1})}hC(M,T,J);continue}}if(A.nested[C])continue;let V="strict"in D?D.strict:A.options.strict,w=cX1(D,A._userProvidedOptions,A.options,J);if(D.upsert&&V){if(V==="throw")throw new bC(C);throw new bC(C,'Path "'+C+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if(w==="throw")throw new bC(C,'Path "'+C+`" is not in schema and strictQuery is 'throw'.`);else if(w)delete B[C]}else if(q==null)continue;else if(Vf.isPOJO(q))if($=Object.keys(q).some(Lf),!$)B[C]=G.castForQuery(null,q,J);else{let W=Object.keys(q),K,U=W.length;while(U--)if(K=W[U],E=q[K],K==="$elemMatch"){if(E&&G!=null&&G.schema!=null)F(G.schema,E,D,J);else if(E&&G!=null&&G.$isMongooseArray)if(Vf.isPOJO(E)&&E.$not!=null)F(A,E,D,J);else q[K]=G.castForQuery(K,E,J)}else if(K==="$not"){if(E&&G){if(Y=Object.keys(E),Y.length&&Lf(Y[0]))for(let Q in E)E[Q]=G.castForQuery(Q,E[Q],J);else q[K]=G.castForQuery(K,E,J);continue}}else q[K]=G.castForQuery(K,E,J)}else if(Array.isArray(q)&&["Buffer","Array"].indexOf(G.instance)===-1&&!D.sanitizeFilter){let W=[],K=q;for(let U of K)W.push(G.castForQuery(null,U,J));B[C]={$in:W}}else B[C]=G.castForQuery(null,q,J)}return B};function hC(F,A,B){if(Array.isArray(F))F.forEach(function(D,J){if(Array.isArray(D)||vC(D))return hC(D,A,B);F[J]=A.castForQuery(null,D,B)});else{let D=Object.keys(F),J=D.length;while(J--){let Z=D[J],X=F[Z];if(Array.isArray(X)||vC(X))hC(X,A,B),F[Z]=X;else F[Z]=A.castForQuery({val:X,context:B})}}}function cX1(F,A,B,D){if("strictQuery"in F)return F.strictQuery;if("strictQuery"in A)return A.strictQuery;let J=D&&D.mongooseCollection&&D.mongooseCollection.conn&&D.mongooseCollection.conn.base&&D.mongooseCollection.conn.base.options;if(J){if("strictQuery"in J)return J.strictQuery}return B.strictQuery}});var If=z((BI1,wf)=>{var lX1=i2();class a7 extends lX1{}var _D=q6();Object.defineProperty(a7.prototype,"min",_D);Object.defineProperty(a7.prototype,"max",_D);Object.defineProperty(a7.prototype,"enum",_D);Object.defineProperty(a7.prototype,"populate",_D);/*!
|
|
378
|
+
* ignore
|
|
379
|
+
*/wf.exports=a7});var gD=z((DI1,Pf)=>{/*!
|
|
380
|
+
* Module requirements.
|
|
381
|
+
*/var pX1=q2();/*!
|
|
382
|
+
* ignore
|
|
383
|
+
*/function iX1(F){let A=this;if(Array.isArray(F))return F.map(function(B){return Nf(A.path,B)});else if(Buffer.isBuffer(F))return F;return Nf(A.path,F)}/*!
|
|
384
|
+
* ignore
|
|
385
|
+
*/function Nf(F,A){let B=Number(A);if(isNaN(B))throw new pX1("number",A,F);return B}Pf.exports=iX1});var cC=z((JI1,Mf)=>{/*!
|
|
386
|
+
* Module requirements.
|
|
387
|
+
*/var vD=W2(),nX1=If(),f3=M0(),sX1=FF(),bD=gD(),mC=J1(),dC=f3.CastError;function F0(F,A){f3.call(this,F,A,"Number")}F0.get=f3.get;F0.set=f3.set;F0.setters=[];/*!
|
|
388
|
+
* ignore
|
|
389
|
+
*/F0._cast=sX1;F0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
|
|
390
|
+
* ignore
|
|
391
|
+
*/F0._defaultCaster=(F)=>{if(typeof F!=="number")throw new Error;return F};F0.schemaName="Number";F0.defaultOptions={};/*!
|
|
392
|
+
* Inherits from SchemaType.
|
|
393
|
+
*/F0.prototype=Object.create(f3.prototype);F0.prototype.constructor=F0;F0.prototype.OptionsConstructor=nX1;/*!
|
|
394
|
+
* ignore
|
|
395
|
+
*/F0._checkRequired=(F)=>typeof F==="number"||F instanceof Number;F0.checkRequired=f3.checkRequired;F0.prototype.checkRequired=function F(A,B){if(typeof A==="object"&&f3._isRef(this,A,B,!0))return A!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():F0.checkRequired())(A)};F0.prototype.min=function(F,A){if(this.minValidator)this.validators=this.validators.filter(function(B){return B.validator!==this.minValidator},this);if(F!==null&&F!==void 0){let B=A||vD.messages.Number.min;B=B.replace(/{MIN}/,F),this.validators.push({validator:this.minValidator=function(D){return D==null||D>=F},message:B,type:"min",min:F})}return this};F0.prototype.max=function(F,A){if(this.maxValidator)this.validators=this.validators.filter(function(B){return B.validator!==this.maxValidator},this);if(F!==null&&F!==void 0){let B=A||vD.messages.Number.max;B=B.replace(/{MAX}/,F),this.validators.push({validator:this.maxValidator=function(D){return D==null||D<=F},message:B,type:"max",max:F})}return this};F0.prototype.enum=function(F,A){if(this.enumValidator)this.validators=this.validators.filter(function(B){return B.validator!==this.enumValidator},this);if(!Array.isArray(F)){if(mC.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(mC.isPOJO(F))F=Object.values(F);A=A||vD.messages.Number.enum}return A=A==null?vD.messages.Number.enum:A,this.enumValidator=(B)=>B==null||F.indexOf(B)!==-1,this.validators.push({validator:this.enumValidator,message:A,type:"enum",enumValues:F}),this};F0.prototype.cast=function(F,A,B){if(typeof F!=="number"&&f3._isRef(this,F,A,B)){if(F==null||mC.isNonBuiltinObject(F))return this._castRef(F,A,B)}let D=F&&typeof F._id!=="undefined"?F._id:F,J;if(typeof this._castFunction==="function")J=this._castFunction;else if(typeof this.constructor.cast==="function")J=this.constructor.cast();else J=F0.cast();try{return J(D)}catch(Z){throw new dC("Number",D,this.path,Z,this)}};/*!
|
|
396
|
+
* ignore
|
|
397
|
+
*/function yD(F){return this.cast(F)}function aX1(F){let A=this;if(!Array.isArray(F))return[this.cast(F)];return F.map(function(B){return A.cast(B)})}F0.prototype.$conditionalHandlers={...f3.prototype.$conditionalHandlers,$bitsAllClear:bD,$bitsAnyClear:bD,$bitsAllSet:bD,$bitsAnySet:bD,$gt:yD,$gte:yD,$lt:yD,$lte:yD,$mod:aX1};F0.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=this.$conditionalHandlers[F],!D)throw new dC("number",A,this.path,null,this);return D.call(this,A,B)}try{A=this.applySetters(A,B)}catch(J){if(J instanceof dC&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}return A};/*!
|
|
398
|
+
* Module exports.
|
|
399
|
+
*/Mf.exports=F0});var JF=z((tX1)=>{/*!
|
|
400
|
+
* Module requirements.
|
|
401
|
+
*/var rX1=cC();/*!
|
|
402
|
+
* ignore
|
|
403
|
+
*/tX1.castToNumber=Tf;tX1.castArraysOfNumbers=jf;/*!
|
|
404
|
+
* ignore
|
|
405
|
+
*/function Tf(F){return rX1.cast()(F)}function jf(F,A){F.forEach(function(B,D){if(Array.isArray(B))jf(B,A);else F[D]=Tf.call(A,B)})}});var iC=z((DY1)=>{/*!
|
|
406
|
+
* Module requirements.
|
|
407
|
+
*/var uf=JF().castArraysOfNumbers,ZF=JF().castToNumber;/*!
|
|
408
|
+
* ignore
|
|
409
|
+
*/DY1.cast$geoIntersects=BY1;DY1.cast$near=FY1;DY1.cast$within=AY1;function FY1(F){let A=hD();if(Array.isArray(F))return uf(F,this),F;if(pC(this,F),F&&F.$geometry)return lC(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 lC(F,A){switch(F.$geometry.type){case"Polygon":case"LineString":case"Point":uf(F.$geometry.coordinates,A);break;default:break}return pC(A,F),F}function AY1(F){if(pC(this,F),F.$box||F.$polygon){let A=F.$box?"$box":"$polygon";F[A].forEach((B)=>{if(!Array.isArray(B)){let D="Invalid $within $box argument. Expected an array, received "+B;throw new TypeError(D)}B.forEach((D,J)=>{B[J]=ZF.call(this,D)})})}else if(F.$center||F.$centerSphere){let A=F.$center?"$center":"$centerSphere";F[A].forEach((B,D)=>{if(Array.isArray(B))B.forEach((J,Z)=>{B[Z]=ZF.call(this,J)});else F[A][D]=ZF.call(this,B)})}else if(F.$geometry)lC(F,this);return F}function BY1(F){if(!F.$geometry)return;return lC(F,this),F}function pC(F,A){if(A.$maxDistance)A.$maxDistance=ZF.call(F,A.$maxDistance);if(A.$minDistance)A.$minDistance=ZF.call(F,A.$minDistance)}});var hD=z((YI1,xf)=>{/*!
|
|
410
|
+
* Module dependencies.
|
|
411
|
+
*/var YY1=tB(),$Y1=jE(),kf=C1(),GY1=Bf(),U6=M0(),dD=U6.CastError,cD=$9(),EY1=IC(),Of=TD(),CY1=Jf(),nC=q9(),HY1=Z0(),qY1=C2(),WY1=BF(),lD=import.meta.require("util"),V4=J1(),KY1=JF().castToNumber,sC=iC(),zY1=K6(),XF,mD,Sf=Symbol("mongoose#isNestedArray"),UY1=Object.freeze({});function j1(F,A,B,D){mD||(mD=n7().Embedded);let J="type";if(D&&D.typeKey)J=D.typeKey;if(this.schemaOptions=D,A){let Y={};if(V4.isPOJO(A))if(A[J])Y=HY1(A),delete Y[J],A=A[J];else A=cD;if(B!=null&&B.ref!=null&&Y.ref==null)Y.ref=B.ref;if(A===Object)A=cD;let $=typeof A==="string"?A:V4.getFunctionName(A),G=DF(),E=G.hasOwnProperty($)?G[$]:A;if(this.casterConstructor=E,this.casterConstructor instanceof j1)this.casterConstructor[Sf]=!0;if(typeof E==="function"&&!E.$isArraySubdocument&&!E.$isSchemaMap){let C=this.caster instanceof mD?null:F;this.caster=new E(C,Y)}else if(this.caster=E,!(this.caster instanceof mD))this.caster.path=F;this.$embeddedSchemaType=this.caster}this.$isMongooseArray=!0,U6.call(this,F,B,"Array");let Z,X;if(this.defaultValue!=null)Z=this.defaultValue,X=typeof Z==="function";if(!("defaultValue"in this)||this.defaultValue!=null){let Y=function(){return X?Z.call(this):Z!=null?[].concat(Z):[]};Y.$runBeforeSetters=!X,this.default(Y)}}j1.schemaName="Array";j1.options={castNonArrays:!0};/*!
|
|
412
|
+
* ignore
|
|
413
|
+
*/j1.defaultOptions={};j1.set=U6.set;j1.setters=[];j1.get=U6.get;/*!
|
|
414
|
+
* Inherits from SchemaType.
|
|
415
|
+
*/j1.prototype=Object.create(U6.prototype);j1.prototype.constructor=j1;j1.prototype.OptionsConstructor=GY1;/*!
|
|
416
|
+
* ignore
|
|
417
|
+
*/j1._checkRequired=U6.prototype.checkRequired;j1.checkRequired=U6.checkRequired;/*!
|
|
418
|
+
* Virtuals defined on this array itself.
|
|
419
|
+
*/j1.prototype.virtuals=null;j1.prototype.checkRequired=function F(A,B){if(typeof A==="object"&&U6._isRef(this,A,B,!0))return!!A;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():j1.checkRequired())(A)};j1.prototype.enum=function(){let F=this;while(!0){let B=F&&F.caster&&F.caster.instance;if(B==="Array"){F=F.caster;continue}if(B!=="String"&&B!=="Number")throw new Error("`enum` can only be set on an array of strings or numbers , not "+B);break}let A=arguments;if(!Array.isArray(arguments)&&V4.isObject(arguments))A=V4.object.vals(A);return F.caster.enum.apply(F.caster,A),this};j1.prototype.applyGetters=function(F,A){if(A!=null&&A.$__!=null&&A.$populated(this.path))return F;return U6.prototype.applyGetters.call(this,F,A)};j1.prototype._applySetters=function(F,A,B,D){if(this.casterConstructor.$isMongooseArray&&j1.options.castNonArrays&&!this[Sf]){let J=0,Z=this;while(Z!=null&&Z.$isMongooseArray&&!Z.$isMongooseDocumentArray)++J,Z=Z.casterConstructor;if(F!=null&&F.length!==0){let X=CY1(F);if(X.min===X.max&&X.max<J&&X.containsNonArrayItem)for(let Y=X.max;Y<J;++Y)F=[F]}}return U6.prototype._applySetters.call(this,F,A,B,D)};j1.prototype.cast=function(F,A,B,D,J){XF||(XF=n7().Array);let Z,X;if(Array.isArray(F)){if(!F.length&&A){let q=A.schema.indexedPaths(),W=this.path;for(Z=0,X=q.length;Z<X;++Z){let U=q[Z][0][W];if(U==="2dsphere"||U==="2d")return}let K=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(K!=null){for(Z=0,X=q.length;Z<X;++Z)if(q[Z][0][K]==="2dsphere")return}}J=J||UY1;let G=V4.isMongooseArray(F)?F.__array:F,E=J.path||this.path;if(J.arrayPathIndex!=null)E+="."+J.arrayPathIndex;if(F=XF(G,E,A,this),G=F.__array,B&&A!=null&&A.$__!=null&&A.$populated(this.path))return F;let C=this.caster,H=C.$isMongooseArray;if(C&&this.casterConstructor!==cD)try{let q=G.length;for(Z=0;Z<q;Z++){let W={};if(H){if(J.arrayPath!=null)W.arrayPathIndex=Z;else if(C._arrayParentPath!=null)W.arrayPathIndex=Z}G[Z]=C.applySetters(G[Z],A,B,void 0,W)}}catch(q){throw new dD("["+q.kind+"]",lD.inspect(F),this.path+"."+Z,q,this)}return F}let Y=this.options.castNonArrays!=null?this.options.castNonArrays:j1.options.castNonArrays;if(B||Y){if(!!A&&!!B)A.markModified(this.path);return this.cast([F],A,B)}throw new dD("Array",lD.inspect(F),this.path,null,this)};/*!
|
|
420
|
+
* ignore
|
|
421
|
+
*/j1.prototype._castForPopulate=function F(A,B){if(XF||(XF=n7().Array),Array.isArray(A)){let D,J=A.__array?A.__array:A,Z=J.length,X=this.caster;if(X&&this.casterConstructor!==cD)try{for(D=0;D<Z;D++){let Y={};if(X.$isMongooseArray&&X._arrayParentPath!=null)Y.arrayPathIndex=D;J[D]=X.cast(J[D],B,!1,void 0,Y)}}catch(Y){throw new dD("["+Y.kind+"]",lD.inspect(A),this.path+"."+D,Y,this)}return A}throw new dD("Array",lD.inspect(A),this.path,null,this)};j1.prototype.$toObject=j1.prototype.toObject;/*!
|
|
422
|
+
* ignore
|
|
423
|
+
*/j1.prototype.discriminator=function(...F){let A=this;while(A.$isMongooseArray&&!A.$isMongooseDocumentArray)if(A=A.casterConstructor,A==null||typeof A==="function")throw new kf("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return A.discriminator(...F)};/*!
|
|
424
|
+
* ignore
|
|
425
|
+
*/j1.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};j1.prototype._castForQuery=function(F,A){let B=this.casterConstructor;if(F&&B.discriminators&&B.schema&&B.schema.options&&B.schema.options.discriminatorKey)if(typeof F[B.schema.options.discriminatorKey]==="string"&&B.discriminators[F[B.schema.options.discriminatorKey]])B=B.discriminators[F[B.schema.options.discriminatorKey]];else{let $=zY1(B.discriminators,F[B.schema.options.discriminatorKey]);if($)B=$}let D=this.casterConstructor.prototype,J=D&&D.castForQuery,Z=D&&D.cast,X=B.castForQuery,Y=this.caster;if(Array.isArray(F))this.setters.reverse().forEach(($)=>{F=$.call(this,F,this)}),F=F.map(function($){if(V4.isObject($)&&$.$elemMatch)return $;if(J)return $=J.call(Y,null,$,A),$;else if(Z)return $=Z.call(Y,$),$;else if(X)return $=X.call(Y,null,$,A),$;if($!=null)return $=new B($),$;return $});else if(J)F=J.call(Y,null,F,A);else if(Z)F=Z.call(Y,F);else if(X)F=X.call(Y,null,F,A);else if(F!=null)F=new B(F);return F};j1.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=this.$conditionalHandlers[F],!D)throw new Error("Can't use "+F+" with Array.");return D.call(this,A,B)}else return this._castForQuery(A,B)};j1.prototype.virtual=function F(A,B){if(A instanceof Of||qY1(A)==="VirtualType")return this.virtual(A.path,A.options);if(B=new EY1(B),V4.hasUserDefinedProperty(B,["ref","refPath"]))throw new kf("Cannot set populate virtual as a property of an array");let D=new Of(B,A);if(this.virtuals===null)this.virtuals={};return this.virtuals[A]=D,D};function QY1(F,A){if(!Array.isArray(F))F=[F];return F=F.map((B)=>{if(!V4.isObject(B))return B;if(B.$elemMatch!=null)return{$elemMatch:nC(this.casterConstructor.schema,B.$elemMatch,null,this&&this.$$context)};let D={};return D[this.path]=B,nC(this.casterConstructor.schema,D,null,this&&this.$$context)[this.path]},this),this.castForQuery(null,F,A)}function LY1(F,A){let B=Object.keys(F),D=B.length;for(let J=0;J<D;++J){let Z=B[J],X=F[Z];if(WY1(Z)&&X!=null)F[Z]=this.castForQuery(Z,X,A)}return F}var n1=j1.prototype.$conditionalHandlers={};n1.$all=QY1;n1.$options=String;n1.$elemMatch=LY1;n1.$geoIntersects=sC.cast$geoIntersects;n1.$or=aC("$or");n1.$and=aC("$and");n1.$nor=aC("$nor");function aC(F){return function A(B,D){if(!Array.isArray(B))throw new TypeError("conditional "+F+" requires an array");let J=[];for(let Z of B)J.push(nC(this.casterConstructor.schema??D.schema,Z,null,this&&this.$$context));return J}}n1.$near=n1.$nearSphere=sC.cast$near;n1.$within=n1.$geoWithin=sC.cast$within;n1.$size=n1.$minDistance=n1.$maxDistance=KY1;n1.$exists=YY1;n1.$type=$Y1;n1.$eq=n1.$gt=n1.$gte=n1.$lt=n1.$lte=n1.$not=n1.$regex=n1.$ne=j1.prototype._castForQuery;n1.$nin=U6.prototype.$conditionalHandlers.$nin;n1.$in=U6.prototype.$conditionalHandlers.$in;/*!
|
|
426
|
+
* Module exports.
|
|
427
|
+
*/xf.exports=j1});var _f=z(($I1,ff)=>{var VY1=import.meta.require("assert"),{Long:RY1}=l6();ff.exports=function F(A){if(A==null)return A;if(A==="")return null;if(typeof A==="bigint")return A;if(A instanceof RY1)return A.toBigInt();if(typeof A==="string"||typeof A==="number")return BigInt(A);VY1.ok(!1)}});var yf=z((GI1,bf)=>{/*!
|
|
428
|
+
* Module dependencies.
|
|
429
|
+
*/var gf=q2(),r7=M0(),wY1=_f();function z0(F,A){r7.call(this,F,A,"BigInt")}z0.schemaName="BigInt";z0.defaultOptions={};/*!
|
|
430
|
+
* Inherits from SchemaType.
|
|
431
|
+
*/z0.prototype=Object.create(r7.prototype);z0.prototype.constructor=z0;/*!
|
|
432
|
+
* ignore
|
|
433
|
+
*/z0._cast=wY1;z0.set=r7.set;z0.setters=[];z0.get=r7.get;z0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
|
|
434
|
+
* ignore
|
|
435
|
+
*/z0._checkRequired=(F)=>F!=null;z0.checkRequired=r7.checkRequired;z0.prototype.checkRequired=function(F){return this.constructor._checkRequired(F)};z0.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=z0.cast();try{return A(F)}catch(B){throw new gf("BigInt",F,this.path,B,this)}};/*!
|
|
436
|
+
* ignore
|
|
437
|
+
*/z0.$conditionalHandlers={...r7.prototype.$conditionalHandlers,$gt:pD,$gte:pD,$lt:pD,$lte:pD};/*!
|
|
438
|
+
* ignore
|
|
439
|
+
*/function pD(F,A){return this.castForQuery(null,F,A)}z0.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=z0.$conditionalHandlers[F],D)return D.call(this,A);return this.applySetters(null,A,B)}try{return this.applySetters(A,B)}catch(J){if(J instanceof gf&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};z0.prototype._castNullish=function F(A){if(typeof A==="undefined")return A;if((typeof this.constructor.cast==="function"?this.constructor.cast():z0.cast())==null)return A;return A};/*!
|
|
440
|
+
* Module exports.
|
|
441
|
+
*/bf.exports=z0});var mf=z((EI1,hf)=>{/*!
|
|
442
|
+
* Module dependencies.
|
|
443
|
+
*/var vf=q2(),t7=M0(),YF=rB();function A0(F,A){t7.call(this,F,A,"Boolean")}A0.schemaName="Boolean";A0.defaultOptions={};/*!
|
|
444
|
+
* Inherits from SchemaType.
|
|
445
|
+
*/A0.prototype=Object.create(t7.prototype);A0.prototype.constructor=A0;/*!
|
|
446
|
+
* ignore
|
|
447
|
+
*/A0._cast=YF;A0.set=t7.set;A0.setters=[];A0.get=t7.get;A0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
|
|
448
|
+
* ignore
|
|
449
|
+
*/A0._defaultCaster=(F)=>{if(F!=null&&typeof F!=="boolean")throw new Error;return F};/*!
|
|
450
|
+
* ignore
|
|
451
|
+
*/A0._checkRequired=(F)=>F===!0||F===!1;A0.checkRequired=t7.checkRequired;A0.prototype.checkRequired=function(F){return this.constructor._checkRequired(F)};Object.defineProperty(A0,"convertToTrue",{get:()=>YF.convertToTrue,set:(F)=>{YF.convertToTrue=F}});Object.defineProperty(A0,"convertToFalse",{get:()=>YF.convertToFalse,set:(F)=>{YF.convertToFalse=F}});A0.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=A0.cast();try{return A(F)}catch(B){throw new vf("Boolean",F,this.path,B,this)}};A0.$conditionalHandlers={...t7.prototype.$conditionalHandlers};A0.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=A0.$conditionalHandlers[F],D)return D.call(this,A);return this.applySetters(null,A,B)}try{return this.applySetters(A,B)}catch(J){if(J instanceof vf&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};A0.prototype._castNullish=function F(A){if(typeof A==="undefined")return A;let B=typeof this.constructor.cast==="function"?this.constructor.cast():A0.cast();if(B==null)return A;if(B.convertToFalse instanceof Set&&B.convertToFalse.has(A))return!1;if(B.convertToTrue instanceof Set&&B.convertToTrue.has(A))return!0;return A};/*!
|
|
452
|
+
* Module exports.
|
|
453
|
+
*/hf.exports=A0});var cf=z((CI1,df)=>{var IY1=i2();class rC extends IY1{}var NY1=q6();Object.defineProperty(rC.prototype,"subtype",NY1);/*!
|
|
454
|
+
* ignore
|
|
455
|
+
*/df.exports=rC});var nf=z((HI1,pf)=>{/*!
|
|
456
|
+
* Module dependencies.
|
|
457
|
+
*/var o7=c5(),PY1=cf(),_3=M0(),iD=gD(),lf=J1(),tC=o7.Binary,sD=_3.CastError;function b0(F,A){_3.call(this,F,A,"Buffer")}b0.schemaName="Buffer";b0.defaultOptions={};/*!
|
|
458
|
+
* Inherits from SchemaType.
|
|
459
|
+
*/b0.prototype=Object.create(_3.prototype);b0.prototype.constructor=b0;b0.prototype.OptionsConstructor=PY1;/*!
|
|
460
|
+
* ignore
|
|
461
|
+
*/b0._checkRequired=(F)=>!!(F&&F.length);b0.set=_3.set;b0.setters=[];b0.get=_3.get;b0.checkRequired=_3.checkRequired;b0.prototype.checkRequired=function(F,A){if(_3._isRef(this,F,A,!0))return!!F;return this.constructor._checkRequired(F)};b0.prototype.cast=function(F,A,B){let D;if(_3._isRef(this,F,A,B)){if(F&&F.isMongooseBuffer)return F;if(Buffer.isBuffer(F)){if(!F||!F.isMongooseBuffer){if(F=new o7(F,[this.path,A]),this.options.subtype!=null)F._subtype=this.options.subtype}return F}if(F instanceof tC){if(D=new o7(F.value(!0),[this.path,A]),typeof F.sub_type!=="number")throw new sD("Buffer",F,this.path,null,this);return D._subtype=F.sub_type,D}if(F==null||lf.isNonBuiltinObject(F))return this._castRef(F,A,B)}if(F&&F._id)F=F._id;if(F&&F.isMongooseBuffer)return F;if(Buffer.isBuffer(F)){if(!F||!F.isMongooseBuffer){if(F=new o7(F,[this.path,A]),this.options.subtype!=null)F._subtype=this.options.subtype}return F}if(F instanceof tC){if(D=new o7(F.value(!0),[this.path,A]),typeof F.sub_type!=="number")throw new sD("Buffer",F,this.path,null,this);return D._subtype=F.sub_type,D}if(F===null)return F;let J=typeof F;if(J==="string"||J==="number"||Array.isArray(F)||J==="object"&&F.type==="Buffer"&&Array.isArray(F.data)){if(J==="number")F=[F];if(D=new o7(F,[this.path,A]),this.options.subtype!=null)D._subtype=this.options.subtype;return D}if(lf.isPOJO(F)&&(F.$binary instanceof tC||typeof F.$binary==="string")){let Z=this.cast(Buffer.from(F.$binary,"base64"));if(F.$type!=null)return Z._subtype=F.$type,Z}throw new sD("Buffer",F,this.path,null,this)};b0.prototype.subtype=function(F){return this.options.subtype=F,this};/*!
|
|
462
|
+
* ignore
|
|
463
|
+
*/function nD(F,A){return this.castForQuery(null,F,A)}b0.prototype.$conditionalHandlers={..._3.prototype.$conditionalHandlers,$bitsAllClear:iD,$bitsAnyClear:iD,$bitsAllSet:iD,$bitsAnySet:iD,$gt:nD,$gte:nD,$lt:nD,$lte:nD};b0.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=this.$conditionalHandlers[F],!D)throw new Error("Can't use "+F+" with Buffer.");return D.call(this,A)}let J;try{J=this.applySetters(A,B)}catch(Z){if(Z instanceof sD&&Z.path===this.path&&this.$fullPath!=null)Z.path=this.$fullPath;throw Z}return J?J.toObject({transform:!1,virtuals:!1}):J};/*!
|
|
464
|
+
* Module exports.
|
|
465
|
+
*/pf.exports=b0});var af=z((qI1,sf)=>{var MY1=i2();class $F extends MY1{}var oC=q6();Object.defineProperty($F.prototype,"min",oC);Object.defineProperty($F.prototype,"max",oC);Object.defineProperty($F.prototype,"expires",oC);/*!
|
|
466
|
+
* ignore
|
|
467
|
+
*/sf.exports=$F});var tf=z((WI1,rf)=>{var eC=import.meta.require("assert");rf.exports=function F(A){if(A==null||A==="")return null;if(A instanceof Date)return eC.ok(!isNaN(A.valueOf())),A;let B;if(eC.ok(typeof A!=="boolean"),A instanceof Number||typeof A==="number")B=new Date(A);else if(typeof A==="string"&&!isNaN(Number(A))&&(Number(A)>=275761||Number(A)<-271820))B=new Date(Number(A));else if(typeof A.valueOf==="function")B=new Date(A.valueOf());else B=new Date(A);if(!isNaN(B.valueOf()))return B;eC.ok(!1)}});var A_=z((KI1,F_)=>{/*!
|
|
468
|
+
* Module requirements.
|
|
469
|
+
*/var of=W2(),TY1=af(),R4=M0(),jY1=tf(),uY1=C2(),OY1=J1(),ef=R4.CastError;function B0(F,A){R4.call(this,F,A,"Date")}B0.schemaName="Date";B0.defaultOptions={};/*!
|
|
470
|
+
* Inherits from SchemaType.
|
|
471
|
+
*/B0.prototype=Object.create(R4.prototype);B0.prototype.constructor=B0;B0.prototype.OptionsConstructor=TY1;/*!
|
|
472
|
+
* ignore
|
|
473
|
+
*/B0._cast=jY1;B0.set=R4.set;B0.setters=[];B0.get=R4.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};/*!
|
|
474
|
+
* ignore
|
|
475
|
+
*/B0._defaultCaster=(F)=>{if(F!=null&&!(F instanceof Date))throw new Error;return F};B0.prototype.expires=function(F){if(uY1(this._index)!=="Object")this._index={};return this._index.expires=F,OY1.expires(this._index),this};/*!
|
|
476
|
+
* ignore
|
|
477
|
+
*/B0._checkRequired=(F)=>F instanceof Date;B0.checkRequired=R4.checkRequired;B0.prototype.checkRequired=function(F,A){if(typeof F==="object"&&R4._isRef(this,F,A,!0))return F!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():B0.checkRequired())(F)};B0.prototype.min=function(F,A){if(this.minValidator)this.validators=this.validators.filter(function(B){return B.validator!==this.minValidator},this);if(F){let B=A||of.messages.Date.min;if(typeof B==="string")B=B.replace(/{MIN}/,F===Date.now?"Date.now()":F.toString());let D=this;this.validators.push({validator:this.minValidator=function(J){let Z=F;if(typeof F==="function"&&F!==Date.now)Z=Z.call(this);let X=Z===Date.now?Z():D.cast(Z);return J===null||J.valueOf()>=X.valueOf()},message:B,type:"min",min:F})}return this};B0.prototype.max=function(F,A){if(this.maxValidator)this.validators=this.validators.filter(function(B){return B.validator!==this.maxValidator},this);if(F){let B=A||of.messages.Date.max;if(typeof B==="string")B=B.replace(/{MAX}/,F===Date.now?"Date.now()":F.toString());let D=this;this.validators.push({validator:this.maxValidator=function(J){let Z=F;if(typeof Z==="function"&&Z!==Date.now)Z=Z.call(this);let X=Z===Date.now?Z():D.cast(Z);return J===null||J.valueOf()<=X.valueOf()},message:B,type:"max",max:F})}return this};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(B){throw new ef("date",F,this.path,B,this)}};function aD(F){return this.cast(F)}B0.prototype.$conditionalHandlers={...R4.prototype.$conditionalHandlers,$gt:aD,$gte:aD,$lt:aD,$lte:aD};B0.prototype.castForQuery=function(F,A,B){if(F==null)try{return this.applySetters(A,B)}catch(J){if(J instanceof ef&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}let D=this.$conditionalHandlers[F];if(!D)throw new Error("Can't use "+F+" with Date.");return D.call(this,A)};/*!
|
|
478
|
+
* Module exports.
|
|
479
|
+
*/F_.exports=B0});var D_=z((zI1,B_)=>{var W9=lB(),kY1=import.meta.require("assert");B_.exports=function F(A){if(A==null)return A;if(typeof A==="object"&&typeof A.$numberDecimal==="string")return W9.fromString(A.$numberDecimal);if(A instanceof W9)return A;if(typeof A==="string")return W9.fromString(A);if(typeof Buffer==="function"&&Buffer.isBuffer(A))return new W9(A);if(typeof Uint8Array==="function"&&A instanceof Uint8Array)return new W9(A);if(typeof A==="number")return W9.fromString(String(A));if(typeof A.valueOf==="function"&&typeof A.valueOf()==="string")return W9.fromString(A.valueOf());kY1.ok(!1)}});var Z_=z((UI1,J_)=>{/*!
|
|
480
|
+
* Module dependencies.
|
|
481
|
+
*/var g3=M0(),SY1=g3.CastError,xY1=D_(),FH=H2();function I0(F,A){g3.call(this,F,A,"Decimal128")}I0.schemaName="Decimal128";I0.defaultOptions={};/*!
|
|
482
|
+
* Inherits from SchemaType.
|
|
483
|
+
*/I0.prototype=Object.create(g3.prototype);I0.prototype.constructor=I0;/*!
|
|
484
|
+
* ignore
|
|
485
|
+
*/I0._cast=xY1;I0.set=g3.set;I0.setters=[];I0.get=g3.get;I0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
|
|
486
|
+
* ignore
|
|
487
|
+
*/I0._defaultCaster=(F)=>{if(F!=null&&!FH(F,"Decimal128"))throw new Error;return F};/*!
|
|
488
|
+
* ignore
|
|
489
|
+
*/I0._checkRequired=(F)=>FH(F,"Decimal128");I0.checkRequired=g3.checkRequired;I0.prototype.checkRequired=function F(A,B){if(g3._isRef(this,A,B,!0))return!!A;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():I0.checkRequired())(A)};I0.prototype.cast=function(F,A,B){if(g3._isRef(this,F,A,B)){if(FH(F,"Decimal128"))return F;return this._castRef(F,A,B)}let D;if(typeof this._castFunction==="function")D=this._castFunction;else if(typeof this.constructor.cast==="function")D=this.constructor.cast();else D=I0.cast();try{return D(F)}catch(J){throw new SY1("Decimal128",F,this.path,J,this)}};/*!
|
|
490
|
+
* ignore
|
|
491
|
+
*/function rD(F){return this.cast(F)}I0.prototype.$conditionalHandlers={...g3.prototype.$conditionalHandlers,$gt:rD,$gte:rD,$lt:rD,$lte:rD};/*!
|
|
492
|
+
* Module exports.
|
|
493
|
+
*/J_.exports=I0});var Y_=z((QI1,X_)=>{var fY1=i2();class AH extends fY1{}var _Y1=q6();Object.defineProperty(AH.prototype,"_id",_Y1);X_.exports=AH});var BH=z((LI1,$_)=>{$_.exports=function F(A,B,D){if(A.length===0)return D();let J=A.length,Z=null;for(let X of A)B(X,function(Y){if(Z!=null)return;if(Y!=null)return Z=Y,D(Z);if(--J<=0)return D()})}});var E_=z((VI1,G_)=>{var gY1=BH();/*!
|
|
494
|
+
* ignore
|
|
495
|
+
*/G_.exports=function F(A){A.s.hooks.pre("save",!1,function D(J){if(this.$isSubdocument){J();return}let Z=this,X=this.$getAllSubdocs({useCache:!0});if(!X.length){J();return}gY1(X,function(Y,$){Y.$__schema.s.hooks.execPre("save",Y,function(G){$(G)})},function(Y){if(Z.$__.saveOptions.__subdocs=null,Y)return Z.$__schema.s.hooks.execPost("save:error",Z,[Z],{error:Y},function($){J($)});J()})},null,!0),A.s.hooks.post("save",async function D(){let J=this.$__.removedSubdocs;if(!J||!J.length)return;let Z=[];for(let X of J)Z.push(new Promise((Y,$)=>{X.$__schema.s.hooks.execPost("deleteOne",X,[X],function(G){if(G)return $(G);Y()})}));this.$__.removedSubdocs=null,await Promise.all(Z)}),A.s.hooks.post("save",async function D(){if(this.$isSubdocument)return;let J=this,Z=this.$getAllSubdocs({useCache:!0});if(!Z.length)return;let X=[];for(let Y of Z)X.push(new Promise(($,G)=>{Y.$__schema.s.hooks.execPost("save",Y,[Y],function(E){if(E)return G(E);$()})}));try{await Promise.all(X)}catch(Y){await new Promise(($,G)=>{this.$__schema.s.hooks.execPost("save:error",J,[J],{error:Y},function(E){if(E)return G(E);$()})})}},null,!0)}});var q_=z((RI1,JH)=>{var bY1=o().objectIdSymbol,C_=J1();/*!
|
|
496
|
+
* ignore
|
|
497
|
+
*/JH.exports=function F(A){A.post("init",function B(){return DH.call(this),this}),A.pre("save",function B(D){H_.call(this),D()}),A.pre("remove",function B(D){H_.call(this),D()}),A.post("save",function B(){DH.call(this)})};/*!
|
|
498
|
+
* ignore
|
|
499
|
+
*/function H_(){let F,A;if(this.$__.shardval){F=Object.keys(this.$__.shardval),A=F.length,this.$where=this.$where||{};for(let B=0;B<A;++B)this.$where[F[B]]=this.$__.shardval[F[B]]}}/*!
|
|
500
|
+
* ignore
|
|
501
|
+
*/JH.exports.storeShard=DH;/*!
|
|
502
|
+
* ignore
|
|
503
|
+
*/function DH(){let F=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(!C_.isPOJO(F))return;let A=this.$__.shardval={},B=Object.keys(F),D=B.length,J;for(let Z=0;Z<D;++Z)if(J=this.$__getValue(B[Z]),J==null)A[B[Z]]=J;else if(C_.isMongooseObject(J))A[B[Z]]=J.toObject({depopulate:!0,_isNested:!0});else if(J instanceof Date||J[bY1])A[B[Z]]=J;else if(typeof J.valueOf==="function")A[B[Z]]=J.valueOf();else A[B[Z]]=J}});var z_=z((wI1,K_)=>{var e7=o().arrayAtomicsSymbol,ZH=o().sessionNewDocuments,yY1=J1();K_.exports=function F(A){A.pre("save",function B(){let D=this.$session();if(D==null)return;if(D.transaction==null||D[ZH]==null)return;if(!D[ZH].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=vY1(this),D[ZH].set(this,J)}})};function vY1(F,A){let B=new Map;A=A||new Map;let D=Object.keys(F.$__.activePaths.init).concat(Object.keys(F.$__.activePaths.modify));for(let Z of D){let X=F.$__getValue(Z);if(X!=null&&Array.isArray(X)&&yY1.isMongooseDocumentArray(X)&&X.length&&X[e7]!=null&&Object.keys(X[e7]).length!==0){let Y=A.get(Z)||{};B.set(Z,W_(Y,X[e7]))}}let J=F.$__dirty();for(let Z of J){let{path:X,value:Y}=Z;if(Y!=null&&Y[e7]!=null&&Object.keys(Y[e7]).length!==0){let $=A.get(X)||{};B.set(X,W_($,Y[e7]))}}return B}function W_(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 Q_=z((II1,U_)=>{/*!
|
|
504
|
+
* ignore
|
|
505
|
+
*/U_.exports=function F(A){A.pre("save",!1,function D(J,Z){let X=this;if(this.$isSubdocument)return J();let Y=Z&&typeof Z==="object"&&"validateBeforeSave"in Z,$;if(Y)$=!!Z.validateBeforeSave;else $=this.$__schema.options.validateBeforeSave;if($){let E=Z&&typeof Z==="object"&&"validateModifiedOnly"in Z?{validateModifiedOnly:Z.validateModifiedOnly}:null;this.$validate(E).then(()=>{this.$op="save",J()},(C)=>{X.$__schema.s.hooks.execPost("save:error",X,[X],{error:C},function(H){X.$op="save",J(H)})})}else J()},null,!0)}});var XH=z((hY1)=>{hY1.saveSubdocs=E_();hY1.sharding=q_();hY1.trackTransaction=z_();hY1.validateBeforeSave=Q_()});var R_=z((PI1,V_)=>{var L_=XH();V_.exports=function F(A){for(let B of Object.values(L_))B(A,{deduplicate:!0});A.plugins=Object.values(L_).map((B)=>({fn:B,opts:{deduplicate:!0}})).concat(A.plugins)}});var N_=z((MI1,I_)=>{var pY1=FD(),iY1=D9(),nY1=H2(),sY1=j3(),w_=K4();I_.exports=function F(A,B,D,J){let Z=Object.keys(B),X=0,Y=Z.length,$;if(D=D||"",J=J||new WeakSet,J.has(B))return;J.add(B);while(X<Y){if($=Z[X++],!D){if($==="discriminators"||$==="base"||$==="_applyDiscriminators"||$==="_userProvidedOptions"||$==="options"||$==="tree")continue}if(D==="tree"&&B!=null&&B.instanceOfSchema)continue;if(iY1.has($))continue;if(A[$]==null)A[$]=B[$];else if(w_(B[$])){if(!w_(A[$]))A[$]={};if(B[$]!=null){if(B[$].$isSingleNested&&A[$].$isMongooseDocumentArray||B[$].$isMongooseDocumentArray&&A[$].$isSingleNested||B[$].$isMongooseDocumentArrayElement&&A[$].$isMongooseDocumentArrayElement)continue;else if(B[$].instanceOfSchema){if(A[$].instanceOfSchema)pY1(A[$],B[$].clone(),!0);else A[$]=B[$].clone();continue}else if(nY1(B[$],"ObjectId")){A[$]=new sY1(B[$]);continue}}F(A[$],B[$],D?D+"."+$:$,J)}}if(B!=null&&B.instanceOfSchema)A.tree=Object.assign({},B.tree,A.tree)}});var tD=z((TI1,T_)=>{var P_=$9(),aY1=R_(),rY1=Z0(),tY1=ZD().defineKey,oY1=C0(),YH=J1(),eY1=N_(),M_={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0};/*!
|
|
506
|
+
* ignore
|
|
507
|
+
*/T_.exports=function F(A,B,D,J,Z,X,Y){if(!(D&&D.instanceOfSchema))throw new Error("You must pass a valid discriminator Schema");if(X=X==null?!0:X,A.schema.discriminatorMapping&&!A.schema.discriminatorMapping.isRoot)throw new Error('Discriminator "'+B+'" can only be a discriminator of the root model');if(Z){let H=oY1(A.base,"options.applyPluginsToDiscriminators",!1)||!X;A.base._applyPlugins(D,{skipTopLevel:!H})}else if(!X)aY1(D);let $=A.schema.options.discriminatorKey,G=A.schema.path($);if(G!=null){if(!YH.hasUserDefinedProperty(G.options,"select"))G.options.select=!0;G.options.$skipDiscriminatorCheck=!0}else{let H={};H[$]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},H[$][A.schema.options.typeKey]=String,A.schema.add(H),tY1({prop:$,prototype:A.prototype,options:A.schema.options})}if(D.path($)&&D.path($).options.$skipDiscriminatorCheck!==!0)throw new Error('Discriminator "'+B+'" cannot have field with name "'+$+'"');let E=B;if(typeof J==="string"&&J.length||J!=null)E=J;function C(H,q){if(H._baseSchema=q,q.paths._id&&q.paths._id.options&&!q.paths._id.options.auto)H.remove("_id");let W=Object.keys(q.paths),K=[];for(let M of W){if(H.nested[M]){K.push(M);continue}if(M.indexOf(".")===-1)continue;let x=M.split(".").slice(0,-1),m="";for(let u of x)if(m+=(m.length?".":"")+u,H.paths[m]instanceof P_||H.singleNestedPaths[m]instanceof P_)K.push(M)}H.obj={...H.obj},eY1(H,q);for(let M of K)delete H.paths[M];H.childSchemas.forEach((M)=>{M.model.prototype.$__setSchema(M.schema)});let U={};if(U[$]={default:E,select:!0,set:function(M){if(M===E||Array.isArray(E)&&YH.deepEqual(M,E))return E;throw new Error(`Can't set discriminator key "`+$+'"')},$skipDiscriminatorCheck:!0},U[$][H.options.typeKey]=G?G.options[H.options.typeKey]:String,H.add(U),H.discriminatorMapping={key:$,value:E,isRoot:!1},q.options.collection)H.options.collection=q.options.collection;let Q=H.options.toJSON,L=H.options.toObject,V=H.options._id,w=H.options.id,j=Object.keys(H.options);H.options.discriminatorKey=q.options.discriminatorKey;let T=H._userProvidedOptions;for(let M of j)if(!M_[M]){if(M in T&&!YH.deepEqual(H.options[M],q.options[M]))throw new Error("Can't customize discriminator option "+M+" (can only modify "+Object.keys(M_).join(", ")+")")}H.options=rY1(q.options);for(let M of Object.keys(T))H.options[M]=T[M];if(Q)H.options.toJSON=Q;if(L)H.options.toObject=L;if(typeof V!=="undefined")H.options._id=V;if(H.options.id=w,X)H.s.hooks=A.schema.s.hooks.merge(H.s.hooks);if(Z)H.plugins=Array.prototype.slice.call(q.plugins);H.callQueue=q.callQueue.concat(H.callQueue),delete H._requiredpaths}if(C(D,A.schema),!A.discriminators)A.discriminators={};if(!A.schema.discriminatorMapping)A.schema.discriminatorMapping={key:$,value:null,isRoot:!0};if(!A.schema.discriminators)A.schema.discriminators={};if(A.schema.discriminators[B]=D,A.discriminators[B]&&!D.options.overwriteModels&&!Y)throw new Error('Discriminator with name "'+B+'" already exists');return D}});var oD=z((jI1,j_)=>{var F$1=K6();j_.exports=function F(A,B,D){let J=A.schema.options.discriminatorKey,Z=B!=null&&B[J];if(Z==null)Z=D;if(A.discriminators&&Z!=null)if(A.discriminators[Z])A=A.discriminators[Z];else{let X=F$1(A.discriminators,Z);if(X)A=X}return A}});var $H=z((uI1,u_)=>{var A$1=PC();u_.exports=function F(A,B){if(B==null||B._id==null)return A;if(A=A.clone(),!B._id)A.remove("_id"),A.options._id=!1;else if(!A.paths._id)A$1(A),A.options._id=!0;return A}});var EH=z((OI1,O_)=>{/*!
|
|
508
|
+
* Module dependencies.
|
|
509
|
+
*/var B$1=C1();class GH extends B$1{constructor(F,A){let B=`Cannot create use schema for property "${F}" because the schema has the ${A} option enabled.`;super(B)}}Object.defineProperty(GH.prototype,"name",{value:"InvalidSchemaOptionError"});/*!
|
|
510
|
+
* exports
|
|
511
|
+
*/O_.exports=GH});var WH=z((kI1,f_)=>{/*!
|
|
512
|
+
* Module dependencies.
|
|
513
|
+
*/var k_=q2(),CH=import.meta.require("events").EventEmitter,D$1=SE(),J$1=Y_(),F8=M0(),Z$1=DD(),X$1=tB(),S_=JF().castToNumber,Y$1=tD(),HH=iC(),qH=oD(),$$1=$H(),G$1=y6().internalToObjectOptions,E$1=d7(),C$1=J1(),H$1=EH(),eD;f_.exports=l1;function l1(F,A,B){if(F.options.timeseries)throw new H$1(A,"timeseries");let D=l1.defaultOptions&&l1.defaultOptions._id;if(D!=null)B=B||{},B._id=D;F=$$1(F,B),this.caster=x_(F,null,B),this.caster.path=A,this.caster.prototype.$basePath=A,this.schema=F,this.$isSingleNested=!0,this.base=F.base,F8.call(this,A,B,"Embedded")}/*!
|
|
514
|
+
* ignore
|
|
515
|
+
*/l1.prototype=Object.create(F8.prototype);l1.prototype.constructor=l1;l1.prototype.OptionsConstructor=J$1;/*!
|
|
516
|
+
* ignore
|
|
517
|
+
*/function x_(F,A,B){eD||(eD=GD());let D=function Z(X,Y,$){if(this.$__parent=$,eD.apply(this,arguments),$==null)return;this.$session($.$session())};F._preCompile();let J=A!=null?A.prototype:eD.prototype;D.prototype=Object.create(J),D.prototype.$__setSchema(F),D.prototype.constructor=D,D.$__required=B?.required,D.base=F.base,D.schema=F,D.$isSingleNested=!0,D.events=new CH,D.prototype.toBSON=function(){return this.toObject(G$1)};for(let Z in F.methods)D.prototype[Z]=F.methods[Z];for(let Z in F.statics)D[Z]=F.statics[Z];for(let Z in CH.prototype)D[Z]=CH.prototype[Z];return D}l1.prototype.$conditionalHandlers.$geoWithin=function F(A,B){return{$geometry:this.castForQuery(null,A.$geometry,B)}};/*!
|
|
518
|
+
* ignore
|
|
519
|
+
*/l1.prototype.$conditionalHandlers.$near=l1.prototype.$conditionalHandlers.$nearSphere=HH.cast$near;l1.prototype.$conditionalHandlers.$within=l1.prototype.$conditionalHandlers.$geoWithin=HH.cast$within;l1.prototype.$conditionalHandlers.$geoIntersects=HH.cast$geoIntersects;l1.prototype.$conditionalHandlers.$minDistance=S_;l1.prototype.$conditionalHandlers.$maxDistance=S_;l1.prototype.$conditionalHandlers.$exists=X$1;l1.prototype.cast=function(F,A,B,D,J){if(F&&F.$isSingleNested&&F.parent===A)return F;if(F!=null&&(typeof F!=="object"||Array.isArray(F)))throw new D$1(this.path,F);let Z=this.schema.path(this.schema.options.discriminatorKey),X=Z==null?null:Z.getDefault(A),Y=qH(this.caster,F,X),$,G=A&&A.$__&&A.$__.selected,E=this.path,C=G==null?null:Object.keys(G).reduce((H,q)=>{if(q.startsWith(E+"."))H=H||{},H[q.substring(E.length+1)]=G[q];return H},null);if(B){$=new Y(void 0,C,A,!1,{defaults:!1}),delete $.$__.defaults,$.$init(F);let H=E$1(C);Z$1($,C,H)}else{if(J=Object.assign({},J,{priorDoc:D}),Object.keys(F).length===0)return new Y({},C,A,void 0,J);return new Y(F,C,A,void 0,J)}return $};l1.prototype.castForQuery=function(F,A,B,D){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 Z=qH(this.caster,A);if(A instanceof Z)return A;if(this.options.runSetters)A=this._applySetters(A,B);let X=D!=null&&D.strict!=null?D.strict:void 0;try{A=new Z(A,X)}catch(Y){if(!(Y instanceof k_))throw new k_("Embedded",A,this.path,Y,this);throw Y}return A};l1.prototype.doValidate=function(F,A,B,D){let J=qH(this.caster,F);if(F&&!(F instanceof J))F=new J(F,null,B!=null&&B.$__!=null?B:null);if(D&&D.skipSchemaValidators){if(!F)return A(null);return F.validate().then(()=>A(null),(Z)=>A(Z))}F8.prototype.doValidate.call(this,F,function(Z){if(Z)return A(Z);if(!F)return A(null);F.validate().then(()=>A(null),(X)=>A(X))},B,D)};l1.prototype.doValidateSync=function(F,A,B){if(!B||!B.skipSchemaValidators){let D=F8.prototype.doValidateSync.call(this,F,A);if(D)return D}if(!F)return;return F.validateSync()};l1.prototype.discriminator=function(F,A,B){B=B||{};let D=C$1.isPOJO(B)?B.value:B,J=typeof B.clone==="boolean"?B.clone:!0;if(A.instanceOfSchema&&J)A=A.clone();return A=Y$1(this.caster,F,A,D,null,null,B.overwriteExisting),this.caster.discriminators[F]=x_(A,this.caster),this.caster.discriminators[F]};/*!
|
|
520
|
+
* ignore
|
|
521
|
+
*/l1.defaultOptions={};l1.set=F8.set;l1.setters=[];l1.get=F8.get;/*!
|
|
522
|
+
* ignore
|
|
523
|
+
*/l1.prototype.toJSON=function F(){return{path:this.path,options:this.options}};/*!
|
|
524
|
+
* ignore
|
|
525
|
+
*/l1.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}});var g_=z((SI1,__)=>{/*!
|
|
526
|
+
* Module dependencies.
|
|
527
|
+
*/var q$1=C1(),KH=M0(),W$1=WH(),K$1=oD();function b3(F,A){if(this.$parentSchemaType=A&&A.$parentSchemaType,!this.$parentSchemaType)throw new q$1("Cannot create DocumentArrayElement schematype without a parent");delete A.$parentSchemaType,KH.call(this,F,A,"DocumentArrayElement"),this.$isMongooseDocumentArrayElement=!0}b3.schemaName="DocumentArrayElement";b3.defaultOptions={};/*!
|
|
528
|
+
* Inherits from SchemaType.
|
|
529
|
+
*/b3.prototype=Object.create(KH.prototype);b3.prototype.constructor=b3;b3.prototype.cast=function(...F){return this.$parentSchemaType.cast(...F)[0]};b3.prototype.doValidate=function(F,A,B,D){let J=K$1(this.caster,F);if(F&&!(F instanceof J))F=new J(F,B,null,null,D&&D.index!=null?D.index:null);return W$1.prototype.doValidate.call(this,F,A,B,D)};b3.prototype.clone=function(){this.options.$parentSchemaType=this.$parentSchemaType;let F=KH.prototype.clone.apply(this,arguments);return delete this.options.$parentSchemaType,F.caster=this.caster,F.schema=this.schema,F};/*!
|
|
530
|
+
* Module exports.
|
|
531
|
+
*/__.exports=b3});var v_=z((xI1,y_)=>{var z$1=i2();class FJ extends z$1{}var b_=q6();Object.defineProperty(FJ.prototype,"excludeIndexes",b_);Object.defineProperty(FJ.prototype,"_id",b_);/*!
|
|
532
|
+
* ignore
|
|
533
|
+
*/y_.exports=FJ});var n_=z((fI1,i_)=>{/*!
|
|
534
|
+
* Module dependencies.
|
|
535
|
+
*/var h_=q2(),U$1=g_(),zH=import.meta.require("events").EventEmitter,QH=hD(),Q$1=v_(),GF=M0(),m_=q9(),L$1=tD(),d_=$H(),V$1=YD(),R$1=BF(),A8=J1(),AJ=oD(),w$1=EH(),c_=o().arrayAtomicsSymbol,UH=o().arrayPathSymbol,I$1=o().documentArrayParent,y3,K9;function X0(F,A,B,D){if(A.options&&A.options.timeseries)throw new w$1(F,"timeseries");let J=X0.defaultOptions&&X0.defaultOptions._id;if(J!=null)D=D||{},D._id=J;if(D!=null&&D._id!=null)A=d_(A,D);else if(B!=null&&B._id!=null)A=d_(A,B);let Z=p_(A,B);Z.prototype.$basePath=F,QH.call(this,F,Z,B),this.schema=A,this.schemaOptions=D||{},this.$isMongooseDocumentArray=!0,this.Constructor=Z,Z.base=A.base;let X=this.defaultValue;if(!("defaultValue"in this)||X!=null)this.default(function(){let $=X.call(this);if($!=null&&!Array.isArray($))$=[$];return $});let Y=this;this.$embeddedSchemaType=new U$1(F+".$",{required:this&&this.schemaOptions&&this.schemaOptions.required||!1,$parentSchemaType:Y}),this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}X0.schemaName="DocumentArray";X0.options={castNonArrays:!0};/*!
|
|
536
|
+
* Inherits from SchemaArray.
|
|
537
|
+
*/X0.prototype=Object.create(QH.prototype);X0.prototype.constructor=X0;X0.prototype.OptionsConstructor=Q$1;X0.prototype.$conditionalHandlers={...QH.prototype.$conditionalHandlers};/*!
|
|
538
|
+
* ignore
|
|
539
|
+
*/function p_(F,A,B){K9||(K9=c7());function D(){if(K9.apply(this,arguments),this.__parentArray==null||this.__parentArray.getArrayParent()==null)return;this.$session(this.__parentArray.getArrayParent().$session())}F._preCompile();let J=B!=null?B.prototype:K9.prototype;D.prototype=Object.create(J),D.prototype.$__setSchema(F),D.schema=F,D.prototype.constructor=D,D.$isArraySubdocument=!0,D.events=new zH,D.base=F.base;for(let Z in F.methods)D.prototype[Z]=F.methods[Z];for(let Z in F.statics)D[Z]=F.statics[Z];for(let Z in zH.prototype)D[Z]=zH.prototype[Z];return D.options=A,D}X0.prototype.discriminator=function(F,A,B){if(typeof F==="function")F=A8.getFunctionName(F);B=B||{};let D=A8.isPOJO(B)?B.value:B,J=typeof B.clone==="boolean"?B.clone:!0;if(A.instanceOfSchema&&J)A=A.clone();A=L$1(this.casterConstructor,F,A,D,null,null,B?.overwriteExisting);let Z=p_(A,null,this.casterConstructor);Z.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(Z,"name",{value:F})}catch(X){}return this.casterConstructor.discriminators[F]=Z,this.casterConstructor.discriminators[F]};X0.prototype.doValidate=function(F,A,B,D){y3||(y3=E9());let J=this;try{GF.prototype.doValidate.call(this,F,Z,B)}catch(X){return A(X)}function Z(X){if(X)return A(X);let Y=F&&F.length,$;if(!Y)return A();if(D&&D.updateValidator)return A();if(!A8.isMongooseDocumentArray(F))F=new y3(F,J.path,B);function G(E){if(E!=null)$=E;--Y||A($)}for(let E=0,C=Y;E<C;++E){let H=F[E];if(H==null){--Y||A($);continue}if(!(H instanceof K9)){let q=AJ(J.casterConstructor,F[E]);H=F[E]=new q(H,F,void 0,void 0,E)}if(D!=null&&D.validateModifiedOnly&&!H.$isModified()){--Y||A($);continue}H.$__validate(null,D,G)}}};X0.prototype.doValidateSync=function(F,A,B){let D=GF.prototype.doValidateSync.call(this,F,A);if(D!=null)return D;let J=F&&F.length,Z=null;if(!J)return;for(let X=0,Y=J;X<Y;++X){let $=F[X];if(!$)continue;if(!($ instanceof K9)){let E=AJ(this.casterConstructor,F[X]);$=F[X]=new E($,F,void 0,void 0,X)}if(B!=null&&B.validateModifiedOnly&&!$.$isModified())continue;let G=$.validateSync(B);if(G&&Z==null)Z=G}return Z};/*!
|
|
540
|
+
* ignore
|
|
541
|
+
*/X0.prototype.getDefault=function(F,A,B){let D=typeof this.defaultValue==="function"?this.defaultValue.call(F):this.defaultValue;if(D==null)return D;if(B&&B.skipCast)return D;if(y3||(y3=E9()),!Array.isArray(D))D=[D];D=new y3(D,this.path,F);for(let J=0;J<D.length;++J){let X=new(AJ(this.casterConstructor,D[J]))({},D,void 0,void 0,J);X.$init(D[J]),X.isNew=!0,Object.assign(X.$__.activePaths.default,X.$__.activePaths.init),X.$__.activePaths.init={},D[J]=X}return D};var N$1=Object.freeze({transform:!1,virtuals:!1}),l_=Object.freeze({skipId:!1,willInit:!0});X0.prototype.cast=function(F,A,B,D,J){if(y3||(y3=E9()),F!=null&&F[UH]!=null&&F===D)return F;let Z,X;J=J||{};let Y=J.path||this.path;if(!Array.isArray(F)){if(!B&&!X0.options.castNonArrays)throw new h_("DocumentArray",F,this.path,null,this);if(!!A&&B)A.markModified(Y);return this.cast([F],A,B,D,J)}if(!J.skipDocumentArrayCast||A8.isMongooseDocumentArray(F))F=new y3(F,Y,A,this);if(D!=null)F[c_]=D[c_]||{};if(J.arrayPathIndex!=null)F[UH]=Y+"."+J.arrayPathIndex;let $=A8.isMongooseDocumentArray(F)?F.__array:F,G=$.length;for(let E=0;E<G;++E){if(!$[E])continue;let C=AJ(this.casterConstructor,$[E]),H=V$1($[E],!0);if($[E]!==H)$[E]=H;if($[E]instanceof K9){if($[E][I$1]!==A)if(B){let q=new C(null,F,l_,Z,E);$[E]=q.$init($[E])}else{let q=new C($[E],F,void 0,void 0,E);$[E]=q}if($[E].__index==null)$[E].$setIndex(E)}else if($[E]!=null)if(B){if(A)Z||(Z=P$1(this,A.$__.selected,B));else Z=!0;X=new C(null,F,l_,Z,E),$[E]=X.$init($[E])}else{if(D&&typeof D.id==="function")X=D.id($[E]._id);if(D&&X&&A8.deepEqual(X.toObject(N$1),$[E]))X.set($[E]),$[E]=X;else try{X=new C($[E],F,void 0,void 0,E),$[E]=X}catch(q){throw new h_("embedded",$[E],F[UH],q,this)}}}return F};/*!
|
|
542
|
+
* ignore
|
|
543
|
+
*/X0.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};/*!
|
|
544
|
+
* ignore
|
|
545
|
+
*/X0.prototype.applyGetters=function(F,A){return GF.prototype.applyGetters.call(this,F,A)};function P$1(F,A,B){if(!(B&&A))return;let D=F.path+".",J=Object.keys(A),Z=J.length,X={},Y,$,G;while(Z--)if($=J[Z],$.startsWith(D)){if(G=$.substring(D.length),G==="$")continue;if(G.startsWith("$."))G=G.substring(2);Y||(Y=!0),X[G]=A[$]}return Y&&X||void 0}/*!
|
|
546
|
+
* ignore
|
|
547
|
+
*/X0.defaultOptions={};X0.set=GF.set;X0.setters=[];X0.get=GF.get;/*!
|
|
548
|
+
* Handle casting $elemMatch operators
|
|
549
|
+
*/X0.prototype.$conditionalHandlers.$elemMatch=M$1;function M$1(F,A){let B=Object.keys(F),D=B.length;for(let Y=0;Y<D;++Y){let $=B[Y],G=F[$];if(R$1($)&&G!=null)F[$]=this.castForQuery($,G,A)}let J=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.options&&this.casterConstructor.schema.options.discriminatorKey,Z=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.discriminators||{};if(J!=null&&F[J]!=null&&Z[F[J]]!=null)return m_(Z[F[J]],F,null,this&&this.$$context);let X=this.casterConstructor.schema??A.schema;return m_(X,F,null,this&&this.$$context)}/*!
|
|
550
|
+
* Module exports.
|
|
551
|
+
*/i_.exports=X0});var a_=z((_I1,s_)=>{var T$1=i2();class LH extends T$1{}var j$1=q6();Object.defineProperty(LH.prototype,"of",j$1);s_.exports=LH});var o_=z((gI1,t_)=>{/*!
|
|
552
|
+
* ignore
|
|
553
|
+
*/var VH=kD(),u$1=a_(),r_=M0();/*!
|
|
554
|
+
* ignore
|
|
555
|
+
*/class EF extends r_{constructor(F,A){super(F,A,"Map");this.$isSchemaMap=!0}set(F,A){return r_.set(F,A)}cast(F,A,B){if(F instanceof VH)return F;let D=this.path;if(B){let J=new VH({},D,A,this.$__schemaType);if(F instanceof global.Map)for(let Z of F.keys()){let X=F.get(Z);if(X==null)X=J.$__schemaType._castNullish(X);else X=J.$__schemaType.cast(X,A,!0,null,{path:D+"."+Z});J.$init(Z,X)}else for(let Z of Object.keys(F)){let X=F[Z];if(X==null)X=J.$__schemaType._castNullish(X);else X=J.$__schemaType.cast(X,A,!0,null,{path:D+"."+Z});J.$init(Z,X)}return J}return new VH(F,D,A,this.$__schemaType)}clone(){let F=super.clone();if(this.$__schemaType!=null)F.$__schemaType=this.$__schemaType.clone();return F}}EF.schemaName="Map";EF.prototype.OptionsConstructor=u$1;EF.defaultOptions={};t_.exports=EF});var Ag=z((bI1,Fg)=>{var O$1=i2();class BJ extends O$1{}var e_=q6();Object.defineProperty(BJ.prototype,"auto",e_);Object.defineProperty(BJ.prototype,"populate",e_);/*!
|
|
556
|
+
* ignore
|
|
557
|
+
*/Fg.exports=BJ});var Zg=z((yI1,Jg)=>{/*!
|
|
558
|
+
* Module dependencies.
|
|
559
|
+
*/var k$1=Ag(),v3=M0(),S$1=rE(),x$1=C2(),wH=j3(),IH=H2(),Bg=J1(),f$1=v3.CastError,RH;function U0(F,A){let B=typeof F==="string"&&F.length===24&&/^[a-f0-9]+$/i.test(F),D=A&&A.suppressWarning;if((B||typeof F==="undefined")&&!D)Bg.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.");v3.call(this,F,A,"ObjectId")}U0.schemaName="ObjectId";U0.defaultOptions={};/*!
|
|
560
|
+
* Inherits from SchemaType.
|
|
561
|
+
*/U0.prototype=Object.create(v3.prototype);U0.prototype.constructor=U0;U0.prototype.OptionsConstructor=k$1;U0.get=v3.get;U0.set=v3.set;U0.setters=[];U0.prototype.auto=function(F){if(F)this.default(Dg),this.set(_$1);return this};/*!
|
|
562
|
+
* ignore
|
|
563
|
+
*/U0._checkRequired=(F)=>IH(F,"ObjectId");/*!
|
|
564
|
+
* ignore
|
|
565
|
+
*/U0._cast=S$1;U0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
|
|
566
|
+
* ignore
|
|
567
|
+
*/U0._defaultCaster=(F)=>{if(!IH(F,"ObjectId"))throw new Error(F+" is not an instance of ObjectId");return F};U0.checkRequired=v3.checkRequired;U0.prototype.checkRequired=function F(A,B){if(v3._isRef(this,A,B,!0))return!!A;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():U0.checkRequired())(A)};U0.prototype.cast=function(F,A,B){if(!IH(F,"ObjectId")&&v3._isRef(this,F,A,B)){if((x$1(F)||"").toLowerCase()==="objectid")return new wH(F.toHexString());if(F==null||Bg.isNonBuiltinObject(F))return this._castRef(F,A,B)}let D;if(typeof this._castFunction==="function")D=this._castFunction;else if(typeof this.constructor.cast==="function")D=this.constructor.cast();else D=U0.cast();try{return D(F)}catch(J){throw new f$1("ObjectId",F,this.path,J,this)}};/*!
|
|
568
|
+
* ignore
|
|
569
|
+
*/function DJ(F){return this.cast(F)}U0.prototype.$conditionalHandlers={...v3.prototype.$conditionalHandlers,$gt:DJ,$gte:DJ,$lt:DJ,$lte:DJ};/*!
|
|
570
|
+
* ignore
|
|
571
|
+
*/function Dg(){return new wH}Dg.$runBeforeSetters=!0;function _$1(F){if(RH||(RH=O2()),this instanceof RH){if(F===void 0)return new wH}return F}/*!
|
|
572
|
+
* Module exports.
|
|
573
|
+
*/Jg.exports=U0});var Yg=z((vI1,Xg)=>{var g$1=i2();class Q6 extends g$1{}var D3=q6();Object.defineProperty(Q6.prototype,"enum",D3);Object.defineProperty(Q6.prototype,"match",D3);Object.defineProperty(Q6.prototype,"lowercase",D3);Object.defineProperty(Q6.prototype,"trim",D3);Object.defineProperty(Q6.prototype,"uppercase",D3);Object.defineProperty(Q6.prototype,"minLength",D3);Object.defineProperty(Q6.prototype,"minlength",D3);Object.defineProperty(Q6.prototype,"maxLength",D3);Object.defineProperty(Q6.prototype,"maxlength",D3);Object.defineProperty(Q6.prototype,"populate",D3);/*!
|
|
574
|
+
* ignore
|
|
575
|
+
*/Xg.exports=Q6});var NH=z((hI1,Cg)=>{/*!
|
|
576
|
+
* Module dependencies.
|
|
577
|
+
*/var h3=M0(),HF=W2(),b$1=Yg(),y$1=fD(),$g=J1(),v$1=H2(),Eg=h3.CastError;function k1(F,A){this.enumValues=[],this.regExp=null,h3.call(this,F,A,"String")}k1.schemaName="String";k1.defaultOptions={};/*!
|
|
578
|
+
* Inherits from SchemaType.
|
|
579
|
+
*/k1.prototype=Object.create(h3.prototype);k1.prototype.constructor=k1;Object.defineProperty(k1.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:b$1});/*!
|
|
580
|
+
* ignore
|
|
581
|
+
*/k1._cast=y$1;k1.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
|
|
582
|
+
* ignore
|
|
583
|
+
*/k1._defaultCaster=(F)=>{if(F!=null&&typeof F!=="string")throw new Error;return F};k1.get=h3.get;k1.set=h3.set;k1.setters=[];/*!
|
|
584
|
+
* ignore
|
|
585
|
+
*/k1._checkRequired=(F)=>(F instanceof String||typeof F==="string")&&F.length;k1.checkRequired=h3.checkRequired;k1.prototype.enum=function(){if(this.enumValidator)this.validators=this.validators.filter(function(D){return D.validator!==this.enumValidator},this),this.enumValidator=!1;if(arguments[0]===void 0||arguments[0]===!1)return this;let F,A;if($g.isObject(arguments[0]))if(Array.isArray(arguments[0].values))F=arguments[0].values,A=arguments[0].message;else F=$g.object.vals(arguments[0]),A=HF.messages.String.enum;else F=arguments,A=HF.messages.String.enum;for(let D of F)if(D!==void 0)this.enumValues.push(this.cast(D));let B=this.enumValues;return this.enumValidator=function(D){return D==null||~B.indexOf(D)},this.validators.push({validator:this.enumValidator,message:A,type:"enum",enumValues:B}),this};k1.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})};k1.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})};k1.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})};k1.prototype.minlength=function(F,A){if(this.minlengthValidator)this.validators=this.validators.filter(function(B){return B.validator!==this.minlengthValidator},this);if(F!==null&&F!==void 0){let B=A||HF.messages.String.minlength;B=B.replace(/{MINLENGTH}/,F),this.validators.push({validator:this.minlengthValidator=function(D){return D===null||D.length>=F},message:B,type:"minlength",minlength:F})}return this};k1.prototype.minLength=k1.prototype.minlength;k1.prototype.maxlength=function(F,A){if(this.maxlengthValidator)this.validators=this.validators.filter(function(B){return B.validator!==this.maxlengthValidator},this);if(F!==null&&F!==void 0){let B=A||HF.messages.String.maxlength;B=B.replace(/{MAXLENGTH}/,F),this.validators.push({validator:this.maxlengthValidator=function(D){return D===null||D.length<=F},message:B,type:"maxlength",maxlength:F})}return this};k1.prototype.maxLength=k1.prototype.maxlength;k1.prototype.match=function F(A,B){let D=B||HF.messages.String.match,J=function(Z){if(!A)return!1;return A.lastIndex=0,Z!=null&&Z!==""?A.test(Z):!0};return this.validators.push({validator:J,message:D,type:"regexp",regexp:A}),this};k1.prototype.checkRequired=function F(A,B){if(typeof A==="object"&&h3._isRef(this,A,B,!0))return A!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():k1.checkRequired())(A)};k1.prototype.cast=function(F,A,B){if(typeof F!=="string"&&h3._isRef(this,F,A,B))return this._castRef(F,A,B);let D;if(typeof this._castFunction==="function")D=this._castFunction;else if(typeof this.constructor.cast==="function")D=this.constructor.cast();else D=k1.cast();try{return D(F)}catch(J){throw new Eg("string",F,this.path,null,this)}};/*!
|
|
586
|
+
* ignore
|
|
587
|
+
*/function CF(F,A){return this.castForQuery(null,F,A)}/*!
|
|
588
|
+
* ignore
|
|
589
|
+
*/function h$1(F,A){let B=this;if(!Array.isArray(F))return[this.castForQuery(null,F,A)];return F.map(function(D){return B.castForQuery(null,D,A)})}/*!
|
|
590
|
+
* ignore
|
|
591
|
+
*/function Gg(F){if(F==null)return this._castNullish(F);return this.cast(F,this)}var m$1={...h3.prototype.$conditionalHandlers,$all:h$1,$gt:CF,$gte:CF,$lt:CF,$lte:CF,$options:Gg,$regex:function F(A){if(Object.prototype.toString.call(A)==="[object RegExp]")return A;return Gg.call(this,A)},$not:CF};Object.defineProperty(k1.prototype,"$conditionalHandlers",{configurable:!1,enumerable:!1,writable:!1,value:Object.freeze(m$1)});k1.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=this.$conditionalHandlers[F],!D)throw new Error("Can't use "+F+" with String.");return D.call(this,A,B)}if(Object.prototype.toString.call(A)==="[object RegExp]"||v$1(A,"BSONRegExp"))return A;try{return this.applySetters(A,B)}catch(J){if(J instanceof Eg&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};/*!
|
|
592
|
+
* Module exports.
|
|
593
|
+
*/Cg.exports=k1});var zg=z((mI1,Kg)=>{/*!
|
|
594
|
+
* Module dependencies.
|
|
595
|
+
*/var TH=c5(),w4=M0(),XJ=w4.CastError,qg=J1(),JJ=gD(),MH=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,Wg=TH.Binary;function d$1(F){return F!=null&&Buffer.from(F,"hex")}function Hg(F){if(typeof F!=="string")F="";let A=F.replace(/[{}-]/g,""),B=d$1(A),D=new TH(B);return D._subtype=4,D}function ZJ(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 Q0(F,A){w4.call(this,F,A,"UUID"),this.getters.push(function(B){if(B!=null&&B.$__!=null)return B;if(Buffer.isBuffer(B))return ZJ(B);else if(B instanceof Wg)return ZJ(B.buffer);else if(qg.isPOJO(B)&&B.type==="Buffer"&&Array.isArray(B.data))return ZJ(Buffer.from(B.data));return B})}Q0.schemaName="UUID";Q0.defaultOptions={};/*!
|
|
596
|
+
* Inherits from SchemaType.
|
|
597
|
+
*/Q0.prototype=Object.create(w4.prototype);Q0.prototype.constructor=Q0;/*!
|
|
598
|
+
* ignore
|
|
599
|
+
*/Q0._cast=function(F){if(F==null)return F;function A(B){let D=new TH(B);return D._subtype=4,D}if(typeof F==="string")if(MH.test(F))return Hg(F);else throw new XJ(Q0.schemaName,F,this.path);if(Buffer.isBuffer(F))return A(F);if(F instanceof Wg)return A(F.value(!0));if(F.toString&&F.toString!==Object.prototype.toString){if(MH.test(F.toString()))return Hg(F.toString())}throw new XJ(Q0.schemaName,F,this.path)};Q0.get=w4.get;Q0.set=w4.set;Q0.setters=[];Q0.cast=function F(A){if(arguments.length===0)return this._cast;if(A===!1)A=this._defaultCaster;return this._cast=A,this._cast};/*!
|
|
600
|
+
* ignore
|
|
601
|
+
*/Q0._checkRequired=(F)=>F!=null;Q0.checkRequired=w4.checkRequired;Q0.prototype.checkRequired=function F(A){if(Buffer.isBuffer(A))A=ZJ(A);return A!=null&&MH.test(A)};Q0.prototype.cast=function(F,A,B){if(qg.isNonBuiltinObject(F)&&w4._isRef(this,F,A,B))return this._castRef(F,A,B);let D;if(typeof this._castFunction==="function")D=this._castFunction;else if(typeof this.constructor.cast==="function")D=this.constructor.cast();else D=Q0.cast();try{return D(F)}catch(J){throw new XJ(Q0.schemaName,F,this.path,J,this)}};/*!
|
|
602
|
+
* ignore
|
|
603
|
+
*/function qF(F){return this.cast(F)}/*!
|
|
604
|
+
* ignore
|
|
605
|
+
*/function PH(F){return F.map((A)=>{return this.cast(A)})}Q0.prototype.$conditionalHandlers={...w4.prototype.$conditionalHandlers,$bitsAllClear:JJ,$bitsAnyClear:JJ,$bitsAllSet:JJ,$bitsAnySet:JJ,$all:PH,$gt:qF,$gte:qF,$in:PH,$lt:qF,$lte:qF,$ne:qF,$nin:PH};Q0.prototype.castForQuery=function(F,A,B){let D;if(F!=null){if(D=this.$conditionalHandlers[F],!D)throw new Error("Can't use "+F+" with UUID.");return D.call(this,A,B)}try{return this.applySetters(A,B)}catch(J){if(J instanceof XJ&&J.path===this.path&&this.$fullPath!=null)J.path=this.$fullPath;throw J}};/*!
|
|
606
|
+
* Module exports.
|
|
607
|
+
*/Kg.exports=Q0});var DF=z((c$1)=>{/*!
|
|
608
|
+
* Module exports.
|
|
609
|
+
*/c$1.Array=hD();c$1.BigInt=yf();c$1.Boolean=mf();c$1.Buffer=nf();c$1.Date=A_();c$1.Decimal128=c$1.Decimal=Z_();c$1.DocumentArray=n_();c$1.Map=o_();c$1.Mixed=$9();c$1.Number=cC();c$1.ObjectId=Zg();c$1.String=NH();c$1.Subdocument=WH();c$1.UUID=zg();c$1.Oid=c$1.ObjectId;c$1.Object=c$1.Mixed;c$1.Bool=c$1.Boolean;c$1.ObjectID=c$1.ObjectId});var l7=z((SH,ug)=>{/*!
|
|
610
|
+
* Module dependencies.
|
|
611
|
+
*/var ZG1=import.meta.require("events").EventEmitter,XG1=x7(),I4=C1(),Lg=M0(),Vg=i2(),YG1=IC(),kH=TD(),Rg=PC(),z2=Z0(),wg=C0(),$G1=C2(),GG1=jx(),GJ=jC(),EG1=kx(),CG1=FD(),YJ=n2(),HG1=xx(),qG1=cx(),s1=J1(),WG1=px(),KG1=import.meta.require("util"),zG1=/\.\d+(\.|$)/,N4,UG1=uD().queryMiddlewareFunctions,QG1=OD().middlewareFunctions,Ig=UG1.concat(QG1).reduce((F,A)=>F.add(A),new Set),uH=s1.isPOJO,Ng=0,LG1=/^\d+$/;function n(F,A){if(!(this instanceof n))return new n(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=++Ng,this.mapPaths=[],this.s={hooks:new XG1},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,Z=Object.keys(J);for(let X of Z){let Y=J[X].options?J[X].options:void 0,$=this.virtual(X,Y);if(J[X].get)$.get(J[X].get);if(J[X].set)$.set(J[X].set)}}let B=F&&F._id&&s1.isObject(F._id);if(!this.paths._id&&this.options._id&&!B)Rg(this);this.setupTimestamp(this.options.timestamps)}function Pg(F,A){for(let B of Object.keys(A)){let D=null;if(A[B]!=null)D=A[B];else{let Z=wg(F.paths[B],"options");if(Z==null)continue;D=Z.alias}if(!D)continue;let J=F.paths[B].path;if(Array.isArray(D)){for(let Z of D){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(Y){return this.$set(X,Y)}}(J))}continue}if(typeof D!=="string")throw new Error("Invalid value for alias option on "+J+", got "+D);F.aliases[D]=J,F.virtual(D).get(function(Z){return function(){if(typeof this.get==="function")return this.get(Z);return this[Z]}}(J)).set(function(Z){return function(X){return this.$set(Z,X)}}(J))}}/*!
|
|
612
|
+
* Inherit from EventEmitter.
|
|
613
|
+
*/n.prototype=Object.create(ZG1.prototype);n.prototype.constructor=n;n.prototype.instanceOfSchema=!0;/*!
|
|
614
|
+
* ignore
|
|
615
|
+
*/Object.defineProperty(n.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0});Object.defineProperty(n.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(n.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0});n.prototype.obj;n.prototype.paths;n.prototype.tree;n.prototype.clone=function(){let F=this._clone();return F.on("init",(A)=>this.emit("init",A)),F};/*!
|
|
616
|
+
* ignore
|
|
617
|
+
*/n.prototype._clone=function F(A){A=A||(this.base==null?n:this.base.Schema);let B=new A({},this._userProvidedOptions);B.base=this.base,B.obj=this.obj,B.options=z2(this.options),B.callQueue=this.callQueue.map(function(D){return D}),B.methods=z2(this.methods),B.methodOptions=z2(this.methodOptions),B.statics=z2(this.statics),B.query=z2(this.query),B.plugins=Array.prototype.slice.call(this.plugins),B._indexes=z2(this._indexes),B._searchIndexes=z2(this._searchIndexes),B.s.hooks=this.s.hooks.clone(),B.tree=z2(this.tree),B.paths=Object.fromEntries(Object.entries(this.paths).map(([D,J])=>[D,J.clone()])),B.nested=z2(this.nested),B.subpaths=z2(this.subpaths);for(let D of Object.values(B.paths))if(D.$isSingleNested){let J=D.path;for(let Z of Object.keys(D.schema.paths))B.singleNestedPaths[J+"."+Z]=D.schema.paths[Z];for(let Z of Object.keys(D.schema.singleNestedPaths))B.singleNestedPaths[J+"."+Z]=D.schema.singleNestedPaths[Z];for(let Z of Object.keys(D.schema.subpaths))B.singleNestedPaths[J+"."+Z]=D.schema.subpaths[Z];for(let Z of Object.keys(D.schema.nested))B.singleNestedPaths[J+"."+Z]="nested"}if(B.childSchemas=VG1(B),B.virtuals=z2(this.virtuals),B.$globalPluginsApplied=this.$globalPluginsApplied,B.$isRootDiscriminator=this.$isRootDiscriminator,B.$implicitlyCreated=this.$implicitlyCreated,B.$id=++Ng,B.$originalSchemaId=this.$id,B.mapPaths=[].concat(this.mapPaths),this.discriminatorMapping!=null)B.discriminatorMapping=Object.assign({},this.discriminatorMapping);if(this.discriminators!=null)B.discriminators=Object.assign({},this.discriminators);if(this._applyDiscriminators!=null)B._applyDiscriminators=new Map(this._applyDiscriminators);return B.aliases=Object.assign({},this.aliases),B};n.prototype.pick=function(F,A){let B=new n({},A||this.options);if(!Array.isArray(F))throw new I4('Schema#pick() only accepts an array argument, got "'+typeof F+'"');for(let D of F)if(this.nested[D])B.add({[D]:wg(this.tree,D)});else{let J=this.path(D);if(J==null)throw new I4("Path `"+D+"` is not in the schema");B.add({[D]:J})}return B};n.prototype.omit=function(F,A){let B=new n(this,A||this.options);if(!Array.isArray(F))throw new I4('Schema#omit() only accepts an array argument, got "'+typeof F+'"');B.remove(F);for(let D in B.singleNestedPaths)if(F.includes(D))delete B.singleNestedPaths[D];return B};n.prototype.defaultOptions=function(F){this._userProvidedOptions=F==null?{}:z2(F);let A=this.base&&this.base.options||{},B="strict"in A?A.strict:!0,D="strictQuery"in A?A.strictQuery:!1,J="id"in A?A.id:!0;if(F={strict:B,strictQuery:D,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 I4("`versionKey` must be falsy or string, got `"+typeof F.versionKey+"`");if(typeof F.read==="string")F.read=GJ(F.read);else if(Array.isArray(F.read)&&typeof F.read[0]==="string")F.read={mode:GJ(F.read[0]),tags:F.read[1]};if(F.optimisticConcurrency&&!F.versionKey)throw new I4("Must set `versionKey` if using `optimisticConcurrency`");return F};n.prototype.discriminator=function(F,A,B){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(F,{schema:A,options:B}),this};/*!
|
|
618
|
+
* Get this schema's default toObject/toJSON options, including Mongoose global
|
|
619
|
+
* options.
|
|
620
|
+
*/n.prototype._defaultToObjectOptions=function(F){let A=F?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&this._defaultToObjectOptionsMap[A])return this._defaultToObjectOptionsMap[A];let B=this.base&&this.base.options&&this.base.options[A]||{},D=this.options[A]||{},J=Object.assign({},B,D);return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[A]=J,J};n.prototype.add=function F(A,B){if(A instanceof n||A!=null&&A.instanceOfSchema)return CG1(this,A),this;if(A._id===!1&&B==null)this.options._id=!1;if(B=B||"",B==="__proto__."||B==="constructor."||B==="prototype.")return this;let D=Object.keys(A),J=this.options.typeKey;for(let X of D){if(s1.specialProperties.has(X))continue;let Y=B+X,$=A[X];if($==null)throw new TypeError("Invalid value for schema path `"+Y+'`, got value "'+$+'"');if(X==="_id"&&$===!1)continue;let G=!1;if(typeof $==="string"){let E=this.base!=null?this.base.Schema.Types:n.Types,C=$.charAt(0).toUpperCase()+$.substring(1);G=E[C]!=null}if(X!=="_id"&&(typeof $!=="object"&&typeof $!=="function"&&!G||$==null))throw new TypeError(`Invalid schema configuration: \`${$}\` is not a valid type at path \`${X}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if($ instanceof kH||($.constructor&&$.constructor.name||null)==="VirtualType"){this.virtual($);continue}if(Array.isArray($)&&$.length===1&&$[0]==null)throw new TypeError("Invalid value for schema Array path `"+Y+'`, got value "'+$[0]+'"');if(!(uH($)||$ instanceof Vg)){if(B)this.nested[B.substring(0,B.length-1)]=!0;if(this.path(B+X,$),$[0]!=null&&!$[0].instanceOfSchema&&s1.isPOJO($[0].discriminators)){let E=this.path(B+X);for(let C in $[0].discriminators)E.discriminator(C,$[0].discriminators[C])}}else if(Object.keys($).length<1){if(B)this.nested[B.substring(0,B.length-1)]=!0;this.path(Y,$)}else if(!$[J]||J==="type"&&uH($.type)&&$.type.type)this.nested[Y]=!0,this.add($,Y+".");else{let E=$[J];if(uH(E)&&Object.keys(E).length>0){if(B)this.nested[B.substring(0,B.length-1)]=!0;let C={};if(this._userProvidedOptions.typeKey)C.typeKey=this._userProvidedOptions.typeKey;if(this._userProvidedOptions.strict!=null)C.strict=this._userProvidedOptions.strict;if(this._userProvidedOptions.toObject!=null)C.toObject=s1.omit(this._userProvidedOptions.toObject,["transform"]);if(this._userProvidedOptions.toJSON!=null)C.toJSON=s1.omit(this._userProvidedOptions.toJSON,["transform"]);let H=new n(E,C);H.$implicitlyCreated=!0;let q=Object.assign({},$,{[J]:H});this.path(B+X,q)}else{if(B)this.nested[B.substring(0,B.length-1)]=!0;if(this.path(B+X,$),$!=null&&!$.instanceOfSchema&&s1.isPOJO($.discriminators)){let C=this.path(B+X);for(let H in $.discriminators)C.discriminator(H,$.discriminators[H])}}}}let Z=Object.fromEntries(Object.entries(A).map(([X])=>[B+X,null]));return Pg(this,Z),this};n.prototype.alias=function A(F,A){return Pg(this,{[F]:A}),this};n.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 B=this._indexes.length-1;B>=0;--B)if(KG1.isDeepStrictEqual(this._indexes[B][0],A))this._indexes.splice(B,1)}else for(let B=this._indexes.length-1;B>=0;--B)if(this._indexes[B][1]!=null&&this._indexes[B][1].name===A)this._indexes.splice(B,1);return this};n.prototype.clearIndexes=function F(){return this._indexes.length=0,this};n.prototype.searchIndex=function F(A){return this._searchIndexes.push(A),this};n.reserved=Object.create(null);n.prototype.reserved=n.reserved;var y0=n.reserved;y0.prototype=y0.emit=y0.listeners=y0.removeListener=y0.collection=y0.errors=y0.get=y0.init=y0.isModified=y0.isNew=y0.populated=y0.remove=y0.save=y0.toObject=y0.validate=1;y0.collection=1;n.prototype.path=function(F,A){if(A===void 0){if(this.paths[F]!=null)return this.paths[F];let $=Mg(F),G=RG1(this,F,$);if(G!=null)return G;let E=Tg(this,F);if(E!=null)return E;if(G=this.hasMixedParent($),G!=null)return G;return zG1.test(F)?IG1(this,F,$):void 0}let B=F.split(".")[0];if(y0[B]&&!this.options.suppressReservedKeysWarning){let $=`\`${B}\` 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.`;s1.warn($)}if(typeof A==="object"&&s1.hasUserDefinedProperty(A,"ref"))WG1(A.ref,F);let D=F.split(/\./),J=D.pop(),Z=this.tree,X="";for(let $ of D){if(s1.specialProperties.has($))throw new Error("Cannot set special property `"+$+"` on a schema");if(X=X+=(X.length>0?".":"")+$,!Z[$])this.nested[X]=!0,Z[$]={};if(typeof Z[$]!=="object"){let G="Cannot set nested path `"+F+"`. Parent path `"+X+"` already set to type "+Z[$].name+".";throw new Error(G)}Z=Z[$]}Z[J]=z2(A),this.paths[F]=this.interpretAsType(F,A,this.options);let Y=this.paths[F];if(Y.$isSchemaMap){let $=F+".$*";if(this.paths[$]=Y.$__schemaType,this.mapPaths.push(this.paths[$]),Y.$__schemaType.$isSingleNested)this.childSchemas.push({schema:Y.$__schemaType.schema,model:Y.$__schemaType.caster,path:F})}if(Y.$isSingleNested){for(let $ of Object.keys(Y.schema.paths))this.singleNestedPaths[F+"."+$]=Y.schema.paths[$];for(let $ of Object.keys(Y.schema.singleNestedPaths))this.singleNestedPaths[F+"."+$]=Y.schema.singleNestedPaths[$];for(let $ of Object.keys(Y.schema.subpaths))this.singleNestedPaths[F+"."+$]=Y.schema.subpaths[$];for(let $ of Object.keys(Y.schema.nested))this.singleNestedPaths[F+"."+$]="nested";Object.defineProperty(Y.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),Y.caster.base=this.base,this.childSchemas.push({schema:Y.schema,model:Y.caster,path:F})}else if(Y.$isMongooseDocumentArray)Object.defineProperty(Y.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),Y.casterConstructor.base=this.base,this.childSchemas.push({schema:Y.schema,model:Y.casterConstructor,path:F});if(Y.$isMongooseArray&&Y.caster instanceof Lg){let $=F,G=Y,E=[];while(G.$isMongooseArray){if($=$+".$",G.$isMongooseDocumentArray)G.$embeddedSchemaType._arrayPath=$,G.$embeddedSchemaType._arrayParentPath=F,G=G.$embeddedSchemaType;else G.caster._arrayPath=$,G.caster._arrayParentPath=F,G=G.caster;this.subpaths[$]=G}for(let C of E)this.subpaths[C.path]=C}if(Y.$isMongooseDocumentArray){for(let $ of Object.keys(Y.schema.paths)){let G=Y.schema.paths[$];if(this.subpaths[F+"."+$]=G,typeof G==="object"&&G!=null&&G.$parentSchemaDocArray==null)G.$parentSchemaDocArray=Y}for(let $ of Object.keys(Y.schema.subpaths)){let G=Y.schema.subpaths[$];if(this.subpaths[F+"."+$]=G,typeof G==="object"&&G!=null&&G.$parentSchemaDocArray==null)G.$parentSchemaDocArray=Y}for(let $ of Object.keys(Y.schema.singleNestedPaths)){let G=Y.schema.singleNestedPaths[$];if(this.subpaths[F+"."+$]=G,typeof G==="object"&&G!=null&&G.$parentSchemaDocArray==null)G.$parentSchemaDocArray=Y}}return this};/*!
|
|
621
|
+
* ignore
|
|
622
|
+
*/function VG1(F){let A=[];for(let B of Object.keys(F.paths)){let D=F.paths[B];if(D.$isMongooseDocumentArray||D.$isSingleNested)A.push({schema:D.schema,model:D.caster,path:B});else if(D.$isSchemaMap&&D.$__schemaType.$isSingleNested)A.push({schema:D.$__schemaType.schema,model:D.$__schemaType.caster,path:B})}return A}/*!
|
|
623
|
+
* ignore
|
|
624
|
+
*/function RG1(F,A,B){if(F.paths.hasOwnProperty(A))return F.paths[A];if(F.subpaths.hasOwnProperty(B)){let D=F.subpaths[B];if(D==="nested")return;return D}if(F.singleNestedPaths.hasOwnProperty(B)&&typeof F.singleNestedPaths[B]==="object"){let D=F.singleNestedPaths[B];if(D==="nested")return;return D}return null}/*!
|
|
625
|
+
* ignore
|
|
626
|
+
*/function Mg(F){if(!/\.\d+/.test(F))return F;return F.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$")}/*!
|
|
627
|
+
* ignore
|
|
628
|
+
*/function Tg(F,A){if(F.mapPaths.length===0)return null;for(let B of F.mapPaths){let D=B.path;if(new RegExp("^"+D.replace(/\.\$\*/g,"\\.[^.]+")+"$").test(A))return F.paths[D]}return null}Object.defineProperty(n.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null});n.prototype.interpretAsType=function(F,A,B){if(A instanceof Lg){if(A.path===F)return A;let $=A.clone();return $.path=F,$}let D=this.base!=null?this.base.Schema.Types:n.Types,J=this.base!=null?this.base.Types:n7();if(!s1.isPOJO(A)&&!(A instanceof Vg)){if(s1.getFunctionName(A.constructor)!=="Object"){let G=A;A={},A[B.typeKey]=G}}let Z=A[B.typeKey]&&(A[B.typeKey]instanceof Function||B.typeKey!=="type"||!A.type.type)?A[B.typeKey]:{},X;if(s1.isPOJO(Z)||Z==="mixed")return new D.Mixed(F,A);if(Array.isArray(Z)||Z===Array||Z==="array"||Z===D.Array){let $=Z===Array||Z==="array"?A.cast||A.of:Z[0];if($&&$.instanceOfSchema){if(!($ instanceof n))if(this.options._isMerging)$=new n($);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 D.DocumentArray(F,$,A)}if($&&$[B.typeKey]&&$[B.typeKey].instanceOfSchema){if(!($[B.typeKey]instanceof n))if(this.options._isMerging)$[B.typeKey]=new n($[B.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 D.DocumentArray(F,$[B.typeKey],A,$)}if(typeof $!=="undefined"){if(Array.isArray($)||$.type===Array||$.type=="Array"){if($&&$.type=="Array")$.type=Array;return new D.Array(F,this.interpretAsType(F,$,B),A)}}let G=$!=null&&$[B.typeKey]&&(B.typeKey!=="type"||!$.type.type)?$[B.typeKey]:$;if(typeof $==="string")$=D[$.charAt(0).toUpperCase()+$.substring(1)];else if(s1.isPOJO(G))if(Object.keys(G).length){let E={minimize:B.minimize};if(B.typeKey)E.typeKey=B.typeKey;if(B.hasOwnProperty("strict"))E.strict=B.strict;if(B.hasOwnProperty("strictQuery"))E.strictQuery=B.strictQuery;if(B.hasOwnProperty("toObject"))E.toObject=s1.omit(B.toObject,["transform"]);if(B.hasOwnProperty("toJSON"))E.toJSON=s1.omit(B.toJSON,["transform"]);if(this._userProvidedOptions.hasOwnProperty("_id"))E._id=this._userProvidedOptions._id;else if(n.Types.DocumentArray.defaultOptions._id!=null)E._id=n.Types.DocumentArray.defaultOptions._id;let C=new n(G,E);return C.$implicitlyCreated=!0,new D.DocumentArray(F,C,A)}else return new D.Array(F,D.Mixed,A);if($){if(Z=$[B.typeKey]&&(B.typeKey!=="type"||!$.type.type)?$[B.typeKey]:$,Array.isArray(Z))return new D.Array(F,this.interpretAsType(F,Z,B),A);if(X=typeof Z==="string"?Z:Z.schemaName||s1.getFunctionName(Z),X==="ClockDate")X="Date";if(X===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(!D.hasOwnProperty(X))throw new TypeError(`Invalid schema configuration: \`${X}\` is not a valid type within the array \`${F}\`.See https://bit.ly/mongoose-schematypes for a list of valid schema types.`)}return new D.Array(F,$||D.Mixed,A,B)}if(Z&&Z.instanceOfSchema)return new D.Subdocument(Z,F,A);if(Buffer.isBuffer(Z))X="Buffer";else if(typeof Z==="function"||typeof Z==="object")X=Z.schemaName||s1.getFunctionName(Z);else if(Z===J.ObjectId)X="ObjectId";else if(Z===J.Decimal128)X="Decimal128";else X=Z==null?""+Z:Z.toString();if(X)X=X.charAt(0).toUpperCase()+X.substring(1);if(X==="ObjectID")X="ObjectId";if(X==="ClockDate")X="Date";if(X===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(D[X]==null)throw new TypeError(`Invalid schema configuration: \`${X}\` is not a valid type at path \`${F}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);let Y=new D[X](F,A);if(Y.$isSchemaMap)wG1(this,Y,F,A,B);return Y};/*!
|
|
629
|
+
* ignore
|
|
630
|
+
*/function wG1(F,A,B,D,J){let Z=B+".$*",X={type:{}};if(s1.hasUserDefinedProperty(D,"of")){if(s1.isPOJO(D.of)&&Object.keys(D.of).length>0&&!s1.hasUserDefinedProperty(D.of,F.options.typeKey))X={[F.options.typeKey]:new n(D.of)};else if(s1.isPOJO(D.of))X=Object.assign({},D.of);else X={[F.options.typeKey]:D.of};if(X[F.options.typeKey]&&X[F.options.typeKey].instanceOfSchema)X[F.options.typeKey].eachPath((G,E)=>{if(E.options.select===!0||E.options.select===!1)throw new I4('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+B+"."+G+'"')});if(s1.hasUserDefinedProperty(D,"ref"))X.ref=D.ref}A.$__schemaType=F.interpretAsType(Z,X,J)}n.prototype.eachPath=function(F){let A=Object.keys(this.paths),B=A.length;for(let D=0;D<B;++D)F(A[D],this.paths[A[D]]);return this};n.prototype.requiredPaths=function F(A){if(this._requiredpaths&&!A)return this._requiredpaths;let B=Object.keys(this.paths),D=B.length,J=[];while(D--){let Z=B[D];if(this.paths[Z].isRequired)J.push(Z)}return this._requiredpaths=J,this._requiredpaths};n.prototype.indexedPaths=function F(){if(this._indexedpaths)return this._indexedpaths;return this._indexedpaths=this.indexes(),this._indexedpaths};n.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=Mg(F);if(this.subpaths.hasOwnProperty(A)||this.subpaths.hasOwnProperty(F))return"real";let B=this.singleNestedPaths.hasOwnProperty(A)||this.singleNestedPaths.hasOwnProperty(F);if(B)return B==="nested"?"nested":"real";if(Tg(this,F)!=null)return"real";if(/\.\d+\.|\.\d+$/.test(F))return jg(this,F,A);return"adhocOrUndefined"};n.prototype.hasMixedParent=function(F){let A=F.split(/\./g);F="";for(let B=0;B<A.length;++B)if(F=B>0?F+"."+A[B]:A[B],this.paths.hasOwnProperty(F)&&this.paths[F]instanceof N4.Mixed)return this.paths[F];return null};n.prototype.setupTimestamp=function(F){return qG1(this,F)};function jg(F,A,B){let D=A.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(D.length<2)return F.paths.hasOwnProperty(D[0])?F.paths[D[0]]:"adhocOrUndefined";let J=F.path(D[0]),Z=!1;if(!J)return"adhocOrUndefined";let X=D.length-1;for(let Y=1;Y<D.length;++Y){Z=!1;let $=D[Y];if(Y===X&&J&&!/\D/.test($)){if(J.$isMongooseDocumentArray)J=J.$embeddedSchemaType;else if(J instanceof N4.Array)J=J.caster;else J=void 0;break}if(!/\D/.test($)){if(J instanceof N4.Array&&Y!==X)J=J.caster;continue}if(!(J&&J.schema)){J=void 0;break}Z=J.schema.pathType($)==="nested",J=J.schema.path($)}if(F.subpaths[B]=J,J)return"real";if(Z)return"nested";return"adhocOrUndefined"}/*!
|
|
631
|
+
* ignore
|
|
632
|
+
*/function IG1(F,A,B){return jg(F,A,B),F.subpaths[B]}n.prototype.queue=function(F,A){return this.callQueue.push([F,A]),this};n.prototype.pre=function(F){if(F instanceof RegExp){let A=Array.prototype.slice.call(arguments,1);for(let B of Ig)if(F.test(B))this.pre.apply(this,[B].concat(A));return this}if(Array.isArray(F)){let A=Array.prototype.slice.call(arguments,1);for(let B of F)this.pre.apply(this,[B].concat(A));return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this};n.prototype.post=function(F){if(F instanceof RegExp){let A=Array.prototype.slice.call(arguments,1);for(let B of Ig)if(F.test(B))this.post.apply(this,[B].concat(A));return this}if(Array.isArray(F)){let A=Array.prototype.slice.call(arguments,1);for(let B of F)this.post.apply(this,[B].concat(A));return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this};n.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 B of this.plugins)if(B.fn===F)return this}return this.plugins.push({fn:F,opts:A}),F(this,A),this};n.prototype.method=function(F,A,B){if(typeof F!=="string")for(let D in F)this.methods[D]=F[D],this.methodOptions[D]=z2(B);else this.methods[F]=A,this.methodOptions[F]=z2(B);return this};n.prototype.static=function(F,A){if(typeof F!=="string")for(let B in F)this.statics[B]=F[B];else this.statics[F]=A;return this};n.prototype.index=function(F,A){if(F||(F={}),A||(A={}),A.expires)s1.expires(A);for(let B in F)if(this.aliases[B])F=s1.renameObjKey(F,B,this.aliases[B]);for(let B of Object.keys(F))if(F[B]==="ascending"||F[B]==="asc")F[B]=1;else if(F[B]==="descending"||F[B]==="desc")F[B]=-1;return this._indexes.push([F,A]),this};n.prototype.set=function(F,A,B){if(arguments.length===1)return this.options[F];switch(F){case"read":if(typeof A==="string")this.options[F]={mode:GJ(A),tags:B};else if(Array.isArray(A)&&typeof A[0]==="string")this.options[F]={mode:GJ(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)Rg(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")WF(this,{strict:A});if(F==="strictQuery")WF(this,{strictQuery:A});if(F==="toObject")A={...A},delete A.transform,WF(this,{toObject:A});if(F==="toJSON")A={...A},delete A.transform,WF(this,{toJSON:A});return this};/*!
|
|
633
|
+
* Recursively set options on implicitly created schemas
|
|
634
|
+
*/function WF(F,A){for(let{schema:B}of F.childSchemas){if(!B.$implicitlyCreated)continue;Object.assign(B.options,A),WF(B,A)}}n.prototype.get=function(F){return this.options[F]};var NG1="2d 2dsphere hashed text".split(" ");Object.defineProperty(n,"indexTypes",{get:function(){return NG1},set:function(){throw new Error("Cannot overwrite Schema.indexTypes")}});n.prototype.indexes=function(){return GG1(this)};n.prototype.virtual=function(F,A){if(F instanceof kH||$G1(F)==="VirtualType")return this.virtual(F.path,F.options);if(A=new YG1(A),s1.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 Y($,G){if(YJ.has(F,$)){let E=YJ.get(F,$);if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};if(A.justOne||A.count)this.$$populatedVirtuals[F]=Array.isArray(E)?E[0]:E;else this.$$populatedVirtuals[F]=Array.isArray(E)?E:E==null?[]:[E];if(G?.hydratedPopulatedDocs&&!A.count){let C=J._getModelNamesForPopulate(this),H=this.$$populatedVirtuals[F];if(!Array.isArray(H)&&!H.$__&&C?.length===1){let q=this.db.model(C[0]);this.$$populatedVirtuals[F]=q.hydrate(H)}else if(Array.isArray(H)&&C?.length===1){let q=this.db.model(C[0]);for(let W=0;W<H.length;++W)if(!H[W].$__)H[W]=q.hydrate(H[W])}}YJ.unset(F,$)}}),J.set(function(Y){if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};return HG1(this.$$populatedVirtuals,F,Y,A)}),typeof A.get==="function")J.get(A.get);let Z=F.split("."),X=Z[0];for(let Y=0;Y<Z.length-1;++Y){if(this.paths[X]==null)continue;if(this.paths[X].$isMongooseDocumentArray||this.paths[X].$isSingleNested){let $=Z.slice(Y+1).join(".");this.paths[X].schema.virtual($,A);break}X+="."+Z[Y+1]}return J}let B=this.virtuals,D=F.split(".");if(this.pathType(F)==="real")throw new Error('Virtual path "'+F+'" conflicts with a real path in the schema');if(B[F]=D.reduce(function(J,Z,X){return J[Z]||(J[Z]=X===D.length-1?new kH(A,F):{}),J[Z]},this.tree),A&&A.applyToArray&&D.length>1){let J=this.path(D.slice(0,-1).join("."));if(J&&J.$isMongooseArray)return J.virtual(D[D.length-1],A);else throw new I4(`Path "${J}" is not an array`)}return B[F]};n.prototype.virtualpath=function(F){return this.virtuals.hasOwnProperty(F)?this.virtuals[F]:null};n.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 B=Object.keys(this.paths).concat(Object.keys(this.nested));for(let D of B)if(D.startsWith(A+"."))delete this.paths[D],delete this.nested[D],OH(this,D);delete this.nested[A],OH(this,A);return}delete this.paths[A],OH(this,A)},this);return this};/*!
|
|
635
|
+
* ignore
|
|
636
|
+
*/function OH(F,A){let B=A.split("."),D=B.pop(),J=F.tree;for(let Z of B)J=J[Z];delete J[D]}n.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 I4(`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)YJ.unset(A,this.tree);else delete this.tree[A]}return this};n.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(B){if(B.match(/^(length|name|prototype|constructor|__proto__)$/))return;let D=Object.getOwnPropertyDescriptor(F,B);if(D.hasOwnProperty("value"))this.static(B,D.value)},this);return Object.getOwnPropertyNames(F.prototype).forEach(function(B){if(B.match(/^(constructor)$/))return;let D=Object.getOwnPropertyDescriptor(F.prototype,B);if(!A){if(typeof D.value==="function")this.method(B,D.value)}if(typeof D.get==="function"){if(this.virtuals[B])this.virtuals[B].getters=[];this.virtual(B).get(D.get)}if(typeof D.set==="function"){if(this.virtuals[B])this.virtuals[B].setters=[];this.virtual(B).set(D.set)}},this),this};/*!
|
|
637
|
+
* ignore
|
|
638
|
+
*/n.prototype._getSchema=function(F){let A=this,B=A.path(F),D=[];if(B)return B.$fullPath=F,B;function J(X,Y){let $=X.length+1,G,E;while($--)if(E=X.slice(0,$).join("."),G=Y.path(E),G){if(D.push(E),G.caster){if(G.caster instanceof N4.Mixed)return G.caster.$fullPath=D.join("."),G.caster;if($!==X.length){if($+1===X.length&&G.$embeddedSchemaType&&(X[$]==="$"||$J(X[$])))return G.$embeddedSchemaType;if(G.schema){let C;if(X[$]==="$"||$J(X[$])){if($+1===X.length)return G.$embeddedSchemaType;if(C=J(X.slice($+1),G.schema),C)C.$parentSchemaDocArray=C.$parentSchemaDocArray||(G.schema.$isSingleNested?null:G);return C}if(C=J(X.slice($),G.schema),C)C.$parentSchemaDocArray=C.$parentSchemaDocArray||(G.schema.$isSingleNested?null:G);return C}}}else if(G.$isSchemaMap){if($>=X.length)return G;if($+1>=X.length)return G.$__schemaType;if(G.$__schemaType instanceof N4.Mixed)return G.$__schemaType;if(G.$__schemaType.schema!=null)return J(X.slice($+1),G.$__schemaType.schema)}return G.$fullPath=D.join("."),G}}let Z=F.split(".");for(let X=0;X<Z.length;++X){if(Z[X]==="$"||$J(Z[X]))Z[X]="0";if(LG1.test(Z[X]))Z[X]="$"}return J(Z,A)};/*!
|
|
639
|
+
* ignore
|
|
640
|
+
*/n.prototype._getPathType=function(F){let A=this;if(A.path(F))return"real";function D(J,Z){let X=J.length+1,Y,$;while(X--)if($=J.slice(0,X).join("."),Y=Z.path($),Y){if(Y.caster){if(Y.caster instanceof N4.Mixed)return{schema:Y,pathType:"mixed"};if(X!==J.length&&Y.schema){if(J[X]==="$"||$J(J[X])){if(X===J.length-1)return{schema:Y,pathType:"nested"};return D(J.slice(X+1),Y.schema)}return D(J.slice(X),Y.schema)}return{schema:Y,pathType:Y.$isSingleNested?"nested":"array"}}return{schema:Y,pathType:"real"}}else if(X===J.length&&Z.nested[$])return{schema:Z,pathType:"nested"};return{schema:Y||Z,pathType:"undefined"}}return D(F.split("."),A)};/*!
|
|
641
|
+
* ignore
|
|
642
|
+
*/function $J(F){return F.startsWith("$[")&&F.endsWith("]")}n.prototype._preCompile=function F(){this.plugin(EG1,{deduplicate:!0})};/*!
|
|
643
|
+
* Module exports.
|
|
644
|
+
*/ug.exports=SH=n;n.Types=N4=DF();/*!
|
|
645
|
+
* ignore
|
|
646
|
+
*/SH.ObjectId=N4.ObjectId});var kg=z((lI1,Og)=>{/*!
|
|
647
|
+
* Module dependencies.
|
|
648
|
+
*/var PG1=C1();class xH extends PG1{constructor(F,A){super(F);this.errors=A}}Object.defineProperty(xH.prototype,"name",{value:"SyncIndexesError"});Og.exports=xH});var fH=z((pI1,Sg)=>{Sg.exports=function F(A,B,D,J){if(A[J])return;if(A[J]=!0,!D||!D.skipTopLevel){let $=null;for(let G of B){let E=G[1]==null?null:G[1].tags;if(!Array.isArray(E)){A.plugin(G[0],G[1]);continue}if($=$||new Set(A.options.pluginTags||[]),!E.find((C)=>$.has(C)))continue;A.plugin(G[0],G[1])}}if(D=Object.assign({},D),delete D.skipTopLevel,D.applyPluginsToChildSchemas!==!1)for(let $ of Object.keys(A.paths)){let G=A.paths[$];if(G.schema!=null)F(G.schema,B,D,J),G.caster.prototype.$__setSchema(G.schema)}let Z=A.discriminators;if(Z==null)return;let X=D.applyPluginsToDiscriminators,Y=Object.keys(Z);for(let $ of Y){let G=Z[$];F(G,B,{skipTopLevel:!X},J)}}});var EJ=z((MG1,_H)=>{/*!
|
|
649
|
+
* ignore
|
|
650
|
+
*/var xg=null;MG1.get=function(){return xg};MG1.set=function(F){xg=F}});var _g=z((iI1,fg)=>{var uG1=C1();class gH extends uG1{constructor(F,A){super(F);this.errors=A}}Object.defineProperty(gH.prototype,"name",{value:"CreateCollectionsError"});fg.exports=gH});var vg=z((nI1,yg)=>{/*!
|
|
651
|
+
* Module dependencies.
|
|
652
|
+
*/var OG1=YE(),bH=import.meta.require("events").EventEmitter,kG1=l7(),L0=w9(),U2=W2(),SG1=wE(),xG1=kg(),fG1=fH(),_G1=Z0(),gG1=EJ(),bG1=C0(),gg=r2(),yH=J1(),yG1=_g(),vG1=o().arrayAtomicsSymbol,KF=o().sessionNewDocuments,hG1=["MONGODB-X509"];function e(F){if(this.base=F,this.collections={},this.models={},this.config={},this.replica=!1,this.options=null,this.otherDbs=[],this.relatedDbs={},this.states=L0,this._readyState=L0.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=[]}/*!
|
|
653
|
+
* Inherit from EventEmitter
|
|
654
|
+
*/Object.setPrototypeOf(e.prototype,bH.prototype);Object.defineProperty(e.prototype,"readyState",{get:function(){if(this._readyState===L0.connected&&this._lastHeartbeatAt!=null&&typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS==="number"&&Date.now()-this._lastHeartbeatAt>=this.client.topology.s.description.heartbeatFrequencyMS*2)return L0.disconnected;return this._readyState},set:function(F){if(!(F in L0))throw new Error("Invalid connection state: "+F);if(this._readyState!==F){this._readyState=F;for(let A of this.otherDbs)A.readyState=F;if(L0.connected===F)this._hasOpened=!0;this.emit(L0[F])}}});e.prototype.get=function(F){if(this.config.hasOwnProperty(F))return this.config[F];return bG1(this.options,F)};e.prototype.set=function(F,A){if(this.config.hasOwnProperty(F))return this.config[F]=A,A;return this.options=this.options||{},this.options[F]=A,A};e.prototype.collections;e.prototype.name;e.prototype.models;e.prototype.id;Object.defineProperty(e.prototype,"plugins",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(e.prototype,"host",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(e.prototype,"port",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(e.prototype,"user",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(e.prototype,"pass",{configurable:!0,enumerable:!0,writable:!0});e.prototype.db;e.prototype.client;e.prototype.config;e.prototype.createCollection=async function F(A,B){if(typeof B==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new U2("Connection.prototype.createCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.createCollection(A,B)};e.prototype.createCollections=async function F(A={}){let B={},D={},{continueOnError:J}=A;delete A.continueOnError;for(let Z of Object.values(this.models))try{B[Z.modelName]=await Z.createCollection({})}catch(X){if(!J){D[Z.modelName]=X;break}else B[Z.modelName]=X}if(!J&&Object.keys(D).length){let Z=Object.entries(D).map(([Y,$])=>`${Y}: ${$.message}`).join(", ");throw new yG1(Z,D)}return B};e.prototype.withSession=async function F(A){if(arguments.length===0)throw new Error("Please provide an executor function");return await this.client.withSession(A)};e.prototype.startSession=async function F(A){if(arguments.length>=2&&typeof arguments[1]==="function")throw new U2("Connection.prototype.startSession() no longer accepts a callback");return await this._waitForConnect(),this.client.startSession(A)};e.prototype.transaction=function F(A,B){return this.startSession().then((D)=>{return D[KF]=new Map,D.withTransaction(()=>mG1(A,D,this.base),B).then((J)=>{return delete D[KF],J}).catch((J)=>{throw delete D[KF],J}).finally(()=>{D.endSession().catch(()=>{})})})};/*!
|
|
655
|
+
* Reset document state in between transaction retries re: gh-13698
|
|
656
|
+
*/async function mG1(F,A,B){try{return B.transactionAsyncLocalStorage==null?await F(A):await new Promise((J)=>{B.transactionAsyncLocalStorage.run({session:A},()=>J(F(A)))})}catch(D){throw dG1(A),D}}/*!
|
|
657
|
+
* If transaction was aborted, we need to reset newly inserted documents' `isNew`.
|
|
658
|
+
*/function dG1(F){for(let A of F[KF].keys()){let B=F[KF].get(A);if(B.hasOwnProperty("isNew"))A.$isNew=B.isNew;if(B.hasOwnProperty("versionKey"))A.set(A.schema.options.versionKey,B.versionKey);if(B.modifiedPaths.length>0&&A.$__.activePaths.states.modify==null)A.$__.activePaths.states.modify={};for(let D of B.modifiedPaths){let J=A.$__.activePaths.paths[D];if(J!=null)delete A.$__.activePaths[J][D];A.$__.activePaths.paths[D]="modify",A.$__.activePaths.states.modify[D]=!0}for(let D of B.atomics.keys()){let J=A.$__getValue(D);if(J==null)continue;J[vG1]=B.atomics.get(D)}}}e.prototype.dropCollection=async function F(A){if(arguments.length>=2&&typeof arguments[1]==="function")throw new U2("Connection.prototype.dropCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.dropCollection(A)};e.prototype._waitForConnect=async function F(){if((this.readyState===L0.connecting||this.readyState===L0.disconnected)&&this._shouldBufferCommands())await new Promise((A)=>{this._queue.push({fn:A})})};e.prototype.listCollections=async function F(){return await this._waitForConnect(),await this.db.listCollections().toArray()};e.prototype.listDatabases=async function F(){throw new U2("listDatabases() not implemented by driver")};e.prototype.dropDatabase=async function F(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new U2("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()};/*!
|
|
659
|
+
* ignore
|
|
660
|
+
*/e.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};e.prototype.error=function(F,A){if(A)return A(F),null;if(this.listeners("error").length>0)this.emit("error",F);return Promise.reject(F)};e.prototype.onOpen=function(){this.readyState=L0.connected;for(let F of this._queue)F.fn.apply(F.ctx,F.args);this._queue=[];for(let F in this.collections)if(yH.object.hasOwnProperty(this.collections,F))this.collections[F].onOpen();this.emit("open")};e.prototype.openUri=async function F(A,B){if(this.readyState===L0.connecting||this.readyState===L0.connected){if(this._connectionString===A)return this}this._closeCalled=!1;let D=!1;if(B&&"_fireAndForget"in B)D=B._fireAndForget,delete B._fireAndForget;try{cG1.apply(arguments)}catch(J){if(D)throw J;throw this.$initialConnection=Promise.reject(J),J}this.$initialConnection=this.createClient(A,B).then(()=>this).catch((J)=>{if(this.readyState=L0.disconnected,this.listeners("error").length>0)gg(()=>this.emit("error",J));throw J});for(let J of Object.values(this.models))J.init().catch(function Z(){});if(D)return this;try{await this.$initialConnection}catch(J){throw bg(J)}return this};/*!
|
|
661
|
+
* Treat `on('error')` handlers as handling the initialConnection promise
|
|
662
|
+
* to avoid uncaught exceptions when using `on('error')`. See gh-14377.
|
|
663
|
+
*/e.prototype.on=function F(A,B){if(A==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return bH.prototype.on.call(this,A,B)};/*!
|
|
664
|
+
* Treat `once('error')` handlers as handling the initialConnection promise
|
|
665
|
+
* to avoid uncaught exceptions when using `on('error')`. See gh-14377.
|
|
666
|
+
*/e.prototype.once=function F(A,B){if(A==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return bH.prototype.once.call(this,A,B)};/*!
|
|
667
|
+
* ignore
|
|
668
|
+
*/function cG1(F,A,B){if(typeof A==="function"&&B==null)throw new U2("Connection.prototype.openUri() no longer accepts a callback");else if(typeof B==="function")throw new U2("Connection.prototype.openUri() no longer accepts a callback")}/*!
|
|
669
|
+
* ignore
|
|
670
|
+
*/function bg(F){if(F?.name==="MongoServerSelectionError"){let A=F;F=new SG1,F.assimilateError(A)}return F}e.prototype.destroy=async function F(A){if(typeof A==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new U2("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)};e.prototype.close=async function F(A){if(typeof A==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new U2("Connection.prototype.close() no longer accepts a callback");if(A!=null&&typeof A==="object")this.$wasForceClosed=!!A.force;else this.$wasForceClosed=!!A;for(let B of Object.values(this.models))delete B.$init;return this._close(A,!1)};e.prototype._close=async function F(A,B){let D=this,J=this._closeCalled;if(this._closeCalled=!0,this._destroyCalled=B,this.client!=null)this.client._closeCalled=!0,this.client._destroyCalled=B;let Z=this;switch(this.readyState){case L0.disconnected:if(B&&this.base.connections.indexOf(Z)!==-1)this.base.connections.splice(this.base.connections.indexOf(Z),1);if(!J)await this.doClose(A),this.onClose(A);break;case L0.connected:if(this.readyState=L0.disconnecting,await this.doClose(A),B&&D.base.connections.indexOf(Z)!==-1)this.base.connections.splice(this.base.connections.indexOf(Z),1);this.onClose(A);break;case L0.connecting:return new Promise((X,Y)=>{let $=()=>{if(this.removeListener("open",$),this.removeListener("error",$),B)this.destroy(A).then(X,Y);else this.close(A).then(X,Y)};this.once("open",$),this.once("error",$)});case L0.disconnecting:return new Promise((X)=>{this.once("close",()=>{if(B&&this.base.connections.indexOf(Z)!==-1)this.base.connections.splice(this.base.connections.indexOf(Z),1);X()})})}return this};e.prototype.doClose=function(){throw new Error("Connection#doClose unimplemented by driver")};e.prototype.onClose=function(F){this.readyState=L0.disconnected;for(let A in this.collections)if(yH.object.hasOwnProperty(this.collections,A))this.collections[A].onClose(F);this.emit("close",F);for(let A of this.otherDbs)this._destroyCalled?A.destroy({force:F,skipCloseClient:!0}):A.close({force:F,skipCloseClient:!0})};e.prototype.collection=function(F,A){let B={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({},B,A?_G1(A):{}),A.$wasForceClosed=this.$wasForceClosed;let D=this.base&&this.base.__driver&&this.base.__driver.Collection||gG1.get().Collection;if(!(F in this.collections))this.collections[F]=new D(F,this,A);return this.collections[F]};e.prototype.plugin=function(F,A){return this.plugins.push([F,A]),this};e.prototype.model=function(F,A,B,D){if(!(this instanceof e))throw new U2("`connection.model()` should not be run with `new`. If you are doing `new db.model(foo)(bar)`, use `db.model(foo)(bar)` instead");let J;if(typeof F==="function")J=F,F=J.name;if(typeof A==="string")B=A,A=!1;if(yH.isObject(A)){if(!A.instanceOfSchema)A=new kG1(A);else if(!(A instanceof this.base.Schema))A=A._clone(this.base.Schema)}if(A&&!A.instanceOfSchema)throw new Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");let Z={cache:!1,overwriteModels:this.base.options.overwriteModels},X=Object.assign(Z,D,{connection:this});if(this.models[F]&&!B&&X.overwriteModels!==!0){if(A&&A.instanceOfSchema&&A!==this.models[F].schema)throw new U2.OverwriteModelError(F);return this.models[F]}let Y;if(A&&A.instanceOfSchema){if(fG1(A,this.plugins,null,"$connectionPluginsApplied"),Y=this.base._model(J||F,A,B,X),!this.models[F])this.models[F]=Y;return Y.init().catch(function $(){}),Y}if(this.models[F]&&B)return Y=this.models[F],A=Y.prototype.schema,Y.__subclass(this,A,B);if(arguments.length===1){if(Y=this.models[F],!Y)throw new U2.MissingSchemaError(F);return Y}if(!Y)throw new U2.MissingSchemaError(F);if(this===Y.prototype.db&&(!B||B===Y.collection.name)){if(!this.models[F])this.models[F]=Y;return Y}return this.models[F]=Y.__subclass(this,A,B),this.models[F]};e.prototype.deleteModel=function(F){if(typeof F==="string"){let A=this.model(F);if(A==null)return this;let B=A.collection.name;delete this.models[F],delete this.collections[B],this.emit("deleteModel",A)}else if(F instanceof RegExp){let A=F,B=this.modelNames();for(let D of B)if(A.test(D))this.deleteModel(D)}else throw new Error('First parameter to `deleteModel()` must be a string or regexp, got "'+F+'"');return this};e.prototype.watch=function(F,A){return new OG1((J)=>{gg(()=>{if(this.readyState===L0.connecting)this.once("open",function(){let Z=this.db.watch(F,A);J(null,Z)});else{let Z=this.db.watch(F,A);J(null,Z)}})},F,A)};e.prototype.asPromise=async function F(){try{return await this.$initialConnection,this}catch(A){throw bg(A)}};e.prototype.modelNames=function(){return Object.keys(this.models)};e.prototype.shouldAuthenticate=function(){return this.user!=null&&(this.pass!=null||this.authMechanismDoesNotRequirePassword())};e.prototype.authMechanismDoesNotRequirePassword=function(){if(this.options&&this.options.auth)return hG1.indexOf(this.options.auth.authMechanism)>=0;return!0};e.prototype.optionsProvideAuthenticationData=function(F){return F&&F.user&&(F.pass||this.authMechanismDoesNotRequirePassword())};e.prototype.getClient=function F(){return this.client};e.prototype.setClient=function F(){throw new U2("Connection#setClient not implemented by driver")};/*!
|
|
671
|
+
* Called internally by `openUri()` to create a MongoClient instance.
|
|
672
|
+
*/e.prototype.createClient=function F(){throw new U2("Connection#createClient not implemented by driver")};e.prototype.syncIndexes=async function F(A={}){let B={},D={},{continueOnError:J}=A;delete A.continueOnError;for(let Z of Object.values(this.models))try{B[Z.modelName]=await Z.syncIndexes(A)}catch(X){if(!J){D[Z.modelName]=X;break}else B[Z.modelName]=X}if(!J&&Object.keys(D).length){let Z=Object.entries(D).map(([Y,$])=>`${Y}: ${$.message}`).join(", ");throw new xG1(Z,D)}return B};/*!
|
|
673
|
+
* Module exports.
|
|
674
|
+
*/e.STATES=L0;yg.exports=e});var vH=z((sI1,lG1)=>{lG1.exports={name:"mongoose",description:"Mongoose MongoDB ODM",version:"8.8.3",author:"Guillermo Rauch <guillermo@learnboost.com>",keywords:["mongodb","document","model","schema","database","odm","data","datastore","query","nosql","orm","db"],license:"MIT",dependencies:{bson:"^6.7.0",kareem:"2.6.3",mongodb:"~6.10.0",mpath:"0.9.0",mquery:"5.0.0",ms:"2.1.3",sift:"17.1.3"},devDependencies:{"@babel/core":"7.26.0","@babel/preset-env":"7.26.0","@typescript-eslint/eslint-plugin":"^8.4.0","@typescript-eslint/parser":"^8.4.0",acquit:"1.3.0","acquit-ignore":"0.2.1","acquit-require":"0.1.1","assert-browserify":"2.0.0",axios:"1.1.3","babel-loader":"8.2.5","broken-link-checker":"^0.7.8",buffer:"^5.6.0",cheerio:"1.0.0","crypto-browserify":"3.12.1",dotenv:"16.4.5",dox:"1.0.0",eslint:"8.57.0","eslint-plugin-markdown":"^5.0.0","eslint-plugin-mocha-no-only":"1.2.0",express:"^4.19.2","fs-extra":"~11.2.0","highlight.js":"11.10.0","lodash.isequal":"4.5.0","lodash.isequalwith":"4.4.0","markdownlint-cli2":"^0.14.0",marked:"14.1.3",mkdirp:"^3.0.1",mocha:"10.8.2",moment:"2.30.1","mongodb-memory-server":"10.1.2",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.6.3",uuid:"11.0.2",webpack:"5.96.1"},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",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 mg=z((aI1,hg)=>{var pG1=Z0(),iG1=W2();function nG1(F,A){let B=A?A:{},D=B.readPreference?B.readPreference:tG1(F),J=pG1(B);return D&&D!=="primary"&&D!=="primaryPreferred"?sG1(D,J):J}function sG1(F,A){if(aG1(A)&&rG1(F))eG1();else return oG1(A)}function aG1(F){let A=F.config&&F.config.autoIndex,{autoCreate:B,autoIndex:D}=F;return!!(A||B||D)}function rG1(F){return F==="secondary"||F==="secondaryPreferred"}function tG1(F){let B=/(?:&|\?)readPreference=(\w+)(?:&|$)/.exec(F);return B?B[1]:null}function oG1(F){return F.config={autoIndex:!1},F.autoCreate=!1,F.autoIndex=!1,F}function eG1(){throw new iG1('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')}hg.exports=nG1});var dg=z((FE1)=>{FE1.setTimeout=setTimeout});var ng=z((tI1,ig)=>{/*!
|
|
675
|
+
* Module dependencies.
|
|
676
|
+
*/var cg=vg(),z9=W2(),f2=w9(),lg=o4(),BE1=vH(),DE1=mg(),JE1=dg().setTimeout,pg=J1();function m3(){cg.apply(this,arguments),this._listening=!1,this._lastHeartbeatAt=null}m3.STATES=f2;/*!
|
|
677
|
+
* Inherits from Connection.
|
|
678
|
+
*/Object.setPrototypeOf(m3.prototype,cg.prototype);m3.prototype.useDb=function(F,A){if(A=A||{},A.useCache&&this.relatedDbs[F])return this.relatedDbs[F];let B=new this.constructor;B.name=F,B.base=this.base,B.collections={},B.models={},B.replica=this.replica,B.config=Object.assign({},this.config,B.config),B.name=this.name,B.options=this.options,B._readyState=this._readyState,B._closeCalled=this._closeCalled,B._hasOpened=this._hasOpened,B._listening=!1,B._parent=this,B.host=this.host,B.port=this.port,B.user=this.user,B.pass=this.pass;let D=this;if(B.client=D.client,this.db&&this._readyState===f2.connected)J();else this._queue.push({fn:J});function J(){B.client=D.client;let Z={};if(A.hasOwnProperty("noListener"))Z.noListener=A.noListener;B.db=D.client.db(F,Z),B._lastHeartbeatAt=D._lastHeartbeatAt,B.onOpen()}if(B.name=F,A.noListener!==!0)this.otherDbs.push(B);if(B.otherDbs.push(this),A&&A.useCache)this.relatedDbs[B.name]=B,B.relatedDbs=this.relatedDbs;return B};m3.prototype.removeDb=function F(A){let B=this.otherDbs.filter((D)=>D.name===A);if(!B.length)throw new z9(`No connections to database "${A}" found`);for(let D of B)D._closeCalled=!0,D._destroyCalled=!0,D._readyState=f2.disconnected,D.$wasForceClosed=!0;delete this.relatedDbs[A],this.otherDbs=this.otherDbs.filter((D)=>D.name!==A)};m3.prototype.doClose=async function F(A){if(this.client==null)return this;let B=!1;if(A!=null&&typeof A==="object")B=A.skipCloseClient,A=A.force;if(B)return this;return await this.client.close(A),await new Promise((D)=>JE1(D,1)),this};m3.prototype.listDatabases=async function F(){return await this._waitForConnect(),await this.db.admin().listDatabases()};/*!
|
|
679
|
+
* ignore
|
|
680
|
+
*/m3.prototype.createClient=async function F(A,B){if(typeof A!=="string")throw new z9(`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 z9("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===f2.connecting||this.readyState===f2.connected){if(this._connectionString!==A)throw new z9("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(B=DE1(A,B),B){let Z=B.config&&B.config.autoIndex!=null?B.config.autoIndex:B.autoIndex;if(Z!=null)this.config.autoIndex=Z!==!1,delete B.config,delete B.autoIndex;if("autoCreate"in B)this.config.autoCreate=!!B.autoCreate,delete B.autoCreate;if("sanitizeFilter"in B)this.config.sanitizeFilter=B.sanitizeFilter,delete B.sanitizeFilter;if("autoSearchIndex"in B)this.config.autoSearchIndex=B.autoSearchIndex,delete B.autoSearchIndex;if(B.user||B.pass)B.auth=B.auth||{},B.auth.username=B.user,B.auth.password=B.pass,this.user=B.user,this.pass=B.pass;if(delete B.user,delete B.pass,B.bufferCommands!=null)this.config.bufferCommands=B.bufferCommands,delete B.bufferCommands}else B={};this._connectionOptions=B;let D=B.dbName;if(D!=null)this.$dbName=D;if(delete B.dbName,!pg.hasUserDefinedProperty(B,"driverInfo"))B.driverInfo={name:"Mongoose",version:BE1.version};this.readyState=f2.connecting,this._connectionString=A;let J;try{J=new lg.MongoClient(A,B)}catch(Z){throw this.readyState=f2.disconnected,Z}this.client=J,J.setMaxListeners(0),await J.connect(),hH(this,J,B,D);for(let Z of this.otherDbs)hH(Z,J,{},Z.name);return this};/*!
|
|
681
|
+
* ignore
|
|
682
|
+
*/m3.prototype.setClient=function F(A){if(!(A instanceof lg.MongoClient))throw new z9("Must call `setClient()` with an instance of MongoClient");if(this.readyState!==f2.disconnected)throw new z9("Cannot call `setClient()` on a connection that is already connected.");if(A.topology==null)throw new z9("Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.");this._connectionString=A.s.url,hH(this,A,{},A.s.options.dbName);for(let B of Object.values(this.models))B.init().catch(function D(){});return this};/*!
|
|
683
|
+
* ignore
|
|
684
|
+
*/function hH(F,A,B,D){let J=D!=null?A.db(D):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=D!=null?D:J.databaseName,F._closeCalled=A._closeCalled;let Z=()=>{if(F.readyState!==f2.connected)F.readyState=f2.connected,F.emit("reconnect"),F.emit("reconnected"),F.onOpen()},X=A&&A.topology&&A.topology.description&&A.topology.description.type||"";if(X==="Single")A.on("serverDescriptionChanged",(Y)=>{if(Y.newDescription.type==="Unknown")F.readyState=f2.disconnected;else Z()});else if(X.startsWith("ReplicaSet"))A.on("topologyDescriptionChanged",(Y)=>{let $=Y.newDescription;if(F.readyState===f2.connected&&$.type!=="ReplicaSetWithPrimary")F.readyState=f2.disconnected;else if(F.readyState===f2.disconnected&&$.type==="ReplicaSetWithPrimary")Z()});if(A.on("serverHeartbeatSucceeded",()=>{F._lastHeartbeatAt=Date.now()}),B.monitorCommands)A.on("commandStarted",(Y)=>F.emit("commandStarted",Y)),A.on("commandFailed",(Y)=>F.emit("commandFailed",Y)),A.on("commandSucceeded",(Y)=>F.emit("commandSucceeded",Y));if(F.onOpen(),A.topology?.s?.state==="connected")F._lastHeartbeatAt=Date.now();for(let Y in F.collections)if(pg.object.hasOwnProperty(F.collections,Y))F.collections[Y].onOpen()}/*!
|
|
685
|
+
* Module exports.
|
|
686
|
+
*/ig.exports=m3});var sg=z((ZE1)=>{/*!
|
|
687
|
+
* Module exports.
|
|
688
|
+
*/ZE1.Collection=cu();ZE1.Connection=ng()});var rg=z((eI1,ag)=>{/*!
|
|
689
|
+
* Valid mongoose options
|
|
690
|
+
*/var $E1=Object.freeze(["allowDiskUse","applyPluginsToChildSchemas","applyPluginsToDiscriminators","autoCreate","autoIndex","autoSearchIndex","bufferCommands","bufferTimeoutMS","cloneSchemas","createInitialConnection","debug","id","timestamps.createdAt.immutable","maxTimeMS","objectIdGetter","overwriteModels","returnOriginal","runValidators","sanitizeFilter","sanitizeProjection","selectPopulatedPaths","setDefaultsOnInsert","strict","strictPopulate","strictQuery","toJSON","toObject","transactionAsyncLocalStorage","translateAliases"]);ag.exports=$E1});var og=z((FN1,tg)=>{/*!
|
|
691
|
+
* Module dependencies.
|
|
692
|
+
*/var GE1=C1();class mH extends GE1{constructor(F){let A=F.map((B)=>B.message).join(", ");if(A.length>50)A=A.slice(0,50)+"...";super(`eachAsync() finished with ${F.length} errors: ${A}`);this.errors=F}}Object.defineProperty(mH.prototype,"name",{value:"EachAsyncMultiError"});/*!
|
|
693
|
+
* exports
|
|
694
|
+
*/tg.exports=mH});var cH=z((AN1,Fb)=>{/*!
|
|
695
|
+
* Module dependencies.
|
|
696
|
+
*/var EE1=og(),dH=r2();Fb.exports=async function F(A,B,D){let J=D.parallel||1,Z=D.batchSize,X=D.signal,Y=D.continueOnError,$=[],G=CE1(),E=!1;return new Promise((q,W)=>{if(X!=null){if(X.aborted)return q(null);X.addEventListener("abort",()=>{return E=!0,q(null)},{once:!0})}if(Z!=null){if(typeof Z!=="number")throw new TypeError("batchSize must be a number");else if(!Number.isInteger(Z))throw new TypeError("batchSize must be an integer");else if(Z<1)throw new TypeError("batchSize must be at least 1")}C((K,U)=>{if(K!=null)return W(K);q(U)})});function C(q){let W=0,K=0,U=null;for(let L=0;L<J;++L)G(Q());function Q(){let L=[],V=!1;return w;function w(j){if(V||E)return j();else if(U)return j();A(function(T,M){if(U!=null)return j();if(T!=null)if(T.name==="MongoCursorExhaustedError")M=null;else if(Y)$.push(T);else return U=T,q(T),j();if(M==null){if(V=!0,W<=0){let u=Y?eg($):U;q(u)}else if(Z&&L.length)H(L,K++,m);return j()}if(++W,dH(()=>j()),Z)L.push(M);if(Z&&L.length!==Z){dH(()=>G(w));return}let x=Z?L:M;function m(u){if(Z)W-=L.length,L=[];else--W;if(u!=null)if(Y)$.push(u);else return U=u,q(u);if((V||E)&&W<=0){let k=Y?eg($):U;return q(k)}dH(()=>G(w))}H(x,K++,m)})}}}function H(q,W,K){let U;try{U=B(q,W)}catch(Q){return K(Q)}if(U&&typeof U.then==="function")U.then(function(){K(null)},function(Q){K(Q||new Error("`eachAsync()` promise rejected without error"))});else K(null)}};function CE1(){let F=[],A=null,B=0;return function J(Z){if(A===null&&F.length===0)return A=B++,Z(D);F.push(Z)};function D(){if(F.length!==0)A=B++,F.shift()(D);else A=null}}function eg(F){if(F.length===0)return null;return new EE1(F)}});var Gb=z((BN1,$b)=>{/*!
|
|
697
|
+
* Module dependencies.
|
|
698
|
+
*/var zF=C1(),Jb=import.meta.require("stream").Readable,HE1=cH(),Zb=l5(),qE1=x7(),lH=r2(),{once:WE1}=import.meta.require("events"),Xb=import.meta.require("util");function e0(F){Jb.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,(B)=>{if(B!=null){if(B instanceof qE1.skipWrappedFunction){let D=B.args[0];if(D!=null&&(!Array.isArray(D)||D.length)){let J=new zF('Cannot `skipMiddlewareFunction()` with a value when using `.find().cursor()`, value must be nullish or empty array, got "'+Xb.inspect(D)+'".');this._markError(J),this.listeners("error").length>0&&this.emit("error",J);return}this.skipped=!0,this.emit("cursor",null);return}this._markError(B),this.listeners("error").length>0&&this.emit("error",B);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([()=>Ab(F,this)]);else Ab(F,this)})}Xb.inherits(e0,Jb);/*!
|
|
699
|
+
* ignore
|
|
700
|
+
*/function Ab(F,A){try{let B=F.model.collection.find(F._conditions,A.options);A.cursor=B,A.emit("cursor",B)}catch(B){A._markError(B),A.listeners("error").length>0&&A.emit("error",A._error)}}e0.prototype._read=function(){HJ(this,(F,A)=>{if(F)return this.emit("error",F);if(!A){this.push(null),this.cursor.close(function(B){if(B)return this.emit("error",B)});return}this.push(A)})};e0.prototype.getDriverCursor=async function F(){if(this.cursor)return this.cursor;return await WE1(this,"cursor"),this.cursor};Object.defineProperty(e0.prototype,"map",{value:function(F){return this._transforms.push(F),this},enumerable:!0,configurable:!0,writable:!0});e0.prototype._markError=function(F){return this._error=F,this};e0.prototype.close=async function F(){if(typeof arguments[0]==="function")throw new zF("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}};e0.prototype._destroy=function F(A,B){let D=null;if(!this.cursor)D=new Promise((J)=>{this.once("cursor",J)});else D=Promise.resolve();return D.then(()=>{this.cursor.close()}).then(()=>{this._closed=!0,B()}).catch((J)=>{B(J)}),this};e0.prototype.rewind=function(){return Yb(this,()=>{this.cursor.rewind()}),this};e0.prototype.next=async function F(){if(typeof arguments[0]==="function")throw new zF("QueryCursor.prototype.next() no longer accepts a callback");if(this._closed)throw new zF("Cannot call `next()` on a closed cursor");return new Promise((A,B)=>{HJ(this,function(D,J){if(D)return B(D);A(J)})})};e0.prototype.eachAsync=function(F,A){if(typeof arguments[2]==="function")throw new zF("QueryCursor.prototype.eachAsync() no longer accepts a callback");if(typeof A==="function")A={};return A=A||{},HE1((B)=>HJ(this,B),F,A)};e0.prototype.options;e0.prototype.addCursorFlag=function(F,A){return Yb(this,()=>{this.cursor.addCursorFlag(F,A)}),this};/*!
|
|
701
|
+
* ignore
|
|
702
|
+
*/e0.prototype.transformNull=function(F){if(arguments.length===0)F=!0;return this._mongooseOptions.transformNull=F,this};/*!
|
|
703
|
+
* ignore
|
|
704
|
+
*/e0.prototype._transformForAsyncIterator=function(){if(this._transforms.indexOf(Bb)===-1)this.map(Bb);return this};if(Symbol.asyncIterator!=null)e0.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()};/*!
|
|
705
|
+
* ignore
|
|
706
|
+
*/function Bb(F){return F==null?{done:!0}:{value:F,done:!1}}function HJ(F,A){let B=A;if(F._transforms.length)B=function(D,J){if(D||J===null&&!F._mongooseOptions.transformNull)return A(D,J);A(D,F._transforms.reduce(function(Z,X){return X.call(F,Z)},J))};if(F._error)return lH(function(){B(F._error)});if(F.skipped)return lH(()=>B(null,null));if(F.cursor){if(F.query._mongooseOptions.populate&&!F._pop)F._pop=Zb.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 CJ(F,F._batchDocs.shift(),F._pop,B);else if(F._batchExhausted)return B(null,null);else{F._batchDocs=[],F.cursor.next().then((D)=>{B8.call({ctx:F,callback:B},null,D)},(D)=>{B8.call({ctx:F,callback:B},D)});return}else return F.cursor.next().then((D)=>{if(!D){B(null,null);return}if(!F.query._mongooseOptions.populate)return CJ(F,D,null,B);F.query.model.populate(D,F._pop).then((J)=>{CJ(F,J,F._pop,B)},(J)=>{B(J)})},(D)=>{B(D)})}else F.once("error",A),F.once("cursor",function(D){if(F.removeListener("error",A),D==null){if(F.skipped)return A(null,null);return}HJ(F,A)})}/*!
|
|
707
|
+
* ignore
|
|
708
|
+
*/function B8(F,A){if(F)return this.callback(F);if(!A)return this.ctx._batchExhausted=!0,Db.call(this);if(this.ctx._batchDocs.push(A),this.ctx._batchDocs.length<this.ctx.options._populateBatchSize){if(this.ctx._batchDocs.length>0&&this.ctx._batchDocs.length%1000===0)return lH(()=>this.ctx.cursor.next().then((B)=>{B8.call(this,null,B)},(B)=>{B8.call(this,B)}));this.ctx.cursor.next().then((B)=>{B8.call(this,null,B)},(B)=>{B8.call(this,B)})}else Db.call(this)}/*!
|
|
709
|
+
* ignore
|
|
710
|
+
*/function Db(){if(!this.ctx._batchDocs.length)return this.callback(null,null);this.ctx.query.model.populate(this.ctx._batchDocs,this.ctx._pop).then(()=>{CJ(this.ctx,this.ctx._batchDocs.shift(),this.ctx._pop,this.callback)},(F)=>{this.callback(F)})}/*!
|
|
711
|
+
* ignore
|
|
712
|
+
*/function CJ(F,A,B,D){if(F.query._mongooseOptions.lean)return F.model.hooks.execPost("find",F.query,[[A]],($)=>{if($!=null)return D($);D(null,A)});let{model:J,_fields:Z,_userProvidedFields:X,options:Y}=F.query;Zb.createModelAndInit(J,A,Z,X,Y,B,($,G)=>{if($!=null)return D($);F.model.hooks.execPost("find",F.query,[[G]],(E)=>{if(E!=null)return D(E);D(null,G)})})}/*!
|
|
713
|
+
* ignore
|
|
714
|
+
*/function Yb(F,A){if(F.cursor)return A();F.once("cursor",function(B){if(B==null)return;A()})}$b.exports=e0});var iH=z((DN1,Cb)=>{var pH=J1();function KE1(F,A,B){Eb(F,A,B,"maxTimeMS")}function zE1(F,A,B){Eb(F,A,B,"allowDiskUse")}Cb.exports={applyGlobalMaxTimeMS:KE1,applyGlobalDiskUse:zE1};function Eb(F,A,B,D){if(pH.hasUserDefinedProperty(F,D))return;if(pH.hasUserDefinedProperty(A,D))F[D]=A[D];else if(pH.hasUserDefinedProperty(B,D))F[D]=B[D]}});var nH=z((JN1,Hb)=>{Hb.exports=function F(A,B){if(B.readConcern!==void 0)return;if(B&&B.session&&B.session.transaction)return;let D=A.options?.readConcern?.level;if(D!=null)B.readConcern={level:D}}});var sH=z((ZN1,qb)=>{qb.exports=function F(A,B){if(B.writeConcern!=null)return;if(B&&B.session&&B.session.transaction)return;let D=A.options.writeConcern??{};if(Object.keys(D).length!=0){if(B.writeConcern={},!("w"in B)&&D.w!=null)B.writeConcern.w=D.w;if(!("j"in B)&&D.j!=null)B.writeConcern.j=D.j;if(!("wtimeout"in B)&&D.wtimeout!=null)B.writeConcern.wtimeout=D.wtimeout}else{if(!("w"in B)&&D.w!=null)B.w=D.w;if(!("j"in B)&&D.j!=null)B.j=D.j;if(!("wtimeout"in B)&&D.wtimeout!=null)B.wtimeout=D.wtimeout}}});var zb=z((XN1,Kb)=>{var Wb=BF();Kb.exports=function F(A,B,D){if(!Object.keys(D).some(Wb))return B.castForQuery(null,D,A);let Z=Object.keys(D),X=Z.length;while(X--){let Y=Z[X],$=D[Y];if(Y==="$not"){if($&&B&&!B.caster){let G=Object.keys($);if(G.length&&Wb(G[0]))for(let E of Object.keys($))$[E]=B.castForQuery(E,$[E],A);else D[Y]=B.castForQuery(Y,$,A);continue}}else D[Y]=B.castForQuery(Y,$,A)}return D}});var Qb=z((YN1,Ub)=>{var UE1=/^\d+$/;Ub.exports=function F(A,B){let D=A.path(B);if(D!=null)return D;let J=B.split("."),Z="",X=!1;for(let Y of J){if(X&&UE1.test(Y))continue;if(Z=Z.length===0?Y:Z+"."+Y,D=A.path(Z),D!=null&&D.schema){if(A=D.schema,Z="",!X&&D.$isMongooseDocumentArray)X=!0}}return D}});var aH=z(($N1,Vb)=>{var Lb=h7().modifiedPaths;Vb.exports=function F(A){let B=Object.keys(A),D={},J={};for(let Z of B){if(Z.startsWith("$")){Lb(A[Z],"",D);continue}J[Z]=A[Z]}return Lb(J,"",D),D}});var rH=z((GN1,Rb)=>{var QE1=aH();Rb.exports=function F(A){if(A==null)return{};let B=QE1(A);return Object.keys(B).reduce((D,J)=>{let Z=J.match(/\$\[[^\]]+\]/g);if(Z==null)return D;for(let X of Z){let Y=J.indexOf(X);if(Y!==J.lastIndexOf(X))throw new Error(`Path '${J}' contains the same array filter multiple times`);D[X.substring(2,X.length-1)]=J.substring(0,Y-1).replace(/\$\[[^\]]+\]/g,"0")}return D},{})}});var Mb=z((EN1,Pb)=>{var LE1=zb(),wb=t5(),Ib=Qb(),VE1=rH();Pb.exports=function F(A){let B=A.options.arrayFilters,D=A.getUpdate(),J=A.schema,Z=VE1(D),X=J.options.strict;if(A._mongooseOptions.strict!=null)X=A._mongooseOptions.strict;if(A.model&&A.model.base.options.strictQuery!=null)X=A.model.base.options.strictQuery;if(J._userProvidedOptions.strictQuery!=null)X=J._userProvidedOptions.strictQuery;if(A._mongooseOptions.strictQuery!=null)X=A._mongooseOptions.strictQuery;Nb(B,J,X,Z,A)};function Nb(F,A,B,D,J){if(!Array.isArray(F))return;for(let Z of F){if(Z==null)throw new Error(`Got null array filter in ${F}`);let X=Object.keys(Z).filter((q)=>Z[q]!=null);if(X.length===0)continue;let Y=X[0];if(Y==="$and"||Y==="$or"){for(let q of X)Nb(Z[q],A,B,D,J);continue}let $=Y.indexOf("."),G=$===-1?Y:Y.substring(0,$);if(D[G]==null)continue;let E=wb(D[G]),C=Ib(A,E),H=C!=null?C.schema:null;if(H!=null&&H.discriminators!=null&&Z[G+"."+H.options.discriminatorKey])H=H.discriminators[Z[G+"."+H.options.discriminatorKey]]||H;for(let q of X){if(D[q]===null)continue;if(Object.keys(D).length===0)continue;let W=q.indexOf("."),K=W===-1?null:q.substring(W),U;if(K==null||H==null)U=C;else K=wb(K),U=Ib(H,K);if(U==null){if(!B)return;let Q=K==null?E+".0":E+".0"+K;throw new Error(`Could not find path "${Q}" in schema`)}if(typeof Z[q]==="object")Z[q]=LE1(J,U,Z[q]);else Z[q]=U.castForQuery(null,Z[q])}}}});var ub=z((CN1,jb)=>{var RE1=t5(),Tb=C0(),wE1=K6(),IE1=rH();jb.exports=function F(A,B,D,J,Z){let X=J.split("."),Y=null,$="adhocOrUndefined";D=D||{},B=B||{};let G=Z!=null&&Array.isArray(Z.arrayFilters)?Z.arrayFilters:[],E=IE1(B);for(let C=0;C<X.length;++C){let H=RE1(X.slice(0,C+1).join("."));if(Y=A.path(H),Y==null)continue;if($=A.pathType(H),(Y.$isSingleNested||Y.$isMongooseDocumentArrayElement)&&Y.schema.discriminators!=null){let q=Tb(Y,"schema.options.discriminatorKey"),W=H+"."+q,K=W.replace(/\.\d+\./,"."),U=null;if(W in D)U=D[W];if(K in D)U=D[K];let Q=H.replace(/\.\d+$/,"");if(Y.$isMongooseDocumentArrayElement&&Tb(D[Q],"$elemMatch."+q)!=null)U=D[Q].$elemMatch[q];if(W in B)U=B[W];for(let j of Object.keys(E)){let T=E[j]+"."+q,M=j+"."+q;if(T===K){let x=G.find((m)=>m.hasOwnProperty(M));if(x!=null)U=x[M]}}if(U==null)continue;let L=wE1(Y.caster.discriminators,U),V=L&&L.schema;if(V==null)continue;let w=X.slice(C+1).join(".");if(Y=V.path(w),Y!=null){$=V._getPathType(w);break}}}return{type:$,schematype:Y}}});var kb=z((HN1,Ob)=>{var NE1=z4();Ob.exports=function F(A,B,D,J,Z,X,Y){if(A==null||!A.options||!A.options.immutable)return!1;let $=A.options.immutable;if(typeof $==="function")$=$.call(Y,Y);if(!$)return!1;if(X&&X.overwriteImmutable)return!1;if(B===!1)return!1;if(B==="throw")throw new NE1(null,`Field ${Z} is immutable and strict = 'throw'`);return delete D[J],!0}});var fb=z((qN1,xb)=>{var PE1=C0();xb.exports=function F(A,B,D){if(B==null)return;let J=Object.keys(B);for(let Z of J){let X=Z.startsWith("$");if(Z==="$set"){let Y=Object.keys(B[Z]);for(let $ of Y)Sb(A,B[Z],$,B,D)}else if(!X)Sb(A,B,Z,B,D)}};function Sb(F,A,B,D,J){let Z=F.path(B);if(Z==null)return;let X=PE1(Z,"options.immutable",null);if(X==null)return;if(typeof X==="function")X=X.call(J,J);if(!X)return;D.$setOnInsert=D.$setOnInsert||{},D.$setOnInsert[B]=A[B],delete A[B]}});var oH=z((WN1,_b)=>{var tH=D9();_b.exports=function F(A,B,D){if(B.indexOf(".")===-1){if(tH.has(B))return;A[B]=D;return}let J=B.split("."),Z=J.pop(),X=A;for(let Y of J){if(tH.has(Y))continue;if(X[Y]==null)X[Y]={};X=X[Y]}if(!tH.has(Z))X[Z]=D}});var Dq=z((KN1,lb)=>{var qJ=q2(),UF=C1(),gb=NH(),bb=z4(),ME1=Z9(),Fq=FF(),TE1=q9(),jE1=C2(),yb=K6(),eH=ub(),vb=kb(),uE1=fb(),db=Y9().schemaMixedSymbol,OE1=oH(),QF=J1(),{internalToObjectOptions:kE1}=y6(),Aq=new Set(["$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$bit"]);lb.exports=function F(A,B,D,J,Z){if(B==null)return;if(D=D||{},Array.isArray(B)){let C=B.length;for(let H=0;H<C;++H){let q=Object.keys(B[H]);for(let W of q)B[H][W]=SE1(W,B[H][W])}return B}if(A!=null&&Z!=null&&QF.hasUserDefinedProperty(Z,A.options.discriminatorKey)&&typeof Z[A.options.discriminatorKey]!=="object"&&A.discriminators!=null){let C=Z[A.options.discriminatorKey],H=yb(J.model.discriminators,C);A=A.discriminators[C]||H&&H.schema||A}else if(A!=null&&D.overwriteDiscriminatorKey&&QF.hasUserDefinedProperty(B,A.options.discriminatorKey)&&A.discriminators!=null){let C=B[A.options.discriminatorKey],H=yb(J.model.discriminators,C);A=A.discriminators[C]||H&&H.schema||A}if(D.upsert)uE1(A,B,J);let X=Object.keys(B),Y=X.length,$={},G,E=!1;Z=Z||{};while(Y--){let C=X[Y];if(!Aq.has(C)){if(!$.$set)if(B.$set)$.$set=B.$set;else $.$set={};if($.$set[C]=B[C],X.splice(Y,1),!~X.indexOf("$set"))X.push("$set")}else if(C==="$set"){if(!$.$set)$[C]=B[C]}else $[C]=B[C]}Y=X.length;while(Y--){let C=X[Y];if(G=$[C],E=E||C.startsWith("$"),G!=null&&G.$__)G=G.toObject(kE1),$[C]=G;if(G&&typeof G==="object"&&!Buffer.isBuffer(G)&&Aq.has(C))cb(A,G,C,D,J,Z);else{let H="Invalid atomic update value for "+C+". Expected an object, received "+typeof G;throw new Error(H)}if(C.startsWith("$")&&QF.isEmptyObject(G))delete $[C]}if(Object.keys($).length===0&&D.upsert&&Object.keys(Z).length>0)return{$setOnInsert:{...Z}};return $};/*!
|
|
715
|
+
* ignore
|
|
716
|
+
*/function SE1(F,A){if(F==="$unset"){if(typeof A!=="string"&&(!Array.isArray(A)||A.find((B)=>typeof B!=="string")))throw new UF("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 UF("Invalid $project in pipeline, must be an object");return A}if(F==="$addFields"||F==="$set"){if(A==null||typeof A!=="object")throw new UF("Invalid "+F+" in pipeline, must be an object");return A}else if(F==="$replaceRoot"||F==="$replaceWith"){if(A==null||typeof A!=="object")throw new UF("Invalid "+F+" in pipeline, must be an object");return A}throw new UF('Invalid update pipeline operator: "'+F+'"')}function cb(F,A,B,D,J,Z,X){let Y=D.strict,$=X?X+".":"",G=Object.keys(A),E=G.length,C=!1,H,q,W,K=null,U=Y!=null?Y:F.options.strict;while(E--){if(q=G[E],W=A[q],B==="$pull"){if(H=F._getSchema($+q),H==null){let L=eH(F,A,Z,$+q,D);if(L.schematype!=null)H=L.schematype}if(H!=null&&H.schema!=null){A[q]=TE1(H.schema,A[q],D,J),C=!0;continue}}let Q=$?$+q:q;if(F.discriminatorMapping!=null&&Q===F.options.discriminatorKey&&F.discriminatorMapping.value!==A[q]&&!D.overwriteDiscriminatorKey){if(U==="throw"){let L=new Error(`Can't modify discriminator key "`+Q+'" on discriminator model');K=U9(L,J,Q,K);continue}else if(U){delete A[q];continue}}if(jE1(W)==="Object"){if(H=F._getSchema($+q),H==null){let L=eH(F,A,Z,$+q,D);if(L.schematype!=null)H=L.schematype}if(B!=="$setOnInsert"&&vb(H,Y,A,q,$+q,D,J))continue;if(H&&H.caster&&B in Bq)if("$each"in W){C=!0;try{A[q]={$each:D8(H,W.$each,B,q,J,$+q)}}catch(L){K=U9(L,J,q,K)}if(W.$slice!=null)A[q].$slice=W.$slice|0;if(W.$sort)A[q].$sort=W.$sort;if(W.$position!=null)A[q].$position=Fq(W.$position)}else{if(H!=null&&H.$isSingleNested){let L=Y==null?H.schema.options.strict:Y;try{A[q]=H.castForQuery(null,W,J,{strict:L})}catch(V){K=U9(V,J,q,K)}}else try{A[q]=D8(H,W,B,q,J,$+q)}catch(L){K=U9(L,J,q,K)}if(A[q]===void 0){delete A[q];continue}C=!0}else if(B==="$currentDate"||B in Bq&&H){try{A[q]=D8(H,W,B,q,J,$+q)}catch(L){K=U9(L,J,q,K)}if(A[q]===void 0){delete A[q];continue}C=!0}else if(B==="$rename"){let L=new gb(`${$}${q}.$rename`);try{A[q]=D8(L,W,B,q,J,$+q)}catch(V){K=U9(V,J,q,K)}if(A[q]===void 0){delete A[q];continue}C=!0}else{let L=$+q,V=F._getPathType(L),w=Y;if(V&&V.schema&&w==null)w=V.schema.options.strict;if(V.pathType==="undefined"){if(w==="throw")throw new bb(L);else if(w){delete A[q];continue}}C|=cb(F,W,B,D,J,Z,$+q)||QF.isObject(W)&&Object.keys(W).length===0}}else{let L=q==="$each"||q==="$or"||q==="$and"||q==="$in"?X:$+q;if(H=F._getSchema(L),B!=="$setOnInsert"&&vb(H,Y,A,q,$+q,D,J))continue;let V=F._getPathType(L);if(H==null){let T=eH(F,A,Z,L,D);if(T.schematype!=null)H=T.schematype,V=T.type}let w=Y;if(V&&V.schema&&Y==null)w=V.schema.options.strict;if(w&&!H&&!/real|nested/.test(V.pathType))if(w==="throw"&&F.virtuals[L]==null)throw new bb($+q);else delete A[q];else{if(B==="$rename"){if(A[q]==null)throw new qJ("String",A[q],`${$}${q}.$rename`);let T=new gb(`${$}${q}.$rename`);A[q]=T.castForQuery(null,A[q],J);continue}try{if($.length===0||q.indexOf(".")===-1)A[q]=D8(H,W,B,q,J,$+q);else if(w!==!1||H!=null)OE1(A,q,D8(H,W,B,q,J,$+q)),delete A[q]}catch(T){K=U9(T,J,q,K)}if(Array.isArray(A[q])&&(B==="$addToSet"||B==="$push")&&q!=="$each"){if(H&&H.caster&&!H.caster.$isMongooseArray&&!H.caster[db])A[q]={$each:A[q]}}if(A[q]===void 0){delete A[q];continue}C=!0}}}if(K!=null)throw K;return C}/*!
|
|
717
|
+
* ignore
|
|
718
|
+
*/function U9(F,A,B,D){if(typeof A!=="object"||!A.options.multipleCastError)throw F;return D=D||new ME1,D.addError(B,F),D}var hb={$pop:1,$inc:1},xE1={$unset:1},Bq={$push:1,$addToSet:1,$set:1,$setOnInsert:1};/*!
|
|
719
|
+
* ignore
|
|
720
|
+
*/var mb={$set:1,$setOnInsert:1};function D8(F,A,B,D,J,Z){if(!F){if(B in hb)try{return Fq(A)}catch(Y){throw new qJ("number",A,Z)}return A}if(F.caster&&B in Bq&&(QF.isObject(A)||Array.isArray(A))&&!mb[B]){let Y=0,$=F;while($.$isMongooseArray)++Y,$=$.caster;let G=0,E=A;while(Array.isArray(E))++G,E=E[0];let C=Y-G;while(G<Y)A=[A],++G;let H=F.applySetters(Array.isArray(A)?A:[A],J);for(let q=0;q<C;++q)H=H[0];return H}if(B in xE1)return A;if(B in hb){if(A==null)throw new qJ("number",A,F.path);if(B==="$inc")return F.castForQuery(null,A,J);try{return Fq(A)}catch(Y){throw new qJ("number",A,F.path)}}if(B==="$currentDate"){if(typeof A==="object")return{$type:A.$type};return Boolean(A)}if(Aq.has(D))return F.castForQuery(D,A,J);if(mb[B]){let Y=A!=null&&F.$isMongooseArray&&F.$fullPath!=null&&!F.$fullPath.match(/\d+$/),$=F[db]!=null;if(Y||$)return F.applySetters(A,J);return F.castForQuery(null,A,J)}return F.castForQuery(null,A,J)}});var WJ=z((zN1,pb)=>{var fE1=m7(),_E1=O7();/*!
|
|
721
|
+
* ignore
|
|
722
|
+
*/pb.exports=function F(A){if(A==null)return!1;let B=Object.keys(A),D=B.length;if(D===0)return!1;for(let J=0;J<D;++J){let Z=B[J];if(Z.startsWith("+"))continue;if(fE1(A[Z])&&!!A[Z])if(_E1(A[Z]))return F(A[Z]);else return!!A[Z]}return!1}});var nb=z((UN1,ib)=>{ib.exports=function F(A,B){return A===B||B.startsWith(A+".")}});var tb=z((vE1)=>{/*!
|
|
723
|
+
* Module dependencies.
|
|
724
|
+
*/var Jq=["__proto__","constructor","prototype"],KJ=vE1.clone=function F(A,B){if(A===void 0||A===null)return A;if(Array.isArray(A))return vE1.cloneArray(A,B);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,B));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,B);if(A.valueOf)return A.valueOf()};/*!
|
|
725
|
+
* ignore
|
|
726
|
+
*/vE1.cloneObject=function F(A,B){let D=B&&B.minimize,J={},Z=Object.keys(A),X=Z.length,Y=!1,$,G="",E=0;for(E=0;E<X;++E){if(G=Z[E],Jq.indexOf(G)!==-1)continue;if($=KJ(A[G],B),!D||typeof $!=="undefined")Y||(Y=!0),J[G]=$}return D?Y&&J:J};vE1.cloneArray=function F(A,B){let D=[],J=A.length,Z=0;for(;Z<J;Z++)D.push(KJ(A[Z],B));return D};vE1.merge=function F(A,B){let D=Object.keys(B);for(let J of D){if(Jq.indexOf(J)!==-1)continue;if(typeof A[J]==="undefined")A[J]=B[J];else if(vE1.isObject(B[J]))F(A[J],B[J]);else A[J]=B[J]}};vE1.mergeClone=function F(A,B){let D=Object.keys(B);for(let J of D){if(Jq.indexOf(J)!==-1)continue;if(typeof A[J]==="undefined")A[J]=KJ(B[J]);else if(vE1.isObject(B[J]))F(A[J],B[J]);else A[J]=KJ(B[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 gE1=Object.prototype.toString;vE1.toString=function(F){return gE1.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:yE1;function yE1(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 eb=z((VN1,ob)=>{var J8=1000,Z8=J8*60,X8=Z8*60,Q9=X8*24,aE1=Q9*7,rE1=Q9*365.25;ob.exports=function(F,A){A=A||{};var B=typeof F;if(B==="string"&&F.length>0)return tE1(F);else if(B==="number"&&isFinite(F))return A.long?eE1(F):oE1(F);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(F))};function tE1(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 B=parseFloat(A[1]),D=(A[2]||"ms").toLowerCase();switch(D){case"years":case"year":case"yrs":case"yr":case"y":return B*rE1;case"weeks":case"week":case"w":return B*aE1;case"days":case"day":case"d":return B*Q9;case"hours":case"hour":case"hrs":case"hr":case"h":return B*X8;case"minutes":case"minute":case"mins":case"min":case"m":return B*Z8;case"seconds":case"second":case"secs":case"sec":case"s":return B*J8;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return B;default:return}}function oE1(F){var A=Math.abs(F);if(A>=Q9)return Math.round(F/Q9)+"d";if(A>=X8)return Math.round(F/X8)+"h";if(A>=Z8)return Math.round(F/Z8)+"m";if(A>=J8)return Math.round(F/J8)+"s";return F+"ms"}function eE1(F){var A=Math.abs(F);if(A>=Q9)return zJ(F,A,Q9,"day");if(A>=X8)return zJ(F,A,X8,"hour");if(A>=Z8)return zJ(F,A,Z8,"minute");if(A>=J8)return zJ(F,A,J8,"second");return F+" ms"}function zJ(F,A,B,D){var J=A>=B*1.5;return Math.round(F/B)+" "+D+(J?"s":"")}});var Zq=z((RN1,Fy)=>{function FC1(F){B.debug=B,B.default=B,B.coerce=$,B.disable=Z,B.enable=J,B.enabled=X,B.humanize=eb(),B.destroy=G,Object.keys(F).forEach((E)=>{B[E]=F[E]}),B.names=[],B.skips=[],B.formatters={};function A(E){let C=0;for(let H=0;H<E.length;H++)C=(C<<5)-C+E.charCodeAt(H),C|=0;return B.colors[Math.abs(C)%B.colors.length]}B.selectColor=A;function B(E){let C,H=null,q,W;function K(...U){if(!K.enabled)return;let Q=K,L=Number(new Date),V=L-(C||L);if(Q.diff=V,Q.prev=C,Q.curr=L,C=L,U[0]=B.coerce(U[0]),typeof U[0]!=="string")U.unshift("%O");let w=0;U[0]=U[0].replace(/%([a-zA-Z%])/g,(T,M)=>{if(T==="%%")return"%";w++;let x=B.formatters[M];if(typeof x==="function"){let m=U[w];T=x.call(Q,m),U.splice(w,1),w--}return T}),B.formatArgs.call(Q,U),(Q.log||B.log).apply(Q,U)}if(K.namespace=E,K.useColors=B.useColors(),K.color=B.selectColor(E),K.extend=D,K.destroy=B.destroy,Object.defineProperty(K,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(H!==null)return H;if(q!==B.namespaces)q=B.namespaces,W=B.enabled(E);return W},set:(U)=>{H=U}}),typeof B.init==="function")B.init(K);return K}function D(E,C){let H=B(this.namespace+(typeof C==="undefined"?":":C)+E);return H.log=this.log,H}function J(E){B.save(E),B.namespaces=E,B.names=[],B.skips=[];let C,H=(typeof E==="string"?E:"").split(/[\s,]+/),q=H.length;for(C=0;C<q;C++){if(!H[C])continue;if(E=H[C].replace(/\*/g,".*?"),E[0]==="-")B.skips.push(new RegExp("^"+E.slice(1)+"$"));else B.names.push(new RegExp("^"+E+"$"))}}function Z(){let E=[...B.names.map(Y),...B.skips.map(Y).map((C)=>"-"+C)].join(",");return B.enable(""),E}function X(E){if(E[E.length-1]==="*")return!0;let C,H;for(C=0,H=B.skips.length;C<H;C++)if(B.skips[C].test(E))return!1;for(C=0,H=B.names.length;C<H;C++)if(B.names[C].test(E))return!0;return!1}function Y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function $(E){if(E instanceof Error)return E.stack||E.message;return E}function G(){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 B.enable(B.load()),B}Fy.exports=FC1});var By=z((Ay,QJ)=>{Ay.formatArgs=BC1;Ay.save=DC1;Ay.load=JC1;Ay.useColors=AC1;Ay.storage=ZC1();Ay.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`.")}})();Ay.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 AC1(){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 BC1(F){if(F[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+F[0]+(this.useColors?"%c ":" ")+"+"+QJ.exports.humanize(this.diff),!this.useColors)return;let A="color: "+this.color;F.splice(1,0,A,"color: inherit");let B=0,D=0;F[0].replace(/%[a-zA-Z%]/g,(J)=>{if(J==="%%")return;if(B++,J==="%c")D=B}),F.splice(D,0,A)}Ay.log=console.debug||console.log||(()=>{});function DC1(F){try{if(F)Ay.storage.setItem("debug",F);else Ay.storage.removeItem("debug")}catch(A){}}function JC1(){let F;try{F=Ay.storage.getItem("debug")}catch(A){}if(!F&&typeof process!=="undefined"&&"env"in process)F=process.env.DEBUG;return F}function ZC1(){try{return localStorage}catch(F){}}QJ.exports=Zq()(Ay);var{formatters:XC1}=QJ.exports;XC1.j=function(F){try{return JSON.stringify(F)}catch(A){return"[UnexpectedJSONParseError]: "+A.message}}});var Xy=z((Jy,VJ)=>{var WC1=import.meta.require("tty"),LJ=import.meta.require("util");Jy.init=RC1;Jy.log=QC1;Jy.formatArgs=zC1;Jy.save=LC1;Jy.load=VC1;Jy.useColors=KC1;Jy.destroy=LJ.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Jy.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)Jy.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){}Jy.inspectOpts=Object.keys(process.env).filter((F)=>{return/^debug_/i.test(F)}).reduce((F,A)=>{let B=A.substring(6).toLowerCase().replace(/_([a-z])/g,(J,Z)=>{return Z.toUpperCase()}),D=process.env[A];if(/^(yes|on|true|enabled)$/i.test(D))D=!0;else if(/^(no|off|false|disabled)$/i.test(D))D=!1;else if(D==="null")D=null;else D=Number(D);return F[B]=D,F},{});function KC1(){return"colors"in Jy.inspectOpts?Boolean(Jy.inspectOpts.colors):WC1.isatty(process.stderr.fd)}function zC1(F){let{namespace:A,useColors:B}=this;if(B){let D=this.color,J="\x1B[3"+(D<8?D:"8;5;"+D),Z=` ${J};1m${A} \x1B[0m`;F[0]=Z+F[0].split(`
|
|
727
|
+
`).join(`
|
|
728
|
+
`+Z),F.push(J+"m+"+VJ.exports.humanize(this.diff)+"\x1B[0m")}else F[0]=UC1()+A+" "+F[0]}function UC1(){if(Jy.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function QC1(...F){return process.stderr.write(LJ.format(...F)+`
|
|
729
|
+
`)}function LC1(F){if(F)process.env.DEBUG=F;else delete process.env.DEBUG}function VC1(){return process.env.DEBUG}function RC1(F){F.inspectOpts={};let A=Object.keys(Jy.inspectOpts);for(let B=0;B<A.length;B++)F.inspectOpts[A[B]]=Jy.inspectOpts[A[B]]}VJ.exports=Zq()(Jy);var{formatters:Dy}=VJ.exports;Dy.o=function(F){return this.inspectOpts.colors=this.useColors,LJ.inspect(F,this.inspectOpts).split(`
|
|
730
|
+
`).map((A)=>A.trim()).join(" ")};Dy.O=function(F){return this.inspectOpts.colors=this.useColors,LJ.inspect(F,this.inspectOpts)}});var Yy=z((NN1,Xq)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)Xq.exports=By();else Xq.exports=Xy()});var Gy=z(($y)=>{var H0=$y;H0.distinct=function(F){if(F._fields&&Object.keys(F._fields).length>0)return"field selection and slice";let A=Object.keys(H0.distinct),B;return A.every(function(D){if(F.options[D])return B=D,!1;return!0}),B};H0.distinct.select=H0.distinct.slice=H0.distinct.sort=H0.distinct.limit=H0.distinct.skip=H0.distinct.batchSize=H0.distinct.hint=H0.distinct.tailable=!0;H0.findOneAndUpdate=H0.findOneAndRemove=function(F){let A=Object.keys(H0.findOneAndUpdate),B;return A.every(function(D){if(F.options[D])return B=D,!1;return!0}),B};H0.findOneAndUpdate.limit=H0.findOneAndUpdate.skip=H0.findOneAndUpdate.batchSize=H0.findOneAndUpdate.tailable=!0;H0.count=function(F){if(F._fields&&Object.keys(F._fields).length>0)return"field selection and slice";let A=Object.keys(H0.count),B;return A.every(function(D){if(F.options[D])return B=D,!1;return!0}),B};H0.count.slice=H0.count.batchSize=H0.count.tailable=!0});var $q=z((uC1,Ey)=>{uC1.isNode=typeof process!="undefined"&&typeof Ey=="object"&&typeof global=="object"&&typeof Buffer=="function"&&process.argv;uC1.isMongo=!uC1.isNode&&typeof printjson=="function"&&typeof ObjectId=="function"&&typeof rs=="function"&&typeof sh=="function";uC1.isBrowser=!uC1.isNode&&!uC1.isMongo&&typeof window!="undefined";uC1.type=uC1.isNode?"node":uC1.isMongo?"mongo":uC1.isBrowser?"browser":"unknown"});var LF=z((Hy,qy)=>{var Gq=["find","findOne","updateMany","updateOne","replaceOne","count","distinct","findOneAndDelete","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function Eq(){}for(let F=0,A=Gq.length;F<A;++F){let B=Gq[F];Eq.prototype[B]=kC1(B)}qy.exports=Hy=Eq;Eq.methods=Gq;function kC1(F){return function(){throw new Error("collection."+F+" not implemented")}}});var Uy=z((Ky,zy)=>{var SC1=LF();class Wy extends SC1{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,B){return this.collection.distinct(F,A,B)}async updateMany(F,A,B){return this.collection.updateMany(F,A,B)}async updateOne(F,A,B){return this.collection.updateOne(F,A,B)}async replaceOne(F,A,B){return this.collection.replaceOne(F,A,B)}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,B){return this.collection.findOneAndUpdate(F,A,B)}findCursor(F,A){return this.collection.find(F,A)}}zy.exports=Ky=Wy});var Ly=z((MN1,Qy)=>{var Cq=$q();if(Cq.type=="unknown")throw new Error("Unknown environment");Qy.exports=Cq.isNode?Uy():Cq.isMongo?LF():LF()});var Kq=z((Ry,wy)=>{var xC1=import.meta.require("assert"),fC1=import.meta.require("util"),u1=tb(),d3=Yy()("mquery");function h(F,A){if(!(this instanceof h))return new h(F,A);let B=this.constructor.prototype;if(this.op=B.op||void 0,this.options=Object.assign({},B.options),this._conditions=B._conditions?u1.clone(B._conditions):{},this._fields=B._fields?u1.clone(B._fields):void 0,this._updateDoc=B._updateDoc?u1.clone(B._updateDoc):void 0,this._path=B._path||void 0,this._distinctDoc=B._distinctDoc||void 0,this._collection=B._collection||void 0,this._traceFunction=B._traceFunction||void 0,A)this.setOptions(A);if(F)this.find(F)}var L9="$geoWithin";Object.defineProperty(h,"use$geoWithin",{get:function(){return L9=="$geoWithin"},set:function(F){if(F===!0)L9="$geoWithin";else L9="$within"}});h.prototype.toConstructor=function F(){function A(D,J){if(!(this instanceof A))return new A(D,J);h.call(this,D,J)}u1.inherits(A,h);let B=A.prototype;return B.options={},B.setOptions(this.options),B.op=this.op,B._conditions=u1.clone(this._conditions),B._fields=u1.clone(this._fields),B._updateDoc=u1.clone(this._updateDoc),B._path=this._path,B._distinctDoc=this._distinctDoc,B._collection=this._collection,B._traceFunction=this._traceFunction,A};h.prototype.setOptions=function(F){if(!(F&&u1.isObject(F)))return this;let A=u1.keys(F),B;for(let D=0;D<A.length;++D)if(B=A[D],typeof this[B]=="function"){let J=Array.isArray(F[B])?F[B]:[F[B]];this[B].apply(this,J)}else this.options[B]=F[B];return this};h.prototype.collection=function F(A){return this._collection=new h.Collection(A),this};h.prototype.collation=function(F){return this.options.collation=F,this};h.prototype.$where=function(F){return this._conditions.$where=F,this};h.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")};h.prototype.equals=function F(A){this._ensurePath("equals");let B=this._path;return this._conditions[B]=A,this};h.prototype.eq=function F(A){this._ensurePath("eq");let B=this._path;return this._conditions[B]=A,this};h.prototype.or=function F(A){let B=this._conditions.$or||(this._conditions.$or=[]);if(!Array.isArray(A))A=[A];return B.push.apply(B,A),this};h.prototype.nor=function F(A){let B=this._conditions.$nor||(this._conditions.$nor=[]);if(!Array.isArray(A))A=[A];return B.push.apply(B,A),this};h.prototype.and=function F(A){let B=this._conditions.$and||(this._conditions.$and=[]);if(!Array.isArray(A))A=[A];return B.push.apply(B,A),this};/*!
|
|
731
|
+
* gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
|
|
732
|
+
*
|
|
733
|
+
* Thing.where('type').nin(array)
|
|
734
|
+
*/"gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach(function(F){h.prototype[F]=function(){let A,B;if(arguments.length===1)this._ensurePath(F),B=arguments[0],A=this._path;else B=arguments[1],A=arguments[0];let D=this._conditions[A]===null||typeof this._conditions[A]==="object"?this._conditions[A]:this._conditions[A]={};return D["$"+F]=B,this}});h.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 B=this._conditions[A]||(this._conditions[A]={});return B.$mod=F,this};h.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 B=this._conditions[F]||(this._conditions[F]={});return B.$exists=A,this};h.prototype.elemMatch=function(){if(arguments[0]==null)throw new TypeError("Invalid argument");let F,A,B;if(typeof arguments[0]==="function")this._ensurePath("elemMatch"),A=this._path,F=arguments[0];else if(u1.isObject(arguments[0]))this._ensurePath("elemMatch"),A=this._path,B=arguments[0];else if(typeof arguments[1]==="function")A=arguments[0],F=arguments[1];else if(arguments[1]&&u1.isObject(arguments[1]))A=arguments[0],B=arguments[1];else throw new TypeError("Invalid argument");if(F)B=new h,F(B),B=B._conditions;let D=this._conditions[A]||(this._conditions[A]={});return D.$elemMatch=B,this};h.prototype.within=function F(){if(this._ensurePath("within"),this._geoComparison=L9,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")};h.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 B=this._conditions[F]||(this._conditions[F]={});return B[this._geoComparison||L9]={$box:A},this};h.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 B=this._conditions[A]||(this._conditions[A]={});return B[this._geoComparison||L9]={$polygon:F},this};h.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 B=this._conditions[F]||(this._conditions[F]={}),D=A.spherical?"$centerSphere":"$center",J=this._geoComparison||L9;if(B[J]={},B[J][D]=[A.center,A.radius],"unique"in A)B[J].$uniqueDocs=!!A.unique;return this};h.prototype.near=function F(){let A,B;if(this._geoComparison="$near",arguments.length===0)return this;else if(arguments.length===1)this._ensurePath("near"),A=this._path,B=arguments[0];else if(arguments.length===2)A=arguments[0],B=arguments[1];else throw new TypeError("Invalid argument");if(!B.center)throw new Error("center is required");let D=this._conditions[A]||(this._conditions[A]={}),J=B.spherical?"$nearSphere":"$near";if(Array.isArray(B.center)){D[J]=B.center;let Z="maxDistance"in B?B.maxDistance:null;if(Z!=null)D.$maxDistance=Z;if(B.minDistance!=null)D.$minDistance=B.minDistance}else{if(B.center.type!="Point"||!Array.isArray(B.center.coordinates))throw new Error(fC1.format("Invalid GeoJSON specified for %s",J));if(D[J]={$geometry:B.center},"maxDistance"in B)D[J].$maxDistance=B.maxDistance;if("minDistance"in B)D[J].$minDistance=B.minDistance}return this};h.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")};h.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,B;if(arguments.length===1)this._ensurePath("geometry"),B=this._path,A=arguments[0];else throw new TypeError("Invalid argument");if(!(A.type&&Array.isArray(A.coordinates)))throw new TypeError("Invalid argument");let D=this._conditions[B]||(this._conditions[B]={});return D[this._geoComparison]={$geometry:A},this};h.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 B=this._fields||(this._fields={}),D=typeof A,J,Z;if((D=="string"||u1.isArgumentsObject(A))&&typeof A.length=="number"||Array.isArray(A)){if(D=="string")A=A.split(/\s+/);for(J=0,Z=A.length;J<Z;++J){let X=A[J];if(!X)continue;let Y=X[0]=="-"?0:1;if(Y===0)X=X.substring(1);B[X]=Y}return this}if(u1.isObject(A)){let X=u1.keys(A);for(J=0;J<X.length;++J)B[X[J]]=A[X[J]];return this}throw new TypeError("Invalid select() argument. Must be string or object.")};h.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let F,A;if(arguments.length===1){let D=arguments[0];if(typeof D==="object"&&!Array.isArray(D)){let J=Object.keys(D),Z=J.length;for(let X=0;X<Z;++X)this.slice(J[X],D[J[X]]);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 B=this._fields||(this._fields={});return B[F]={$slice:A},this};h.prototype.sort=function(F){if(!F)return this;let A,B,D;this._validate("sort");let J=typeof F;if(Array.isArray(F)){B=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");_C1(this.options,F[A][0],F[A][1])}return this}if(arguments.length===1&&J=="string"){F=F.split(/\s+/),B=F.length;for(A=0;A<B;++A){if(D=F[A],!D)continue;let Z=D[0]=="-"?-1:1;if(Z===-1)D=D.substring(1);Vy(this.options,D,Z)}return this}if(u1.isObject(F)){let Z=u1.keys(F);for(A=0;A<Z.length;++A)D=Z[A],Vy(this.options,D,F[D]);return this}if(typeof Map!=="undefined"&&F instanceof Map)return gC1(this.options,F),this;throw new TypeError("Invalid sort() argument. Must be a string, object, or array.")};/*!
|
|
735
|
+
* @ignore
|
|
736
|
+
*/var Hq={1:1,"-1":-1,asc:1,ascending:1,desc:-1,descending:-1};function Vy(F,A,B){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 D;if(B&&B.$meta){D=F.sort||(F.sort={}),D[A]={$meta:B.$meta};return}D=F.sort||(F.sort={});let J=String(B||1).toLowerCase();if(J=Hq[J],!J)throw new TypeError("Invalid sort value: { "+A+": "+B+" }");D[A]=J}function _C1(F,A,B){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 D=String(B||1).toLowerCase();if(D=Hq[D],!D)throw new TypeError("Invalid sort value: [ "+A+", "+B+" ]");F.sort.push([A,D])}function gC1(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(B,D){let J=String(B||1).toLowerCase();if(J=Hq[J],!J)throw new TypeError("Invalid sort value: < "+D+": "+B+" >");F.sort.set(D,J)})}/*!
|
|
737
|
+
* limit, skip, batchSize, comment
|
|
738
|
+
*
|
|
739
|
+
* Sets these associated options.
|
|
740
|
+
*
|
|
741
|
+
* query.comment('feed query');
|
|
742
|
+
*/["limit","skip","batchSize","comment"].forEach(function(F){h.prototype[F]=function(A){return this._validate(F),this.options[F]=A,this}});h.prototype.maxTime=h.prototype.maxTimeMS=function(F){return this._validate("maxTime"),this.options.maxTimeMS=F,this};h.prototype.hint=function(){if(arguments.length===0)return this;this._validate("hint");let F=arguments[0];if(u1.isObject(F)){let A=this.options.hint||(this.options.hint={});for(let B in F)A[B]=F[B];return this}if(typeof F==="string")return this.options.hint=F,this;throw new TypeError("Invalid hint. "+F)};h.prototype.j=function F(A){return this.options.j=A,this};h.prototype.slaveOk=function(F){return this.options.slaveOk=arguments.length?!!F:!0,this};h.prototype.read=h.prototype.setReadPreference=function(F){if(arguments.length>1&&!h.prototype.read.deprecationWarningIssued)console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),h.prototype.read.deprecationWarningIssued=!0;return this.options.readPreference=u1.readPref(F),this};h.prototype.readConcern=h.prototype.r=function(F){return this.options.readConcern=u1.readConcern(F),this};h.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=arguments.length?!!arguments[0]:!0,this};h.prototype.writeConcern=h.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};h.prototype.wtimeout=h.prototype.wTimeout=function F(A){return this.options.wtimeout=A,this};h.prototype.merge=function(F){if(!F)return this;if(!h.canMerge(F))throw new TypeError("Invalid argument. Expected instanceof mquery or plain object");if(F instanceof h){if(F._conditions)u1.merge(this._conditions,F._conditions);if(F._fields)this._fields||(this._fields={}),u1.merge(this._fields,F._fields);if(F.options)this.options||(this.options={}),u1.merge(this.options,F.options);if(F._updateDoc)this._updateDoc||(this._updateDoc={}),u1.mergeClone(this._updateDoc,F._updateDoc);if(F._distinctDoc)this._distinctDoc=F._distinctDoc;return this}return u1.merge(this._conditions,F),this};h.prototype.find=function(F){if(this.op="find",h.canMerge(F))this.merge(F);return this};h.prototype._find=async function F(){let A=this._conditions,B=this._optionsForExec();if(this.$useProjection)B.projection=this._fieldsForExec();else B.fields=this._fieldsForExec();return d3("_find",this._collection.collectionName,A,B),this._collection.find(A,B)};h.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 B=this._conditions,D=this._optionsForExec();if(this.$useProjection)D.projection=this._fieldsForExec();else D.fields=this._fieldsForExec();return d3("findCursor",this._collection.collectionName,B,D),this._collection.findCursor(B,D)};h.prototype.findOne=function(F){if(this.op="findOne",h.canMerge(F))this.merge(F);return this};h.prototype._findOne=async function F(){let A=this._conditions,B=this._optionsForExec();if(this.$useProjection)B.projection=this._fieldsForExec();else B.fields=this._fieldsForExec();return d3("findOne",this._collection.collectionName,A,B),this._collection.findOne(A,B)};h.prototype.count=function(F){if(this.op="count",this._validate(),h.canMerge(F))this.merge(F);return this};h.prototype._count=async function F(){let A=this._conditions,B=this._optionsForExec();return d3("count",this._collection.collectionName,A,B),this._collection.count(A,B)};h.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(h.canMerge(F))this.merge(F);return this};h.prototype._distinct=async function F(){if(!this._distinctDoc)throw new Error("No value for `distinct` has been declared");let A=this._conditions,B=this._optionsForExec();return d3("distinct",this._collection.collectionName,A,B),this._collection.distinct(this._distinctDoc,A,B)};h.prototype.updateMany=function F(A,B,D){if(arguments.length===1)B=A,A=D=void 0;return qq(this,"updateMany",A,B,D)};h.prototype._updateMany=async function(){return Wq(this,"updateMany")};h.prototype.updateOne=function F(A,B,D){if(arguments.length===1)B=A,A=D=void 0;return qq(this,"updateOne",A,B,D)};h.prototype._updateOne=async function(){return Wq(this,"updateOne")};h.prototype.replaceOne=function F(A,B,D){if(arguments.length===1)B=A,A=D=void 0;return this.setOptions({overwrite:!0}),qq(this,"replaceOne",A,B,D)};h.prototype._replaceOne=async function(){return Wq(this,"replaceOne")};/*!
|
|
743
|
+
* Internal helper for updateMany, updateOne
|
|
744
|
+
*/function qq(F,A,B,D,J){if(F.op=A,h.canMerge(B))F.merge(B);if(D)F._mergeUpdate(D);if(u1.isObject(J))F.setOptions(J);return F}async function Wq(F,A){let B=F._optionsForExec(),D=F._conditions,J=F._updateForExec();return d3("update",F._collection.collectionName,D,J,B),F._collection[A](D,J,B)}h.prototype.deleteOne=function(F){if(this.op="deleteOne",h.canMerge(F))this.merge(F);return this};h.prototype._deleteOne=async function(){let F=this._optionsForExec();delete F.justOne;let A=this._conditions;return d3("deleteOne",this._collection.collectionName,A,F),this._collection.deleteOne(A,F)};h.prototype.deleteMany=function(F){if(this.op="deleteMany",h.canMerge(F))this.merge(F);return this};h.prototype._deleteMany=async function(){let F=this._optionsForExec();delete F.justOne;let A=this._conditions;return d3("deleteOne",this._collection.collectionName,A,F),this._collection.deleteMany(A,F)};h.prototype.findOneAndUpdate=function(F,A,B){if(this.op="findOneAndUpdate",this._validate(),arguments.length===1)A=F,F=B=void 0;if(h.canMerge(F))this.merge(F);if(A)this._mergeUpdate(A);return B&&this.setOptions(B),this};h.prototype._findOneAndUpdate=async function(){let F=this._conditions,A=this._updateForExec(),B=this._optionsForExec();return this._collection.findOneAndUpdate(F,A,B)};h.prototype.findOneAndRemove=h.prototype.findOneAndDelete=function(F,A){if(this.op="findOneAndRemove",this._validate(),h.canMerge(F))this.merge(F);return A&&this.setOptions(A),this};h.prototype._findOneAndRemove=async function(){let F=this._optionsForExec(),A=this._conditions;return this._collection.findOneAndDelete(A,F)};h.prototype.setTraceFunction=function(F){return this._traceFunction=F,this};h.prototype.exec=async function F(A){if(typeof A==="string")this.op=A;xC1.ok(this.op,"Missing query type: (find, etc)");let B="_"+this.op;if(typeof this[B]!=="function")throw new TypeError(`this[${B}] is not a function`);return this[B]()};h.prototype.then=async function(F,A){return this.exec().then(F,A)};h.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 d3("cursor",this._collection.collectionName,F,A),this._collection.findCursor(F,A)};h.prototype.selected=function F(){return!!(this._fields&&Object.keys(this._fields).length>0)};h.prototype.selectedInclusively=function F(){if(!this._fields)return!1;let A=Object.keys(this._fields);if(A.length===0)return!1;for(let B=0;B<A.length;++B){let D=A[B];if(this._fields[D]===0)return!1;if(this._fields[D]&&typeof this._fields[D]==="object"&&this._fields[D].$meta)return!1}return!0};h.prototype.selectedExclusively=function F(){if(!this._fields)return!1;let A=Object.keys(this._fields);if(A.length===0)return!1;for(let B=0;B<A.length;++B){let D=A[B];if(this._fields[D]===0)return!0}return!1};h.prototype._mergeUpdate=function(F){if(!this._updateDoc)this._updateDoc={};if(F instanceof h){if(F._updateDoc)u1.mergeClone(this._updateDoc,F._updateDoc)}else u1.mergeClone(this._updateDoc,F)};h.prototype._optionsForExec=function(){return u1.clone(this.options)};h.prototype._fieldsForExec=function(){return u1.clone(this._fields)};h.prototype._updateForExec=function(){let F=u1.clone(this._updateDoc),A=u1.keys(F),B={};for(let D of A){if(this.options.overwrite){B[D]=F[D];continue}if(D[0]!=="$"){if(!B.$set)if(F.$set)B.$set=F.$set;else B.$set={};if(B.$set[D]=F[D],!~A.indexOf("$set"))A.push("$set")}else if(D==="$set"){if(!B.$set)B[D]=F[D]}else B[D]=F[D]}return this._compiledUpdate=B,B};h.prototype._ensurePath=function(F){if(!this._path){let A=F+"() must be used after where() when called with these arguments";throw new Error(A)}};/*!
|
|
745
|
+
* Permissions
|
|
746
|
+
*/h.permissions=Gy();h._isPermitted=function(F,A){let B=h.permissions[A];if(!B)return!0;return B[F]!==!0};h.prototype._validate=function(F){let A,B;if(F===void 0){if(B=h.permissions[this.op],typeof B!="function")return!0;A=B(this)}else if(!h._isPermitted(F,this.op))A=F;if(A)throw new Error(A+" cannot be used with "+this.op)};h.canMerge=function(F){return F instanceof h||u1.isObject(F)};h.setGlobalTraceFunction=function(F){h.traceFunction=F};/*!
|
|
747
|
+
* Exports.
|
|
748
|
+
*/h.utils=u1;h.env=$q();h.Collection=Ly();h.BaseCollection=LF();wy.exports=Ry=h});var zq=z((TN1,Iy)=>{Iy.exports=function F(A,B){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,Z={};for(let X=0;X<J;++X){let Y=A[X];if(!Y)continue;let $=Y[0]=="-"?0:1;if(!B&&$===0)Y=Y.substring(1);Z[Y]=$}return Z}});var My=z((jN1,Py)=>{Py.exports=function F(A,B){let D=Object.keys(A).map((J)=>Object.keys(A[J])).reduce((J,Z)=>J.concat(Z),[]);return B.filter((J)=>{return Ny(J,D)})};function Ny(F,A){let B=Object.keys(F)[0];if(B==="$and"||B==="$or"){if(!Array.isArray(F[B]))return!1;return F[B].find((Z)=>Ny(Z,A))!=null}let D=B.indexOf("."),J=D===-1?B:B.slice(0,D);return A.find((Z)=>Z.includes("$["+J+"]"))!=null}});var wJ=z((uN1,Ty)=>{/*!
|
|
749
|
+
* ignore
|
|
750
|
+
*/Ty.exports=function F(A){if(typeof A!=="object"||A===null)return!1;let B=Object.keys(A),D=B.length;for(let J=0;J<D;++J)if(B[J][0]==="$")return!0;return!1}});var Uq=z((ON1,jy)=>{var bC1=wJ(),{trustedSymbol:yC1}=k7();jy.exports=function F(A){if(A==null||typeof A!=="object")return A;if(Array.isArray(A)){for(let D of A)F(D);return A}let B=Object.keys(A);for(let D of B){let J=A[D];if(J!=null&&J[yC1])continue;if(D==="$and"||D==="$or"){F(J);continue}if(bC1(J)){let Z=Object.keys(J);if(Z.length===1&&Z[0]==="$eq")continue;A[D]={$eq:A[D]}}}return A}});var Oy=z((kN1,uy)=>{uy.exports=function F(A){if(A==null)return;let B=Object.keys(A);for(let D=0;D<B.length;++D)if(typeof A[B[D]]==="string")A[B[D]]=1}});var xy=z((SN1,Sy)=>{var vC1=d7(),hC1=WJ();/*!
|
|
751
|
+
* ignore
|
|
752
|
+
*/Sy.exports=function F(A,B,D){if(D==null)return;let J=Object.keys(D);if(B=B||{},hC1(A))for(let Z of J){if(!ky(B,Z))A[Z]=1;else if(B[Z]===0)delete A[Z];let X=D[Z]?.refPath;if(typeof X==="string"){if(!ky(B,X))A[X]=1;else if(B[X]===0)delete A[X]}}else if(vC1(A))for(let Z of J){if(B[Z]==null)delete A[Z];let X=D[Z]?.refPath;if(typeof X==="string"&&B[X]==null)delete A[X]}};/*!
|
|
753
|
+
* ignore
|
|
754
|
+
*/function ky(F,A){let B=A.split("."),D=B.length,J=B[0];for(let Z=1;Z<D;++Z){if(F[J]!=null||F[J+".$"]!=null)return!0;J+="."+B[Z]}return F[J]!=null||F[J+".$"]!=null}});var Qq=z((xN1,_y)=>{var fy=h7().modifiedPaths,mC1=C0();_y.exports=function(F,A,B,D){D=D||{};let J=D.setDefaultsOnInsert!=null?D.setDefaultsOnInsert:A.base.options.setDefaultsOnInsert;if(!D.upsert||J===!1)return B;let Z=Object.keys(B||{}),X={},Y={},$=Z.length,G={},E=!1;for(let q=0;q<$;++q)if(Z[q].startsWith("$"))fy(B[Z[q]],"",G),E=!0;if(!E)fy(B,"",G);let C=Object.keys(F),H=C.length;for(let q=0;q<H;++q){let W=C[q],K=F[W];if(K&&typeof K==="object"){let U=Object.keys(K),Q=U.length,L=!1;for(let V=0;V<Q;++V)if(U[V].startsWith("$")){L=!0;break}if(L)continue}X[W]=!0,G[W]=!0}if(D&&D.overwrite&&!E)return B;return A.eachPath(function(q,W){if(W.path==="_id"&&W.options.auto)return;let K=W.getDefault(null,!0);if(dC1(G,q))return;if(typeof K==="undefined")return;if(W.splitPath().includes("$*"))return;if(B=B||{},B.$setOnInsert=B.$setOnInsert||{},mC1(B,q)==null)B.$setOnInsert[q]=K;Y[q]=K}),B};function dC1(F,A){if(F[A])return!0;let B=A.split("."),D=B[0];for(let Z=1;Z<B.length;++Z){if(F[D])return!0;D+="."+B[Z]}let J=Object.keys(F);if(J.length){let Z=A+".";for(let X of J)if(X.slice(0,A.length+1)===Z)return!0}return!1}});var hy=z((fN1,vy)=>{/*!
|
|
755
|
+
* Module dependencies.
|
|
756
|
+
*/var gy=Z9(),cC1=t5(),by=h7().flatten,yy=h7().modifiedPaths;vy.exports=function(F,A,B,D,J){let Z=Object.keys(B||{}),X={},Y={},$={},G={},E=Z.length,C=!1,H={},q,W,K;for(K=0;K<E;++K)if(Z[K].startsWith("$")){if(C=!0,Z[K]==="$push"||Z[K]==="$addToSet"){let b=Object.keys(B[Z[K]]);for(let s=0;s<b.length;++s)if(q=B[Z[K]][b[s]],q&&q.$each)G[b[s]]=(G[b[s]]||[]).concat(q.$each);else G[b[s]]=(G[b[s]]||[]).concat([q]);continue}yy(B[Z[K]],"",H);let u=by(B[Z[K]],null,null,A),k=Object.keys(u),O=k.length;for(let b=0;b<O;++b){let s=cC1(k[b]);if(W=Z[K],s.includes("$"))continue;if(W==="$set"||W==="$setOnInsert"||W==="$pull"||W==="$pullAll")Y[s]=u[k[b]],$[s]=W==="$pull"||W==="$pullAll";else if(W==="$unset")Y[s]=void 0;X[s]=!0}}if(!C)yy(B,"",H),Y=by(B,null,null,A),X=Object.keys(Y);let U=Object.keys(Y),Q=U.length,L=[],V=[],w=[],j=F;function T(u,k){let O=A._getSchema(U[u]);if(O==null)return;if(O.instance==="Mixed"&&O.path!==U[u])return;if(k&&Array.isArray(k.$in))k.$in.forEach((b,s)=>{L.push(function(N1){O.doValidate(b,function(v0){if(v0)v0.path=U[s]+".$in."+s,V.push(v0);N1(null)},j,{updateValidator:!0})})});else{if($[U[u]]&&O.$isMongooseArray)return;if(O.$isMongooseDocumentArrayElement&&k!=null&&k.$__!=null)w.push(U[u]),L.push(function(b){O.doValidate(k,function(s){if(s)if(s.errors)for(let N1 of Object.keys(s.errors)){let v0=s.errors[N1];v0.path=U[u]+"."+N1,V.push(v0)}else s.path=U[u],V.push(s);return b(null)},j,{updateValidator:!0})});else L.push(function(b){for(let s of w)if(U[u].startsWith(s+"."))return b(null);O.doValidate(k,function(s){if(O.schema!=null&&O.schema.options.storeSubdocValidationError===!1&&s instanceof gy)return b(null);if(s)s.path=U[u],V.push(s);b(null)},j,{updateValidator:!0})})}}for(K=0;K<Q;++K)T(K,Y[U[K]]);let M=Object.keys(G);for(let u of M){let k=A._getSchema(u);if(k&&k.$isMongooseDocumentArray)L.push(function(O){k.doValidate(G[u],m(u,V,O),D&&D.context==="query"?F:null)});else{k=A._getSchema(u+".0");for(let O of G[u])L.push(function(b){k.doValidate(O,m(u,V,b),D&&D.context==="query"?F:null,{updateValidator:!0})})}}if(J!=null){let u=L.length;if(u===0)return x(J);for(let k of L)k(function(){if(--u<=0)x(J)});return}return function(u){let k=L.length;if(k===0)return x(u);for(let O of L)O(function(){if(--k<=0)x(u)})};function x(u){if(V.length){let k=new gy(null);for(let O of V)k.addError(O.path,O);return u(k)}u(null)}function m(u,k,O){return function(b){if(b)b.path=u,k.push(b);O(null)}}}});var PJ=z((_N1,ey)=>{/*!
|
|
757
|
+
* Module dependencies.
|
|
758
|
+
*/var RF=q2(),lC1=aB(),Vq=x7(),Q2=C1(),P4=BD(),my=Gb(),dy=Z9(),{applyGlobalMaxTimeMS:wF,applyGlobalDiskUse:IF}=iH(),pC1=jC(),iC1=nH(),nC1=sH(),sC1=q9(),aC1=Mb(),NJ=FF(),rC1=Dq(),_2=Z0(),tC1=K6(),NF=l5(),oC1=y6().internalToObjectOptions,eC1=d7(),FH1=WJ(),AH1=$D(),cy=nb(),py=n2(),a2=Kq(),BH1=zq(),DH1=My(),JH1=Uq(),ZH1=Oy(),XH1=xy(),iy=Qq(),IJ=D9(),YH1=hy(),VF=import.meta.require("util"),a1=J1(),$H1=uD().queryMiddlewareFunctions,GH1=new Set(["allowDiskUse","batchSize","collation","comment","explain","hint","j","lean","limit","maxTimeMS","populate","projection","read","select","skip","slice","sort","tailable","w","writeConcern","wtimeout"]);function v(F,A,B,D){if(!this._mongooseOptions)this._mongooseOptions={};A=A||{},this._transforms=[],this._hooks=new Vq,this._executionStack=null;let J=Object.keys(A);for(let X of J)this._mongooseOptions[X]=A[X];if(D)this.mongooseCollection=D;if(B)this.model=B,this.schema=B.schema;if(this.model&&this.model._mapreduce)this.lean();if(a2.call(this,null,A),D)this.collection(D);if(F)this.find(F);this.options=this.options||{},this.$useProjection=!0;let Z=this&&this.schema&&this.schema.options&&this.schema.options.collation||null;if(Z!=null)this.options.collation=Z}/*!
|
|
759
|
+
* inherit mquery
|
|
760
|
+
*/v.prototype=new a2;v.prototype.constructor=v;v.prototype.count=void 0;v.prototype.findOneAndRemove=void 0;v.base=a2.prototype;/*!
|
|
761
|
+
* Overwrite mquery's `_distinct`, because Mongoose uses that name
|
|
762
|
+
* to store the field to apply distinct on.
|
|
763
|
+
*/Object.defineProperty(v.prototype,"_distinct",{configurable:!0,writable:!0,enumerable:!0,value:void 0});v.use$geoWithin=a2.use$geoWithin;v.prototype.toConstructor=function F(){let A=this.model,B=this.mongooseCollection,D=function(X,Y){if(!(this instanceof D))return new D(X,Y);this._mongooseOptions=_2(J._mongooseOptions),v.call(this,X,Y||null,A,B)};VF.inherits(D,A.Query);let J=D.prototype;J.options={};let Z=Object.assign({},this.options);if(Z.sort!=null)J.sort(Z.sort),delete Z.sort;return J.setOptions(Z),J.op=this.op,J._validateOp(),J._conditions=_2(this._conditions),J._fields=_2(this._fields),J._update=_2(this._update,{flattenDecimals:!1}),J._path=this._path,J._distinct=this._distinct,J._collection=this._collection,J._mongooseOptions=this._mongooseOptions,D};v.prototype.clone=function(){let F=this.model,A=this.mongooseCollection,B=new this.model.Query({},{},F,A),D=Object.assign({},this.options);if(D.sort!=null)B.sort(D.sort),delete D.sort;return B.setOptions(D),B.op=this.op,B._validateOp(),B._conditions=_2(this._conditions),B._fields=_2(this._fields),B._update=_2(this._update,{flattenDecimals:!1}),B._path=this._path,B._distinct=this._distinct,B._collection=this._collection,B._mongooseOptions=this._mongooseOptions,B};v.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let F,A;if(arguments.length===1){let D=arguments[0];if(typeof D==="object"&&!Array.isArray(D)){let J=Object.keys(D),Z=J.length;for(let X=0;X<Z;++X)this.slice(J[X],D[J[X]]);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 B={};return B[F]={$slice:A},this.select(B),this};/*!
|
|
764
|
+
* ignore
|
|
765
|
+
*/var EH1=new Set($H1);v.prototype._validateOp=function(){if(this.op!=null&&!EH1.has(this.op))this.error(new Error('Query has invalid `op`: "'+this.op+'"'))};v.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 B=this._conditions[A]||(this._conditions[A]={});return B.$mod=F,this};v.prototype.limit=function F(A){if(this._validate("limit"),typeof A==="string")try{A=NJ(A)}catch(B){throw new RF("Number",A,"limit")}return this.options.limit=A,this};v.prototype.skip=function F(A){if(this._validate("skip"),typeof A==="string")try{A=NJ(A)}catch(B){throw new RF("Number",A,"skip")}return this.options.skip=A,this};v.prototype.projection=function(F){if(arguments.length===0)return this._fields;return this._fields={},this._userProvidedFields={},this.select(F),this._fields};v.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 B=this._fields||(this._fields={}),D=this._userProvidedFields||(this._userProvidedFields={}),J=void 0;if(this.model!=null&&a1.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))J=this.model.db.options.sanitizeProjection;else if(this.model!=null&&a1.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))J=this.model.base.options.sanitizeProjection;else J=this._mongooseOptions.sanitizeProjection;function Z(X){return typeof X==="string"&&J?X=1:X}if(A=BH1(A,!0),a1.isObject(A)){if(this.selectedInclusively())Object.entries(A).forEach(([X,Y])=>{if(Y){if(B["-"+X]!=null)delete B["-"+X];B[X]=D[X]=Z(Y)}else Object.keys(D).forEach(($)=>{if(cy(X,$))delete B[$],delete D[$]})});else if(this.selectedExclusively())Object.entries(A).forEach(([X,Y])=>{if(!Y){if(B["+"+X]!=null)delete B["+"+X];B[X]=D[X]=Z(Y)}else Object.keys(D).forEach(($)=>{if(cy(X,$))delete B[$],delete D[$]})});else{let X=Object.keys(A);for(let Y=0;Y<X.length;++Y){let $=A[X[Y]],G=X[Y];B[G]=Z($),D[G]=Z($)}}return this}throw new TypeError("Invalid select() argument. Must be string or object.")};v.prototype.schemaLevelProjections=function F(A){return this._mongooseOptions.schemaLevelProjections=A,this};v.prototype.sanitizeProjection=function F(A){return this._mongooseOptions.sanitizeProjection=A,this};v.prototype.read=function F(A,B){if(typeof A==="string")A=pC1(A),this.options.readPreference={mode:A,tags:B};else this.options.readPreference=A;return this};v.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}(${VF.inspect(this._conditions)})`;if(this.op==="distinct")return`${this.model.modelName}.distinct('${this._distinct}', ${VF.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}(${VF.inspect(this._conditions)}, ${VF.inspect(this._update)})`;return`${this.model.modelName}.${this.op}()`};v.prototype.session=function F(A){if(A==null)delete this.options.session;return this.options.session=A,this};v.prototype.writeConcern=function F(A){if(A==null)return delete this.options.writeConcern,this;return this.options.writeConcern=A,this};v.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};v.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};v.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};v.prototype.getOptions=function(){return this.options};v.prototype.setOptions=function(F,A){if(A){if(this._mongooseOptions=F&&_2(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 B=F.populate;delete F.populate;let D=B.length;for(let J=0;J<D;++J)this.populate(B[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)ZH1(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=NJ(F.limit)}catch(B){throw new RF("Number",F.limit,"limit")}if(typeof F.skip==="string")try{F.skip=NJ(F.skip)}catch(B){throw new RF("Number",F.skip,"skip")}for(let B of Object.keys(F))if(GH1.has(B)){let D=Array.isArray(F[B])?F[B]:[F[B]];this[B].apply(this,D)}else this.options[B]=F[B];return this};v.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};v.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};v.prototype.maxTimeMS=function(F){return this.options.maxTimeMS=F,this};v.prototype.getFilter=function(){return this._conditions};v.prototype.getQuery=function(){return this._conditions};v.prototype.setQuery=function(F){this._conditions=F};v.prototype.getUpdate=function(){return this._update};v.prototype.setUpdate=function(F){this._update=F};v.prototype._fieldsForExec=function(){if(this._fields==null)return null;if(Object.keys(this._fields).length===0)return null;return _2(this._fields)};v.prototype._updateForExec=function(){let F=_2(this._update,{transform:!1,depopulate:!0}),A=Object.keys(F),B=A.length,D={};while(B--){let J=A[B];if(J[0]!=="$"){if(!D.$set)if(F.$set)D.$set=F.$set;else D.$set={};if(D.$set[J]=F[J],A.splice(B,1),!~A.indexOf("$set"))A.push("$set")}else if(J==="$set"){if(!D.$set)D[J]=F[J]}else D[J]=F[J]}return D};v.prototype._optionsForExec=function(F){let A=_2(this.options);if(delete A.populate,F=F||this.model,!F)return A;iC1(F.schema,A),nC1(F.schema,A);let B=this.model?.db?.base.transactionAsyncLocalStorage?.getStore();if(!this.options.hasOwnProperty("session")&&B?.session!=null)A.session=B.session;let D=F&&F.schema&&F.schema.options&&F.schema.options.read;if(!("readPreference"in A)&&D)A.readPreference=D;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};v.prototype.lean=function(F){return this._mongooseOptions.lean=arguments.length?F:!0,this};v.prototype.set=function(F,A){if(typeof F==="object"){let B=Object.keys(F);for(let D of B)this.set(D,F[D]);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};v.prototype.get=function F(A){let B=this._update;if(B==null)return;let D=B.$set;if(D==null)return B[A];if(a1.hasUserDefinedProperty(B,A))return B[A];if(a1.hasUserDefinedProperty(D,A))return D[A];return};v.prototype.error=function F(A){if(arguments.length===0)return this._error;return this._error=A,this};v.prototype._unsetCastError=function F(){if(this._error==null)return;if(this._error!=null&&!(this._error instanceof RF))return;return this.error(null)};v.prototype.mongooseOptions=function(F){if(arguments.length>0)this._mongooseOptions=F;return this._mongooseOptions};v.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)JH1(this._conditions);try{this.cast(this.model),this._unsetCastError()}catch(A){this.error(A)}};/*!
|
|
766
|
+
* ignore
|
|
767
|
+
*/function ny(F){try{aC1(F)}catch(A){F.error(A)}}v.prototype._find=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let A=this._mongooseOptions,B=this,D=B._userProvidedFields||{};wF(this.options,this.model.db.options,this.model.base.options),IF(this.options,this.model.db.options,this.model.base.options);let J=Object.assign({},{session:this&&this.options&&this.options.session||null,lean:A.lean||null}),Z=this._optionsForExec(),X=this._conditions,Y=Z.projection,$=await this.mongooseCollection.find(X,Z);if(Z.explain)return $.explain();let G=await $.toArray();if(G.length===0)return G;if(!A.populate){let C=B.schema.options.versionKey;if(A.lean&&A.lean.versionKey===!1&&C)G.forEach((H)=>{if(C in H)delete H[C]});return A.lean?ay(B.model.schema,G,null,J):B._completeMany(G,Y,D,J)}let E=NF.preparePopulationOptionsMQ(B,A);if(A.lean)return B.model.populate(G,E);return G=await B._completeMany(G,Y,D,J),await this.model.populate(G,E),G};v.prototype.find=function(F){if(typeof F==="function"||typeof arguments[1]==="function")throw new Q2("Query.prototype.find() no longer accepts a callback");if(this.op="find",a2.canMerge(F))this.merge(F),PF(this);else if(F!=null)this.error(new P4(F,"filter","find"));return this};v.prototype.merge=function(F){if(!F)return this;let A={overwrite:!0};if(F instanceof v){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);a1.merge(this._conditions,F._conditions,A)}if(F._fields)this._fields||(this._fields={}),a1.merge(this._fields,F._fields,A);if(F.options)this.options||(this.options={}),a1.merge(this.options,F.options,A);if(F._update)this._update||(this._update={}),a1.mergeClone(this._update,F._update);if(F._distinct)this._distinct=F._distinct;return a1.merge(this._mongooseOptions,F._mongooseOptions),this}else if(this.model!=null&&F instanceof this.model.base.Types.ObjectId)return a1.merge(this._conditions,{_id:F},A),this;else if(F&&F.$__)F=F.toObject(oC1);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((B)=>a1.isPOJO(B)?a1.merge({},B):B))}if(Array.isArray(F.$or)){if(A.omit.$or=!0,!this._conditions)this._conditions={};this._conditions.$or=(this._conditions.$or||[]).concat(F.$or.map((B)=>a1.isPOJO(B)?a1.merge({},B):B))}return a1.merge(this._conditions,F,A),this};v.prototype.collation=function(F){if(this.options==null)this.options={};return this.options.collation=F,this};v.prototype._completeOne=function(F,A,B,D){if(!F&&!this.options.includeResultMetadata)return D(null,null);let J=this.model,Z=this._userProvidedFields||{},X=this._mongooseOptions,Y=this.options;if(!Y.lean&&X.lean)Y.lean=X.lean;if(Y.explain)return D(null,F);if(!X.populate){let G=this.schema.options.versionKey;if(X.lean&&X.lean.versionKey===!1&&G){if(G in F)delete F[G]}return X.lean?Rq(J.schema,F,null,A,Y,D):ly(J,F,A,Y,B,Z,null,D)}let $=NF.preparePopulationOptionsMQ(this,this._mongooseOptions);if(X.lean)return J.populate(F,$).then((G)=>{Rq(J.schema,G,null,A,Y,D)},(G)=>{D(G)});ly(J,F,A,Y,B,Z,[],(G,E)=>{if(G!=null)return D(G);J.populate(E,$).then((C)=>{D(null,C)},(C)=>{D(C)})})};v.prototype._completeMany=async function F(A,B,D,J){let Z=this.model;return Promise.all(A.map((X)=>new Promise((Y,$)=>{let G=X;if(X=NF.createModel(Z,X,B,D),J.session!=null)X.$session(J.session);X.$init(G,J,(E)=>{if(E!=null)return $(E);Y(X)})})))};v.prototype._findOne=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();wF(this.options,this.model.db.options,this.model.base.options),IF(this.options,this.model.db.options,this.model.base.options);let A=this._optionsForExec(),B=await this.mongooseCollection.findOne(this._conditions,A);return new Promise((D,J)=>{this._completeOne(B,null,A.projection,(Z,X)=>{if(Z)return J(Z);D(X)})})};v.prototype.findOne=function(F,A,B){if(typeof F==="function"||typeof A==="function"||typeof B==="function"||typeof arguments[3]==="function")throw new Q2("Query.prototype.findOne() no longer accepts a callback");if(this.op="findOne",this._validateOp(),B)this.setOptions(B);if(A)this.select(A);if(a2.canMerge(F))this.merge(F),PF(this);else if(F!=null)this.error(new P4(F,"filter","findOne"));return this};v.prototype._countDocuments=async function F(){this._applyTranslateAliases();try{this.cast(this.model)}catch(D){this.error(D)}if(this.error())throw this.error();wF(this.options,this.model.db.options,this.model.base.options),IF(this.options,this.model.db.options,this.model.base.options);let A=this._optionsForExec(),B=this._conditions;return this.mongooseCollection.countDocuments(B,A)};/*!
|
|
768
|
+
* If `translateAliases` option is set, call `Model.translateAliases()`
|
|
769
|
+
* on the following query properties: filter, projection, update, distinct.
|
|
770
|
+
*/v.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]}};v.prototype._estimatedDocumentCount=async function F(){if(this.error())throw this.error();let A=this._optionsForExec();return this.mongooseCollection.estimatedDocumentCount(A)};v.prototype.estimatedDocumentCount=function(F){if(typeof F==="function"||typeof arguments[1]==="function")throw new Q2("Query.prototype.estimatedDocumentCount() no longer accepts a callback");if(this.op="estimatedDocumentCount",this._validateOp(),F!=null)this.setOptions(F);return this};v.prototype.countDocuments=function(F,A){if(typeof F==="function"||typeof A==="function"||typeof arguments[2]==="function")throw new Q2("Query.prototype.countDocuments() no longer accepts a callback");if(this.op="countDocuments",this._validateOp(),a2.canMerge(F))this.merge(F);if(A!=null)this.setOptions(A);return this};v.prototype.__distinct=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();wF(this.options,this.model.db.options,this.model.base.options),IF(this.options,this.model.db.options,this.model.base.options);let A=this._optionsForExec();return this.mongooseCollection.distinct(this._distinct,this._conditions,A)};v.prototype.distinct=function(F,A,B){if(typeof F==="function"||typeof A==="function"||typeof B==="function"||typeof arguments[3]==="function")throw new Q2("Query.prototype.distinct() no longer accepts a callback");if(this.op="distinct",this._validateOp(),a2.canMerge(A))this.merge(A),PF(this);else if(A!=null)this.error(new P4(A,"filter","distinct"));if(F!=null)this._distinct=F;if(B!=null)this.setOptions(B);return this};v.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 B=this.options.sort;if(typeof F==="string"){let D=F.indexOf(" ")===-1?[F]:F.split(" ");for(let J of D){let Z=J[0]=="-"?-1:1;if(Z===-1)J=J.slice(1);if(IJ.has(J))continue;B[J]=Z}}else if(Array.isArray(F))for(let D of F){if(!Array.isArray(D))throw new TypeError("Invalid sort() argument, must be array of arrays");let J=""+D[0];if(IJ.has(J))continue;B[J]=Lq(D[1],J)}else if(typeof F==="object"&&F!=null&&!(F instanceof Map))for(let D of Object.keys(F)){if(IJ.has(D))continue;B[D]=Lq(F[D],D)}else if(F instanceof Map)for(let D of F.keys()){if(D=""+D,IJ.has(D))continue;B[D]=Lq(F.get(D),D)}else if(F!=null)throw new TypeError("Invalid sort() argument. Must be a string, object, array, or map.");return this};/*!
|
|
771
|
+
* Convert sort values
|
|
772
|
+
*/function Lq(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+" }")}v.prototype.deleteOne=function F(A,B){if(typeof A==="function"||typeof B==="function"||typeof arguments[2]==="function")throw new Q2("Query.prototype.deleteOne() no longer accepts a callback");if(this.op="deleteOne",this.setOptions(B),a2.canMerge(A))this.merge(A),PF(this);else if(A!=null)this.error(new P4(A,"filter","deleteOne"));return this};v.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)};v.prototype.deleteMany=function(F,A){if(typeof F==="function"||typeof A==="function"||typeof arguments[2]==="function")throw new Q2("Query.prototype.deleteMany() no longer accepts a callback");if(this.setOptions(A),this.op="deleteMany",a2.canMerge(F))this.merge(F),PF(this);else if(F!=null)this.error(new P4(F,"filter","deleteMany"));return this};v.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 ly(F,A,B,D,J,Z,X,Y){if(D.includeResultMetadata&&A==null)return $(null),null;NF.createModelAndInit(F,A,J,Z,D,X,$);function $(G,E){if(G)return Y(G);if(D.includeResultMetadata){if(A&&E){if(D.session!=null)E.$session(D.session);B.value=E}else B.value=null;return Y(null,B)}if(D.session!=null)E.$session(D.session);Y(null,E)}}function PF(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}v.prototype.findOneAndUpdate=function(F,A,B){if(typeof F==="function"||typeof A==="function"||typeof B==="function"||typeof arguments[3]==="function")throw new Q2("Query.prototype.findOneAndUpdate() no longer accepts a callback");switch(this.op="findOneAndUpdate",this._validateOp(),this._validate(),arguments.length){case 2:B=void 0;break;case 1:A=F,F=B=void 0;break}if(a2.canMerge(F))this.merge(F);else if(F!=null)this.error(new P4(F,"filter","findOneAndUpdate"));if(A)this._mergeUpdate(A);if(B=B?_2(B):{},B.projection)this.select(B.projection),delete B.projection;if(B.fields)this.select(B.fields),delete B.fields;let D=this&&this.model&&this.model.base&&this.model.base.options&&this.model.base.options.returnOriginal;if(B.new==null&&B.returnDocument==null&&B.returnOriginal==null&&D!=null)B.returnOriginal=D;return this.setOptions(B),this};v.prototype._findOneAndUpdate=async function F(){if(this._applyTranslateAliases(),this._castConditions(),ny(this),this.error())throw this.error();if(wF(this.options,this.model.db.options,this.model.base.options),IF(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);sy(A),this._update=this._castUpdate(this._update);let B=Object.assign({},A,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});if(this._update=iy(this._conditions,this.model.schema,this._update,B),!this._update||Object.keys(this._update).length===0)if(A.upsert){let X=_2(this._update);delete X._id,this._update={$set:X}}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(wq(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 X of this._transforms)J=X(J);let Z=!A.includeResultMetadata?J:J.value;return new Promise((X,Y)=>{this._completeOne(Z,J,A.projection,($,G)=>{if($)return Y($);X(G)})})};v.prototype.findOneAndDelete=function(F,A){if(typeof F==="function"||typeof A==="function"||typeof arguments[2]==="function")throw new Q2("Query.prototype.findOneAndDelete() no longer accepts a callback");if(this.op="findOneAndDelete",this._validateOp(),this._validate(),a2.canMerge(F))this.merge(F);return A&&this.setOptions(A),this};v.prototype._findOneAndDelete=async function F(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let A=this.options.includeResultMetadata,B=this._conditions,D=this._optionsForExec(this.model),J=await this.mongooseCollection.findOneAndDelete(B,D);for(let X of this._transforms)J=X(J);let Z=!A?J:J.value;return new Promise((X,Y)=>{this._completeOne(Z,J,D.projection,($,G)=>{if($)return Y($);X(G)})})};v.prototype.findOneAndReplace=function(F,A,B){if(typeof F==="function"||typeof A==="function"||typeof B==="function"||typeof arguments[4]==="function")throw new Q2("Query.prototype.findOneAndReplace() no longer accepts a callback");if(this.op="findOneAndReplace",this._validateOp(),this._validate(),a2.canMerge(F))this.merge(F);else if(F!=null)this.error(new P4(F,"filter","findOneAndReplace"));if(A!=null)this._mergeUpdate(A);B=B||{};let D=this&&this.model&&this.model.base&&this.model.base.options&&this.model.base.options.returnOriginal;if(B.new==null&&B.returnDocument==null&&B.returnOriginal==null&&D!=null)B.returnOriginal=D;return this.setOptions(B),this};v.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,B=this._optionsForExec();sy(B);let D=this.options.includeResultMetadata,J={skipId:!0};if("strict"in this._mongooseOptions)J.strict=this._mongooseOptions.strict;let Z=wq(this,"runValidators",!1);try{let $=new this.model(this._update,null,J);if(Z)await $.validate();else if($.$__.validationError)throw $.$__.validationError;this._update=$.toBSON()}catch($){if($ instanceof dy)throw $;let G=new dy;throw G.errors[$.path]=$,G}let X=await this.mongooseCollection.findOneAndReplace(A,this._update,B);for(let $ of this._transforms)X=$(X);let Y=!D?X:X.value;return new Promise(($,G)=>{this._completeOne(Y,X,B.projection,(E,C)=>{if(E)return G(E);$(C)})})};function sy(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 wq(F,A,B){let D=F._optionsForExec(F.model);if(A in D)return D[A];if(A in F.model.base.options)return F.model.base.options[A];return B}/*!
|
|
773
|
+
* ignore
|
|
774
|
+
*/function Rq(F,A,B,D,J,Z){if(J.lean&&typeof J.lean.transform==="function"){J.lean.transform(A);for(let X=0;X<F.childSchemas.length;X++){let Y=B?B+"."+F.childSchemas[X].model.path:F.childSchemas[X].model.path,$=F.childSchemas[X].schema,G=py.get(Y,A);if(G==null)continue;if(Array.isArray(G))for(let E=0;E<G.length;E++)J.lean.transform(G[E]);else J.lean.transform(G);Rq($,G,Y,D,J)}if(Z)return Z(null,A);else return}if(J.includeResultMetadata)return Z(null,D);return Z(null,A)}/*!
|
|
775
|
+
* ignore
|
|
776
|
+
*/function ay(F,A,B,D){if(D.lean&&typeof D.lean.transform==="function"){for(let J of A)D.lean.transform(J);for(let J=0;J<F.childSchemas.length;J++){let Z=B?B+"."+F.childSchemas[J].model.path:F.childSchemas[J].model.path,X=F.childSchemas[J].schema,Y=py.get(Z,A);if(Y==null)continue;Y=Y.flat();for(let $=0;$<Y.length;$++)D.lean.transform(Y[$]);ay(X,Y,Z,D)}}return A}v.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 v){if(Array.isArray(this._update))throw new Error("Cannot mix array and object updates");if(F._update)a1.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");a1.mergeClone(this._update,F)}};/*!
|
|
777
|
+
* ignore
|
|
778
|
+
*/async function Iq(F){if(this._applyTranslateAliases(),this._castConditions(),ny(this),this.error()!=null)throw this.error();let A=this._conditions,B=this._optionsForExec(this.model);this._update=_2(this._update,B);let D=F==="replaceOne";if(D)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 Z=Object.assign({},B,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});this._update=iy(this._conditions,this.model.schema,this._update,Z)}if(Array.isArray(B.arrayFilters))B.arrayFilters=DH1(this._update,B.arrayFilters);if(wq(this,"runValidators",!1))await this.validate(this._update,B,D);if(this._update.toBSON)this._update=this._update.toBSON();return this.mongooseCollection[F](A,this._update,B)}v.prototype.validate=async function F(A,B,D){if(typeof arguments[3]==="function")throw new Q2("Query.prototype.validate() no longer accepts a callback");if(await ty(this,"validate"),D)await A.$validate();else await new Promise((J,Z)=>{YH1(this,this.model.schema,A,B,(X)=>{if(X!=null)return Z(X);J()})});await ry(this,null,null,"validate")};v.prototype._updateMany=async function F(){return Iq.call(this,"updateMany")};v.prototype._updateOne=async function F(){return Iq.call(this,"updateOne")};v.prototype._replaceOne=async function F(){return Iq.call(this,"replaceOne")};v.prototype.updateMany=function(F,A,B,D){if(typeof B==="function")D=B,B=null;else if(typeof A==="function")D=A,A=F,F={},B=null;else if(typeof F==="function")D=F,F=void 0,A=void 0,B=void 0;else if(typeof F==="object"&&!A&&!B&&!D)A=F,F=void 0,B=void 0,D=void 0;return Nq(this,"updateMany",F,A,B,D)};v.prototype.updateOne=function(F,A,B,D){if(typeof B==="function")D=B,B=null;else if(typeof A==="function")D=A,A=F,F={},B=null;else if(typeof F==="function")D=F,F=void 0,A=void 0,B=void 0;else if(typeof F==="object"&&!A&&!B&&!D)A=F,F=void 0,B=void 0,D=void 0;return Nq(this,"updateOne",F,A,B,D)};v.prototype.replaceOne=function(F,A,B,D){if(typeof B==="function")D=B,B=null;else if(typeof A==="function")D=A,A=F,F={},B=null;else if(typeof F==="function")D=F,F=void 0,A=void 0,B=void 0;else if(typeof F==="object"&&!A&&!B&&!D)A=F,F=void 0,B=void 0,D=void 0;return Nq(this,"replaceOne",F,A,B,D)};function Nq(F,A,B,D,J,Z){if(F.op=A,F._validateOp(),D=D||{},J!=null){if("strict"in J)F._mongooseOptions.strict=J.strict}if(!(B instanceof v)&&B!=null&&B.toString()!=="[object Object]")F.error(new P4(B,"filter",A));else F.merge(B);if(a1.isObject(J))F.setOptions(J);if(F._mergeUpdate(D),Z)return F.exec(Z),F;return F}v.prototype.transform=function(F){return this._transforms.push(F),this};v.prototype.orFail=function(F){return this.transform((A)=>{switch(this.op){case"find":if(A.length===0)throw $8(F,this);break;case"findOne":if(A==null)throw $8(F,this);break;case"replaceOne":case"updateMany":case"updateOne":if(A&&A.matchedCount===0)throw $8(F,this);break;case"findOneAndDelete":case"findOneAndUpdate":case"findOneAndReplace":if(this.options.includeResultMetadata&&A!=null&&A.value==null)throw $8(F,this);if(!this.options.includeResultMetadata&&A==null)throw $8(F,this);break;case"deleteMany":case"deleteOne":if(A.deletedCount===0)throw $8(F,this);break;default:break}return A}),this};function $8(F,A){if(typeof F==="function")F=F.call(A);if(F==null)F=new lC1(A.getQuery(),A.model.modelName);return F}v.prototype.isPathSelectedInclusive=function(F){return AH1(this._fields,F)};v.prototype.exec=async function F(A){if(typeof A==="function"||arguments.length>=2&&typeof arguments[1]==="function")throw new Q2("Query.prototype.exec() no longer accepts a callback");if(typeof A==="string")this.op=A;if(this.op==null)throw new Q2("Query must have `op` before executing");if(this.model==null)throw new Q2("Query must have an associated model before executing");if(this._validateOp(),!this.op)return;if(this.options&&this.options.sort){if(Object.keys(this.options.sort).includes(""))throw new Error('Invalid field "" passed to sort()')}let B="_"+this.op;if(this.op==="distinct")B="__distinct";if(this._executionStack!=null){let X=this.toString();if(X.length>60)X=X.slice(0,60)+"...";let Y=new Q2("Query was already executed: "+X);throw Y.originalStack=this._executionStack,Y}else this._executionStack=new Error().stack;let D=null;try{await HH1(this)}catch(X){if(X instanceof Vq.skipWrappedFunction)D=X;else throw X}let J,Z=null;try{await ty(this),J=D?D.args[0]:await this[B]();for(let X of this._transforms)J=X(J)}catch(X){if(X instanceof Vq.skipWrappedFunction)J=X.args[0];else Z=X}return J=await ry(this,J,Z),await CH1(this),J};/*!
|
|
779
|
+
* ignore
|
|
780
|
+
*/function CH1(F){return new Promise((A,B)=>{F._hooks.execPost("exec",F,[],{},(D)=>{if(D)return B(D);A()})})}/*!
|
|
781
|
+
* ignore
|
|
782
|
+
*/function ry(F,A,B,D){if(F._queryMiddleware==null){if(B!=null)throw B;return A}return new Promise((J,Z)=>{let X=B?{error:B}:{};F._queryMiddleware.execPost(D||F.op,F,[A],X,(Y,$)=>{if(Y)return Z(Y);J($)})})}/*!
|
|
783
|
+
* ignore
|
|
784
|
+
*/function HH1(F){return new Promise((A,B)=>{F._hooks.execPre("exec",F,[],(D)=>{if(D!=null)return B(D);A()})})}/*!
|
|
785
|
+
* ignore
|
|
786
|
+
*/function ty(F,A){if(F._queryMiddleware==null)return;return new Promise((B,D)=>{F._queryMiddleware.execPre(A||F.op,F,[],(J)=>{if(J!=null)return D(J);B()})})}v.prototype.then=function(F,A){return this.exec().then(F,A)};v.prototype.catch=function(F){return this.exec().then(null,F)};v.prototype.finally=function(F){return this.exec().finally(F)};v.prototype[Symbol.toStringTag]=function F(){return`Query { ${this.op} }`};v.prototype.pre=function(F){return this._hooks.pre("exec",F),this};v.prototype.post=function(F){return this._hooks.post("exec",F),this};v.prototype._castUpdate=function F(A){let B=this.schema,D=B.options.discriminatorKey,J=B._baseSchema?B._baseSchema:B;if(this._mongooseOptions.overwriteDiscriminatorKey&&A[D]!=null&&J.discriminators){let X=Object.values(J.discriminators).find((Y)=>Y.discriminatorMapping.value===A[D]);if(X!=null)B=X}let Z;if("upsert"in this.options)Z=this.options.upsert;return rC1(B,A,{strict:this._mongooseOptions.strict,upsert:Z,arrayFilters:this.options.arrayFilters,overwriteDiscriminatorKey:this._mongooseOptions.overwriteDiscriminatorKey,overwriteImmutable:this._mongooseOptions.overwriteImmutable},this,this._conditions)};v.prototype.populate=function(){if(!Array.from(arguments).some(Boolean))return this;let F=a1.populate.apply(null,arguments);if(this.options!=null){let D=this.options.readConcern,J=this.options.readPreference;for(let Z of F){if(D!=null&&(Z&&Z.options&&Z.options.readConcern)==null)Z.options=Z.options||{},Z.options.readConcern=D;if(J!=null&&(Z&&Z.options&&Z.options.readPreference)==null)Z.options=Z.options||{},Z.options.readPreference=J}}let A=this._mongooseOptions;if(A.lean!=null){let D=A.lean;for(let J of F)if((J&&J.options&&J.options.lean)==null)J.options=J.options||{},J.options.lean=D}if(!a1.isObject(A.populate))A.populate={};let B=A.populate;for(let D of F){let J=D.path;if(B[J]&&B[J].populate&&D.populate)D.populate=B[J].populate.concat(D.populate);B[D.path]=D}return this};v.prototype.getPopulatedPaths=function F(){let A=this._mongooseOptions.populate||{},B=Object.keys(A);for(let D of Object.keys(A)){let J=A[D];if(!Array.isArray(J.populate))continue;oy(B,J.populate,D+".")}return B};/*!
|
|
787
|
+
* ignore
|
|
788
|
+
*/function oy(F,A,B){for(let D of A){if(F.push(B+D.path),!Array.isArray(D.populate))continue;oy(F,D.populate,B+D.path+".")}}v.prototype.cast=function(F,A){A||(A=this._conditions),F=F||this.model;let B=F.schema.options.discriminatorKey;if(A!=null&&A.hasOwnProperty(B))F=tC1(F.discriminators,A[B])||F;let D={upsert:this.options&&this.options.upsert};if(this.options){if("strict"in this.options)D.strict=this.options.strict;if("strictQuery"in this.options)D.strictQuery=this.options.strictQuery}if("sanitizeFilter"in this._mongooseOptions)D.sanitizeFilter=this._mongooseOptions.sanitizeFilter;try{return sC1(F.schema,A,D,this)}catch(J){if(typeof J.setModel==="function")J.setModel(F);throw J}};v.prototype._castFields=function F(A){let B,D,J,Z,X;if(A){J=Object.keys(A),D=[];for(let Y=0;Y<J.length;++Y)if(Z=J[Y],A[Z].$elemMatch)B||(B={}),B[Z]=A[Z],D.push(Z)}if(B){try{X=this.cast(this.model,B)}catch(Y){return Y}for(let Y=0;Y<D.length;++Y)Z=D[Y],A[Z]=X[Z]}return A};v.prototype._applyPaths=function F(){if(!this.model)return;this._fields=this._fields||{};let A=void 0;if(this.model!=null&&a1.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))A=this.model.db.options.sanitizeProjection;else if(this.model!=null&&a1.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))A=this.model.base.options.sanitizeProjection;else A=this._mongooseOptions.sanitizeProjection;if(this._mongooseOptions.schemaLevelProjections??!0)NF.applyPaths(this._fields,this.model.schema,A);let D=!0;if("selectPopulatedPaths"in this.model.base.options)D=this.model.base.options.selectPopulatedPaths;if("selectPopulatedPaths"in this.model.schema.options)D=this.model.schema.options.selectPopulatedPaths;if(D)XH1(this._fields,this._userProvidedFields,this._mongooseOptions.populate)};v.prototype.cursor=function F(A){if(A)this.setOptions(A);try{this.cast(this.model)}catch(B){return new my(this)._markError(B)}return new my(this)};v.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 B of Object.keys(A))if(B==="awaitData"||B==="awaitdata")this.options.awaitData=!!A[B];else this.options[B]=A[B];return this.options.tailable=arguments.length?!!F:!0,this};v.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(a1.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"&&a1.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 v.base.near.apply(this,F)};v.prototype.nearSphere=function(){return this._mongooseOptions.nearSphere=!0,this.near.apply(this,arguments),this};if(Symbol.asyncIterator!=null)v.prototype[Symbol.asyncIterator]=function(){return this.cursor().transformNull()._transformForAsyncIterator()};v.prototype.box=function(F,A){if(!Array.isArray(F)&&a1.isObject(F))A=F.ur,F=F.ll;return v.base.box.call(this,F,A)};v.prototype.center=v.base.circle;v.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;v.base.circle.apply(this,arguments)};v.prototype.selectedInclusively=function F(){return FH1(this._fields)};v.prototype.selectedExclusively=function F(){return eC1(this._fields)};v.prototype.model;/*!
|
|
789
|
+
* Export
|
|
790
|
+
*/ey.exports=v});var Dv=z((gN1,Bv)=>{/*!
|
|
791
|
+
* Module dependencies.
|
|
792
|
+
*/var MJ=C1(),Av=import.meta.require("stream").Readable,qH1=cH(),WH1=r2(),KH1=import.meta.require("util");function g2(F){Av.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this.agg=F,this._transforms=[];let A=F._model;delete F.options.cursor.useMongooseAggCursor,this._mongooseOptions={},zH1(A,this,F)}KH1.inherits(g2,Av);/*!
|
|
793
|
+
* ignore
|
|
794
|
+
*/function zH1(F,A,B){if(!F.collection.buffer)F.hooks.execPre("aggregate",B,function(){if(typeof B.options?.cursor?.transform==="function")A._transforms.push(B.options.cursor.transform);A.cursor=F.collection.aggregate(B._pipeline,B.options||{}),A.emit("cursor",A.cursor)});else F.collection.emitter.once("queue",function(){F.hooks.execPre("aggregate",B,function(){if(typeof B.options?.cursor?.transform==="function")A._transforms.push(B.options.cursor.transform);A.cursor=F.collection.aggregate(B._pipeline,B.options||{}),A.emit("cursor",A.cursor)})})}g2.prototype._read=function(){let F=this;TJ(this,function(A,B){if(A)return F.emit("error",A);if(!B){F.push(null),F.cursor.close(function(D){if(D)return F.emit("error",D)});return}F.push(B)})};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";g2.prototype[Symbol.asyncIterator]=function(){throw new MJ(F)}}Object.defineProperty(g2.prototype,"map",{value:function(F){return this._transforms.push(F),this},enumerable:!0,configurable:!0,writable:!0});g2.prototype._markError=function(F){return this._error=F,this};g2.prototype.close=async function F(){if(typeof arguments[0]==="function")throw new MJ("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")};g2.prototype._destroy=function F(A,B){let D=null;if(!this.cursor)D=new Promise((J)=>{this.once("cursor",J)});else D=Promise.resolve();return D.then(()=>this.cursor.close()).then(()=>{this._closed=!0,B()}).catch((J)=>{B(J)}),this};g2.prototype.next=async function F(){if(typeof arguments[0]==="function")throw new MJ("AggregationCursor.prototype.next() no longer accepts a callback");return new Promise((A,B)=>{TJ(this,(D,J)=>{if(D!=null)return B(D);A(J)})})};g2.prototype.eachAsync=function(F,A){if(typeof arguments[2]==="function")throw new MJ("AggregationCursor.prototype.eachAsync() no longer accepts a callback");let B=this;if(typeof A==="function")A={};return A=A||{},qH1(function(D){return TJ(B,D)},F,A)};if(Symbol.asyncIterator!=null)g2.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()};/*!
|
|
795
|
+
* ignore
|
|
796
|
+
*/g2.prototype._transformForAsyncIterator=function(){if(this._transforms.indexOf(Fv)===-1)this.map(Fv);return this};/*!
|
|
797
|
+
* ignore
|
|
798
|
+
*/g2.prototype.transformNull=function(F){if(arguments.length===0)F=!0;return this._mongooseOptions.transformNull=F,this};/*!
|
|
799
|
+
* ignore
|
|
800
|
+
*/function Fv(F){return F==null?{done:!0}:{value:F,done:!1}}g2.prototype.addCursorFlag=function(F,A){let B=this;return UH1(this,function(){B.cursor.addCursorFlag(F,A)}),this};/*!
|
|
801
|
+
* ignore
|
|
802
|
+
*/function UH1(F,A){if(F.cursor)return A();F.once("cursor",function(){A()})}function TJ(F,A){let B=A;if(F._transforms.length)B=function(D,J){if(D||J===null&&!F._mongooseOptions.transformNull)return A(D,J);A(D,F._transforms.reduce(function(Z,X){return X(Z)},J))};if(F._error)return WH1(function(){B(F._error)});if(F.cursor)return F.cursor.next().then((D)=>{if(!D)return B(null,null);B(null,D)},(D)=>B(D));else F.once("cursor",function(){TJ(F,A)})}Bv.exports=g2});var Pq=z((bN1,Jv)=>{Jv.exports=function F(A,B,D){let J=B&&B.discriminatorMapping;if(D=D||"",J&&!J.isRoot){let Z=A,X=(D.length>0?D+".":D)+J.key,Y=J.value;if(Z[0]!=null&&Z[0].$match&&(Z[0].$match[X]===void 0||Z[0].$match[X]===Y))Z[0].$match[X]=Y;else if(Z[0]!=null&&Z[0].$geoNear)Z[0].$geoNear.query=Z[0].$geoNear.query||{},Z[0].$geoNear.query[X]=Y;else if(Z[0]!=null&&Z[0].$search)if(Z[1]&&Z[1].$match!=null)Z[1].$match[X]=Z[1].$match[X]||Y;else{let $={};$[X]=Y,Z.splice(1,0,{$match:$})}else{let $={};$[X]=Y,Z.unshift({$match:$})}}}});var Xv=z((yN1,Zv)=>{Zv.exports=function F(A){if(!Array.isArray(A))return;for(let B of A){if(B==null)continue;let D=B.$group||B.$bucket||B.$bucketAuto;if(D!=null)for(let Z of Object.keys(D))QH1(D[Z]);let J=Object.keys(B)[0];if(J&&typeof B[J]==="object"){let Z=B[J];for(let X of Object.keys(Z))if(Z[X]!=null&&Z[X].$function!=null&&typeof Z[X].$function.body==="function")Z[X].$function.body=Z[X].$function.body.toString()}if(B.$facet!=null)for(let Z of Object.keys(B.$facet))F(B.$facet[Z])}};function QH1(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 jq=z((vN1,Cv)=>{/*!
|
|
803
|
+
* Module dependencies
|
|
804
|
+
*/var Gv=Dv(),Mq=C1(),Ev=PJ(),{applyGlobalMaxTimeMS:LH1,applyGlobalDiskUse:VH1}=iH(),RH1=Z0(),wH1=C2(),Tq=Pq(),IH1=Xv(),Yv=J1(),NH1=Ev.prototype.read,PH1=Ev.prototype.readConcern,$v=new Set(["$$DESCEND","$$PRUNE","$$KEEP"]);function V1(F,A){if(this._pipeline=[],this._model=A,this.options={},arguments.length===1&&Array.isArray(F))this.append.apply(this,F)}V1.prototype.options;V1.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};V1.prototype.append=function(){let F=arguments.length===1&&Array.isArray(arguments[0])?arguments[0]:[...arguments];if(!F.every(MH1))throw new Error("Arguments must be aggregate pipeline operators");return this._pipeline=this._pipeline.concat(F),this};V1.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)})};V1.prototype.project=function(F){let A={};if(typeof F==="object"&&!Array.isArray(F))Object.keys(F).forEach(function(B){A[B]=F[B]});else if(arguments.length===1&&typeof F==="string")F.split(/\s+/).forEach(function(B){if(!B)return;let D=B[0]==="-"?0:1;if(D===0)B=B.substring(1);A[B]=D});else throw new Error("Invalid project() argument. Must be string or object");return this.append({$project:A})};V1.prototype.near=function(F){let A={};return A.$geoNear=F,this.append(A)};/*!
|
|
805
|
+
* define methods
|
|
806
|
+
*/"group match skip limit out densify fill".split(" ").forEach(function(F){V1.prototype[F]=function(A){let B={};return B["$"+F]=A,this.append(B)}});V1.prototype.unwind=function(){let F=[...arguments],A=[];for(let B of F)if(B&&typeof B==="object")A.push({$unwind:B});else if(typeof B==="string")A.push({$unwind:B[0]==="$"?B:"$"+B});else throw new Error('Invalid arg "'+B+'" to unwind(), must be string or object');return this.append.apply(this,A)};V1.prototype.replaceRoot=function(F){let A;if(typeof F==="string")A=F.startsWith("$")?F:"$"+F;else A=F;return this.append({$replaceRoot:{newRoot:A}})};V1.prototype.count=function(F){return this.append({$count:F})};V1.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')};V1.prototype.lookup=function(F){return this.append({$lookup:F})};V1.prototype.graphLookup=function(F){let A={};if(F){if(!Yv.isObject(F))throw new TypeError("Invalid graphLookup() argument. Must be an object.");Yv.mergeClone(A,F);let B=A.startWith;if(B&&typeof B==="string")A.startWith=A.startWith.startsWith("$")?A.startWith:"$"+A.startWith}return this.append({$graphLookup:A})};V1.prototype.sample=function(F){return this.append({$sample:{size:F}})};V1.prototype.sort=function(F){let A={};if(wH1(F)==="Object"){let B=["desc","descending",-1];Object.keys(F).forEach(function(D){if(F[D]instanceof Object&&F[D].$meta){A[D]=F[D];return}A[D]=B.indexOf(F[D])===-1?1:-1})}else if(arguments.length===1&&typeof F==="string")F.split(/\s+/).forEach(function(B){if(!B)return;let D=B[0]==="-"?-1:1;if(D===-1)B=B.substring(1);A[B]=D});else throw new TypeError("Invalid sort() argument. Must be a string or object.");return this.append({$sort:A})};V1.prototype.unionWith=function(F){return this.append({$unionWith:F})};V1.prototype.read=function(F,A){return NH1.call(this,F,A),this};V1.prototype.readConcern=function(F){return PH1.call(this,F),this};V1.prototype.redact=function(F,A,B){if(arguments.length===3){if(typeof A==="string"&&!$v.has(A)||typeof B==="string"&&!$v.has(B))throw new Error("If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP");F={$cond:{if:F,then:A,else:B}}}else if(arguments.length!==1)throw new TypeError("Invalid arguments");return this.append({$redact:F})};V1.prototype.explain=async function F(A){if(typeof A==="function"||typeof arguments[1]==="function")throw new Mq("Aggregate.prototype.explain() no longer accepts a callback");let B=this._model;if(!this._pipeline.length)throw new Error("Aggregate has empty pipeline");Tq(this._pipeline,this._model.schema),await new Promise((X,Y)=>{B.hooks.execPre("aggregate",this,($)=>{if($){let G={error:$};return B.hooks.execPost("aggregate",this,[null],G,(E)=>{Y(E)})}else X()})});let D=B.collection.aggregate(this._pipeline,this.options);if(A==null)A=!0;let J=null;try{J=await D.explain(A)}catch(X){await new Promise((Y,$)=>{let G={error:X};B.hooks.execPost("aggregate",this,[null],G,(E)=>{if(E)return $(E);return Y()})})}let Z={error:null};return await new Promise((X,Y)=>{B.hooks.execPost("aggregate",this,[J],Z,($)=>{if($)return Y($);return X()})}),J};V1.prototype.allowDiskUse=function(F){return this.options.allowDiskUse=F,this};V1.prototype.hint=function(F){return this.options.hint=F,this};V1.prototype.session=function(F){if(F==null)delete this.options.session;else this.options.session=F;return this};V1.prototype.option=function(F){for(let A in F)this.options[A]=F[A];return this};V1.prototype.cursor=function(F){return this.options.cursor=F||{},new Gv(this)};V1.prototype.collation=function(F){return this.options.collation=F,this};V1.prototype.facet=function(F){return this.append({$facet:F})};V1.prototype.search=function(F){return this.append({$search:F})};V1.prototype.pipeline=function(){return this._pipeline};V1.prototype.exec=async function F(){if(!this._model)throw new Error("Aggregate not bound to any Model");if(typeof arguments[0]==="function")throw new Mq("Aggregate.prototype.exec() no longer accepts a callback");let A=this._model,B=this._model.collection;LH1(this.options,A.db.options,A.base.options),VH1(this.options,A.db.options,A.base.options);let D=this.model()?.db?.base.transactionAsyncLocalStorage?.getStore();if(!this.options.hasOwnProperty("session")&&D?.session!=null)this.options.session=D.session;if(this.options&&this.options.cursor)return new Gv(this);if(Tq(this._pipeline,this._model.schema),IH1(this._pipeline),await new Promise((Y,$)=>{A.hooks.execPre("aggregate",this,(G)=>{if(G){let E={error:G};return A.hooks.execPost("aggregate",this,[null],E,(C)=>{$(C)})}else Y()})}),!this._pipeline.length)throw new Mq("Aggregate has empty pipeline");let J=RH1(this.options||{}),Z;try{Z=await(await B.aggregate(this._pipeline,J)).toArray()}catch(Y){await new Promise(($,G)=>{let E={error:Y};A.hooks.execPost("aggregate",this,[null],E,(C)=>{if(C)return G(C);$()})})}let X={error:null};return await new Promise((Y,$)=>{A.hooks.execPost("aggregate",this,[Z],X,(G)=>{if(G)return $(G);return Y()})}),Z};V1.prototype.then=function(F,A){return this.exec().then(F,A)};V1.prototype.catch=function(F){return this.exec().then(null,F)};V1.prototype.finally=function(F){return this.exec().finally(F)};if(Symbol.asyncIterator!=null)V1.prototype[Symbol.asyncIterator]=function(){return this.cursor({useMongooseAggCursor:!0}).transformNull()._transformForAsyncIterator()};/*!
|
|
807
|
+
* Helpers
|
|
808
|
+
*/function MH1(F){if(typeof F!=="object"||F===null)return!1;let A=Object.keys(F);return A.length===1&&A[0][0]==="$"}V1._prepareDiscriminatorPipeline=Tq;/*!
|
|
809
|
+
* Exports
|
|
810
|
+
*/Cv.exports=V1});var qv=z((hN1,Hv)=>{/*!
|
|
811
|
+
* Module dependencies.
|
|
812
|
+
*/var TH1=W2();class uq extends TH1{constructor(F,A,B,D){let J=F.map((Z)=>Z.message).join(", ");if(J.length>200)J=J.slice(0,200)+"...";super(`${D} failed with ${F.length} Mongoose validation errors: ${J}`);this.validationErrors=F,this.results=A,this.rawResult=B,this.operation=D}}Object.defineProperty(uq.prototype,"name",{value:"MongooseBulkWriteError"});/*!
|
|
813
|
+
* exports
|
|
814
|
+
*/Hv.exports=uq});var Kv=z((mN1,Wv)=>{var jH1=Z0();class Oq{constructor(F){if(F==null)return;Object.assign(this,jH1(F))}}Oq.prototype.__subdocs=null;Wv.exports=Oq});var Uv=z((dN1,zv)=>{zv.exports=function F(A,B){let D=Object.keys(B.paths),J=D.length;for(let Z=0;Z<J;++Z){let X="",Y=D[Z],$=B.paths[Y],G=$.splitPath(),E=G.length,C=A;for(let H=0;H<E;++H){if(C==null)break;let q=G[H];if(X+=(!X.length?"":".")+q,H===E-1){if(typeof C[q]!=="undefined"){if($.$isSingleNested)F(C[q],$.caster.schema);else if($.$isMongooseDocumentArray&&Array.isArray(C[q]))C[q].forEach((K)=>F(K,$.schema));break}let W=$.getDefault(A,!1,{skipCast:!0});if(typeof W!=="undefined"){if(C[q]=W,$.$isSingleNested)F(W,$.caster.schema);else if($.$isMongooseDocumentArray&&Array.isArray(W))W.forEach((K)=>F(K,$.schema))}}else{if(C[q]==null)C[q]={};C=C[q]}}}}});var Sq=z((cN1,Qv)=>{Qv.exports=kq;function kq(F,A=new WeakSet,B=!1){if(A.has(F))return;A.add(F);for(let D of Object.keys(F.paths)){let J=F.paths[D];if(!J.schema)continue;if(kq(J.schema,A),!J.schema._applyDiscriminators)continue;if(J._appliedDiscriminators&&!B)continue;for(let Z of J.schema._applyDiscriminators.keys()){let{schema:X,options:Y}=J.schema._applyDiscriminators.get(Z);kq(X,A),J.discriminator(Z,X,B?{...Y,overwriteExisting:!0}:Y)}J._appliedDiscriminators=!0}}});var Vv=z((lN1,Lv)=>{var uH1=C0(),OH1=J1();Lv.exports=function F(A,B){let D=xq();function J(Z,X){Object.defineProperty(A.prototype,Z,{get:function(){let Y={};for(let $ in X.methods[Z])Y[$]=X.methods[Z][$].bind(this);return Y},configurable:!0})}for(let Z of Object.keys(B.methods)){let X=B.methods[Z];if(B.tree.hasOwnProperty(Z))throw new Error('You have a method and a property in your schema both named "'+Z+'"');if(typeof X==="function"&&D.prototype[Z]===X){delete B.methods[Z];continue}if(B.reserved[Z]&&!uH1(B,`methodOptions.${Z}.suppressWarning`,!1))OH1.warn(`mongoose: the method name "${Z}" 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('${Z}', fn, { suppressWarning: true })\`.`);if(typeof X==="function")A.prototype[Z]=X;else J(Z,B)}A.$appliedMethods=!0;for(let Z of Object.keys(B.paths)){let X=B.paths[Z];if(X.$isSingleNested&&!X.caster.$appliedMethods)F(X.caster,X.schema);if(X.$isMongooseDocumentArray&&!X.Constructor.$appliedMethods)F(X.Constructor,X.schema)}}});var Iv=z((pN1,wv)=>{var Rv=_E(),kH1=d7(),SH1=WJ(),OJ=J1().isPOJO;wv.exports=function F(A,B,D){if(B==null)return A;if(A==null)return A;let J=null;if(SH1(B))J=!1;else if(kH1(B))J=!0;if(J==null)return A;else if(J)return D=D||Rv(B),jJ(A,B,D);else return D=D||Rv(B),uJ(A,B,D)};function jJ(F,A,B,D,J){if(F==null||typeof F!=="object")return F;if(Array.isArray(F))return F.map((X)=>jJ(X,A,B,D,J));let Z={...F};D=J?D||{}:A;for(let X of Object.keys(Z)){let Y=J?J+"."+X:X;if(A.hasOwnProperty(Y)||D.hasOwnProperty(X))if(OJ(A[Y])||OJ(D[X]))Z[X]=jJ(Z[X],A,B,D[X],Y);else delete Z[X];else if(B[Y])Z[X]=jJ(Z[X],A,B,D[X],Y)}return Z}function uJ(F,A,B,D,J){if(F==null||typeof F!=="object")return F;if(Array.isArray(F))return F.map((X)=>uJ(X,A,B,D,J));let Z={...F};D=J?D||{}:A;for(let X of Object.keys(Z)){let Y=J?J+"."+X:X;if(A.hasOwnProperty(Y)||D.hasOwnProperty(X)){if(OJ(A[Y])||OJ(D[X]))Z[X]=uJ(Z[X],A,B,D[X],Y);continue}else if(B[Y])Z[X]=uJ(Z[X],A,B,D[X],Y);else delete Z[X]}return Z}});var Pv=z((iN1,Nv)=>{Nv.exports=function F(A){let B=!1;for(let D of Object.keys(A))if(A[D]==="text")B=!0;return B}});var Tv=z((nN1,Mv)=>{var xH1=Pv();Mv.exports=function F(A,B,D){if(xH1(A))return;if(D.hasOwnProperty("collation")&&!B.hasOwnProperty("collation"))B.collation=D.collation}});var uv=z((sN1,jv)=>{var fH1=eB(),{queryMiddlewareFunctions:_H1,aggregateMiddlewareFunctions:gH1,modelMiddlewareFunctions:bH1,documentMiddlewareFunctions:yH1}=uD(),vH1=Array.from(new Set([..._H1,...gH1,...bH1,...yH1]));jv.exports=function F(A,B,D){let J={useErrorHandlers:!0,numCallbackParams:1};A.$__insertMany=B.createWrapper("insertMany",A.$__insertMany,A,J),B=B.filter((Z)=>{if(vH1.indexOf(Z.name)!==-1)return!!Z.model;return Z.model!==!1});for(let Z of Object.keys(D))if(B.hasHooks(Z)){let X=A[Z];A[Z]=function(){let Y=arguments.length,$=Y>0?arguments[Y-1]:null,G=typeof $==="function"?$:null,E=Array.prototype.slice.call(arguments,0,G==null?Y:Y-1);return fH1(G,(C)=>{B.execPre(Z,A,E,function(H){if(H!=null)return C(H);let q=0,W=X.apply(A,E.concat(K));if(W!=null&&typeof W.then==="function")W.then((U)=>K(null,U),(U)=>K(U));function K(U,Q){if(q++>0)return;if(U!=null)return C(U);B.execPost(Z,A,[Q],function(L){if(L!=null)return C(L);C(null,Q)})}})},A.events)}}}});var kv=z((aN1,Ov)=>{Ov.exports=function F(A,B){for(let D in B.statics)A[D]=B.statics[D]}});var gv=z((rN1,_v)=>{var Sv=jD(),hH1=n2();_v.exports=xv;function xv(F,A,B){if(A==null)return A;return mH1(F,A,B),fv(F,A,B)}function mH1(F,A,B){for(let D of F.childSchemas){let J=D.model.path,Z=D.schema;if(!J)continue;let X=hH1.get(J,A);if(X==null||Array.isArray(X)&&X.flat(1/0).length===0)continue;xv(Z,X,B)}}function fv(F,A,B){if(A==null||typeof A!=="object")return;if(Array.isArray(A)){for(let Y of A)fv(F,Y,B);return}if(F.discriminators&&Object.keys(F.discriminators).length>0)for(let Y of Object.keys(F.discriminators)){let $=F.discriminators[Y],G=$.discriminatorMapping.key,E=$.discriminatorMapping.value;if(A[G]==E){F=$;break}}let D=Sv(F.options.timestamps,"createdAt"),J=Sv(F.options.timestamps,"updatedAt"),Z=B?.currentTime,X=null;if(Z!=null)X=Z();else if(F.base?.now)X=F.base.now();else X=new Date;if(D&&A[D]==null&&!B?.isUpdate)A[D]=X;if(J)A[J]=X}});var vv=z((tN1,yv)=>{var dH1=n2();yv.exports=bv;function bv(F,A,B){if(A==null)return A;let D=B,J=null;if(Array.isArray(B)){D=[],J=[];for(let Z of B)if(Z.length===1)J.push(Z[0]);else D.push(Z)}return cH1(F,A,D),fq(F,A,J)}function cH1(F,A,B){let D=!1;for(let J of F.childSchemas){let Z=J.model.path,X=J.schema;if(!Z)continue;let Y=dH1.get(Z,A);if(Y==null||Array.isArray(Y)&&Y.flat(1/0).length===0)continue;let $=null;if(Array.isArray(B)){$=[];for(let G of B)if(G[0]==Z)$.push(G.slice(1));if($.length===0)continue}bv(X,Y,$),D=!0}if(B&&B.length&&!D)fq(F,A,B)}function fq(F,A,B){if(A==null||typeof A!=="object")return;if(Array.isArray(A)){for(let D of A)fq(F,D,B);return}if(F.discriminators&&Object.keys(F.discriminators).length>0)for(let D of Object.keys(F.discriminators)){let J=F.discriminators[D],Z=J.discriminatorMapping.key,X=J.discriminatorMapping.value;if(A[Z]==X){F=J;break}}if(B==null)B=Object.keys(F.virtuals);for(let D of B){if(F.virtuals[D]==null)continue;let J=F.virtuals[D],Z=Array.isArray(D)?D:D.indexOf(".")===-1?[D]:D.split("."),X=A;for(let G=0;G<Z.length-1;++G)X[Z[G]]=Z[G]in X?X[Z[G]]:{},X=X[Z[G]];let Y=J.applyGetters(X[Z[Z.length-1]],A);if(J.options&&(J.options.ref||J.options.refPath)&&Y===void 0)if(J.options.justOne)Y=null;else Y=[];X[Z[Z.length-1]]=Y}}});var kJ=z((oN1,hv)=>{hv.exports=function F(A){if(!(this instanceof F))return new F(A);return this.val=A,this}});var MF=z((eN1,mv)=>{/*!
|
|
815
|
+
* ignore
|
|
816
|
+
*/mv.exports=new WeakMap});var pv=z((FP1,lv)=>{var lH1=Z0(),dv=MF(),pH1=o().modelSymbol,iH1=J1();lv.exports=cv;var SJ=Symbol("mongoose#assignRawDocsToIdStructure#hasArray");function cv(F,A,B,D,J){let Z=[],X=D.isVirtual&&D.justOne&&F.length>1?!1:D.sort&&F.length>1,Y=D.$nullIfNotFound,$,G,E;if(iH1.isMongooseArray(F))F=F.__array;let C=0,H=F.length;if(X&&J&&D[SJ]===void 0){D[SJ]=!1;for(let q in B)if(Array.isArray(B[q])){D[SJ]=!0;break}}for(C=0;C<H;++C){if(E=F[C],Array.isArray(E)){cv(E,A,B,D,!0),Z.push(E);continue}if(E===null&&X===!1){Z.push(E);continue}if(G=String(E),$=A[G],D.clone&&$!=null)if(D.lean){let q=dv.get($);$=lH1($),dv.set($,q)}else $=$.constructor.hydrate($._doc);if(J)if($)if(X){let q=B[G];if(D[SJ])Z.push($);else Z[q]=$}else Z.push($);else if(E!=null&&E[pH1]!=null)Z.push(E);else Z.push(D.retainNullValues||Y?null:E);else Z[C]=$||null}if(F.length=0,Z.length)Z.forEach(function(q,W){F[W]=q})}});var gq=z((AP1,iv)=>{iv.exports=_q;/*!
|
|
817
|
+
* ignore
|
|
818
|
+
*/function _q(F,A){if(F.virtuals[A])return{virtual:F.virtuals[A],path:void 0};let B=A.split("."),D="",J="";for(let Z=0;Z<B.length;++Z){if(D+=(D.length>0?".":"")+B[Z],F.virtuals[D]){if(Z===B.length-1)return{virtual:F.virtuals[D],path:J};continue}if(F.nested[D])continue;if(F.paths[D]&&F.paths[D].schema){F=F.paths[D].schema;let X=B.slice(Z+1).join(".");if(F.virtuals[X]){if(Z===B.length-2)return{virtual:F.virtuals[X],nestedSchemaPath:[J,D].filter((Y)=>!!Y).join(".")};continue}if(Z+1<B.length&&F.discriminators)for(let Y of Object.keys(F.discriminators)){let $=_q(F.discriminators[Y],X);if($!=null){let G=[J,D,$.nestedSchemaPath].filter((E)=>!!E).join(".");return{virtual:$.virtual,nestedSchemaPath:G}}}J+=(J.length>0?".":"")+D,D="";continue}if(F.discriminators)for(let X of Object.keys(F.discriminators)){let Y=_q(F.discriminators[X],A);if(Y)return Y}return null}}});var sv=z((xJ,nv)=>{(function(F,A){typeof xJ==="object"&&typeof nv!=="undefined"?A(xJ):typeof define==="function"&&define.amd?define(["exports"],A):(F=typeof globalThis!=="undefined"?globalThis:F||self,A(F.sift={}))})(xJ,function(F){var A=function(R,I){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,S){P.__proto__=S}||function(P,S){for(var l in S)if(Object.prototype.hasOwnProperty.call(S,l))P[l]=S[l]},A(R,I)};function B(R,I){if(typeof I!=="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");A(R,I);function P(){this.constructor=R}R.prototype=I===null?Object.create(I):(P.prototype=I.prototype,new P)}typeof SuppressedError==="function"&&SuppressedError;var D=function(R){var I="[object "+R+"]";return function(P){return J(P)===I}},J=function(R){return Object.prototype.toString.call(R)},Z=function(R){if(R instanceof Date)return R.getTime();else if(Y(R))return R.map(Z);else if(R&&typeof R.toJSON==="function")return R.toJSON();return R},X=function(R){return R==null?null:R},Y=D("Array"),$=D("Object"),G=D("Function"),E=function(R,I){return R.hasOwnProperty(I)&&!G(R[I])},C=function(R){return R&&(R.constructor===Object||R.constructor===Array||R.constructor.toString()==="function Object() { [native code] }"||R.constructor.toString()==="function Array() { [native code] }")&&!R.toJSON},H=function(R,I){if(R==null&&R==I)return!0;if(R===I)return!0;if(Object.prototype.toString.call(R)!==Object.prototype.toString.call(I))return!1;if(Y(R)){if(R.length!==I.length)return!1;for(var P=0,S=R.length;P<S;P++)if(!H(R[P],I[P]))return!1;return!0}else if($(R)){if(Object.keys(R).length!==Object.keys(I).length)return!1;for(var l in R)if(!H(R[l],I[l]))return!1;return!0}return!1},q=function(R,I,P,S,l,t){var Z1=I[S];if(Y(R)&&isNaN(Number(Z1))&&!E(R,Z1)){for(var U1=0,m0=R.length;U1<m0;U1++)if(!q(R[U1],I,P,S,U1,R))return!1}if(S===I.length||R==null)return P(R,l,t,S===0,S===I.length);return q(R[Z1],I,P,S+1,Z1,R)},W=function(){function R(I,P,S,l){this.params=I,this.owneryQuery=P,this.options=S,this.name=l,this.init()}return R.prototype.init=function(){},R.prototype.reset=function(){this.done=!1,this.keep=!1},R}(),K=function(R){B(I,R);function I(P,S,l,t){var Z1=R.call(this,P,S,l)||this;return Z1.children=t,Z1}return I.prototype.reset=function(){this.keep=!1,this.done=!1;for(var P=0,S=this.children.length;P<S;P++)this.children[P].reset()},I.prototype.childrenNext=function(P,S,l,t,Z1){var U1=!0,m0=!0;for(var b2=0,d6=this.children.length;b2<d6;b2++){var j4=this.children[b2];if(!j4.done)j4.next(P,S,l,t,Z1);if(!j4.keep)m0=!1;if(j4.done){if(!j4.keep)break}else U1=!1}this.done=U1,this.keep=m0},I}(W),U=function(R){B(I,R);function I(P,S,l,t,Z1){var U1=R.call(this,P,S,l,t)||this;return U1.name=Z1,U1}return I}(K),Q=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.next=function(P,S,l,t){this.childrenNext(P,S,l,t)},I}(K),L=function(R){B(I,R);function I(P,S,l,t,Z1){var U1=R.call(this,S,l,t,Z1)||this;return U1.keyPath=P,U1.propop=!0,U1._nextNestedValue=function(m0,b2,d6,j4,Jd){return U1.childrenNext(m0,b2,d6,j4,Jd),!U1.done},U1}return I.prototype.next=function(P,S,l){q(P,this.keyPath,this._nextNestedValue,0,S,l)},I}(K),V=function(R,I){if(R instanceof Function)return R;if(R instanceof RegExp)return function(S){var l=typeof S==="string"&&R.test(S);return R.lastIndex=0,l};var P=Z(R);return function(S){return I(P,Z(S))}},w=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.init=function(){this._test=V(this.params,this.options.compare)},I.prototype.next=function(P,S,l){if(!Array.isArray(l)||l.hasOwnProperty(S)){if(this._test(P,S,l))this.done=!0,this.keep=!0}},I}(W),j=function(R,I,P){return new w(R,I,P)},T=function(R){return function(I,P,S,l){return R(I,P,S,l)}},M=function(R){return T(function(I,P,S,l){var t=typeof Z(I),Z1=R(I);return new w(function(U1){var m0=X(U1);return typeof Z(m0)===t&&Z1(m0)},P,S,l)})},x=function(R,I,P,S){var l=S.operations[R];if(!l)m(R);return l(I,P,S,R)},m=function(R){throw new Error("Unsupported operation: ".concat(R))},u=function(R,I){for(var P in R)if(I.operations.hasOwnProperty(P)||P.charAt(0)==="$")return!0;return!1},k=function(R,I,P,S,l){if(u(I,l)){var t=b(I,P,l),Z1=t[0],U1=t[1];if(U1.length)throw new Error("Property queries must contain only operations, or exact objects.");return new L(R,I,S,l,Z1)}return new L(R,I,S,l,[new w(I,S,l)])},O=function(R,I,P){if(I===void 0)I=null;var S=P===void 0?{}:P,l=S.compare,t=S.operations,Z1={compare:l||H,operations:Object.assign({},t||{})},U1=b(R,null,Z1),m0=U1[0],b2=U1[1],d6=[];if(m0.length)d6.push(new L([],R,I,Z1,m0));if(d6.push.apply(d6,b2),d6.length===1)return d6[0];return new Q(R,I,Z1,d6)},b=function(R,I,P){var S=[],l=[];if(!C(R))return S.push(new w(R,R,P)),[S,l];for(var t in R)if(P.operations.hasOwnProperty(t)){var Z1=x(t,R[t],R,P);if(Z1){if(!Z1.propop&&I&&!P.operations[I])throw new Error("Malformed query. ".concat(t," cannot be matched against property."))}if(Z1!=null)S.push(Z1)}else if(t.charAt(0)==="$")m(t);else l.push(k(t.split("."),R[t],t,R,P));return[S,l]},s=function(R){return function(I,P,S){return R.reset(),R.next(I,P,S),R.keep}},N1=function(R,I){if(I===void 0)I={};return s(O(R,null,I))},v0=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.init=function(){this._test=V(this.params,this.options.compare)},I.prototype.reset=function(){R.prototype.reset.call(this),this.keep=!0},I.prototype.next=function(P){if(this._test(P))this.done=!0,this.keep=!1},I}(W),h1=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.init=function(){if(!this.params||typeof this.params!=="object")throw new Error("Malformed query. $elemMatch must by an object.");this._queryOperation=O(this.params,this.owneryQuery,this.options)},I.prototype.reset=function(){R.prototype.reset.call(this),this._queryOperation.reset()},I.prototype.next=function(P){if(Y(P)){for(var S=0,l=P.length;S<l;S++){this._queryOperation.reset();var t=P[S];this._queryOperation.next(t,S,P,!1),this.keep=this.keep||this._queryOperation.keep}this.done=!0}else this.done=!1,this.keep=!1},I}(W),T0=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.init=function(){this._queryOperation=O(this.params,this.owneryQuery,this.options)},I.prototype.reset=function(){R.prototype.reset.call(this),this._queryOperation.reset()},I.prototype.next=function(P,S,l,t){this._queryOperation.next(P,S,l,t),this.done=this._queryOperation.done,this.keep=!this._queryOperation.keep},I}(W),A2=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.init=function(){},I.prototype.next=function(P){if(Y(P)&&P.length===this.params)this.done=!0,this.keep=!0},I}(W),h0=function(R){if(R.length===0)throw new Error("$and/$or/$nor must be a nonempty array")},Z3=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!1,P}return I.prototype.init=function(){var P=this;h0(this.params),this._ops=this.params.map(function(S){return O(S,null,P.options)})},I.prototype.reset=function(){this.done=!1,this.keep=!1;for(var P=0,S=this._ops.length;P<S;P++)this._ops[P].reset()},I.prototype.next=function(P,S,l){var t=!1,Z1=!1;for(var U1=0,m0=this._ops.length;U1<m0;U1++){var b2=this._ops[U1];if(b2.next(P,S,l),b2.keep){t=!0,Z1=b2.keep;break}}this.keep=Z1,this.done=t},I}(W),tm=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!1,P}return I.prototype.next=function(P,S,l){R.prototype.next.call(this,P,S,l),this.keep=!this.keep},I}(Z3),EW=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.init=function(){var P=this,S=Array.isArray(this.params)?this.params:[this.params];this._testers=S.map(function(l){if(u(l,P.options))throw new Error("cannot nest $ under ".concat(P.name.toLowerCase()));return V(l,P.options.compare)})},I.prototype.next=function(P,S,l){var t=!1,Z1=!1;for(var U1=0,m0=this._testers.length;U1<m0;U1++){var b2=this._testers[U1];if(b2(P)){t=!0,Z1=!0;break}}this.keep=Z1,this.done=t},I}(W),om=function(R){B(I,R);function I(P,S,l,t){var Z1=R.call(this,P,S,l,t)||this;return Z1.propop=!0,Z1._in=new EW(P,S,l,t),Z1}return I.prototype.next=function(P,S,l,t){if(this._in.next(P,S,l),Y(l)&&!t){if(this._in.keep)this.keep=!1,this.done=!0;else if(S==l.length-1)this.keep=!0,this.done=!0}else this.keep=!this._in.keep,this.done=!0},I.prototype.reset=function(){R.prototype.reset.call(this),this._in.reset()},I}(W),em=function(R){B(I,R);function I(){var P=R!==null&&R.apply(this,arguments)||this;return P.propop=!0,P}return I.prototype.next=function(P,S,l,t,Z1){if(!Z1)this.done=!0,this.keep=!this.params;else if(l.hasOwnProperty(S)===this.params)this.done=!0,this.keep=!0},I}(W),Fd=function(R){B(I,R);function I(P,S,l,t){var Z1=R.call(this,P,S,l,P.map(function(U1){return O(U1,S,l)}),t)||this;return Z1.propop=!1,h0(P),Z1}return I.prototype.next=function(P,S,l,t){this.childrenNext(P,S,l,t)},I}(U),Ad=function(R){B(I,R);function I(P,S,l,t){var Z1=R.call(this,P,S,l,P.map(function(U1){return O(U1,S,l)}),t)||this;return Z1.propop=!0,Z1}return I.prototype.next=function(P,S,l,t){this.childrenNext(P,S,l,t)},I}(U),CW=function(R,I,P){return new w(R,I,P)},HW=function(R,I,P,S){return new v0(R,I,P,S)},qW=function(R,I,P,S){return new Z3(R,I,P,S)},WW=function(R,I,P,S){return new tm(R,I,P,S)},KW=function(R,I,P,S){return new h1(R,I,P,S)},zW=function(R,I,P,S){return new om(R,I,P,S)},UW=function(R,I,P,S){return new EW(R,I,P,S)},QW=M(function(R){return function(I){return I!=null&&I<R}}),LW=M(function(R){return function(I){return I===R||I<=R}}),VW=M(function(R){return function(I){return I!=null&&I>R}}),RW=M(function(R){return function(I){return I===R||I>=R}}),wW=function(R,I,P){var S=R[0],l=R[1];return new w(function(t){return Z(t)%S===l},I,P)},IW=function(R,I,P,S){return new em(R,I,P,S)},NW=function(R,I,P){return new w(new RegExp(R,I.$options),I,P)},PW=function(R,I,P,S){return new T0(R,I,P,S)},MW={number:function(R){return typeof R==="number"},string:function(R){return typeof R==="string"},bool:function(R){return typeof R==="boolean"},array:function(R){return Array.isArray(R)},null:function(R){return R===null},timestamp:function(R){return R instanceof Date}},TW=function(R,I,P){return new w(function(S){if(typeof R==="string"){if(!MW[R])throw new Error("Type alias does not exist");return MW[R](S)}return S!=null?S instanceof R||S.constructor===R:!1},I,P)},jW=function(R,I,P,S){return new Fd(R,I,P,S)},uW=function(R,I,P,S){return new Ad(R,I,P,S)},OW=function(R,I,P){return new A2(R,I,P,"$size")},kW=function(){return null},SW=function(R,I,P){var S;if(G(R))S=R;else if(!process.env.CSP_ENABLED)S=new Function("obj","return "+R);else throw new Error('In CSP mode, sift does not support strings in "$where" condition');return new w(function(l){return S.bind(l)(l)},I,P)},Bd=Object.freeze({__proto__:null,$Size:A2,$all:uW,$and:jW,$elemMatch:KW,$eq:CW,$exists:IW,$gt:VW,$gte:RW,$in:UW,$lt:QW,$lte:LW,$mod:wW,$ne:HW,$nin:zW,$nor:WW,$not:PW,$options:kW,$or:qW,$regex:NW,$size:OW,$type:TW,$where:SW}),xW=function(R,I,P){var S=P===void 0?{}:P,l=S.compare,t=S.operations;return O(R,I,{compare:l,operations:Object.assign({},Bd,t||{})})},Dd=function(R,I){if(I===void 0)I={};var P=xW(R,null,I);return s(P)};F.$Size=A2,F.$all=uW,F.$and=jW,F.$elemMatch=KW,F.$eq=CW,F.$exists=IW,F.$gt=VW,F.$gte=RW,F.$in=UW,F.$lt=QW,F.$lte=LW,F.$mod=wW,F.$ne=HW,F.$nin=zW,F.$nor=WW,F.$not=PW,F.$options=kW,F.$or=qW,F.$regex=NW,F.$size=OW,F.$type=TW,F.$where=SW,F.EqualsOperation=w,F.createDefaultQueryOperation=xW,F.createEqualsOperation=j,F.createOperationTester=s,F.createQueryOperation=O,F.createQueryTester=N1,F.default=Dd,Object.defineProperty(F,"__esModule",{value:!0})})});var rv=z((BP1,bq)=>{var av=sv();bq.exports=av.default;Object.assign(bq.exports,av)});var Bh=z((DP1,Ah)=>{var nH1=kD(),sH1=kJ(),aH1=pv(),fJ=C0(),rH1=gq(),Fh=MF(),tv=MD(),tH1=mE(),yq=n2(),ov=rv().default,_J=J1(),{populateModelSymbol:oH1}=o();Ah.exports=function F(A){let B=Object.assign({},fJ(A,"allOptions.options.options"),fJ(A,"allOptions.options")),D=Object.assign({},A.options,B,{justOne:A.justOne,isVirtual:A.isVirtual});D.$nullIfNotFound=A.isVirtual;let J=A.populatedModel,Z=[].concat(A.rawIds);A.allIds=[].concat(A.allIds),aH1(A.rawIds,A.rawDocs,A.rawOrder,D);let{docs:X,rawIds:Y,options:$}=A,G=A.count&&A.isVirtual,E,C=0;function H(q){if(++C,G)return q;if(q instanceof sH1)return q.val;if(q===void 0)return q;let W=A.allIds[E];if(A.path.endsWith(".$*"))return TF(q,$,D,W);if(A.justOne===!0&&Array.isArray(q)){let K=[];for(let U of q){let Q=Fh.get(U);if(Q==null||Q===J)K.push(U)}while(q.length>K.length)Array.prototype.pop.apply(q,[]);for(let U=0;U<K.length;++U)q[U]=K[U];return TF(q[0],$,D,W)}else if(A.justOne===!1&&!Array.isArray(q))return TF([q],$,D,W);else if(A.justOne===!0&&!Array.isArray(q)&&Array.isArray(W))return TF(q,$,D,q==null?q:W[C-1]);return TF(q,$,D,W)}for(E=0;E<X.length;++E){C=0;let q=A.path.endsWith(".$*")?A.path.slice(0,-3):A.path,W=yq.get(q,X[E],tv);if(W==null&&!rH1(A.originalModel.schema,q))continue;let K;if(G)K=eH1(Y[E]);else if(Array.isArray(A.match))K=Array.isArray(Y[E])?Y[E].filter((j)=>j==null||ov(A.match[E])(j)):[Y[E]].filter((j)=>j==null||ov(A.match[E])(j))[0];else K=Y[E];let U=A.originalModel.schema,Q=fJ(X[E],"$__",null)!=null,L=Q?W instanceof Map:_J.isPOJO(W);if(L=L&&fJ(U._getSchema(q),"$isSchemaMap"),!A.isVirtual&&L){let j=W instanceof Map?Array.from(W.keys()):Object.keys(W);K=K.reduce((T,M,x)=>{return T.set(j[x],M),T},new Map)}if(Q&&Array.isArray(K)){for(let j of K)if(j!=null&&j.$__!=null)j.$__.parent=X[E]}else if(Q&&K!=null&&K.$__!=null)K.$__.parent=X[E];if(A.isVirtual&&Q){if(X[E].$populated(q,A.justOne?Z[0]:Z,A.allOptions),Array.isArray(K))K=K.map((j)=>j==null?void 0:j);yq.set(q,K,X[E],void 0,H,!1);continue}let V=q.split("."),w=X[E];for(let j=0;j<V.length-1;++j){if(Array.isArray(w)&&!_J.isArrayIndex(V[j]))break;if(V[j]==="$*")break;if(w[V[j]]==null){let T=V.slice(0,j+1).join("."),M=U._getSchema(T);if(K==null&&M!=null&&M.$isMongooseArray)break;w[V[j]]={}}if(w=w[V[j]],typeof w!=="object")break}if(X[E].$__){if(A.allOptions.options[oH1]=A.allOptions.model,X[E].$populated(q,A.unpopulatedValues[E],A.allOptions.options),K!=null&&K.$__!=null)K.$__.wasPopulated={value:A.unpopulatedValues[E]};if(K instanceof Map&&!K.$isMongooseMap)K=new nH1(K,q,X[E],X[E].schema.path(q).$__schemaType)}if(yq.set(q,K,X[E],tv,H,!1),X[E].$__)tH1(X[E],[A.allOptions.options])}};function eH1(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((B)=>B!=null).length;return 1});return F.filter((A)=>A!=null).length}return F==null?0:1}function TF(F,A,B,D){let J=typeof B.transform==="function",Z=J?B.transform:(X)=>X;if(Array.isArray(F)){let X=[],Y=F.length;for(let E=0;E<Y;++E){let C=F[E],H=Array.isArray(D)?D[E]:D;if(!vq(C)&&(!B.retainNullValues||C!=null)&&!J)continue;else if(!B.retainNullValues&&C==null)continue;else if(J)C=Z(vq(C)?C:null,H);if(ev(C,A),X.push(C),A.originalLimit&&X.length>=A.originalLimit)break}let $=X.length;while(F.length>$)Array.prototype.pop.apply(F,[]);let G=0;if(_J.isMongooseArray(F))for(G=0;G<$;++G)F.set(G,X[G],!0);else for(G=0;G<$;++G)F[G]=X[G];return F}if(vq(F)||_J.isPOJO(F))return ev(F,A),Z(F,D);if(F instanceof Map)return F;if(B.justOne===!1)return[];return F==null?Z(F,D):Z(null,D)}function ev(F,A){if(F!=null&&A.excludeId)if(typeof F.$__setValue==="function")delete F._doc._id;else delete F._id}function vq(F){if(F==null)return!1;return Array.isArray(F)||F.$isMongooseMap||F.$__!=null||Fh.has(F)}});var hq=z((JP1,Dh)=>{var Fq1=aH();Dh.exports=function F(A,B,D){if(!D||!(B&&B.upsert))return;if(!Fq1(A)[D])if(B.overwrite)A[D]=0;else{if(!A.$setOnInsert)A.$setOnInsert={};A.$setOnInsert[D]=0}}});var Eh=z((ZP1,Gh)=>{var Aq1=C1(),Bq1=K6(),Jh=OC(),Zh=kC(),jF=q9(),Xh=Dq(),Dq1=Z0(),Yh=hq(),{inspect:Jq1}=import.meta.require("util"),$h=Qq();Gh.exports=function F(A,B,D){let J=A.base.now(),Z=A.base.options.setDefaultsOnInsert;if(B.insertOne)return(X)=>{let Y=G8(A,B.insertOne.document),$=new Y(B.insertOne.document);if(Y.schema.options.timestamps&&gJ(B.insertOne,D))$.initializeTimestamps();if(D.session!=null)$.$session(D.session);let G=Y?.schema?.options?.versionKey;if(G&&$[G]==null)$[G]=0;if(B.insertOne.document=$,D.skipValidation||B.insertOne.skipValidation){X(null);return}B.insertOne.document.$validate().then(()=>{X(null)},(E)=>{X(E,null)})};else if(B.updateOne)return(X)=>{try{if(!B.updateOne.filter)throw new Error("Must provide a filter object.");if(!B.updateOne.update)throw new Error("Must provide an update object.");let Y=G8(A,B.updateOne.filter),$=Y.schema,G=D.strict!=null?D.strict:Y.schema.options.strict,E=Dq1(B.updateOne.update);uF($,B.updateOne.filter);let C=gJ(B.updateOne,D);if(Y.schema.$timestamps!=null&&C){let q=Y.schema.$timestamps.createdAt,W=Y.schema.$timestamps.updatedAt;Zh(J,q,W,E,{})}if(C)Jh(J,E,Y.schema);if((B.updateOne.setDefaultsOnInsert==null?Z:B.updateOne.setDefaultsOnInsert)!==!1)$h(B.updateOne.filter,Y.schema,E,{setDefaultsOnInsert:!0,upsert:B.updateOne.upsert});Yh(E,B.updateOne,Y.schema.options.versionKey),B.updateOne.filter=jF(Y.schema,B.updateOne.filter,{strict:G,upsert:B.updateOne.upsert}),B.updateOne.update=Xh(Y.schema,E,{strict:G,upsert:B.updateOne.upsert,arrayFilters:B.updateOne.arrayFilters,overwriteDiscriminatorKey:B.updateOne.overwriteDiscriminatorKey},Y,B.updateOne.filter)}catch(Y){return X(Y,null)}X(null)};else if(B.updateMany)return(X)=>{try{if(!B.updateMany.filter)throw new Error("Must provide a filter object.");if(!B.updateMany.update)throw new Error("Must provide an update object.");let Y=G8(A,B.updateMany.filter),$=Y.schema,G=D.strict!=null?D.strict:Y.schema.options.strict;if((B.updateMany.setDefaultsOnInsert==null?Z:B.updateMany.setDefaultsOnInsert)!==!1)$h(B.updateMany.filter,Y.schema,B.updateMany.update,{setDefaultsOnInsert:!0,upsert:B.updateMany.upsert});let C=gJ(B.updateMany,D);if(Y.schema.$timestamps!=null&&C){let H=Y.schema.$timestamps.createdAt,q=Y.schema.$timestamps.updatedAt;Zh(J,H,q,B.updateMany.update,{})}if(C)Jh(J,B.updateMany.update,Y.schema);uF($,B.updateMany.filter),Yh(B.updateMany.update,B.updateMany,Y.schema.options.versionKey),B.updateMany.filter=jF(Y.schema,B.updateMany.filter,{strict:G,upsert:B.updateMany.upsert}),B.updateMany.update=Xh(Y.schema,B.updateMany.update,{strict:G,upsert:B.updateMany.upsert,arrayFilters:B.updateMany.arrayFilters,overwriteDiscriminatorKey:B.updateMany.overwriteDiscriminatorKey},Y,B.updateMany.filter)}catch(Y){return X(Y,null)}X(null)};else if(B.replaceOne)return(X)=>{let Y=G8(A,B.replaceOne.filter),$=Y.schema,G=D.strict!=null?D.strict:Y.schema.options.strict;uF($,B.replaceOne.filter);try{B.replaceOne.filter=jF(Y.schema,B.replaceOne.filter,{strict:G,upsert:B.replaceOne.upsert})}catch(H){return X(H,null)}let E=new Y(B.replaceOne.replacement,G,!0);if(Y.schema.options.timestamps&&gJ(B.replaceOne,D))E.initializeTimestamps();if(D.session!=null)E.$session(D.session);let C=Y?.schema?.options?.versionKey;if(C&&E[C]==null)E[C]=0;if(B.replaceOne.replacement=E,D.skipValidation||B.replaceOne.skipValidation){B.replaceOne.replacement=B.replaceOne.replacement.toBSON(),X(null);return}B.replaceOne.replacement.$validate().then(()=>{B.replaceOne.replacement=B.replaceOne.replacement.toBSON(),X(null)},(H)=>{X(H,null)})};else if(B.deleteOne)return(X)=>{let Y=G8(A,B.deleteOne.filter),$=Y.schema;uF($,B.deleteOne.filter);try{B.deleteOne.filter=jF(Y.schema,B.deleteOne.filter)}catch(G){return X(G,null)}X(null)};else if(B.deleteMany)return(X)=>{let Y=G8(A,B.deleteMany.filter),$=Y.schema;uF($,B.deleteMany.filter);try{B.deleteMany.filter=jF(Y.schema,B.deleteMany.filter)}catch(G){return X(G,null)}X(null)};else return(X)=>{let Y=new Aq1(`Invalid op passed to \`bulkWrite()\`: ${Jq1(B)}`);X(Y,null)}};function uF(F,A){if(F==null)return;if(F.discriminatorMapping&&!F.discriminatorMapping.isRoot)A[F.discriminatorMapping.key]=F.discriminatorMapping.value}function G8(F,A){let B=F.schema.options.discriminatorKey;if(A!=null&&A.hasOwnProperty(B))F=Bq1(F.discriminators,A[B])||F;return F}function gJ(F,A){let B=F.timestamps,D=A.timestamps;if(B!=null)return B;else if(D!=null)return D;return!0}});var Wh=z((XP1,qh)=>{var Zq1=kJ(),Xq1=cE(),{trusted:bJ}=k7(),Ch=wJ();qh.exports=function F(A,B,D,J,Z){let X=Yq1(B);if(D.size===1){let Y=Array.from(D)[0],$=J.schema.path(Y);if(Y!=="_id"||!X._id)A=Hh(A,$,Z),X[Y]=bJ({$in:A});else if(Y==="_id"&&X._id){let E=Ch(X[Y])?X[Y]:{$eq:X[Y]};X[Y]={...bJ({$in:A}),...E}}let G=Xq1(Y);for(let E=0;E<G.length-1;++E){let C=G[E];if(X[C]!=null&&X[C].$elemMatch!=null){X[C].$elemMatch[Y.slice(C.length+1)]=bJ({$in:A}),delete X[Y];break}}}else{let Y=[];if(Array.isArray(X.$or))X.$and=[{$or:X.$or},{$or:Y}],delete X.$or;else X.$or=Y;for(let $ of D)if($!=="_id"||!X._id){let G=J.schema.path($);A=Hh(A,G,Z),Y.push({[$]:{$in:A}})}else if($==="_id"&&X._id){let G=Ch(X[$])?X[$]:{$eq:X[$]};X[$]={...bJ({$in:A}),...G}}}return X};function Hh(F,A,B){if(F=F.filter((D)=>!(D instanceof Zq1)),!B)return F;return F.filter((D)=>{try{return A.cast(D),!0}catch(J){return!1}})}function Yq1(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 zh=z((YP1,Kh)=>{function $q1(){return{result:{ok:1,writeErrors:[],writeConcernErrors:[],insertedIds:[],nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[]},insertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,upsertedCount:0,upsertedIds:{},insertedIds:{},n:0}}Kh.exports=$q1});var Vh=z(($P1,Lh)=>{/*!
|
|
819
|
+
* ignore
|
|
820
|
+
*/var Uh=$9(),Gq1=C0(),Eq1=K6(),Qh=MF(),E8=n2(),Cq1=o().populateModelSymbol;Lh.exports=function F(A,B,D,J){let Z=B.path(J),X=D;if(Z)return Z;let Y=B.discriminatorMapping&&B.discriminatorMapping.key;if(Y&&A!=null){if(D!=null&&D[Y]!=null){let E=Eq1(A.discriminators,D[Y]);B=E?E.schema:B}else if(A.discriminators!=null)return Object.keys(A.discriminators).reduce((E,C)=>{let H=A.discriminators[C];return E.concat(F(H,H.schema,null,J))},[])}function $(E,C,H,q){let W=E.length+1,K,U;while(W--){if(U=E.slice(0,W).join("."),K=C.path(U),K==null)continue;if(K.caster){if(K.caster instanceof Uh)return K.caster;let V=null;if(K.schema!=null&&K.schema.discriminators!=null){let w=K.schema.discriminators,j=U+"."+K.schema.options.discriminatorKey,T=H?E8.get(j,H)||[]:[];V=Object.keys(w).reduce(function(M,x){let m=w[x].discriminatorMapping.value;if(D==null||T.indexOf(x)!==-1||T.indexOf(m)!==-1)M.push(w[x]);return M},[])}if(W!==E.length&&K.schema){let w;if(E[W]==="$"){if(W+1===E.length)return K;if(w=$(E.slice(W+1),C,H?E8.get(U,H):null,q.concat(E.slice(0,W))),w)w.$parentSchemaDocArray=w.$parentSchemaDocArray||(K.schema.$isSingleNested?null:K);return w}if(V!=null&&V.length>0){w=[];for(let j of V){let T=$(E.slice(W),j,H?E8.get(U,H):null,q.concat(E.slice(0,W)));if(T!=null){if(T.$parentSchemaDocArray=T.$parentSchemaDocArray||(K.schema.$isSingleNested?null:K),T.$parentSchemaDocArray)w.$parentSchemaDocArray=T.$parentSchemaDocArray;w.push(T)}}return w}else{if(w=$(E.slice(W),K.schema,H?E8.get(U,H):null,q.concat(E.slice(0,W))),w)w.$parentSchemaDocArray=w.$parentSchemaDocArray||(K.schema.$isSingleNested?null:K);return w}}else if(W!==E.length&&K.$isMongooseArray&&K.casterConstructor.$isMongooseArray){let w=K;while(w.$isMongooseArray&&!w.$isMongooseDocumentArray)w=w.casterConstructor;let j=$(E.slice(W),w.schema,null,q.concat(E.slice(0,W)));if(j!=null)return j;if(w.schema.discriminators){let T=[];for(let M of Object.keys(w.schema.discriminators)){let x=w.schema.discriminators[M]||w.schema,m=$(E.slice(W),x,null,q.concat(E.slice(0,W)));if(m!=null)T.push(m)}if(T.length>0)return T}}}else if(K.$isSchemaMap&&K.$__schemaType instanceof Uh)return K.$__schemaType;let Q=q.concat([U]).join(".");if(X!=null&&X.$__&&X.$populated(Q)&&W<E.length){let V=D.$__.populated[Q].options[Cq1];if(V!=null)return $(E.slice(W),V.schema,H?E8.get(U,H):null,q.concat(E.slice(0,W)))}let L=Gq1(X,U);if(L!=null){let V=Array.isArray(L)&&L.length>0?Qh.get(L[0]):Qh.get(L),w=V!=null?V.schema:null;if(w!=null){let j=$(E.slice(W),w,H?E8.get(U,H):null,q.concat(E.slice(0,W)));if(j!=null)return j.$parentSchemaDocArray=j.$parentSchemaDocArray||(w.$isSingleNested?null:w),j}}return K}}let G=J.split(".");for(let E=0;E<G.length;++E)if(G[E]==="$")G[E]="0";return $(G,B,D,[])}});var Mh=z((GP1,Ph)=>{var C8=W2(),Hq1=kJ(),qq1=Z0(),L6=C0(),Wq1=K6(),Kq1=C2(),Rh=Vh(),zq1=gq(),OF=MD(),V9=n2(),yJ=NC(),F2=J1(),cq=o().modelSymbol,mq=o().populateModelSymbol,lq=Y9().schemaMixedSymbol,Uq1=TE();Ph.exports=function F(A,B,D){let J,Z=B.length,X=[],Y=D.model&&D.model.modelName||D.model,$,G,E,C={},H=A.schema;if(D._localModel!=null&&D._localModel.schema.nested[D.path])return[];let q=zq1(A.schema,D.path);if((q==null?null:q.virtual)!=null)return Qq1(A,B,D,q);let K=Rh(A,H,null,D.path);if(K=Array.isArray(K)?K:[K].filter((L)=>L!=null),!(D.strictPopulate===!1||D.options?.strictPopulate===!1)&&K.length===0&&D._localModel!=null)return new Uq1(D._fullPath||D.path);for(let L=0;L<Z;L++){J=B[L];let V=null,w=J!=null&&J.$__!=null?J.$__schema:H;if($=Rh(A,w,J,D.path),$!=null&&$.$isMongooseDocumentArray&&$.options.ref==null&&$.options.refPath==null)continue;if($&&$.$parentSchemaDocArray&&L6(D,"options.sort")!=null)return new C8("Cannot populate with `sort` on path "+D.path+" because it is a subproperty of a document array");E=null;let T=!1,M=null,x=null,m=null;if($!=null&&$.instance==="Embedded"){if($.options.ref){let h1={localField:D.path+"._id",foreignField:"_id",justOne:!0},T0=Q(J,$,Y,A),A2=V9.get(D.path,J),h0=V9.get("_id",A2);pq(A,X,C,T0.modelNames,D,h1,h0,J,x,A2)}continue}if(Array.isArray($)){let h1=$;for(let T0 of h1){let A2,h0;try{h0=Q(J,T0,Y,A),A2=h0.modelNames,T=T||h0.isRefPath,M=M||h0.refPath,V=h0.justOne}catch(Z3){return Z3}if(T&&!h0.isRefPath)continue;if(!A2)continue;E=E||[];for(let Z3 of A2)if(E.indexOf(Z3)===-1)E.push(Z3)}}else{try{let h1=Q(J,$,Y,A);if(E=h1.modelNames,T=h1.isRefPath,M=M||h1.refPath,V=h1.justOne,x=L6($,"options.populate",null),T)m=E,E=Array.from(new Set(E))}catch(h1){return h1}if(!E)continue}let u={},k=D.path,O="_id";if("justOne"in D&&D.justOne!==void 0)V=D.justOne;else if($&&!$[lq]){if(D.path.endsWith("."+$.path)||D.path===$.path)V=Array.isArray($)?$.every((h1)=>!h1.$isMongooseArray):!$.$isMongooseArray}if(!E)continue;u.isVirtual=!1,u.justOne=V,u.localField=k,u.foreignField=O;let b=Ih(J,k,A,D,null,$),s=String(F2.getValue(O,J));D._docs[s]=Array.isArray(b)?b.slice():b;let N1=L6(D,"match",null),v0=typeof N1==="function";if(v0)N1=N1.call(J,J);if(Array.isArray(N1)){for(let h1 of N1)if(h1!=null&&h1.$where)throw new C8("Cannot use $where filter with populate() match")}else if(N1!=null&&N1.$where!=null)throw new C8("Cannot use $where filter with populate() match");if(u.match=N1,u.hasMatchFunction=v0,u.isRefPath=T,u.modelNamesInOrder=m,T)E=Lq1(J,H,u,D,M,b)||E;try{pq(A,X,C,E,D,u,b,J,x)}catch(h1){return h1}}return X;function Q(L,V,w,j){let T,M=!1,x=null,m=V;if(V&&V.instance==="Array")V=V.caster;if(V&&V.$isSchemaMap)V=V.$__schemaType;let u=V&&V.options&&V.options.ref;if(G=V&&V.options&&V.options.refPath,V!=null&&V[lq]&&!u&&!G&&!w)return{modelNames:null};if(w)T=[w];else if(G!=null){if(typeof G==="function"){let k=D.path.slice(0,D.path.length-V.path.length-1),O=V9.get(k,L,OF),b=Array.isArray(O)?F2.array.flatten(O):O?[O]:[];T=new Set;for(let s of b)G=G.call(s,s,D.path),yJ(G,L,D.path,H,D._queryProjection).forEach((N1)=>T.add(N1));T=Array.from(T)}else T=yJ(G,L,D.path,H,D._queryProjection);M=!0}else{let k,O,b,s,N1=j,v0=j.schema.options.discriminatorKey;if(!V&&v0&&(s=F2.getValue(v0,L))){let h1=Wq1(j.discriminators,s)||j;if(h1!=null)N1=h1;else try{N1=iq(j.db,s)}catch(T0){return T0}if(b=N1.schema._getSchema(D.path),b&&b.caster)b=b.caster}else b=V;if(m&&m.path.endsWith(".$*"))x=!m.$isMongooseArray&&!m._arrayPath;else if(b!=null)x=!b.$isMongooseArray&&!b._arrayPath;if((k=L6(b,"options.ref"))!=null)if(b!=null&&typeof k==="function"&&D.path.endsWith("."+b.path)){T=new Set;let h1=D.path.slice(0,D.path.length-b.path.length-1),T0=V9.get(h1,L,OF),A2=Array.isArray(T0)?F2.array.flatten(T0):T0?[T0]:[];for(let h0 of A2)T.add(dq(k,h0));if(A2.length===0)T=[dq(k,L)];else T=Array.from(T)}else k=dq(k,L),T=[k];else if((b=L6(V,"options.refPath"))!=null)if(M=!0,typeof O==="function"){let h1=D.path.slice(0,D.path.length-b.path.length-1),T0=V9.get(h1,L,OF),A2=Array.isArray(T0)?F2.array.flatten(T0):T0?[T0]:[];T=new Set;for(let h0 of A2)O=O.call(h0,h0,D.path),yJ(O,L,D.path,H,D._queryProjection).forEach((Z3)=>T.add(Z3));T=Array.from(T)}else T=yJ(O,L,D.path,H,D._queryProjection)}if(!T)if(D._localModel==null)T=[j.modelName];else return{modelNames:T,justOne:x,isRefPath:M,refPath:G};if(!Array.isArray(T))T=[T];return{modelNames:T,justOne:x,isRefPath:M,refPath:G}}};/*!
|
|
821
|
+
* ignore
|
|
822
|
+
*/function Qq1(F,A,B,D){let J=[],Z={},X=D.virtual;for(let Y of A){let $=null,G={},E,C=D.nestedSchemaPath?D.nestedSchemaPath+".":"";if(typeof B.localField==="string")E=B.localField;else if(typeof X.options.localField==="function")E=C+X.options.localField.call(Y,Y);else if(Array.isArray(X.options.localField))E=X.options.localField.map((L)=>C+L);else E=C+X.options.localField;if(G.count=X.options.count,X.options.skip!=null&&!B.hasOwnProperty("skip"))B.skip=X.options.skip;if(X.options.limit!=null&&!B.hasOwnProperty("limit"))B.limit=X.options.limit;if(X.options.perDocumentLimit!=null&&!B.hasOwnProperty("perDocumentLimit"))B.perDocumentLimit=X.options.perDocumentLimit;let H=X.options.foreignField;if(!E||!H)return new C8(`Cannot populate virtual \`${B.path}\` on model \`${F.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`);if(typeof E==="function")E=E.call(Y,Y);if(typeof H==="function")H=H.call(Y,Y);G.isRefPath=!1;let q=null;if("justOne"in B&&B.justOne!==void 0)q=B.justOne;if($=X._getModelNamesForPopulate(Y),X.options.refPath)q=!!X.options.justOne,G.isRefPath=!0;else if(X.options.ref)q=!!X.options.justOne;G.isVirtual=!0,G.virtual=X,G.justOne=q;let W=L6(G,"virtual.options.match",null)||L6(G,"virtual.options.options.match",null),K=L6(B,"match",null)||W,U=typeof K==="function";if(U)K=K.call(Y,Y,G.virtual);if(Array.isArray(E)&&Array.isArray(H)&&E.length===H.length){K=Object.assign({},K);for(let L=1;L<E.length;++L)K[H[L]]=Nh(V9.get(E[L],Y,OF),F.schema),U=!0;E=E[0],H=H[0]}if(G.localField=E,G.foreignField=H,G.match=K,G.hasMatchFunction=U,Array.isArray(K)){for(let L of K)if(L!=null&&L.$where)throw new C8("Cannot use $where filter with populate() match")}else if(K!=null&&K.$where!=null)throw new C8("Cannot use $where filter with populate() match");let Q=Ih(Y,E,F,B,X);try{pq(F,J,Z,$,B,G,Q,Y)}catch(L){return L}}return J}/*!
|
|
823
|
+
* ignore
|
|
824
|
+
*/function pq(F,A,B,D,J,Z,X,Y,$,G){let E=J.connection!=null?J.connection:F.db;if(G=G===void 0?X:G,Array.isArray(G))G=F2.cloneArrays(G);if(D==null)return;let C=F2.array.flatten(D),H=C.length;while(H--){let q=C[H];if(q==null)continue;let W;if(J.model&&J.model[cq])W=J.model;else if(q[cq])W=q,q=W.modelName;else try{W=iq(E,q)}catch(L){if(X!==void 0)throw L;W=null}let K=X,U=Z.modelNamesInOrder?Z.modelNamesInOrder:D;if(Z.isRefPath&&Array.isArray(X)&&X.length===U.length)K=wh(X,U,q);let Q=J.perDocumentLimit==null?L6(J,"options.perDocumentLimit",null):J.perDocumentLimit;if(!B[q]||Q!=null){let L={model:W};if(Z.isVirtual&&L6(Z.virtual,"options.options"))L.options=qq1(Z.virtual.options.options);else if($!=null)L.options=Object.assign({},$);F2.merge(L,J),J[mq]=W,L[mq]=W,B[q]={model:W,options:L,match:Z.hasMatchFunction?[Z.match]:Z.match,docs:[Y],ids:[K],allIds:[X],unpopulatedValues:[G],localField:new Set([Z.localField]),foreignField:new Set([Z.foreignField]),justOne:Z.justOne,isVirtual:Z.isVirtual,virtual:Z.virtual,count:Z.count,[mq]:W},A.push(B[q])}else if(B[q].localField.add(Z.localField),B[q].foreignField.add(Z.foreignField),B[q].docs.push(Y),B[q].ids.push(K),B[q].allIds.push(X),B[q].unpopulatedValues.push(G),Z.hasMatchFunction)B[q].match.push(Z.match)}}function iq(F,A){if(F.models[A]==null&&F._parent!=null)return iq(F._parent,A);return F.model(A)}function wh(F,A,B){if(!Array.isArray(A))return A===B?Array.isArray(F)?F2.array.flatten(F):[F]:[];if(Array.isArray(F)&&Array.isArray(A))return F.flatMap((D,J)=>wh(D,A[J],B));return[]}/*!
|
|
825
|
+
* ignore
|
|
826
|
+
*/function dq(F,A){if(typeof F==="function"&&!F[cq])return F.call(A,A);return F}/*!
|
|
827
|
+
* ignore
|
|
828
|
+
*/function Ih(F,A,B,D,J,Z){let X=B.schema._getPathType(A),Y=X==="real"?B.schema.path(A):X.schema,$=Y&&Y.getters?Y.getters:[];A=Y!=null&&Y.instance==="Embedded"?A+"._id":A;let G=L6(D,"options",{}),E="getters"in G?G.getters:L6(J,"options.getters",!1);if($.length!==0&&E){let C=F.$__!=null?F:B.hydrate(F),H=F2.getValue(A,F);if(Array.isArray(H)){let q=F2.getValue(A.split(".").slice(0,-1),C);return H.map((W,K)=>Y.applyGetters(W,q[K]))}else return Y.applyGetters(H,C)}else return Nh(V9.get(A,F,OF),Z)}function Nh(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 B=F.__array!=null?F.__array:F;for(let D=0;D<B.length;++D)if(B[D]!=null&&B[D].$__!=null)B[D]=B[D]._doc._id;if(F2.isMongooseArray(F)&&F.$schema())return F.$schema()._castForPopulate(F,F.$parent());return[].concat(F)}if(Kq1(F)==="Object"&&(A==null||A[lq]==null)){let B=[];for(let D of Object.keys(F))B.push(F[D]);return B}if(F instanceof Map)return Array.from(F.values());return F}/*!
|
|
829
|
+
* ignore
|
|
830
|
+
*/function Lq1(F,A,B,D,J,Z){if(!B.isRefPath||J==null)return;let X=J.split("."),Y="",$=void 0;for(let G=0;G<X.length;++G){let E=X[G];Y=Y+(Y.length===0?"":".")+E;let C=A.path(Y);if(C!=null&&C.$isMongooseArray&&C.caster.discriminators!=null&&Object.keys(C.caster.discriminators).length!==0){let H=F2.getValue(Y,F),q=D.path.substring(Y.length+1),W=C.caster.schema.options.discriminatorKey;$=[];for(let K of H){let U=F2.getValue(W,K),Q=C.caster.discriminators[U],L=Q&&Q.schema;if(L==null)continue;let V=L.path(q);if(V==null||V.options.refPath==null){let j=F2.getValue(B.localField.substring(Y.length+1),K);Z.forEach((T,M)=>{if(T===j)Z[M]=Hq1(T)});continue}let w=F2.getValue(X.slice(G+1).join("."),K);$.push(w)}}}return $}});var jh=z((EP1,Th)=>{var Vq1=C0();Th.exports=function F(A){if(Array.isArray(A)){let D=Object.keys(A[0]);return D.length===1&&D[0]==="_id"&&A[0]._id!=="hashed"}if(typeof A!=="object")return!1;let B=Vq1(A,"key",{});return Object.keys(B).length===1&&B.hasOwnProperty("_id")}});var kh=z((CP1,Oh)=>{var vJ=C0(),uh=J1();Oh.exports=function F(A,B,D){if(D.textIndexVersion!=null){delete D.key._fts,delete D.key._ftsx;let Y={...D.weights,...D.key};if(Object.keys(Y).length!==Object.keys(A).length)return!1;for(let $ of Object.keys(Y)){if(!($ in A))return!1;let G=Y[$];if(G!==vJ(B,"weights."+$)&&!(G===1&&vJ(B,"weights."+$)==null))return!1}if(B.default_language!==D.default_language)return D.default_language==="english"&&B.default_language==null;return!0}let J=["unique","partialFilterExpression","sparse","expireAfterSeconds","collation"];for(let Y of J){if(!(Y in B)&&!(Y in D))continue;if(Y==="collation"){if(B[Y]==null||D[Y]==null)return B[Y]==null&&D[Y]==null;let $=Object.keys(B.collation),G=B.collation,E=D.collation;for(let C of $)if(vJ(G,C)!==vJ(E,C))return!1}else if(!uh.deepEqual(B[Y],D[Y]))return!1}let Z=Object.keys(A),X=Object.keys(D.key);if(Z.length!==X.length)return!1;for(let Y=0;Y<Z.length;++Y){if(Z[Y]!==X[Y])return!1;if(!uh.deepEqual(A[Z[Y]],D.key[X[Y]]))return!1}return!0}});var xh=z((HP1,Sh)=>{Sh.exports=function F(A,B){if(B.timeseries==null)return!1;let{timeField:D,metaField:J}=B.timeseries;if(typeof D!=="string"||typeof J!=="string")return!1;return Object.keys(A.key).length===2&&A.key[D]===1&&A.key[J]===1}});var bh=z((qP1,gh)=>{var Rq1=wJ();function wq1(F,A){return _h({baseModelName:F.baseModelName,discriminatorMapping:F.schema.discriminatorMapping,indexes:A,indexesType:"schema"})}function Iq1(F,A){return _h({baseModelName:F.baseModelName,discriminatorMapping:F.schema.discriminatorMapping,indexes:A,indexesType:"db"})}gh.exports={getRelatedSchemaIndexes:wq1,getRelatedDBIndexes:Iq1};function _h({baseModelName:F,discriminatorMapping:A,indexes:B,indexesType:D}){let J=A&&A.key,Z=A&&A.value;if(!J)return B;if(Boolean(F))return B.filter((Y)=>{let $=fh(Y,D);return $&&$[J]===Z});return B.filter((Y)=>{let $=fh(Y,D);return!$||!$[J]||Rq1($[J])&&!("$eq"in $[J])})}function fh(F,A){if(A==="schema"){let B=F[1];return B&&B.partialFilterExpression}return F.partialFilterExpression}});var vh=z((WP1,yh)=>{yh.exports=Nq1;/*!
|
|
831
|
+
* ignore
|
|
832
|
+
*/function Nq1(F,A,B){let D=0,J=0,Z=null;if(A<=0)throw new Error("Limit must be positive");if(F.length===0)return B(null,[]);for(let G=0;G<F.length&&G<A;++G)X();function X(){F[J+D]($(J+D)),++D}let Y=[];function $(G){return(E,C)=>{if(--D,++J,Z!=null)return;if(E!=null)return Z=E,B(Z);if(Y[G]=C,J===F.length)return B(null,Y);else if(J+D<F.length)X()}}}});var mh=z((KP1,hh)=>{hh.exports=function F(A,B,D){if(B==null)return;for(let J=0;J<B.length;++J)if(Array.isArray(B[J]))F(A,B[J],D+"."+J);else A.push(D+"."+J)}});var ih=z((zP1,ph)=>{var dh=C0(),ch=n2(),lh=zq();/*!
|
|
833
|
+
* ignore
|
|
834
|
+
*/ph.exports=function F(A,B,D){let J=lh(dh(B,"select",null),!0)||lh(dh(B,"options.select",null),!0);if(J==null)return;for(let Z of A){if(!J.hasOwnProperty("-"+Z))continue;for(let X of D)if(X.$__!=null)ch.unset(Z,X._doc);else ch.unset(Z,X)}}});var ah=z((UP1,nh)=>{/*!
|
|
835
|
+
* Module dependencies.
|
|
836
|
+
*/var Pq1=C1();class nq extends Pq1{constructor(F,A,B){let D=B?.matchedCount??0,J=B?.insertedCount??0,Z=A.map((Y)=>Y._id).join(", ");if(Z.length>100)Z=Z.slice(0,100)+"...";let X=A.length-D-J;super(`${F}.bulkSave() was not able to update ${X} of the given documents due to incorrect version or optimistic concurrency, document ids: ${Z}`);this.modelName=F,this.documents=A,this.bulkWriteResult=B,this.numDocumentsNotUpdated=X}}Object.defineProperty(nq.prototype,"name",{value:"MongooseBulkSaveIncompleteError"});/*!
|
|
837
|
+
* exports
|
|
838
|
+
*/nh.exports=nq});var xq=z((qm,Wm)=>{/*!
|
|
839
|
+
* Module dependencies.
|
|
840
|
+
*/var Mq1=jq(),Tq1=YE(),J3=O2(),jq1=aB(),sq=import.meta.require("events").EventEmitter,oq=x7(),{MongoBulkWriteError:uq1}=o4(),dJ=qv(),G1=W2(),Oq1=BD(),kq1=LE(),hJ=PJ(),Sq1=Kv(),aq=l7(),rq=Z9(),Dm=KE(),rh=UE(),xq1=DD(),fq1=Uv(),_q1=Sq(),gq1=OD(),Jm=Vv(),bq1=Iv(),yq1=nH(),Zm=Tv(),vq1=uv(),Xm=kv(),hq1=gv(),Ym=sH(),mq1=vv(),dq1=Bh(),cq1=Eh(),c3=Z0(),lq1=Wh(),$m=hq(),th=zh(),pq1=XD(),iq1=tD(),tq=BH(),SF=C0(),nq1=C2(),mJ=K6(),sq1=Mh(),q8=r2(),eq=y6().internalToObjectOptions,FW=jh(),Gm=kh(),aq1=xh(),{getRelatedDBIndexes:rq1,getRelatedSchemaIndexes:tq1}=bh(),AW=MC(),oq1=$D(),eq1=MF(),FW1=vh(),AW1=Pq(),Em=mh(),BW1=ih(),DW1=oH(),oh=w9(),eh=import.meta.require("util"),r1=J1(),JW1=dE(),ZW1=ah(),xF=Symbol("mongoose#Model#collection"),fF=Symbol("mongoose#Model#db"),Cm=o().modelSymbol,kF=Symbol("mongoose#Model#subclassed"),{VERSION_INC:cJ,VERSION_WHERE:Fm,VERSION_ALL:XW1}=J3,YW1=Object.assign({},eq,{bson:!0});function d(F,A,B){if(A instanceof aq)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()`.");J3.call(this,F,A,B)}Object.setPrototypeOf(d.prototype,J3.prototype);d.prototype.$isMongooseModelPrototype=!0;d.prototype.db;d.prototype.collection;d.prototype.$__collection;d.prototype.modelName;d.prototype.$where;d.prototype.baseModelName;d.events;d._middleware;/*!
|
|
841
|
+
* ignore
|
|
842
|
+
*/function Hm(F,A){if(F.$where==null)return;for(let B of Object.keys(F.$where))A[B]=F.$where[B]}/*!
|
|
843
|
+
* ignore
|
|
844
|
+
*/d.prototype.$__handleSave=function(F,A){let B={};if(Ym(this.$__schema,F),typeof F.writeConcern!=="undefined"){if(B.writeConcern={},"w"in F.writeConcern)B.writeConcern.w=F.writeConcern.w;if("j"in F.writeConcern)B.writeConcern.j=F.writeConcern.j;if("wtimeout"in F.writeConcern)B.writeConcern.wtimeout=F.writeConcern.wtimeout}else{if("w"in F)B.w=F.w;if("j"in F)B.j=F.j;if("wtimeout"in F)B.wtimeout=F.wtimeout}if("checkKeys"in F)B.checkKeys=F.checkKeys;let D=this.$session(),J=this[fF].base.transactionAsyncLocalStorage?.getStore();if(D!=null)B.session=D;else if(!F.hasOwnProperty("session")&&J?.session!=null)B.session=J.session;if(this.$isNew){let Y=this.toObject(YW1);if((Y||{})._id===void 0){q8(function(){A(new G1("document must have an _id before saving"))});return}this.$__version(!0,Y),this[xF].insertOne(Y,B).then(($)=>A(null,$),($)=>{H8(this,!0),A($,null)}),this.$__reset(),H8(this,!1),this.$__.inserting=!0;return}this.$__.inserting=!1;let Z=this.$__delta();if(F.pathsToSave)for(let Y in Z[1].$set)if(F.pathsToSave.includes(Y))continue;else if(F.pathsToSave.some(($)=>Y.slice(0,$.length)===$&&Y.charAt($.length)==="."))continue;else delete Z[1].$set[Y];if(Z){if(Z instanceof G1){A(Z);return}let Y=this.$__where(Z[0]);if(Y instanceof G1){A(Y);return}Hm(this,Y);let $=Z[1];if(this.$__schema.options.minimize)for(let G of Object.values($)){if(G==null)continue;for(let E of Object.keys(G)){if(G[E]==null||typeof G[E]!=="object")continue;if(!r1.isPOJO(G[E]))continue;if(JW1(G[E]),Object.keys(G[E]).length===0)delete G[E],$.$unset=$.$unset||{},$.$unset[E]=1}}this[xF].updateOne(Y,$,B).then((G)=>{G.$where=Y,A(null,G)},(G)=>{this.$__undoReset(),A(G)})}else{X.call(this);return}this.$__.modifiedPaths=this.modifiedPaths(),this.$__reset(),H8(this,!1);function X(){let Y=Object.assign({},F,B),$=this.$__where(),G=this.$__schema.options.optimisticConcurrency;if(G&&!Array.isArray(G)){let E=this.$__schema.options.versionKey,C=this.$__getValue(E);if(C!=null)$[E]=C}yq1(this.$__schema,Y),this.constructor.collection.findOne($,Y).then((E)=>{A(null,{$where:$,matchedCount:!E?0:1})}).catch(A)}};/*!
|
|
845
|
+
* ignore
|
|
846
|
+
*/d.prototype.$__save=function(F,A){this.$__handleSave(F,(B,D)=>{if(B)return this.$__schema.s.hooks.execPost("save:error",this,[this],{error:B},(Y)=>{A(Y,this)});let J=0;if((F!=null?F.writeConcern!=null?F.writeConcern.w:F.w:0)!==0){if(D!=null)if(Array.isArray(D))J=D.length;else if(D.matchedCount!=null)J=D.matchedCount;else J=D;if(this.$__.version&&!this.$__.inserting){let Y=cJ===(cJ&this.$__.version);this.$__.version=void 0;let $=this.$__schema.options.versionKey,G=this.$__getValue($)||0;if(J<=0){this.$__undoReset();let E=this.$__.$versionError||new Dm(this,G,this.$__.modifiedPaths);return A(E)}if(Y)this.$__setValue($,G+1)}if(D!=null&&J<=0)return this.$__undoReset(),B=new jq1(D.$where,this.constructor.modelName,J,D),this.$__schema.s.hooks.execPost("save:error",this,[this],{error:B},($)=>{A($,this)})}this.$__.saving=void 0,this.$__.savedState={},this.$emit("save",this,J),this.constructor.emit("save",this,J),A(null,this)})};/*!
|
|
847
|
+
* ignore
|
|
848
|
+
*/function $W1(F,A){let B=F.$__schema.options.versionKey;if(!B)return null;let D=F.$__getValue(B)||0;return new Dm(F,D,A)}d.prototype.save=async function F(A){if(typeof A==="function"||typeof arguments[1]==="function")throw new G1("Model.prototype.save() no longer accepts a callback");let B;if(this.$op="save",this.$__.saving)B=new rh(this);else this.$__.saving=new rh(this);if(A=new Sq1(A),A.hasOwnProperty("session"))this.$session(A.session);if(this.$__.timestamps!=null)A.timestamps=this.$__.timestamps;if(this.$__.$versionError=$W1(this,this.modifiedPaths()),B)throw this.$__handleReject(B),B;return this.$__.saveOptions=A,await new Promise((D,J)=>{this.$__save(A,(Z)=>{if(this.$__.saving=null,this.$__.saveOptions=null,this.$__.$versionError=null,this.$op=null,Z!=null)return this.$__handleReject(Z),J(Z);D()})}),this};d.prototype.$save=d.prototype.save;d.prototype.$__version=function(F,A){let B=this.$__schema.options.versionKey;if(F===!0){if(B)DW1(A,B,0),this.$__setValue(B,0);return}if(B===!1)return;if(!this.$__isSelected(B))return;if(Fm===(Fm&this.$__.version)){let D=this.$__getValue(B);if(D!=null)F[B]=D}if(cJ===(cJ&this.$__.version))if(SF(A.$set,B,null)!=null)++A.$set[B];else A.$inc=A.$inc||{},A.$inc[B]=1};d.prototype.increment=function F(){return this.$__.version=XW1,this};d.prototype.$__where=function F(A){if(A||(A={}),!A._id)A._id=this._doc._id;if(this._doc._id===void 0)return new G1("No _id found on document!");return A};d.prototype.deleteOne=function F(A){if(typeof A==="function"||typeof arguments[1]==="function")throw new G1("Model.prototype.deleteOne() no longer accepts a callback");if(!A)A={};if(A.hasOwnProperty("session"))this.$session(A.session);let B=this,D=this.$__where();if(D instanceof Error)throw D;let J=B.constructor.deleteOne(D,A);if(this.$session()!=null){if(!("session"in J.options))J.options.session=this.$session()}return J.pre(function Z(X){B.constructor._middleware.execPre("deleteOne",B,[B],X)}),J.pre(function Z(X){tq(B.$getAllSubdocs(),(Y,$)=>{Y.constructor._middleware.execPre("deleteOne",Y,[Y],$)},X)}),J.pre(function Z(X){if(B.$__.isDeleted)return X(oq.skipWrappedFunction());return X()}),J.post(function Z(X){tq(B.$getAllSubdocs(),(Y,$)=>{Y.constructor._middleware.execPost("deleteOne",Y,[Y],{},$)},X)}),J.post(function Z(X){B.constructor._middleware.execPost("deleteOne",B,[B],{},X)}),J};d.prototype.$model=function F(A){if(arguments.length===0)return this.constructor;return this[fF].model(A)};d.prototype.model=d.prototype.$model;d.exists=function F(A,B){if(q1(this,"exists"),typeof arguments[2]==="function")throw new G1("Model.exists() no longer accepts a callback");return this.findOne(A).select({_id:1}).lean().setOptions(B)};d.discriminator=function(F,A,B){let D;if(typeof F==="function"){if(D=F,F=r1.getFunctionName(D),!(D.prototype instanceof d))throw new G1("The provided class "+F+" must extend Model")}B=B||{};let J=r1.isPOJO(B)?B.value:B,Z=typeof B.clone==="boolean"?B.clone:!0,X=typeof B.mergePlugins==="boolean"?B.mergePlugins:!0,Y=typeof B.overwriteModels==="boolean"?B.overwriteModels:!1;if(q1(this,"discriminator"),r1.isObject(A)&&!A.instanceOfSchema)A=new aq(A);if(A instanceof aq&&Z)A=A.clone();if(A=iq1(this,F,A,J,X,B.mergeHooks,Y),this.db.models[F]&&!A.options.overwriteModels&&!Y)throw new kq1(F);A.$isRootDiscriminator=!0,A.$globalPluginsApplied=!0,D=this.db.model(D||F,A,this.$__collection.name),this.discriminators[F]=D;let $=this.discriminators[F];if(Object.setPrototypeOf($.prototype,this.prototype),Object.defineProperty($,"baseModelName",{value:this.modelName,configurable:!0,writable:!1}),Jm($,A),Xm($,A),this[kF]!=null)for(let G of this[kF])G.discriminators=G.discriminators||{},G.discriminators[F]=D.__subclass(D.db,A,G.collection.name);return $};function q1(F,A){if(F==null||F===global)throw new G1("`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[Cm]==null)throw new G1("`Model."+A+"()` cannot run without a model as `this`. Make sure you are not calling `new Model."+A+"()`")}/*!
|
|
849
|
+
* Give the constructor the ability to emit events.
|
|
850
|
+
*/for(let F in sq.prototype)d[F]=sq.prototype[F];d.init=function F(){if(q1(this,"init"),typeof arguments[0]==="function")throw new G1("Model.init() no longer accepts a callback");if(this.schema.emit("init",this),this.$init!=null)return this.$init;let A=this.db,B=async()=>{if(!r1.getOption("autoIndex",this.schema.options,A.config,A.base.options))return;return await this.ensureIndexes({_automatic:!0})},D=async()=>{if(!r1.getOption("autoSearchIndex",this.schema.options,A.config,A.base.options))return;let $=[];for(let G of this.schema._searchIndexes)$.push(await this.createSearchIndex(G));return $},J=async()=>{if((A.readyState===oh.connecting||A.readyState===oh.disconnected)&&A._shouldBufferCommands())await new Promise(($)=>{A._queue.push({fn:$})});if(!r1.getOption("autoCreate",this.schema.options,A.config,A.base.options))return;return await this.createCollection()};this.$init=J().then(()=>B()).then(()=>D());let Z=this.$init.catch,X=this;return this.$init.catch=function(){return X.$caught=!0,Z.apply(X.$init,arguments)},this.$init};d.createCollection=async function F(A){if(q1(this,"createCollection"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new G1("Model.createCollection() no longer accepts a callback");let B=await new Promise(($,G)=>{this.hooks.execPre("createCollection",this,[A],(E)=>{if(E!=null){if(E instanceof oq.skipWrappedFunction)return $(!0);return G(E)}$()})}),D=this&&this.schema&&this.schema.options&&this.schema.options.collectionOptions;if(D!=null)A=Object.assign({},D,A);let J=this&&this.schema&&this.schema.options&&this.schema.options.collation;if(J!=null)A=Object.assign({collation:J},A);let Z=this&&this.schema&&this.schema.options&&this.schema.options.capped;if(Z!=null){if(typeof Z==="number")A=Object.assign({capped:!0,size:Z},A);else if(typeof Z==="object")A=Object.assign({capped:!0},Z,A)}let X=this&&this.schema&&this.schema.options&&this.schema.options.timeseries;if(X!=null){if(A=Object.assign({timeseries:X},A),A.expireAfterSeconds!=null);else if(A.expires!=null)r1.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,r1.expires(A)}let Y=this&&this.schema&&this.schema.options&&this.schema.options.clusteredIndex;if(Y!=null)A=Object.assign({clusteredIndex:{...Y,unique:!0}},A);try{if(!B)await this.db.createCollection(this.$__collection.collectionName,A)}catch($){if($!=null&&($.name!=="MongoServerError"||$.code!==48))await new Promise((G,E)=>{let C={error:$};this.hooks.execPost("createCollection",this,[null],C,(H)=>{if(H!=null)return E(H);G()})})}return await new Promise(($,G)=>{this.hooks.execPost("createCollection",this,[this.$__collection],(E)=>{if(E!=null)return G(E);$()})}),this.$__collection};d.syncIndexes=async function F(A){if(q1(this,"syncIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new G1("Model.syncIndexes() no longer accepts a callback");let B=this;try{await B.createCollection()}catch(Z){if(Z!=null&&(Z.name!=="MongoServerError"||Z.code!==48))throw Z}let D=await B.diffIndexes(),J=await B.cleanIndexes({...A,toDrop:D.toDrop});return await B.createIndexes({...A,toCreate:D.toCreate}),J};d.createSearchIndex=async function F(A){return q1(this,"createSearchIndex"),await this.$__collection.createSearchIndex(A)};d.updateSearchIndex=async function F(A,B){return q1(this,"updateSearchIndex"),await this.$__collection.updateSearchIndex(A,B)};d.dropSearchIndex=async function F(A){return q1(this,"dropSearchIndex"),await this.$__collection.dropSearchIndex(A)};d.listSearchIndexes=async function F(A){return q1(this,"listSearchIndexes"),await(await this.$__collection.listSearchIndexes(A)).toArray()};d.diffIndexes=async function F(){if(typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new G1("Model.syncIndexes() no longer accepts a callback");let A=this,B=await A.listIndexes().catch((Y)=>{if(Y.codeName=="NamespaceNotFound")return;throw Y});if(B===void 0)B=[];B=rq1(A,B);let D=A.schema,J=tq1(A,D.indexes()),Z=EW1(D,J,B),X=GW1(D,J,B,Z);return{toDrop:Z,toCreate:X}};function GW1(F,A,B,D){let J=[];for(let[Z,X]of A){let Y=!1,$=AW(F,c3(X));for(let G of B){if(FW(G))continue;if(Gm(Z,$,G)&&!D.includes(G.name)){Y=!0;break}}if(!Y)J.push(Z)}return J}function EW1(F,A,B){let D=[];for(let J of B){let Z=!1;if(FW(J))continue;if(aq1(J,F.options))continue;for(let[X,Y]of A){let $=AW(F,c3(Y));if(Zm(X,$,F.options),Gm(X,$,J)){Z=!0;break}}if(Z)continue;D.push(J.name)}return D}d.cleanIndexes=async function F(A){if(q1(this,"cleanIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new G1("Model.cleanIndexes() no longer accepts a callback");let B=this;if(Array.isArray(A&&A.toDrop))return await Am(A.toDrop,B,A);let D=await B.diffIndexes();return await Am(D.toDrop,B,A)};async function Am(F,A,B){if(F.length===0)return[];let D=A.$__collection;if(B&&B.hideIndexes)await Promise.all(F.map((J)=>{return A.db.db.command({collMod:D.collectionName,index:{name:J,hidden:!0}})}));else await Promise.all(F.map((J)=>D.dropIndex(J)));return F}d.listIndexes=async function F(){if(q1(this,"listIndexes"),typeof arguments[0]==="function")throw new G1("Model.listIndexes() no longer accepts a callback");if(this.$__collection.buffer)await new Promise((A)=>{this.$__collection.addQueue(A)});return this.$__collection.listIndexes().toArray()};d.ensureIndexes=async function F(A){if(q1(this,"ensureIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new G1("Model.ensureIndexes() no longer accepts a callback");await new Promise((B,D)=>{CW1(this,A,(J)=>{if(J!=null)return D(J);B()})})};d.createIndexes=async function F(A){if(q1(this,"createIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new G1("Model.createIndexes() no longer accepts a callback");return this.ensureIndexes(A)};/*!
|
|
851
|
+
* ignore
|
|
852
|
+
*/function CW1(F,A,B){let D=F.schema.indexes(),J;A=A||{};let Z=function(C){if(C&&!F.$caught)F.emit("error",C);F.emit("index",C||J),B&&B(C||J)};for(let C of D)if(FW(C))r1.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(!D.length){q8(function(){Z()});return}let X=function(C,H,q,W){F.emit("index-single-done",C,H,q,W)},Y=function(C,H){F.emit("index-single-start",C,H)},$=F.schema._baseSchema,G=$?$.indexes():[];q8(function(){if(A._automatic&&!F.collection.collection)F.collection.addQueue(E,[]);else E()});function E(){if(A._automatic){if(F.schema.options.autoIndex===!1||F.schema.options.autoIndex==null&&F.db.config.autoIndex===!1)return Z()}let C=D.shift();if(!C)return Z();if(A._automatic&&C[1]._autoIndex===!1)return E();if(G.find((K)=>r1.deepEqual(K,C)))return E();let H=c3(C[0]),q=c3(C[1]);if(delete q._autoIndex,AW(F.schema,q),Ym(F.schema,q),Zm(H,q,F.schema.options),Y(H,A),"background"in A)q.background=A.background;if("toCreate"in A){if(A.toCreate.length===0)return Z()}let W=null;try{W=F.collection.createIndex(H,q)}catch(K){if(!J)J=K;if(!F.$caught)F.emit("error",K);X(K,H,q),E();return}W.then((K)=>{X(null,H,q,K),E()},(K)=>{if(!J)J=K;if(!F.$caught)F.emit("error",K);X(K,H,q),E()})}}d.schema;d.db;d.collection;d.$__collection;d.base;d.discriminators;d.translateAliases=function F(A,B){q1(this,"translateAliases");let D=(J,Z)=>{let X,Y=[],$=J.split("."),G=this.schema;for(let C in $){let H=$[C];if(G&&G.aliases[H]){if(X=G.aliases[H],B&&X in A)throw new G1(`Provided object has both field "${H}" and its alias "${X}"`);Y.push(X)}else X=H,Y.push(H);if(G&&G.paths[X])G=G.paths[X].schema;else G=null}let E=Y.join(".");if(A instanceof Map)A.set(E,Z);else A[E]=Z;if(E!==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=D(J[0],J[1]);else for(let J of Object.keys(A))if(A=D(J,A[J]),J[0]==="$")if(Array.isArray(A[J]))for(let Z in A[J])A[J][Z]=this.translateAliases(A[J][Z]);else this.translateAliases(A[J]);return A}else return A};d.deleteOne=function F(A,B){if(q1(this,"deleteOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.prototype.deleteOne() no longer accepts a callback");let D=new this.Query({},{},this,this.$__collection);return D.setOptions(B),D.deleteOne(A)};d.deleteMany=function F(A,B){if(q1(this,"deleteMany"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.deleteMany() no longer accepts a callback");let D=new this.Query({},{},this,this.$__collection);return D.setOptions(B),D.deleteMany(A)};d.find=function F(A,B,D){if(q1(this,"find"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new G1("Model.find() no longer accepts a callback");let J=new this.Query({},{},this,this.$__collection);return J.select(B),J.setOptions(D),J.find(A)};d.findById=function F(A,B,D){if(q1(this,"findById"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.findById() no longer accepts a callback");if(typeof A==="undefined")A=null;return this.findOne({_id:A},B,D)};d.findOne=function F(A,B,D){if(q1(this,"findOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.findOne() no longer accepts a callback");let J=new this.Query({},{},this,this.$__collection);return J.select(B),J.setOptions(D),J.findOne(A)};d.estimatedDocumentCount=function F(A){return q1(this,"estimatedDocumentCount"),new this.Query({},{},this,this.$__collection).estimatedDocumentCount(A)};d.countDocuments=function F(A,B){if(q1(this,"countDocuments"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.countDocuments() no longer accepts a callback");let D=new this.Query({},{},this,this.$__collection);if(B!=null)D.setOptions(B);return D.countDocuments(A)};d.distinct=function F(A,B,D){if(q1(this,"distinct"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.distinct() no longer accepts a callback");let J=new this.Query({},{},this,this.$__collection);if(D!=null)J.setOptions(D);return J.distinct(A,B)};d.where=function F(A,B){q1(this,"where");let D=new this.Query({},{},this,this.$__collection).find({});return D.where.apply(D,arguments)};d.$where=function F(){q1(this,"$where");let A=new this.Query({},{},this,this.$__collection).find({});return A.$where.apply(A,arguments)};d.findOneAndUpdate=function(F,A,B){if(q1(this,"findOneAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new G1("Model.findOneAndUpdate() no longer accepts a callback");if(arguments.length===1)A=F,F=null,B=null;let D;if(B)D=B.fields||B.projection;A=c3(A,{depopulate:!0,_isNested:!0}),$m(A,B,this.schema.options.versionKey);let J=new this.Query({},{},this,this.$__collection);return J.select(D),J.findOneAndUpdate(F,A,B)};d.findByIdAndUpdate=function(F,A,B){if(q1(this,"findByIdAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new G1("Model.findByIdAndUpdate() no longer accepts a callback");if(F instanceof J3)F=F._doc._id;return this.findOneAndUpdate.call(this,{_id:F},A,B)};d.findOneAndDelete=function(F,A){if(q1(this,"findOneAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.findOneAndDelete() no longer accepts a callback");let B;if(A)B=A.select,A.select=void 0;let D=new this.Query({},{},this,this.$__collection);return D.select(B),D.findOneAndDelete(F,A)};d.findByIdAndDelete=function(F,A){if(q1(this,"findByIdAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new G1("Model.findByIdAndDelete() no longer accepts a callback");return this.findOneAndDelete({_id:F},A)};d.findOneAndReplace=function(F,A,B){if(q1(this,"findOneAndReplace"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new G1("Model.findOneAndReplace() no longer accepts a callback");let D;if(B)D=B.select,B.select=void 0;let J=new this.Query({},{},this,this.$__collection);return J.select(D),J.findOneAndReplace(F,A,B)};d.create=async function F(A,B){if(typeof B==="function"||typeof arguments[2]==="function")throw new G1("Model.create() no longer accepts a callback");q1(this,"create");let D,J=this.schema.options.discriminatorKey;if(Array.isArray(A))D=A,B=B!=null&&typeof B==="object"?B:{};else{let Y=arguments[arguments.length-1];if(B={},typeof Y==="function"||typeof B==="function"||typeof arguments[2]==="function")throw new G1("Model.create() no longer accepts a callback");else if(D=[...arguments],D.length>1&&!Y)D.pop();if(D.length===2&&D[0]!=null&&D[1]!=null&&D[0].session==null&&Y&&nq1(Y.session)==="ClientSession"&&!this.schema.path("session"))r1.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(D.length===0)return Array.isArray(A)?[]:null;let Z=[],X=typeof B.aggregateErrors==="boolean"?!B.aggregateErrors:!0;if(delete B.aggregateErrors,B.ordered){for(let Y=0;Y<D.length;Y++)try{let $=D[Y],G=this.discriminators&&$[J]!=null?this.discriminators[$[J]]||mJ(this.discriminators,$[J]):this;if(G==null)throw new G1(`Discriminator "${$[J]}" not found for model "${this.modelName}"`);let E=$;if(!(E instanceof G))E=new G(E);await E.$save(B),Z.push(E)}catch($){if(!X)Z.push($);else throw $}return Z}else if(!X)Z=await Promise.allSettled(D.map(async(Y)=>{let $=this.discriminators&&Y[J]!=null?this.discriminators[Y[J]]||mJ(this.discriminators,Y[J]):this;if($==null)throw new G1(`Discriminator "${Y[J]}" not found for model "${this.modelName}"`);let G=Y;if(!(G instanceof $))G=new $(G);return await G.$save(B),G})),Z=Z.map((Y)=>Y.status==="fulfilled"?Y.value:Y.reason);else{let Y=null;if(Z=await Promise.all(D.map(async($)=>{let G=this.discriminators&&$[J]!=null?this.discriminators[$[J]]||mJ(this.discriminators,$[J]):this;if(G==null)throw new G1(`Discriminator "${$[J]}" not found for model "${this.modelName}"`);try{let E=$;if(!(E instanceof G))E=new G(E);return await E.$save(B),E}catch(E){if(!Y)Y=E}})),Y)throw Y}if(!Array.isArray(A)&&D.length===1)return Z[0];return Z};d.watch=function(F,A){q1(this,"watch");let B=(D)=>{if(F=F||[],AW1(F,this.schema,"fullDocument"),this.$__collection.buffer)this.$__collection.addQueue(()=>{if(this.closed)return;let J=this.$__collection.watch(F,A);D(null,J)});else{let J=this.$__collection.watch(F,A);D(null,J)}};return A=A||{},A.model=this,new Tq1(B,F,A)};d.startSession=function(){return q1(this,"startSession"),this.db.startSession.apply(this.db,arguments)};d.insertMany=async function F(A,B){if(q1(this,"insertMany"),typeof B==="function"||typeof arguments[2]==="function")throw new G1("Model.insertMany() no longer accepts a callback");return new Promise((D,J)=>{this.$__insertMany(A,B,(Z,X)=>{if(Z!=null)return J(Z);D(X)})})};d.$__insertMany=function(F,A,B){let D=this;if(typeof A==="function")B=A,A=null;B=B||r1.noop,A=A||{};let J=A.limit||1000,Z=!!A.rawResult,X=typeof A.ordered==="boolean"?A.ordered:!0,Y=typeof A.throwOnValidationError==="boolean"?A.throwOnValidationError:!1,$=!!A.lean,G=this.db.base.transactionAsyncLocalStorage?.getStore();if((!A||!A.hasOwnProperty("session"))&&G?.session!=null)A={...A,session:G.session};if(!Array.isArray(F))F=[F];let E=[],C=new Map,H=X?null:new Array(F.length),q=F.map((W,K)=>(U)=>{if($)return q8(()=>U(null,W));let Q=!1;if(!(W instanceof D)){if(W!=null&&typeof W!=="object")return U(new Oq1(W,"arr."+K,"insertMany"));try{W=new D(W),Q=!0}catch(L){return U(L)}}if(A.session!=null)W.$session(A.session);if($)return q8(()=>U(null,W));W.$validate(Q?{_skipParallelValidateCheck:!0}:null).then(()=>{U(null,W)},(L)=>{if(X===!1)return E.push(L),C.set(L,K),H[K]=L,U(null,null);U(L)})});FW1(q,J,function(W,K){if(W){B(W,null);return}let U=new Map,Q=new Map;for(let w=0;w<K.length;++w)U.set(K[w],w);let L=K.filter(function(w){return w!=null});for(let w=0;w<L.length;++w)Q.set(w,U.get(L[w]));if(E.length>0)E.sort((w,j)=>{return C.get(w)-C.get(j)});if(L.length===0){if(Y)return B(new dJ(E,H,null,"insertMany"));if(Z)return B(null,{acknowledged:!0,insertedCount:0,insertedIds:{},mongoose:{validationErrors:E}});B(null,[]);return}let V=$?L:L.map(function(w){if(w.$__schema.options.versionKey)w[w.$__schema.options.versionKey]=0;if((!A||A.timestamps!==!1)&&w.initializeTimestamps&&(!w.$__||w.$__.timestamps!==!1))w.initializeTimestamps();if(w.$__hasOnlyPrimitiveValues())return w.$__toObjectShallow();return w.toObject(eq)});D.$__collection.insertMany(V,A).then((w)=>{if(!$)for(let j of L)j.$__reset(),H8(j,!1);if(X===!1&&Y&&E.length>0){for(let j=0;j<H.length;++j)if(H[j]===void 0)H[j]=K[j];return B(new dJ(E,H,w,"insertMany"))}if(Z){if(X===!1){for(let j=0;j<H.length;++j)if(H[j]===void 0)H[j]=K[j];w.mongoose={validationErrors:E,results:H}}return B(null,w)}if(A.populate!=null)return D.populate(L,A.populate).then((j)=>{B(null,j)},(j)=>{if(j!=null)j.insertedDocs=L;throw j});B(null,L)},(w)=>{if(w.writeErrors==null&&(w.result&&w.result.result&&w.result.result.writeErrors)!=null)w.writeErrors=w.result.result.writeErrors;let j=w&&w.writeErrors,T=new Set((w&&w.writeErrors||[]).map((x)=>x.index));if(w.writeErrors!=null)for(let x=0;x<w.writeErrors.length;++x){let m=Q.get(w.writeErrors[x].index);if(w.writeErrors[x]={...w.writeErrors[x],index:m},!X)H[m]=w.writeErrors[x]}if(!X){for(let x=0;x<H.length;++x)if(H[x]===void 0)H[x]=K[x];w.results=H}let M=-1;if(w.insertedDocs=L.filter((x,m)=>{let u=!j||T.has(m);if(X){if(M>-1)return m<M;if(u)M=m}return!u}).map(function x(m){if($)return m;return m.$__reset(),H8(m,!1),m}),Z&&X===!1)w.mongoose={validationErrors:E,results:H};B(w,null)})})};/*!
|
|
853
|
+
* ignore
|
|
854
|
+
*/function H8(F,A){F.$isNew=A,F.$emit("isNew",A),F.constructor.emit("isNew",A);let B=F.$getAllSubdocs({useCache:!0});for(let D of B)D.$isNew=A,D.$emit("isNew",A)}d.bulkWrite=async function F(A,B){if(q1(this,"bulkWrite"),typeof B==="function"||typeof arguments[2]==="function")throw new G1("Model.bulkWrite() no longer accepts a callback");B=B||{};let D=await new Promise(($,G)=>{this.hooks.execPre("bulkWrite",this,[A,B],(E)=>{if(E!=null){if(E instanceof oq.skipWrappedFunction)return $(E);return G(E)}$()})});if(D)return D.args[0];let J=B.ordered==null?!0:B.ordered;if(A.length===0)return th();let Z=A.map(($)=>cq1(this,$,B)),X=this.db.base.transactionAsyncLocalStorage?.getStore();if((!B||!B.hasOwnProperty("session"))&&X?.session!=null)B={...B,session:X.session};let Y=null;if(J){await new Promise(($,G)=>{tq(Z,(E,C)=>E(C),(E)=>{if(E)return G(E);$()})});try{Y=await this.$__collection.bulkWrite(A,B)}catch($){await new Promise((G,E)=>{let C={error:$};this.hooks.execPost("bulkWrite",this,[null],C,(H)=>{if(H!=null)return E(H);G()})})}}else{let $=Z.length,G=[],E=[],C=[];await new Promise((W)=>{for(let K=0;K<Z.length;++K)Z[K]((U)=>{if(U==null)G.push(K);else E.push({index:K,error:U}),C[K]=U;if(--$<=0)W()})}),E=E.sort((W,K)=>W.index-K.index).map((W)=>W.error);let H=G;if(G=G.sort().map((W)=>A[W]),G.length===0){if(B.throwOnValidationError&&E.length)throw new dJ(E,C,Y,"bulkWrite");return th()}let q;if([Y,q]=await this.$__collection.bulkWrite(G,B).then((W)=>[W,null]).catch((W)=>[null,W]),q){if(E.length>0)q.mongoose=q.mongoose||{},q.mongoose.validationErrors=E;await new Promise((W,K)=>{let U={error:q};this.hooks.execPost("bulkWrite",this,[null],U,(Q)=>{if(Q!=null)return K(Q);W()})})}for(let W=0;W<H.length;++W)C[H[W]]=null;if(E.length>0)if(B.throwOnValidationError)throw new dJ(E,C,Y,"bulkWrite");else Y.mongoose=Y.mongoose||{},Y.mongoose.validationErrors=E,Y.mongoose.results=C}return await new Promise(($,G)=>{this.hooks.execPost("bulkWrite",this,[Y],(E)=>{if(E!=null)return G(E);$()})}),Y};d.bulkSave=async function F(A,B){if(B=B||{},B.timestamps!=null)for(let G of A)G.$__.saveOptions=G.$__.saveOptions||{},G.$__.saveOptions.timestamps=B.timestamps;else for(let G of A)if(G.$__.timestamps!=null)G.$__.saveOptions=G.$__.saveOptions||{},G.$__.saveOptions.timestamps=G.$__.timestamps;await Promise.all(A.map(HW1));let D=this.buildBulkWriteOperations(A,{skipValidation:!0,timestamps:B.timestamps}),{bulkWriteResult:J,bulkWriteError:Z}=await this.bulkWrite(D,B).then((G)=>({bulkWriteResult:G,bulkWriteError:null}),(G)=>({bulkWriteResult:null,bulkWriteError:G}));if(Z!=null&&!(Z instanceof uq1))throw Z;let X=J?.matchedCount??0,Y=J?.insertedCount??0;if(D.length>0&&X+Y<D.length&&!Z)throw new ZW1(this.modelName,A,J);let $=[];for(let G=0;G<A.length;G++){let E=A[G];if((Z&&Z.writeErrors.find((H)=>{return(H.err.op._id||H.err.op.q._id).toString()===E._doc._id.toString()}))==null)$.push(E)}if(await Promise.all($.map((G)=>qW1(G))),Z&&Z.writeErrors&&Z.writeErrors.length)throw Z;return J};function HW1(F){return new Promise((A,B)=>{F.schema.s.hooks.execPre("save",F,(D)=>{if(D){B(D);return}A()})})}function qW1(F){return new Promise((A,B)=>{if(F.$isNew)H8(F,!1);F.$__reset(),F.schema.s.hooks.execPost("save",F,[F],{},(D)=>{if(D){B(D);return}A()})})}d.applyDefaults=function F(A){if(A==null)return A;if(A.$__!=null){xq1(A,A.$__.fields,A.$__.exclude);for(let B of A.$getAllSubdocs())F(B,B.$__.fields,B.$__.exclude);return A}return fq1(A,this.schema),A};d.applyVirtuals=function F(A,B){if(A==null)return A;if(A.$__!=null)return A;return mq1(this.schema,A,B),A};d.applyTimestamps=function F(A,B){if(A==null)return A;if(A.$__!=null)return A;return hq1(this.schema,A,B),A};d.castObject=function F(A,B){B=B||{};let D={},J=this.schema,Z=Object.keys(J.paths);for(let Y of Z){let $=J.path(Y);if(!$||!$.$isMongooseArray)continue;let G=SF(A,Y);Em(Z,G,Y)}let X=null;for(let Y of Z){let $=J.path(Y);if($==null)continue;let G=SF(A,Y,void 0);if(G==null)continue;let E=Y.indexOf(".")===-1?[Y]:Y.split("."),C=D;for(let H=0;H<E.length-1;++H){if(C[E[H]]==null)C[E[H]]=isNaN(E[H+1])?{}:[];C=C[E[H]]}if($.$isMongooseDocumentArray)continue;if($.$isSingleNested||$.$isMongooseDocumentArrayElement){try{G=d.castObject.call($.caster,G)}catch(H){if(!B.ignoreCastErrors)X=X||new rq,X.addError(Y,H);continue}C[E[E.length-1]]=G;continue}try{G=$.cast(G),C[E[E.length-1]]=G}catch(H){if(!B.ignoreCastErrors)X=X||new rq,X.addError(Y,H);continue}}if(X!=null)throw X;return D};d.buildBulkWriteOperations=function F(A,B){if(!Array.isArray(A))throw new Error(`bulkSave expects an array of documents to be passed, received \`${A}\` instead`);Z();let D=this.schema.options.discriminatorKey;return A.reduce((X,Y,$)=>{if(!B.skipValidation){if(!(Y instanceof J3))throw new Error(`documents.${$} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`);let H=Y.validateSync();if(H)throw H}if(Y.isNew){let H={insertOne:{document:Y}};return r1.injectTimestampsOption(H.insertOne,B.timestamps),X.push(H),X}let E=Y.$__delta();if(E!=null&&!r1.isEmptyObject(E[0])){let H=Y.$__where(E[0]),q=E[1];Hm(Y,H);let W=this.schema.options.shardKey;if(W){let U=Object.keys(W),Q=U.length;for(let L=0;L<Q;++L)H[U[L]]=Y[U[L]]}if(Y[D]!=null&&!(D in H))H[D]=Y[D];Y.$__version(H,E);let K={updateOne:{filter:H,update:q}};return r1.injectTimestampsOption(K.updateOne,B.timestamps),X.push(K),X}return X},[]);function Z(){if(B=B||{},B.skipValidation==null)B.skipValidation=!1}};d.hydrate=function(F,A,B){if(q1(this,"hydrate"),A!=null){if(F!=null&&F.$__!=null)F=F.toObject(eq);F=bq1(F,A)}let D=l5().createModel(this,F,A);return D.$init(F,B),D};d.updateMany=function F(A,B,D){return q1(this,"updateMany"),BW(this,"updateMany",A,B,D)};d.updateOne=function F(A,B,D){return q1(this,"updateOne"),BW(this,"updateOne",A,B,D)};d.replaceOne=function F(A,B,D){q1(this,"replaceOne");let J=this&&this.schema&&this.schema.options&&this.schema.options.versionKey||null;if(J&&!B[J])B[J]=0;return BW(this,"replaceOne",A,B,D)};function BW(F,A,B,D,J){let Z=new F.Query({},{},F,F.collection);if(B instanceof J3)B=B.toObject();else B=c3(B);J=typeof J==="function"?J:c3(J);let X=F&&F.schema&&F.schema.options&&F.schema.options.versionKey||null;return $m(D,J,X),Z[A](B,D,J)}d.aggregate=function F(A,B){if(q1(this,"aggregate"),typeof B==="function"||typeof arguments[2]==="function")throw new G1("Model.aggregate() no longer accepts a callback");let D=new Mq1(A||[]);if(D.model(this),B!=null)D.option(B);if(typeof callback==="undefined")return D;return D};d.validate=async function F(A,B,D){if(arguments.length<3||arguments.length===3&&typeof arguments[2]==="function")D=A;if(typeof D==="function"||typeof arguments[3]==="function")throw new G1("Model.validate() no longer accepts a callback");let J=this.schema,Z=J.options.discriminatorKey;if(J.discriminators!=null&&A!=null&&A[Z]!=null)J=pq1(J,A[Z])||J;let X=Object.keys(J.paths);if(B!=null){let G=typeof B==="string"?new Set(B.split(" ")):Array.isArray(B)?new Set(B):new Set(X);X=X.filter((E)=>{if(B.pathsToSkip){if(Array.isArray(B.pathsToSkip)){if(B.pathsToSkip.find((q)=>q==E))return!1}else if(typeof B.pathsToSkip=="string"){if(B.pathsToSkip.includes(E))return!1}}let C=E.split("."),H=C[0];for(let q of C){if(G.has(H))return!0;H+="."+q}return G.has(E)})}for(let G of X){let E=J.path(G);if(!E||!E.$isMongooseArray||E.$isMongooseDocumentArray)continue;let C=SF(A,G);Em(X,C,G)}let Y=null;X=new Set(X);try{A=this.castObject(A)}catch(G){Y=G;for(let E of Object.keys(Y.errors||{}))X.delete(E)}let $=X.size;return new Promise((G,E)=>{for(let H of X){let q=J.path(H);if(q==null){C();continue}let W=H.indexOf(".")===-1?[H]:H.split("."),K=A;for(let Q=0;Q<W.length-1;++Q)K=K[W[Q]];let U=SF(A,H,void 0);q.doValidate(U,(Q)=>{if(Q)Y=Y||new rq,Y.addError(H,Q);C()},D,{path:H})}function C(){if(--$<=0)if(Y)E(Y);else G(A)}})};d.populate=async function F(A,B){if(q1(this,"populate"),typeof B==="function"||typeof arguments[2]==="function")throw new G1("Model.populate() no longer accepts a callback");let D=this;B=r1.populate(B);let J={};return new Promise((Z,X)=>{WW1(D,A,B,J,(Y,$)=>{if(Y)return X(Y);Z($)})})};function WW1(F,A,B,D,J){let Z=B.length;if(B.length===0)return J(null,A);for(let Y of B)UW1(F,A,Y,X);function X(Y){if(Y)return J(Y,null);if(--Z)return;J(null,A)}}/*!
|
|
855
|
+
* Populates `docs`
|
|
856
|
+
*/var KW1=/\s?-_id\s?/,zW1=/\s?-_id\s?/g;function UW1(F,A,B,D){let J=B;if(B.strictPopulate==null){if(B._localModel!=null&&B._localModel.schema._userProvidedOptions.strictPopulate!=null)J.strictPopulate=B._localModel.schema._userProvidedOptions.strictPopulate;else if(B._localModel!=null&&F.base.options.strictPopulate!=null)J.strictPopulate=F.base.options.strictPopulate;else if(F.base.options.strictPopulate!=null)J.strictPopulate=F.base.options.strictPopulate}if(!Array.isArray(A))A=[A];if(A.length===0||A.every(r1.isNullOrUndefined))return D();let Z=sq1(F,A,J);if(Z instanceof G1)return q8(function(){D(Z)});let X=Z.length,Y=[];function $(W){return W!==void 0}let G=X,E=!1,C=[];for(let W=0;W<X;++W){let K=Z[W],U=K.options.select,Q=r1.array.flatten(K.ids,$);Q=r1.array.unique(Q);let L={};if(L.sort=K&&K.options&&K.options.options&&K.options.options.sort||void 0,L.excludeId=KW1.test(U)||U&&U._id===0,K.options&&K.options.options&&K.options.options.lean&&K.options.options.lean.transform)K.options.options._leanTransform=K.options.options.lean.transform,K.options.options.lean=!0;if(Q.length===0||Q.every(r1.isNullOrUndefined)){--G,Bm(F,[],K,L);continue}if(E=!0,typeof J.foreignField==="string")K.foreignField.clear(),K.foreignField.add(J.foreignField);let V=lq1(Q,K.match,K.foreignField,K.model,K.options.skipInvalidIds);if(L.excludeId)if(typeof U==="string")U=U.replace(zW1," ");else if(Array.isArray(U))U=U.filter((w)=>w!=="-_id");else U={...U},delete U._id;if(K.options.options&&K.options.options.limit!=null)L.originalLimit=K.options.options.limit;else if(K.options.limit!=null)L.originalLimit=K.options.limit;C.push([K,V,U,L,H])}if(!E){if(Z.length!==0)return D();if(J.populate!=null){let W=r1.populate(J.populate).map((K)=>Object.assign({},K,{path:J.path+"."+K.path}));F.populate(A,W).then((K)=>{D(null,K)},(K)=>{D(K)});return}return D()}for(let W of C)QW1.apply(null,W);function H(W,K){if(W!=null)return D(W,null);if(Y=Y.concat(K),--G===0)q()}function q(){for(let W of C){let K=W[0],U=W[3];for(let Q of Y)K.options._childDocs.push(Q);try{Bm(F,Y,K,U)}catch(Q){return D(Q)}}for(let W of C)BW1(W[0].foreignField,W[0].options,Y);for(let W of C){let K=W[0];if(K.options&&K.options.options&&K.options.options._leanTransform)for(let U of Y)K.options.options._leanTransform(U)}D()}}/*!
|
|
857
|
+
* ignore
|
|
858
|
+
*/function QW1(F,A,B,D,J){let Z=c3(F.options.populate),X=Object.assign({skip:F.options.skip,limit:F.options.limit,perDocumentLimit:F.options.perDocumentLimit},F.options.options);if(F.count)delete X.skip;if(X.perDocumentLimit!=null)X.limit=X.perDocumentLimit,delete X.perDocumentLimit;else if(X.limit!=null)X.limit=X.limit*F.ids.length;let Y=F.model.find(A,B,X);for(let $ of F.foreignField)if($!=="_id"&&Y.selectedInclusively()&&!oq1(Y._fields,$))Y.select($);if(F.count)for(let $ of F.foreignField)Y.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;Y.populate(Z)}Y.exec().then(($)=>{for(let G of $)eq1.set(G,F.model);J(null,$)},($)=>{J($)})}/*!
|
|
859
|
+
* ignore
|
|
860
|
+
*/function Bm(F,A,B,D){let{options:J,isVirtual:Z,justOne:X}=B,Y,$=J&&J.options&&J.options.lean||!1,G=A.length,E={},C={},H,q,W=c3(B.allIds);for(let K=0;K<G;K++){if(q=A[K],q==null)continue;for(let U of B.foreignField){if(Y=r1.getValue(U,q),Array.isArray(Y)){Y=r1.array.unique(r1.array.flatten(Y));for(let Q of Y){if(Q instanceof J3)Q=Q._doc._id;if(H=String(Q),C[H])if(Array.isArray(C[H]))C[H].push(q),E[H].push(K);else C[H]=[C[H],q],E[H]=[E[H],K];else if(Z&&!X)C[H]=[q],E[H]=[K];else C[H]=q,E[H]=K}}else{if(Y instanceof J3)Y=Y._doc._id;if(H=String(Y),C[H]){if(Array.isArray(C[H]))C[H].push(q),E[H].push(K);else if(Z||C[H].constructor!==q.constructor||(C[H]instanceof J3?String(C[H]._doc._id):String(C[H]._id))!==(q instanceof J3?String(q._doc._id):String(q._id)))C[H]=[C[H],q],E[H]=[E[H],K]}else C[H]=q,E[H]=K}if(!$)q.$__.wasPopulated=q.$__.wasPopulated||{value:Y}}}dq1({originalModel:F,rawIds:B.isVirtual?W:B.allIds,allIds:W,unpopulatedValues:B.unpopulatedValues,foreignField:B.foreignField,rawDocs:C,rawOrder:E,docs:B.docs,path:J.path,options:D,justOne:B.justOne,isVirtual:B.isVirtual,allOptions:B,populatedModel:B.model,lean:$,virtual:B.virtual,count:B.count,match:B.match})}d.compile=function F(A,B,D,J,Z){if(B.options.versionKey!==!1&&!B.paths[B.options.versionKey]){let C={};C[B.options.versionKey]=Number,B.add(C)}let Y;if(typeof A==="function"&&A.prototype instanceof d)Y=A,A=Y.name,B.loadClass(Y,!1),Y.prototype.$isMongooseModelPrototype=!0;else Y=function C(H,q,W){if(C.hooks.execPreSync("createModel",H),!(this instanceof C))return new C(H,q,W);let K=C.schema.options.discriminatorKey;if(C.discriminators==null||H==null||H[K]==null){d.call(this,H,q,W);return}let U=C.discriminators[H[K]]||mJ(C.discriminators,H[K]);if(U!=null)return new U(H,q,W);d.call(this,H,q,W)};if(Y.hooks=B.s.hooks.clone(),Y.base=Z,Y.modelName=A,!(Y.prototype instanceof d))Object.setPrototypeOf(Y,d),Object.setPrototypeOf(Y.prototype,d.prototype);Y.model=function C(H){return this.db.model(H)},Y.db=J,Y.prototype.db=J,Y.prototype[fF]=J,Y.discriminators=Y.prototype.discriminators=void 0,Y[Cm]=!0,Y.events=new sq,B._preCompile();let G={schemaUserProvidedOptions:B._userProvidedOptions||{},capped:B.options.capped,Promise:Y.base.Promise,modelName:A};if(B.options.autoCreate!==void 0)G.autoCreate=B.options.autoCreate;let E=J.collection(D,G);return Y.prototype.collection=E,Y.prototype.$collection=E,Y.prototype[xF]=E,Y.prototype.$__setSchema(B),Jm(Y,B),Xm(Y,B),gq1(Y,B),vq1(Y,B.s.hooks,B.statics),Y.schema=Y.prototype.$__schema,Y.collection=E,Y.$__collection=E,Y.Query=function(){hJ.apply(this,arguments)},Object.setPrototypeOf(Y.Query.prototype,hJ.prototype),Y.Query.base=hJ.base,Y.Query.prototype.constructor=hJ,Y._applyQueryMiddleware(),LW1(Y,B.query),Y};d.$__updateConnection=function F(A){this.db=A,this.prototype.db=A,this.prototype[fF]=A;let B=A.collection(this.collection.collectionName,this.collection.opts);this.prototype.collection=B,this.prototype.$collection=B,this.prototype[xF]=B,this.collection=B,this.$__collection=B};function LW1(F,A){for(let B in A)F.Query.prototype[B]=A[B]}d.__subclass=function F(A,B,D){let J=this,Z=function E(C,H,q){if(!(this instanceof E))return new E(C,H,q);J.call(this,C,H,q)};if(Object.setPrototypeOf(Z,J),Object.setPrototypeOf(Z.prototype,J.prototype),Z.db=A,Z.prototype.db=A,Z.prototype[fF]=A,J[kF]=J[kF]||[],J[kF].push(Z),J.discriminators!=null){Z.discriminators={};for(let E of Object.keys(J.discriminators))Z.discriminators[E]=J.discriminators[E].__subclass(J.db,J.discriminators[E].schema,D)}let X=B&&typeof B!=="string"?B:J.prototype.$__schema,Y=X.options||{},$=X._userProvidedOptions||{};if(!D)D=J.prototype.$__schema.get("collection")||r1.toCollectionName(J.modelName,this.base.pluralize());let G={schemaUserProvidedOptions:$,capped:X&&Y.capped};return Z.prototype.collection=A.collection(D,G),Z.prototype.$collection=Z.prototype.collection,Z.prototype[xF]=Z.prototype.collection,Z.collection=Z.prototype.collection,Z.$__collection=Z.collection,Z.init().catch(()=>{}),Z};d.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,_q1(this.schema,new WeakSet,!0)};d.inspect=function(){return`Model { ${this.modelName} }`};if(eh.inspect.custom)d[eh.inspect.custom]=d.inspect;/*!
|
|
861
|
+
* Applies query middleware from this model's schema to this model's
|
|
862
|
+
* Query constructor.
|
|
863
|
+
*/d._applyQueryMiddleware=function F(){let A=this.Query,B=this.schema.s.hooks.filter((D)=>{let J=VW1(D);if(D.name==="validate")return!!J.query;if(D.name==="deleteOne"||D.name==="updateOne")return!!J.query||Object.keys(J).length===0;if(D.query!=null||D.document!=null)return!!D.query;return!0});A.prototype._queryMiddleware=B};function VW1(F){let A={};if(F.hasOwnProperty("query"))A.query=F.query;if(F.hasOwnProperty("document"))A.document=F.document;return A}/*!
|
|
864
|
+
* Module exports.
|
|
865
|
+
*/Wm.exports=qm=d});var zm=z((_F,Km)=>{Km.exports=IW1;_F.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 RW1=_F.pluralization;_F.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 wW1=_F.uncountables;function IW1(F){let A;if(F=F.toLowerCase(),!~wW1.indexOf(F)){if(A=RW1.filter(function(B){return F.match(B[0])}),A[0])return F.replace(A[0][0],A[0][1])}return F}});var wm=z((QP1,Rm)=>{/*!
|
|
866
|
+
* Module requirements
|
|
867
|
+
*/var Lm=C1(),Um=import.meta.require("util"),Qm=HE();class M4 extends Lm{constructor(){super("");this.errors={}}toString(){return Qm(this)}inspect(){return Object.assign(new Error(this.message),this)}addError(F,A){if(A instanceof M4){let{errors:B}=A;for(let D of Object.keys(B))this.addError(D,B[D]);return}this.errors[F]=A,this.message=Qm(this)}}if(Um.inspect.custom)M4.prototype[Um.inspect.custom]=M4.prototype.inspect;Object.defineProperty(M4.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(M4.prototype,"name",{value:"SetOptionError"});class Vm extends Lm{constructor(F){super(`"${F}" is not a valid option to set`)}}M4.SetOptionInnerError=Vm;/*!
|
|
868
|
+
* Module exports
|
|
869
|
+
*/Rm.exports=M4});var Nm=z(()=>{var Im=J1();if(typeof jest!=="undefined"&&!process.env.SUPPRESS_JEST_WARNINGS){if(typeof window!=="undefined")Im.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")Im.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 Om=z((jm,um)=>{/*!
|
|
870
|
+
* Module dependencies.
|
|
871
|
+
*/var Pm=O2(),Mm=import.meta.require("events").EventEmitter,Tm=W2(),NW1=l7(),PW1=j3(),MW1=Tm.ValidationError,TW1=OD(),jW1=K4();function V6(F,A,B,D,J){if(!(this instanceof V6))return new V6(F,A,B,D,J);if(jW1(A)&&!A.instanceOfSchema)A=new NW1(A);if(A=this.schema||A,!this.schema&&A.options._id){if(F=F||{},F._id===void 0)F._id=new PW1}if(!A)throw new Tm.MissingSchemaError;this.$__setSchema(A),Pm.call(this,F,B,D,J),TW1(this,A,{decorateDoc:!0});for(let Z in A.methods)this[Z]=A.methods[Z];for(let Z in A.statics)this[Z]=A.statics[Z]}/*!
|
|
872
|
+
* Inherit from the NodeJS document
|
|
873
|
+
*/V6.prototype=Object.create(Pm.prototype);V6.prototype.constructor=V6;/*!
|
|
874
|
+
* ignore
|
|
875
|
+
*/V6.events=new Mm;/*!
|
|
876
|
+
* Browser doc exposes the event emitter API
|
|
877
|
+
*/V6.$emitter=new Mm;["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"].forEach(function(F){V6[F]=function(){return V6.$emitter[F].apply(V6.$emitter,arguments)}});/*!
|
|
878
|
+
* Module exports.
|
|
879
|
+
*/V6.ValidationError=MW1;um.exports=jm=V6});var Sm=z((RP1,DW)=>{/*!
|
|
880
|
+
* Module dependencies.
|
|
881
|
+
*/var uW1=O2(),OW1=Om(),km=!1;DW.exports=function F(){if(km)return OW1;return uW1};/*!
|
|
882
|
+
* ignore
|
|
883
|
+
*/DW.exports.setBrowser=function(F){km=F}});var dm=z((hm,mm)=>{/*!
|
|
884
|
+
* Module dependencies.
|
|
885
|
+
*/var kW1=O2(),SW1=import.meta.require("events").EventEmitter,fm=x7(),l3=l7(),xW1=M0(),gF=DF(),fW1=TD(),pJ=w9(),xm=rg(),_W1=n7(),gW1=PJ(),_m=xq(),bW1=fH(),yW1=XH(),gm=EJ(),vW1=zm(),JW=J1(),hW1=vH(),mW1=q9(),dW1=jq(),cW1=k7().trusted,lW1=Uq(),pW1=H2(),iJ=C1(),lJ=wm(),iW1=Sq(),bm=Symbol.for("mongoose:default"),ym=Symbol("mongoose:defaultConnection");Nm();var nW1=/^[0-9A-Fa-f]{24}$/,{AsyncLocalStorage:vm}=import.meta.require("async_hooks");function i(F){if(this.connections=[],this.nextConnectionId=0,this.models={},this.events=new SW1,this.__driver=gm.get(),this.options=Object.assign({pluralization:!0,autoIndex:!0,autoCreate:!0,autoSearchIndex:!1},F),(JW.getOption("createInitialConnection",this.options)??!0)&&this.__driver!=null)ZW(this);if(this.options.pluralization)this._pluralize=vW1;if(!F||!F[bm]){let B=this;this.Schema=function(){return this.base=B,l3.apply(this,arguments)},this.Schema.prototype=Object.create(l3.prototype),Object.assign(this.Schema,l3),this.Schema.base=this,this.Schema.Types=Object.assign({},l3.Types)}else for(let B of["Schema","model"])this[B]=i.prototype[B];if(this.Schema.prototype.base=this,F?.transactionAsyncLocalStorage)this.transactionAsyncLocalStorage=new vm;Object.defineProperty(this,"plugins",{configurable:!1,enumerable:!0,writable:!1,value:Object.values(yW1).map((B)=>[B,{deduplicate:!0}])})}i.prototype.cast=mW1;i.prototype.STATES=pJ;i.prototype.ConnectionStates=pJ;i.prototype.driver=gm;i.prototype.setDriver=function F(A){let B=this instanceof i?this:L2;if(B.__driver===A)return B;if(B.connections&&B.connections.find((X)=>X.readyState!==pJ.disconnected))throw new iJ("Cannot modify Mongoose driver if a connection is already open. Call `mongoose.disconnect()` before modifying the driver");if(B.__driver=A,Array.isArray(A.plugins)){for(let X of A.plugins)if(typeof X==="function")B.plugin(X)}let J=A.Connection,Z=B.connections[0];if(B.connections=[new J(B)],B.connections[0].models=B.models,Z==null)return B;for(let X of Object.values(B.models)){if(X.db!==Z)continue;X.$__updateConnection(B.connections[0])}return B};i.prototype.set=function(F,A){let B=this instanceof i?this:L2;if(arguments.length===1&&typeof F!=="object"){if(xm.indexOf(F)===-1){let Z=new lJ;throw Z.addError(F,new lJ.SetOptionInnerError(F)),Z}return B.options[F]}let D={};if(arguments.length===2)D={[F]:A};if(arguments.length===1&&typeof F==="object")D=F;let J=void 0;for(let[Z,X]of Object.entries(D)){if(xm.indexOf(Z)===-1){if(!J)J=new lJ;J.addError(Z,new lJ.SetOptionInnerError(Z));continue}if(B.options[Z]=X,Z==="objectIdGetter")if(X)Object.defineProperty(B.Types.ObjectId.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});else delete B.Types.ObjectId.prototype._id;else if(Z==="transactionAsyncLocalStorage"){if(X&&!B.transactionAsyncLocalStorage)B.transactionAsyncLocalStorage=new vm;else if(!X&&B.transactionAsyncLocalStorage)delete B.transactionAsyncLocalStorage}else if(Z==="createInitialConnection"){if(X&&!B.connection)ZW(B);else if(X===!1&&B.connection&&B.connection[ym]){if(B.connection.readyState===pJ.disconnected&&Object.keys(B.connection.models).length===0)B.connections.shift()}}}if(J)throw J;return B};i.prototype.get=i.prototype.set;i.prototype.createConnection=function(F,A){let B=this instanceof i?this:L2,J=new B.__driver.Connection(B);if(B.connections.push(J),B.nextConnectionId++,B.events.emit("createConnection",J),arguments.length>0)J.openUri(F,{...A,_fireAndForget:!0});return J};i.prototype.connect=async function F(A,B){if(typeof B==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new iJ("Mongoose.prototype.connect() no longer accepts a callback");let D=this instanceof i?this:L2;if(D.connection==null)ZW(D);return D.connection.openUri(A,B).then(()=>D)};i.prototype.disconnect=async function F(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new iJ("Mongoose.prototype.disconnect() no longer accepts a callback");let A=this instanceof i?this:L2;if(A.connections.length<=0)return;await Promise.all(A.connections.map((D)=>D.close()))};i.prototype.startSession=function(){let F=this instanceof i?this:L2;return F.connection.startSession.apply(F.connection,arguments)};i.prototype.pluralize=function(F){let A=this instanceof i?this:L2;if(arguments.length>0)A._pluralize=F;return A._pluralize};i.prototype.model=function(F,A,B,D){let J=this instanceof i?this:L2;if(typeof A==="string")B=A,A=!1;if(arguments.length===1){let $=J.models[F];if(!$)throw new iJ.MissingSchemaError(F);return $}if(JW.isObject(A)&&!(A instanceof l3))A=new l3(A);if(A&&!(A instanceof l3))throw new Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");D=D||{};let Z=A;if(A){if(J.get("cloneSchemas"))A=A.clone();J._applyPlugins(A)}let X=J.options.hasOwnProperty("overwriteModels")?J.options.overwriteModels:D.overwriteModels;if(J.models.hasOwnProperty(F)&&D.cache!==!1&&X!==!0){if(Z&&Z.instanceOfSchema&&Z!==J.models[F].schema)throw new J.Error.OverwriteModelError(F);if(B&&B!==J.models[F].collection.name){let $=J.models[F];return A=$.prototype.schema,$.__subclass(J.connection,A,B)}return J.models[F]}if(A==null)throw new J.Error.MissingSchemaError(F);let Y=J._model(F,A,B,D);return J.connection.models[F]=Y,J.models[F]=Y,Y};/*!
|
|
886
|
+
* ignore
|
|
887
|
+
*/i.prototype._model=function(F,A,B,D){let J=this instanceof i?this:L2,Z;if(typeof F==="function"){if(Z=F,F=Z.name,!(Z.prototype instanceof _m))throw new J.Error("The provided class "+F+" must extend Model")}if(A){if(J.get("cloneSchemas"))A=A.clone();J._applyPlugins(A)}if(A==null||!("pluralization"in A.options))A.options.pluralization=J.options.pluralization;if(!B)B=A.get("collection")||JW.toCollectionName(F,J.pluralize());iW1(A);let X=D.connection||J.connection;if(Z=J.Model.compile(Z||F,A,B,X,J),Z.init().catch(function Y(){}),X.emit("model",Z),A._applyDiscriminators!=null)for(let Y of A._applyDiscriminators.keys()){let{schema:$,options:G}=A._applyDiscriminators.get(Y);Z.discriminator(Y,$,G)}return Z};i.prototype.deleteModel=function(F){let A=this instanceof i?this:L2;return A.connection.deleteModel(F),delete A.models[F],A};i.prototype.modelNames=function(){let F=this instanceof i?this:L2;return Object.keys(F.models)};i.prototype._applyPlugins=function(F,A){let B=this instanceof i?this:L2;A=A||{},A.applyPluginsToDiscriminators=B.options&&B.options.applyPluginsToDiscriminators||!1,A.applyPluginsToChildSchemas=typeof(B.options&&B.options.applyPluginsToChildSchemas)==="boolean"?B.options.applyPluginsToChildSchemas:!0,bW1(F,B.plugins,A,"$globalPluginsApplied")};i.prototype.plugin=function(F,A){let B=this instanceof i?this:L2;return B.plugins.push([F,A]),B};i.prototype.__defineGetter__("connection",function(){return this.connections[0]});i.prototype.__defineSetter__("connection",function(F){if(F instanceof this.__driver.Connection)this.connections[0]=F,this.models=F.models});i.prototype.connections;i.prototype.nextConnectionId;i.prototype.Aggregate=dW1;Object.defineProperty(i.prototype,"Collection",{get:function(){return this.__driver.Collection},set:function(F){this.__driver.Collection=F}});Object.defineProperty(i.prototype,"Connection",{get:function(){return this.__driver.Connection},set:function(F){if(F===this.__driver.Connection)return;this.__driver.Connection=F}});i.prototype.version=hW1.version;i.prototype.Mongoose=i;i.prototype.Schema=l3;i.prototype.SchemaType=xW1;i.prototype.SchemaTypes=l3.Types;i.prototype.VirtualType=fW1;i.prototype.Types=_W1;i.prototype.Query=gW1;i.prototype.Model=_m;i.prototype.Document=kW1;i.prototype.DocumentProvider=Sm();i.prototype.ObjectId=gF.ObjectId;i.prototype.isValidObjectId=function(F){return(this instanceof i?this:L2).Types.ObjectId.isValid(F)};i.prototype.isObjectIdOrHexString=function(F){return pW1(F,"ObjectId")||typeof F==="string"&&nW1.test(F)};i.prototype.syncIndexes=function(F){return(this instanceof i?this:L2).connection.syncIndexes(F)};i.prototype.Decimal128=gF.Decimal128;i.prototype.Mixed=gF.Mixed;i.prototype.Date=gF.Date;i.prototype.Number=gF.Number;i.prototype.Error=W2();i.prototype.MongooseError=C1();i.prototype.now=function F(){return new Date};i.prototype.CastError=q2();i.prototype.SchemaTypeOptions=i2();i.prototype.mquery=Kq();i.prototype.sanitizeFilter=lW1;i.prototype.trusted=cW1;i.prototype.skipMiddlewareFunction=fm.skipWrappedFunction;i.prototype.overwriteMiddlewareResult=fm.overwriteResult;i.prototype.omitUndefined=_C();/*!
|
|
888
|
+
* Create a new default connection (`mongoose.connection`) for a Mongoose instance.
|
|
889
|
+
* No-op if there is already a default connection.
|
|
890
|
+
*/function ZW(F){if(F.connection)return;let A=F.createConnection();A[ym]=!0,A.models=F.models}var L2=mm.exports=hm=new i({[bm]:!0})});var pm=z((wP1,lm)=>{/*!
|
|
891
|
+
* Module dependencies.
|
|
892
|
+
*/var cm=sg();EJ().set(cm);var XW=dm();XW.setDriver(cm);XW.Mongoose.prototype.mongo=o4();lm.exports=XW});var bF=z((IP1,A1)=>{var B1=pm();A1.exports=B1;A1.exports.default=B1;A1.exports.mongoose=B1;A1.exports.cast=B1.cast;A1.exports.STATES=B1.STATES;A1.exports.setDriver=B1.setDriver;A1.exports.set=B1.set;A1.exports.get=B1.get;A1.exports.createConnection=B1.createConnection;A1.exports.connect=B1.connect;A1.exports.disconnect=B1.disconnect;A1.exports.startSession=B1.startSession;A1.exports.pluralize=B1.pluralize;A1.exports.model=B1.model;A1.exports.deleteModel=B1.deleteModel;A1.exports.modelNames=B1.modelNames;A1.exports.plugin=B1.plugin;A1.exports.connections=B1.connections;A1.exports.version=B1.version;A1.exports.Aggregate=B1.Aggregate;A1.exports.Mongoose=B1.Mongoose;A1.exports.Schema=B1.Schema;A1.exports.SchemaType=B1.SchemaType;A1.exports.SchemaTypes=B1.SchemaTypes;A1.exports.VirtualType=B1.VirtualType;A1.exports.Types=B1.Types;A1.exports.Query=B1.Query;A1.exports.Model=B1.Model;A1.exports.Document=B1.Document;A1.exports.ObjectId=B1.ObjectId;A1.exports.isValidObjectId=B1.isValidObjectId;A1.exports.isObjectIdOrHexString=B1.isObjectIdOrHexString;A1.exports.syncIndexes=B1.syncIndexes;A1.exports.Decimal128=B1.Decimal128;A1.exports.Mixed=B1.Mixed;A1.exports.Date=B1.Date;A1.exports.Number=B1.Number;A1.exports.Error=B1.Error;A1.exports.MongooseError=B1.MongooseError;A1.exports.now=B1.now;A1.exports.CastError=B1.CastError;A1.exports.SchemaTypeOptions=B1.SchemaTypeOptions;A1.exports.mongo=B1.mongo;A1.exports.mquery=B1.mquery;A1.exports.sanitizeFilter=B1.sanitizeFilter;A1.exports.trusted=B1.trusted;A1.exports.skipMiddlewareFunction=B1.skipMiddlewareFunction;A1.exports.overwriteMiddlewareResult=B1.overwriteMiddlewareResult});var nJ=hF(bF(),1);class im{async connect(F){if(!F)throw new Error("DB URI is not valid.");console.log("Connecting to database..."),await nJ.default.connect(F).catch((A)=>console.error("Unable to connect to the database:",A)),nJ.default.connection.on("open",()=>{console.log("Database connection is ready.")}),nJ.default.connection.on("error",(A)=>{console.error("Database connection error:",A)})}}var W8=hF(bF(),1);class R9{static transformSchemaToJSON(F,A){A.id=A._id,delete A._id,delete A.__v}}var nm=new W8.Schema({owner:{type:W8.Schema.Types.ObjectId,ref:"user",required:!0,index:!0},parent:{type:W8.Schema.Types.ObjectId,ref:"category",index:!0},nickname:{type:String,required:!0,trim:!0},type:{type:Number,required:!0,index:!0},email:{type:String,required:!0,unique:!0,lowercase:!0},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}}}});nm.set("toJSON",{transform:R9.transformSchemaToJSON});var sW1=W8.model("bot",nm);var aW1;((F)=>{F[F.Public=0]="Public",F[F.Private=1]="Private"})(aW1||={});var rW1;((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"})(rW1||={});var tW1;((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"})(tW1||={});var YW;((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"})(YW||={});var $W;((F)=>{F[F.Public=0]="Public",F[F.Private=1]="Private"})($W||={});var yF;((F)=>{F[F.Equals=0]="Equals",F[F.Includes=1]="Includes",F[F.StartsWith=2]="StartsWith",F[F.EndsWith=3]="EndsWith"})(yF||={});var T4;((F)=>{F[F.ChatBan=0]="ChatBan",F[F.Kick=1]="Kick",F[F.Block=2]="Block",F[F.RemoveFriend=3]="RemoveFriend",F[F.AddFriend=4]="AddFriend",F[F.Promote=5]="Promote",F[F.Copy=6]="Copy",F[F.Mimic=7]="Mimic",F[F.Hide=8]="Hide",F[F.Show=9]="Show",F[F.Blacklist=10]="Blacklist",F[F.Whitelist=11]="Whitelist"})(T4||={});var oW1;((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"})(oW1||={});var sm;((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.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.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.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"})(sm||={});var am;((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"})(am||={});var jP1={...sm,...am},eW1;((F)=>{F.Username="username",F.Email="email",F.Password="password",F.Shared="shared"})(eW1||={});var FK1;((F)=>{F.General="general",F.Input="input"})(FK1||={});var sJ;((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"})(sJ||={});var vF=hF(bF(),1);var rm=new vF.Schema({owner:{type:vF.Schema.Types.ObjectId,ref:"user",required:!0,index:!0},name:{type:String,required:!0,trim:!0},config:{replyLangs:{type:[String],enum:Object.values(sJ)},searchLangs:{type:[String],enum:Object.values(sJ)},platform:{type:[String],enum:Object.values(YW)},privacy:{type:String,enum:Object.values($W)},prefixes:{type:[String]},extraOwners:{type:[String]},admins:{type:[String]},whitelistUsers:{type:[String]},blacklistUsers:{type:[String]},excludedAutoAddFriends:{type:[String]},otherBots:{type:[String]},statusText:{type:[String]},statusInterval:{type:[Number]},level:{type:[Number]},bpLevel:{type:[Number]},disableMatchmakingChecks:{type:[Boolean]},disableJoinMessages:{type:[Boolean]},inviteTimeout:{type:Number},maxBotsPerLobby:{type:Number},maxBotsPerLobbyWithOwner:{type:Number},maxBotsPerLobbyWithAdmin:{type:Number},maxBotsPerLobbyWithWhitelistUser:{type:Number},allowMatchmaking:{type:Boolean},acceptFriendRequests:{type:Boolean},sendFriendRequestOnJoinParty:{type:Boolean},sendFriendRequestOnMemberJoinParty:{type:Boolean},runCommandsWithoutPrefix:{type:Boolean},setCosmeticsWithoutCommands:{type:Boolean},usernameTriggers:{type:[{triggers:{type:[String]},detectionMethods:{type:[Number],enum:Object.values(yF)},actions:{type:[Number],enum:Object.values(T4)},messages:{type:[String]}}]},messageContentTriggers:{type:[{triggers:{type:[String]},detectionMethods:{type:[Number],enum:Object.values(yF)},actions:{type:[Number],enum:Object.values(T4)},messages:{type:[String]}}]},cosmeticTriggers:{type:[{triggers:{type:[String]},detectionMethods:{type:[Number],enum:Object.values(yF)},actions:{type:[Number],enum:Object.values(T4)},messages:{type:[String]}}]},addFriendTrigger:{type:[{actions:{type:[Number],enum:Object.values(T4)},messages:{type:[String]}}]},memberJoinTrigger:{type:[{actions:{type:[Number],enum:Object.values(T4)},messages:{type:[String]}}]},changeCosmeticTrigger:{type:[{actions:{type:[Number],enum:Object.values(T4)},messages:{type:[String]}}]},onlyOwnerCommands:{type:[String]},onlyAdminCommands:{type:[String]},onlyWhitelistUsersCommands:{type:[String]},onlyFriendsCommands:{type:[String]},onlyPartyMembersCommands:{type:[String]},onlyWhisperCommands:{type:[String]},startOutfit:{type:[String]},startOutfitVariants:{type:[[[Number]]]},startBackpack:{type:[String]},startBackpackVariants:{type:[[[Number]]]},startPickaxe:{type:[String]},startPickaxeVariants:{type:[[[Number]]]},startBanner:{type:[String]},joinOutfit:{type:[String]},joinOutfitVariants:{type:[[[Number]]]},joinBackpack:{type:[String]},joinBackpackVariants:{type:[[[Number]]]},joinPickaxe:{type:[String]},joinPickaxeVariants:{type:[[[Number]]]},joinEmote:{type:[String]},joinEmoji:{type:[String]},joinBanner:{type:[String]},memberJoinOutfit:{type:[String]},memberJoinOutfitVariants:{type:[[[Number]]]},memberJoinBackpack:{type:[String]},memberJoinBackpackVariants:{type:[[[Number]]]},memberJoinPickaxe:{type:[String]},memberJoinPickaxeVariants:{type:[[[Number]]]},memberJoinEmote:{type:[String]},memberJoinEmoji:{type:[String]},memberJoinBanner:{type:[String]}}});rm.set("toJSON",{transform:R9.transformSchemaToJSON});var AK1=vF.model("category",rm);var aJ=hF(bF(),1);var GW=new aJ.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},connections:{discord:{id:{type:String,index:!0,unique:!0,sparse:!0},username:{type:String}},epic:{id:{type:String,index:!0,unique:!0,sparse:!0},username:{type:String}}}},{statics:{async verifyPassword(F,A){return Bun.password.verify(F,A)},async findByToken(F,A){let B=await this.findById(F);if(!B?.token||B.token!==A)return null;return B},async findByAPIToken(F,A){let B=await this.findById(F);if(!B?.apiToken||B.apiToken!==A)return null;return B}}});GW.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)}});GW.set("toJSON",{transform:R9.transformSchemaToJSON});var BK1=aJ.model("user",GW);export{BK1 as UserModel,im as DatabaseClient,AK1 as CategoryModel,sW1 as BotModel};
|