@truebit/cli 1.120.0-beta.262 → 1.120.0-beta.264
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/build/index.mjs +2 -2
- package/package.json +2 -2
package/build/index.mjs
CHANGED
|
@@ -102,7 +102,7 @@ Use mongoose.model(name, schema)`;super(r)}};Object.defineProperty(sz.prototype,
|
|
|
102
102
|
Use Model.updateOne() to update these arrays instead. See https://mongoosejs.com/docs/faq.html#divergent-array-error for more information.`;super(r)}};Object.defineProperty(fz.prototype,"name",{value:"DivergentArrayError"});Dvt.exports=fz});var Gb=l((G4a,kvt)=>{"use strict";var f6n=Ir(),lz=class extends f6n{constructor(e,r,n){r=r||"Field `"+e+"` is not in schema and strict mode is set to throw.",super(r),this.isImmutableError=!!n,this.path=e}};Object.defineProperty(lz.prototype,"name",{value:"StrictModeError"});kvt.exports=lz});var ySe=l((K4a,$vt)=>{"use strict";var l6n=Ir(),cz=class extends l6n{constructor(e,r){r=r||"Cannot populate path `"+e+"` because it is not in your schema. Set the `strictPopulate` option to false to override.",super(r),this.path=e}};Object.defineProperty(cz.prototype,"name",{value:"StrictPopulateError"});$vt.exports=cz});var ml=l((Bvt,Fvt)=>{"use strict";var Zo=Ir();Fvt.exports=Bvt=Zo;Zo.messages=fvt();Zo.Messages=Zo.messages;Zo.CastError=Iu();Zo.DocumentNotFoundError=rz();Zo.ValidationError=fv();Zo.ValidatorError=fSe();Zo.VersionError=lSe();Zo.ParallelSaveError=cSe();Zo.OverwriteModelError=dSe();Zo.MissingSchemaError=Tvt();Zo.MongooseBulkSaveIncompleteError=pSe();Zo.MongooseServerSelectionError=hSe();Zo.DivergentArrayError=mSe();Zo.StrictModeError=Gb();Zo.StrictPopulateError=ySe()});var yl=l((Y4a,Lvt)=>{"use strict";Lvt.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})});var ff=l((J4a,jvt)=>{"use strict";var c6n=_a(),Xo=class{constructor(e){if(e==null)return this;Object.assign(this,c6n(e))}},uf=yl();Object.defineProperty(Xo.prototype,"type",uf);Object.defineProperty(Xo.prototype,"validate",uf);Object.defineProperty(Xo.prototype,"cast",uf);Object.defineProperty(Xo.prototype,"required",uf);Object.defineProperty(Xo.prototype,"default",uf);Object.defineProperty(Xo.prototype,"ref",uf);Object.defineProperty(Xo.prototype,"refPath",uf);Object.defineProperty(Xo.prototype,"select",uf);Object.defineProperty(Xo.prototype,"index",uf);Object.defineProperty(Xo.prototype,"unique",uf);Object.defineProperty(Xo.prototype,"immutable",uf);Object.defineProperty(Xo.prototype,"sparse",uf);Object.defineProperty(Xo.prototype,"text",uf);Object.defineProperty(Xo.prototype,"transform",uf);jvt.exports=Xo});var dz=l((Z4a,_9)=>{"use strict";var d6n=Iu();_9.exports=function(e,r){if(_9.exports.convertToTrue.has(e))return!0;if(_9.exports.convertToFalse.has(e))return!1;if(e==null)return e;throw new d6n("boolean",e,r)};_9.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]);_9.exports.convertToFalse=new Set([!1,"false",0,"0","no"])});var pz=l((X4a,Uvt)=>{"use strict";var p6n=dz();Uvt.exports=function(t){let e=this?.path??null;return p6n(t,e)}});var bSe=l((Q4a,Vvt)=>{"use strict";Vvt.exports=function(t){if(Array.isArray(t)){if(!t.every(e=>typeof e=="number"||typeof e=="string"))throw new Error("$type array values must be strings or numbers");return t}if(typeof t!="number"&&typeof t!="string")throw new Error("$type parameter must be number, string, or array of numbers and strings");return t}});var zvt=l((e7a,Hvt)=>{"use strict";var h6n=Gb();Hvt.exports=function(t){t.$immutable?(t.$immutableSetter=m6n(t.path,t.options.immutable),t.set(t.$immutableSetter)):t.$immutableSetter&&(t.setters=t.setters.filter(e=>e!==t.$immutableSetter),delete t.$immutableSetter)};function m6n(t,e){return function(n,i,a,s){if(this==null||this.$__==null||this.isNew||s?.overwriteImmutable||!(typeof e=="function"?e.call(this,this):e))return n;let u=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(t):this.$__getValue(t);if(this.$__.strictMode==="throw"&&n!==u)throw new h6n(t,"Path `"+t+"` is immutable and strict mode is set to throw.",!0);return u}}});var Gvt=l((t7a,Wvt)=>{"use strict";Wvt.exports=function(e){return typeof e=="function"&&e.constructor&&e.constructor.name==="AsyncFunction"}});var Yvt=l((r7a,Kvt)=>{"use strict";Kvt.exports=function(e){let r=Object.keys(e),n=!0;for(let i=0,a=r.length;i<a;++i)if(typeof e[r[i]]=="object"&&e[r[i]]!==null){n=!1;break}return n}});var Zvt=l((n7a,Jvt)=>{"use strict";Jvt.exports=function(e){let r=[],n="",i="DEFAULT";for(let a=0;a<e.length;++a)i==="IN_SQUARE_BRACKETS"&&!/\d/.test(e[a])&&e[a]!=="]"&&(i="DEFAULT",n=r[r.length-1]+"["+n,r.splice(r.length-1,1)),e[a]==="["?(i!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS"&&(r.push(n),n=""),i="IN_SQUARE_BRACKETS"):e[a]==="]"?i==="IN_SQUARE_BRACKETS"?(i="IMMEDIATELY_AFTER_SQUARE_BRACKETS",r.push(n),n=""):(i="DEFAULT",n+=e[a]):e[a]==="."?(i!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS"&&(r.push(n),n=""),i="DEFAULT"):n+=e[a];return i!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS"&&r.push(n),r}});var t_t=l(Ay=>{var tR=Zvt(),Xvt=["__proto__","constructor","prototype"];Ay.get=function(t,e,r,n){var i;typeof r=="function"&&(r.length<2?(n=r,r=void 0):(i=r,r=void 0)),n||(n=e_t);var a=typeof t=="string"?tR(t):t;if(!Array.isArray(a))throw new TypeError("Invalid `path`. Must be either string or array");for(var s=e,o,u=0;u<a.length;++u){if(o=a[u],typeof a[u]!="string"&&typeof a[u]!="number")throw new TypeError("Each segment of path to `get()` must be a string or number, got "+typeof a[u]);if(Array.isArray(s)&&!/^\d+$/.test(o)){var f=a.slice(u);return[].concat(s).map(function(d){return d?Ay.get(f,d,r||i,n):n(void 0)})}if(i)s=i(s,o);else{var c=r&&s[r]?s[r]:s;s=c instanceof Map?c.get(o):c[o]}if(!s)return n(s)}return n(s)};Ay.has=function(t,e){var r=typeof t=="string"?tR(t):t;if(!Array.isArray(r))throw new TypeError("Invalid `path`. Must be either string or array");for(var n=r.length,i=e,a=0;a<n;++a){if(typeof r[a]!="string"&&typeof r[a]!="number")throw new TypeError("Each segment of path to `has()` must be a string or number, got "+typeof r[a]);if(i==null||typeof i!="object"||!(r[a]in i))return!1;i=i[r[a]]}return!0};Ay.unset=function(t,e){var r=typeof t=="string"?tR(t):t;if(!Array.isArray(r))throw new TypeError("Invalid `path`. Must be either string or array");for(var n=r.length,i=e,a=0;a<n;++a){if(i==null||typeof i!="object"||!(r[a]in i))return!1;if(typeof r[a]!="string"&&typeof r[a]!="number")throw new TypeError("Each segment of path to `unset()` must be a string or number, got "+typeof r[a]);if(Xvt.indexOf(r[a])!==-1)return!1;if(a===n-1)return delete i[r[a]],!0;i=i instanceof Map?i.get(r[a]):i[r[a]]}return!0};Ay.set=function(t,e,r,n,i,a){var s;typeof n=="function"&&(n.length<2?(i=n,n=void 0):(s=n,n=void 0)),i||(i=e_t);var o=typeof t=="string"?tR(t):t;if(!Array.isArray(o))throw new TypeError("Invalid `path`. Must be either string or array");if(r!=null){for(var u=0;u<o.length;++u){if(typeof o[u]!="string"&&typeof o[u]!="number")throw new TypeError("Each segment of path to `set()` must be a string or number, got "+typeof o[u]);if(Xvt.indexOf(o[u])!==-1)return}for(var f=a||/\$/.test(t)&&a!==!1,c=r,d,u=0,h=o.length-1;u<h;++u){if(d=o[u],d=="$"){if(u==h-1)break;continue}if(Array.isArray(c)&&!/^\d+$/.test(d)){var p=o.slice(u);if(!f&&Array.isArray(e))for(var m=0;m<c.length&&m<e.length;++m)Ay.set(p,e[m],c[m],n||s,i,f);else for(var m=0;m<c.length;++m)Ay.set(p,e,c[m],n||s,i,f);return}if(s)c=s(c,d);else{var y=n&&c[n]?c[n]:c;c=y instanceof Map?y.get(d):y[d]}if(!c)return}if(d=o[h],n&&c[n]&&(c=c[n]),Array.isArray(c)&&!/^\d+$/.test(d))if(!f&&Array.isArray(e))Qvt(c,e,d,s,n,i);else for(var m=0;m<c.length;++m){var b=c[m];b&&(s?s(b,d,i(e)):(b[n]&&(b=b[n]),b[d]=i(e)))}else s?s(c,d,i(e)):c instanceof Map?c.set(d,i(e)):c[d]=i(e)}};Ay.stringToParts=tR;function Qvt(t,e,r,n,i,a){for(var s,o=0;o<t.length&&o<e.length;++o)s=t[o],Array.isArray(s)&&Array.isArray(e[o])?Qvt(s,e[o],r,n,i,a):s&&(n?n(s,r,a(e[o])):(s[i]&&(s=s[i]),s[r]=a(e[o])))}function e_t(t){return t}});var bl=l((r_t,n_t)=>{"use strict";n_t.exports=r_t=t_t()});var vSe=l((a7a,i_t)=>{"use strict";var y6n=_a(),gSe=class{constructor(e){if(this._docs={},this._childDocs=[],e!=null&&(e=y6n(e),Object.assign(this,e),typeof e.subPopulate=="object"&&(this.populate=e.subPopulate),e.perDocumentLimit!=null&&e.limit!=null))throw new Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+e.path+"`.")}};i_t.exports=gSe});var s_t=l(a_t=>{"use strict";a_t.isMongooseDocumentArray=function(t){return Array.isArray(t)&&t.isMongooseDocumentArray}});var hz=l((o7a,o_t)=>{"use strict";o_t.exports=function(e,r,n){let i=Object.keys(r.tree),a={};for(let s of i)n&&(e.paths[s]||e.nested[s]||e.singleNestedPaths[s])||(a[s]=r.tree[s]);e.options._isMerging=!0,e.add(a,null),delete e.options._isMerging,e.callQueue=e.callQueue.concat(r.callQueue),e.method(r.methods),e.static(r.statics);for(let[s,o]of Object.entries(r._userProvidedOptions))s in e._userProvidedOptions||e.set(s,o);for(let s in r.query)e.query[s]=r.query[s];for(let s in r.virtuals)e.virtuals[s]=r.virtuals[s].clone();e._indexes=e._indexes.concat(r._indexes||[]),e.s.hooks.merge(r.s.hooks,!1)}});var l_t=l((u_t,f_t)=>{"use strict";var u7a=zt(),yc=f_t.exports=u_t=function(){};yc.ctor=function(){let t=[...arguments],e=function(){yc.apply(this,arguments),this.paths={},this.states={}};return e.prototype=new yc,e.prototype.constructor=e,e.prototype.stateNames=t,t.forEach(function(r){e.prototype[r]=function(n){this._changeState(n,r)}}),e};yc.prototype._changeState=function(e,r){let n=this.paths[e];if(n===r)return;let i=this.states[n];i&&delete i[e],this.paths[e]=r,this.states[r]=this.states[r]||{},this.states[r][e]=!0};yc.prototype.clear=function(e){if(this.states[e]==null)return;let r=Object.keys(this.states[e]),n=r.length,i;for(;n--;)i=r[n],delete this.states[e][i],delete this.paths[i]};yc.prototype.clearPath=function(e){let r=this.paths[e];r&&(delete this.paths[e],delete this.states[r][e])};yc.prototype.getStatePaths=function(e){return this.states[e]!=null?this.states[e]:{}};yc.prototype.some=function(){let e=this,r=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(r,function(n){return e.states[n]==null?!1:Object.keys(e.states[n]).length})};yc.prototype._iter=function(e){return function(){let r=[...arguments],n=r.pop();r.length||(r=this.stateNames);let i=this;return r.reduce(function(s,o){return i.states[o]==null?s:s.concat(Object.keys(i.states[o]))},[])[e](function(s,o,u){return n(s,o,u)})}};yc.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)};yc.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)};yc.prototype.clone=function(){let e=new this.constructor;e.paths={...this.paths};for(let r of this.stateNames)r in this.states&&(e.states[r]=this.states[r]==null?this.states[r]:{...this.states[r]});return e}});var p_t=l((c_t,d_t)=>{"use strict";var b6n=l_t(),g6n=b6n.ctor("require","modify","init","default","ignore");d_t.exports=c_t=Da;function Da(){this.activePaths=new g6n}Da.prototype.strictMode=!0;Da.prototype.fullPath=void 0;Da.prototype.selected=void 0;Da.prototype.shardval=void 0;Da.prototype.saveError=void 0;Da.prototype.validationError=void 0;Da.prototype.adhocPaths=void 0;Da.prototype.removing=void 0;Da.prototype.inserting=void 0;Da.prototype.saving=void 0;Da.prototype.version=void 0;Da.prototype._id=void 0;Da.prototype.ownerDocument=void 0;Da.prototype.populate=void 0;Da.prototype.populated=void 0;Da.prototype.primitiveAtomics=void 0;Da.prototype.wasPopulated=!1;Da.prototype.scope=void 0;Da.prototype.session=null;Da.prototype.pathsToScopes=null;Da.prototype.cachedRequired=null});var mz=l((f7a,y_t)=>{"use strict";var _Se=sr().Binary,v6n=sr().UUID,h_t=zt();function _0(t,e,r){let n=t;t==null&&(n=0);let i,a,s;Array.isArray(e)?(a=e[0],s=e[1]):i=e;let o;return typeof n=="number"||n instanceof Number?o=Buffer.alloc(n):o=Buffer.from(n,i,r),h_t.decorate(o,_0.mixin),o.isMongooseBuffer=!0,o[_0.pathSymbol]=a,o[m_t]=s,o._subtype=0,o}var _6n=Symbol.for("mongoose#Buffer#_path"),m_t=Symbol.for("mongoose#Buffer#_parent");_0.pathSymbol=_6n;_0.mixin={_subtype:void 0,_markModified:function(){let t=this[m_t];return t&&t.markModified(this[_0.pathSymbol]),this},write:function(){let t=Buffer.prototype.write.apply(this,arguments);return t>0&&this._markModified(),t},copy:function(t){let e=Buffer.prototype.copy.apply(this,arguments);return t?.isMongooseBuffer&&t._markModified(),e}};h_t.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(t){Buffer.prototype[t]&&(_0.mixin[t]=function(){let e=Buffer.prototype[t].apply(this,arguments);return this._markModified(),e})});_0.mixin.toObject=function(t){let e=typeof t=="number"?t:this._subtype||0;return new _Se(Buffer.from(this),e)};_0.mixin.$toObject=_0.mixin.toObject;_0.mixin.toBSON=function(){return new _Se(this,this._subtype||0)};_0.mixin.toUUID=function(){if(this._subtype!==4)throw new Error("Cannot convert a Buffer with subtype "+this._subtype+" to a UUID");return new v6n(this)};_0.mixin.equals=function(t){if(!Buffer.isBuffer(t)||this.length!==t.length)return!1;for(let e=0;e<this.length;++e)if(this[e]!==t[e])return!1;return!0};_0.mixin.subtype=function(t){if(typeof t!="number")throw new TypeError("Invalid subtype. Expected a number");this._subtype!==t&&this._markModified(),this._subtype=t};_0.Binary=_Se;y_t.exports=_0});var lv=l(ESe=>{"use strict";ESe.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed");ESe.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")});var cv=l((c7a,g_t)=>{"use strict";var yz=ka(),E6n=lv(),S6n=sv(),b_t=zt();function bc(t,e,r,n){if(e?.default){let i=e.default;Array.isArray(i)&&i.length===0?e.default=Array:!e.shared&&S6n(i)&&b_t.hasOwnKeys(i)===!1&&(e.default=function(){return{}})}yz.call(this,t,e,"Mixed",n),this[E6n.schemaMixedSymbol]=!0}bc.schemaName="Mixed";bc.defaultOptions={};bc.prototype=Object.create(yz.prototype);bc.prototype.constructor=bc;bc.get=yz.get;bc.set=yz.set;bc.setters=[];bc.prototype.cast=function(t){return t instanceof Error?b_t.errorToPOJO(t):t};bc.prototype.castForQuery=function(t,e){return e};bc.prototype.toJSONSchema=function(e){return{}};g_t.exports=bc});var __t=l((p7a,v_t)=>{"use strict";v_t.exports=class{constructor(e,r,n){this.subdocSnapshot=e,this.activePaths=r,this.version=n}}});var gz=l((h7a,E_t)=>{"use strict";var w6n=Ir(),bz=class extends w6n{constructor(e,r){let n=Array.isArray(r)?"array":"primitive value";super("Tried to set nested object field `"+e+`\` to ${n} \``+r+"`"),this.path=e}};Object.defineProperty(bz.prototype,"name",{value:"ObjectExpectedError"});E_t.exports=bz});var _z=l((m7a,S_t)=>{"use strict";var A6n=Ir(),vz=class extends A6n{constructor(e,r,n){super('Parameter "'+r+'" to '+n+'() must be an object, got "'+(e==null?e:e.toString())+'" (type '+typeof e+")")}};Object.defineProperty(vz.prototype,"name",{value:"ObjectParameterError"});S_t.exports=vz});var A_t=l((y7a,w_t)=>{"use strict";var x6n=Ir(),Ez=class extends x6n{constructor(e){super("Can't validate() the same doc multiple times in parallel. Document: "+e._doc._id)}};Object.defineProperty(Ez.prototype,"name",{value:"ParallelValidateError"});w_t.exports=Ez});var SSe=l((b7a,x_t)=>{"use strict";x_t.exports=function(e){let r={},n=Object.keys(e);for(let i of n){if(i.indexOf(".")===-1){r[i]=1;continue}let a=i.split("."),s=a[0];for(let o=0;o<a.length;++o)r[s]=1,o+1<a.length&&(s=s+"."+a[o+1])}return r}});var O_t=l((g7a,T_t)=>{"use strict";T_t.exports=function(e){return e==null||typeof e!="object"?!1:e.$slice==null&&e.$elemMatch==null&&e.$meta==null&&e.$==null}});var Sz=l((v7a,C_t)=>{"use strict";var T6n=O_t();C_t.exports=function(e,r,n,i,a,s,o){let u=Object.keys(e.$__schema.paths),f=u.length,c=o?.skipParentChangeTracking;for(let d=0;d<f;++d){let h,p="",m=u[d];if(m==="_id"&&e.$__.skipId)continue;let y=e.$__schema.paths[m],b=y.splitPath(),v=b.length;if(b[v-1]==="$*")continue;let E=!1,x=e._doc;for(let w=0;w<v&&x!=null;++w){let M=b[w];if(p+=(p.length?".":"")+M,n===!0){if(p in r)break}else if(n===!1&&r&&!E){let N=y.$isSingleNested||y.$isMongooseDocumentArray;if(p in r&&!T6n(r[p])||w===v-1&&N&&i!=null&&i[p])E=!0;else if(i!=null&&!i[p])break}if(w===v-1){if(x[M]!==void 0)break;if(a!=null){if(typeof y.defaultValue=="function"){if(!y.defaultValue.$runBeforeSetters&&a||y.defaultValue.$runBeforeSetters&&!a)break}else if(!a)continue}if(s&&s[p])break;if(r&&n!==null){if(n===!0){if(m in r)continue;try{h=y.getDefault(e,!1)}catch(N){e.invalidate(m,N);break}typeof h<"u"&&(x[M]=h,wSe(e,m,c))}else if(E){try{h=y.getDefault(e,!1)}catch(N){e.invalidate(m,N);break}typeof h<"u"&&(x[M]=h,wSe(e,m,c))}}else{try{h=y.getDefault(e,!1)}catch(N){e.invalidate(m,N);break}typeof h<"u"&&(x[M]=h,wSe(e,m,c))}}else x=x[M]}}};function wSe(t,e,r){t.$__.activePaths.default(e),!r&&t.$isSubdocument&&t.$isSingleNested&&t.$parent()!=null&&t.$parent().$__.activePaths.default(t.$__pathRelativeToParent(e))}});var wz=l((_7a,M_t)=>{"use strict";M_t.exports=function(e,r,n){n=n||{};let i=n.skipDocArrays,a=0;if(!e)return a;for(let s of Object.keys(e.$__.activePaths.getStatePaths("modify")))i&&e.$__schema.path(s)?.$isMongooseDocumentArray||s.startsWith(r+".")&&(e.$__.activePaths.clearPath(s),++a,e.$isSubdocument&&I_t(e,s));return a};function I_t(t,e,r=new Set){if(r.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");let n=t.$parent(),i=t.$__pathRelativeToParent(void 0,!1)+"."+e;n.$__.activePaths.clearPath(i),n.$isSubdocument&&I_t(n,i,r)}});var xz=l(ASe=>{"use strict";var O6n=_a(),C6n=Mt().documentSchemaSymbol,I6n=i1().internalToObjectOptions,R_t=zt(),E9,M6n=Mt().getSymbol,Az=Mt().scopeSymbol,P_t=R_t.isPOJO;ASe.compile=q_t;ASe.defineKey=N_t;var P6n=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),R6n=Object.freeze({noDottedPath:!0});function q_t(t,e,r,n){E9=E9||Dh();let i=n.typeKey;for(let a of Object.keys(t)){let s=t[a],u=P_t(s)&&R_t.hasOwnKeys(s)&&(!s[i]||i==="type"&&P_t(s.type)&&s.type.type)?s:null;N_t({prop:a,subprops:u,prototype:e,prefix:r,options:n})}}function N_t({prop:t,subprops:e,prototype:r,prefix:n,options:i}){E9=E9||Dh();let a=(n?n+".":"")+t;n=n||"";let s=n?Object.freeze({}):R6n;e?Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){if(!this.$__)return;let o=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[a]){let u=Object.create(E9.prototype,q6n(this));n||(u.$__[Az]=this),u.$__.nestedPath=a,Object.defineProperty(u,"schema",{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(u,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(u,C6n,{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(u,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return O6n(o.get(a,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(u,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o.get(a,null,{virtuals:this?.schema?.options?.toObject?.virtuals||null})}}),Object.defineProperty(u,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o.get(a,null,{virtuals:this?.schema?.options?.toJSON?.virtuals||null})}}),Object.defineProperty(u,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(u,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Object.keys(this.get(a,null,P6n)||{}).length===0}}),Object.defineProperty(u,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),q_t(e,u,a,i),this.$__.getters[a]=u}return this.$__.getters[a]},set:function(o){o?.$__isNested?o=o.$__get():o instanceof E9&&!o.$__isNested&&(o=o.$toObject(I6n)),(this.$__[Az]||this).$set(a,o)}}):Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){return this[M6n].call(this.$__[Az]||this,a,null,s)},set:function(o){this.$set.call(this.$__[Az]||this,a,o)}})}function q6n(t){let e={};return Object.getOwnPropertyNames(t).forEach(function(r){["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(r)!==-1&&(e[r]=Object.getOwnPropertyDescriptor(t,r),e[r].enumerable=!1)}),e}});var k_t=l((S7a,D_t)=>{"use strict";D_t.exports=function(e){return e==null?null:Object.keys(e)[0]}});var Tz=l(xSe=>{"use strict";var N6n=sr().Binary,$_t=Jo(),B_t=QP(),D6n=ml(),k6n=fe("util");xSe.flatten=F_t;xSe.modifiedPaths=L_t;function F_t(t,e,r,n){let i;t&&B_t(t)&&!Buffer.isBuffer(t)?i=Object.keys(t.toObject({transform:!1,virtuals:!1})||{}):i=Object.keys(t||{});let a=i.length,s={};e=e?e+".":"";for(let o=0;o<a;++o){let u=i[o],f=t[u];s[e+u]=f;let c=n?.path?.(e+u),d=n?.nested?.[e+u];if(c?.instance!=="Mixed"){if(j_t(f)){if(r?.skipArrays&&Array.isArray(f))continue;let h=F_t(f,e+u,r,n);for(let p in h)s[p]=h[p];Array.isArray(f)&&(s[e+u]=f)}if(d){let h=Object.keys(n.paths);for(let p of h)p.startsWith(e+u+".")&&!Object.hasOwn(s,p)&&(s[p]=void 0)}}}return s}function L_t(t,e,r,n=null){if(t==null||typeof t!="object")return;if(n==null&&(n={raw:{update:t,path:e},trace:new WeakSet}),n.trace.has(t))throw new D6n(`a circular reference in the update value, updateValue:
|
|
103
103
|
${k6n.inspect(n.raw.update,{showHidden:!1,depth:1})}
|
|
104
104
|
updatePath: '${n.raw.path}'`);n.trace.add(t);let i=Object.keys(t||{}),a=i.length;r=r||{},e=e?e+".":"";for(let s=0;s<a;++s){let o=i[s],u=t[o],f=e+o;r[f]=!0,!Buffer.isBuffer(u)&&B_t(u)&&(u=u.toObject({transform:!1,virtuals:!1})),j_t(u)&&L_t(u,e+o,r,n)}return n.trace.delete(t),r}function j_t(t){return t&&typeof t=="object"&&!(t instanceof Date)&&!$_t(t,"ObjectId")&&(!Array.isArray(t)||t.length!==0)&&!(t instanceof Buffer)&&!$_t(t,"Decimal128")&&!(t instanceof N6n)}});var $a=l((A7a,U_t)=>{"use strict";U_t.exports=function(e,r,n){let i,a=!1;if(typeof r=="string"){if(r.indexOf(".")===-1){let u=TSe(e,r);return u??n}i=r.split(".")}else if(a=!0,i=r,i.length===1){let u=TSe(e,i[0]);return u??n}let s=r,o=e;for(let u of i){if(o==null)return n;if(!a&&o[s]!=null)return o[s];o=TSe(o,u),a||(s=s.substr(u.length+1))}return o??n};function TSe(t,e){return t==null?t:t instanceof Map?t.get(e):t[e]}});var OSe=l((x7a,H_t)=>{"use strict";var V_t=Jo();H_t.exports=function(e,r){return typeof e=="string"&&typeof r=="string"||typeof e=="number"&&typeof r=="number"?e===r:V_t(e,"ObjectId")&&V_t(r,"ObjectId")?e.toString()===r.toString():!1}});var Oz=l((T7a,z_t)=>{"use strict";var $6n=OSe();z_t.exports=function(e,r){if(e?.discriminators==null)return null;for(let n of Object.keys(e.discriminators)){let i=e.discriminators[n];if(i.discriminatorMapping!=null&&$6n(i.discriminatorMapping.value,r))return i}return null}});var G_t=l((O7a,W_t)=>{"use strict";var B6n=$a(),F6n=Oz();W_t.exports=function t(e,r,n){n=n||{};let i=n.typeOnly,a=Array.isArray(r)?r:r.indexOf(".")===-1?[r]:r.split("."),s=null,o="adhocOrUndefined",u=F6n(e.schema,e.get(e.schema.options.discriminatorKey))||e.schema;for(let f=0;f<a.length;++f){let c=a.slice(0,f+1).join(".");if(s=u.path(c),s==null){o="adhocOrUndefined";continue}if(s.instance==="Mixed")return i?"real":s;if(o=u.pathType(c),(s.$isSingleNested||s.$isMongooseDocumentArrayElement)&&s.schema.discriminators!=null){let d=s.schema.discriminators,h=e.get(c+"."+B6n(s,"schema.options.discriminatorKey"));if(h==null||d[h]==null)continue;let p=a.slice(f+1).join(".");return t(e.get(c),p,n)}}return i?o:s}});var Y_t=l((C7a,K_t)=>{"use strict";var L6n=$a();K_t.exports=function(e,r,n){let i=n!=null?Object.keys(L6n(e.tree,n,{})):Object.keys(e.tree),a=new Set(Object.keys(r)),s;if(a.size>1){s=new Set;for(let o of i)a.has(o)&&s.add(o);for(let o of a)s.has(o)||s.add(o);s=Array.from(s)}else s=Array.from(a);return s}});var Z_t=l((I7a,J_t)=>{"use strict";J_t.exports=function(e,r){if(r.length===1)return;let n=r[0],i;for(let a=0;a<r.length-1;++a){let s=e.path(n);s?.schema?(i=s.schema.options.strict,e=s.schema,n=s.$isMongooseDocumentArray&&!isNaN(r[a+1])?"":r[a+1]):n+=n.length?"."+r[a+1]:r[a+1]}return i}});var Cz=l((M7a,X_t)=>{"use strict";var j6n=zt(),U6n=new Set(["__index","__parentArray","_doc"]);X_t.exports=function(e,r){if(j6n.isPOJO(e)&&e.$__!=null&&e._doc!=null){if(r){let n={};for(let i of Object.keys(e))typeof i!="symbol"&&i[0]!=="$"&&(U6n.has(i)||(n[i]=e[i]));return{...e._doc,...n}}return e._doc}return e}});var S9=l((P7a,Q_t)=>{"use strict";Q_t.exports=function(e){return e==null?!0:typeof e=="object"?!("$meta"in e)&&!("$slice"in e):!0}});var w9=l((R7a,e8t)=>{"use strict";var V6n=S9(),H6n=y9();e8t.exports=function t(e){if(e==null)return null;let r=Object.keys(e),n=null;if(r.length===1&&r[0]==="_id")n=!e._id;else for(let i=0;i<r.length;++i){let a=r[i];if(a!=="_id"&&V6n(e[a])&&(n=H6n(e[a])?t(e[a])??n:!e[a],n!=null))break}return n}});var CSe=l((q7a,t8t)=>{"use strict";var z6n=S9();t8t.exports=function(e,r){if(e==null)return!1;if(r==="_id")return e._id===0;let n=Object.keys(e),i=null;for(let a of n)if(z6n(e[a])){i=e[r]===1?"inclusive":"exclusive";break}return i==="inclusive"?e[r]!==1:i==="exclusive"?e[r]===0:!1}});var ISe=l((N7a,r8t)=>{"use strict";var W6n=zt();r8t.exports=function(e,r){if(e._doc._id==null||r==null||r.length===0)return;let n=String(e._doc._id);for(let i of r){if(i.isVirtual)continue;let s=i.path.split(".");for(let o=0;o<s.length-1;++o){let u=s.slice(0,o+1).join("."),f=s.slice(o+1).join("."),c=e.get(u);if(c!=null&&W6n.isMongooseDocumentArray(c)){for(let d=0;d<c.length;++d)c[d]&&c[d].populated(f,i._docs[n]==null?void 0:i._docs[n][d],i);break}}}}});var MSe=l((D7a,i8t)=>{"use strict";var{isPOJO:G6n}=zt();i8t.exports=n8t;function n8t(t){let e=Object.keys(t),r=e.length,n,i,a;for(;r--;){if(i=e[r],a=t[i],G6n(a)&&(t[i]=n8t(a)),t[i]===void 0){delete t[i];continue}n=!0}return n?t:void 0}});var PSe=l((k7a,a8t)=>{"use strict";var K6n=/\./g;a8t.exports=function(e){if(e.indexOf(".")===-1)return[e];let r=e.split(K6n),n=r.length,i=new Array(n),a="";for(let s=0;s<n;++s)a+=a.length!==0?"."+r[s]:r[s],i[s]=a;return i}});var o8t=l(($7a,s8t)=>{"use strict";s8t.exports=function(e,r,n,i,a){let s=Object.keys(e).reduce((u,f)=>u||f.startsWith(r+"."),!1),o=r+"."+n.options.discriminatorKey;!s&&a.length===1&&a[0]===o&&i.splice(i.indexOf(o),1)}});var gc=l((B7a,u8t)=>{"use strict";var Y6n=OSe();u8t.exports=function(e,r){if(e==null)return null;for(let n of Object.keys(e)){let i=e[n];if(i.schema&&i.schema.discriminatorMapping&&Y6n(i.schema.discriminatorMapping.value,r))return i}return null}});var Iz=l((F7a,f8t)=>{"use strict";f8t.exports=function(e,r){let n=r.split("."),i="",a,s,o;for(let u=0;u<n.length;++u)if(i+=i.length?".":""+n[u],e[i]){for(s=Object.keys(e),o=s.length,a=0;a<o;++a)s[u].indexOf(i+".")===0&&s[u].indexOf(r);return!0}return!1}});var rR=l(dv=>{"use strict";var l8t=vSe(),J6n=o8t(),c8t=$a(),Z6n=gc(),X6n=S9(),Q6n=_a(),eyn=Iz();dv.preparePopulationOptionsMQ=function(e,r){let n=e._mongooseOptions.populate,i=Object.keys(n).reduce((o,u)=>o.concat([n[u]]),[]);r.lean!=null&&i.filter(o=>o?.options?.lean==null).forEach(tyn(r.lean));let a=e?.options?.session||null;a!=null&&i.forEach(o=>{if(o.options==null){o.options={session:a};return}"session"in o.options||(o.options.session=a)});let s=e._fieldsForExec();for(let o=0;o<i.length;++o)i[o]instanceof l8t?i[o]=new l8t({...i[o],_queryProjection:s,_localModel:e.model}):(i[o]._queryProjection=s,i[o]._localModel=e.model);return i};dv.createModel=function(e,r,n,i,a){e.hooks.execPreSync("createModel",r);let s=e.schema?e.schema.discriminatorMapping:null,o=s?.isRoot?s.key:null,u=r[o];if(o&&u&&e.discriminators){let c=e.discriminators[u]||Z6n(e.discriminators,u);if(c){let d=Q6n(i);return dv.applyPaths(d,c.schema),new c(void 0,d,{skipId:!0})}}let f={skipId:!0,isNew:!1,willInit:!0};return a!=null&&"defaults"in a&&(f.defaults=a.defaults),new e(void 0,n,f)};dv.createModelAndInit=function(e,r,n,i,a,s,o){let u=s?{populated:s}:void 0,f=dv.createModel(e,r,n,i,a);try{f.$init(r,u,o)}catch(c){o(c,f)}};dv.applyPaths=function(e,r,n){let i,a,s=new Set;if(e){a=Object.keys(e);let h=[];for(let p=0;p<a.length;++p){let m=a[p];a[p][0]==="-"&&(delete e[m],m==="-_id"?e._id=0:h.push(m.slice(1)))}a=Object.keys(e);for(let p=0;p<a.length;++p){if(a[p][0]==="+")continue;let m=e[a[p]];if(X6n(m)&&!(a[p]==="_id"&&a.length>1)&&!(a[p]===r.options.discriminatorKey&&a.length>1&&m!=null&&!m)){i=!m;break}}for(let p of h){let m=r.path(p);!m?.selected||i!==!1?(e[p]=0,i=!0):m?.selected&&i===!1&&s.add(p)}}let o=[],u=[],f=[];switch(c(r),i){case!0:for(let h of u)e[h]=0;break;case!1:r?.paths._id?.options?.select===!1&&(e._id=0);for(let h of o)s.has(h)||eyn(e,h)||(e[h]=e[h]||1);break;case void 0:if(e==null)break;for(let h of Object.keys(e||{}))h.startsWith("+")&&delete e[h];for(let h of u)e[h]==null&&(e[h]=0);break}function c(h,p){if(p||(p=""),f.indexOf(h)!==-1)return[];f.push(h);let m=[];return h.eachPath(function(y,b){if(p&&(y=p+"."+y),b.$isSchemaMap||y.endsWith(".$*")){let E="+"+y,x=e&&E in e;b.options?.select===!1&&!x&&u.push(y);return}let v=d(y,b);if(v==null&&!Array.isArray(b)&&b.$isMongooseArray&&!b.$isMongooseDocumentArray&&(v=d(y,b.embeddedSchemaType)),v!=null&&m.push(v),b.schema){let E=c(b.schema,y);i===!1&&J6n(e,y,b.schema,o,E)}}),f.pop(),m}function d(h,p){if(e==null||typeof p.selected!="boolean")return;if(p.selected===!1&&e[h]){n&&(e[h]=0);return}if(!i&&p.selected&&h===r.options.discriminatorKey&&e[h]!=null&&!e[h]){delete e[h];return}if(i===!1&&p.selected&&e[h]!=null&&!e[h]){delete e[h];return}let m="+"+h;if(e&&m in e){delete e[m],i===!1&&a.length>1&&!~a.indexOf(h)&&!n?e[h]=1:i==null&&n&&p.selected===!1&&(e[h]=0);return}let b=h.split("."),v="";for(let E=0;E<b.length;++E)if(v+=v.length?"."+b[E]:b[E],u.indexOf(v)!==-1)return;if(!i&&p?.options?.$skipDiscriminatorCheck){let E="";for(let x=0;x<b.length;++x){E+=(E.length===0?"":".")+b[x];let w=c8t(e,E,!1)||c8t(e,E+".$",!1);if(w&&typeof w!="object")return}}return(p.selected?o:u).push(h),h}};function tyn(t){return function(e){e.options||(e.options={}),Array.isArray(t?.virtuals)&&(t=Object.assign({},t),t.virtuals=t.virtuals.filter(r=>typeof r=="string"&&r.startsWith(e.path+".")).map(r=>r.slice(e.path.length+1))),e.options.lean=t}}});var RSe=l((j7a,d8t)=>{"use strict";function ryn(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}d8t.exports=ryn});var h8t=l((U7a,p8t)=>{"use strict";p8t.exports=function(e,r,n){let i=r[0],a=n,s=e;for(let o=0;o<r.length-1;++o){let u=a.path(i);if(u?.schema){let f=s.get(i);if(a=u.schema,i=r[o+1],Array.isArray(f)&&!isNaN(i)&&(f=f[i],i=""),f==null)break;s=f}else i+=i.length?"."+r[o+1]:r[o+1]}return s}});var Mz=l((V7a,b8t)=>{"use strict";var xy=Dh(),nyn=i1().internalToObjectOptions,m8t=fe("util"),y8t=zt();b8t.exports=ii;function ii(t,e,r,n){if(r!=null){let i={isNew:r.isNew};"defaults"in r.$__&&(i.defaults=r.$__.defaults),n=Object.assign(i,n)}n?.path!=null&&(this.$basePath=n.path),xy.call(this,t,e,n),delete this.$__.priorDoc}ii.prototype=Object.create(xy.prototype);Object.defineProperty(ii.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0});Object.defineProperty(ii.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0});ii.prototype.toBSON=function(){return this.toObject(nyn)};ii.prototype.save=async function(e){return e=e||{},e.suppressWarning||y8t.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."),await this.$__save()};ii.prototype.$__fullPath=function(t){return this.$__.fullPath||this.ownerDocument(),t?this.$__.fullPath+"."+t:this.$__.fullPath};ii.prototype.$__pathRelativeToParent=function(t){return t==null?this.$basePath:this.$basePath?[this.$basePath,t].join("."):t};ii.prototype.$__save=async function(){try{await this._execDocumentPreHooks("save")}catch(e){await this._execDocumentPostHooks("save",e);return}await this._execDocumentPostHooks("save")};ii.prototype.$isValid=function(t){let e=this.$parent(),r=this.$__pathRelativeToParent(t);return e!=null&&r!=null?e.$isValid(r):xy.prototype.$isValid.call(this,t)};ii.prototype.markModified=function(t){xy.prototype.markModified.call(this,t);let e=this.$parent(),r=this.$__pathRelativeToParent(t);if(e==null||r==null)return;let n=this.$__pathRelativeToParent().replace(/\.$/,"");e.isDirectModified(n)||this.isNew||this.$__parent.markModified(r,this)};ii.prototype.isModified=function(t,e,r){let n=this.$parent();return n!=null?(Array.isArray(t)||typeof t=="string"?(t=Array.isArray(t)?t:t.split(" "),t=t.map(i=>this.$__pathRelativeToParent(i)).filter(i=>i!=null)):t||(t=this.$__pathRelativeToParent()),n.$isModified(t,e,r)):xy.prototype.isModified.call(this,t,e,r)};ii.prototype.$markValid=function(t){xy.prototype.$markValid.call(this,t);let e=this.$parent(),r=this.$__pathRelativeToParent(t);e!=null&&r!=null&&e.$markValid(r)};ii.prototype.invalidate=function(t,e,r){xy.prototype.invalidate.call(this,t,e,r);let n=this.$parent(),i=this.$__pathRelativeToParent(t);if(n!=null&&i!=null)n.invalidate(i,e,r);else if(e.kind==="cast"||e.name==="CastError"||i==null)throw e;return this.ownerDocument().$__.validationError};ii.prototype.$ignore=function(t){xy.prototype.$ignore.call(this,t);let e=this.$parent(),r=this.$__pathRelativeToParent(t);e!=null&&r!=null&&e.$ignore(r)};ii.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;let t=this,e=[],r=new Set([t]);for(;typeof t.$__pathRelativeToParent=="function";){e.unshift(t.$__pathRelativeToParent(void 0,!0));let n=t.$parent();if(n==null)break;if(t=n,r.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");r.add(t)}return this.$__.fullPath=e.join("."),this.$__.ownerDocument=t,this.$__.ownerDocument};ii.prototype.$__fullPathWithIndexes=function(){let t=this,e=[],r=new Set([t]);for(;typeof t.$__pathRelativeToParent=="function";){e.unshift(t.$__pathRelativeToParent(void 0,!1));let n=t.$parent();if(n==null)break;if(t=n,r.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");r.add(t)}return e.join(".")};ii.prototype.parent=function(){return this.$__parent};ii.prototype.$parent=ii.prototype.parent;ii.prototype.$__setParent=function(e){this.$__parent=e};ii.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)};ii.prototype.deleteOne=function(e){if(iyn(this),!e?.noop){this.$__removeFromParent();let r=this.ownerDocument();r.$__.removedSubdocs=r.$__.removedSubdocs||[],r.$__.removedSubdocs.push(this)}};ii.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")`')};ii.prototype.inspect=function(){return this.toObject()};m8t.inspect.custom&&(ii.prototype[m8t.inspect.custom]=ii.prototype.inspect);ii.prototype.$toObject=function(e,r){let n=xy.prototype.$toObject.call(this,e,r);if(!(y8t.hasOwnKeys(n)===!1&&e?._calledWithOptions!=null&&(e._calledWithOptions?.minimize??this?.$__schemaTypeOptions?.minimize??e.minimize)&&!this.constructor.$__required))return n};function iyn(t){let e=t.ownerDocument();function r(){e.$removeListener("save",r),e.$removeListener("deleteOne",r),t.emit("deleteOne",t),t.constructor.emit("deleteOne",t)}e.$on("save",r),e.$on("deleteOne",r)}});var x9=l((H7a,_8t)=>{"use strict";var g8t=fe("events").EventEmitter,v8t=Mz(),ayn=zt(),A9=Mt().documentArrayParent;function E0(t,e,r,n,i){ayn.isMongooseDocumentArray(e)?(this.__parentArray=e,this[A9]=e.$parent()):(this.__parentArray=void 0,this[A9]=void 0),this.$setIndex(i),this.$__parent=this[A9];let a;typeof r=="object"&&r!=null?(a={isNew:!0,...r},r=void 0):a={isNew:!0},v8t.call(this,t,n,this[A9],a)}E0.prototype=Object.create(v8t.prototype);E0.prototype.constructor=E0;Object.defineProperty(E0.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1});Object.defineProperty(E0.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0});for(let t in g8t.prototype)E0[t]=g8t.prototype[t];E0.prototype.$setIndex=function(t){if(this.__index=t,this.$__?.validationError!=null){let e=Object.keys(this.$__.validationError.errors);for(let r of e)this.invalidate(r,this.$__.validationError.errors[r])}};E0.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")`')};E0.prototype.$__removeFromParent=function(){let t=this._doc._id;if(!t)throw new Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:t})};E0.prototype.$__fullPath=function(t,e){return this.__index==null?null:(this.$__.fullPath||this.ownerDocument(),e?t?this.$__.fullPath+"."+t:this.$__.fullPath:t?this.$__.fullPath+"."+this.__index+"."+t:this.$__.fullPath+"."+this.__index)};E0.prototype.$__pathRelativeToParent=function(t,e){return this.__index==null||!this.__parentArray?.$path?null:e?t==null?this.__parentArray.$path():this.__parentArray.$path()+"."+t:t==null?this.__parentArray.$path()+"."+this.__index:this.__parentArray.$path()+"."+this.__index+"."+t};E0.prototype.$parent=function(){return this[A9]};E0.prototype.$__setParent=function(e){this[A9]=e};E0.prototype.parentArray=function(){return this.__parentArray};_8t.exports=E0});var qz=l((z7a,C8t)=>{"use strict";var DSe=Dh(),qSe=x9(),syn=Ir(),E8t=wz(),oyn=_a(),S8t=i1().internalToObjectOptions,x8t=bl(),_o=zt(),NSe=Jo(),uyn=Mt().arrayAtomicsBackupSymbol,s1=Mt().arrayAtomicsSymbol,Kb=Mt().arrayParentSymbol,Yb=Mt().arrayPathSymbol,Ty=Mt().arraySchemaSymbol,T8t=Mt().populateModelSymbol,fyn=Symbol("mongoose#Array#sliced"),w8t=Array.prototype.push;var Rz={$__getAtomics(){let t=[],e=Object.keys(this[s1]||{}),r=e.length,n=Object.assign({},S8t,{_isNested:!0});if(r===0)return t[0]=["$set",this.toObject(n)],t;for(;r--;){let i=e[r],a=this[s1][i];_o.isMongooseObject(a)?a=a.toObject(n):Array.isArray(a)?a=this.toObject.call(a,n):Array.isArray(a?.$each)?a.$each=this.toObject.call(a.$each,n):typeof a?.valueOf=="function"&&(a=a.valueOf()),i==="$addToSet"&&(a={$each:a}),t.push([i,a])}return t},getAtomics(){return this.$__getAtomics()},clearAtomics(){this[uyn]=this[s1],this[s1]={}},$atomics(){return this[s1]},$parent(){return this[Kb]},$path(){return this[Yb]},$schemaType(){return this[Ty]},$shift(){this._registerAtomic("$pop",-1),this._markModified();let t=this.__array;if(!t._shifted)return t._shifted=!0,[].shift.call(t)},$pop(){if(this._registerAtomic("$pop",1),this._markModified(),!this._popped)return this._popped=!0,[].pop.call(this)},$schema(){return this[Ty]},_cast(t){let e=!1,r,n=this[Kb];if(n&&(e=n.$populated(this[Yb],!0)),e&&t!=null){if(r=e.options[T8t],r==null)throw new syn("No populated model found for path `"+this[Yb]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");return(Buffer.isBuffer(t)||NSe(t,"ObjectId")||!_o.isObject(t))&&(t={_id:t}),t.schema?.discriminatorMapping?.key!==void 0||(t=new r(t)),this[Ty].embeddedSchemaType.applySetters(t,n,!0)}return this[Ty].embeddedSchemaType.applySetters(t,n,!1)},_mapCast(t,e){return this._cast(t,this.length+e)},_markModified(t){let e=this[Kb],r;if(e){if(r=this[Yb],arguments.length&&(r=r+"."+t),r!=null&&r.endsWith(".$"))return this;e.markModified(r,arguments.length!==0?t:e)}return this},_registerAtomic(t,e){if(this[fyn])return;if(t==="$set")return this[s1]={$set:e},E8t(this[Kb],this[Yb]),this._markModified(),this;let r=this[s1];if(t==="$pop"&&!("$pop"in r)){let i=this;this[Kb].once("save",function(){i._popped=i._shifted=null})}if(r.$set||_o.hasOwnKeys(r)&&!(t in r))return this[s1]={$set:this},this;let n;if(t==="$pullAll"||t==="$addToSet")r[t]||(r[t]=[]),r[t]=r[t].concat(e);else if(t==="$pullDocs"){let i=r.$pull||(r.$pull={});e[0]instanceof qSe?(n=i.$or||(i.$or=[]),Array.prototype.push.apply(n,e.map(a=>a.toObject({transform:(s,o)=>(a==null||a.$__==null||Object.keys(a.$__.activePaths.getStatePaths("default")).forEach(u=>{x8t.unset(u,o),O8t(o,u)}),o),virtuals:!1})))):(n=i._id||(i._id={$in:[]}),n.$in=n.$in.concat(e))}else if(t==="$push")if(r.$push=r.$push||{$each:[]},e!=null&&_o.hasUserDefinedProperty(e,"$each"))r.$push=e;else if(e.length===1)r.$push.$each.push(e[0]);else if(e.length<1e4)r.$push.$each.push(...e);else for(let i of e)r.$push.$each.push(i);else r[t]=e;return this},addToSet(){Pz(this,arguments),A8t(this,arguments);let t=[].map.call(arguments,this._mapCast,this),e=[],r="";t[0]instanceof qSe?r="doc":t[0]instanceof Date?r="date":NSe(t[0],"ObjectId")&&(r="ObjectId");let n=_o.isMongooseArray(t)?t.__array:t,i=_o.isMongooseArray(this)?this.__array:this;return n.forEach(function(a){let s,o=+a;switch(r){case"doc":s=this.some(function(u){return u.equals(a)});break;case"date":s=this.some(function(u){return+u===o});break;case"ObjectId":s=this.find(u=>u.toString()===a.toString());break;default:s=~this.indexOf(a);break}s||(this._markModified(),i.push(a),this._registerAtomic("$addToSet",a),[].push.call(e,a))},this),e},hasAtomics(){return _o.isPOJO(this[s1])?Object.keys(this[s1]).length:0},includes(t,e){return this.indexOf(t,e)!==-1},indexOf(t,e){NSe(t,"ObjectId")&&(t=t.toString()),e=e??0;let r=this.length;for(let n=e;n<r;++n)if(t==this[n])return n;return-1},inspect(){return JSON.stringify(this)},nonAtomicPush(){let t=[].map.call(arguments,this._mapCast,this);this._markModified();let e=[].push.apply(this,t);return this._registerAtomic("$set",this),e},pop(){this._markModified();let t=[].pop.call(this);return this._registerAtomic("$set",this),t},pull(){let t=[].map.call(arguments,(i,a)=>this._cast(i,a,{defaults:!1}),this),e=this;_o.isMongooseArray(e)&&(e=e.__array);let r=e.length,n;for(this._markModified();r--;)n=e[r],n instanceof DSe?t.some(function(a){return n.equals(a)})&&e.splice(r,1):~this.indexOf.call(t,n)&&e.splice(r,1);return t[0]instanceof qSe?this._registerAtomic("$pullDocs",t.map(function(i){let a=i.$__getValue("_id");return a===void 0||i.$isDefault("_id")?i:a})):this._registerAtomic("$pullAll",t),E8t(this[Kb],this[Yb])>0&&this._registerAtomic("$set",this),this},push(){let t=arguments,e=t,r=t[0]!=null&&_o.hasUserDefinedProperty(t[0],"$each"),n=_o.isMongooseArray(this)?this.__array:this;if(r&&(e=t[0],t=t[0].$each),this[Ty]==null)return w8t.apply(this,t);Pz(this,t),A8t(this,t),t=[].map.call(t,this._mapCast,this);let i,a=this[s1];return this._markModified(),r?(e.$each=t,(a.$push&&a.$push.$each&&a.$push.$each.length||0)!==0&&a.$push.$position!=e.$position?(e.$position!=null?([].splice.apply(n,[e.$position,0].concat(t)),i=n.length):i=[].push.apply(n,t),this._registerAtomic("$set",this)):e.$position!=null?([].splice.apply(n,[e.$position,0].concat(t)),i=this.length):i=[].push.apply(n,t)):(e=t,i=w8t.apply(n,t)),this._registerAtomic("$push",e),i},remove(){return this.pull.apply(this,arguments)},set(t,e,r){let n=this.__array;if(r)return n[t]=e,this;let i=Rz._cast.call(this,e,t);return Rz._markModified.call(this,t),n[t]=i,this},shift(){let t=_o.isMongooseArray(this)?this.__array:this;this._markModified();let e=[].shift.call(t);return this._registerAtomic("$set",this),e},sort(){let t=_o.isMongooseArray(this)?this.__array:this,e=[].sort.apply(t,arguments);return this._registerAtomic("$set",this),e},splice(){let t,e=_o.isMongooseArray(this)?this.__array:this;if(this._markModified(),Pz(this,Array.prototype.slice.call(arguments,2)),arguments.length){let r;if(this[Ty]==null)r=arguments;else{r=[];for(let n=0;n<arguments.length;++n)r[n]=n<2?arguments[n]:this._cast(arguments[n],arguments[0]+(n-2))}t=[].splice.apply(e,r),this._registerAtomic("$set",this)}return t},toBSON(){return this.toObject(S8t)},toObject(t){let e=_o.isMongooseArray(this)?this.__array:this;return t?.depopulate?(t=oyn(t),t._isNested=!0,[].concat(e).map(function(r){return r instanceof DSe?r.toObject(t):r})):[].concat(e)},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift(){Pz(this,arguments);let t;this[Ty]==null?t=arguments:t=[].map.call(arguments,this._cast,this);let e=_o.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(e,t),this._registerAtomic("$set",this),this.length}};function lyn(t,e){if(!e)return!1;for(let r of t){if(r==null)return!1;let n=r.constructor;if(!(r instanceof DSe)||n.modelName!==e&&n.baseModelName!==e)return!1}return!0}function O8t(t,e,r){if(typeof e=="string"){if(e.indexOf(".")===-1)return;e=x8t.stringToParts(e)}r=r||0,!(r>=e.length)&&(t==null||typeof t!="object"||(O8t(t[e[0]],e,r+1),t[e[0]]!=null&&typeof t[e[0]]=="object"&&_o.hasOwnKeys(t[e[0]])===!1&&delete t[e[0]]))}function Pz(t,e){let r=t==null?null:t[Ty]?.embeddedSchemaType?.options?.ref||null;t.length===0&&e.length!==0&&lyn(e,r)&&t[Kb].$populated(t[Yb],[],{[T8t]:e[0].constructor})}function A8t(t,e){let r=t==null?null:t[Ty]?.embeddedSchemaType?.options?.ref||null,n=t[Kb],i=t[Yb];if(!(!r||!n.populated(i))){for(let a of e)if(a!=null&&(typeof a!="object"||a instanceof String||a instanceof Number||a instanceof Buffer||_o.isMongooseType(a))){n.depopulate(i);break}}}var cyn=["filter","flat","flatMap","map","slice"];for(let t of cyn)Array.prototype[t]!=null&&(Rz[t]=function(){let e=_o.isMongooseArray(this)?this.__array:this,r=[].concat(e);return r[t].apply(r,arguments)});C8t.exports=Rz});var $Se=l((q8t,N8t)=>{"use strict";var kSe=qz(),Nz=Mt().arrayAtomicsSymbol,dyn=Mt().arrayAtomicsBackupSymbol,I8t=Mt().arrayParentSymbol,pyn=Mt().arrayPathSymbol,M8t=Mt().arraySchemaSymbol,P8t=Array.prototype.push,R8t=/^\d+$/;function hyn(t,e,r,n){let i;if(Array.isArray(t)){let o=t.length;if(o===0)i=new Array;else if(o===1)i=new Array(1),i[0]=t[0];else if(o<1e4)i=new Array,P8t.apply(i,t);else{i=new Array;for(let u=0;u<o;++u)P8t.call(i,t[u])}}else i=[];let a={[Nz]:{},[dyn]:void 0,[pyn]:e,[M8t]:n,[I8t]:void 0,isMongooseArray:!0,isMongooseArrayProxy:!0,__array:i};t&&t[Nz]!=null&&(a[Nz]=t[Nz]),r?.$__&&(a[I8t]=r,a[M8t]=n||r.schema.path(e));let s=new Proxy(i,{get:function(o,u){return Object.hasOwn(a,u)?a[u]:Object.hasOwn(kSe,u)?kSe[u]:n?.virtuals&&Object.hasOwn(n.virtuals,u)?n.virtuals[u].applyGetters(void 0,o):typeof u=="string"&&R8t.test(u)&&n?.embeddedSchemaType!=null?n.embeddedSchemaType.applyGetters(i[u],r):i[u]},set:function(o,u,f){return typeof u=="string"&&R8t.test(u)?kSe.set.call(s,u,f,!1):Object.hasOwn(a,u)?a[u]=f:n?.virtuals&&Object.hasOwn(n.virtuals,u)?n.virtuals[u].applySetters(f,o):i[u]=f,!0}});return s}N8t.exports=q8t=hyn});var B8t=l((W7a,$8t)=>{"use strict";var Dz=qz(),myn=Dh(),D8t=gc(),yyn=i1().internalToObjectOptions,pv=zt(),byn=Jo(),$z=Mt().arrayParentSymbol,BSe=Mt().arrayPathSymbol,nR=Mt().arraySchemaSymbol,k8t=Mt().documentArrayParent,gyn=Array.prototype.toString,FSe={toBSON(){return this.toObject(yyn)},toString(){return gyn.call(this.__array.map(t=>t?.$__!=null?t.toString():t))},getArrayParent(){return this[$z]},$schemaType(){return this[nR]},_cast(t,e,r){if(this[nR]==null)return t;let n=this[nR].Constructor;if((n.$isMongooseDocumentArray?pv.isMongooseDocumentArray(t):t instanceof n)||t?.constructor?.baseCasterConstructor===n)return t[k8t]&&t.__parentArray||(t[k8t]=this[$z],t.__parentArray=this),t.$setIndex(e),t;if(t==null)return null;if((Buffer.isBuffer(t)||byn(t,"ObjectId")||!pv.isObject(t))&&(t={_id:t}),t&&n.discriminators&&n.schema&&n.schema.options&&n.schema.options.discriminatorKey)if(typeof t[n.schema.options.discriminatorKey]=="string"&&n.discriminators[t[n.schema.options.discriminatorKey]])n=n.discriminators[t[n.schema.options.discriminatorKey]];else{let s=D8t(n.discriminators,t[n.schema.options.discriminatorKey]);s&&(n=s)}if(n.$isMongooseDocumentArray)return n.cast(t,this,void 0,void 0,e);let a=new n(t,this,r,void 0,e);return a.isNew=!0,a},id(t){if(t==null)return null;let e=this[nR],r=null;e?.schema?r=e.schema.path("_id"):e?.casterConstructor?.schema&&(r=e.casterConstructor.schema.path("_id"));let n=null;if(r)try{n=r.cast(t)}catch{}let i;for(let a of this)if(a&&(i=a.get("_id"),i!=null))if(i instanceof myn){if(i=i.get("_id"),n!=null&&pv.deepEqual(n,i))return a;if(n==null&&(t==i||pv.deepEqual(t,i)))return a}else{if(n!=null&&pv.deepEqual(n,i))return a;if(n==null&&(i==t||pv.deepEqual(t,i)))return a}return null},toObject(t){return[].concat(this.map(function(e){return e==null?null:typeof e.toObject!="function"?e:e.toObject(t)}))},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},push(){let t=Dz.push.apply(this,arguments);return kz(this),t},pull(){let t=Dz.pull.apply(this,arguments);return kz(this),t},shift(){let t=Dz.shift.apply(this,arguments);return kz(this),t},splice(){let t=Dz.splice.apply(this,arguments);return kz(this),t},inspect(){return this.toObject()},create(t){let e=this[nR].Constructor;if(t&&e.discriminators&&e.schema&&e.schema.options&&e.schema.options.discriminatorKey)if(typeof t[e.schema.options.discriminatorKey]=="string"&&e.discriminators[t[e.schema.options.discriminatorKey]])e=e.discriminators[t[e.schema.options.discriminatorKey]];else{let r=D8t(e.discriminators,t[e.schema.options.discriminatorKey]);r&&(e=r)}return new e(t,this)},notify(t){let e=this;return function r(n,i){i=i||e;let a=i.length;for(;a--;)i[a]!=null&&(t==="save"&&(n=e[a]),pv.isMongooseArray(i[a])?r(n,i[a]):i[a]&&i[a].emit(t,n))}},set(t,e,r){let n=this.__array;if(r)return n[t]=e,this;let i=FSe._cast.call(this,e,t);return FSe._markModified.call(this,t),n[t]=i,this},_markModified(t,e){let r=this[$z],n;if(r){if(n=this[BSe],arguments.length)if(e!=null){let i=t.__index;n=n+"."+i+"."+e}else n=n+"."+t;if(n!=null&&n.endsWith(".$"))return this;r.markModified(n,arguments.length!==0?t:r)}return this}};$8t.exports=FSe;function kz(t){let e=t[$z];if(!e||e.$__.populated==null)return;let r=Object.keys(e.$__.populated).filter(n=>n.startsWith(t[BSe]+"."));for(let n of r){let i=n.slice((t[BSe]+".").length);Array.isArray(e.$__.populated[n].value)&&(e.$__.populated[n].value=t.map(a=>a.$populated(i)))}}});var mv=l((G7a,L8t)=>{"use strict";var F8t=qz(),LSe=B8t(),jSe=Mt().arrayAtomicsSymbol,vyn=Mt().arrayAtomicsBackupSymbol,USe=Mt().arrayParentSymbol,VSe=Mt().arrayPathSymbol,hv=Mt().arraySchemaSymbol,_yn=Array.prototype.push,Eyn=/^\d+$/;function Syn(t,e,r,n){let i=[],a={[jSe]:{},[vyn]:void 0,[VSe]:e,[hv]:void 0,[USe]:void 0};if(Array.isArray(t)&&(t[VSe]===e&&t[USe]===r&&(a[jSe]=Object.assign({},t[jSe])),t.forEach(o=>{_yn.call(i,o)})),a[VSe]=e,a.__array=i,r?.$__)for(a[USe]=r,a[hv]=r.$__schema.path(e);a[hv]!=null&&a[hv].$isMongooseArray&&!a[hv].$isMongooseDocumentArray;)a[hv]=a[hv].embeddedSchemaType;let s=new Proxy(i,{get:function(o,u){return u==="isMongooseArray"||u==="isMongooseArrayProxy"||u==="isMongooseDocumentArray"||u==="isMongooseDocumentArrayProxy"?!0:Object.hasOwn(a,u)?a[u]:Object.hasOwn(LSe,u)?LSe[u]:n?.virtuals&&Object.hasOwn(n.virtuals,u)?n.virtuals[u].applyGetters(void 0,o):Object.hasOwn(F8t,u)?F8t[u]:i[u]},set:function(o,u,f){return typeof u=="string"&&Eyn.test(u)?LSe.set.call(s,u,f,!1):Object.hasOwn(a,u)?a[u]=f:n?.virtuals&&Object.hasOwn(n.virtuals,u)?n.virtuals[u].applySetters(f,o):i[u]=f,!0}});return s}L8t.exports=Syn});var Dh=l((i4t,a4t)=>{"use strict";var wyn=mSe(),zSe=fe("events").EventEmitter,Ayn=p_t(),xyn=mz(),lf=ml(),j8t=cv(),Tyn=__t(),K8t=gz(),YSe=_z(),Oyn=A_t(),Cyn=bv(),WSe=Gb(),Uz=fv(),Y8t=fSe(),J8t=SSe(),GSe=Sz(),Bz=wz(),o1=_a(),Iyn=xz().compile,Myn=xz().defineKey,Pyn=k_t(),Ryn=Tz().flatten,HSe=G_t(),U8t=Y_t(),qyn=Z_t(),Nyn=Cz(),V8t=Jo(),Z8t=S9(),Dyn=w9(),H8t=CSe(),KSe=fe("util").inspect,X8t=i1().internalToObjectOptions,kyn=ISe(),$yn=MSe(),Byn=bl(),JSe=PSe(),Fyn=rR(),Jt=zt(),Lyn=RSe(),Lz=Jt.deepEqual,jyn=Jt.isMongooseObject,aR=Mt().arrayAtomicsBackupSymbol,cf=Mt().arrayAtomicsSymbol,Uyn=Mt().documentArrayParent,Vyn=Mt().documentIsModified,Q8t=Mt().documentModifiedPaths,Hyn=Mt().documentSchemaSymbol,zyn=Mt().getSymbol,Wyn=Mt().modelSymbol,z8t=Mt().populateModelSymbol,Gyn=Mt().scopeSymbol,Kyn=lv().schemaMixedSymbol,Yyn=h8t(),Fz=Mt().sessionNewDocuments,jz,W8t,iR,e4t=Jt.specialProperties,T9=1,yv=2,kh=T9|yv;function Oe(t,e,r){if(typeof r=="boolean")throw new Error("The skipId parameter has been removed. Use { skipId: true } in the options parameter instead.");r=Object.assign({},r);let n=r.skipId;if(this.$__=new Ayn,this.$__schema==null){let f=Jt.isObject(e)&&!e.instanceOfSchema?new Cyn(e):e;this.$__setSchema(f),e=r,n=r.skipId}if(r.isNew!=null&&r.isNew!==!0&&(this.$isNew=r.isNew),r.priorDoc!=null&&(this.$__.priorDoc=r.priorDoc),n&&(this.$__.skipId=n),t!=null&&typeof t!="object")throw new YSe(t,"obj","Document");let i=!0;r.defaults!==void 0&&(this.$__.defaults=r.defaults,i=r.defaults);let a=this.$__schema;typeof e=="boolean"||e==="throw"?(e!==!0&&(this.$__.strictMode=e),e=void 0):a.options.strict!==!0&&(this.$__.strictMode=a.options.strict);let s=a.requiredPaths(!0);for(let f of s)this.$__.activePaths.require(f);let o=null;Jt.isPOJO(e)&&Jt.hasOwnKeys(e)&&(o=Dyn(e),this.$__.selected=e,this.$__.exclude=o);let u=o===!1&&e?J8t(e):null;if(this._doc==null&&(this.$__buildDoc(t,e,n,o,u,!1),i&&GSe(this,e,o,u,!0,null,{skipParentChangeTracking:!0})),t&&(this.$__original_set?this.$__original_set(t,void 0,!0,r):this.$set(t,void 0,!0,r),t instanceof Oe&&(this.$isNew=t.$isNew)),r.willInit&&i?r.skipDefaults&&(this.$__.skipDefaults=r.skipDefaults):i&&GSe(this,e,o,u,!1,r.skipDefaults),!this.$__.strictMode&&t){let f=this;Object.keys(this._doc).forEach(function(d){!(d in a.tree)&&!(d in a.methods)&&!(d in a.virtuals)&&!d.startsWith("$")&&Myn({prop:d,subprops:null,prototype:f})})}i2n(this)}Oe.prototype.$isMongooseDocumentPrototype=!0;Object.defineProperty(Oe.prototype,"isNew",{get:function(){return this.$isNew},set:function(t){this.$isNew=t}});Object.defineProperty(Oe.prototype,"errors",{get:function(){return this.$errors},set:function(t){this.$errors=t}});Oe.prototype.$isNew=!0;Jt.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(t){Oe.prototype[t]=function(){if(!this.$__.emitter){if(t==="emit")return;this.$__.emitter=new zSe,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[t].apply(this.$__.emitter,arguments)},Oe.prototype[`$${t}`]=Oe.prototype[t]});Oe.prototype.constructor=Oe;for(let t in zSe.prototype)Oe[t]=zSe.prototype[t];Oe.prototype.$__schema;Oe.prototype.schema;Object.defineProperty(Oe.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){return this.$__.locals==null&&(this.$__.locals={}),this.$__.locals},set:function(t){this.$__.locals=t}});Oe.prototype.isNew;Object.defineProperty(Oe.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0});Oe.prototype.id;Oe.prototype.$errors;Object.defineProperty(Oe.prototype,"$op",{get:function(){return this.$__.op||null},set:function(t){this.$__.op=t}});function Jyn(t,e,r){if(t==null)return;let n=Object.keys(r.$__schema.paths),i=n.length,a=e.indexOf(".")===-1?[e]:e.split(".");for(let s=0;s<i;++s){let o="",u=n[s];if(!u.startsWith(e+"."))continue;let f=r.$__schema.paths[u],c=f.splitPath().slice(a.length),d=c.length;if(f.defaultValue===void 0)continue;let h=t;for(let p=0;p<d&&h!=null;++p){let m=c[p];if(p===d-1){if(h[m]!==void 0)break;try{let y=f.getDefault(r,!1);y!==void 0&&(h[m]=y)}catch(y){r.invalidate(e+"."+o,y);break}break}o+=(o.length?".":"")+m,h[m]=h[m]||{},h=h[m]}}}Oe.prototype.$__buildDoc=function(t,e,r,n,i){let a={},s=Object.keys(this.$__schema.paths).filter(f=>!f.includes("$*")),o=s.length,u=0;for(;u<o;++u){let f=s[u];if(f==="_id"&&(r||t&&"_id"in t))continue;let c=this.$__schema.paths[f].splitPath(),d=c.length,h=d-1,p="",m=a,y=!1;for(let b=0;b<d;++b){let v=c[b];if(p.length?p+="."+v:p=v,n===!0){if(p in e)break}else if(n===!1&&e&&!y){if(p in e)y=!0;else if(!i[p])break}b<h&&(m=m[v]||(m[v]={}))}}this._doc=a};Oe.prototype.toBSON=function(){return this.toObject(X8t)};Oe.prototype.init=function(t,e,r){if(typeof e=="function"&&(r=e,e=null),t==null)throw new YSe(t,"doc","init");return this.$__init(t,e),r&&r(null,this),this};Oe.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)};Oe.prototype.$__init=function(t,e){if(t==null)throw new YSe(t,"doc","init");if(this.$isNew=!1,e=e||{},t._id!=null&&e.populated&&e.populated.length){let n=String(t._id);for(let i of e.populated)if(i.isVirtual?this.$populated(i.path,Jt.getValue(i.path,t),i):this.$populated(i.path,i._docs[n],i),i._childDocs!=null){for(let a of i._childDocs)a?.$__!=null&&(a.$__.parent=this);i._childDocs=[]}}t4t(this,t,this._doc,e),kyn(this,e.populated),this.$emit("init",this),this.constructor.emit("init",this);let r=this.$__.exclude===!1&&this.$__.selected?J8t(this.$__.selected):null;return GSe(this,this.$__.selected,this.$__.exclude,r,!1,this.$__.skipDefaults),this};function t4t(t,e,r,n,i){if(i=i||"",typeof e!="object"||Array.isArray(e))throw new K8t(t.$basePath,e);e.$__!=null&&(e=e._doc);let a=Object.keys(e),s=a.length,o,u,f,c=t.$__.strictMode,d=t.$__schema;for(let h=0;h<s;++h){if(f=a[h],e4t.has(f)||(u=i?i+f:f,o=d.path(u),d.$isRootDiscriminator&&!t.$__isSelected(u)))continue;let p=e[f];if(!o&&Jt.isPOJO(p))r[f]||(r[f]={},(!c&&!(f in d.tree)&&!(f in d.methods)&&!(f in d.virtuals)||n?.virtuals&&f in d.virtuals)&&(t[f]=r[f])),t4t(t,p,r[f],n,u+".");else if(!o)r[f]=p,(!c&&!i||n?.virtuals&&f in d.virtuals)&&(t[f]=p);else{if(Object.hasOwn(r,f)&&p!==void 0&&!n.hydratedPopulatedDocs&&delete r[f],p===null)r[f]=o._castNullish(null);else if(p!==void 0){let m=p.$__==null?null:p.$__.wasPopulated;if(o&&!m&&!n.hydratedPopulatedDocs)try{n?.setters?r[f]=o.applySetters(p,t,!1,null,n):r[f]=o.cast(p,t,!0,void 0,n)}catch(y){t.invalidate(y.path,new Y8t({path:y.path,message:y.message,type:"cast",value:y.value,reason:y}))}else o&&n.hydratedPopulatedDocs?(r[f]=o.cast(p,t,!0,void 0,{hydratedPopulatedDocs:!0}),r[f]?.$__?.wasPopulated?t.$populated(u,r[f].$__.wasPopulated.value,r[f].$__.wasPopulated.options):Array.isArray(r[f])&&r[f].length&&r[f][0]?.$__?.wasPopulated&&t.$populated(u,r[f].map(y=>y?.$__?.wasPopulated?.value).filter(y=>y!=null),r[f][0].$__.wasPopulated.options)):r[f]=p}t.$isModified(u)||t.$__.activePaths.init(u)}}}Oe.prototype.updateOne=function(e,r){let n=this.constructor.updateOne(),i=this;return n.pre(async function(){let s=await i._execDocumentPreHooks("updateOne",i,e,r);if(s[0]!==i||s[1]!==e||s[2]!==r)throw new Error("Document updateOne pre hooks cannot overwrite arguments");return n.updateOne({_id:i._doc._id},e,r),i.$where!=null&&this.where(i.$where),i.$session()!=null&&("session"in n.options||(n.options.session=i.$session())),s}),n.post(function(){return i._execDocumentPostHooks("updateOne")}),n};Oe.prototype.replaceOne=function(){let e=[...arguments];return e.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,e)};Oe.prototype.$session=function(e){if(arguments.length===0)return this.$__.session?.hasEnded?(this.$__.session=null,null):this.$__.session;if(e?.hasEnded)throw new lf("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(!(e==null&&this.$__.session==null)){if(this.$__.session=e,!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)n.$session(e)}return e}};Oe.prototype.$timestamps=function(e){if(arguments.length===0)return this.$__.timestamps!=null?this.$__.timestamps:this.$__schema?this.$__schema.options.timestamps:void 0;let r=this.$timestamps();return e!==r&&(this.$__.timestamps=e),this};Oe.prototype.overwrite=function(e){let r=new Set(Object.keys(this._doc));for(let i of Object.keys(e))r.add(i);let n=this.$__schema.options;for(let i of r)i!=="_id"&&(n.versionKey&&i===n.versionKey||n.discriminatorKey&&i===n.discriminatorKey||this.$set(i,e[i]));return this};Oe.prototype.$set=function(e,r,n,i){Jt.isPOJO(n)&&(i=n,n=void 0);let a=i?.merge,s=n&&n!==!0,o=n===!0,u,f,c=0,d,h,p,m=i&&"strict"in i,y=m?i.strict:this.$__.strictMode;if(s&&(u=this.$__.adhocPaths||(this.$__.adhocPaths={}),u[e]=this.$__schema.interpretAsType(e,n,this.$__schema.options)),e==null)[e,r]=[r,e];else if(typeof e!="string"){e instanceof Oe&&(e.$__isNested?e=e.toObject():e=e.$__schema===this.$__schema?ZSe(e,{...e._doc}):e._doc),e==null&&([e,r]=[r,e]),p=r?r+".":"",f=U8t(this.$__schema,e);let k=f.length,R=i?._skipMinimizeTopLevel||!1;if(k===0&&R)return delete i._skipMinimizeTopLevel,r&&this.$set(r,{}),this;i=Object.assign({},i,{_skipMinimizeTopLevel:!1});for(let V=0;V<k;++V){h=f[V];let J=p?p+h:h;d=this.$__schema.pathType(J);let z=e[h];if(n===!0&&!p&&z!=null&&d==="nested"&&this._doc[h]!=null&&delete this._doc[h],Jt.isNonBuiltinObject(z)&&d==="nested"){this.$set(J,z,o,i),Jyn(this.$get(J),J,this);continue}else if(y){if(o&&z===void 0&&this.$get(J)!==void 0)continue;if(d==="adhocOrUndefined"&&(d=HSe(this,J,{typeOnly:!0})),d==="real"||d==="virtual")this.$set(J,z,o,i);else if(d==="nested"&&z instanceof Oe)this.$set(J,z.toObject({transform:!1}),o,i);else{if(y==="throw")throw d==="nested"?new K8t(h,z):new WSe(h);d==="nested"&&z==null&&this.$set(J,z,o,i)}}else this.$set(J,z,o,i)}let U={},F=Object.keys(this.$__schema.tree);for(let V=0,J=F.length;V<J;++V)(h=F[V])&&Object.hasOwn(this._doc,h)&&(U[h]=void 0);return this._doc=Object.assign(U,this._doc),this}let b=this.$__schema.pathType(e),v=null;if(b==="adhocOrUndefined"&&(v=e.indexOf(".")===-1?[e]:e.split("."),b=HSe(this,v,{typeOnly:!0})),b==="adhocOrUndefined"&&!m){v==null&&(v=e.indexOf(".")===-1?[e]:e.split("."));let k=qyn(this.$__schema,v);k!==void 0&&(y=k)}r=Nyn(r,!0);let E=(()=>{if(this.$__.priorDoc!=null)return this.$__.priorDoc.$__getValue(e);if(!o)return this.$__getValue(e)})();if(b==="nested"&&r){if(typeof r=="object"&&r!=null){if(r.$__!=null&&(r=r.toObject(X8t)),r==null)return this.invalidate(e,new lf.CastError("Object",r,e)),this;let k=this.$isModified(e),R=this.$__.savedState!=null&&Object.hasOwn(this.$__.savedState,e);if(this.$__.savedState!=null&&!this.$isNew&&!Object.hasOwn(this.$__.savedState,e)){let F=this.$__getValue(e);this.$__.savedState[e]=F;let V=Object.keys(F||{});for(let J of V)this.$__.savedState[e+"."+J]=F[J]}if(!a)this.$__setValue(e,null),Bz(this,e);else return this.$set(r,e,o,i);let U=U8t(this.$__schema,r,e);this.$__setValue(e,{});for(let F of U)this.$set(e+"."+F,r[F],o,{...i,_skipMarkModified:!0});return E!=null&&(!k||R)&&Jt.deepEqual(R?this.$__.savedState[e]:E,r)?this.unmarkModified(e):this.markModified(e),this}return this.invalidate(e,new lf.CastError("Object",r,e)),this}let x;if(v==null&&(v=e.indexOf(".")===-1?[e]:e.split(".")),typeof this.$__schema.aliases[v[0]]=="string"&&(v[0]=this.$__schema.aliases[v[0]]),b==="adhocOrUndefined"&&y){let k;for(c=0;c<v.length;++c){let R=v.slice(0,c+1).join(".");if(c+1<v.length&&this.$__schema.pathType(R)==="virtual")return Byn.set(e,r,this),this;if(x=this.$__schema.path(R),x!=null){if(x instanceof j8t){k=!0;break}else if(x.$isSchemaMap&&x.$__schemaType instanceof j8t&&c<v.length-1){k=!0,x=x.$__schemaType;break}}}if(x==null&&(x=HSe(this,e)),!k&&!x){if(y==="throw")throw new WSe(e);return this}}else{if(b==="virtual")return x=this.$__schema.virtualpath(e),x.applySetters(r,this),this;x=this.$__path(e)}let w=this._doc,M="";for(c=0;c<v.length-1;++c)w=w instanceof Map?w.get(v[c]):w[v[c]],M+=(M.length!==0?".":"")+v[c],w||(this.$set(M,{}),this.$__isSelected(M)||this.unmarkModified(M),w=this.$__getValue(M));let N;if(v.length<=1)N=e;else{let k=v.length;for(c=0;c<k;++c){let R=v.slice(0,c+1).join(".");if(this.$get(R,null,{getters:!1})===null){N=R;break}}N||(N=e)}if(!x)return this.$__set(N,e,i,o,v,x,r,E),b==="nested"&&r==null&&Bz(this,e),this;if((x.$isSingleNested||x.$isMongooseArray)&&r2n(this,e),r!=null&&a&&x.$isSingleNested){r instanceof Oe&&(r=r.toObject({virtuals:!1,transform:!1}));let k=Object.keys(r);for(let R of k)this.$set(e+"."+R,r[R],o,i);return this}let P=!0;try{let k=(()=>{if(x.options==null||!(r instanceof Oe))return!1;let V=r.constructor,J=typeof x.options.ref=="function"&&!x.options.ref[Wyn]?x.options.ref.call(this,this):x.options.ref,z=J?.modelName||J;if(z!=null&&(z===V.modelName||z===V.baseModelName))return!0;let re=x.options.refPath;if(re==null)return!1;let K=r.get(re);return K===V.modelName||K===V.baseModelName})(),R=!1;if(k&&r instanceof Oe&&(!r.$__.wasPopulated||Jt.deepEqual(r.$__.wasPopulated.value,r._doc._id))){let V=x?.$isSingleNested?x.cast(r,this):r._doc._id;this.$populated(e,V,{[z8t]:r.constructor}),r.$__.wasPopulated={value:V},R=!0}let U,F=this.$__schema.options.typeKey;if(x.options&&Array.isArray(x.options[F])&&x.options[F].length&&x.options[F][0]&&x.options[F][0].ref&&Zyn(r,x.options[F][0].ref)){U={[z8t]:r[0].constructor},this.$populated(e,r.map(function(V){return V._doc._id}),U);for(let V of r)V.$__.wasPopulated={value:V._doc._id};R=!0}if(!k||!x.$isSingleNested||!r.$__){let V=this;this.$__schema.singleNestedPaths[e]!=null&&v.length>1&&(V=Yyn(this,v,this.schema)),i?.overwriteImmutable?r=x.applySetters(r,V,!1,E,{path:e,overwriteImmutable:!0}):r=x.applySetters(r,V,!1,E,{path:e})}if(Array.isArray(r)&&!Array.isArray(x)&&x.$isMongooseDocumentArray&&r.length!==0&&r[0]?.$__?.populated!=null){let V=Object.keys(r[0].$__.populated);for(let J of V)this.$populated(e+"."+J,r.map(z=>z.$populated(J)),r[0].$__.populated[J].options);R=!0}if(!R&&this.$__.populated){if(Array.isArray(r)&&this.$__.populated[e])for(let V=0;V<r.length;++V)r[V]instanceof Oe&&r.set(V,r[V]._doc._id,!0);delete this.$__.populated[e]}r!=null&&x.$isSingleNested&&n2n(r,x,E),this.$markValid(e)}catch(k){k instanceof lf.StrictModeError&&k.isImmutableError?this.invalidate(e,k):k instanceof lf.CastError?(this.invalidate(k.path,k),k.$originalErrorPath&&this.invalidate(e,new lf.CastError(x.instance,r,e,k.$originalErrorPath))):this.invalidate(e,new lf.CastError(x.instance,r,e,k)),P=!1}if(P){let k=null,R=null;if(!o){let V=this.$isSubdocument?this.ownerDocument():this;k=V.$__.savedState,R=this.$isSubdocument?this.$__.fullPath+"."+e:e,V.$__saveInitialState(R)}this.$__set(N,e,i,o,v,x,r,E);let U=!!this.$__.session?.transaction,F=this.$__.session&&this.$__.session[Fz]&&this.$__.session[Fz].has(this)&&this.$__.session[Fz].get(this).modifiedPaths&&!this.$__.session[Fz].get(this).modifiedPaths.has(R);k!=null&&Object.hasOwn(k,R)&&(!U||F)&&Jt.deepEqual(r,k[R])&&this.unmarkModified(e)}return x.$isSingleNested&&(this.isDirectModified(e)||r==null)?Bz(this,e):x.$isSchemaMap&&r==null&&Bz(this,e),this};function Zyn(t,e){if(!Array.isArray(t)||t.length===0)return!1;for(let r of t)if(!(r instanceof Oe)||r.constructor.modelName==null||r.constructor.modelName!=e&&r.constructor.baseModelName!=e)return!1;return!0}Oe.prototype.set=Oe.prototype.$set;Oe.prototype.$__shouldModify=function(t,e,r,n,i,a,s,o){return r?._skipMarkModified?!1:this.$isNew||e in this.$__.activePaths.getStatePaths("modify")||s===void 0&&!this.$__isSelected(e)?!0:s===void 0&&e in this.$__.activePaths.getStatePaths("default")||this.$populated(e)&&s instanceof Oe&&Lz(s._doc._id,o)?!1:!!(!Lz(s,o!==void 0?o:Jt.getValue(e,this))||!n&&s!==null&&s!==void 0&&e in this.$__.activePaths.getStatePaths("default")&&Lz(s,a.getDefault(this,n)))};Oe.prototype.$__set=function(t,e,r,n,i,a,s,o){iR=iR||x9();let u=this.$__shouldModify(t,e,r,n,i,a,s,o);u?(this.$__.primitiveAtomics?.[e]&&(delete this.$__.primitiveAtomics[e],Jt.hasOwnKeys(this.$__.primitiveAtomics)===!1&&delete this.$__.primitiveAtomics),this.markModified(t),W8t||(W8t=$Se()),s&&Jt.isMongooseArray(s)&&(s._registerAtomic("$set",s),Jt.isMongooseDocumentArray(s)&&s.forEach(function(p){p&&p.__parentArray&&(p.__parentArray=s)}))):Array.isArray(s)&&Array.isArray(o)&&Jt.isMongooseArray(s)&&Jt.isMongooseArray(o)&&(s[cf]=o[cf],s[aR]=o[aR],Jt.isMongooseDocumentArray(s)&&s.forEach(p=>{p!=null&&(p.$isNew=!1)}));let f=this._doc,c=0,d=i.length,h="";for(;c<d;c++){let m=c+1===d;if(h+=h?"."+i[c]:i[c],!e4t.has(i[c]))if(m)f instanceof Map?f.set(i[c],s):f.$isSingleNested?(i[c]in f||(f[i[c]]=s),f._doc[i[c]]=s,u&&f.markModified(i[c])):f[i[c]]=s;else{let y=f instanceof Map,b=y?f.get(i[c]):f[i[c]];Jt.isPOJO(b)||b&&b instanceof iR||b&&!Array.isArray(b)&&b.$isSingleNested||b&&Array.isArray(b)||b==null&&(b={},y?f.set(i[c],b):f[i[c]]=b),f=b}}};Oe.prototype.$__getValue=function(t){if(typeof t!="string"&&!Array.isArray(t))throw new TypeError(`Invalid \`path\`. Must be either string or array. Got "${t}" (type ${typeof t})`);return Jt.getValue(t,this._doc)};Oe.prototype.$inc=function(e,r){if(r==null&&(r=1),Array.isArray(e))return e.forEach(u=>this.$inc(u,r)),this;let n=this.$__path(e);if(n==null){if(this.$__.strictMode==="throw")throw new WSe(e);if(this.$__.strictMode===!0)return this}else if(n.instance!=="Number")return this.invalidate(e,new lf.CastError(n.instance,r,e)),this;let i=this.$__getValue(e)||0,a=!1,s=null,o=r;try{r=n.cast(r),s=n.applySetters(i+r,this),o=s-i,a=!0}catch(u){this.invalidate(e,new lf.CastError("number",r,e,u))}return a&&(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},this.$__.primitiveAtomics[e]==null?this.$__.primitiveAtomics[e]={$inc:o}:this.$__.primitiveAtomics[e].$inc+=o,this.markModified(e),this.$__setValue(e,s)),this};Oe.prototype.$__setValue=function(t,e){return Jt.setValue(t,e,this._doc),this};Oe.prototype.get=function(t,e,r){let n;r==null&&(r={}),e&&(n=this.$__schema.interpretAsType(t,e,this.$__schema.options));let i=r.noDottedPath,a=i?this.$__schema.paths[t]:this.$__path(t);if(a==null&&(a=this.$__schema.virtualpath(t),a!=null))return a.applyGetters(void 0,this);if(i){let f=this._doc[t];return n&&(f=n.cast(f)),a!=null&&r.getters!==!1?a.applyGetters(f,this):f}if(a?.instance==="Mixed"){let f=this.$__schema.virtualpath(t);f!=null&&(a=f)}let s=t.indexOf(".")!==-1,o=this._doc,u=s?t.split("."):[t];typeof this.$__schema.aliases[u[0]]=="string"&&(u[0]=this.$__schema.aliases[u[0]]);for(let f=0,c=u.length;f<c;f++)o?._doc&&(o=o._doc),o==null?o=void 0:o instanceof Map?o=o.get(u[f],{getters:!1}):f===c-1?o=Jt.getValue(u[f],o):o=o[u[f]];if(n&&(o=n.cast(o)),a!=null&&r.getters!==!1)o=a.applyGetters(o,this);else if(this.$__schema.nested[t]&&r.virtuals)return ZSe(this,o1(o)||{},{path:t});return o};Oe.prototype[zyn]=Oe.prototype.get;Oe.prototype.$get=Oe.prototype.get;Oe.prototype.$__path=function(t){let e=this.$__.adhocPaths,r=e&&Object.hasOwn(e,t)?e[t]:null;return r||this.$__schema.path(t)};Oe.prototype.markModified=function(t,e){this.$__saveInitialState(t),this.$__.activePaths.modify(t),e!=null&&!this.$isSubdocument&&(this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[t]=e)};Oe.prototype.$__saveInitialState=function(e){let r=this.$__.savedState,n=e;if(r!=null){let i=n.indexOf("."),a=i===-1?n:n.slice(0,i);Object.hasOwn(r,a)||(r[a]=o1(this.$__getValue(a)))}};Oe.prototype.unmarkModified=function(t){this.$__.activePaths.init(t),this.$__.pathsToScopes!=null&&delete this.$__.pathsToScopes[t]};Oe.prototype.$ignore=function(t){this.$__.activePaths.ignore(t)};Oe.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))};Oe.prototype.$isEmpty=function(t){let e={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(arguments.length!==0){let r=this.$get(t);return r==null?!0:typeof r!="object"?!1:Jt.isPOJO(r)?r4t(r):Object.keys(r.toObject(e)).length===0}return Object.keys(this.toObject(e)).length===0};function r4t(t){if(t==null)return!0;if(typeof t!="object"||Array.isArray(t))return!1;for(let e of Object.keys(t))if(!r4t(t[e]))return!1;return!0}Oe.prototype.modifiedPaths=function(t){t=t||{};let e=Object.keys(this.$__.activePaths.getStatePaths("modify")),r=new Set,n=0,i=0,a=e.length;for(n=0;n<a;++n){let s=e[n],o=JSe(s),u=o.length;for(i=0;i<u;++i)r.add(o[i]);if(!t.includeChildren)continue;let f=0,c=this.$get(s);if(typeof c=="object"&&c!==null){c._doc&&(c=c._doc);let d=c.length;if(Array.isArray(c))for(f=0;f<d;++f){let h=s+"."+f;if(!r.has(h)&&(r.add(h),c[f]!=null&&c[f].$__)){let p=c[f].modifiedPaths(),m=0,y=p.length;for(m=0;m<y;++m)r.add(h+"."+p[m])}}else{let h=Object.keys(c),p=0,m=h.length;for(p=0;p<m;++p)r.add(s+"."+h[p])}}}return Array.from(r)};Oe.prototype[Q8t]=Oe.prototype.modifiedPaths;Oe.prototype.isModified=function(t,e,r){if(t){let n=e?.ignoreAtomics,i=this.$__.activePaths.states.modify;if(i==null)return!1;typeof t=="string"&&(t=t.indexOf(" ")===-1?[t]:t.split(" "));for(let u of t)if(i[u]!=null)return!0;let a=r||this[Q8t](),s=t.some(function(u){return!!~a.indexOf(u)}),o=Object.keys(i);return n&&(o=o.filter(u=>{let f=this.$__getValue(u);return!(f?.[cf]!=null&&f[cf].$set===void 0)})),s||t.some(function(u){return o.some(function(f){return f===u||u.startsWith(f+".")})})}return this.$__.activePaths.some("modify")};Oe.prototype.$isModified=Oe.prototype.isModified;Oe.prototype[Vyn]=Oe.prototype.isModified;Oe.prototype.$isDefault=function(t){if(t==null)return this.$__.activePaths.some("default");if(typeof t=="string"&&t.indexOf(" ")===-1)return Object.hasOwn(this.$__.activePaths.getStatePaths("default"),t);let e=t;return Array.isArray(e)||(e=e.split(" ")),e.some(r=>Object.hasOwn(this.$__.activePaths.getStatePaths("default"),r))};Oe.prototype.$isDeleted=function(t){return arguments.length===0?!!this.$__.isDeleted:(this.$__.isDeleted=!!t,this)};Oe.prototype.isDirectModified=function(t){if(t==null)return this.$__.activePaths.some("modify");if(typeof t=="string"&&t.indexOf(" ")===-1){let r=Object.hasOwn(this.$__.activePaths.getStatePaths("modify"),t);if(r||t.indexOf(".")===-1)return r;let n=t.split(".");for(let i=0;i<n.length-1;++i){let a=n.slice(0,i+1).join("."),s=this.$get(a);if(s?.$__!=null&&s.isDirectModified(n.slice(i+1).join(".")))return!0}return!1}let e=t;return typeof e=="string"&&(e=e.split(" ")),e.some(r=>this.isDirectModified(r))};Oe.prototype.isInit=function(t){if(t==null)return this.$__.activePaths.some("init");if(typeof t=="string"&&t.indexOf(" ")===-1)return Object.hasOwn(this.$__.activePaths.getStatePaths("init"),t);let e=t;return Array.isArray(e)||(e=e.split(" ")),e.some(r=>Object.hasOwn(this.$__.activePaths.getStatePaths("init"),r))};Oe.prototype.isSelected=function(e){if(this.$__.selected==null)return!0;if(!e)return!1;if(e==="_id")return this.$__.selected._id!==0;if(e.indexOf(" ")!==-1&&(e=e.split(" ")),Array.isArray(e))return e.some(a=>this.$__isSelected(a));let r=Object.keys(this.$__.selected),n=null;if(r.length===1&&r[0]==="_id")return this.$__.selected._id===0;for(let a of r)if(a!=="_id"&&Z8t(this.$__.selected[a])){n=!!this.$__.selected[a];break}if(n===null)return!0;if(e in this.$__.selected)return n;let i=e+".";for(let a of r)if(a!=="_id"){if(a.startsWith(i))return n||a!==i;if(i.startsWith(a+"."))return n}return!n};Oe.prototype.$__isSelected=Oe.prototype.isSelected;Oe.prototype.isDirectSelected=function(e){if(this.$__.selected==null)return!0;if(e==="_id")return this.$__.selected._id!==0;if(e.indexOf(" ")!==-1&&(e=e.split(" ")),Array.isArray(e))return e.some(i=>this.isDirectSelected(i));let r=Object.keys(this.$__.selected),n=null;if(r.length===1&&r[0]==="_id")return this.$__.selected._id===0;for(let i of r)if(i!=="_id"&&Z8t(this.$__.selected[i])){n=!!this.$__.selected[i];break}return n===null?!0:Object.hasOwn(this.$__.selected,e)?n:!n};Oe.prototype.validate=async function(e,r){if(typeof e=="function"||typeof r=="function"||typeof arguments[2]=="function")throw new lf("Document.prototype.validate() no longer accepts a callback");if(this.$op="validate",arguments.length===1&&typeof arguments[0]=="object"&&!Array.isArray(arguments[0])&&(r=arguments[0],e=null),r&&typeof r.pathsToSkip=="string"){let i=r.pathsToSkip.indexOf(" ")===-1;r.pathsToSkip=i?[r.pathsToSkip]:r.pathsToSkip.split(" ")}let n=r?._skipParallelValidateCheck;if(this.$isSubdocument==null){if(this.$__.validating&&!n)throw new Oyn(this);n||(this.$__.validating=!0)}try{await this.$__validate(e,r)}finally{this.$op=null,this.$__.validating=null}};Oe.prototype.$validate=Oe.prototype.validate;function Xyn(t){let e=Object.keys(t.$__.activePaths.getStatePaths("require")),r=0,n=e.length;for(r=0;r<n;++r){let i=e[r],a=t.$__schema.path(i);if(typeof a?.originalRequiredValue=="function"){t.$__.cachedRequired=t.$__.cachedRequired||{};try{t.$__.cachedRequired[i]=a.originalRequiredValue.call(t,t)}catch(s){t.invalidate(i,s)}}}}function n4t(t,e,r,n){let i={};Xyn(t);let a=new Set(Object.keys(t.$__.activePaths.getStatePaths("require")).filter(function(u){return!t.$__isSelected(u)&&!t.$isModified(u)||u.endsWith(".$*")?!1:t.$__.cachedRequired!=null&&u in t.$__.cachedRequired?t.$__.cachedRequired[u]:!0}));Object.keys(t.$__.activePaths.getStatePaths("init")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("modify")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("default")).forEach(s);function s(u){u.endsWith(".$*")||a.add(u)}if(!n){let u=[];for(let c of Object.keys(t.$__schema.paths)){let d=t.$__schema.path(c);if(d.$isSingleNested){let h=t.$get(c);h&&u.push(h)}else if(d.$isMongooseDocumentArray){let h=t.$get(c);if(h?.length)for(let p of h)p&&u.push(p)}}let f=t.modifiedPaths();for(let c of u)if(c.$basePath){let d=c.$__pathRelativeToParent();for(let p of c.modifiedPaths())a.delete(d+"."+p);let h=c.$parent();if(h==null)throw new Error("Cannot validate subdocument that does not have a parent");t.$isModified(d,null,f)&&!Object.hasOwn(h.$__.activePaths.getStatePaths("modify"),d)&&!h.$isDefault(d)&&(a.add(d),t.$__.pathsToScopes==null&&(t.$__.pathsToScopes={}),t.$__.pathsToScopes[d]=c.$isDocumentArrayElement?c.__parentArray:c.$parent(),i[d]={skipSchemaValidators:!0},c.$isDocumentArrayElement&&c.__index!=null&&(i[d].index=c.__index))}}for(let u of a){let f=t.$__schema.path(u);if(f){if(f.$isMongooseDocumentArray)for(let c of a)(c==null||c.startsWith(f.path+"."))&&a.delete(c);(!f.schema&&!f.embeddedSchemaType&&f.validators.length===0&&!f.$parentSchemaDocArray&&!f.$isSchemaMap||f.$isMongooseArray&&!f.$isMongooseDocumentArray&&!f.embeddedSchemaType.$isMongooseArray&&f.validators.length===0&&f.embeddedSchemaType.validators.length===0)&&a.delete(u)}}Array.isArray(e)?a=e2n(a,e):Array.isArray(r)&&(a=t2n(a,r)),Qyn(t,a);let o={skipArrays:!0};for(let u of a)if(t.$__schema.nested[u]){let f=t.$__getValue(u);jyn(f)&&(f=f.toObject({transform:!1}));let c=Ryn(f,u,o,t.$__schema),d=t.$__schema.singleNestedPaths;for(let h of Object.keys(c))Object.hasOwn(d,h)||s(h)}for(let u of a){let f=t.$__schema.path(u);if(!f||(f.$parentSchemaDocArray&&typeof f.$parentSchemaDocArray.path=="string"&&a.add(f.$parentSchemaDocArray.path),!f.$isSchemaMap))continue;let c=t.$__getValue(u);if(c!=null)for(let d of c.keys())a.add(u+"."+d)}return a=Array.from(a),[a,i]}function Qyn(t,e){for(let r of e){let n=t.$__schema.path(r);if(!n||!n.$isMongooseArray||!Array.isArray(n)&&n.$isMongooseDocumentArray&&!n?.schemaOptions?.required||n.$isMongooseArray&&!n.$isMongooseDocumentArray&&!n.embeddedSchemaType.$isMongooseArray&&n.embeddedSchemaType.validators.length===0)continue;let i=t.$__getValue(r);Vz(i,e,r)}}function Vz(t,e,r){if(t!=null){let n=t.length;for(let i=0;i<n;++i)Array.isArray(t[i])?Vz(t[i],e,r+"."+i):e.add(r+"."+i)}}Oe.prototype._execDocumentPreHooks=async function(e,...r){return this.$__middleware.execPre(e,this,[...r])};Oe.prototype._execDocumentPostHooks=async function(e,r){return this.$__middleware.execPost(e,this,[this],{error:r})};Oe.prototype.$__validate=async function(e,r){try{[r]=await this._execDocumentPreHooks("validate",r)}catch(b){await this._execDocumentPostHooks("validate",b);return}this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!e&&(e=[...this.$__.saveOptions.pathsToSave]);let n=r&&typeof r=="object"&&"validateModifiedOnly"in r,i=r?.pathsToSkip||null,a;n?a=!!r.validateModifiedOnly:a=this.$__schema.options.validateModifiedOnly;let s=r?.validateAllPaths;if(s){if(i)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(e)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(n&&a)throw new TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}let o=this,u=()=>{let b=this.$__.validationError;if(this.$__.validationError=null,this.$__.validating=null,a&&b!=null){let v=Object.keys(b.errors);for(let E of v)this.$isModified(E)||delete b.errors[E];Jt.hasOwnKeys(b.errors)===!1&&(b=void 0)}if(this.$__.cachedRequired={},this.$emit("validate",o),this.constructor.emit("validate",o),b){for(let v in b.errors)!this[Uyn]&&b.errors[v]instanceof lf.CastError&&this.invalidate(v,b.errors[v]);return b}},f,c;if(s){f=new Set(Object.keys(this.$__schema.paths));for(let b of f){if(!this.$__schema.path(b)?.$isMongooseArray)continue;let E=this.$__getValue(b);E&&Vz(E,f,b)}f=[...f],c={}}else{let b=n4t(this,e,i,r?._nestedValidate);f=a?b[0].filter(v=>this.$isModified(v)):b[0],c=b[1]}if(typeof e=="string"&&(e=e.split(" ")),f.length===0){let b=u();await this._execDocumentPostHooks("validate",b);return}let d={},h=this.$__.saveOptions?.pathsToSave,p=[];if(Array.isArray(h)){h=new Set(h);for(let b of f)h.has(b)&&p.push(y(b))}else for(let b of f)p.push(y(b));await Promise.all(p);let m=u();await this._execDocumentPostHooks("validate",m);async function y(b){if(b==null||d[b])return;d[b]=!0;let v=o.$__schema.path(b);if(!v||!o.$isValid(b)||v[Kyn]!=null&&b!==v.path)return;let E=o.$__getValue(b),x;(x=o.$populated(b))?E=x:E?.$__?.wasPopulated&&(E=E._doc._id);let w=o.$__.pathsToScopes!=null&&b in o.$__.pathsToScopes?o.$__.pathsToScopes[b]:o,M={...c[b],path:b,validateAllPaths:s,_nestedValidate:!0};try{await v.doValidate(E,w,M)}catch(N){if((v.$isSingleNested||v.$isArraySubdocument||v.$isMongooseDocumentArray)&&N instanceof Uz)return;o.invalidate(b,N,void 0,!0)}}};function e2n(t,e){let r=new Set(e),n=new Map([]);for(let a of e){if(a.indexOf(".")===-1)continue;let s=a.split("."),o=s[0];for(let u=1;u<s.length;++u)n.set(o,a),o=o+"."+s[u]}let i=new Set;for(let a of t)r.has(a)?i.add(a):n.has(a)&&i.add(n.get(a));return i}function t2n(t,e){return e=new Set(e),t=Array.from(t).filter(r=>!e.has(r)),new Set(t)}Oe.prototype.validateSync=function(t,e){let r=this;arguments.length===1&&typeof arguments[0]=="object"&&!Array.isArray(arguments[0])&&(e=arguments[0],t=null);let n=e&&typeof e=="object"&&"validateModifiedOnly"in e,i;n?i=!!e.validateModifiedOnly:i=this.$__schema.options.validateModifiedOnly;let a=e?.pathsToSkip,s=e?.validateAllPaths;if(s){if(a)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`")}typeof t=="string"?t=t.indexOf(" ")===-1?[t]:t.split(" "):typeof a=="string"&&a.indexOf(" ")!==-1&&(a=a.split(" "));let o,u;if(s){o=new Set(Object.keys(this.$__schema.paths));for(let d of o){if(!this.$__schema.path(d)?.$isMongooseArray)continue;let p=this.$__getValue(d);p&&Vz(p,o,d)}o=[...o],u={}}else{let d=n4t(this,t,a);o=i?d[0].filter(h=>this.$isModified(h)):d[0],u=d[1]}let f={};for(let d=0,h=o.length;d<h;++d){let p=o[d];if(f[p])continue;f[p]=!0;let m=r.$__schema.path(p);if(!m||!r.$isValid(p))continue;let y=r.$__getValue(p),b=m.doValidateSync(y,r,{skipSchemaValidators:u[p],path:p,validateModifiedOnly:i,validateAllPaths:s});if(b){if((m.$isSingleNested||m.$isArraySubdocument||m.$isMongooseDocumentArray)&&b instanceof Uz)continue;r.invalidate(p,b,void 0,!0)}}let c=r.$__.validationError;if(r.$__.validationError=void 0,r.$emit("validate",r),r.constructor.emit("validate",r),c)for(let d in c.errors)c.errors[d]instanceof lf.CastError&&r.invalidate(d,c.errors[d]);return c};Oe.prototype.invalidate=function(t,e,r,n){if(this.$__.validationError||(this.$__.validationError=new Uz(this)),!this.$__.validationError.errors[t])return(!e||typeof e=="string")&&(e=new Y8t({path:t,message:e,type:n||"user defined",value:r})),this.$__.validationError===e?this.$__.validationError:(this.$__.validationError.addError(t,e),this.$__.validationError)};Oe.prototype.$markValid=function(t){this.$__.validationError?.errors[t]&&(delete this.$__.validationError.errors[t],Jt.hasOwnKeys(this.$__.validationError.errors)===!1&&(this.$__.validationError=null))};function r2n(t,e){if(!t.$__.validationError)return;let r=Object.keys(t.$__.validationError.errors);for(let n of r)n.startsWith(e+".")&&delete t.$__.validationError.errors[n];Jt.hasOwnKeys(t.$__.validationError.errors)===!1&&(t.$__.validationError=null)}function n2n(t,e,r){let n=e.schema;if(n!=null)for(let i of Object.keys(n.paths)){let a=n.paths[i];if(a.$immutableSetter==null)continue;let s=r?.$__getValue(i);a.$immutableSetter.call(t,s)}}Oe.prototype.$isValid=function(t){return this.$__.validationError==null||Jt.hasOwnKeys(this.$__.validationError.errors)===!1?!0:t==null?!1:(t.indexOf(" ")!==-1&&(t=t.split(" ")),Array.isArray(t)?t.some(e=>this.$__.validationError.errors[e]==null):this.$__.validationError.errors[t]==null)};Oe.prototype.$__reset=function(){let e=this,r=this.$isSubdocument?null:this.$getAllSubdocs({useCache:!0});if(r?.length>0)for(let n of r)n.$__reset();return this.$__dirty().forEach(function(n){let i=n.value;i&&typeof i.clearAtomics=="function"?i.clearAtomics():i&&i[cf]&&(i[aR]=i[cf],i[cf]={})}),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,e=this,this.$__schema.requiredPaths().forEach(function(n){e.$__.activePaths.require(n)}),this};Oe.prototype.$__undoReset=function(){if(this.$__.backup?.activePaths!=null){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 e of this.$__dirty()){let r=e.value;r?.[cf]&&r[aR]&&(r[cf]=r[aR])}if(!this.$isSubdocument)for(let e of this.$getAllSubdocs())e.$__undoReset()}};Oe.prototype.$__dirty=function(){let t=this,e=this.$__.activePaths.map("modify",function(i){return{path:i,value:t.$__getValue(i),schema:t.$__path(i)}});e=e.concat(this.$__.activePaths.map("default",function(i){if(!(i==="_id"||t.$__getValue(i)==null))return{path:i,value:t.$__getValue(i),schema:t.$__path(i)}}));let r=new Map(e.filter(i=>i!=null).map(i=>[i.path,i.value])),n=[];return e.forEach(function(i){if(!i)return;let a=null,s=JSe(i.path);for(let o=0;o<s.length-1;o++)if(r.has(s[o])){a=r.get(s[o]);break}a==null?n.push(i):a!=null&&a[cf]!=null&&a.hasAtomics()&&(a[cf]={},a[cf].$set=a)}),n};Oe.prototype.$__setSchema=function(t){Iyn(t.tree,this,void 0,t.options);for(let e of Object.keys(t.virtuals))t.virtuals[e]._applyDefaultGetters();t.path("schema")==null&&(this.schema=t),this.$__schema=t,this.$__middleware=t._getDocumentMiddleware(),this[Hyn]=t};Oe.prototype.$__getArrayPathsToValidate=function(){return jz||(jz=mv()),this.$__.activePaths.map("init","modify",function(t){return this.$__getValue(t)}.bind(this)).filter(function(t){return t&&Array.isArray(t)&&Jt.isMongooseDocumentArray(t)&&t.length}).reduce(function(t,e){return t.concat(e)},[]).filter(function(t){return t})};Oe.prototype.$getAllSubdocs=function(t){if(t?.useCache&&this.$__.saveOptions?.__subdocs)return this.$__.saveOptions.__subdocs;jz||(jz=mv()),iR=iR||x9();let e=[];function r(n){let i=[];for(let{model:a}of n.$__schema.childSchemas){let s=n.$__getValue(a.path);if(s!=null){if(s.$__&&i.push(s),Array.isArray(s))for(let o of s)o?.$__&&i.push(o);if(s instanceof Map)for(let o of s.values())o?.$__&&i.push(o)}}for(let a of i)r(a);e.push(...i)}return r(this),this.$__.saveOptions&&(this.$__.saveOptions.__subdocs=e),e};function i2n(t){let e=t.$__schema&&t.$__schema.callQueue;if(e.length)for(let r of e)r[0]!=="pre"&&r[0]!=="post"&&r[0]!=="on"&&t[r[0]].apply(t,r[1])}Oe.prototype.$__handleReject=function(e){this.$listeners("error").length?this.$emit("error",e):this.constructor.listeners?.("error").length&&this.constructor.emit("error",e)};Oe.prototype.$toObject=function(t,e){let r=this.$__schema._defaultToObjectOptions(e),n=this.$__hasOnlyPrimitiveValues();t=Jt.isPOJO(t)?{...t}:{},t._calledWithOptions=t._calledWithOptions||{...t};let i;t._calledWithOptions.minimize!=null?i=t.minimize:this.$__schemaTypeOptions?.minimize!=null?i=this.$__schemaTypeOptions.minimize:r?.minimize!=null?i=r.minimize:i=this.$__schema.options.minimize,t.minimize=i,n||(t._seen=t._seen||new Map);let a=t._calledWithOptions.depopulate??r?.depopulate??t.depopulate??!1;if(a&&t._isNested&&this.$__.wasPopulated)return o1(this.$__.wasPopulated.value||this._doc._id,t);if(a&&(t.depopulate=!0),r!=null)for(let p of Object.keys(r))t[p]==null&&(t[p]=r[p]);t._isNested=!0,t.json=e,t.minimize=i;let s=t._parentOptions;t._parentOptions=this.$isSubdocument?t:null;let o=t._calledWithOptions.schemaFieldsOnly??t.schemaFieldsOnly??r.schemaFieldsOnly??!1,u;if(n&&!t.flattenObjectIds)u=this.$__toObjectShallow(o);else if(o){u={};for(let p of Object.keys(this.$__schema.paths)){let m=this.$__getValue(p);if(m===void 0)continue;let y=p,b=u;if(p.indexOf(".")!==-1){let v=p.split(".");y=v[v.length-1];for(let E=0;E<v.length-1;++E)b[v[E]]=b[v[E]]??{},b=b[v[E]]}if(m===null){b[y]=null;continue}b[y]=o1(m,t)}}else u=o1(this._doc,t)||{};let f=t._calledWithOptions.getters??t.getters??r.getters??!1;f&&(a2n(this,u),t.minimize&&(u=$yn(u)||{}));let c=t._calledWithOptions.virtuals??r.virtuals??s?.virtuals??void 0;(c||f&&c!==!1)&&ZSe(this,u,t,t),t.versionKey===!1&&this.$__schema.options.versionKey&&delete u[this.$__schema.options.versionKey];let d=t._calledWithOptions.transform??!0,h;if(d===!0?h=r.transform:typeof d=="function"&&(h=d),d&&s2n(this,u),t.useProjection&&o2n(this,u),typeof h=="function"){let p=h(this,u,t);typeof p<"u"&&(u=p)}return u};Oe.prototype.$__toObjectShallow=function(e){let r={};if(this._doc!=null){let n=Object.keys(e?this.$__schema.paths:this._doc);for(let i of n){let a=this._doc[i];a instanceof Date?r[i]=new Date(a):a!==void 0&&(r[i]=a)}}return r};Oe.prototype.toObject=function(t){return this.$toObject(t)};function ZSe(t,e,r,n){let i=t.$__schema,a=i.virtuals,s=Object.keys(a),o=s.length,u=o,f,c,d=t._doc,h,p=typeof n?.aliases=="boolean"?n.aliases:!0;r=r||{};let m=null;if(Array.isArray(r.virtuals))m=new Set(r.virtuals);else if(r.virtuals?.pathsToSkip){m=new Set(s);for(let y=0;y<r.virtuals.pathsToSkip.length;y++)m.has(r.virtuals.pathsToSkip[y])&&m.delete(r.virtuals.pathsToSkip[y])}if(!d)return e;for(o=0;o<u;++o){if(f=s[o],m!=null&&!m.has(f)||!p&&Object.hasOwn(i.aliases,f))continue;if(c=f,r.path!=null){if(!f.startsWith(r.path+"."))continue;c=f.substring(r.path.length+1)}if(c.indexOf(".")===-1&&c===f){if(h=a[f].applyGetters(void 0,t),h===void 0)continue;h=o1(h,r),e[c]=h;continue}let y=c.split(".");if(h=o1(t.get(f),r),h===void 0)continue;let b=y.length;d=e;for(let v=0;v<b-1;++v)d[y[v]]=d[y[v]]||{},d=d[y[v]];d[y[b-1]]=h}return e}function a2n(t,e){let r=t.$__schema,n=Object.keys(r.paths),i=n.length,a,s=t._doc,o;if(!s)return e;for(;i--;){a=n[i];let u=a.split("."),f=u.length,c=f-1,d=e,h;if(s=t._doc,!!t.$__isSelected(a))for(let p=0;p<f&&(h=u[p],o=s[h],!(d!=null&&typeof d!="object"));++p){if(p===c){if(d[h]=r.paths[a].applyGetters(d[h],t),Array.isArray(d[h])&&r.paths[a].embeddedSchemaType)for(let m=0;m<d[h].length;++m)d[h][m]=r.paths[a].embeddedSchemaType.applyGetters(d[h][m],t)}else if(o==null){h in s&&(d[h]=o);break}else d=d[h]||(d[h]={});s=o}}return e}function s2n(t,e){let r=t.$__schema,n=Object.keys(r.paths||{});if(!t._doc)return e;for(let a of n){let s=r.paths[a],o=s.options.transform??s.constructor?.defaultOptions?.transform,u=s.embeddedSchemaType?.options?.transform??s.embeddedSchemaType?.constructor?.defaultOptions?.transform;if(typeof o=="function"){let f=t.$get(a);if(f===void 0)continue;let c=o.call(t,f);G8t(a,c),Jt.setValue(a,c,e)}else if(typeof u=="function"){let f=t.$get(a);if(f===void 0)continue;let c=[].concat(f);for(let d=0;d<c.length;++d){let h=u.call(t,c[d]);c[d]=h,G8t(a,h)}e[a]=c}}return e}function G8t(t,e){if(Lyn(e))throw new Error("`transform` function must be synchronous, but the transform on path `"+t+"` returned a promise.")}function o2n(t,e){let r=t.$__schema,n=Object.keys(r.paths||{});if(!t._doc)return e;let a=t.$__.selected;if(a===void 0&&(a={},Fyn.applyPaths(a,r)),a==null||Jt.hasOwnKeys(a)===!1)return e;for(let s of n)a[s]!=null&&!a[s]&&delete e[s];return e}Oe.prototype.toJSON=function(t){return this.$toObject(t,!0)};Oe.prototype.ownerDocument=function(){return this};Oe.prototype.parent=function(){return this.$isSubdocument||this.$__.wasPopulated?this.$__.parent:this};Oe.prototype.$parent=Oe.prototype.parent;Oe.prototype.$__setParent=function(e){this.$__.parent=e};Oe.prototype.inspect=function(t){let e=Jt.isPOJO(t),r;e&&(r=t,r.minimize=!1);let n=arguments.length>0?this.toObject(r):this.toObject();return n??"MongooseDocument { "+n+" }"};KSe.custom&&(Oe.prototype[KSe.custom]=Oe.prototype.inspect);Oe.prototype.toString=function(){let t=this.inspect();return typeof t=="string"?t:KSe(t)};Oe.prototype.equals=function(t){if(!t)return!1;let e=this.$__getValue("_id"),r=t.$__!=null?t.$__getValue("_id"):t;return!e&&!r?Lz(this,t):e&&e.equals?e.equals(r):e===r};Oe.prototype.populate=async function(){let e={},r=[...arguments];if(typeof r[r.length-1]=="function")throw new lf("Document.prototype.populate() no longer accepts a callback");if(r.length!==0){let a=Jt.populate.apply(null,r);for(let s of a)e[s.path]=s}let n=Jt.object.vals(e),i=this.constructor;if(this.$__isNested){i=this.$__[Gyn].constructor;let a=this.$__.nestedPath;n.forEach(function(s){s.path=a+"."+s.path})}if(this.$session()!=null){let a=this.$session();n.forEach(s=>{if(s.options==null){s.options={session:a};return}"session"in s.options||(s.options.session=a)})}return n.forEach(a=>{a._localModel=i}),i.populate(this,n)};Oe.prototype.$getPopulatedDocs=function(){let e=[];this.$__.populated!=null&&(e=e.concat(Object.keys(this.$__.populated)));let r=[];for(let n of e){let i=this.$get(n);Array.isArray(i)?r=r.concat(i):i instanceof Oe&&r.push(i)}return r};Oe.prototype.populated=function(t,e,r){if(e==null||e===!0){if(!this.$__.populated||typeof t!="string")return;let i=t.endsWith(".$*")?t.replace(/\.\$\*$/,""):t,a=this.$__.populated[i];return a?e===!0?a:a.value:void 0}this.$__.populated||(this.$__.populated={}),this.$__.populated[t]={value:e,options:r};let n=t.split(".");for(let i=0;i<n.length-1;++i){let a=n.slice(0,i+1).join("."),s=this.$get(a);if(s?.$__!=null&&this.$populated(a)){let o=n.slice(i+1).join(".");s.$populated(o,e,r);break}}return e};Oe.prototype.$populated=Oe.prototype.populated;Oe.prototype.$assertPopulated=function(e,r){if(Array.isArray(e))return e.forEach(n=>this.$assertPopulated(n,r)),this;if(arguments.length>1&&this.$set(r),!this.$populated(e))throw new lf(`Expected path "${e}" to be populated`);return this};Oe.prototype.depopulate=function(t){typeof t=="string"&&(t=t.indexOf(" ")===-1?[t]:t.split(" "));let e,r=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],n=this.$__?.populated||{};if(arguments.length===0){for(let a of r)delete this.$$populatedVirtuals[a],delete this._doc[a],delete n[a];let i=Object.keys(n);for(let a of i)if(e=this.$populated(a),!!e)if(delete n[a],Array.isArray(e)){let s=Jt.getValue(a,this._doc);if(s.isMongooseArray){let o=s.__array;for(let u=0;u<o.length;++u){let f=o[u];f!=null&&(o[u]=f instanceof Oe?f._doc._id:f._id)}}else Jt.setValue(a,e,this._doc)}else Jt.setValue(a,e,this._doc);return this}for(let i of t)if(e=this.$populated(i),delete n[i],r.indexOf(i)!==-1)delete this.$$populatedVirtuals[i],delete this._doc[i];else if(e)if(Array.isArray(e)){let a=Jt.getValue(i,this._doc);if(a.isMongooseArray){let s=a.__array;for(let o=0;o<s.length;++o){let u=s[o];u!=null&&(s[o]=u instanceof Oe?u._doc._id:u._id)}}else Jt.setValue(i,e,this._doc)}else Jt.setValue(i,e,this._doc);return this};Oe.prototype.$__fullPath=function(t){return t||""};Oe.prototype.getChanges=function(){let t=this.$__delta();return t?t[1]:{}};Oe.prototype.$__delta=function(){let e=this.$__dirty(),r=this.$__schema.options.optimisticConcurrency;if(r)if(Array.isArray(r)){let u=new Set(r);this.modifiedPaths().some(c=>u.has(c))&&(this.$__.version=e.length?kh:T9)}else if(Array.isArray(r?.exclude)){let u=new Set(r.exclude);this.modifiedPaths().some(c=>!u.has(c))&&(this.$__.version=e.length?kh:T9)}else this.$__.version=e.length?kh:T9;if(!e.length&&kh!==this.$__.version)return;let n={},i={},a=e.length,s=[],o=0;for(n._id=this._doc._id,n?._id?.$__!=null&&(n._id=n._id.toObject({transform:!1,depopulate:!0}));o<a;++o){let u=e[o],f=u.value,c=u2n(this,u.path,f);if(c){s.push(c);continue}if(!this.$populated(u.path,!0)&&this.$__.selected){let h=u.path.split("."),p=h[0];if(this.$__.selected[p]&&this.$__.selected[p].$elemMatch)if(h.length>1&&h[1]==0&&typeof n[p]>"u")n[p]=this.$__.selected[p],h[1]="$",u.path=h.join(".");else{s.push(u.path);continue}}if(!(this.$isDefault(u.path)&&this.$__.selected&&(u.path.indexOf(".")===-1&&H8t(this.$__.selected,u.path)||JSe(u.path).find(p=>H8t(this.$__.isSelected,p))))&&!s.length)if(f===void 0)Oy(this,n,i,u,1,"$unset");else if(f===null)Oy(this,n,i,u,null);else if(typeof f.getAtomics=="function")f2n(this,n,i,u,f);else if(f[xyn.pathSymbol]&&Buffer.isBuffer(f))f=f.toObject(),Oy(this,n,i,u,f);else if(this.$__.primitiveAtomics?.[u.path]!=null){let h=this.$__.primitiveAtomics[u.path],p=Pyn(h);Oy(this,n,i,u,h[p],p)}else f=o1(f,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}),Oy(this,n,i,u,f)}if(s.length)throw new wyn(s);return this.$__.version&&this.$__version(n,i),Jt.hasOwnKeys(i)===!1?[n,null]:[n,i]};function u2n(t,e,r){let n=t.$populated(e,!0);if(!n&&t.$__.selected){let a=e.split(".")[0];if(t.$__.selected[a+".$"])return a}if(!(n&&Jt.isMongooseArray(r)))return;if(n.options.match||n.options.options&&Object.hasOwn(n.options.options,"limit")||n.options.options?.skip||n.options.select&&(n.options.select._id===0||/\s?-_id\s?/.test(n.options.select))){let a=r[cf];if(Jt.hasOwnKeys(a)===!1||a.$set||a.$pop)return e}}function Oy(t,e,r,n,i,a){if(a||(a="$set"),r[a]||(r[a]={}),r[a][n.path]=i,t.$__schema.options.versionKey!==!1&&!l2n(t,n.path)&&kh!==(kh&t.$__.version)&&!(t.$__schema.options.optimisticConcurrency===!0||Array.isArray(t.$__schema.options.optimisticConcurrency)||Array.isArray(t.$__schema.options.optimisticConcurrency?.exclude))){switch(a){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}a==="$push"||a==="$addToSet"||a==="$pullAll"||a==="$pull"?/\.\d+\.|\.\d+$/.test(n.path)?t.$__.version=kh:t.$__.version|=yv:/^\$p/.test(a)||Array.isArray(i)?t.$__.version=kh:/\.\d+\.|\.\d+$/.test(n.path)&&(t.$__.version|=T9)}}function f2n(t,e,r,n,i){if(r.$set?.[n.path])return;if(typeof i.getAtomics=="function"){i.getAtomics().forEach(function(d){let h=d[0],p=d[1];Oy(t,e,r,n,p,h)});return}if(typeof i.$__getAtomics=="function"){i.$__getAtomics().forEach(function(d){let h=d[0],p=d[1];Oy(t,e,r,n,p,h)});return}let a=i[cf],s=Object.keys(a),o=s.length,u,f;if(o===0)return Jt.isMongooseObject(i)?i=i.toObject({depopulate:1,_isNested:!0}):i.valueOf&&(i=i.valueOf()),Oy(t,e,r,n,i);function c(d){return Jt.isMongooseObject(d)?d.toObject({depopulate:1,_isNested:!0}):d}for(;o--;)f=s[o],u=a[f],Jt.isMongooseObject(u)?u=u.toObject({depopulate:!0,transform:!1,_isNested:!0}):Array.isArray(u)?u=u.map(c):u.valueOf&&(u=u.valueOf()),f==="$addToSet"&&(u={$each:u}),Oy(t,e,r,n,u,f)}function l2n(t,e){let r=t.$__schema.options.skipVersioning;return r?(e=e.replace(/\.\d+\./,"."),r[e]):!1}Oe.prototype.$clone=function(){let t=this.constructor,e=new t;if(e.$isNew=this.$isNew,this._doc&&(e._doc=o1(this._doc,{retainDocuments:!0,parentDoc:e})),this.$__){let r=this.$__.constructor,n=new r;for(let i of Object.getOwnPropertyNames(this.$__))i!=="activePaths"&&(n[i]=o1(this.$__[i]));Object.assign(n.activePaths,o1({...this.$__.activePaths})),e.$__=n}return e};Oe.prototype.$createModifiedPathsSnapshot=function(){let e=new WeakMap;if(!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)e.set(n,n.$__.activePaths.clone())}return new Tyn(e,this.$__.activePaths.clone(),this.$__.version)};Oe.prototype.$restoreModifiedPathsSnapshot=function(e){if(this.$__.activePaths=e.activePaths.clone(),this.$__.version=e.version,!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)e.subdocSnapshot.has(n)&&(n.$__.activePaths=e.subdocSnapshot.get(n))}return this};Oe.prototype.$clearModifiedPaths=function(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){let e=this.$getAllSubdocs();for(let r of e)r.$clearModifiedPaths()}return this};Oe.prototype.$__hasOnlyPrimitiveValues=function(){return!this.$__.populated&&!this.$__.wasPopulated&&(this._doc==null||Object.values(this._doc).every(e=>e==null||typeof e!="object"||Jt.isNativeObject(e)&&!Array.isArray(e)||V8t(e,"ObjectId")||V8t(e,"Decimal128")))};Oe.prototype._applyVersionIncrement=function(){if(!this.$__.version)return;let e=yv===(yv&this.$__.version);if(this.$__.version=void 0,e){let r=this.$__schema.options.versionKey,n=this.$__getValue(r)||0;this.$__setValue(r,n+1)}};Oe.prototype._applyVersionIncrement=function(){if(!this.$__.version)return;let e=yv===(yv&this.$__.version);if(this.$__.version=void 0,e){let r=this.$__schema.options.versionKey,n=this.$__getValue(r)||0;this.$__setValue(r,n+1)}};Oe.VERSION_WHERE=T9;Oe.VERSION_INC=yv;Oe.VERSION_ALL=kh;Oe.ValidationError=Uz;a4t.exports=i4t=Oe});var zt=l(gt=>{"use strict";var c2n=sr().UUID,d2n=D$(),o4t=bl(),p2n=Wb(),u4t=vSe(),QSe=_a(),h2n=Eb(),m2n=sv(),f4t=ZH(),l4t=s_t(),Jb=Jo(),y2n=y9(),b2n=KEe(),sR=QP(),g2n=hz(),oR=av(),{trustedSymbol:O9}=b9(),XSe;gt.specialProperties=oR;gt.isMongooseArray=f4t.isMongooseArray;gt.isMongooseDocumentArray=l4t.isMongooseDocumentArray;gt.registerMongooseArray=f4t.registerMongooseArray;gt.registerMongooseDocumentArray=l4t.registerMongooseDocumentArray;var ewe=/\s/,twe=/\s+/;gt.toCollectionName=function(t,e){if(t==="system.profile"||t==="system.indexes")return t;if(typeof e=="function"){if(typeof t!="string")throw new TypeError("Collection name must be a string");if(t.length===0)throw new TypeError("Collection name cannot be empty");return e(t)}return t};gt.deepEqual=function t(e,r){if(e===r)return!0;if(typeof e!="object"||typeof r!="object")return e===r;if(e instanceof Date&&r instanceof Date)return e.getTime()===r.getTime();if(Jb(e,"ObjectId")&&Jb(r,"ObjectId")||Jb(e,"Decimal128")&&Jb(r,"Decimal128"))return e.toString()===r.toString();if(e instanceof RegExp&&r instanceof RegExp)return e.source===r.source&&e.ignoreCase===r.ignoreCase&&e.multiline===r.multiline&&e.global===r.global&&e.dotAll===r.dotAll&&e.unicode===r.unicode&&e.sticky===r.sticky&&e.hasIndices===r.hasIndices;if(e==null||r==null||e.prototype!==r.prototype)return!1;if(e instanceof Map||r instanceof Map)return!(e instanceof Map)||!(r instanceof Map)?!1:t(Array.from(e.keys()),Array.from(r.keys()))&&t(Array.from(e.values()),Array.from(r.values()));if(e instanceof Number&&r instanceof Number)return e.valueOf()===r.valueOf();if(Buffer.isBuffer(e))return gt.buffer.areEqual(e,r);if(Array.isArray(e)||Array.isArray(r)){if(!Array.isArray(e)||!Array.isArray(r))return!1;let s=e.length;if(s!==r.length)return!1;for(let o=0;o<s;++o)if(!t(e[o],r[o]))return!1;return!0}e.$__!=null?e=e._doc:sR(e)&&(e=e.toObject()),r.$__!=null?r=r._doc:sR(r)&&(r=r.toObject());let n=Object.keys(e),i=Object.keys(r),a=n.length;if(a!==i.length)return!1;for(let s=a-1;s>=0;s--)if(n[s]!==i[s])return!1;for(let s of n)if(!t(e[s],r[s]))return!1;return!0};gt.last=function(t){if(t!=null&&t.length>0)return t[t.length-1]};gt.cloneArrays=function(e){return Array.isArray(e)?e.map(r=>gt.cloneArrays(r)):e};gt.omit=function(e,r){if(r==null)return Object.assign({},e);Array.isArray(r)||(r=[r]);let n=Object.assign({},e);for(let i of r)delete n[i];return n};gt.clonePOJOsAndArrays=function(e){if(e==null||e.$__!=null)return e;if(y2n(e)){e={...e};for(let r of Object.keys(e))e[r]=gt.clonePOJOsAndArrays(e[r]);return e}if(Array.isArray(e)){e=[...e];for(let r=0;r<e.length;++r)e[r]=gt.clonePOJOsAndArrays(e[r]);return e}return e};gt.merge=function t(e,r,n,i){if(n=n||{},r==null)return e;let a=Object.keys(r),s=0,o=a.length,u;r[O9]&&(e[O9]=r[O9]),i=i||"";let f=n.omitNested||{};for(;s<o;)if(u=a[s++],!(n.omit&&n.omit[u])&&!f[i]&&!oR.has(u))if(e[u]==null)e[u]=gt.clonePOJOsAndArrays(r[u]);else if(gt.isObject(r[u])){if(gt.isObject(e[u])||(e[u]={}),r[u]!=null){if(n.isDiscriminatorSchemaMerge&&r[u].$isSingleNested&&e[u].$isMongooseDocumentArray||r[u].$isMongooseDocumentArray&&e[u].$isSingleNested)continue;if(r[u].instanceOfSchema){e[u].instanceOfSchema?g2n(e[u],r[u].clone(),n.isDiscriminatorSchemaMerge):e[u]=r[u].clone();continue}else if(Jb(r[u],"ObjectId")){e[u]=new p2n(r[u]);continue}}t(e[u],r[u],n,i?i+"."+u:u)}else n.overwrite&&(e[u]=r[u]);return e};gt.toObject=function t(e){XSe||(XSe=Dh());let r;if(e==null)return e;if(e instanceof XSe)return e.toObject();if(Array.isArray(e)){r=[];for(let n of e)r.push(t(n));return r}if(gt.isPOJO(e)){r={},e[O9]&&(r[O9]=e[O9]);for(let n of Object.keys(e))oR.has(n)||(r[n]=t(e[n]));return r}return e};gt.isObject=m2n;gt.isPOJO=y9();gt.isNonBuiltinObject=function(e){return typeof e=="object"&&!gt.isNativeObject(e)&&!gt.isMongooseType(e)&&!(e instanceof c2n)&&e!=null};gt.isNativeObject=function(t){return Array.isArray(t)||t instanceof Date||t instanceof Boolean||t instanceof Number||t instanceof String};gt.isEmptyObject=function(e){return e==null||typeof e!="object"?!1:gt.hasOwnKeys(e)===!1};gt.hasOwnKeys=function(e){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1};gt.hasKey=function(e,r){let n=Object.keys(e);for(let i of n)if(i===r||gt.isPOJO(e[i])&>.hasKey(e[i],r))return!0;return!1};gt.tick=function(e){if(typeof e=="function")return function(){try{e.apply(this,arguments)}catch(r){h2n(function(){throw r})}}};gt.isMongooseType=function(t){return Jb(t,"ObjectId")||Jb(t,"Decimal128")||t instanceof Buffer};gt.isMongooseObject=sR;gt.expires=function(e){e&&e.constructor.name==="Object"&&"expires"in e&&(e.expireAfterSeconds=typeof e.expires!="string"?e.expires:Math.round(d2n(e.expires)/1e3),delete e.expires)};gt.populate=function(e,r,n,i,a,s,o,u){let f=null;if(arguments.length===1){if(e instanceof u4t)return e._docs={},e._childDocs=[],[e];if(Array.isArray(e))return c(e).map(h=>gt.populate(h)[0]);gt.isObject(e)?f=Object.assign({},e):f={path:e}}else typeof n=="object"?f={path:e,select:r,match:n,options:i}:f={path:e,select:r,model:n,match:i,options:a,populate:s,justOne:o,count:u};if(typeof f.path!="string"&&!(Array.isArray(f.path)&&f.path.every(d=>typeof d=="string")))throw new TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `"+typeof e+"`");return v2n(f);function c(d){let h=[];return d.forEach(function(p){ewe.test(p.path)?p.path.split(twe).forEach(function(y){let b=Object.assign({},p);b.path=y,h.push(b)}):h.push(p)}),h}};function v2n(t){if(Array.isArray(t.populate)){let n=[];t.populate.forEach(function(i){if(ewe.test(i.path)){let a=Object.assign({},i);a.path.split(twe).forEach(function(o){a.path=o,n.push(gt.populate(a)[0])})}else n.push(gt.populate(i)[0])}),t.populate=gt.populate(n)}else t.populate!=null&&typeof t.populate=="object"&&(t.populate=gt.populate(t.populate));let e=[],r=ewe.test(t.path)?t.path.split(twe):Array.isArray(t.path)?t.path:[t.path];t.options!=null&&(t.options=QSe(t.options));for(let n of r)e.push(new u4t(Object.assign({},t,{path:n})));return e}gt.getValue=function(t,e,r){return o4t.get(t,e,E2n,r)};var _2n=Object.freeze({getters:!1});function E2n(t,e){if(e==="$*"&&t instanceof Map)return t;let r=t?._doc||t;return r?.isMongooseArrayProxy&&(r=r.__array),r instanceof Map?r.get(e,_2n):r[e]}gt.setValue=function(t,e,r,n,i){o4t.set(t,e,r,"_doc",n,i)};gt.object={};gt.object.vals=function(e){if(e==null)return[];let r=Object.keys(e),n=r.length,i=[];for(;n--;)i.push(e[r[n]]);return i};gt.isNullOrUndefined=function(t){return t==null};gt.array={};gt.array.flatten=function t(e,r,n){return n||(n=[]),e.forEach(function(i){Array.isArray(i)?t(i,r,n):(!r||r(i))&&n.push(i)}),n};gt.hasUserDefinedProperty=function(t,e){if(t==null)return!1;if(Array.isArray(e)){for(let r of e)if(gt.hasUserDefinedProperty(t,r))return!0;return!1}if(Object.hasOwn(t,e))return!0;if(typeof t=="object"&&e in t){let r=t[e];return r!==Object.prototype[e]&&r!==Array.prototype[e]}return!1};var s4t=Math.pow(2,32)-1;gt.isArrayIndex=function(t){return typeof t=="number"?t>=0&&t<=s4t:typeof t=="string"&&/^\d+$/.test(t)?(t=+t,t>=0&&t<=s4t):!1};gt.array.unique=function(t){let e=new Set,r=new Set,n=[];for(let i of t)if(typeof i=="number"||typeof i=="string"||i==null){if(e.has(i))continue;n.push(i),e.add(i)}else if(Jb(i,"ObjectId")){if(r.has(i.toString()))continue;n.push(i),r.add(i.toString())}else n.push(i);return n};gt.buffer={};gt.buffer.areEqual=function(t,e){return!Buffer.isBuffer(t)||!Buffer.isBuffer(e)?!1:t.equals(e)};gt.getFunctionName=b2n;gt.decorate=function(t,e){for(let r in e)oR.has(r)||(t[r]=e[r])};gt.mergeClone=function(t,e){sR(e)&&(e=e.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1}));let r=Object.keys(e),n=r.length,i=0,a;for(;i<n;)if(a=r[i++],!oR.has(a))if(typeof t[a]>"u")t[a]=QSe(e[a],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{let s=e[a];if(s?.valueOf&&!(s instanceof Date)&&(s=s.valueOf()),gt.isObject(s)){let o=s;sR(s)&&!s.isMongooseBuffer&&(o=o.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1})),s.isMongooseBuffer&&(o=Buffer.from(o)),gt.mergeClone(t[a],o)}else t[a]=QSe(s,{flattenDecimals:!1})}};gt.each=function(t,e){for(let r of t)e(r)};gt.renameObjKey=function(t,e,r){return Object.keys(t).reduce((i,a)=>(a===e?i[r]=t[e]:i[a]=t[a],i),{})};gt.getOption=function(t){let e=Array.prototype.slice.call(arguments,1);for(let r of e)if(r!=null&&r[t]!=null)return r[t];return null};gt.noop=function(){};gt.errorToPOJO=function(e){if(!(e instanceof Error))throw new Error("`error` must be `instanceof Error`.");let n={};for(let i of Object.getOwnPropertyNames(e))n[i]=e[i];return n};gt.warn=function(e){return process.emitWarning(e,{code:"MONGOOSE"})};gt.injectTimestampsOption=function(e,r){r!=null&&(e.timestamps=r)}});var ka=l((zz,y4t)=>{"use strict";var fR=ml(),m4t=ff(),S2n=pz(),w2n=bSe(),Hz=_a(),rwe=zvt(),A2n=Gvt(),nwe=Yvt(),x2n=Mt().schemaTypeSymbol,gv=zt(),uR=Mt().validatorErrorSymbol,T2n=Mt().documentIsModified,c4t=Mt().populateModelSymbol,iwe=fR.CastError,C9=fR.ValidatorError,O2n={_skipMarkModified:!0};function pr(t,e,r,n){this[x2n]=!0,this.path=t,this.instance=r,this.schemaName=this.constructor.schemaName,this.validators=[],this.getters=Object.hasOwn(this.constructor,"getters")?this.constructor.getters.slice():[],this.setters=Object.hasOwn(this.constructor,"setters")?this.constructor.setters.slice():[],this.splitPath(),e=e||{};let i=this.constructor.defaultOptions||{},a=Object.keys(i);for(let u of a)u==="validate"?this.validate(i.validate):Object.hasOwn(i,u)&&!Object.hasOwn(e,u)&&(e[u]=i[u]);e.select==null&&delete e.select;let s=this.OptionsConstructor||m4t;this.options=new s(e),this.parentSchema=n,this._index=null,gv.hasUserDefinedProperty(this.options,"immutable")&&(this.$immutable=this.options.immutable,rwe(this));let o=Object.keys(this.options);for(let u of o){if(u==="cast"){Array.isArray(this.options[u])?this.castFunction.apply(this,this.options[u]):this.castFunction(this.options[u]);continue}if(gv.hasUserDefinedProperty(this.options,u)&&typeof this[u]=="function"){if(u==="index"&&this._index){if(e.index===!1){let d=this._index;if(typeof d=="object"&&d!=null){if(d.unique)throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(d.sparse)throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}let f=e[u];if(u==="default"){this.default(f);continue}let c=Array.isArray(f)?f:[f];this[u].apply(this,c)}}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}pr.prototype.OptionsConstructor=m4t;pr.prototype.path;pr.prototype.toJSON=function(){let e={...this};return delete e.parentSchema,e};pr.prototype.validators;pr.prototype.isRequired;pr.prototype.splitPath=function(){if(this._presplitPath!=null)return this._presplitPath;if(this.path!=null)return this._presplitPath=this.path.indexOf(".")===-1?[this.path]:this.path.split("."),this._presplitPath};pr.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=r=>r),this._cast=e,this._cast)};pr.prototype.castFunction=function(e,r){return arguments.length===0?this._castFunction:(e===!1&&(e=this.constructor._defaultCaster||(n=>n)),typeof e=="string"?(this._castErrorMessage=e,this._castFunction):(e!=null&&(this._castFunction=e),r!=null&&(this._castErrorMessage=r),this._castFunction))};pr.prototype.cast=function(){throw new Error("Base SchemaType class does not implement a `cast()` function")};pr.set=function(e,r){Object.hasOwn(this,"defaultOptions")||(this.defaultOptions=Object.assign({},this.defaultOptions)),this.defaultOptions[e]=r};pr.get=function(t){this.getters=Object.hasOwn(this,"getters")?this.getters:[],this.getters.push(t)};pr.prototype.default=function(t){if(arguments.length===1){if(t===void 0){this.defaultValue=void 0;return}if(t?.instanceOfSchema)throw new fR("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=t,this.defaultValue}else arguments.length>1&&(this.defaultValue=[...arguments]);return this.defaultValue};pr.prototype.index=function(t){return this._index=t,gv.expires(this._index),this};pr.prototype.unique=function(e,r){if(this._index===!1){if(!e)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}return!Object.hasOwn(this.options,"index")&&e===!1?this:(this._index==null||this._index===!0?this._index={}:typeof this._index=="string"&&(this._index={type:this._index}),this._index.unique=!!e,typeof r=="string"&&(this._duplicateKeyErrorMessage=r),this)};pr.prototype.text=function(t){if(this._index===!1){if(!t)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}return!Object.hasOwn(this.options,"index")&&t===!1?this:(this._index===null||this._index===void 0||typeof this._index=="boolean"?this._index={}:typeof this._index=="string"&&(this._index={type:this._index}),this._index.text=t,this)};pr.prototype.sparse=function(t){if(this._index===!1){if(!t)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}return!Object.hasOwn(this.options,"index")&&t===!1?this:(this._index==null||typeof this._index=="boolean"?this._index={}:typeof this._index=="string"&&(this._index={type:this._index}),this._index.sparse=t,this)};pr.prototype.immutable=function(t){return this.$immutable=t,rwe(this),this};pr.prototype.transform=function(t){return this.options.transform=t,this};pr.prototype.set=function(t){if(typeof t!="function")throw new TypeError("A setter must be a function.");return this.setters.push(t),this};pr.prototype.get=function(t){if(typeof t!="function")throw new TypeError("A getter must be a function.");return this.getters.push(t),this};pr.prototype.validateAll=function(t){for(let e=0;e<t.length;e++)this.validate(t[e]);return this};pr.prototype.validate=function(t,e,r){if(typeof t=="function"||t&&gv.getFunctionName(t.constructor)==="RegExp"){let s;return typeof e=="function"?(s={validator:t,message:e},s.type=r||"user defined"):e instanceof Object&&!r?(s=nwe(e)?Object.assign({},e):Hz(e),s.message||(s.message=s.msg),s.validator=t,s.type=s.type||"user defined"):(e==null&&(e=fR.messages.general.default),r||(r="user defined"),s={message:e,type:r,validator:t}),this.validators.push(s),this}let n,i,a;for(n=0,i=arguments.length;n<i;n++){if(a=arguments[n],!gv.isPOJO(a)){let s="Invalid validator. Received ("+typeof a+") "+a+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()";throw new Error(s)}this.validate(a.validator,a)}return this};pr.prototype.required=function(t,e){let r={};if(arguments.length>0&&t==null)return this.validators=this.validators.filter(function(a){return a.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;if(typeof t=="object"&&(r=t,e=r.message||e,t=t.isRequired),t===!1)return this.validators=this.validators.filter(function(a){return a.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;let n=this;this.isRequired=!0,this.requiredValidator=function(a){let s=this?.$__?.cachedRequired;if(s!=null&&!this.$__isSelected(n.path)&&!this[T2n](n.path))return!0;if(s!=null&&n.path in s){let o=s[n.path]?n.checkRequired(a,this):!0;return delete s[n.path],o}else if(typeof t=="function")return t.apply(this)?n.checkRequired(a,this):!0;return n.checkRequired(a,this)},this.originalRequiredValue=t,typeof t=="string"&&(e=t,t=void 0);let i=e||fR.messages.general.required;return this.validators.unshift(Object.assign({},r,{validator:this.requiredValidator,message:i,type:"required"})),this};pr.prototype.ref=function(t){return this.options.ref=t,this};pr.prototype.getDefault=function(t,e,r){let n;if(this.defaultValue==null)return this.defaultValue;if(typeof this.defaultValue=="function"?this.defaultValue===Date.now||this.defaultValue===Array||this.defaultValue.name.toLowerCase()==="objectid"?n=this.defaultValue.call(t):n=this.defaultValue.call(t,t):n=this.defaultValue,n!=null){if(typeof n=="object"&&!this.options?.shared&&(n=Hz(n)),r?.skipCast)return this._applySetters(n,t);let i=this.applySetters(n,t,e,void 0,O2n);return i&&!Array.isArray(i)&&i.$isSingleNested&&(i.$__parent=t),i}return n};pr.prototype._applySetters=function(t,e,r,n,i){let a=t;if(r)return a;let s=this.setters;for(let o=s.length-1;o>=0;o--)a=s[o].call(e,a,n,this,i);return a};pr.prototype._castNullish=function(e){return e};pr.prototype.applySetters=function(t,e,r,n,i){let a=this._applySetters(t,e,r,n,i);return a==null?this._castNullish(a):(a=this.cast(a,e,r,n,i),a)};pr.prototype.applyGetters=function(t,e){let r=t,n=this.getters,i=n.length;if(i===0)return r;for(let a=0;a<i;++a)r=n[a].call(e,r,this);return r};pr.prototype.select=function(e){return this.selected=!!e,this};pr.prototype.doValidate=async function(e,r,n){let i=!1,a=this.path,s=this.validators.filter(u=>typeof u=="object"&&u!==null);if(!s.length)return;let o=[];for(let u=0,f=s.length;u<f;++u){let c=s[u],d=c.validator,h,p=nwe(c)?Object.assign({},c):Hz(c);if(p.path=n?.path||a,p.fullPath=this.$fullPath,p.value=e,typeof e=="string"&&(p.length=e.length,p.value.length>30&&(p.value=p.value.slice(0,30)+"...")),!(e===void 0&&d!==this.requiredValidator)){if(d instanceof RegExp){if(h=d.test(e),h===!1){let m=p.ErrorConstructor||C9;throw i=new m(p,r),i[uR]=!0,i}continue}else if(typeof d!="function")continue;try{p.propsParameter?h=d.call(r,e,p):h=d.call(r,e)}catch(m){h=!1,p.reason=m,m.message&&(p.message=m.message)}if(typeof h?.then=="function")o.push(h.then(function(m){if(m===!1){let y=p.ErrorConstructor||C9;throw i=new y(p,r),i[uR]=!0,i}},function(m){p.reason=m,p.message=m.message,h=!1;let y=p.ErrorConstructor||C9;throw i=new y(p,r),i[uR]=!0,i}));else if(h!==void 0&&!h){let m=p.ErrorConstructor||C9;throw i=new m(p,r),i[uR]=!0,i}}}await Promise.all(o)};function d4t(t,e){if(t!==void 0&&!t){let r=e.ErrorConstructor||C9,n=new r(e);return n[uR]=!0,n}}pr.prototype.doValidateSync=function(t,e,r){let n=this.path;if(!this.validators.length)return null;let a=this.validators;if(t===void 0)if(this.validators.length!==0&&this.validators[0].type==="required")a=[this.validators[0]];else return null;let s=null,o=0,u=a.length;for(o=0;o<u;++o){let f=a[o];if(f===null||typeof f!="object")continue;let c=f.validator,d=nwe(f)?Object.assign({},f):Hz(f);d.path=r?.path||n,d.fullPath=this.$fullPath,d.value=t,typeof t=="string"&&(d.length=t.length,d.value.length>30&&(d.value=d.value.slice(0,30)+"..."));let h=!1;if(!A2n(c)){if(c instanceof RegExp){s=d4t(c.test(t),d);continue}if(typeof c=="function"){try{d.propsParameter?h=c.call(e,t,d):h=c.call(e,t)}catch(p){h=!1,d.reason=p}if(typeof h?.then!="function"&&(s=d4t(h,d),s))break}}}return s};pr._isRef=function(t,e,r,n){let i=n&&(t.options?.ref||t.options?.refPath);if(!i&&r?.$__!=null){let a=r.$__fullPath(t.path,!0),s=r.ownerDocument();i=a!=null&&s.$populated(a)||r.$populated(t.path)}return i?e==null||!Buffer.isBuffer(e)&&e._bsontype!=="Binary"&&gv.isObject(e)?!0:n:!1};pr.prototype._castRef=function(e,r,n,i){if(e==null)return e;if(e.$__!=null)return e.$__.wasPopulated=e.$__.wasPopulated||{value:e._doc._id},e;if(Buffer.isBuffer(e)||!gv.isObject(e)){if(n)return e;throw new iwe(this.instance,e,this.path,null,this)}let a=r.$__fullPath(this.path,!0),o=r.ownerDocument().$populated(a,!0),u=e;if(!r.$__.populated||!r.$__.populated[a]||!r.$__.populated[a].options||!r.$__.populated[a].options.options||!r.$__.populated[a].options.options.lean){let f=o?o.options[c4t]:r.constructor.db.model(this.options.ref);u=f.hydrate(e,null,i),u.$__.wasPopulated={value:u._doc._id,options:{[c4t]:f}}}return u};function p4t(t,e){return this.castForQuery(null,t,e)}function C2n(t,e){let r=this;return Array.isArray(t)?t.map(function(n){return r.castForQuery(null,n,e)}):[this.castForQuery(null,t,e)]}function h4t(t,e){let r=this;return Array.isArray(t)?t.map(function(n){return Array.isArray(n)&&n.length===0?n:r.castForQuery(null,n,e)}):[this.castForQuery(null,t,e)]}pr.prototype.$conditionalHandlers={$all:C2n,$eq:p4t,$in:h4t,$ne:p4t,$nin:h4t,$exists:S2n,$type:w2n};pr.prototype.castForQuery=function(t,e,r){let n;if(t!=null){if(n=this.$conditionalHandlers[t],!n)throw new Error("Can't use "+t);return n.call(this,e,r)}try{return this.applySetters(e,r)}catch(i){throw i instanceof iwe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};pr.checkRequired=function(t){return arguments.length!==0&&(this._checkRequired=t),this._checkRequired};pr.prototype.checkRequired=function(t){return t!=null};pr.prototype.clone=function(){let t=Object.assign({},this.options),e=new this.constructor(this.path,t,this.instance,this.parentSchema);return e.validators=this.validators.slice(),this.requiredValidator!==void 0&&(e.requiredValidator=this.requiredValidator),this.defaultValue!==void 0&&(e.defaultValue=this.defaultValue),this.$immutable!==void 0&&this.options.immutable===void 0&&(e.$immutable=this.$immutable,rwe(e)),this._index!==void 0&&(e._index=this._index),this.selected!==void 0&&(e.selected=this.selected),this.isRequired!==void 0&&(e.isRequired=this.isRequired),this.originalRequiredValue!==void 0&&(e.originalRequiredValue=this.originalRequiredValue),e.getters=this.getters.slice(),e.setters=this.setters.slice(),e};pr.prototype.getEmbeddedSchemaType=function(){return this.embeddedSchemaType};pr.prototype._duplicateKeyErrorMessage=null;pr.prototype.toJSONSchema=function(e){throw new Error(`Converting unsupported SchemaType to JSON Schema: ${this.instance} at path "${this.path}"`)};pr.prototype.autoEncryptionType=function(){return null};y4t.exports=zz=pr;zz.CastError=iwe;zz.ValidatorError=C9});var awe=l((Y7a,b4t)=>{"use strict";var u1=yl(),df=class{constructor(e){Object.assign(this,e),e?.options!=null&&(this.options=Object.assign({},e.options))}};Object.defineProperty(df.prototype,"ref",u1);Object.defineProperty(df.prototype,"refPath",u1);Object.defineProperty(df.prototype,"localField",u1);Object.defineProperty(df.prototype,"foreignField",u1);Object.defineProperty(df.prototype,"justOne",u1);Object.defineProperty(df.prototype,"count",u1);Object.defineProperty(df.prototype,"match",u1);Object.defineProperty(df.prototype,"options",u1);Object.defineProperty(df.prototype,"skip",u1);Object.defineProperty(df.prototype,"limit",u1);Object.defineProperty(df.prototype,"perDocumentLimit",u1);b4t.exports=df});var Wz=l((J7a,g4t)=>{"use strict";g4t.exports=function(e,r,n){return e==null?e:(e._doc!=null&&(e=e._doc),arguments.length>=3?typeof e!="object"||n===void 0?void 0:(e instanceof Map?e.set(r,n):e[r]=n,n):r==="$*"?e instanceof Map?Array.from(e.values()):Object.keys(e).map(i=>e[i]):e instanceof Map?e.get(r):e[r])}});var swe=l((Z7a,S4t)=>{"use strict";var I2n=Ir(),M2n=CSe(),v4t=Wz(),_4t=bl(),P2n=fe("util"),R2n=zt(),E4t=/(\.\d+$|\.\d+\.)/g;S4t.exports=function(e,r,n,i,a){if(e==null)return[];if(typeof e=="string"&&a!=null&&M2n(a,e))throw new I2n("refPath `"+e+"` must not be excluded in projection, got "+P2n.inspect(a));if(E4t.test(n)){let u=n.split(E4t);if(u[u.length-1]==="")throw new Error("Can't populate individual element in an array");let f="",c=e;for(let p=0;p<u.length;p+=2){let m=u[p];if(c.startsWith(m+"."))f+=c.substring(0,m.length)+u[p+1],c=c.substring(m.length+1);else if(p===u.length-1){f+=c,c="";break}else throw new Error("Could not normalize ref path, chunk "+m+" not in populated path")}let d=_4t.get(f,r,v4t),h=Array.isArray(d)?d:[d];return h=R2n.array.flatten(h),h}let s=_4t.get(e,r,v4t),o;return i!=null&&Object.hasOwn(i.virtuals,e)?o=[i.virtuals[e].applyGetters(void 0,r)]:o=Array.isArray(s)?s:[s],o}});var Gz=l((X7a,w4t)=>{"use strict";var q2n=swe(),N2n=zt(),D2n=Mt().modelSymbol;function Cy(t,e){this.path=e,this.getters=[],this.setters=[],this.options=Object.assign({},t)}Cy.prototype._applyDefaultGetters=function(){if(this.getters.length>0||this.setters.length>0)return;let e="$"+this.path;this.getters.push(function(){return this.$locals[e]}),this.setters.push(function(r){this.$locals[e]=r})};Cy.prototype.clone=function(){let t=new Cy(this.options,this.path);return t.getters=[].concat(this.getters),t.setters=[].concat(this.setters),t};Cy.prototype.get=function(t){return this.getters.push(t),this};Cy.prototype.set=function(t){return this.setters.push(t),this};Cy.prototype.applyGetters=function(t,e){N2n.hasUserDefinedProperty(this.options,["ref","refPath"])&&e.$$populatedVirtuals&&Object.hasOwn(e.$$populatedVirtuals,this.path)&&(t=e.$$populatedVirtuals[this.path]);let r=t;for(let n of this.getters)r=n.call(e,r,this,e);return r};Cy.prototype.applySetters=function(t,e){let r=t;for(let n of this.setters)r=n.call(e,r,this,e);return r};Cy.prototype._getModelNamesForPopulate=function(e){if(this.options.refPath)return q2n(this.options.refPath,e,this.path);let r=null;return typeof this.options.ref=="function"&&!this.options.ref[D2n]?r=this.options.ref.call(e,e):r=this.options.ref,r!=null&&!Array.isArray(r)?[r]:r};w4t.exports=Cy});var owe=l((Q7a,A4t)=>{"use strict";A4t.exports=function(e){let r={_id:{auto:!0}};r._id[e.options.typeKey]="ObjectId",e.add(r)}});var uwe=l((e9a,x4t)=>{"use strict";x4t.exports=function(e,r){let n=e.discriminatorMapping?.value;if(n&&!("sparse"in r)){let i=e.options.discriminatorKey;r.partialFilterExpression=r.partialFilterExpression||{},r.partialFilterExpression[i]=n}return r}});var O4t=l((t9a,T4t)=>{"use strict";var fwe=$a(),k2n=sv(),$2n=uwe();T4t.exports=function(e){let r=[],n=new WeakMap,i=e.constructor.indexTypes,a=new Map;return s(e),r;function s(u,f,c){if(n.has(u))return;n.set(u,!0),f=f||"";let d=Object.keys(u.paths);for(let h of d){let p=u.paths[h];if(c!=null&&c.paths[h])continue;if(p._duplicateKeyErrorMessage!=null&&(u._duplicateKeyErrorMessagesByPath=u._duplicateKeyErrorMessagesByPath||{},u._duplicateKeyErrorMessagesByPath[h]=p._duplicateKeyErrorMessage),p.$isMongooseDocumentArray||p.$isSingleNested){if(fwe(p,"options.excludeIndexes")!==!0&&fwe(p,"schemaOptions.excludeIndexes")!==!0&&fwe(p,"schema.options.excludeIndexes")!==!0&&s(p.schema,f+h+"."),p.schema.discriminators!=null){let y=p.schema.discriminators,b=Object.keys(y);for(let v of b)s(y[v],f+h+".",p.schema)}if(p.$isMongooseDocumentArray)continue}let m=p._index||p.embeddedSchemaType&&p.embeddedSchemaType._index;if(m!==!1&&m!=null){let y={},b=k2n(m),v=b?{...m}:{},E=typeof m=="string"?m:b?m.type:!1;if(E&&i.indexOf(E)!==-1)y[f+h]=E;else if(v.text)y[f+h]="text",delete v.text;else{let w=!1;m==="descending"||m==="desc"?w=!0:m==="ascending"||m==="asc"?w=!1:w=Number(m)===-1,y[f+h]=w?-1:1}delete v.type,u.options.autoIndex!=null&&(v._autoIndex=u.options.autoIndex);let x=v?.name;typeof x=="string"?a.has(x)?Object.assign(a.get(x),y):(r.push([y,v]),a.set(x,y)):(r.push([y,v]),a.set(x,y))}}n.delete(u),f?o(u,f):(u._indexes.forEach(function(h){let p=h[1];$2n(u,p)}),r=r.concat(u._indexes))}function o(u,f){let c=u._indexes,d=c.length;for(let h=0;h<d;++h){let p=c[h][0],m=c[h][1],y=Object.keys(p),b=y.length,v={};for(let x=0;x<b;++x){let w=y[x];v[f+w]=p[w]}let E=Object.assign({},m);if(m?.partialFilterExpression!=null){E.partialFilterExpression={};let x=m.partialFilterExpression;for(let w of Object.keys(x))E.partialFilterExpression[f+w]=x[w]}r.push([v,E])}}}});var lwe=l((r9a,C4t)=>{"use strict";C4t.exports=function(e){switch(e){case"p":e="primary";break;case"pp":e="primaryPreferred";break;case"s":e="secondary";break;case"sp":e="secondaryPreferred";break;case"n":e="nearest";break}return e}});var M4t=l((n9a,I4t)=>{"use strict";I4t.exports=function(e){return!(!e.paths.id&&e.paths._id&&e.options.id)||e.aliases?.id||e.virtual("id").get(B2n),e};function B2n(){return this._id!=null?this._id.toString():null}});var R4t=l((i9a,P4t)=>{"use strict";P4t.exports=function(e,r){let n=Object.keys(e),i=Object.keys(r);if(n.length!==i.length)return!1;for(let a=0;a<n.length;a++){let s=n[a];if(s!==i[a]||e[s]!==r[s])return!1}return!0}});var N4t=l((a9a,q4t)=>{"use strict";q4t.exports=function(e,r,n,i){return i.justOne||i.count?(e[r]=Array.isArray(n)?n[0]:n,typeof e[r]!="object"&&(e[r]=i.count?n:null)):(e[r]=Array.isArray(n)?n:n==null?[]:[n],e[r]=e[r].filter(function(a){return a&&typeof a=="object"})),e[r]}});var lR=l((s9a,D4t)=>{"use strict";D4t.exports=function(e){return e.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}});var Kz=l((o9a,k4t)=>{"use strict";k4t.exports=F2n;function F2n(t,e){return t==null?null:typeof t=="boolean"?e:typeof t[e]=="boolean"?t[e]?e:null:e in t?t[e]:e}});var dwe=l((u9a,$4t)=>{"use strict";var L2n=lR(),Iy=Kz();$4t.exports=vv;function vv(t,e,r){if(e==null)return;if(Object.keys(e).some(o=>o[0]==="$")){if(e.$push&&s(e.$push),e.$addToSet&&s(e.$addToSet),e.$set!=null){let o=Object.keys(e.$set);for(let u of o)cwe(r,u,e.$set,t)}if(e.$setOnInsert!=null){let o=Object.keys(e.$setOnInsert);for(let u of o)cwe(r,u,e.$setOnInsert,t)}}let a=Object.keys(e).filter(o=>o[0]!=="$");for(let o of a)cwe(r,o,e,t);function s(o){for(let u of Object.keys(o)){let f=r.path(u.replace(/\.\$\./i,".").replace(/.\$$/,""));if(o[u]&&f&&f.$isMongooseDocumentArray&&f.schema.options.timestamps){let c=f.schema.options.timestamps,d=Iy(c,"createdAt"),h=Iy(c,"updatedAt");o[u].$each?o[u].$each.forEach(function(p){h!=null&&(p[h]=t),d!=null&&(p[d]=t),vv(t,p,f.schema)}):(h!=null&&(o[u][h]=t),d!=null&&(o[u][d]=t),vv(t,o[u],f.schema))}}}}function j2n(t,e,r){let n=e.schema.options.timestamps,i=t.length;if(!n){for(let o=0;o<i;++o)vv(r,t[o],e.schema);return}let a=Iy(n,"createdAt"),s=Iy(n,"updatedAt");for(let o=0;o<i;++o)s!=null&&(t[o][s]=r),a!=null&&(t[o][a]=r),vv(r,t[o],e.schema)}function U2n(t,e,r){let n=e.schema.options.timestamps;if(!n){vv(r,t,e.schema);return}let i=Iy(n,"createdAt"),a=Iy(n,"updatedAt");a!=null&&(t[a]=r),i!=null&&(t[i]=r),vv(r,t,e.schema)}function cwe(t,e,r,n){let i=L2n(e),a=t.path(i);if(!a)return;let s=[],o=i.split(".");for(let u=o.length-1;u>0;--u){let f=t.path(o.slice(0,u).join("."));f!=null&&(f.$isMongooseDocumentArray||f.$isSingleNested)&&s.push({parentPath:e.split(".").slice(0,u).join("."),parentSchemaType:f})}if(Array.isArray(r[e])&&a.$isMongooseDocumentArray)j2n(r[e],a,n);else if(r[e]&&a.$isSingleNested)U2n(r[e],a,n);else if(s.length>0)for(let u of s){let f=u.parentPath,c=u.parentSchemaType,d=c.schema.options.timestamps,h=Iy(d,"updatedAt");if(!(!d||h==null)){if(c.$isSingleNested)r[f+"."+h]=n;else if(c.$isMongooseDocumentArray){let p=e.substring(f.length+1);if(/^\d+$/.test(p)){r[f+"."+p][h]=n;continue}let m=p.indexOf(".");p=m!==-1?p.substring(0,m):p,r[f+"."+p+"."+h]=n}}}else if(a.schema!=null&&a.schema!=t&&r[e]){let u=a.schema.options.timestamps,f=Iy(u,"createdAt"),c=Iy(u,"updatedAt");if(!u)return;c!=null&&(r[e][c]=n),f!=null&&(r[e][f]=n)}}});var pwe=l((f9a,F4t)=>{"use strict";var B4t=$a(),V2n=zt();F4t.exports=H2n;function H2n(t,e,r,n,i,a){let s=n,o=s,u=B4t(i,"timestamps",!0);if(!u||s==null)return n;let f=u?.createdAt===!1,c=u?.updatedAt===!1;if(a)return n?.$set&&(n=n.$set,s.$set={},o=s.$set),!c&&r&&!n[r]&&(o[r]=t),!f&&e&&!n[e]&&(o[e]=t),s;if(n=n||{},Array.isArray(s))return r==null||s.push({$set:{[r]:t}}),s;if(s.$set=s.$set||{},!c&&r&&!n.$currentDate?.[r]){let d=!1;if(r.indexOf(".")!==-1){let h=r.split(".");for(let p=1;p<h.length;++p){let m=h.slice(-p).join("."),y=h.slice(0,-p).join(".");if(n[y]!=null){n[y][m]=t,d=!0;break}else if(n.$set?.[y]){n.$set[y][m]=t,d=!0;break}}}d||(s.$set[r]=t),Object.hasOwn(s,r)&&delete s[r]}if(!f&&e){let d=B4t(i,"overwriteImmutable",!1),h=n[e]!=null||n.$set?.[e]!=null;if(d&&h)n[e]!=null&&(s.$set[e]=n[e],delete n[e]);else{n[e]&&delete n[e],n.$set?.[e]&&delete n.$set[e];let p=!1;if(e.indexOf(".")!==-1){let m=e.split(".");for(let y=1;y<m.length;++y){let b=m.slice(-y).join("."),v=m.slice(0,-y).join(".");if(n[v]!=null){n[v][b]=t,p=!0;break}else if(n.$set?.[v]){n.$set[v][b]=t,p=!0;break}}}p||(s.$setOnInsert=s.$setOnInsert||{},s.$setOnInsert[e]=t)}}return V2n.hasOwnKeys(s.$set)===!1&&delete s.$set,s}});var j4t=l((l9a,L4t)=>{"use strict";L4t.exports=function(e,r,n,i,a){let s=r?.updatedAt===!1,o=r?.createdAt===!1,u=n!=null?n():e.ownerDocument().constructor.base.now();if(!o&&(e.isNew||e.$isSubdocument)&&i&&!e.$__getValue(i)&&e.$__isSelected(i)&&e.$set(i,u,void 0,{overwriteImmutable:!0}),!s&&a&&(e.isNew||e.$isModified())){let f=u;e.isNew&&i!=null&&(f=e.$__getValue(i)),e.$set(a,f)}}});var H4t=l((c9a,V4t)=>{"use strict";var z2n=dwe(),W2n=pwe(),G2n=$a(),Yz=Kz(),K2n=j4t(),Y2n=lv(),U4t=new Set(["replaceOne","findOneAndReplace"]);V4t.exports=function(e,r){let n=e.childSchemas.find(i);function i(d){return!!d.schema.options.timestamps}if(!r&&!n)return;let a=Yz(r,"createdAt"),s=Yz(r,"updatedAt"),o=r!=null&&Object.hasOwn(r,"currentTime")?r.currentTime:null,u={};if(e.$timestamps={createdAt:a,updatedAt:s},a&&!e.paths[a]){let h=e.base?.get("timestamps.createdAt.immutable")??null??!0;u[a]={[e.options.typeKey||"type"]:Date,immutable:h}}s&&!e.paths[s]&&(u[s]=Date),e.add(u),e.pre("save",function(){let h=G2n(this,"$__.saveOptions.timestamps");h!==!1&&K2n(this,h,o,a,s)}),e.methods.initializeTimestamps=function(d){if(d===!1)return this;let h=o!=null?o():this.constructor.base.now(),p=d!=null?Yz(d,"createdAt"):a,m=d!=null?Yz(d,"updatedAt"):s;if(p&&!this.get(p)&&this.$set(a,h),m&&!this.get(m)&&this.$set(s,h),this.$isSubdocument)return this;let y=this.$getAllSubdocs();for(let b of y)b.initializeTimestamps&&b.initializeTimestamps(d);return this},c[Y2n.builtInMiddleware]=!0;let f={query:!0,model:!1};e.pre("findOneAndReplace",f,c),e.pre("findOneAndUpdate",f,c),e.pre("replaceOne",f,c),e.pre("update",f,c),e.pre("updateOne",f,c),e.pre("updateMany",f,c);function c(){let d=o!=null?o():this.model.base.now();U4t.has(this.op)&&this.getUpdate()==null&&this.setUpdate({}),W2n(d,a,s,this.getUpdate(),this._mongooseOptions,U4t.has(this.op)),z2n(d,this.getUpdate(),this.model.schema)}}});var W4t=l((d9a,z4t)=>{"use strict";var J2n=Ir(),Z2n=fe("util");z4t.exports=X2n;function X2n(t,e){if(typeof t!="string"&&typeof t!="function")throw new J2n('Invalid ref at path "'+e+'". Got '+Z2n.inspect(t,{depth:0}))}});var cR=l(I9=>{"use strict";var G4t=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]);I9.queryOperations=G4t;var Q2n=G4t.concat(["validate"]);I9.queryMiddlewareFunctions=Q2n;var ebn=["aggregate"];I9.aggregateMiddlewareFunctions=ebn;var tbn=["bulkWrite","createCollection","insertMany"];I9.modelMiddlewareFunctions=tbn;var rbn=["validate","save","remove","updateOne","deleteOne","init"];I9.documentMiddlewareFunctions=rbn});var Y4t=l((h9a,K4t)=>{"use strict";K4t.exports=sr().Double});var Jz=l((m9a,e7t)=>{"use strict";var nbn=cv(),ibn=Ir(),J4t=_a(),abn=zt().deepEqual,sbn=v0(),obn=Cz(),Z4t=fe("util"),ubn=av(),hwe=Jo(),fbn=wz(),X4t=Mt().populateModelSymbol;var f1=class extends Map{constructor(e,r,n,i){sbn(e)==="Object"&&(e=Object.keys(e).reduce((a,s)=>a.concat([[s,e[s]]]),[])),super(e),this.$__parent=n?.$__!=null?n:null,this.$__path=r,this.$__schemaType=i??new nbn(r),this.$__runDeferred()}$init(e,r){Q4t(e),super.set(e,r),r?.$isSingleNested&&(r.$basePath=this.$__path+"."+e)}$__set(e,r){super.set(e,r)}get(e,r){return hwe(e,"ObjectId")&&(e=e.toString()),r=r||{},r.getters===!1?super.get(e):this.$__schemaType.applyGetters(super.get(e),this.$__parent)}set(e,r){if(hwe(e,"ObjectId")&&(e=e.toString()),Q4t(e),r=obn(r),this.$__schemaType==null){this.$__deferred=this.$__deferred||[],this.$__deferred.push({key:e,value:r});return}let n,i=this.$__parent,a=i?.$__?.populated?i.$populated(o.call(this),!0)||i.$populated(this.$__path,!0):null,s=this.get(e);if(a!=null){if(this.$__schemaType.$isSingleNested)throw new ibn(`Cannot manually populate single nested subdoc underneath Map at path "${this.$__path}". Try using an array instead of a Map.`);Array.isArray(r)&&this.$__schemaType.$isMongooseArray?r=r.map(u=>(u.$__==null&&(u=new a.options[X4t](u)),u.$__.wasPopulated={value:u._doc._id},u)):r!=null&&(r.$__==null&&(r=new a.options[X4t](r)),r.$__.wasPopulated={value:r._doc._id})}else try{let u=this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested||this.$__schemaType.$isMongooseArray||this.$__schemaType.$isSchemaMap?{path:o.call(this)}:null;r=this.$__schemaType.applySetters(r,this.$__parent,!1,this.get(e),u)}catch(u){if(this.$__parent?.$__!=null){this.$__parent.invalidate(o.call(this),u);return}throw u}if(super.set(e,r),i?.$__!=null&&!abn(r,s)){let u=o.call(this);i.markModified(u),(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested)&&fbn(i,u)}function o(){return n||(n=this.$__path+"."+e,n)}}clear(){super.clear();let e=this.$__parent;e?.markModified(this.$__path)}delete(e){return hwe(e,"ObjectId")&&(e=e.toString()),this.set(e,void 0),super.delete(e)}toBSON(){return new Map(this)}toObject(e){if(e?.flattenMaps){let r={},n=this.keys();for(let i of n)r[i]=J4t(this.get(i),e);return r}return new Map(this)}$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)}toJSON(e){if(typeof e?.flattenMaps!="boolean"||e.flattenMaps){let r={},n=this.keys();for(let i of n)r[i]=J4t(this.get(i),e);return r}return new Map(this)}inspect(){return new Map(this)}$__runDeferred(){if(this.$__deferred){for(let e of this.$__deferred)this.set(e.key,e.value);this.$__deferred=null}}};Z4t.inspect.custom&&Object.defineProperty(f1.prototype,Z4t.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:f1.prototype.inspect});Object.defineProperty(f1.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(f1.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(f1.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(f1.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(f1.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0});Object.defineProperty(f1.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0});function Q4t(t){let e=typeof t;if(e!=="string")throw new TypeError(`Mongoose maps only support string keys, got ${e}`);if(t.startsWith("$"))throw new Error(`Mongoose maps do not support keys that start with "$", got "${t}"`);if(t.includes("."))throw new Error(`Mongoose maps do not support keys that contain ".", got "${t}"`);if(ubn.has(t))throw new Error(`Mongoose maps do not support reserved key name "${t}"`)}e7t.exports=f1});var r7t=l((y9a,t7t)=>{"use strict";t7t.exports=sr().UUID});var M9=l(vc=>{"use strict";vc.Array=$Se();vc.Buffer=mz();vc.Document=vc.Embedded=x9();vc.DocumentArray=mv();vc.Double=Y4t();vc.Decimal128=JH();vc.ObjectId=Wb();vc.Map=Jz();vc.Subdocument=Mz();vc.UUID=r7t()});var i7t=l((g9a,n7t)=>{"use strict";var lbn=ff(),P9=class extends lbn{},mwe=yl();Object.defineProperty(P9.prototype,"enum",mwe);Object.defineProperty(P9.prototype,"of",mwe);Object.defineProperty(P9.prototype,"castNonArrays",mwe);n7t.exports=P9});var s7t=l((v9a,a7t)=>{"use strict";a7t.exports=ywe;function ywe(t){if(!Array.isArray(t))return{min:0,max:0,containsNonArrayItem:!0};if(t.length===0)return{min:1,max:1,containsNonArrayItem:!1};if(t.length===1&&!Array.isArray(t[0]))return{min:1,max:1,containsNonArrayItem:!1};let e=ywe(t[0]);for(let r=1;r<t.length;++r){let n=ywe(t[r]);n.min<e.min&&(e.min=n.min),n.max>e.max&&(e.max=n.max),e.containsNonArrayItem=e.containsNonArrayItem||n.containsNonArrayItem}return e.min=e.min+1,e.max=e.max+1,e}});var dR=l((_9a,u7t)=>{"use strict";var o7t=fe("assert");u7t.exports=function(e){if(e==null)return e;if(e==="")return null;if((typeof e=="string"||typeof e=="boolean")&&(e=Number(e)),o7t.ok(!isNaN(e)),e instanceof Number)return e.valueOf();if(typeof e=="number")return e;if(!Array.isArray(e)&&typeof e.valueOf=="function")return Number(e.valueOf());if(e.toString&&!Array.isArray(e)&&e.toString()==Number(e))return Number(e);o7t.ok(!1)}});var bwe=l((E9a,f7t)=>{"use strict";f7t.exports=function(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))for(let r=e.length-1;r>=0;--r)e[r]===void 0&&e.splice(r,1);for(let r of Object.keys(e))e[r]===void 0&&delete e[r];return e}});var d7t=l((S9a,c7t)=>{"use strict";var R9=Iu(),l7t=Gb(),Zz=dR(),cbn=bwe(),dbn=new Set(["$and","$or"]),pbn=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),hbn=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),mbn=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),ybn=new Set(["$arrayElemAt","$first","$last"]),bbn=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),gbn=new Set(["$not"]);c7t.exports=function(e,r,n){if(typeof e=="boolean")return e;if(typeof e!="object"||e===null)throw new Error("`$expr` must be an object or boolean literal");return _c(e,r,n)};function _c(t,e,r){if(pR(t)||t===null)return t;t.$cond!=null?Array.isArray(t.$cond)?t.$cond=t.$cond.map(i=>_c(i,e,r)):(t.$cond.if=_c(t.$cond.if,e,r),t.$cond.then=_c(t.$cond.then,e,r),t.$cond.else=_c(t.$cond.else,e,r)):t.$ifNull!=null?t.$ifNull.map(i=>_c(i,e,r)):t.$switch!=null&&(Array.isArray(t.$switch.branches)&&(t.$switch.branches=t.$switch.branches.map(i=>_c(i,e,r))),"default"in t.$switch&&(t.$switch.default=_c(t.$switch.default,e,r)));let n=Object.keys(t);for(let i of n)dbn.has(i)?t[i]=t[i].map(a=>_c(a,e,r)):pbn.has(i)?t[i]=Ebn(t[i],e,r):hbn.has(i)?t[i]=_bn(t[i],e,r):mbn.has(i)?t[i]=gwe(t[i],e,r):gbn.has(i)&&(t[i]=_c(t[i],e,r));if(t.$in&&(t.$in=vbn(t.$in,e,r)),t.$size&&(t.$size=gwe(t.$size,e,r)),t.$round){let i=t.$round;if(!Array.isArray(i)||i.length<1||i.length>2)throw new R9("Array",i,"$round");t.$round=i.map(a=>gwe(a,e,r))}return cbn(t),t}function gwe(t){if(!Xz(t))return t;try{return Zz(t)}catch{throw new R9("Number",t)}}function vbn(t,e,r){let n=t[1];if(!pR(n))return t;let i=t[0],a=e.path(n.slice(1));if(a===null){if(r===!1)return t;if(r==="throw")throw new l7t("$in");return}if(!a.$isMongooseArray)throw new Error("Path must be an array for $in");return[a.embeddedSchemaType.cast(i),n]}function _bn(t){if(!Array.isArray(t)){if(!Xz(t))return t;try{return Zz(t)}catch{throw new R9("Number",t)}}return t.map(e=>{if(!Xz(e))return e;try{return Zz(e)}catch{throw new R9("Number",e)}})}function Ebn(t,e,r){if(!Array.isArray(t)||t.length!==2)throw new Error("Comparison operator must be an array of length 2");t[0]=_c(t[0],e,r);let n=t[0];if(Xz(t[1])){let i=null,a=null,s=null;if(pR(n))i=n.slice(1),a=e.path(i);else if(typeof n=="object"&&n!=null)for(let u of Object.keys(n))bbn.has(u)&&pR(n[u])?(i=n[u].slice(1)+"."+u,s=Zz):ybn.has(u)&&pR(n[u])&&(i=n[u].slice(1)+"."+u,a=e.path(n[u].slice(1)),a!=null&&a.$isMongooseArray&&(a=a.embeddedSchemaType));let o=typeof t[1]=="object"&&t[1]!=null&&t[1].$literal!=null;if(a!=null)o?t[1]={$literal:a.cast(t[1].$literal)}:t[1]=a.cast(t[1]);else if(s!=null)if(o)try{t[1]={$literal:s(t[1].$literal)}}catch{throw new R9(s.name.replace(/^cast/,""),t[1],i+".$literal")}else try{t[1]=s(t[1])}catch{throw new R9(s.name.replace(/^cast/,""),t[1],i)}else{if(i!=null&&r===!0)return;if(i!=null&&r==="throw")throw new l7t(i)}}else t[1]=_c(t[1]);return t}function pR(t){return typeof t=="string"&&t[0]==="$"}function Xz(t){return typeof t=="string"&&t[0]==="$"?!1:typeof t=="object"&&t!==null&&Object.keys(t).find(e=>e[0]==="$")?t.$literal!=null:!0}});var Qz=l((w9a,p7t)=>{"use strict";var Sbn=Iu();p7t.exports=function(e,r){if(e==null)return e;if(typeof e?._id=="string")return e._id;if(e.toString&&e.toString!==Object.prototype.toString&&!Array.isArray(e))return e.toString();throw new Sbn("string",e,r)}});var b7t=l((A9a,y7t)=>{"use strict";var wbn=Iu(),h7t=dz(),m7t=Qz();y7t.exports=function(e,r){if(e==null||typeof e!="object")throw new wbn("$text",e,r);return e.$search!=null&&(e.$search=m7t(e.$search,r+".$search")),e.$language!=null&&(e.$language=m7t(e.$language,r+".$language")),e.$caseSensitive!=null&&(e.$caseSensitive=h7t(e.$caseSensitive,r+".$caseSensitive")),e.$diacriticSensitive!=null&&(e.$diacriticSensitive=h7t(e.$diacriticSensitive,r+".$diacriticSensitive")),e}});var hR=l((x9a,g7t)=>{"use strict";var Abn=new Set(["$ref","$id","$db"]);g7t.exports=function(e){return e[0]==="$"&&!Abn.has(e)}});var _v=l((T9a,S7t)=>{"use strict";var v7t=Iu(),vwe=Gb(),xbn=mR(),Tbn=d7t(),Obn=Qz(),Cbn=b7t(),Ibn=$a(),_7t=Oz(),E7t=hR(),Mbn=fe("util"),Swe=sv(),_we=QP(),Ewe=zt(),Pbn=["Polygon","MultiPolygon"];S7t.exports=function t(e,r,n,i){if(Array.isArray(r))throw new Error("Query filter must be an object, got an array ",Mbn.inspect(r));if(r==null)return r;e?.discriminators!=null&&r[e.options.discriminatorKey]!=null&&(e=_7t(e,r[e.options.discriminatorKey])||e);let a=Object.keys(r),s=a.length,o,u,f,c,d,h,p;for(n=n||{};s--;)if(d=a[s],p=r[d],d==="$or"||d==="$nor"||d==="$and"){if(!Array.isArray(p))throw new v7t("Array",p,d);for(let m=p.length-1;m>=0;m--){if(p[m]==null||typeof p[m]!="object")throw new v7t("Object",p[m],d+"."+m);let y=Object.keys(p[m]).length,b=p[m][e.options.discriminatorKey];if(b==null)p[m]=t(e,p[m],n,i);else{let v=_7t(i.schema,b);p[m]=t(v||e,p[m],n,i)}Ewe.hasOwnKeys(p[m])===!1&&y!==0&&p.splice(m,1)}p.length===0&&delete r[d]}else if(d==="$where"){if(h=typeof p,h!=="string"&&h!=="function")throw new Error("Must have a string or function for $where");h==="function"&&(r[d]=p.toString());continue}else if(d==="$expr"){p=Tbn(p,e);continue}else if(d==="$elemMatch")p=t(e,p,n,i);else if(d==="$text")p=Cbn(p,d);else if(d==="$comment"&&!Object.hasOwn(e.paths,"$comment"))p=Obn(p,d),r[d]=p;else{if(!e)continue;if(f=e.path(d),!f){let m=d.split("."),y=m.length;for(;y--;){let b=m.slice(0,y).join("."),v=m.slice(y).join("."),E=e.path(b),x=E?.schema?.options?.discriminatorKey;if(E?.schema?.discriminators!=null&&x!=null&&v!==x){let w=Ibn(r,b+"."+x),M=E.schema.discriminators;typeof w=="string"&&M[w]!=null?f=M[w].path(v):w!=null&&Object.keys(w).length===1&&Array.isArray(w.$in)&&w.$in.length===1&&typeof w.$in[0]=="string"&&M[w.$in[0]]!=null&&(f=M[w.$in[0]].path(v))}}}if(f){if(p==null)continue;if(Ewe.isPOJO(p))if(u=Object.keys(p).some(E7t),!u)r[d]=f.castForQuery(null,p,i);else{let m=Object.keys(p),y,b=m.length;for(;b--;)if(y=m[b],c=p[y],y==="$elemMatch")c&&f?.schema!=null?t(f.schema,c,n,i):c&&f?.$isMongooseArray&&(Ewe.isPOJO(c)&&c.$not!=null?t(e,c,n,i):p[y]=f.castForQuery(y,c,i));else if(y==="$not"){if(c&&f){if(o=Object.keys(c),o.length&&E7t(o[0]))for(let v in c)c[v]=f.castForQuery(v,c[v],i);else p[y]=f.castForQuery(y,c,i);continue}}else p[y]=f.castForQuery(y,c,i)}else if(Array.isArray(p)&&["Buffer","Array"].indexOf(f.instance)===-1&&!n.sanitizeFilter){let m=[],y=p;for(let b of y)m.push(f.castForQuery(null,b,i));r[d]={$in:m}}else r[d]=f.castForQuery(null,p,i)}else{let m=d.split("."),y=m.length,b,v,E;for(;y--&&(b=m.slice(0,y).join("."),f=e.path(b),!f););if(f){if(f.schema){E={},v=m.slice(y).join("."),E[v]=p;let M=t(f.schema,E,n,i)[v];M===void 0?delete r[d]:r[d]=M}else r[d]=p;continue}if(Swe(p)){let M="";if(p.$near?M="$near":p.$nearSphere?M="$nearSphere":p.$within?M="$within":p.$geoIntersects?M="$geoIntersects":p.$geoWithin&&(M="$geoWithin"),M){let N=new xbn.Number("__QueryCasting__",null,null,e),P=p[M];if(p.$maxDistance!=null&&(p.$maxDistance=N.castForQuery(null,p.$maxDistance,i)),p.$minDistance!=null&&(p.$minDistance=N.castForQuery(null,p.$minDistance,i)),M==="$within"){let k=P.$center||P.$centerSphere||P.$box||P.$polygon;if(!k)throw new Error("Bad $within parameter: "+JSON.stringify(p));P=k}else if(M==="$near"&&typeof P.type=="string"&&Array.isArray(P.coordinates))P=P.coordinates;else if((M==="$near"||M==="$nearSphere"||M==="$geoIntersects")&&P.$geometry&&typeof P.$geometry.type=="string"&&Array.isArray(P.$geometry.coordinates))P.$maxDistance!=null&&(P.$maxDistance=N.castForQuery(null,P.$maxDistance,i)),P.$minDistance!=null&&(P.$minDistance=N.castForQuery(null,P.$minDistance,i)),_we(P.$geometry)&&(P.$geometry=P.$geometry.toObject({transform:!1,virtuals:!1})),P=P.$geometry.coordinates;else if(M==="$geoWithin")if(P.$geometry){_we(P.$geometry)&&(P.$geometry=P.$geometry.toObject({virtuals:!1}));let k=P.$geometry.type;if(Pbn.indexOf(k)===-1)throw new Error('Invalid geoJSON type for $geoWithin "'+k+'", must be "Polygon" or "MultiPolygon"');P=P.$geometry.coordinates}else P=P.$box||P.$polygon||P.$center||P.$centerSphere,_we(P)&&(P=P.toObject({virtuals:!1}));wwe(P,N,i);continue}}if(e.nested[d])continue;let x="strict"in n?n.strict:e.options.strict,w=Rbn(n,e._userProvidedOptions,e.options,i);if(n.upsert&&x)throw x==="throw"?new vwe(d):new vwe(d,'Path "'+d+'" is not in schema, strict mode is `true`, and upsert is `true`.');if(w==="throw")throw new vwe(d,'Path "'+d+`" is not in schema and strictQuery is 'throw'.`);w&&delete r[d]}}return r};function wwe(t,e,r){if(Array.isArray(t))t.forEach(function(n,i){if(Array.isArray(n)||Swe(n))return wwe(n,e,r);t[i]=e.castForQuery(null,n,r)});else{let n=Object.keys(t),i=n.length;for(;i--;){let a=n[i],s=t[a];Array.isArray(s)||Swe(s)?(wwe(s,e,r),t[a]=s):t[a]=e.castForQuery({val:s,context:r})}}}function Rbn(t,e,r,n){if("strictQuery"in t)return t.strictQuery;if("strictQuery"in e)return e.strictQuery;let i=n?.mongooseCollection?.conn?.base?.options;return i&&"strictQuery"in i?i.strictQuery:r.strictQuery}});var A7t=l((O9a,w7t)=>{"use strict";var qbn=ff(),Ev=class extends qbn{},eW=yl();Object.defineProperty(Ev.prototype,"min",eW);Object.defineProperty(Ev.prototype,"max",eW);Object.defineProperty(Ev.prototype,"enum",eW);Object.defineProperty(Ev.prototype,"populate",eW);w7t.exports=Ev});var Mu=l((C9a,x7t)=>{"use strict";x7t.exports=function(e,r,n,i){return n?i?{bsonType:r}:{bsonType:[r,"null"]}:i?{type:e}:{type:[e,"null"]}}});var yR=l((I9a,O7t)=>{"use strict";var Nbn=Iu();function Dbn(t){let e=this;return Array.isArray(t)?t.map(function(r){return T7t(e.path,r)}):Buffer.isBuffer(t)?t:T7t(e.path,t)}function T7t(t,e){let r=Number(e);if(isNaN(r))throw new Nbn("number",e,t);return r}O7t.exports=Dbn});var Twe=l((M9a,C7t)=>{"use strict";var nW=ml(),kbn=A7t(),My=ka(),$bn=dR(),Bbn=Mu(),tW=yR(),Awe=zt(),xwe=My.CastError;function Hi(t,e,r,n){this.enumValues=[],My.call(this,t,e,"Number",n)}Hi.get=My.get;Hi.set=My.set;Hi.setters=[];Hi._cast=$bn;Hi.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Hi._defaultCaster=t=>{if(typeof t!="number")throw new Error;return t};Hi.schemaName="Number";Hi.defaultOptions={};Hi.prototype=Object.create(My.prototype);Hi.prototype.constructor=Hi;Hi.prototype.OptionsConstructor=kbn;Hi._checkRequired=t=>typeof t=="number"||t instanceof Number;Hi.checkRequired=My.checkRequired;Hi.prototype.checkRequired=function(e,r){return typeof e=="object"&&My._isRef(this,e,r,!0)?e!=null:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():Hi.checkRequired())(e)};Hi.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(r){return r.validator!==this.minValidator},this)),t!=null){let r=e||nW.messages.Number.min;r=r.replace(/{MIN}/,t),this.validators.push({validator:this.minValidator=function(n){return n==null||n>=t},message:r,type:"min",min:t})}return this};Hi.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter(function(r){return r.validator!==this.maxValidator},this)),t!=null){let r=e||nW.messages.Number.max;r=r.replace(/{MAX}/,t),this.validators.push({validator:this.maxValidator=function(n){return n==null||n<=t},message:r,type:"max",max:t})}return this};Hi.prototype.enum=function(t,e){if(this.enumValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.enumValidator},this),this.enumValidator=!1),t===void 0||t===!1)return this;if(!Array.isArray(t)){if(Awe.isPOJO(t)&&t.values!=null?(e=t.message,t=t.values):typeof t=="number"&&(t=Array.prototype.slice.call(arguments),e=null),Awe.isPOJO(t)){let i=Object.keys(t).sort(),a=Object.values(t).sort();i.length===a.length&&i.every((s,o)=>s===String(a[o]))&&a.filter(s=>typeof s=="number").length===Math.floor(a.length/2)?t=a.filter(s=>typeof s=="number"):t=Object.values(t)}e=e||nW.messages.Number.enum}e=e??nW.messages.Number.enum;for(let n of t)n!==void 0&&this.enumValues.push(this.cast(n));let r=this.enumValues;return this.enumValidator=n=>n==null||r.indexOf(n)!==-1,this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:r}),this};Hi.prototype.cast=function(t,e,r,n,i){if(typeof t!="number"&&My._isRef(this,t,e,r)&&(t==null||Awe.isNonBuiltinObject(t)))return this._castRef(t,e,r,i);let a=t?._id!==void 0?t._id:t,s;typeof this._castFunction=="function"?s=this._castFunction:typeof this.constructor.cast=="function"?s=this.constructor.cast():s=Hi.cast();try{return s(a)}catch(o){throw new xwe("Number",a,this.path,o,this)}};function rW(t){return this.cast(t)}function Fbn(t){let e=this;return Array.isArray(t)?t.map(function(r){return e.cast(r)}):[this.cast(t)]}var Lbn={...My.prototype.$conditionalHandlers,$bitsAllClear:tW,$bitsAnyClear:tW,$bitsAllSet:tW,$bitsAnySet:tW,$gt:rW,$gte:rW,$lt:rW,$lte:rW,$mod:Fbn};Object.defineProperty(Hi.prototype,"$conditionalHandlers",{enumerable:!1,value:Lbn});Hi.prototype.castForQuery=function(t,e,r){let n;if(t!=null){if(n=this.$conditionalHandlers[t],!n)throw new xwe("number",e,this.path,null,this);return n.call(this,e,r)}try{e=this.applySetters(e,r)}catch(i){throw i instanceof xwe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}return e};Hi.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function"||this.path==="_id";return Bbn("number","number",e?.useBsonType,r)};C7t.exports=Hi});var bR=l(Owe=>{"use strict";var jbn=Twe();Owe.castToNumber=I7t;Owe.castArraysOfNumbers=M7t;function I7t(t){return jbn.cast()(t)}function M7t(t,e){t.forEach(function(r,n){Array.isArray(r)?M7t(r,e):t[n]=I7t.call(e,r)})}});var Mwe=l(iW=>{"use strict";var P7t=bR().castArraysOfNumbers,gR=bR().castToNumber;iW.cast$geoIntersects=Hbn;iW.cast$near=Ubn;iW.cast$within=Vbn;function Ubn(t){let e=aW();if(Array.isArray(t))return P7t(t,this),t;if(Iwe(this,t),t?.$geometry)return Cwe(t,this);if(!Array.isArray(t))throw new TypeError("$near must be either an array or an object with a $geometry property");return e.prototype.castForQuery.call(this,null,t)}function Cwe(t,e){switch(t.$geometry.type){case"Polygon":case"LineString":case"Point":P7t(t.$geometry.coordinates,e);break;default:break}return Iwe(e,t),t}function Vbn(t){if(Iwe(this,t),t.$box||t.$polygon){let e=t.$box?"$box":"$polygon";t[e].forEach(r=>{if(!Array.isArray(r)){let n="Invalid $within $box argument. Expected an array, received "+r;throw new TypeError(n)}r.forEach((n,i)=>{r[i]=gR.call(this,n)})})}else if(t.$center||t.$centerSphere){let e=t.$center?"$center":"$centerSphere";t[e].forEach((r,n)=>{Array.isArray(r)?r.forEach((i,a)=>{r[a]=gR.call(this,i)}):t[e][n]=gR.call(this,r)})}else t.$geometry&&Cwe(t,this);return t}function Hbn(t){if(t.$geometry)return Cwe(t,this),t}function Iwe(t,e){e.$maxDistance&&(e.$maxDistance=gR.call(t,e.$maxDistance)),e.$minDistance&&(e.$minDistance=gR.call(t,e.$minDistance))}});var aW=l((q9a,N7t)=>{"use strict";var zbn=pz(),Wbn=bSe(),q7t=Ir(),Gbn=i7t(),gl=ka(),sW=gl.CastError,oW=cv(),Kbn=awe(),R7t=Gz(),Ybn=s7t(),Rwe=_v(),Jbn=_a(),Zbn=v0(),Xbn=hR(),uW=fe("util"),Zb=zt(),Qbn=bR().castToNumber,egn=Mu(),qwe=Mwe(),tgn=gc(),vR,Pwe,rgn=Object.freeze({});function tn(t,e,r,n,i){Pwe||(Pwe=M9().Embedded);let a="type";if(n?.typeKey&&(a=n.typeKey),this.schemaOptions=n,e){let u={};Zb.isPOJO(e)&&(e[a]?(u=Jbn(e),delete u[a],e=e[a]):e=oW),r?.ref!=null&&u.ref==null&&(u.ref=r.ref),e===Object&&(e=oW);let f=typeof e=="string"?e:Zb.getFunctionName(e),c=mR(),d=Object.hasOwn(c,f)?c[f]:e;typeof d=="function"?d===tn?this.embeddedSchemaType=new d(t,u,n,null,i):this.embeddedSchemaType=new d(t,u,n,i):d instanceof gl&&(this.embeddedSchemaType=d,this.embeddedSchemaType instanceof Pwe||(this.embeddedSchemaType.path=t))}this.$isMongooseArray=!0,gl.call(this,t,r,"Array",i);let s,o;if(this.defaultValue!=null&&(s=this.defaultValue,o=typeof s=="function"),!("defaultValue"in this)||this.defaultValue!=null){let u=function(){return o?s.call(this):s!=null?[].concat(s):[]};u.$runBeforeSetters=!o,this.default(u)}}tn.schemaName="Array";tn.options={castNonArrays:!0};tn.defaultOptions={};tn.set=gl.set;tn.setters=[];tn.get=gl.get;tn.prototype=Object.create(gl.prototype);tn.prototype.constructor=tn;tn.prototype.OptionsConstructor=Gbn;tn._checkRequired=gl.prototype.checkRequired;tn.checkRequired=gl.checkRequired;tn.prototype.virtuals=null;tn.prototype.checkRequired=function(e,r){return typeof e=="object"&&gl._isRef(this,e,r,!0)?!!e:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():tn.checkRequired())(e)};tn.prototype.enum=function(){let t=this;for(;;){let r=t?.embeddedSchemaType?.instance;if(r==="Array"){t=t.embeddedSchemaType;continue}if(r!=="String"&&r!=="Number")throw new Error("`enum` can only be set on an array of strings or numbers , not "+r);break}let e=arguments;return!Array.isArray(arguments)&&Zb.isObject(arguments)&&(e=Zb.object.vals(e)),t.embeddedSchemaType.enum.apply(t.embeddedSchemaType,e),this};tn.prototype.applyGetters=function(t,e){return e?.$__!=null&&e.$populated(this.path)?t:gl.prototype.applyGetters.call(this,t,e)};tn.prototype._applySetters=function(t,e,r,n){if(this.embeddedSchemaType.$isMongooseArray&&tn.options.castNonArrays){let i=0,a=this;for(;a!=null&&a.$isMongooseArray&&!a.$isMongooseDocumentArray;)++i,a=a.embeddedSchemaType;if(t!=null&&t.length!==0){let s=Ybn(t);if(s.min===s.max&&s.max<i&&s.containsNonArrayItem)for(let o=s.max;o<i;++o)t=[t]}}return gl.prototype._applySetters.call(this,t,e,r,n)};tn.prototype.cast=function(t,e,r,n,i){vR||(vR=M9().Array);let a,s;if(Array.isArray(t)){if(!t.length&&e){let p=e.schema.indexedPaths(),m=this.path;for(a=0,s=p.length;a<s;++a){let b=p[a][0][m];if(b==="2dsphere"||b==="2d")return}let y=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(y!=null){for(a=0,s=p.length;a<s;++a)if(p[a][0][y]==="2dsphere")return}}i=i||rgn;let f=Zb.isMongooseArray(t)?t.__array:t,c=i.path||this.path;if(i.arrayPathIndex!=null&&(c+="."+i.arrayPathIndex),t=vR(f,c,e,this),f=t.__array,r&&e?.$__!=null&&e.$populated(this.path))return t;let d=this.embeddedSchemaType,h=d.$isMongooseArray;if(d&&this.embeddedSchemaType.constructor!==oW)try{let p=f.length;for(a=0;a<p;a++){let m={};h&&(i.arrayPath!=null||d._arrayParentPath!=null)&&(m.arrayPathIndex=a),i.hydratedPopulatedDocs&&(m.hydratedPopulatedDocs=i.hydratedPopulatedDocs),i.virtuals&&(m.virtuals=i.virtuals),f[a]=d.applySetters(f[a],e,r,void 0,m)}}catch(p){throw new sW("["+p.kind+"]",uW.inspect(t),this.path+"."+a,p,this)}return t}let o=this.options.castNonArrays??tn.options.castNonArrays;if(r||o)return e&&r&&e.markModified(this.path),this.cast([t],e,r);throw new sW("Array",uW.inspect(t),this.path,null,this)};tn.prototype._castForPopulate=function(e,r){if(vR||(vR=M9().Array),Array.isArray(e)){let n,i=e.__array?e.__array:e,a=i.length;if(this.embeddedSchemaType&&this.embeddedSchemaType.constructor!==oW)try{for(n=0;n<a;n++){let s={};this.embeddedSchemaType.$isMongooseArray&&this.embeddedSchemaType._arrayParentPath!=null&&(s.arrayPathIndex=n),i[n]=this.embeddedSchemaType.cast(i[n],r,!1,void 0,s)}}catch(s){throw new sW("["+s.kind+"]",uW.inspect(e),this.path+"."+n,s,this)}return e}throw new sW("Array",uW.inspect(e),this.path,null,this)};tn.prototype.$toObject=tn.prototype.toObject;tn.prototype.discriminator=function(...t){let e=this;for(;e.$isMongooseArray&&!e.$isMongooseDocumentArray;)e=e.embeddedSchemaType;if(!e.$isMongooseDocumentArray)throw new q7t("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return e.discriminator(...t)};tn.prototype.clone=function(){let t=Object.assign({},this.options),e=new this.constructor(this.path,this.embeddedSchemaType,t,this.schemaOptions,this.parentSchema);return e.validators=this.validators.slice(),this.requiredValidator!==void 0&&(e.requiredValidator=this.requiredValidator),e};tn.prototype._castForQuery=function(t,e){let r=this.embeddedSchemaType,n=r?.schema?.options?.discriminatorKey,i=r?.discriminators;if(t&&i&&typeof n=="string")if(i[t[n]])r=i[t[n]];else{let a=tgn(i,t[n]);a&&(r=a)}return Array.isArray(t)?(this.setters.reverse().forEach(a=>{t=a.call(this,t,this)}),t=t.map(function(a){return Zb.isObject(a)&&a.$elemMatch?a:r.castForQuery(null,a,e)})):t=r.castForQuery(null,t,e),t};tn.prototype.castForQuery=function(t,e,r){let n;if(t!=null){if(n=this.$conditionalHandlers[t],!n)throw new Error("Can't use "+t+" with Array.");return n.call(this,e,r)}else return this._castForQuery(e,r)};tn.prototype.virtual=function(e,r){if(e instanceof R7t||Zbn(e)==="VirtualType")return this.virtual(e.path,e.options);if(r=new Kbn(r),Zb.hasUserDefinedProperty(r,["ref","refPath"]))throw new q7t("Cannot set populate virtual as a property of an array");let n=new R7t(r,e);return this.virtuals===null&&(this.virtuals={}),this.virtuals[e]=n,n};function ngn(t,e){return Array.isArray(t)||(t=[t]),t=t.map(r=>{if(!Zb.isObject(r))return r;if(r.$elemMatch!=null)return{$elemMatch:Rwe(this.embeddedSchemaType.schema,r.$elemMatch,null,this?.$$context)};let n={};return n[this.path]=r,Rwe(this.embeddedSchemaType.schema,n,null,this?.$$context)[this.path]},this),this.castForQuery(null,t,e)}function ign(t,e){let r=Object.keys(t),n=r.length;for(let i=0;i<n;++i){let a=r[i],s=t[a];Xbn(a)&&s!=null&&(t[a]=this.castForQuery(a,s,e))}return t}var Ii=tn.prototype.$conditionalHandlers={};Ii.$all=ngn;Ii.$options=String;Ii.$elemMatch=ign;Ii.$geoIntersects=qwe.cast$geoIntersects;Ii.$or=Nwe("$or");Ii.$and=Nwe("$and");Ii.$nor=Nwe("$nor");function Nwe(t){return function(r,n){if(!Array.isArray(r))throw new TypeError("conditional "+t+" requires an array");let i=[];for(let a of r)i.push(Rwe(this.embeddedSchemaType.schema??n.schema,a,null,this?.$$context));return i}}Ii.$near=Ii.$nearSphere=qwe.cast$near;Ii.$within=Ii.$geoWithin=qwe.cast$within;Ii.$size=Ii.$minDistance=Ii.$maxDistance=Qbn;Ii.$exists=zbn;Ii.$type=Wbn;Ii.$eq=Ii.$gt=Ii.$gte=Ii.$lt=Ii.$lte=Ii.$not=Ii.$regex=Ii.$ne=tn.prototype._castForQuery;Ii.$nin=gl.prototype.$conditionalHandlers.$nin;Ii.$in=gl.prototype.$conditionalHandlers.$in;tn.prototype.toJSONSchema=function(e){let r=this.getEmbeddedSchemaType(),n=this.options.required&&typeof this.options.required!="function";return{...egn("array","array",e?.useBsonType,n),items:r.toJSONSchema(e)}};tn.prototype.autoEncryptionType=function(){return"array"};N7t.exports=tn});var $7t=l((N9a,k7t)=>{"use strict";var{Long:agn}=sr(),Dwe=9223372036854775807n,kwe=-9223372036854775808n,D7t=`Mongoose only supports BigInts between ${kwe} and ${Dwe} because MongoDB does not support arbitrary precision integers`;k7t.exports=function(e){if(e==null)return e;if(e==="")return null;if(typeof e=="bigint"){if(e>Dwe||e<kwe)throw new Error(D7t);return e}if(e instanceof agn)return e.toBigInt();if(typeof e=="string"||typeof e=="number"){if(e=BigInt(e),e>Dwe||e<kwe)throw new Error(D7t);return e}throw new Error(`Cannot convert value to BigInt: "${e}"`)}});var L7t=l((D9a,F7t)=>{"use strict";var B7t=Iu(),q9=ka(),sgn=$7t(),ogn=Mu();function Ba(t,e,r,n){q9.call(this,t,e,"BigInt",n)}Ba.schemaName="BigInt";Ba.defaultOptions={};Ba.prototype=Object.create(q9.prototype);Ba.prototype.constructor=Ba;Ba._cast=sgn;Ba.set=q9.set;Ba.setters=[];Ba.get=q9.get;Ba.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Ba._checkRequired=t=>t!=null;Ba.checkRequired=q9.checkRequired;Ba.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};Ba.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=Ba.cast();try{return e(t)}catch(r){throw new B7t("BigInt",t,this.path,r,this)}};var ugn={...q9.prototype.$conditionalHandlers,$gt:fW,$gte:fW,$lt:fW,$lte:fW};Object.defineProperty(Ba.prototype,"$conditionalHandlers",{enumerable:!1,value:ugn});function fW(t,e){return this.castForQuery(null,t,e)}Ba.prototype.castForQuery=function(t,e,r){let n;if(t!=null)return n=this.$conditionalHandlers[t],n?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(i){throw i instanceof B7t&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};Ba.prototype._castNullish=function(e){return typeof e>"u"||(typeof this.constructor.cast=="function"?this.constructor.cast():Ba.cast())==null,e};Ba.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return ogn("string","long",e?.useBsonType,r)};Ba.prototype.autoEncryptionType=function(){return"long"};F7t.exports=Ba});var V7t=l((k9a,U7t)=>{"use strict";var j7t=Iu(),N9=ka(),_R=dz(),fgn=Mu();function zi(t,e,r,n){N9.call(this,t,e,"Boolean",n)}zi.schemaName="Boolean";zi.defaultOptions={};zi.prototype=Object.create(N9.prototype);zi.prototype.constructor=zi;zi._cast=_R;zi.set=N9.set;zi.setters=[];zi.get=N9.get;zi.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};zi._defaultCaster=t=>{if(t!=null&&typeof t!="boolean")throw new Error;return t};zi._checkRequired=t=>t===!0||t===!1;zi.checkRequired=N9.checkRequired;zi.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};Object.defineProperty(zi,"convertToTrue",{get:()=>_R.convertToTrue,set:t=>{_R.convertToTrue=t}});Object.defineProperty(zi,"convertToFalse",{get:()=>_R.convertToFalse,set:t=>{_R.convertToFalse=t}});zi.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=zi.cast();try{return e(t)}catch(r){throw new j7t("Boolean",t,this.path,r,this)}};var lgn={...N9.prototype.$conditionalHandlers};Object.defineProperty(zi.prototype,"$conditionalHandlers",{enumerable:!1,value:lgn});zi.prototype.castForQuery=function(t,e,r){let n;if(t!=null)return n=this.$conditionalHandlers[t],n?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(i){throw i instanceof j7t&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};zi.prototype._castNullish=function(e){if(typeof e>"u")return e;let r=typeof this.constructor.cast=="function"?this.constructor.cast():zi.cast();return r==null?e:r.convertToFalse instanceof Set&&r.convertToFalse.has(e)?!1:r.convertToTrue instanceof Set&&r.convertToTrue.has(e)?!0:e};zi.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return fgn("boolean","bool",e?.useBsonType,r)};zi.prototype.autoEncryptionType=function(){return"bool"};U7t.exports=zi});var z7t=l(($9a,H7t)=>{"use strict";var cgn=ff(),lW=class extends cgn{},dgn=yl();Object.defineProperty(lW.prototype,"subtype",dgn);H7t.exports=lW});var K7t=l((B9a,G7t)=>{"use strict";var D9=mz(),pgn=z7t(),Py=ka(),hgn=Mu(),cW=yR(),W7t=zt(),$we=D9.Binary,pW=Py.CastError;function Qs(t,e,r,n){Py.call(this,t,e,"Buffer",n)}Qs.schemaName="Buffer";Qs.defaultOptions={};Qs.prototype=Object.create(Py.prototype);Qs.prototype.constructor=Qs;Qs.prototype.OptionsConstructor=pgn;Qs._checkRequired=t=>!!t?.length;Qs.set=Py.set;Qs.setters=[];Qs.get=Py.get;Qs.checkRequired=Py.checkRequired;Qs.prototype.checkRequired=function(t,e){return Py._isRef(this,t,e,!0)?!!t:this.constructor._checkRequired(t)};Qs.prototype.cast=function(t,e,r,n,i){let a;if(Py._isRef(this,t,e,r)){if(t?.isMongooseBuffer)return t;if(Buffer.isBuffer(t))return t?.isMongooseBuffer||(t=new D9(t,[this.path,e]),this.options.subtype!=null&&(t._subtype=this.options.subtype)),t;if(t instanceof $we){if(a=new D9(t.value(!0),[this.path,e]),typeof t.sub_type!="number")throw new pW("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(t==null||W7t.isNonBuiltinObject(t))return this._castRef(t,e,r,i)}if(t?._id&&(t=t._id),t?.isMongooseBuffer)return t;if(Buffer.isBuffer(t))return t?.isMongooseBuffer||(t=new D9(t,[this.path,e]),this.options.subtype!=null&&(t._subtype=this.options.subtype)),t;if(t instanceof $we){if(a=new D9(t.value(!0),[this.path,e]),typeof t.sub_type!="number")throw new pW("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(t===null)return t;let s=typeof t;if(s==="string"||s==="number"||Array.isArray(t)||s==="object"&&t.type==="Buffer"&&Array.isArray(t.data))return s==="number"&&(t=[t]),a=new D9(t,[this.path,e]),this.options.subtype!=null&&(a._subtype=this.options.subtype),a;if(W7t.isPOJO(t)&&(t.$binary instanceof $we||typeof t.$binary=="string")){let o=this.cast(Buffer.from(t.$binary,"base64"));if(t.$type!=null)return o._subtype=t.$type,o}throw new pW("Buffer",t,this.path,null,this)};Qs.prototype.subtype=function(t){return this.options.subtype=t,this};function dW(t,e){return this.castForQuery(null,t,e)}var mgn={...Py.prototype.$conditionalHandlers,$bitsAllClear:cW,$bitsAnyClear:cW,$bitsAllSet:cW,$bitsAnySet:cW,$gt:dW,$gte:dW,$lt:dW,$lte:dW};Object.defineProperty(Qs.prototype,"$conditionalHandlers",{enumerable:!1,value:mgn});Qs.prototype.castForQuery=function(t,e,r){let n;if(t!=null){if(n=this.$conditionalHandlers[t],!n)throw new Error("Can't use "+t+" with Buffer.");return n.call(this,e)}let i;try{i=this.applySetters(e,r)}catch(a){throw a instanceof pW&&a.path===this.path&&this.$fullPath!=null&&(a.path=this.$fullPath),a}return i&&i.toObject({transform:!1,virtuals:!1})};Qs.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return hgn("string","binData",e?.useBsonType,r)};Qs.prototype.autoEncryptionType=function(){return"binData"};G7t.exports=Qs});var J7t=l((F9a,Y7t)=>{"use strict";var ygn=ff(),k9=class extends ygn{},Bwe=yl();Object.defineProperty(k9.prototype,"min",Bwe);Object.defineProperty(k9.prototype,"max",Bwe);Object.defineProperty(k9.prototype,"expires",Bwe);Y7t.exports=k9});var X7t=l((L9a,Z7t)=>{"use strict";var Fwe=fe("assert");Z7t.exports=function(e){if(e==null||e==="")return null;if(e instanceof Date)return Fwe.ok(!isNaN(e.valueOf())),e;let r;if(Fwe.ok(typeof e!="boolean"),e instanceof Number||typeof e=="number"?r=new Date(e):typeof e=="string"&&!isNaN(Number(e))&&(Number(e)>=275761||Number(e)<-271820)?r=new Date(Number(e)):typeof e.valueOf=="function"?r=new Date(e.valueOf()):r=new Date(e),!isNaN(r.valueOf()))return r;Fwe.ok(!1)}});var r9t=l((j9a,t9t)=>{"use strict";var Q7t=ml(),bgn=J7t(),Xb=ka(),ggn=X7t(),vgn=Mu(),_gn=v0(),Egn=zt(),e9t=Xb.CastError;function Mi(t,e,r,n){Xb.call(this,t,e,"Date",n)}Mi.schemaName="Date";Mi.defaultOptions={};Mi.prototype=Object.create(Xb.prototype);Mi.prototype.constructor=Mi;Mi.prototype.OptionsConstructor=bgn;Mi._cast=ggn;Mi.set=Xb.set;Mi.setters=[];Mi.get=Xb.get;Mi.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Mi._defaultCaster=t=>{if(t!=null&&!(t instanceof Date))throw new Error;return t};Mi.prototype.expires=function(t){return _gn(this._index)!=="Object"&&(this._index={}),this._index.expires=t,Egn.expires(this._index),this};Mi._checkRequired=t=>t instanceof Date;Mi.checkRequired=Xb.checkRequired;Mi.prototype.checkRequired=function(t,e){return typeof t=="object"&&Xb._isRef(this,t,e,!0)?t!=null:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():Mi.checkRequired())(t)};Mi.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(r){return r.validator!==this.minValidator},this)),t){let r=e||Q7t.messages.Date.min;typeof r=="string"&&(r=r.replace(/{MIN}/,t===Date.now?"Date.now()":t.toString()));let n=this;this.validators.push({validator:this.minValidator=function(i){let a=t;typeof t=="function"&&t!==Date.now&&(a=a.call(this));let s=a===Date.now?a():n.cast(a);return i===null||i.valueOf()>=s.valueOf()},message:r,type:"min",min:t})}return this};Mi.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter(function(r){return r.validator!==this.maxValidator},this)),t){let r=e||Q7t.messages.Date.max;typeof r=="string"&&(r=r.replace(/{MAX}/,t===Date.now?"Date.now()":t.toString()));let n=this;this.validators.push({validator:this.maxValidator=function(i){let a=t;typeof a=="function"&&a!==Date.now&&(a=a.call(this));let s=a===Date.now?a():n.cast(a);return i===null||i.valueOf()<=s.valueOf()},message:r,type:"max",max:t})}return this};Mi.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=Mi.cast();try{return e(t)}catch(r){throw new e9t("date",t,this.path,r,this)}};function hW(t){return this.cast(t)}var Sgn={...Xb.prototype.$conditionalHandlers,$gt:hW,$gte:hW,$lt:hW,$lte:hW};Object.defineProperty(Mi.prototype,"$conditionalHandlers",{enumerable:!1,value:Sgn});Mi.prototype.castForQuery=function(t,e,r){if(t==null)try{return this.applySetters(e,r)}catch(i){throw i instanceof e9t&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}let n=this.$conditionalHandlers[t];if(!n)throw new Error("Can't use "+t+" with Date.");return n.call(this,e)};Mi.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return vgn("string","date",e?.useBsonType,r)};Mi.prototype.autoEncryptionType=function(){return"date"};t9t.exports=Mi});var i9t=l((U9a,n9t)=>{"use strict";var Sv=JH(),wgn=fe("assert");n9t.exports=function(e){if(e==null)return e;if(typeof e=="object"&&typeof e.$numberDecimal=="string")return Sv.fromString(e.$numberDecimal);if(e instanceof Sv)return e;if(typeof e=="string")return Sv.fromString(e);if(typeof Buffer=="function"&&Buffer.isBuffer(e))return new Sv(e);if(typeof Uint8Array=="function"&&e instanceof Uint8Array)return new Sv(e);if(typeof e=="number")return Sv.fromString(String(e));if(typeof e.valueOf=="function"&&typeof e.valueOf()=="string")return Sv.fromString(e.valueOf());wgn.ok(!1)}});var s9t=l((V9a,a9t)=>{"use strict";var Ry=ka(),Agn=Ry.CastError,xgn=i9t(),Tgn=Mu(),Lwe=Jo();function ns(t,e,r,n){Ry.call(this,t,e,"Decimal128",n)}ns.schemaName="Decimal128";ns.defaultOptions={};ns.prototype=Object.create(Ry.prototype);ns.prototype.constructor=ns;ns._cast=xgn;ns.set=Ry.set;ns.setters=[];ns.get=Ry.get;ns.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};ns._defaultCaster=t=>{if(t!=null&&!Lwe(t,"Decimal128"))throw new Error;return t};ns._checkRequired=t=>Lwe(t,"Decimal128");ns.checkRequired=Ry.checkRequired;ns.prototype.checkRequired=function(e,r){return Ry._isRef(this,e,r,!0)?!!e:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():ns.checkRequired())(e)};ns.prototype.cast=function(t,e,r,n,i){if(Ry._isRef(this,t,e,r))return Lwe(t,"Decimal128")?t:this._castRef(t,e,r,i);let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=ns.cast();try{return a(t)}catch(s){throw new Agn("Decimal128",t,this.path,s,this)}};function mW(t){return this.cast(t)}var Ogn={...Ry.prototype.$conditionalHandlers,$gt:mW,$gte:mW,$lt:mW,$lte:mW};Object.defineProperty(ns.prototype,"$conditionalHandlers",{enumerable:!1,value:Ogn});ns.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return Tgn("string","decimal",e?.useBsonType,r)};ns.prototype.autoEncryptionType=function(){return"decimal"};a9t.exports=ns});var f9t=l((H9a,u9t)=>{"use strict";var Cgn=ff(),ER=class extends Cgn{},o9t=yl();Object.defineProperty(ER.prototype,"_id",o9t);Object.defineProperty(ER.prototype,"minimize",o9t);u9t.exports=ER});var c9t=l((z9a,l9t)=>{"use strict";l9t.exports=function(e){e.s.hooks.pre("save",!1,async function(){if(this.$isSubdocument)return;let i=this.$getAllSubdocs({useCache:!0});if(!i.length)return;let a=this.$__.saveOptions;await Promise.all(i.map(s=>s._execDocumentPreHooks("save",a))),this.$__.saveOptions&&(this.$__.saveOptions.__subdocs=null)},null,!0),e.s.hooks.pre("save",async function(){let i=this.$__.removedSubdocs;if(!i?.length)return;let a=[];for(let s of i)a.push(s._execDocumentPreHooks("deleteOne"));await Promise.all(a)}),e.s.hooks.post("save",async function(){let i=this.$__.removedSubdocs;if(!i?.length)return;let a=[];for(let s of i)a.push(s._execDocumentPostHooks("deleteOne"));this.$__.removedSubdocs=null,await Promise.all(a)}),e.s.hooks.post("save",async function(){if(this.$isSubdocument)return;let i=this.$getAllSubdocs({useCache:!0});if(!i.length)return;let a=[];for(let s of i)a.push(s._execDocumentPostHooks("save"));await Promise.all(a)},null,!0)}});var p9t=l((W9a,Vwe)=>{"use strict";var Ign=Mt().objectIdSymbol,d9t=zt();Vwe.exports=function(e){e.post("init",function(){return Uwe.call(this),this}),e.pre("save",function(){jwe.call(this)}),e.pre("deleteOne",{document:!0,query:!1},function(){jwe.call(this)}),e.pre("updateOne",{document:!0,query:!1},function(){jwe.call(this)}),e.post("save",function(){Uwe.call(this)})};function jwe(){let t,e;if(this.$__.shardval){t=Object.keys(this.$__.shardval),e=t.length,this.$where=this.$where||{};for(let r=0;r<e;++r)this.$where[t[r]]=this.$__.shardval[t[r]]}}Vwe.exports.storeShard=Uwe;function Uwe(){let t=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(!d9t.isPOJO(t))return;let e=this.$__.shardval={},r=Object.keys(t),n=r.length,i;for(let a=0;a<n;++a)i=this.$__getValue(r[a]),i==null?e[r[a]]=i:d9t.isMongooseObject(i)?e[r[a]]=i.toObject({depopulate:!0,_isNested:!0}):i instanceof Date||i[Ign]?e[r[a]]=i:typeof i.valueOf=="function"?e[r[a]]=i.valueOf():e[r[a]]=i}});var y9t=l((G9a,m9t)=>{"use strict";var $9=Mt().arrayAtomicsSymbol,Hwe=Mt().sessionNewDocuments,zwe=zt();m9t.exports=function(e){e.pre("save",function(){let n=this.$session();if(n!=null&&!(n.transaction==null||n[Hwe]==null)&&!n[Hwe].has(this)){let i={};this.isNew&&(i.isNew=!0),this.$__schema.options.versionKey&&(i.versionKey=this.get(this.$__schema.options.versionKey)),i.modifiedPaths=new Set(Object.keys(this.$__.activePaths.getStatePaths("modify"))),i.atomics=Mgn(this),n[Hwe].set(this,i)}})};function Mgn(t,e){let r=new Map;e=e||new Map;let n=Object.keys(t.$__.activePaths.init).concat(Object.keys(t.$__.activePaths.modify));for(let a of n){let s=t.$__getValue(a);if(Array.isArray(s)&&zwe.isMongooseDocumentArray(s)&&s.length&&s[$9]!=null&&zwe.hasOwnKeys(s[$9])){let o=e.get(a)||{};r.set(a,h9t(o,s[$9]))}}let i=t.$__dirty();for(let a of i){let s=a.path,o=a.value;if(o?.[$9]!=null&&zwe.hasOwnKeys(o[$9])){let u=e.get(s)||{};r.set(s,h9t(u,o[$9]))}}return r}function h9t(t,e){return t=t||{},e.$pullAll!=null&&(t.$pullAll=(t.$pullAll||[]).concat(e.$pullAll)),e.$push!=null&&(t.$push=t.$push||{},t.$push.$each=(t.$push.$each||[]).concat(e.$push.$each)),e.$addToSet!=null&&(t.$addToSet=(t.$addToSet||[]).concat(e.$addToSet)),e.$set!=null&&(t.$set=Array.isArray(e.$set)?[...e.$set]:Object.assign({},e.$set)),t}});var g9t=l((K9a,b9t)=>{"use strict";b9t.exports=function(e){e.pre("save",!1,async function(i){if(this.$isSubdocument)return;let a=i&&typeof i=="object"&&"validateBeforeSave"in i,s;if(a?s=!!i.validateBeforeSave:s=this.$__schema.options.validateBeforeSave,s){let u=i&&typeof i=="object"&&"validateModifiedOnly"in i?{validateModifiedOnly:i.validateModifiedOnly}:null;await this.$validate(u).then(()=>{this.$op="save"})}},null,!0)}});var Wwe=l(SR=>{"use strict";SR.saveSubdocs=c9t();SR.sharding=p9t();SR.trackTransaction=y9t();SR.validateBeforeSave=g9t()});var E9t=l((J9a,_9t)=>{"use strict";var v9t=Wwe();_9t.exports=function(e){for(let r of Object.values(v9t))r(e,{deduplicate:!0});e.plugins=Object.values(v9t).map(r=>({fn:r,opts:{deduplicate:!0}})).concat(e.plugins)}});var A9t=l((Z9a,w9t)=>{"use strict";var Pgn=hz(),Rgn=av(),qgn=Jo(),Ngn=Wb(),Dgn=ka(),S9t=sv();w9t.exports=function t(e,r,n,i){let a=Object.keys(r),s=0,o=a.length,u;if(n=n||"",i=i||new WeakSet,!i.has(r)){for(i.add(r);s<o;)if(u=a[s++],!(!n&&(u==="discriminators"||u==="base"||u==="_applyDiscriminators"||u==="_userProvidedOptions"||u==="options"||u==="tree"))&&!(n==="tree"&&r?.instanceOfSchema)&&!Rgn.has(u)&&u!=="parentSchema"){if(e[u]==null)e[u]=r[u];else if(S9t(r[u])){if(S9t(e[u])||(e[u]={}),r[u]!=null){if(r[u].$isSingleNested&&e[u].$isMongooseDocumentArray||r[u].$isMongooseDocumentArray&&e[u].$isSingleNested||r[u].$isMongooseDocumentArrayElement&&e[u].$isMongooseDocumentArrayElement)continue;if(r[u].instanceOfSchema){e[u].instanceOfSchema?Pgn(e[u],r[u].clone(),!0):e[u]=r[u].clone();continue}else if(qgn(r[u],"ObjectId")){e[u]=new Ngn(r[u]);continue}else if(r[u]instanceof Dgn&&(e[u]==null&&(e[u]=r[u].clone()),!r[u].$isMongooseDocumentArray&&!r[u].$isSingleNested))continue}t(e[u],r[u],n?n+"."+u:u,i)}}r?.instanceOfSchema&&(e.tree=Object.assign({},r.tree,e.tree))}}});var yW=l((X9a,O9t)=>{"use strict";var x9t=cv(),kgn=E9t(),$gn=_a(),Bgn=xz().defineKey,Fgn=$a(),Gwe=zt(),Lgn=A9t(),T9t={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0,statics:!0};function jgn(t,e){if(t.encryptionType()==null&&e.encryptionType()==null)return;let r=i(n(t),n(e));for(let a of r){if(t._hasEncryptedField(a)&&e._hasEncryptedField(a))throw new Error(`encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=${a}`);if(t._hasEncryptedField(a)||e._hasEncryptedField(a))throw new Error(`encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=${a}`)}function n(a){return[...Object.keys(a.paths),...Object.keys(a.singleNestedPaths)]}function*i(a,s){let o=new Set(a);for(let u of s)o.has(u)&&(yield u)}}O9t.exports=function(e,r,n,i,a,s,o){if(!n?.instanceOfSchema)throw new Error("You must pass a valid discriminator Schema");if(s=s??!0,e.schema.discriminatorMapping&&!e.schema.discriminatorMapping.isRoot)throw new Error('Discriminator "'+r+'" can only be a discriminator of the root model');if(a){let h=Fgn(e.base,"options.applyPluginsToDiscriminators",!1)||!s;e.base._applyPlugins(n,{skipTopLevel:!h})}else s||kgn(n);let u=e.schema.options.discriminatorKey,f=e.schema.path(u);if(f!=null)Gwe.hasUserDefinedProperty(f.options,"select")||(f.options.select=!0),f.options.$skipDiscriminatorCheck=!0;else{let h={};h[u]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},h[u][e.schema.options.typeKey]=String,e.schema.add(h),Bgn({prop:u,prototype:e.prototype,options:e.schema.options})}if(n.path(u)&&n.path(u).options.$skipDiscriminatorCheck!==!0)throw new Error('Discriminator "'+r+'" cannot have field with name "'+u+'"');let c=r;(typeof i=="string"&&i.length||i!=null)&&(c=i),jgn(e.schema,n);function d(h,p){h._baseSchema=p,p.paths._id&&p.paths._id.options&&!p.paths._id.options.auto&&h.remove("_id");let m=Object.keys(p.paths),y=[];for(let P of m){if(h.nested[P]){y.push(P);continue}if(P.indexOf(".")===-1)continue;let k=P.split(".").slice(0,-1),R="";for(let U of k)R+=(R.length?".":"")+U,(h.paths[R]instanceof x9t||h.singleNestedPaths[R]instanceof x9t)&&y.push(P)}h.obj={...h.obj},Lgn(h,p),h._gatherChildSchemas();for(let P of y)delete h.paths[P];h.childSchemas.forEach(P=>{P.model.prototype.$__setSchema(P.schema)});let b={};b[u]={default:c,select:!0,set:function(P){if(P===c||Array.isArray(c)&&Gwe.deepEqual(P,c))return c;throw new Error(`Can't set discriminator key "`+u+'"')},$skipDiscriminatorCheck:!0},b[u][h.options.typeKey]=f?f.options[h.options.typeKey]:String,h.add(b),h.discriminatorMapping={key:u,value:c,isRoot:!1},p.options.collection&&(h.options.collection=p.options.collection);let v=h.options.toJSON,E=h.options.toObject,x=h.options._id,w=h.options.id,M=Object.keys(h.options);h.options.discriminatorKey=p.options.discriminatorKey;let N=h._userProvidedOptions;for(let P of M)if(!T9t[P]&&P in N&&!Gwe.deepEqual(h.options[P],p.options[P]))throw new Error("Can't customize discriminator option "+P+" (can only modify "+Object.keys(T9t).join(", ")+")");h.options=$gn(p.options);for(let P of Object.keys(N))h.options[P]=N[P];v&&(h.options.toJSON=v),E&&(h.options.toObject=E),typeof x<"u"&&(h.options._id=x),h.options.id=w,s&&(h.s.hooks=e.schema.s.hooks.merge(h.s.hooks)),a&&(h.plugins=Array.prototype.slice.call(p.plugins)),h.callQueue=p.callQueue.concat(h.callQueue),delete h._requiredpaths}if(d(n,e.schema),e.discriminators||(e.discriminators={}),e.schema.discriminatorMapping||(e.schema.discriminatorMapping={key:u,value:null,isRoot:!0}),e.schema.discriminators||(e.schema.discriminators={}),e.schema.discriminators[r]=n,e.discriminators[r]&&!n.options.overwriteModels&&!o)throw new Error('Discriminator with name "'+r+'" already exists');return n}});var bW=l((Q9a,C9t)=>{"use strict";var Ugn=gc();C9t.exports=function(e,r,n){let i=e.schema.options.discriminatorKey,a=r?.[i];if(a==null&&(a=n),e.discriminators&&a!=null)if(e.discriminators[a])e=e.discriminators[a];else{let s=Ugn(e.discriminators,a);s&&(e=s)}return e}});var Kwe=l((eEa,I9t)=>{"use strict";var Vgn=owe();I9t.exports=function(e,r){return r?._id==null||(e=e.clone(),r._id?e.paths._id||(Vgn(e),e.options._id=!0):(e.remove("_id"),e.options._id=!1)),e}});var Ywe=l((tEa,M9t)=>{"use strict";var Hgn=Ir(),gW=class extends Hgn{constructor(e,r){let n=`Cannot create use schema for property "${e}" because the schema has the ${r} option enabled.`;super(n)}};Object.defineProperty(gW.prototype,"name",{value:"InvalidSchemaOptionError"});M9t.exports=gW});var Qwe=l((rEa,D9t)=>{"use strict";var P9t=Iu(),Jwe=fe("events").EventEmitter,zgn=gz(),Wgn=f9t(),wv=ka(),Ggn=Sz(),Kgn=pz(),R9t=bR().castToNumber,Ygn=Mu(),Jgn=yW(),Zwe=Mwe(),Xwe=bW(),Zgn=Kwe(),Xgn=i1().internalToObjectOptions,Qgn=w9(),q9t=zt(),e5n=Ywe(),vW;D9t.exports=eo;function eo(t,e,r,n){if(t.options.timeseries)throw new e5n(e,"timeseries");let i=eo.defaultOptions?._id;i!=null&&(r=r||{},r._id=i),t=Zgn(t,r),this.Constructor=N9t(t,null,r),this.Constructor.path=e,this.Constructor.prototype.$basePath=e,this.schema=t,this.$isSingleNested=!0,this.base=t.base,wv.call(this,e,r,"Embedded",n)}eo.prototype=Object.create(wv.prototype);eo.prototype.constructor=eo;eo.prototype.OptionsConstructor=Wgn;function N9t(t,e,r){vW||(vW=Mz());let n=function(s,o,u){this.$__parent=u,vW.apply(this,arguments),u!=null&&this.$session(u.$session())};t._preCompile();let i=e?.prototype??vW.prototype;n.prototype=Object.create(i),n.prototype.$__setSchema(t),n.prototype.constructor=n,n.prototype.$__schemaTypeOptions=r,n.$__required=r?.required,n.base=t.base,n.schema=t,n.$isSingleNested=!0,n.events=new Jwe,n.prototype.toBSON=function(){return this.toObject(Xgn)};for(let a in t.methods)n.prototype[a]=t.methods[a];for(let a in t.statics)n[a]=t.statics[a];for(let a in Jwe.prototype)n[a]=Jwe.prototype[a];return n}var $h={...wv.prototype.$conditionalHandlers};$h.$geoWithin=function(e,r){return{$geometry:this.castForQuery(null,e.$geometry,r)}};$h.$near=$h.$nearSphere=Zwe.cast$near;$h.$within=$h.$geoWithin=Zwe.cast$within;$h.$geoIntersects=Zwe.cast$geoIntersects;$h.$minDistance=R9t;$h.$maxDistance=R9t;$h.$exists=Kgn;Object.defineProperty(eo.prototype,"$conditionalHandlers",{enumerable:!1,value:$h});eo.prototype.cast=function(t,e,r,n,i){if(t?.$isSingleNested&&t.parent===e)return t;if(!r&&t!=null&&(typeof t!="object"||Array.isArray(t)))throw new zgn(this.path,t);let a=this.schema.path(this.schema.options.discriminatorKey),s=a==null?null:a.getDefault(e),o=Xwe(this.Constructor,t,s),u,f=e?.$__?.selected,c=this.path,d=f==null?null:Object.keys(f).reduce((h,p)=>(p.startsWith(c+".")&&(h=h||{},h[p.substring(c.length+1)]=f[p]),h),null);if(r){u=new o(void 0,d,e,{defaults:!1}),delete u.$__.defaults,i.path!=null&&(i={...i},delete i.path),u.$init(t,i);let h=Qgn(d);Ggn(u,d,h)}else return i=Object.assign({},i,{priorDoc:n}),q9t.hasOwnKeys(t)===!1?new o({},d,e,i):new o(t,d,e,i);return u};eo.prototype.castForQuery=function(t,e,r,n){let i;if(t!=null){if(i=this.$conditionalHandlers[t],!i)throw new Error("Can't use "+t);return i.call(this,e)}if(e==null)return e;let a=Xwe(this.Constructor,e);if(e instanceof a)return e;this.options.runSetters&&(e=this._applySetters(e,r));let s=n?.strict??void 0;try{e=new a(e,s)}catch(o){throw o instanceof P9t?o:new P9t("Embedded",e,this.path,o,this)}return e};eo.prototype.doValidate=async function(e,r,n){let i=Xwe(this.Constructor,e);if(e&&!(e instanceof i)&&(e=new i(e,null,r?.$__!=null?r:null)),n?.skipSchemaValidators)return e?e.validate():void 0;await wv.prototype.doValidate.call(this,e,r,n),e!=null&&await e.validate()};eo.prototype.doValidateSync=function(t,e,r){if(!r?.skipSchemaValidators){let n=wv.prototype.doValidateSync.call(this,t,e);if(n)return n}if(t)return t.validateSync()};eo.prototype.discriminator=function(t,e,r){r=r||{};let n=q9t.isPOJO(r)?r.value:r,i=typeof r.clone=="boolean"?r.clone:!0;return e.instanceOfSchema&&i&&(e=e.clone()),e=Jgn(this.Constructor,t,e,n,null,null,r.overwriteExisting),this.Constructor.discriminators[t]=N9t(e,this.Constructor),this.Constructor.discriminators[t]};eo.defaultOptions={};eo.set=wv.set;eo.setters=[];eo.get=wv.get;eo.prototype.toJSON=function(){return{path:this.path,options:this.options}};eo.prototype.clone=function(){let t=new this.constructor(this.schema,this.path,{...this.options,_skipApplyDiscriminators:!0},this.parentSchema);return t.validators=this.validators.slice(),this.requiredValidator!==void 0&&(t.requiredValidator=this.requiredValidator),t.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),t._appliedDiscriminators=this._appliedDiscriminators,t};eo.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return{...this.schema.toJSONSchema(e),...Ygn("object","object",e?.useBsonType,r)}}});var eAe=l((nEa,k9t)=>{"use strict";var t5n=Ir(),wR=ka(),r5n=Qwe(),n5n=bW();function l1(t,e,r,n){if(this.$parentSchemaType=r?.$parentSchemaType,!this.$parentSchemaType)throw new t5n("Cannot create DocumentArrayElement schematype without a parent");delete r.$parentSchemaType,wR.call(this,t,r,"DocumentArrayElement",n),this.$isMongooseDocumentArrayElement=!0,this.Constructor=r?.Constructor,this.schema=e}l1.schemaName="DocumentArrayElement";l1.defaultOptions={};l1.set=wR.set;l1.get=wR.get;l1.prototype=Object.create(wR.prototype);l1.prototype.constructor=l1;l1.prototype.cast=function(...t){return this.$parentSchemaType.cast(...t)[0]};l1.prototype.doValidate=async function(e,r,n){let i=n5n(this.Constructor,e);return e&&!(e instanceof i)&&(e=new i(e,r,null,null,n?.index??null)),r5n.prototype.doValidate.call(this,e,r,n)};l1.prototype.clone=function(){this.options.$parentSchemaType=this.$parentSchemaType;let t=wR.prototype.clone.apply(this,arguments);return delete this.options.$parentSchemaType,t.Constructor=this.Constructor,t.schema=this.schema,t};k9t.exports=l1});var F9t=l((iEa,B9t)=>{"use strict";var i5n=ff(),AR=class extends i5n{},$9t=yl();Object.defineProperty(AR.prototype,"excludeIndexes",$9t);Object.defineProperty(AR.prototype,"_id",$9t);B9t.exports=AR});var K9t=l((aEa,G9t)=>{"use strict";var L9t=Iu(),a5n=eAe(),tAe=fe("events").EventEmitter,nAe=aW(),s5n=F9t(),xR=ka(),j9t=_v(),U9t=Mu(),o5n=yW(),V9t=Kwe(),u5n=Cz(),f5n=hR(),B9=zt(),_W=bW(),l5n=Ywe(),H9t=Mt().arrayAtomicsSymbol,rAe=Mt().arrayPathSymbol,c5n=Mt().documentArrayParent,qy,Av;function Ea(t,e,r,n,i){if(e.options?.timeseries)throw new l5n(t,"timeseries");let a=Ea.defaultOptions?._id;a!=null&&(n=n||{},n._id=a),n?._id!=null?e=V9t(e,n):r?._id!=null&&(e=V9t(e,r));let s=W9t(e,r);s.prototype.$basePath=t,s.path=t;let o=this,u=new a5n(t+".$",e,{...n||{},$parentSchemaType:o,Constructor:s});nAe.call(this,t,u,r,null,i),this.schema=e,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=s,s.base=e.base;let f=this.defaultValue;(!("defaultValue"in this)||f!=null)&&this.default(function(){let c=f.call(this);return c!=null&&!Array.isArray(c)&&(c=[c]),c})}Ea.schemaName="DocumentArray";Ea.options={castNonArrays:!0};Ea.prototype=Object.create(nAe.prototype);Ea.prototype.constructor=Ea;Ea.prototype.OptionsConstructor=s5n;Object.defineProperty(Ea.prototype,"$conditionalHandlers",{enumerable:!1,value:{...nAe.prototype.$conditionalHandlers}});function W9t(t,e,r){Av||(Av=x9());function n(){Av.apply(this,arguments),!(this.__parentArray==null||this.__parentArray.getArrayParent()==null)&&this.$session(this.__parentArray.getArrayParent().$session())}t._preCompile();let i=r?.prototype??Av.prototype;n.prototype=Object.create(i),n.prototype.$__setSchema(t),n.schema=t,n.prototype.constructor=n,n.$isArraySubdocument=!0,n.events=new tAe,n.base=t.base;for(let a in t.methods)n.prototype[a]=t.methods[a];for(let a in t.statics)n[a]=t.statics[a];for(let a in tAe.prototype)n[a]=tAe.prototype[a];return n.options=e,n}Ea.prototype.discriminator=function(t,e,r){typeof t=="function"&&(t=B9.getFunctionName(t)),r=r||{};let n=B9.isPOJO(r)?r.value:r,i=typeof r.clone=="boolean"?r.clone:!0;e.instanceOfSchema&&i&&(e=e.clone()),e=o5n(this.Constructor,t,e,n,null,null,r?.overwriteExisting);let a=W9t(e,null,this.Constructor);return a.baseCasterConstructor=this.Constructor,Object.defineProperty(a,"name",{value:t}),this.Constructor.discriminators[t]=a,this.Constructor.discriminators[t]};Ea.prototype.doValidate=async function(e,r,n){if(qy||(qy=mv()),await xR.prototype.doValidate.call(this,e,r),n?.updateValidator)return;B9.isMongooseDocumentArray(e)||(e=new qy(e,this.path,r));let i=[];for(let a=0;a<e.length;++a){let s=e[a];if(s!=null){if(!(s instanceof Av)){let o=_W(this.Constructor,e[a]);s=e[a]=new o(s,e,void 0,void 0,a)}n?.validateModifiedOnly&&!s.$isModified()||i.push(s.$__validate(null,n))}}await Promise.all(i)};Ea.prototype.doValidateSync=function(t,e,r){let n=xR.prototype.doValidateSync.call(this,t,e);if(n!=null)return n;let i=t?.length,a=null;if(i){for(let s=0,o=i;s<o;++s){let u=t[s];if(!u)continue;if(!(u instanceof Av)){let c=_W(this.Constructor,t[s]);u=t[s]=new c(u,t,void 0,void 0,s)}if(r?.validateModifiedOnly&&!u.$isModified())continue;let f=u.validateSync(r);f&&a==null&&(a=f)}return a}};Ea.prototype.getDefault=function(t,e,r){let n=typeof this.defaultValue=="function"?this.defaultValue.call(t):this.defaultValue;if(n==null||r?.skipCast)return n;qy||(qy=mv()),Array.isArray(n)||(n=[n]),n=new qy(n,this.path,t);for(let i=0;i<n.length;++i){let a=_W(this.Constructor,n[i]),s=new a({},n,void 0,void 0,i);s.$init(n[i]),s.isNew=!0,Object.assign(s.$__.activePaths.default,s.$__.activePaths.init),s.$__.activePaths.init={},n[i]=s}return n};var d5n=Object.freeze({transform:!1,virtuals:!1}),z9t=Object.freeze({skipId:!1,willInit:!0});Ea.prototype.cast=function(t,e,r,n,i){if(qy||(qy=mv()),t?.[rAe]!=null&&t===n)return t;let a,s;i=i||{};let o=i.path||this.path;if(!Array.isArray(t)){if(!r&&!Ea.options.castNonArrays)throw new L9t("DocumentArray",t,this.path,null,this);return e&&r&&e.markModified(o),this.cast([t],e,r,n,i)}(!i.skipDocumentArrayCast||B9.isMongooseDocumentArray(t))&&(t=new qy(t,o,e,this)),n!=null&&(t[H9t]=n[H9t]||{}),i.arrayPathIndex!=null&&(t[rAe]=o+"."+i.arrayPathIndex);let u=B9.isMongooseDocumentArray(t)?t.__array:t,f=u.length;for(let c=0;c<f;++c){if(!u[c])continue;let d=_W(this.Constructor,u[c]),h=u5n(u[c],!0);if(u[c]!==h&&(u[c]=h),u[c]instanceof Av){if(u[c][c5n]!==e)if(r){let p=new d(null,t,z9t,a,c);u[c]=p.$init(u[c])}else{let p=new d(u[c],t,void 0,void 0,c);u[c]=p}u[c].__index==null&&u[c].$setIndex(c)}else if(u[c]!=null)if(r)e?a||(a=p5n(this,e.$__.selected,r)):a=!0,s=new d(null,t,z9t,a,c),u[c]=s.$init(u[c],i);else if(typeof n?.id=="function"&&(s=n.id(u[c]._id)),n&&s&&B9.deepEqual(s.toObject(d5n),u[c]))s.set(u[c]),u[c]=s;else try{s=new d(u[c],t,void 0,void 0,c),u[c]=s}catch(p){throw new L9t("embedded",u[c],t[rAe],p,this)}}return t};Ea.prototype.clone=function(){let t=Object.assign({},this.options),e=new this.constructor(this.path,this.schema,t,this.schemaOptions,this.parentSchema);return e.validators=this.validators.slice(),this.requiredValidator!==void 0&&(e.requiredValidator=this.requiredValidator),e.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),e._appliedDiscriminators=this._appliedDiscriminators,e};Ea.prototype.applyGetters=function(t,e){return xR.prototype.applyGetters.call(this,t,e)};function p5n(t,e,r){if(!(r&&e))return;let n=t.path+".",i=Object.keys(e),a=i.length,s={},o,u,f;for(;a--;)if(u=i[a],u.startsWith(n)){if(f=u.substring(n.length),f==="$")continue;f.startsWith("$.")&&(f=f.substring(2)),o||(o=!0),s[f]=e[u]}return o&&s||void 0}Ea.defaultOptions={};Ea.set=xR.set;Ea.setters=[];Ea.get=xR.get;Ea.prototype.$conditionalHandlers.$elemMatch=h5n;function h5n(t,e){let r=Object.keys(t),n=r.length;for(let o=0;o<n;++o){let u=r[o],f=t[u];f5n(u)&&f!=null&&(t[u]=this.castForQuery(u,f,e))}let i=this?.Constructor?.schema?.options?.discriminatorKey,a=this?.Constructor?.schema?.discriminators||{};if(i!=null&&t[i]!=null&&a[t[i]]!=null)return j9t(a[t[i]],t,null,this?.$$context);let s=this.Constructor.schema??e.schema;return j9t(s,t,null,this?.$$context)}Ea.prototype.toJSONSchema=function(e){let r=U9t("object","object",e?.useBsonType,!1),n=this.options.required&&typeof this.options.required!="function";return{...U9t("array","array",e?.useBsonType,n),items:{...r,...this.schema.toJSONSchema(e)}}};G9t.exports=Ea});var Z9t=l((sEa,J9t)=>{"use strict";var Y9t=fe("assert"),iAe=sr(),m5n=Jo();J9t.exports=function(e){if(e==null||e==="")return null;let r;if(m5n(e,"Long"))r=e.toNumber();else if(typeof e=="string")try{return r=iAe.Double.fromString(e),r}catch{Y9t.ok(!1)}else if(typeof e=="object"){let n=e.valueOf()??e.toString();if(typeof n=="string")try{return r=iAe.Double.fromString(n),r}catch{Y9t.ok(!1)}else r=Number(n)}else r=Number(e);return new iAe.Double(r)}});var Q9t=l((oEa,X9t)=>{"use strict";var y5n=Iu(),F9=ka(),b5n=Z9t(),g5n=Mu();function Cs(t,e,r,n){F9.call(this,t,e,"Double",n)}Cs.schemaName="Double";Cs.defaultOptions={};Cs.prototype=Object.create(F9.prototype);Cs.prototype.constructor=Cs;Cs._cast=b5n;Cs.set=F9.set;Cs.setters=[];Cs.get=F9.get;Cs._defaultCaster=t=>{if(t!=null&&t._bsontype!=="Double")throw new Error;return t};Cs.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Cs._checkRequired=t=>t!=null;Cs.checkRequired=F9.checkRequired;Cs.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};Cs.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=Cs.cast();try{return e(t)}catch(r){throw new y5n("Double",t,this.path,r,this)}};function EW(t){return this.cast(t)}var v5n={...F9.prototype.$conditionalHandlers,$gt:EW,$gte:EW,$lt:EW,$lte:EW};Object.defineProperty(Cs.prototype,"$conditionalHandlers",{enumerable:!1,value:v5n});Cs.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return g5n("number","double",e?.useBsonType,r)};Cs.prototype.autoEncryptionType=function(){return"double"};X9t.exports=Cs});var tEt=l((uEa,eEt)=>{"use strict";var _5n=Jo(),E5n=fe("assert");eEt.exports=function(e){if(e==null)return e;if(e==="")return null;let r=_5n(e,"Long")?e.toNumber():Number(e);if(r===(r|0)&&r>=-2147483648&&r<=2147483647)return r;E5n.ok(!1)}});var iEt=l((fEa,nEt)=>{"use strict";var rEt=Iu(),L9=ka(),S5n=tEt(),w5n=Mu(),SW=yR();function is(t,e,r,n){L9.call(this,t,e,"Int32",n)}is.schemaName="Int32";is.defaultOptions={};is.prototype=Object.create(L9.prototype);is.prototype.constructor=is;is._cast=S5n;is.set=L9.set;is.setters=[];is.get=L9.get;is._defaultCaster=t=>{if(t!=null&&(typeof t!="number"||t!==(t|0)||t<-2147483648||t>2147483647))throw new Error;return t};is.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};is._checkRequired=t=>t!=null;is.checkRequired=L9.checkRequired;is.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};is.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=is.cast();try{return e(t)}catch(r){throw new rEt("Int32",t,this.path,r,this)}};var A5n={...L9.prototype.$conditionalHandlers,$gt:wW,$gte:wW,$lt:wW,$lte:wW,$bitsAllClear:SW,$bitsAnyClear:SW,$bitsAllSet:SW,$bitsAnySet:SW};Object.defineProperty(is.prototype,"$conditionalHandlers",{enumerable:!1,value:A5n});function wW(t,e){return this.castForQuery(null,t,e)}is.prototype.castForQuery=function(t,e,r){let n;if(t!=null)return n=this.$conditionalHandlers[t],n?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(i){throw i instanceof rEt&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};is.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return w5n("number","int",e?.useBsonType,r)};is.prototype.autoEncryptionType=function(){return"int"};nEt.exports=is});var sEt=l((lEa,aEt)=>{"use strict";var x5n=ff(),AW=class extends x5n{},T5n=yl();Object.defineProperty(AW.prototype,"of",T5n);aEt.exports=AW});var fEt=l((cEa,uEt)=>{"use strict";var aAe=Jz(),O5n=sEt(),oEt=ka(),C5n=Mu(),I5n=Ir(),M5n=bv(),j9=zt(),xv=class extends oEt{constructor(e,r,n,i){super(e,r,"Map",i),this.$isSchemaMap=!0,this._createNestedSchemaType(i,e,r,n)}set(e,r){return oEt.set(e,r)}cast(e,r,n,i,a){if(e instanceof aAe)return e;let s=a?.path??this.path;if(n){let o=new aAe({},s,r,this.$__schemaType);if(e instanceof global.Map)for(let u of e.keys()){let f=e.get(u);f==null?f=o.$__schemaType._castNullish(f):f=o.$__schemaType.cast(f,r,!0,null,{...a,path:s+"."+u}),o.$init(u,f)}else for(let u of Object.keys(e)){let f=e[u];f==null?f=o.$__schemaType._castNullish(f):f=o.$__schemaType.cast(f,r,!0,null,{...a,path:s+"."+u}),o.$init(u,f)}return o}return new aAe(e,s,r,this.$__schemaType)}clone(){let e=super.clone();return this.$__schemaType!=null&&(e.$__schemaType=this.$__schemaType.clone()),e}getEmbeddedSchemaType(){return this.$__schemaType}toJSONSchema(e){let r=e?.useBsonType,n=this.getEmbeddedSchemaType(),i=this.options.required&&typeof this.options.required!="function",a=C5n("object","object",r,i);return a.additionalProperties=n.toJSONSchema(e),a}autoEncryptionType(){return"object"}};xv.schemaName="Map";xv.prototype.OptionsConstructor=O5n;xv.defaultOptions={};xv.prototype._createNestedSchemaType=function(e,r,n,i){let a=r+".$*",s={type:{}};j9.hasUserDefinedProperty(n,"of")&&(j9.isPOJO(n.of)&&j9.hasOwnKeys(n.of)&&!j9.hasUserDefinedProperty(n.of,e.options.typeKey)?s={[e.options.typeKey]:new M5n(n.of)}:j9.isPOJO(n.of)?s=Object.assign({},n.of):s={[e.options.typeKey]:n.of},s[e.options.typeKey]&&s[e.options.typeKey].instanceOfSchema&&s[e.options.typeKey].eachPath((f,c)=>{if(c.options.select===!0||c.options.select===!1)throw new I5n('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+r+"."+f+'"')}),j9.hasUserDefinedProperty(n,"ref")&&(s.ref=n.ref)),this.$__schemaType=e.interpretAsType(a,s,i)};uEt.exports=xv});var dEt=l((dEa,cEt)=>{"use strict";var P5n=ff(),TR=class extends P5n{},lEt=yl();Object.defineProperty(TR.prototype,"auto",lEt);Object.defineProperty(TR.prototype,"populate",lEt);cEt.exports=TR});var mEt=l((pEa,hEt)=>{"use strict";var pEt=Jo(),sAe=Wb();hEt.exports=function(e){if(e==null||pEt(e,"ObjectId"))return e;if(e._id){if(pEt(e._id,"ObjectId"))return e._id;if(e._id.toString instanceof Function)return new sAe(e._id.toString())}return e.toString instanceof Function?new sAe(e.toString()):new sAe(e)}});var vEt=l((hEa,gEt)=>{"use strict";var R5n=dEt(),Ny=ka(),q5n=mEt(),N5n=Mu(),D5n=v0(),uAe=Wb(),fAe=Jo(),yEt=zt(),k5n=Ny.CastError,oAe;function Sa(t,e,r,n){let i=typeof t=="string"&&t.length===24&&/^[a-f0-9]+$/i.test(t),a=e?.suppressWarning;(i||typeof t>"u")&&!a&&yEt.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.Types.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."),Ny.call(this,t,e,"ObjectId",n)}Sa.schemaName="ObjectId";Sa.defaultOptions={};Sa.prototype=Object.create(Ny.prototype);Sa.prototype.constructor=Sa;Sa.prototype.OptionsConstructor=R5n;Sa.get=Ny.get;Sa.set=Ny.set;Sa.setters=[];Sa.prototype.auto=function(t){return t&&(this.default(bEt),this.set(B5n)),this};Sa._checkRequired=t=>fAe(t,"ObjectId");Sa._cast=q5n;Sa.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Sa._defaultCaster=t=>{if(!fAe(t,"ObjectId"))throw new Error(t+" is not an instance of ObjectId");return t};Sa.checkRequired=Ny.checkRequired;Sa.prototype.checkRequired=function(e,r){return Ny._isRef(this,e,r,!0)?!!e:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():Sa.checkRequired())(e)};Sa.prototype.cast=function(t,e,r,n,i){if(!fAe(t,"ObjectId")&&Ny._isRef(this,t,e,r)){if((D5n(t)||"").toLowerCase()==="objectid")return new uAe(t.toHexString());if(t==null||yEt.isNonBuiltinObject(t))return this._castRef(t,e,r,i)}let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=Sa.cast();try{return a(t)}catch(s){throw new k5n("ObjectId",t,this.path,s,this)}};function xW(t){return this.cast(t)}var $5n={...Ny.prototype.$conditionalHandlers,$gt:xW,$gte:xW,$lt:xW,$lte:xW};Object.defineProperty(Sa.prototype,"$conditionalHandlers",{enumerable:!1,value:$5n});function bEt(){return new uAe}bEt.$runBeforeSetters=!0;function B5n(t){return oAe||(oAe=Dh()),this instanceof oAe&&t===void 0?new uAe:t}Sa.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function"||this.path==="_id";return N5n("string","objectId",e?.useBsonType,r)};Sa.prototype.autoEncryptionType=function(){return"objectId"};gEt.exports=Sa});var EEt=l((mEa,_Et)=>{"use strict";var F5n=ff(),vl=class extends F5n{},Bh=yl();Object.defineProperty(vl.prototype,"enum",Bh);Object.defineProperty(vl.prototype,"match",Bh);Object.defineProperty(vl.prototype,"lowercase",Bh);Object.defineProperty(vl.prototype,"trim",Bh);Object.defineProperty(vl.prototype,"uppercase",Bh);Object.defineProperty(vl.prototype,"minLength",Bh);Object.defineProperty(vl.prototype,"minlength",Bh);Object.defineProperty(vl.prototype,"maxLength",Bh);Object.defineProperty(vl.prototype,"maxlength",Bh);Object.defineProperty(vl.prototype,"populate",Bh);_Et.exports=vl});var lAe=l((yEa,xEt)=>{"use strict";var Dy=ka(),CR=ml(),L5n=EEt(),j5n=Qz(),U5n=Mu(),SEt=zt(),V5n=Jo(),AEt=Dy.CastError;function on(t,e,r,n){this.enumValues=[],this.regExp=null,Dy.call(this,t,e,"String",n)}on.schemaName="String";on.defaultOptions={};on.prototype=Object.create(Dy.prototype);on.prototype.constructor=on;Object.defineProperty(on.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:L5n});on._cast=j5n;on.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};on._defaultCaster=t=>{if(t!=null&&typeof t!="string")throw new Error;return t};on.get=Dy.get;on.set=Dy.set;on.setters=[];on._checkRequired=t=>(t instanceof String||typeof t=="string")&&t.length;on.checkRequired=Dy.checkRequired;on.prototype.enum=function(){if(this.enumValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.enumValidator},this),this.enumValidator=!1),arguments[0]===void 0||arguments[0]===!1)return this;let t,e;SEt.isObject(arguments[0])?Array.isArray(arguments[0].values)?(t=arguments[0].values,e=arguments[0].message):(t=SEt.object.vals(arguments[0]),e=CR.messages.String.enum):(t=arguments,e=CR.messages.String.enum);for(let n of t)n!==void 0&&this.enumValues.push(this.cast(n));let r=this.enumValues;return this.enumValidator=function(n){return n==null||~r.indexOf(n)},this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:r}),this};on.prototype.lowercase=function(t){return arguments.length>0&&!t?this:this.set(e=>(typeof e!="string"&&(e=this.cast(e)),e&&e.toLowerCase()))};on.prototype.uppercase=function(t){return arguments.length>0&&!t?this:this.set(e=>(typeof e!="string"&&(e=this.cast(e)),e&&e.toUpperCase()))};on.prototype.trim=function(t){return arguments.length>0&&!t?this:this.set(e=>(typeof e!="string"&&(e=this.cast(e)),e&&e.trim()))};on.prototype.minlength=function(t,e){if(this.minlengthValidator&&(this.validators=this.validators.filter(function(r){return r.validator!==this.minlengthValidator},this)),t!=null){let r=e||CR.messages.String.minlength;r=r.replace(/{MINLENGTH}/,t),this.validators.push({validator:this.minlengthValidator=function(n){return n===null||n.length>=t},message:r,type:"minlength",minlength:t})}return this};on.prototype.minLength=on.prototype.minlength;on.prototype.maxlength=function(t,e){if(this.maxlengthValidator&&(this.validators=this.validators.filter(function(r){return r.validator!==this.maxlengthValidator},this)),t!=null){let r=e||CR.messages.String.maxlength;r=r.replace(/{MAXLENGTH}/,t),this.validators.push({validator:this.maxlengthValidator=function(n){return n===null||n.length<=t},message:r,type:"maxlength",maxlength:t})}return this};on.prototype.maxLength=on.prototype.maxlength;on.prototype.match=function(e,r){let n=r||CR.messages.String.match,i=function(a){return e?(e.lastIndex=0,a!=null&&a!==""?e.test(a):!0):!1};return this.validators.push({validator:i,message:n,type:"regexp",regexp:e}),this};on.prototype.checkRequired=function(e,r){return typeof e=="object"&&Dy._isRef(this,e,r,!0)?e!=null:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():on.checkRequired())(e)};on.prototype.cast=function(t,e,r,n,i){if(typeof t!="string"&&Dy._isRef(this,t,e,r))return this._castRef(t,e,r,i);let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=on.cast();try{return a(t)}catch{throw new AEt("string",t,this.path,null,this)}};function OR(t,e){return this.castForQuery(null,t,e)}function H5n(t,e){let r=this;return Array.isArray(t)?t.map(function(n){return r.castForQuery(null,n,e)}):[this.castForQuery(null,t,e)]}function wEt(t){return t==null?this._castNullish(t):this.cast(t,this)}var z5n={...Dy.prototype.$conditionalHandlers,$all:H5n,$gt:OR,$gte:OR,$lt:OR,$lte:OR,$options:wEt,$regex:function(e){return Object.prototype.toString.call(e)==="[object RegExp]"?e:wEt.call(this,e)},$not:OR};Object.defineProperty(on.prototype,"$conditionalHandlers",{enumerable:!1,value:z5n});on.prototype.castForQuery=function(t,e,r){let n;if(t!=null){if(n=this.$conditionalHandlers[t],!n)throw new Error("Can't use "+t+" with String.");return n.call(this,e,r)}if(Object.prototype.toString.call(e)==="[object RegExp]"||V5n(e,"BSONRegExp"))return e;try{return this.applySetters(e,r)}catch(i){throw i instanceof AEt&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};on.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return U5n("string","string",e?.useBsonType,r)};on.prototype.autoEncryptionType=function(){return"string"};xEt.exports=on});var TEt=l((bEa,pAe)=>{"use strict";var cAe=sr().UUID,dAe=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i;pAe.exports=function(e){if(e==null||e instanceof cAe)return e;if(typeof e=="string"){if(dAe.test(e))return new cAe(e);throw new Error(`"${e}" is not a valid UUID string`)}if(e.toString&&e.toString!==Object.prototype.toString&&dAe.test(e.toString()))return new cAe(e.toString());throw new Error(`"${e}" cannot be casted to a UUID`)};pAe.exports.UUID_FORMAT=dAe});var MEt=l((gEa,IEt)=>{"use strict";var Qb=ka(),OEt=Qb.CastError,CEt=TEt(),W5n=Mu(),G5n=zt(),TW=yR(),K5n=CEt.UUID_FORMAT;function Y5n(t){let e;return typeof t!="string"&&t!=null?(e=t.toString("hex"),e.substring(0,8)+"-"+e.substring(8,12)+"-"+e.substring(12,16)+"-"+e.substring(16,20)+"-"+e.substring(20,32)):t}function as(t,e,r,n){Qb.call(this,t,e,"UUID",n)}as.schemaName="UUID";as.defaultOptions={};as.prototype=Object.create(Qb.prototype);as.prototype.constructor=as;as._cast=CEt;as.get=Qb.get;as.set=Qb.set;as.setters=[];as.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};as._checkRequired=t=>t!=null;as.checkRequired=Qb.checkRequired;as.prototype.checkRequired=function(e){return Buffer.isBuffer(e)&&(e=Y5n(e)),e!=null&&K5n.test(e)};as.prototype.cast=function(t,e,r,n,i){if(G5n.isNonBuiltinObject(t)&&Qb._isRef(this,t,e,r))return this._castRef(t,e,r,i);let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=as.cast();try{return a(t)}catch(s){throw new OEt(as.schemaName,t,this.path,s,this)}};function J5n(t){return this.cast(t)}function hAe(t){return t.map(e=>this.cast(e))}var Z5n={...Qb.prototype.$conditionalHandlers,$bitsAllClear:TW,$bitsAnyClear:TW,$bitsAllSet:TW,$bitsAnySet:TW,$all:hAe,$in:hAe,$ne:J5n,$nin:hAe};Object.defineProperty(as.prototype,"$conditionalHandlers",{enumerable:!1,value:Z5n});as.prototype.castForQuery=function(t,e,r){let n;if(t!=null){if(n=this.$conditionalHandlers[t],!n)throw new Error("Can't use "+t+" with UUID.");return n.call(this,e,r)}try{return this.applySetters(e,r)}catch(i){throw i instanceof OEt&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};as.prototype.toJSONSchema=function(e){let r=this.options.required&&typeof this.options.required!="function";return W5n("string","binData",e?.useBsonType,r)};as.prototype.autoEncryptionType=function(){return"binData"};IEt.exports=as});var REt=l((vEa,PEt)=>{"use strict";var X5n=ff(),OW=class extends X5n{},Q5n=yl();Object.defineProperty(OW.prototype,"of",Q5n);PEt.exports=OW});var NEt=l((_Ea,qEt)=>{"use strict";var e3n=REt(),t3n=ka(),U9=Symbol("firstValue");var V9=class extends t3n{constructor(e,r,n,i){if(super(e,r,"Union",i),!Array.isArray(r?.of)||r.of.length===0)throw new Error("Union schema type requires an array of types");this.schemaTypes=r.of.map(a=>i.interpretAsType(e,a,n))}cast(e,r,n,i,a){let s=U9,o;for(let u=0;u<this.schemaTypes.length;++u)try{let f=this.schemaTypes[u].cast(e,r,n,i,a);if(f===e)return f;s===U9&&(s=f)}catch(f){o=f}if(s!==U9)return s;throw o}applySetters(e,r,n,i,a){let s=U9,o;for(let u=0;u<this.schemaTypes.length;++u)try{let f=this.schemaTypes[u]._applySetters(e,r,n,i,a);if(f==null?f=this.schemaTypes[u]._castNullish(f):f=this.schemaTypes[u].cast(f,r,n,i,a),f===e)return f;s===U9&&(s=f)}catch(f){o=f}if(s!==U9)return s;throw o}clone(){let e=super.clone();return e.schemaTypes=this.schemaTypes.map(r=>r.clone()),e}};V9.schemaName="Union";V9.defaultOptions={};V9.prototype.OptionsConstructor=e3n;qEt.exports=V9});var mR=l(ai=>{"use strict";ai.Array=aW();ai.BigInt=L7t();ai.Boolean=V7t();ai.Buffer=K7t();ai.Date=r9t();ai.Decimal128=ai.Decimal=s9t();ai.DocumentArray=K9t();ai.DocumentArrayElement=eAe();ai.Double=Q9t();ai.Int32=iEt();ai.Map=fEt();ai.Mixed=cv();ai.Number=Twe();ai.ObjectId=vEt();ai.String=lAe();ai.Subdocument=Qwe();ai.UUID=MEt();ai.Union=NEt();ai.Oid=ai.ObjectId;ai.Object=ai.Mixed;ai.Bool=ai.Boolean;ai.ObjectID=ai.ObjectId});var bv=l((gAe,WEt)=>{"use strict";var r3n=fe("events").EventEmitter,n3n=ov(),eg=Ir(),DEt=ka(),kEt=ff(),i3n=awe(),bAe=Gz(),$Et=owe(),eu=_a(),BEt=$a(),a3n=v0(),s3n=O4t(),MW=lwe(),o3n=M4t(),FEt=R4t(),u3n=hz(),CW=bl(),f3n=N4t(),l3n=H4t(),c3n=lv(),Pi=zt(),d3n=W4t(),p3n=/\.\d+(\.|$)/,tg,h3n=cR().queryMiddlewareFunctions,m3n=cR().documentMiddlewareFunctions,LEt=h3n.concat(m3n).reduce((t,e)=>t.add(e),new Set),mAe=Pi.isPOJO,jEt=0,y3n=/^\d+$/;function at(t,e){if(!(this instanceof at))return new at(t,e);if(this.obj=t,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this._searchIndexes=[],this.methods=e?.methods||{},this.methodOptions={},this.statics=e?.statics||{},this.tree={},this.query=e?.query||{},this.childSchemas=[],this.plugins=[],this.$id=++jEt,this.mapPaths=[],this.encryptedFields={},this.s={hooks:new n3n},this.options=this.defaultOptions(e),Array.isArray(t))for(let i of t)this.add(i);else t&&this.add(t);if(e?.virtuals){let i=e.virtuals,a=Object.keys(i);for(let s of a){let o=i[s].options?i[s].options:void 0,u=this.virtual(s,o);i[s].get&&u.get(i[s].get),i[s].set&&u.set(i[s].set)}}let r=t?._id&&Pi.isObject(t._id);!this.paths._id&&this.options._id&&!r&&$Et(this),this.setupTimestamp(this.options.timestamps)}function UEt(t,e){for(let r of Object.keys(e)){let n=null;if(e[r]!=null)n=e[r];else{let a=BEt(t.paths[r],"options");if(a==null)continue;n=a.alias}if(!n)continue;let i=t.paths[r].path;if(Array.isArray(n)){for(let a of n){if(typeof a!="string")throw new Error("Invalid value for alias option on "+i+", got "+a);t.aliases[a]=i,t.virtual(a).get((function(s){return function(){return typeof this.get=="function"?this.get(s):this[s]}})(i)).set((function(s){return function(o){return this.$set(s,o)}})(i))}continue}if(typeof n!="string")throw new Error("Invalid value for alias option on "+i+", got "+n);t.aliases[n]=i,t.virtual(n).get((function(a){return function(){return typeof this.get=="function"?this.get(a):this[a]}})(i)).set((function(a){return function(s){return this.$set(a,s)}})(i))}}at.prototype=Object.create(r3n.prototype);at.prototype.constructor=at;at.prototype.instanceOfSchema=!0;Object.defineProperty(at.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0});Object.defineProperty(at.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(at.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0});at.prototype.obj;at.prototype.paths;at.prototype.tree;at.create=function(e,r){return new at(e,r)};at.prototype.clone=function(){let t=this._clone();return t.on("init",e=>this.emit("init",e)),t};at.prototype._clone=function(e){e=e||(this.base==null?at:this.base.Schema);let r=new e({},this._userProvidedOptions);r.base=this.base,r.obj=this.obj,r.options=eu(this.options),r.callQueue=this.callQueue.map(function(n){return n}),r.methods=eu(this.methods),r.methodOptions=eu(this.methodOptions),r.statics=eu(this.statics),r.query=eu(this.query),r.plugins=Array.prototype.slice.call(this.plugins),r._indexes=eu(this._indexes),r._searchIndexes=eu(this._searchIndexes),r.s.hooks=this.s.hooks.clone(),r.tree=eu(this.tree),r.paths=Object.fromEntries(Object.entries(this.paths).map(([n,i])=>[n,i.clone()])),r.nested=eu(this.nested),r.subpaths=eu(this.subpaths);for(let n of Object.values(r.paths))if(n.$isSingleNested){let i=n.path;for(let a of Object.keys(n.schema.paths))r.singleNestedPaths[i+"."+a]=n.schema.paths[a];for(let a of Object.keys(n.schema.singleNestedPaths))r.singleNestedPaths[i+"."+a]=n.schema.singleNestedPaths[a];for(let a of Object.keys(n.schema.subpaths))r.singleNestedPaths[i+"."+a]=n.schema.subpaths[a];for(let a of Object.keys(n.schema.nested))r.singleNestedPaths[i+"."+a]="nested"}return r._gatherChildSchemas(),r.virtuals=eu(this.virtuals),r.$globalPluginsApplied=this.$globalPluginsApplied,r.$isRootDiscriminator=this.$isRootDiscriminator,r.$implicitlyCreated=this.$implicitlyCreated,r.$id=++jEt,r.$originalSchemaId=this.$id,r.mapPaths=[].concat(this.mapPaths),this.discriminatorMapping!=null&&(r.discriminatorMapping=Object.assign({},this.discriminatorMapping)),this.discriminators!=null&&(r.discriminators=Object.assign({},this.discriminators)),this._applyDiscriminators!=null&&(r._applyDiscriminators=new Map(this._applyDiscriminators)),r.aliases=Object.assign({},this.aliases),r.encryptedFields=eu(this.encryptedFields),r};at.prototype.pick=function(t,e){let r=new at({},e||this.options);if(!Array.isArray(t))throw new eg('Schema#pick() only accepts an array argument, got "'+typeof t+'"');for(let n of t)if(this._hasEncryptedField(n)){let i=this.encryptedFields[n],a=this.path(n);r.add({[n]:{encrypt:i,[this.options.typeKey]:a}})}else if(this.nested[n])r.add({[n]:BEt(this.tree,n)});else{let i=this.path(n);if(i==null)throw new eg("Path `"+n+"` is not in the schema");r.add({[n]:i})}return this._hasEncryptedFields()||(r.options.encryptionType=null),r};at.prototype.omit=function(t,e){let r=new at(this,e||this.options);if(!Array.isArray(t))throw new eg('Schema#omit() only accepts an array argument, got "'+typeof t+'"');r.remove(t);for(let n in r.singleNestedPaths)t.includes(n)&&delete r.singleNestedPaths[n];return r};at.prototype.defaultOptions=function(t){this._userProvidedOptions=t==null?{}:eu(t);let e=this.base?.options||{},r="strict"in e?e.strict:!0,n="strictQuery"in e?e.strictQuery:!1,i="id"in e?e.id:!0;if(t={strict:r,strictQuery:n,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:i,typeKey:"type",...t},t.versionKey&&typeof t.versionKey!="string")throw new eg("`versionKey` must be falsy or string, got `"+typeof t.versionKey+"`");if(typeof t.read=="string"?t.read=MW(t.read):Array.isArray(t.read)&&typeof t.read[0]=="string"&&(t.read={mode:MW(t.read[0]),tags:t.read[1]}),t.optimisticConcurrency&&!t.versionKey)throw new eg("Must set `versionKey` if using `optimisticConcurrency`");return t};at.prototype.discriminator=function(t,e,r){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(t,{schema:e,options:r}),this};at.prototype._getDocumentMiddleware=function(){return this.s.hooks.filter(e=>e.name==="updateOne"||e.name==="deleteOne"?!!e.document:e.name==="remove"||e.name==="init"?e.document==null||!!e.document:e.query!=null||e.document!=null?e.document!==!1:!0).filter(e=>this.methods[e.name]?!e.fn[c3n.builtInMiddleware]:!0)};at.prototype._defaultToObjectOptions=function(t){let e=t?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&this._defaultToObjectOptionsMap[e])return this._defaultToObjectOptionsMap[e];let r=this.base?.options?.[e]||{},n=this.options[e]||{},i=Object.assign({},r,n);return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[e]=i,i};at.prototype.encryptionType=function(t){if(arguments.length===0)return this.options.encryptionType;if(!(typeof t=="string"||t===null))throw new Error("invalid `encryptionType`: ${encryptionType}");this.options.encryptionType=t};at.prototype.add=function(e,r){if(e instanceof at||e?.instanceOfSchema)return u3n(this,e),this;if(e._id===!1&&r==null&&(this.options._id=!1),r=r||"",r==="__proto__."||r==="constructor."||r==="prototype.")return this;let n=Object.keys(e),i=this.options.typeKey;for(let s of n){if(Pi.specialProperties.has(s))continue;let o=r+s,u=e[s];if(u==null)throw new TypeError("Invalid value for schema path `"+o+'`, got value "'+u+'"');if(s==="_id"&&u===!1)continue;let f=!1;if(typeof u=="string"){let c=this.base?.Schema.Types??at.Types,d=u.charAt(0).toUpperCase()+u.substring(1);f=c[d]!=null}if(s!=="_id"&&(typeof u!="object"&&typeof u!="function"&&!f||u==null))throw new TypeError(`Invalid schema configuration: \`${u}\` is not a valid type at path \`${s}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if(u instanceof bAe||(u.constructor?.name??null)==="VirtualType"){this.virtual(u);continue}if(Array.isArray(u)&&u.length===1&&u[0]==null)throw new TypeError("Invalid value for schema Array path `"+o+'`, got value "'+u[0]+'"');if(mAe(u)||u instanceof kEt)if(Pi.hasOwnKeys(u)===!1)r&&(this.nested[r.substring(0,r.length-1)]=!0),this.path(o,u);else if(!u[i]||i==="type"&&mAe(u.type)&&u.type.type)this.nested[o]=!0,this.add(u,o+".");else{let c=u[i];if(mAe(c)&&Pi.hasOwnKeys(c)){r&&(this.nested[r.substring(0,r.length-1)]=!0);let d={};this._userProvidedOptions.typeKey&&(d.typeKey=this._userProvidedOptions.typeKey),this._userProvidedOptions.strict!=null&&(d.strict=this._userProvidedOptions.strict),this._userProvidedOptions.toObject!=null&&(d.toObject=Pi.omit(this._userProvidedOptions.toObject,["transform"])),this._userProvidedOptions.toJSON!=null&&(d.toJSON=Pi.omit(this._userProvidedOptions.toJSON,["transform"]));let h=new at(c,d);h.$implicitlyCreated=!0;let p=Object.assign({},u,{[i]:h});this.path(r+s,p)}else if(r&&(this.nested[r.substring(0,r.length-1)]=!0),this.path(r+s,u),!u?.instanceOfSchema&&Pi.isPOJO(u?.discriminators)){let d=this.path(r+s);for(let h in u.discriminators)d.discriminator(h,u.discriminators[h])}}else if(r&&(this.nested[r.substring(0,r.length-1)]=!0),this.path(r+s,u),!u[0]?.instanceOfSchema&&Pi.isPOJO(u[0]?.discriminators)){let c=this.path(r+s);for(let d in u[0].discriminators)c.discriminator(d,u[0].discriminators[d])}if(u.instanceOfSchema&&u.encryptionType()!=null){if(this.encryptionType()!=u.encryptionType())throw new Error("encryptionType of a nested schema must match the encryption type of the parent schema.");for(let[c,d]of Object.entries(u.encryptedFields)){let h=o+"."+c;this._addEncryptedField(h,d)}}else if(typeof u=="object"&&"encrypt"in u){let{encrypt:c}=u;if(this.encryptionType()==null)throw new Error("encryptionType must be provided");this._addEncryptedField(o,c)}else this._removeEncryptedField(o)}let a=Object.fromEntries(Object.entries(e).map(([s])=>[r+s,null]));return UEt(this,a),this};at.prototype._addEncryptedField=function(e,r){if(this.path(e).autoEncryptionType()==null)throw new Error(`Invalid BSON type for FLE field: '${e}'`);this.encryptedFields[e]=eu(r)};at.prototype._removeEncryptedField=function(e){delete this.encryptedFields[e]};at.prototype._hasEncryptedFields=function(){return Pi.hasOwnKeys(this.encryptedFields)};at.prototype._hasEncryptedField=function(e){return e in this.encryptedFields};at.prototype._buildEncryptedFields=function(){return{fields:Object.entries(this.encryptedFields).map(([e,r])=>{let n=this.path(e).autoEncryptionType();return{path:e,bsonType:n,...r}})}};at.prototype._buildSchemaMap=function(){function t(n,i,a){let s=0,o=n[s];for(;s<n.length-1;++s,o=n[s])i[o]=i[o]==null?{bsonType:"object",properties:{}}:i[o],i=i[o].properties;i[o]=a}let e=(n,[i,a])=>{let s=this.path(i).autoEncryptionType(),o=i.split("."),u={encrypt:{...a,bsonType:s}};return t(o,n,u),n};return{bsonType:"object",properties:Object.entries(this.encryptedFields).reduce(e,{})}};at.prototype.alias=function(t,e){return UEt(this,{[t]:e}),this};at.prototype.removeIndex=function(e){if(arguments.length>1)throw new Error("removeIndex() takes only 1 argument");if(typeof e!="object"&&typeof e!="string")throw new Error("removeIndex() may only take either an object or a string as an argument");if(typeof e=="object")for(let r=this._indexes.length-1;r>=0;--r)FEt(this._indexes[r][0],e)&&this._indexes.splice(r,1);else for(let r=this._indexes.length-1;r>=0;--r)this._indexes[r][1]!=null&&this._indexes[r][1].name===e&&this._indexes.splice(r,1);return this};at.prototype.clearIndexes=function(){return this._indexes.length=0,this};at.prototype.searchIndex=function(e){return this._searchIndexes.push(e),this};at.reserved=Object.create(null);at.prototype.reserved=at.reserved;var Qo=at.reserved;Qo.prototype=Qo.emit=Qo.listeners=Qo.removeListener=Qo.collection=Qo.errors=Qo.get=Qo.init=Qo.isModified=Qo.isNew=Qo.populated=Qo.remove=Qo.save=Qo.toObject=Qo.validate=1;Qo.collection=1;at.prototype.path=function(t,e){if(e===void 0){if(this.paths[t]!=null)return this.paths[t];let u=VEt(t),f=b3n(this,t,u);if(f!=null)return f;let c=HEt(this,t);return c??(f=this.hasMixedParent(u),f??(p3n.test(t)?g3n(this,t,u):void 0))}let r=t.split(".")[0];if(Qo[r]&&!this.options.suppressReservedKeysWarning){let u=`\`${r}\` 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.`;Pi.warn(u)}typeof e=="object"&&Pi.hasUserDefinedProperty(e,"ref")&&d3n(e.ref,t);let n=t.split(/\./),i=n.pop(),a=this.tree,s="";for(let u of n){if(Pi.specialProperties.has(u))throw new Error("Cannot set special property `"+u+"` on a schema");if(s=s+=(s.length>0?".":"")+u,a[u]||(this.nested[s]=!0,a[u]={}),typeof a[u]!="object"){let f="Cannot set nested path `"+t+"`. Parent path `"+s+"` already set to type "+a[u].name+".";throw new Error(f)}a=a[u]}a[i]=eu(e),this.paths[t]=this.interpretAsType(t,e,this.options);let o=this.paths[t];if(this.childSchemas=this.childSchemas.filter(u=>u.path!==t),o.$isSchemaMap){let u=t+".$*";this.paths[u]=o.$__schemaType,this.mapPaths.push(this.paths[u]),o.$__schemaType.$isSingleNested&&this.childSchemas.push({schema:o.$__schemaType.schema,model:o.$__schemaType.Constructor,path:t})}if(o.$isSingleNested){for(let u of Object.keys(o.schema.paths))this.singleNestedPaths[t+"."+u]=o.schema.paths[u];for(let u of Object.keys(o.schema.singleNestedPaths))this.singleNestedPaths[t+"."+u]=o.schema.singleNestedPaths[u];for(let u of Object.keys(o.schema.subpaths))this.singleNestedPaths[t+"."+u]=o.schema.subpaths[u];for(let u of Object.keys(o.schema.nested))this.singleNestedPaths[t+"."+u]="nested";Object.defineProperty(o.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),o.Constructor.base=this.base,this.childSchemas.push({schema:o.schema,model:o.Constructor,path:t})}else o.$isMongooseDocumentArray&&(Object.defineProperty(o.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),o.Constructor.base=this.base,this.childSchemas.push({schema:o.schema,model:o.Constructor,path:t}));if(o.$isMongooseArray&&!o.$isMongooseDocumentArray){let u=t,f=o,c=[];for(;f.$isMongooseArray;)u=u+".$",f.embeddedSchemaType._arrayPath=u,f.embeddedSchemaType._arrayParentPath=t,f=f.embeddedSchemaType,this.subpaths[u]=f;for(let d of c)this.subpaths[d.path]=d}if(o.$isMongooseDocumentArray){for(let u of Object.keys(o.schema.paths)){let f=o.schema.paths[u];this.subpaths[t+"."+u]=f,typeof f=="object"&&f!=null&&f.$parentSchemaDocArray==null&&(f.$parentSchemaDocArray=o)}for(let u of Object.keys(o.schema.subpaths)){let f=o.schema.subpaths[u];this.subpaths[t+"."+u]=f,typeof f=="object"&&f!=null&&f.$parentSchemaDocArray==null&&(f.$parentSchemaDocArray=o)}for(let u of Object.keys(o.schema.singleNestedPaths)){let f=o.schema.singleNestedPaths[u];this.subpaths[t+"."+u]=f,typeof f=="object"&&f!=null&&f.$parentSchemaDocArray==null&&(f.$parentSchemaDocArray=o)}}return this};at.prototype._gatherChildSchemas=function(){let e=[];for(let r of Object.keys(this.paths)){if(typeof r!="string")continue;let n=this.paths[r];n.$isMongooseDocumentArray||n.$isSingleNested?e.push({schema:n.schema,model:n.Constructor,path:r}):n.$isSchemaMap&&n.$__schemaType.$isSingleNested&&e.push({schema:n.$__schemaType.schema,model:n.$__schemaType.Constructor,path:r})}return this.childSchemas=e,e};function b3n(t,e,r){if(Object.hasOwn(t.paths,e))return t.paths[e];if(Object.hasOwn(t.subpaths,r)){let n=t.subpaths[r];return n==="nested"?void 0:n}if(Object.hasOwn(t.singleNestedPaths,r)&&typeof t.singleNestedPaths[r]=="object"){let n=t.singleNestedPaths[r];return n==="nested"?void 0:n}return null}function VEt(t){return/\.\d+/.test(t)?t.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$"):t}function HEt(t,e){if(t.mapPaths.length===0)return null;for(let r of t.mapPaths){let n=r.path.replace(/\.\$\*/g,"");if(e===n||e.startsWith(n+".")&&e.slice(n.length+1).indexOf(".")===-1)return r;if(r.schema&&e.startsWith(n+".")){let i=e.slice(n.length+1);return i=i.slice(i.indexOf(".")+1),r.schema.paths[i]}else if(r.$isSchemaMap&&e.startsWith(n+".")){let i=e.slice(n.length+1);i=i.slice(i.indexOf(".")+1);let a=r.$__schemaType._presplitPath;if(i.indexOf(".")===-1&&a[a.length-1]==="$*")return r.$__schemaType;if(i.indexOf(".")!==-1&&r.$__schemaType.schema&&a[a.length-1]==="$*")return r.$__schemaType.schema.path(i.slice(i.indexOf(".")+1))}}return null}Object.defineProperty(at.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null});at.prototype.interpretAsType=function(t,e,r){if(e instanceof DEt){if(e.path===t)return e;let u=e.clone();return u.path=t,u}let n=this.base?.Schema.Types??at.Types,i=this.base?.Types??M9();if(!Pi.isPOJO(e)&&!(e instanceof kEt)&&Pi.getFunctionName(e.constructor)!=="Object"){let f=e;e={},e[r.typeKey]=f}let a=e[r.typeKey]&&(e[r.typeKey]instanceof Function||r.typeKey!=="type"||!e.type.type)?e[r.typeKey]:{};if(a instanceof DEt){if(a.path===t)return a;let u=a.clone();return u.path=t,u}let s;if(Pi.isPOJO(a)||a==="mixed")return new n.Mixed(t,e,null,this);if(Array.isArray(a)||a===Array||a==="array"||a===n.Array){let u=a===Array||a==="array"?e.cast||e.of:a[0];if(u?.instanceOfSchema){if(!(u instanceof at))if(this.options._isMerging)u=new at(u);else throw new TypeError("Schema for array path `"+t+`\` 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: ${t}: new Schema(...)`);return new n.DocumentArray(t,u,e,null,this)}if(u&&u[r.typeKey]&&u[r.typeKey].instanceOfSchema){if(!(u[r.typeKey]instanceof at))if(this.options._isMerging)u[r.typeKey]=new at(u[r.typeKey]);else throw new TypeError("Schema for array path `"+t+`\` 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: ${t}: new Schema(...)`);return new n.DocumentArray(t,u[r.typeKey],e,u,this)}if(typeof u<"u"&&(Array.isArray(u)||u.type===Array||u.type=="Array"))return u?.type=="Array"&&(u.type=Array),new n.Array(t,this.interpretAsType(t,u,r),e,null,this);let f=u!=null&&u[r.typeKey]&&(r.typeKey!=="type"||!u.type.type)?u[r.typeKey]:u;if(typeof u=="string")u=n[u.charAt(0).toUpperCase()+u.substring(1)];else if(Pi.isPOJO(f))if(Pi.hasOwnKeys(f)){let c={minimize:r.minimize};r.typeKey&&(c.typeKey=r.typeKey),Object.hasOwn(r,"strict")&&(c.strict=r.strict),Object.hasOwn(r,"strictQuery")&&(c.strictQuery=r.strictQuery),Object.hasOwn(r,"toObject")&&(c.toObject=Pi.omit(r.toObject,["transform"])),Object.hasOwn(r,"toJSON")&&(c.toJSON=Pi.omit(r.toJSON,["transform"])),Object.hasOwn(this._userProvidedOptions,"_id")?c._id=this._userProvidedOptions._id:at.Types.DocumentArray.defaultOptions._id!=null&&(c._id=at.Types.DocumentArray.defaultOptions._id);let d=new at(f,c);return d.$implicitlyCreated=!0,new n.DocumentArray(t,d,e,null,this)}else return new n.Array(t,n.Mixed,e,null,this);if(u){if(a=u[r.typeKey]&&(r.typeKey!=="type"||!u.type.type)?u[r.typeKey]:u,Array.isArray(a))return new n.Array(t,this.interpretAsType(t,a,r),e,null,this);if(s=typeof a=="string"?a:a.schemaName||Pi.getFunctionName(a),s==="ClockDate"&&(s="Date"),s===void 0)throw new TypeError(`Invalid schema configuration: Could not determine the embedded type for array \`${t}\`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(!Object.hasOwn(n,s))throw new TypeError(`Invalid schema configuration: \`${s}\` is not a valid type within the array \`${t}\`.See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);s==="Union"&&typeof u=="object"&&(u.parentSchema=this)}return new n.Array(t,u||n.Mixed,e,r,this)}if(a?.instanceOfSchema)return new n.Subdocument(a,t,e,this);if(Buffer.isBuffer(a)?s="Buffer":typeof a=="function"||typeof a=="object"?s=a.schemaName||Pi.getFunctionName(a):a===i.ObjectId?s="ObjectId":a===i.Decimal128?s="Decimal128":s=a==null?""+a:a.toString(),s&&(s=s.charAt(0).toUpperCase()+s.substring(1)),s==="ObjectID"&&(s="ObjectId"),s==="ClockDate"&&(s="Date"),s===void 0)throw new TypeError(`Invalid schema configuration: \`${t}\` schematype definition is invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(n[s]==null)throw new TypeError(`Invalid schema configuration: \`${s}\` is not a valid type at path \`${t}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);return new n[s](t,e,r,this)};at.prototype.eachPath=function(t){let e=Object.keys(this.paths),r=e.length;for(let n=0;n<r;++n)t(e[n],this.paths[e[n]]);return this};at.prototype.requiredPaths=function(e){if(this._requiredpaths&&!e)return this._requiredpaths;let r=Object.keys(this.paths),n=r.length,i=[];for(;n--;){let a=r[n];this.paths[a].isRequired&&i.push(a)}return this._requiredpaths=i,this._requiredpaths};at.prototype.indexedPaths=function(){return this._indexedpaths?this._indexedpaths:(this._indexedpaths=this.indexes(),this._indexedpaths)};at.prototype.pathType=function(t){if(Object.hasOwn(this.paths,t))return"real";if(Object.hasOwn(this.virtuals,t))return"virtual";if(Object.hasOwn(this.nested,t))return"nested";let e=VEt(t);if(Object.hasOwn(this.subpaths,e)||Object.hasOwn(this.subpaths,t))return"real";let r=Object.hasOwn(this.singleNestedPaths,e)||Object.hasOwn(this.singleNestedPaths,t);return r?r==="nested"?"nested":"real":HEt(this,t)!=null?"real":/\.\d+\.|\.\d+$/.test(t)?zEt(this,t,e):"adhocOrUndefined"};at.prototype.hasMixedParent=function(t){let e=t.split(/\./g);t="";for(let r=0;r<e.length;++r)if(t=r>0?t+"."+e[r]:e[r],Object.hasOwn(this.paths,t)&&this.paths[t]instanceof tg.Mixed)return this.paths[t];return null};at.prototype.setupTimestamp=function(t){return l3n(this,t)};function zEt(t,e,r){let n=e.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(n.length<2)return Object.hasOwn(t.paths,n[0])?t.paths[n[0]]:"adhocOrUndefined";let i=t.path(n[0]),a=!1;if(!i)return"adhocOrUndefined";let s=n.length-1;for(let o=1;o<n.length;++o){a=!1;let u=n[o];if(o===s&&i&&!/\D/.test(u)){i.$isMongooseDocumentArray||i instanceof tg.Array?i=i.embeddedSchemaType:i=void 0;break}if(!/\D/.test(u)){i instanceof tg.Array&&o!==s&&(i=i.embeddedSchemaType);continue}if(!i?.schema){i=void 0;break}a=i.schema.pathType(u)==="nested",i=i.schema.path(u)}return t.subpaths[r]=i,i?"real":a?"nested":"adhocOrUndefined"}function g3n(t,e,r){return zEt(t,e,r),t.subpaths[r]}at.prototype.queue=function(t,e){return this.callQueue.push([t,e]),this};at.prototype.pre=function(t){if(t instanceof RegExp){let e=Array.prototype.slice.call(arguments,1);for(let r of LEt)t.test(r)&&this.pre.apply(this,[r].concat(e));return this}if(Array.isArray(t)){let e=Array.prototype.slice.call(arguments,1);for(let r of t)this.pre.apply(this,[r].concat(e));return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this};at.prototype.post=function(t){if(t instanceof RegExp){let e=Array.prototype.slice.call(arguments,1);for(let r of LEt)t.test(r)&&this.post.apply(this,[r].concat(e));return this}if(Array.isArray(t)){let e=Array.prototype.slice.call(arguments,1);for(let r of t)this.post.apply(this,[r].concat(e));return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this};at.prototype.plugin=function(t,e){if(typeof t!="function")throw new Error('First param to `schema.plugin()` must be a function, got "'+typeof t+'"');if(e?.deduplicate){for(let r of this.plugins)if(r.fn===t)return this}return this.plugins.push({fn:t,opts:e}),t(this,e),this};at.prototype.method=function(t,e,r){if(typeof t!="string")for(let n in t)this.methods[n]=t[n],this.methodOptions[n]=eu(r);else this.methods[t]=e,this.methodOptions[t]=eu(r);return this};at.prototype.static=function(t,e){if(typeof t!="string")for(let r in t)this.statics[r]=t[r];else this.statics[t]=e;return this};at.prototype.index=function(t,e){t||(t={}),e||(e={}),e.expires&&Pi.expires(e);for(let r in t)this.aliases[r]&&(t=Pi.renameObjKey(t,r,this.aliases[r]));for(let r of Object.keys(t))t[r]==="ascending"||t[r]==="asc"?t[r]=1:(t[r]==="descending"||t[r]==="desc")&&(t[r]=-1);for(let r of this.indexes())e.name==null&&r[1].name==null&&FEt(r[0],t)&&Pi.warn(`Duplicate schema index on ${JSON.stringify(t)} found. This is often due to declaring an index using both "index: true" and "schema.index()". Please remove the duplicate index definition.`);return this._indexes.push([t,e]),this};at.prototype.set=function(t,e,r){if(arguments.length===1)return this.options[t];switch(t){case"read":typeof e=="string"?this.options[t]={mode:MW(e),tags:r}:Array.isArray(e)&&typeof e[0]=="string"?this.options[t]={mode:MW(e[0]),tags:e[1]}:this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break;case"timestamps":this.setupTimestamp(e),this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break;case"_id":this.options[t]=e,this._userProvidedOptions[t]=this.options[t],e&&!this.paths._id?$Et(this):!e&&this.paths._id!=null&&this.paths._id.auto&&this.remove("_id");break;default:this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break}return t==="strict"&&IR(this,{strict:e}),t==="strictQuery"&&IR(this,{strictQuery:e}),t==="toObject"&&(e={...e},delete e.transform,IR(this,{toObject:e})),t==="toJSON"&&(e={...e},delete e.transform,IR(this,{toJSON:e})),this};function IR(t,e){for(let{schema:r}of t.childSchemas)r.$implicitlyCreated&&(Object.assign(r.options,e),IR(r,e))}at.prototype.get=function(t){return this.options[t]};var v3n="2d 2dsphere hashed text".split(" ");Object.defineProperty(at,"indexTypes",{get:function(){return v3n},set:function(){throw new Error("Cannot overwrite Schema.indexTypes")}});at.prototype.indexes=function(){return s3n(this)};at.prototype.virtual=function(t,e){if(t instanceof bAe||a3n(t)==="VirtualType")return this.virtual(t.path,t.options);if(e=new i3n(e),Pi.hasUserDefinedProperty(e,["ref","refPath"])){if(e.localField==null)throw new Error("Reference virtuals require `localField` option");if(e.foreignField==null)throw new Error("Reference virtuals require `foreignField` option");let i=this.virtual(t);i.options=e,this.pre("init",function(u,f){if(CW.has(t,u)){let c=CW.get(t,u);if(this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?this.$$populatedVirtuals[t]=Array.isArray(c)?c[0]:c:this.$$populatedVirtuals[t]=Array.isArray(c)?c:c==null?[]:[c],f?.hydratedPopulatedDocs&&!e.count){let d=i._getModelNamesForPopulate(this),h=this.$$populatedVirtuals[t];if(!Array.isArray(h)&&!h.$__&&d?.length===1){let p=this.db.model(d[0]);this.$$populatedVirtuals[t]=p.hydrate(h)}else if(Array.isArray(h)&&d?.length===1){let p=this.db.model(d[0]);for(let y=0;y<h.length;++y)h[y].$__||(h[y]=p.hydrate(h[y],null,{hydratedPopulatedDocs:!0}));let m=e.foreignField;this.$populated(t,h.map(y=>y==null?y:y.get(typeof m=="function"?m.call(y,y):m)),{populateModelSymbol:p})}}CW.unset(t,u)}}),i.set(function(o){return this.$$populatedVirtuals||(this.$$populatedVirtuals={}),f3n(this.$$populatedVirtuals,t,o,e)}),typeof e.get=="function"&&i.get(e.get);let a=t.split("."),s=a[0];for(let o=0;o<a.length-1;++o)if(this.paths[s]!=null){if(this.paths[s].$isMongooseDocumentArray||this.paths[s].$isSingleNested){let u=a.slice(o+1).join(".");this.paths[s].schema.virtual(u,e);break}else if(this.paths[s].$isSchemaMap){let u=a.slice(o+2).join(".");this.paths[s].$__schemaType.schema.virtual(u,e);break}s+="."+a[o+1]}return i}let r=this.virtuals,n=t.split(".");if(this.pathType(t)==="real")throw new Error('Virtual path "'+t+'" conflicts with a real path in the schema');if(r[t]=n.reduce(function(i,a,s){return i[a]||(i[a]=s===n.length-1?new bAe(e,t):{}),i[a]},this.tree),e?.applyToArray&&n.length>1){let i=this.path(n.slice(0,-1).join("."));if(i?.$isMongooseArray)return i.virtual(n[n.length-1],e);throw new eg(`Path "${i}" is not an array`)}return r[t]};at.prototype.virtualpath=function(t){return Object.hasOwn(this.virtuals,t)?this.virtuals[t]:null};at.prototype.remove=function(t){return typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(function(e){if(!(this.path(e)==null&&!this.nested[e])){if(this.nested[e]){let r=Object.keys(this.paths).concat(Object.keys(this.nested));for(let n of r)n.startsWith(e+".")&&(delete this.paths[n],delete this.nested[n],yAe(this,n));delete this.nested[e],yAe(this,e);return}delete this.paths[e],yAe(this,e),this._removeEncryptedField(e)}},this),this};function yAe(t,e){let r=e.split("."),n=r.pop(),i=t.tree;for(let a of r)i=i[a];delete i[n]}at.prototype.removeVirtual=function(t){if(typeof t=="string"&&(t=[t]),Array.isArray(t)){for(let e of t)if(this.virtuals[e]==null)throw new eg(`Attempting to remove virtual "${e}" that does not exist.`);for(let e of t)delete this.paths[e],delete this.virtuals[e],e.indexOf(".")!==-1?CW.unset(e,this.tree):delete this.tree[e]}return this};at.prototype.loadClass=function(t,e){return t===Object.prototype||t===Function.prototype||Object.hasOwn(t.prototype,"$isMongooseModelPrototype")||Object.hasOwn(t.prototype,"$isMongooseDocumentPrototype")?this:(this.loadClass(Object.getPrototypeOf(t),e),e||Object.getOwnPropertyNames(t).forEach(function(r){if(r.match(/^(length|name|prototype|constructor|__proto__)$/))return;let n=Object.getOwnPropertyDescriptor(t,r);Object.hasOwn(n,"value")&&this.static(r,n.value)},this),Object.getOwnPropertyNames(t.prototype).forEach(function(r){if(r.match(/^(constructor)$/))return;let n=Object.getOwnPropertyDescriptor(t.prototype,r);e||typeof n.value=="function"&&this.method(r,n.value),typeof n.get=="function"&&(this.virtuals[r]&&(this.virtuals[r].getters=[]),this.virtual(r).get(n.get)),typeof n.set=="function"&&(this.virtuals[r]&&(this.virtuals[r].setters=[]),this.virtual(r).set(n.set))},this),this)};at.prototype._getSchema=function(t){let e=this,r=e.path(t),n=[];if(r)return r.$fullPath=t,r;function i(s,o){let u=s.length+1,f,c;for(;u--;)if(c=s.slice(0,u).join("."),f=o.path(c),f){if(n.push(c),f.embeddedSchemaType||f.Constructor){if(f.embeddedSchemaType instanceof tg.Mixed)return f.embeddedSchemaType.$fullPath=n.join("."),f.embeddedSchemaType;if(u!==s.length){if(u+1===s.length&&f.embeddedSchemaType&&(s[u]==="$"||IW(s[u])))return f.embeddedSchemaType;if(f.schema){let d;return s[u]==="$"||IW(s[u])?u+1===s.length?f.embeddedSchemaType:(d=i(s.slice(u+1),f.schema),d&&(d.$parentSchemaDocArray=d.$parentSchemaDocArray||(f.schema.$isSingleNested?null:f)),d):(d=i(s.slice(u),f.schema),d&&(d.$parentSchemaDocArray=d.$parentSchemaDocArray||(f.schema.$isSingleNested?null:f)),d)}}}else if(f.$isSchemaMap){if(u>=s.length)return f;if(u+1>=s.length||f.$__schemaType instanceof tg.Mixed)return f.$__schemaType;if(f.$__schemaType.schema!=null)return i(s.slice(u+1),f.$__schemaType.schema)}return f.$fullPath=n.join("."),f}}let a=t.split(".");for(let s=0;s<a.length;++s)(a[s]==="$"||IW(a[s]))&&(a[s]="0"),y3n.test(a[s])&&(a[s]="$");return i(a,e)};at.prototype._getPathType=function(t){let e=this;if(e.path(t))return"real";function n(i,a){let s=i.length+1,o,u;for(;s--;){if(u=i.slice(0,s).join("."),o=a.path(u),o)return o.embeddedSchemaType||o.Constructor?o.embeddedSchemaType instanceof tg.Mixed?{schema:o,pathType:"mixed"}:s!==i.length&&o.schema?i[s]==="$"||IW(i[s])?s===i.length-1?{schema:o,pathType:"nested"}:n(i.slice(s+1),o.schema):n(i.slice(s),o.schema):{schema:o,pathType:o.$isSingleNested?"nested":"array"}:{schema:o,pathType:"real"};if(s===i.length&&a.nested[u])return{schema:a,pathType:"nested"}}return{schema:o||a,pathType:"undefined"}}return n(t.split("."),e)};at.prototype._transformDuplicateKeyError=function(e){if(!this._duplicateKeyErrorMessagesByPath||e.code!==11e3&&e.code!==11001)return e;if(e.keyPattern!=null){let r=e.keyPattern,n=Object.keys(r);if(n.length!==1)return e;let i=n[0];return Object.hasOwn(this._duplicateKeyErrorMessagesByPath,i)?new eg(this._duplicateKeyErrorMessagesByPath[i],{cause:e}):e}return e};function IW(t){return t.startsWith("$[")&&t.endsWith("]")}at.prototype._preCompile=function(){this.plugin(o3n,{deduplicate:!0})};at.prototype.toJSONSchema=function(e){let r=e?.useBsonType??!1,n=r?{required:[],properties:{}}:{type:"object",required:[],properties:{}};for(let i of Object.keys(this.paths)){let a=this.paths[i];if(a._presplitPath.indexOf("$*")!==-1)continue;let s=a._presplitPath.length>1,o=n;if(s)for(let c=0;c<a._presplitPath.length-1;++c){let d=a._presplitPath[c];o.properties[d]==null&&(o.properties[d]=r?{bsonType:["object","null"],properties:{}}:{type:["object","null"],properties:{}}),o=o.properties[d]}let u=a._presplitPath[a._presplitPath.length-1],f=!1;i==="_id"?(o.required||(o.required=[]),o.required.push("_id"),f=!0):a.options.required&&typeof a.options.required!="function"&&(o.required||(o.required=[]),o.required.push(u),f=!0),o.properties[u]=a.toJSONSchema(e),a.options.enum&&(o.properties[u].enum=f?a.options.enum:[...a.options.enum,null])}return n.required.length===0&&delete n.required,n};WEt.exports=gAe=at;at.Types=tg=mR();gAe.ObjectId=tg.ObjectId});var vAe=l((SEa,GEt)=>{"use strict";var _3n=ml(),PW=class extends _3n{constructor(e,r,n,i){let a=e.map(s=>s.message).join(", ");a.length>200&&(a=a.slice(0,200)+"..."),super(`${i} failed with ${e.length} Mongoose validation errors: ${a}`),this.validationErrors=e,this.results=r,this.rawResult=n,this.operation=i}};Object.defineProperty(PW.prototype,"name",{value:"MongooseBulkWriteError"});GEt.exports=PW});var YEt=l((wEa,KEt)=>{"use strict";var E3n=Ir(),RW=class extends E3n{constructor(e,r){super(e),this.errors=r}};Object.defineProperty(RW.prototype,"name",{value:"SyncIndexesError"});KEt.exports=RW});var _Ae=l((AEa,JEt)=>{"use strict";JEt.exports=function t(e,r,n,i){if(e[i])return;if(e[i]=!0,!n?.skipTopLevel){let u=null;for(let f of r){let c=f[1]==null?null:f[1].tags;if(!Array.isArray(c)){e.plugin(f[0],f[1]);continue}u=u||new Set(e.options.pluginTags||[]),c.find(d=>u.has(d))&&e.plugin(f[0],f[1])}}if(n=Object.assign({},n),delete n.skipTopLevel,n.applyPluginsToChildSchemas!==!1)for(let u of Object.keys(e.paths)){let f=e.paths[u];f.schema!=null&&(t(f.schema,r,n,i),f.Constructor.prototype.$__setSchema(f.schema))}let a=e.discriminators;if(a==null)return;let s=n.applyPluginsToDiscriminators,o=Object.keys(a);for(let u of o){let f=a[u];t(f,r,{skipTopLevel:!s},i)}}});var qW=l((xEa,EAe)=>{"use strict";var ZEt=null;EAe.exports.get=function(){return ZEt};EAe.exports.set=function(t){ZEt=t}});var SAe=l((TEa,XEt)=>{"use strict";function S3n(){return{ok:1,nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[],writeErrors:[],insertedIds:[],writeConcernErrors:[]}}XEt.exports=S3n});var eSt=l((OEa,QEt)=>{"use strict";var w3n=Ir(),NW=class extends w3n{constructor(e,r){super(e),this.errors=r}};Object.defineProperty(NW.prototype,"name",{value:"CreateCollectionsError"});QEt.exports=NW});var nSt=l((CEa,rSt)=>{"use strict";var tSt=Tz().modifiedPaths;rSt.exports=function(e){let r=Object.keys(e),n={},i={};for(let a of r){if(a.startsWith("$")){tSt(e[a],"",n);continue}i[a]=e[a]}return tSt(i,"",n),n}});var wAe=l((IEa,iSt)=>{"use strict";var A3n=nSt();iSt.exports=function(e){if(e==null)return{};let r=A3n(e);return Object.keys(r).reduce((n,i)=>{let a=i.match(/\$\[[^\]]+\]/g);if(a==null)return n;for(let s of a){let o=i.indexOf(s);if(o!==i.lastIndexOf(s))throw new Error(`Path '${i}' contains the same array filter multiple times`);n[s.substring(2,s.length-1)]=i.substring(0,o-1).replace(/\$\[[^\]]+\]/g,"0")}return n},{})}});var oSt=l((MEa,sSt)=>{"use strict";var x3n=lR(),aSt=$a(),T3n=gc(),O3n=wAe();sSt.exports=function(e,r,n,i,a){let s=i.indexOf(".")===-1?[i]:i.split("."),o=null,u="adhocOrUndefined";n=n||{},r=r||{};let f=Array.isArray(a?.arrayFilters)?a.arrayFilters:[],c=O3n(r),d=0;for(let h=0;h<s.length;++h){let p=s.slice(d,h+1).join("."),m=x3n(p);if(o=e.path(m),o!=null&&(u=e.pathType(m),(o.$isSingleNested||o.$isMongooseDocumentArrayElement)&&o.schema.discriminators!=null)){let y=aSt(o,"schema.options.discriminatorKey"),b=m+"."+y,v=b.replace(/\.\d+\./,"."),E=null;b in n&&(E=n[b]),v in n&&(E=n[v]);let x=m.replace(/\.\d+$/,"");o.$isMongooseDocumentArrayElement&&aSt(n[x],"$elemMatch."+y)!=null&&(E=n[x].$elemMatch[y]);let w=p+"."+y;w in r&&(E=r[w]),b in r&&(E=r[b]);for(let k of Object.keys(c)){let R=c[k]+"."+y,U=k+"."+y;if(R===v){let F=f.find(V=>Object.hasOwn(V,U));F!=null&&(E=F[U])}}if(E==null)continue;let N=T3n(o.Constructor.discriminators,E)?.schema;if(N==null)continue;let P=s.slice(h+1).join(".");if(o=N.path(P),e=N,d=h+1,o!=null){u=N._getPathType(P);break}}}return{type:u,schematype:o}}});var fSt=l((PEa,uSt)=>{"use strict";var C3n=Gb();uSt.exports=function(e,r,n,i,a,s,o){if(!e?.options?.immutable)return!1;let u=e.options.immutable;if(typeof u=="function"&&(u=u.call(o,o)),!u||s?.overwriteImmutable||r===!1)return!1;if(r==="throw")throw new C3n(null,`Field ${a} is immutable and strict = 'throw'`);return delete n[i],!0}});var dSt=l((REa,cSt)=>{"use strict";var I3n=$a();cSt.exports=function(e,r,n){if(r==null)return;let i=Object.keys(r);for(let a of i){let s=a.startsWith("$");if(a==="$set"){let o=Object.keys(r[a]);for(let u of o)lSt(e,r[a],u,r,n)}else s||lSt(e,r,a,r,n)}};function lSt(t,e,r,n,i){let a=t.path(r);if(a==null)return;let s=I3n(a,"options.immutable",null);s!=null&&(typeof s=="function"&&(s=s.call(i,i)),s&&(n.$setOnInsert=n.$setOnInsert||{},n.$setOnInsert[r]=e[r],delete e[r]))}});var xAe=l((qEa,pSt)=>{"use strict";var AAe=av();pSt.exports=function(e,r,n){if(r.indexOf(".")===-1){if(AAe.has(r))return;e[r]=n;return}let i=r.split("."),a=i.pop(),s=e;for(let o of i)AAe.has(o)||(s[o]==null&&(s[o]={}),s=s[o]);AAe.has(a)||(s[a]=n)}});var PAe=l((NEa,ESt)=>{"use strict";var DW=Iu(),z9=Ir(),hSt=lAe(),mSt=Gb(),M3n=fv(),CAe=dR(),P3n=_v(),R3n=v0(),TAe=gc(),OAe=oSt(),ySt=fSt(),q3n=dSt(),vSt=lv().schemaMixedSymbol,N3n=xAe(),ky=zt(),{internalToObjectOptions:D3n}=i1(),IAe=new Set(["$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$bit"]);ESt.exports=function(e,r,n,i,a){if(r==null)return;if(n=n||{},Array.isArray(r)){let d=r.length;for(let h=0;h<d;++h){let p=Object.keys(r[h]);for(let m of p)r[h][m]=k3n(m,r[h][m])}return r}if(e!=null&&a!=null&&ky.hasUserDefinedProperty(a,e.options.discriminatorKey)&&typeof a[e.options.discriminatorKey]!="object"&&e.discriminators!=null){let d=a[e.options.discriminatorKey],h=TAe(i.model.discriminators,d);e=e.discriminators[d]||h?.schema||e}else if(e!=null&&n.overwriteDiscriminatorKey&&ky.hasUserDefinedProperty(r,e.options.discriminatorKey)&&e.discriminators!=null){let d=r[e.options.discriminatorKey],h=TAe(i.model.discriminators,d);e=e.discriminators[d]||h?.schema||e}else if(e!=null&&n.overwriteDiscriminatorKey&&r.$set!=null&&ky.hasUserDefinedProperty(r.$set,e.options.discriminatorKey)&&e.discriminators!=null){let d=r.$set[e.options.discriminatorKey],h=TAe(i.model.discriminators,d);e=e.discriminators[d]||h?.schema||e}n.upsert&&q3n(e,r,i);let s=Object.keys(r),o=s.length,u={},f,c=!1;for(a=a||{};o--;){let d=s[o];IAe.has(d)?d==="$set"&&u.$set||(u[d]=r[d]):(u.$set||(r.$set?u.$set=r.$set:u.$set={}),u.$set[d]=r[d],s.splice(o,1),~s.indexOf("$set")||s.push("$set"))}for(o=s.length;o--;){let d=s[o];if(f=u[d],c=c||d.startsWith("$"),f?.$__&&(f=f.toObject(D3n),u[d]=f),f&&typeof f=="object"&&!Buffer.isBuffer(f)&&IAe.has(d))_St(e,f,d,n,i,a);else{let h="Invalid atomic update value for "+d+". Expected an object, received "+typeof f;throw new Error(h)}d.startsWith("$")&&ky.isEmptyObject(f)&&delete u[d]}return ky.hasOwnKeys(u)===!1&&n.upsert&&ky.hasOwnKeys(a)?{$setOnInsert:{...a}}:u};function k3n(t,e){if(t==="$unset"){if(typeof e!="string"&&(!Array.isArray(e)||e.find(r=>typeof r!="string")))throw new z9("Invalid $unset in pipeline, must be a string or an array of strings");return e}if(t==="$project"){if(e==null||typeof e!="object")throw new z9("Invalid $project in pipeline, must be an object");return e}if(t==="$addFields"||t==="$set"){if(e==null||typeof e!="object")throw new z9("Invalid "+t+" in pipeline, must be an object");return e}else if(t==="$replaceRoot"||t==="$replaceWith"){if(e==null||typeof e!="object")throw new z9("Invalid "+t+" in pipeline, must be an object");return e}throw new z9('Invalid update pipeline operator: "'+t+'"')}function _St(t,e,r,n,i,a,s){let o=n.strict;s=s?s+".":"";let u=Object.keys(e),f=u.length,c=!1,d,h,p,m=null,y=o??t.options.strict;for(;f--;){if(h=u[f],p=e[h],r==="$pull"){if(d=t._getSchema(s+h),d==null){let v=OAe(t,e,a,s+h,n);v.schematype!=null&&(d=v.schematype)}if(d?.schema!=null){e[h]=P3n(d.schema,e[h],n,i),c=!0;continue}}let b=s?s+h:h;if(t.discriminatorMapping!=null&&b===t.options.discriminatorKey&&t.discriminatorMapping.value!==e[h]&&!n.overwriteDiscriminatorKey){if(y==="throw"){let v=new Error(`Can't modify discriminator key "`+b+'" on discriminator model');m=Tv(v,i,b,m);continue}else if(y){delete e[h];continue}}if(R3n(p)==="Object"){if(d=t._getSchema(s+h),d==null){let v=OAe(t,e,a,s+h,n);v.schematype!=null&&(d=v.schematype)}if(r!=="$setOnInsert"&&ySt(d,o,e,h,s+h,n,i))continue;if(d&&(d.embeddedSchemaType||d.Constructor)&&r in MAe)if("$each"in p){c=!0;try{e[h]={$each:H9(d,p.$each,r,h,i,s+h)}}catch(v){m=Tv(v,i,h,m)}p.$slice!=null&&(e[h].$slice=p.$slice|0),p.$sort&&(e[h].$sort=p.$sort),p.$position!=null&&(e[h].$position=CAe(p.$position))}else{if(d?.$isSingleNested){let v=o??d.schema.options.strict;try{e[h]=d.castForQuery(null,p,i,{strict:v})}catch(E){m=Tv(E,i,h,m)}}else try{e[h]=H9(d,p,r,h,i,s+h)}catch(v){m=Tv(v,i,h,m)}if(e[h]===void 0){delete e[h];continue}c=!0}else if(r==="$currentDate"||r in MAe&&d){try{e[h]=H9(d,p,r,h,i,s+h)}catch(v){m=Tv(v,i,h,m)}if(e[h]===void 0){delete e[h];continue}c=!0}else if(r==="$rename"){let v=new hSt(`${s}${h}.$rename`);try{e[h]=H9(v,p,r,h,i,s+h)}catch(E){m=Tv(E,i,h,m)}if(e[h]===void 0){delete e[h];continue}c=!0}else{let v=s+h,E=t._getPathType(v),x=o;if(E?.schema&&x==null&&(x=E.schema.options.strict),E.pathType==="undefined"){if(x==="throw")throw new mSt(v);if(x){delete e[h];continue}}c|=_St(t,p,r,n,i,a,s+h)||ky.isObject(p)&&ky.hasOwnKeys(p)===!1}}else{let v=h==="$each"||h==="$or"||h==="$and"||h==="$in";if(v&&!s)throw new z9('Invalid update: Unexpected modifier "'+h+'" as a key in operator. Did you mean something like { $addToSet: { fieldName: { $each: [...] } } }? Modifiers such as "$each", "$or", "$and", "$in" must appear under a valid field path.');let E=v?s:s+h;if(d=t._getSchema(E),r!=="$setOnInsert"&&ySt(d,o,e,h,s+h,n,i))continue;let x=t._getPathType(E);if(d==null){let N=OAe(t,e,a,E,n);N.schematype!=null&&(d=N.schematype,x=N.type)}let w=o;if(x?.schema&&o==null&&(w=x.schema.options.strict),w&&!d&&!/real|nested/.test(x.pathType)){if(w==="throw"&&t.virtuals[E]==null)throw new mSt(s+h);delete e[h]}else{if(r==="$rename"){if(e[h]==null)throw new DW("String",e[h],`${s}${h}.$rename`);let N=new hSt(`${s}${h}.$rename`,null,null,t);e[h]=N.castForQuery(null,e[h],i);continue}try{s.length===0||h.indexOf(".")===-1?e[h]=H9(d,p,r,h,i,s+h):(w!==!1||d!=null)&&(N3n(e,h,H9(d,p,r,h,i,s+h)),delete e[h])}catch(N){m=Tv(N,i,h,m)}if(Array.isArray(e[h])&&(r==="$addToSet"||r==="$push")&&h!=="$each"&&d&&d.embeddedSchemaType&&!d.embeddedSchemaType.$isMongooseArray&&!d.embeddedSchemaType[vSt]&&(e[h]={$each:e[h]}),e[h]===void 0){delete e[h];continue}c=!0}}}if(m!=null)throw m;return c}function Tv(t,e,r,n){if(typeof e!="object"||!e.options.multipleCastError)throw t;return n=n||new M3n,n.addError(r,t),n}var bSt={$pop:1,$inc:1},$3n={$unset:1},MAe={$push:1,$addToSet:1,$set:1,$setOnInsert:1};var gSt={$set:1,$setOnInsert:1};function H9(t,e,r,n,i,a){if(!t){if(r in bSt)try{return CAe(e)}catch{throw new DW("number",e,a)}return e}if(t.$isMongooseArray&&r in MAe&&(ky.isObject(e)||Array.isArray(e))&&!gSt[r]){let o=0,u=t;for(;u.$isMongooseArray;)++o,u=u.embeddedSchemaType;let f=0,c=e;for(;Array.isArray(c);)++f,c=c[0];let d=o-f;for(;f<o;)e=[e],++f;let h=t.applySetters(Array.isArray(e)?e:[e],i);for(let p=0;p<d;++p)h=h[0];return h}if(r in $3n)return e;if(r in bSt){if(e==null)throw new DW("number",e,t.path);if(r==="$inc")return t.castForQuery(null,e,i);try{return CAe(e)}catch{throw new DW("number",e,t.path)}}if(r==="$currentDate")return typeof e=="object"?{$type:e.$type}:!!e;if(IAe.has(n))return t.castForQuery(n,e,i);if(gSt[r]){let o=e!=null&&t.$isMongooseArray&&t.$fullPath!=null&&!t.$fullPath.match(/\d+$/),u=t[vSt]!=null;return o||u?t.applySetters(e,i):t.castForQuery(null,e,i)}return t.castForQuery(null,e,i)}});var RAe=l((DEa,SSt)=>{"use strict";SSt.exports=function(e,r,n){!n||!r?.upsert||(r.overwrite?MR(e,n)||(e[n]=0):!MR(e,n)&&!MR(e?.$set,n)&&!MR(e?.$inc,n)&&!MR(e?.$setOnInsert,n)&&(e.$setOnInsert||(e.$setOnInsert={}),e.$setOnInsert[n]=0))};function MR(t,e){return t==null||typeof t!="object"?!1:Object.hasOwn(t,e)}});var qAe=l((kEa,ASt)=>{"use strict";var B3n=$a();ASt.exports=function(t,e,r,n){n=n||{};let i=n.setDefaultsOnInsert??e.base.options.setDefaultsOnInsert;if(!n.upsert||i===!1)return r;let a=Object.keys(r||{}),s={},o={},u=a.length,f=!1;for(let h=0;h<u;++h)if(a[h].charAt(0)==="$"){f=!0;break}let c=Object.keys(t),d=c.length;for(let h=0;h<d;++h){let p=c[h],m=t[p];if(m&&typeof m=="object"){let y=Object.keys(m),b=y.length,v=!1;for(let E=0;E<b;++E)if(y[E].charAt(0)==="$"){v=!0;break}if(v)continue}s[p]=!0}return n?.overwrite&&!f||e.eachPath(function(h,p){if(p.path==="_id"&&p.options.auto)return;let m=p.getDefault(null,!0);if(typeof m>"u")return;let y=p.splitPath();y.includes("$*")||F3n(r,s,h,y,f)||(r=r||{},r.$setOnInsert=r.$setOnInsert||{},B3n(r,h)==null&&(r.$setOnInsert[h]=m),o[h]=m)}),r};function F3n(t,e,r,n,i){if(e[r])return!0;let a=n[0];for(let s=1;s<n.length;++s){if(e[a])return!0;a+="."+n[s]}if(i){for(let s in t)if(s.charAt(0)==="$"&&wSt(t[s],r,n))return!0}else if(wSt(t,r,n))return!0;return!1}function wSt(t,e,r){if(t==null||typeof t!="object")return!1;if(Object.hasOwn(t,e))return!0;let n=r[0];for(let a=1;a<r.length;++a){if(Object.hasOwn(t,n))return!0;n+="."+r[a]}let i=e+".";for(let a in t)if(a.startsWith(i))return!0;return!1}});var NAe=l(($Ea,ss)=>{"use strict";var L3n=Ir(),j3n=gc(),xSt=dwe(),TSt=pwe(),PR=_v(),OSt=PAe(),U3n=_a(),CSt=RAe(),{inspect:V3n}=fe("util"),ISt=qAe();ss.exports=function(e,r,n){let i=e.base.now();return r.insertOne?a=>ss.exports.castInsertOne(e,r.insertOne,n).then(()=>a(null),s=>a(s)):r.updateOne?a=>{try{ss.exports.castUpdateOne(e,r.updateOne,n,i),a(null)}catch(s){a(s)}}:r.updateMany?a=>{try{ss.exports.castUpdateMany(e,r.updateMany,n,i),a(null)}catch(s){a(s)}}:r.replaceOne?a=>{ss.exports.castReplaceOne(e,r.replaceOne,n).then(()=>a(null),s=>a(s))}:r.deleteOne?a=>{try{ss.exports.castDeleteOne(e,r.deleteOne),a(null)}catch(s){a(s)}}:r.deleteMany?a=>{try{ss.exports.castDeleteMany(e,r.deleteMany),a(null)}catch(s){a(s)}}:a=>{let s=new L3n(`Invalid op passed to \`bulkWrite()\`: ${V3n(r)}`);a(s,null)}};ss.exports.castInsertOne=async function(e,r,n){let i=W9(e,r.document),a=new i(r.document);i.schema.options.timestamps&&kW(r,n)&&a.initializeTimestamps(),n.session!=null&&a.$session(n.session);let s=i?.schema?.options?.versionKey;return s&&a[s]==null&&(a[s]=0),r.document=a,n.skipValidation||r.skipValidation||await r.document.$validate(),r};ss.exports.castUpdateOne=function(e,r,n,i){if(!r.filter)throw new Error("Must provide a filter object.");if(!r.update)throw new Error("Must provide an update object.");let a=W9(e,r.filter),s=a.schema,o=n.strict??a.schema.options.strict,u=U3n(r.update);RR(s,r.filter);let f=kW(r,n);if(a.schema.$timestamps!=null&&f){let h=a.schema.$timestamps.createdAt,p=a.schema.$timestamps.updatedAt;TSt(i,h,p,u,{timestamps:r.timestamps,overwriteImmutable:r.overwriteImmutable})}f&&xSt(i,u,a.schema);let c=e.base.options.setDefaultsOnInsert;return(r.setDefaultsOnInsert??c)!==!1&&ISt(r.filter,a.schema,u,{setDefaultsOnInsert:!0,upsert:r.upsert}),CSt(u,r,a.schema.options.versionKey),r.filter=PR(a.schema,r.filter,{strict:o,upsert:r.upsert}),r.update=OSt(a.schema,u,{strict:o,upsert:r.upsert,arrayFilters:r.arrayFilters,overwriteDiscriminatorKey:r.overwriteDiscriminatorKey,overwriteImmutable:r.overwriteImmutable},a,r.filter),r};ss.exports.castUpdateMany=function(e,r,n,i){if(!r.filter)throw new Error("Must provide a filter object.");if(!r.update)throw new Error("Must provide an update object.");let a=W9(e,r.filter),s=a.schema,o=n.strict??a.schema.options.strict,u=e.base.options.setDefaultsOnInsert;(r.setDefaultsOnInsert??u)!==!1&&ISt(r.filter,a.schema,r.update,{setDefaultsOnInsert:!0,upsert:r.upsert});let c=kW(r,n);if(a.schema.$timestamps!=null&&c){let d=a.schema.$timestamps.createdAt,h=a.schema.$timestamps.updatedAt;TSt(i,d,h,r.update,{timestamps:r.timestamps,overwriteImmutable:r.overwriteImmutable})}c&&xSt(i,r.update,a.schema),RR(s,r.filter),CSt(r.update,r,a.schema.options.versionKey),r.filter=PR(a.schema,r.filter,{strict:o,upsert:r.upsert}),r.update=OSt(a.schema,r.update,{strict:o,upsert:r.upsert,arrayFilters:r.arrayFilters,overwriteDiscriminatorKey:r.overwriteDiscriminatorKey,overwriteImmutable:r.overwriteImmutable},a,r.filter)};ss.exports.castReplaceOne=async function(e,r,n){let i=W9(e,r.filter),a=i.schema,s=n.strict??i.schema.options.strict;RR(a,r.filter),r.filter=PR(i.schema,r.filter,{strict:s,upsert:r.upsert});let o=new i(r.replacement,s,{skipId:!0});i.schema.options.timestamps&&kW(r,n)&&o.initializeTimestamps(),n.session!=null&&o.$session(n.session);let u=i?.schema?.options?.versionKey;if(u&&o[u]==null&&(o[u]=0),r.replacement=o,n.skipValidation||r.skipValidation){r.replacement=r.replacement.toBSON();return}await r.replacement.$validate(),r.replacement=r.replacement.toBSON()};ss.exports.castDeleteOne=function(e,r){let n=W9(e,r.filter),i=n.schema;RR(i,r.filter),r.filter=PR(n.schema,r.filter)};ss.exports.castDeleteMany=function(e,r){let n=W9(e,r.filter),i=n.schema;RR(i,r.filter),r.filter=PR(n.schema,r.filter)};ss.exports.cast={insertOne:ss.exports.castInsertOne,updateOne:ss.exports.castUpdateOne,updateMany:ss.exports.castUpdateMany,replaceOne:ss.exports.castReplaceOne,deleteOne:ss.exports.castDeleteOne,deleteMany:ss.exports.castDeleteMany};function RR(t,e){t!=null&&t.discriminatorMapping&&!t.discriminatorMapping.isRoot&&(e[t.discriminatorMapping.key]=t.discriminatorMapping.value)}function W9(t,e){let r=t.schema.options.discriminatorKey;return e!=null&&Object.hasOwn(e,r)&&(t=j3n(t.discriminators,e[r])||t),t}function kW(t,e){let r=t.timestamps,n=e.timestamps;return r??n??!0}});var DAe=l((BEa,MSt)=>{"use strict";MSt.exports=function(e,r,n){return e.mongoose=e.mongoose||{},e.mongoose.validationErrors=r,e.mongoose.results=n,e}});var FAe=l((FEa,NSt)=>{"use strict";var H3n=iSe(),$Ae=fe("events").EventEmitter,z3n=bv(),os=ZM(),PSt=vAe(),Fa=ml(),W3n=hSe(),G3n=YEt(),K3n=_Ae(),Y3n=_a(),J3n=qW(),Z3n=$a(),X3n=SAe(),RSt=Eb(),BAe=zt(),Q3n=eSt(),$W=NAe(),{modelSymbol:BW}=Mt(),evn=RSe(),kAe=DAe(),tvn=Mt().arrayAtomicsSymbol,qR=Mt().sessionNewDocuments,rvn=globalThis.Date,nvn=["MONGODB-X509"];function Ft(t){this.base=t,this.collections={},this.models={},this.config={},this.replica=!1,this.options=null,this.otherDbs=[],this.relatedDbs={},this.states=os,this._readyState=os.disconnected,this._closeCalled=!1,this._hasOpened=!1,this.plugins=[],typeof t>"u"||!t.connections.length?this.id=0:this.id=t.nextConnectionId,this._queue=[]}Object.setPrototypeOf(Ft.prototype,$Ae.prototype);Object.defineProperty(Ft.prototype,"readyState",{get:function(){return this._readyState===os.connected&&this._lastHeartbeatAt!=null&&this.client?.topology?.s?.description?.type!=="LoadBalanced"&&typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS=="number"&&rvn.now()-this._lastHeartbeatAt>=this.client.topology.s.description.heartbeatFrequencyMS*2?os.disconnected:this._readyState},set:function(t){if(!(t in os))throw new Error("Invalid connection state: "+t);if(this._readyState!==t){this._readyState=t;for(let e of this.otherDbs)e.readyState=t;os.connected===t&&(this._hasOpened=!0),this.emit(os[t])}}});Ft.prototype.get=function(e){return Object.hasOwn(this.config,e)?this.config[e]:Z3n(this.options,e)};Ft.prototype.set=function(e,r){return Object.hasOwn(this.config,e)?(this.config[e]=r,r):(this.options=this.options||{},this.options[e]=r,r)};Ft.prototype.collections;Ft.prototype.name;Ft.prototype.models;Ft.prototype.id;Object.defineProperty(Ft.prototype,"plugins",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(Ft.prototype,"host",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(Ft.prototype,"port",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(Ft.prototype,"user",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(Ft.prototype,"pass",{configurable:!0,enumerable:!0,writable:!0});Ft.prototype.db;Ft.prototype.client;Ft.prototype.config;Ft.prototype.createCollection=async function(e,r){if(typeof r=="function"||arguments.length>=3&&typeof arguments[2]=="function")throw new Fa("Connection.prototype.createCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.createCollection(e,r)};Ft.prototype.bulkWrite=async function(e,r){await this._waitForConnect(),r=r||{};let n=r.ordered==null?!0:r.ordered,i=this.base.transactionAsyncLocalStorage?.getStore();(!r||!Object.hasOwn(r,"session"))&&i?.session!=null&&(r={...r,session:i.session});let a=this.base.now(),s=null;if(n){let o=[];for(let u of e){if(typeof u.model!="string"&&!u.model?.[BW])throw new Fa("Must specify model in Connection.prototype.bulkWrite() operations");let f=u.model[BW]?u.model:this.model(u.model);if(u.name==null)throw new Fa("Must specify operation name in Connection.prototype.bulkWrite()");if(!Object.hasOwn($W.cast,u.name))throw new Fa(`Unrecognized bulkWrite() operation name ${u.name}`);await $W.cast[u.name](f,u,r,a),o.push({...u,namespace:f.namespace()})}s=await this.client.bulkWrite(o,r)}else{let o=[],u=[],f=[],c=[],d=[];for(let p=0;p<e.length;++p){let m=e[p];if(typeof m.model!="string"&&!m.model?.[BW]){let v=new Fa("Must specify model in Connection.prototype.bulkWrite() operations");f.push({index:p,error:v}),d[p]=v;continue}let y;try{y=m.model[BW]?m.model:this.model(m.model)}catch(v){f.push({index:p,error:v});continue}if(m.name==null){let v=new Fa("Must specify operation name in Connection.prototype.bulkWrite()");f.push({index:p,error:v}),d[p]=v;continue}if(!Object.hasOwn($W.cast,m.name)){let v=new Fa(`Unrecognized bulkWrite() operation name ${m.name}`);f.push({index:p,error:v}),d[p]=v;continue}let b=null;try{b=$W.cast[m.name](y,m,r,a)}catch(v){f.push({index:p,error:v}),d[p]=v;continue}evn(b)?c.push(b.then(()=>{o.push({...m,namespace:y.namespace()}),u.push(p)},v=>{f.push({index:p,error:v}),d[p]=v})):(o.push({...m,namespace:y.namespace()}),u.push(p))}if(c.length>0&&await Promise.all(c),f=f.sort((p,m)=>p.index-m.index).map(p=>p.error),o.length===0){if(r.throwOnValidationError&&f.length)throw new PSt(f,d,m,"bulkWrite");let p=this.base.driver.get().BulkWriteResult,m=new p(X3n(),!1);return kAe(m,f,d)}let h;[s,h]=await this.client.bulkWrite(o,r).then(p=>[p,null]).catch(p=>[null,p]);for(let p=0;p<u.length;++p)d[u[p]]=null;if(h&&f.length>0&&(kAe(h,f,d),h.mongoose=h.mongoose||{},h.mongoose.validationErrors=f),f.length>0){if(r.throwOnValidationError)throw new PSt(f,d,s,"bulkWrite");kAe(s,f,d)}}return s};Ft.prototype.createCollections=async function(e={}){let r={},n={},{continueOnError:i}=e;delete e.continueOnError;for(let a of Object.values(this.models))try{r[a.modelName]=await a.createCollection({})}catch(s){if(i)r[a.modelName]=s;else{n[a.modelName]=s;break}}if(!i&&BAe.hasOwnKeys(n)){let a=Object.entries(n).map(([o,u])=>`${o}: ${u.message}`).join(", ");throw new Q3n(a,n)}return r};Ft.prototype.withSession=async function(e){if(arguments.length===0)throw new Error("Please provide an executor function");return await this.client.withSession(e)};Ft.prototype.startSession=async function(e){if(arguments.length>=2&&typeof arguments[1]=="function")throw new Fa("Connection.prototype.startSession() no longer accepts a callback");return await this._waitForConnect(),this.client.startSession(e)};Ft.prototype.transaction=function(e,r){return this.startSession().then(n=>(n[qR]=new Map,n.withTransaction(()=>ivn(e,n,this.base),r).then(i=>(delete n[qR],i)).catch(i=>{throw delete n[qR],i}).finally(()=>{n.endSession().catch(()=>{})})))};async function ivn(t,e,r){try{return r.transactionAsyncLocalStorage==null?await t(e):await new Promise(i=>{r.transactionAsyncLocalStorage.run({session:e},()=>i(t(e)))})}catch(n){throw avn(e),n}}function avn(t){for(let e of t[qR].keys()){let r=t[qR].get(e);Object.hasOwn(r,"isNew")&&(e.$isNew=r.isNew),Object.hasOwn(r,"versionKey")&&e.set(e.schema.options.versionKey,r.versionKey),r.modifiedPaths.length>0&&e.$__.activePaths.states.modify==null&&(e.$__.activePaths.states.modify={});for(let n of r.modifiedPaths){let i=e.$__.activePaths.paths[n];i!=null&&delete e.$__.activePaths[i][n],e.$__.activePaths.paths[n]="modify",e.$__.activePaths.states.modify[n]=!0}for(let n of r.atomics.keys()){let i=e.$__getValue(n);i!=null&&(i[tvn]=r.atomics.get(n))}}}Ft.prototype.dropCollection=async function(e){if(arguments.length>=2&&typeof arguments[1]=="function")throw new Fa("Connection.prototype.dropCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.dropCollection(e)};Ft.prototype._waitForConnect=async function(e){if((this.readyState===os.connecting||this.readyState===os.disconnected)&&this._shouldBufferCommands()){let r=this._getBufferTimeoutMS(),n=null,i=!1,a={},s=new Promise(o=>{a.fn=o,this._queue.push(a)});if(e?await s:await Promise.race([s,new Promise(o=>{n=setTimeout(()=>{i=!0,o()},r)})]),i){let o=this._queue.indexOf(a);o!==-1&&this._queue.splice(o,1);let u="Connection operation buffering timed out after "+r+"ms";throw new Fa(u)}else n!=null&&clearTimeout(n)}};Ft.prototype._getBufferTimeoutMS=function(){return this.config.bufferTimeoutMS!=null?this.config.bufferTimeoutMS:this.base?.get("bufferTimeoutMS")!=null?this.base.get("bufferTimeoutMS"):1e4};Ft.prototype.listCollections=async function(){return await this._waitForConnect(),await this.db.listCollections().toArray()};Ft.prototype.listDatabases=async function(){throw new Fa("listDatabases() not implemented by driver")};Ft.prototype.dropDatabase=async function(){if(arguments.length>=1&&typeof arguments[0]=="function")throw new Fa("Connection.prototype.dropDatabase() no longer accepts a callback");await this._waitForConnect();for(let e of Object.values(this.models))delete e.$init;return this.db.dropDatabase()};Ft.prototype._shouldBufferCommands=function(){return this.config.bufferCommands!=null?this.config.bufferCommands:this.base.get("bufferCommands")!=null?this.base.get("bufferCommands"):!0};Ft.prototype.error=function(e,r){return r?(r(e),null):(this.listeners("error").length>0&&this.emit("error",e),Promise.reject(e))};Ft.prototype.onOpen=function(){this.readyState=os.connected;for(let t of this._queue)t.fn.apply(t.ctx,t.args);this._queue=[];for(let t in this.collections)Object.hasOwn(this.collections,t)&&this.collections[t].onOpen();this.emit("open")};Ft.prototype.openUri=async function(e,r){if((this.readyState===os.connecting||this.readyState===os.connected)&&this._connectionString===e)return this;this._closeCalled=!1;let n=!1;r&&"_fireAndForget"in r&&(n=r._fireAndForget,delete r._fireAndForget);try{svn.apply(arguments)}catch(i){throw n||(this.$initialConnection=Promise.reject(i)),i}this.$initialConnection=this.createClient(e,r).then(()=>this).catch(i=>{throw this.readyState=os.disconnected,this.listeners("error").length>0&&RSt(()=>this.emit("error",i)),i});for(let i of Object.values(this.models))i.init().catch(function(){});if(n)return this;try{await this.$initialConnection}catch(i){throw qSt(i)}return this};Ft.prototype.on=function(e,r){return e==="error"&&this.$initialConnection&&this.$initialConnection.catch(()=>{}),$Ae.prototype.on.call(this,e,r)};Ft.prototype.once=function(e,r){return e==="error"&&this.$initialConnection&&this.$initialConnection.catch(()=>{}),$Ae.prototype.once.call(this,e,r)};function svn(t,e,r){if(typeof e=="function"&&r==null)throw new Fa("Connection.prototype.openUri() no longer accepts a callback");if(typeof r=="function")throw new Fa("Connection.prototype.openUri() no longer accepts a callback")}function qSt(t){if(t?.name==="MongoServerSelectionError"){let e=t;t=new W3n,t.assimilateError(e)}return t}Ft.prototype.destroy=async function(e){if(typeof e=="function"||arguments.length===2&&typeof arguments[1]=="function")throw new Fa("Connection.prototype.destroy() no longer accepts a callback");return e!=null&&typeof e=="object"?this.$wasForceClosed=!!e.force:this.$wasForceClosed=!!e,this._close(e,!0)};Ft.prototype.close=async function(e){if(typeof e=="function"||arguments.length===2&&typeof arguments[1]=="function")throw new Fa("Connection.prototype.close() no longer accepts a callback");e!=null&&typeof e=="object"?this.$wasForceClosed=!!e.force:this.$wasForceClosed=!!e,this._lastHeartbeatAt!=null&&(this._lastHeartbeatAt=null);for(let r of Object.values(this.models))delete r.$init;return this._close(e,!1)};Ft.prototype._close=async function(e,r){let n=this,i=this._closeCalled;this._closeCalled=!0,this._destroyCalled=r,this.client!=null&&(this.client._closeCalled=!0,this.client._destroyCalled=r);let a=this;switch(this.readyState){case os.disconnected:if(r){let s=this.base.connections.indexOf(a);s!==-1&&this.base.connections.splice(s,1)}i||(await this.doClose(e),this.onClose(e));break;case os.connected:if(this.readyState=os.disconnecting,await this.doClose(e),r){let s=n.base.connections.indexOf(a);s!==-1&&this.base.connections.splice(s,1)}this.onClose(e);break;case os.connecting:return new Promise((s,o)=>{let u=()=>{this.removeListener("open",u),this.removeListener("error",u),r?this.destroy(e).then(s,o):this.close(e).then(s,o)};this.once("open",u),this.once("error",u)});case os.disconnecting:return new Promise(s=>{this.once("close",()=>{r&&this.base.connections.indexOf(a)!==-1&&this.base.connections.splice(this.base.connections.indexOf(a),1),s()})})}return this};Ft.prototype.doClose=function(){throw new Error("Connection#doClose unimplemented by driver")};Ft.prototype.onClose=function(e){this.readyState=os.disconnected;for(let n in this.collections)Object.hasOwn(this.collections,n)&&this.collections[n].onClose(e);this.emit("close",e);let r=typeof e=="object"&&e!==null?e.force:e;for(let n of this.otherDbs)this._destroyCalled?n.destroy({force:r,skipCloseClient:!0}):n.close({force:r,skipCloseClient:!0})};Ft.prototype.collection=function(t,e){let r={autoIndex:this.config.autoIndex??this.base.options.autoIndex,autoCreate:this.config.autoCreate??this.base.options.autoCreate,autoSearchIndex:this.config.autoSearchIndex??this.base.options.autoSearchIndex};e=Object.assign({},r,e?Y3n(e):{}),e.$wasForceClosed=this.$wasForceClosed;let n=this.base?.__driver?.Collection||J3n.get().Collection;return t in this.collections||(this.collections[t]=new n(t,this,e)),this.collections[t]};Ft.prototype.plugin=function(t,e){return this.plugins.push([t,e]),this};Ft.prototype.model=function(e,r,n,i){if(!(this instanceof Ft))throw new Fa("`connection.model()` should not be run with `new`. If you are doing `new db.model(foo)(bar)`, use `db.model(foo)(bar)` instead");let a;if(typeof e=="function"&&(a=e,e=a.name),typeof r=="string"&&(n=r,r=!1),BAe.isObject(r)&&(r.instanceOfSchema?r instanceof this.base.Schema||(r=r._clone(this.base.Schema)):r=new z3n(r)),r&&!r.instanceOfSchema)throw new Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");let s={cache:!1,overwriteModels:this.base.options.overwriteModels},o=Object.assign(s,i,{connection:this});if(this.models[e]&&!n&&o.overwriteModels!==!0){if(r?.instanceOfSchema&&r!==this.models[e].schema)throw new Fa.OverwriteModelError(e);return this.models[e]}let u;if(r?.instanceOfSchema)return K3n(r,this.plugins,null,"$connectionPluginsApplied"),u=this.base._model(a||e,r,n,o),this.models[e]||(this.models[e]=u),u.init().catch(function(){}),u;if(this.models[e]&&n)return u=this.models[e],r=u.prototype.schema,u.__subclass(this,r,n);if(arguments.length===1){if(u=this.models[e],!u)throw new Fa.MissingSchemaError(e);return u}if(!u)throw new Fa.MissingSchemaError(e);return this===u.prototype.db&&(!n||n===u.collection.name)?(this.models[e]||(this.models[e]=u),u):(this.models[e]=u.__subclass(this,r,n),this.models[e])};Ft.prototype.deleteModel=function(e){if(typeof e=="string"){let r=this.model(e);if(r==null)return this;let n=r.collection.name;delete this.models[e],delete this.collections[n],this.emit("deleteModel",r)}else if(e instanceof RegExp){let r=e,n=this.modelNames();for(let i of n)r.test(i)&&this.deleteModel(i)}else throw new Error('First parameter to `deleteModel()` must be a string or regexp, got "'+e+'"');return this};Ft.prototype.watch=function(e,r){let n=a=>{RSt(()=>{if(this.readyState===os.connecting)this.once("open",function(){let s=this.db.watch(e,r);a(null,s)});else{let s=this.db.watch(e,r);a(null,s)}})};return new H3n(n,e,r)};Ft.prototype.asPromise=async function(){try{return await this.$initialConnection,this}catch(e){throw qSt(e)}};Ft.prototype.modelNames=function(){return Object.keys(this.models)};Ft.prototype.shouldAuthenticate=function(){return this.user!=null&&(this.pass!=null||this.authMechanismDoesNotRequirePassword())};Ft.prototype.authMechanismDoesNotRequirePassword=function(){return this.options?.auth?nvn.indexOf(this.options.auth.authMechanism)>=0:!0};Ft.prototype.optionsProvideAuthenticationData=function(e){return e&&e.user&&(e.pass||this.authMechanismDoesNotRequirePassword())};Ft.prototype.getClient=function(){return this.client};Ft.prototype.setClient=function(){throw new Fa("Connection#setClient not implemented by driver")};Ft.prototype.createClient=function(){throw new Fa("Connection#createClient not implemented by driver")};Ft.prototype.syncIndexes=async function(e={}){let r={},n={},{continueOnError:i}=e;delete e.continueOnError;for(let a of Object.values(this.models))try{r[a.modelName]=await a.syncIndexes(e)}catch(s){if(i)r[a.modelName]=s;else{n[a.modelName]=s;break}}if(!i&&BAe.hasOwnKeys(n)){let a=Object.entries(n).map(([o,u])=>`${o}: ${u.message}`).join(", ");throw new G3n(a,n)}return r};Ft.STATES=os;NSt.exports=Ft});var LAe=l((LEa,ovn)=>{ovn.exports={name:"mongoose",description:"Mongoose MongoDB ODM",version:"9.1.5",author:"Guillermo Rauch <guillermo@learnboost.com>",keywords:["mongodb","document","model","schema","database","odm","data","datastore","query","nosql","orm","db"],type:"commonjs",license:"MIT",dependencies:{kareem:"3.0.0",mongodb:"~7.0",mpath:"0.9.0",mquery:"6.0.0",ms:"2.1.3",sift:"17.1.3"},devDependencies:{"@ark/attest":"0.56.0","@mongodb-js/mongodb-downloader":"^1.0.0",acquit:"1.4.0","acquit-ignore":"0.2.1","acquit-require":"0.1.1",ajv:"8.17.1","broken-link-checker":"^0.7.8",cheerio:"1.1.2",dox:"1.0.0",eslint:"9.39.2","eslint-plugin-markdown":"^5.1.0","eslint-plugin-mocha-no-only":"1.2.0",express:"^4.19.2","fs-extra":"~11.3.0","highlight.js":"11.11.1","lodash.isequal":"4.5.0","lodash.isequalwith":"4.4.0","markdownlint-cli2":"^0.20.0",marked:"15.x",mkdirp:"^3.0.1",mocha:"11.7.5",moment:"2.30.1","mongodb-memory-server":"11.0.1","mongodb-runner":"^6.0.0","mongodb-client-encryption":"~7.0",ncp:"^2.0.0",nyc:"15.1.0",pug:"3.0.3",sinon:"21.0.1",tsd:"0.33.0",typescript:"5.9.3","typescript-eslint":"^8.31.1",uuid:"11.1.0"},directories:{lib:"./lib/mongoose"},scripts:{"docs:clean":"npm run docs:clean:stable","docs:clean:stable":"rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:clean:5x":"rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:clean:6x":"rimraf index.html && rimraf -rf ./docs/6.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:copy:tmp":"mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && mkdirp ./tmp/docs/api && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/","docs:copy:tmp:5x":"rimraf ./docs/5.x && ncp ./tmp ./docs/5.x","docs:copy:tmp:6x":"rimraf ./docs/6.x && ncp ./tmp ./docs/6.x","docs:generate":"node ./scripts/website.js","docs:generate:sponsorData":"node ./scripts/loadSponsorData.js","docs:test":"npm run docs:generate","docs:view":"node ./scripts/static.js","docs:prepare:publish:stable":"git checkout gh-pages && git merge master && npm run docs:generate","docs:prepare:publish:5x":"git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x","docs:prepare:publish:6x":"git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x","docs:prepare:publish:7x":"env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/7.x && mv ./tmp ./docs/7.x","docs:prepare:publish:8x":"env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/8.x && mv ./tmp ./docs/8.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"',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","create-separate-require-instance":"rm -rf ./node_modules/mongoose-separate-require-instance && node ./scripts/create-tarball && tar -xzf mongoose.tgz -C ./node_modules && mv ./node_modules/package ./node_modules/mongoose-separate-require-instance",test:"mocha --exit ./test/*.test.js","test:ci":"npm run test -- --reporter min","test-deno":"deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.mjs","test-deno:ci":"npm run test-deno -- --reporter min","test-rs":"START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js","test-rs:ci":"npm run test-rs -- --reporter min","test-tsd":"node ./test/types/check-types-filename && tsd --full","setup-test-encryption":"node scripts/setup-encryption-tests.js","test-encryption":"mocha --exit ./test/encryption/*.test.js","test-encryption:ci":"npm run test-encryption -- --reporter min",tdd:"mocha --watch --inspect --recursive ./test/*.test.js --watch-files lib/**/*.js test/**/*.js","test-coverage":"nyc --reporter=html --reporter=text npm test","test-coverage:ci":"nyc --reporter=html --reporter=text npm run test:ci","ts-benchmark":"cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check","ts-benchmark:local":"node ./scripts/create-tarball && cd ./benchmarks/typescript/simple && rm -rf ./node_modules && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check","attest-benchmark":"node ./benchmarks/typescript/infer.bench.mts"},main:"./index.js",types:"./types/index.d.ts",engines:{node:">=20.19.0"},bugs:{url:"https://github.com/Automattic/mongoose/issues/new"},repository:{type:"git",url:"git://github.com/Automattic/mongoose.git"},homepage:"https://mongoosejs.com",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:"ES2022"}}}});var kSt=l((jEa,DSt)=>{"use strict";var uvn=_a(),fvn=ml();function lvn(t,e){let r=e||{},n=r.readPreference?r.readPreference:hvn(t),i=uvn(r);return n&&n!=="primary"&&n!=="primaryPreferred"?cvn(n,i):i}function cvn(t,e){if(dvn(e)&&pvn(t))yvn();else return mvn(e)}function dvn(t){let e=t.config?.autoIndex,{autoCreate:r,autoIndex:n}=t;return!!(e||r||n)}function pvn(t){return t==="secondary"||t==="secondaryPreferred"}function hvn(t){let r=/(?:&|\?)readPreference=(\w+)(?:&|$)/.exec(t);return r?r[1]:null}function mvn(t){return t.config={autoIndex:!1},t.autoCreate=!1,t.autoIndex=!1,t}function yvn(){throw new fvn('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')}DSt.exports=lvn});var BSt=l($St=>{"use strict";$St.setTimeout=setTimeout});var USt=l((VEa,jSt)=>{"use strict";var FSt=FAe(),Ov=ml(),pf=ZM(),LSt=Ob(),bvn=LAe(),gvn=kSt(),vvn=BSt().setTimeout,NR=zt(),_vn=bv();function c1(){FSt.apply(this,arguments),this._listening=!1,this._lastHeartbeatAt=null}c1.STATES=pf;Object.setPrototypeOf(c1.prototype,FSt.prototype);c1.prototype.useDb=function(t,e){if(e=e||{},e.useCache&&this.relatedDbs[t])return this.relatedDbs[t];let r=new this.constructor;r.name=t,r.base=this.base,r.collections={},r.models={},r.replica=this.replica,r.config=Object.assign({},this.config,r.config),r.name=this.name,r.options=this.options,r._readyState=this._readyState,r._closeCalled=this._closeCalled,r._hasOpened=this._hasOpened,r._listening=!1,r._parent=this,r.host=this.host,r.port=this.port,r.user=this.user,r.pass=this.pass;let n=this;r.client=n.client,this.db&&this._readyState===pf.connected?i():this._queue.push({fn:i});function i(){r.client=n.client,r.db=n.client.db(t),r._lastHeartbeatAt=n._lastHeartbeatAt,r.onOpen()}return r.name=t,this.otherDbs.push(r),r.otherDbs.push(this),e?.useCache&&(this.relatedDbs[r.name]=r,r.relatedDbs=this.relatedDbs),r};c1.prototype.aggregate=function(e,r){return new this.base.Aggregate(null,this).append(e).option(r??{})};c1.prototype.removeDb=function(e){let r=this.otherDbs.filter(n=>n.name===e);if(!r.length)throw new Ov(`No connections to database "${e}" found`);for(let n of r)n._closeCalled=!0,n._destroyCalled=!0,n._readyState=pf.disconnected,n.$wasForceClosed=!0;delete this.relatedDbs[e],this.otherDbs=this.otherDbs.filter(n=>n.name!==e)};c1.prototype.doClose=async function(e){if(this.client==null)return this;let r=!1;return e!=null&&typeof e=="object"&&(r=e.skipCloseClient,e=e.force),r?this:(await this.client.close(e),await new Promise(n=>vvn(n,1)),this)};c1.prototype.listDatabases=async function(){return await this._waitForConnect(),await this.db.admin().listDatabases()};c1.prototype.createClient=async function(e,r){if(typeof e!="string")throw new Ov(`The \`uri\` parameter to \`openUri()\` must be a string, got "${typeof e}". Make sure the first parameter to \`mongoose.connect()\` or \`mongoose.createConnection()\` is a string.`);if(this._destroyCalled)throw new Ov("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===pf.connecting||this.readyState===pf.connected)&&this._connectionString!==e)throw new Ov("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(r=gvn(e,r),r){let o=r.config?.autoIndex??r.autoIndex;o!=null&&(this.config.autoIndex=o!==!1,delete r.config,delete r.autoIndex),"autoCreate"in r&&(this.config.autoCreate=!!r.autoCreate,delete r.autoCreate),"sanitizeFilter"in r&&(this.config.sanitizeFilter=r.sanitizeFilter,delete r.sanitizeFilter),"autoSearchIndex"in r&&(this.config.autoSearchIndex=r.autoSearchIndex,delete r.autoSearchIndex),"bufferTimeoutMS"in r&&(this.config.bufferTimeoutMS=r.bufferTimeoutMS,delete r.bufferTimeoutMS),(r.user||r.pass)&&(r.auth=r.auth||{},r.auth.username=r.user,r.auth.password=r.pass,this.user=r.user,this.pass=r.pass),delete r.user,delete r.pass,r.bufferCommands!=null&&(this.config.bufferCommands=r.bufferCommands,delete r.bufferCommands)}else r={};this._connectionOptions=r;let n=r.dbName;n!=null&&(this.$dbName=n),delete r.dbName,NR.hasUserDefinedProperty(r,"driverInfo")||(r.driverInfo={name:"Mongoose",version:bvn.version});let{schemaMap:i,encryptedFieldsMap:a}=this._buildEncryptionSchemas();if((NR.hasOwnKeys(i)||NR.hasOwnKeys(a))&&!r.autoEncryption)throw new Error("Must provide `autoEncryption` when connecting with encrypted schemas.");NR.hasOwnKeys(i)&&(r.autoEncryption.schemaMap=i),NR.hasOwnKeys(a)&&(r.autoEncryption.encryptedFieldsMap=a),this.readyState=pf.connecting,this._connectionString=e;let s;try{s=new LSt.MongoClient(e,r)}catch(o){throw this.readyState=pf.disconnected,o}this.client=s,s.setMaxListeners(0),await s.connect(),jAe(this,s,r,n);for(let o of this.otherDbs)jAe(o,s,{},o.name);return this};c1.prototype._buildEncryptionSchemas=function(){let t={},e={},r=Object.values(this.models).filter(a=>a.schema._hasEncryptedFields());for(let a of r){let{schema:s,collection:{collectionName:o}}=a,u=`${this.$dbName}.${o}`,f=s.encryptionType()==="csfle"?e:t;if(f[u]??=new _vn({},{encryptionType:s.encryptionType()}),s.discriminatorMapping&&!s.discriminatorMapping.isRoot){let d=s._baseSchema;s.eachPath(h=>{if(!d.path(h)&&f[u]._hasEncryptedField(h))throw new Error(`Cannot have duplicate keys in discriminators with encryption. key=${h}`)})}f[u].add(s)}let n=Object.fromEntries(Object.entries(e).map(([a,s])=>[a,s._buildSchemaMap()])),i=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,s._buildEncryptedFields()]));return{schemaMap:n,encryptedFieldsMap:i}};c1.prototype.setClient=function(e){if(!(e instanceof LSt.MongoClient))throw new Ov("Must call `setClient()` with an instance of MongoClient");if(this.readyState!==pf.disconnected)throw new Ov("Cannot call `setClient()` on a connection that is already connected.");if(e.topology==null)throw new Ov("Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.");this._connectionString=e.s.url,jAe(this,e,{},e.s.options.dbName);for(let r of Object.values(this.models))r.init().catch(function(){});return this};function jAe(t,e,r,n){let i=n!=null?e.db(n):e.db();t.db=i,t.client=e,t.host=e?.s?.options?.hosts?.[0]?.host,t.port=e?.s?.options?.hosts?.[0]?.port,t.name=n??i.databaseName,t._closeCalled=e._closeCalled;let a=()=>{t.readyState!==pf.connected&&(t.readyState=pf.connected,t.emit("reconnect"),t.emit("reconnected"),t.onOpen())},s=e?.topology?.description?.type||"";s==="Single"?e.on("serverDescriptionChanged",o=>{o.newDescription.type==="Unknown"?t.readyState=pf.disconnected:a()}):s.startsWith("ReplicaSet")&&e.on("topologyDescriptionChanged",o=>{let u=o.newDescription;t.readyState===pf.connected&&u.type!=="ReplicaSetWithPrimary"?t.readyState=pf.disconnected:t.readyState===pf.disconnected&&u.type==="ReplicaSetWithPrimary"&&a()}),t._lastHeartbeatAt=null,e.on("serverHeartbeatSucceeded",()=>{t._lastHeartbeatAt=Date.now();for(let o of t.otherDbs)o._lastHeartbeatAt=t._lastHeartbeatAt}),r.monitorCommands&&(e.on("commandStarted",o=>t.emit("commandStarted",o)),e.on("commandFailed",o=>t.emit("commandFailed",o)),e.on("commandSucceeded",o=>t.emit("commandSucceeded",o))),t.onOpen();for(let o in t.collections)Object.hasOwn(t.collections,o)&&t.collections[o].onOpen()}jSt.exports=c1});var VSt=l(DR=>{"use strict";DR.BulkWriteResult=c6t();DR.Collection=rvt();DR.Connection=USt();DR.ClientEncryption=Ob().ClientEncryption});var zSt=l((zEa,HSt)=>{"use strict";var Evn=Object.freeze(["allowDiskUse","applyPluginsToChildSchemas","applyPluginsToDiscriminators","autoCreate","autoIndex","autoSearchIndex","bufferCommands","bufferTimeoutMS","cloneSchemas","createInitialConnection","debug","forceRepopulate","id","maxTimeMS","objectIdGetter","overwriteModels","returnOriginal","runValidators","sanitizeFilter","sanitizeProjection","selectPopulatedPaths","setDefaultsOnInsert","strict","strictPopulate","strictQuery","timestamps.createdAt.immutable","toJSON","toObject","transactionAsyncLocalStorage","translateAliases","updatePipeline"]);HSt.exports=Evn});var GSt=l((WEa,WSt)=>{"use strict";var Svn=Ir(),FW=class extends Svn{constructor(e){let r=e.map(n=>n.message).join(", ");r.length>50&&(r=r.slice(0,50)+"..."),super(`eachAsync() finished with ${e.length} errors: ${r}`),this.errors=e}};Object.defineProperty(FW.prototype,"name",{value:"EachAsyncMultiError"});WSt.exports=FW});var VAe=l((GEa,YSt)=>{"use strict";var wvn=GSt(),UAe=Eb();YSt.exports=async function(e,r,n){let i=n.parallel||1,a=n.batchSize,s=n.signal,o=n.continueOnError,u=[],f=Avn(),c=!1;return new Promise((p,m)=>{if(s!=null){if(s.aborted)return p(null);s.addEventListener("abort",()=>(c=!0,p(null)),{once:!0})}if(a!=null){if(typeof a!="number")throw new TypeError("batchSize must be a number");if(Number.isInteger(a)){if(a<1)throw new TypeError("batchSize must be at least 1")}else throw new TypeError("batchSize must be an integer")}d((y,b)=>{if(y!=null)return m(y);p(b)})});function d(p){let m=0,y=0,b=null;for(let E=0;E<i;++E)f(v());function v(){let E=[],x=!1;return w;function w(M){if(x||c)return M();if(b)return M();e(function(N,P){if(b!=null)return M();if(N!=null)if(N.name==="MongoCursorExhaustedError")P=null;else if(o)u.push(N);else return b=N,p(N),M();if(P==null){if(x=!0,m<=0){let U=o?KSt(u):b;p(U)}else a&&E.length&&h(E,y++,R);return M()}if(++m,UAe(()=>M()),a&&E.push(P),a&&E.length!==a){UAe(()=>f(w));return}let k=a?E:P;function R(U){if(a?(m-=E.length,E=[]):--m,U!=null)if(o)u.push(U);else return b=U,p(U);if((x||c)&&m<=0){let F=o?KSt(u):b;return p(F)}UAe(()=>f(w))}h(k,y++,R)})}}}function h(p,m,y){let b;try{b=r(p,m)}catch(v){return y(v)}typeof b?.then=="function"?b.then(function(){y(null)},function(v){y(v||new Error("`eachAsync()` promise rejected without error"))}):y(null)}};function Avn(){let t=[],e=null,r=0;return function(a){if(e===null&&t.length===0)return e=r++,a(n);t.push(a)};function n(){t.length!==0?(e=r++,t.shift()(n)):e=null}}function KSt(t){return t.length===0?null:new wvn(t)}});var nwt=l((KEa,rwt)=>{"use strict";var kR=Ir(),XSt=fe("stream").Readable,xvn=VAe(),QSt=rR(),Tvn=ov(),HAe=Eb(),{once:Ovn}=fe("events"),ewt=fe("util");function hf(t){XSt.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this.skipped=!1,this.query=t,this._closed=!1;let e=t.model;this._mongooseOptions={},this._transforms=[],this.model=e,this.options={};let r=n=>{if(n!=null){if(n instanceof Tvn.skipWrappedFunction){let i=n.args[0];if(i!=null&&(!Array.isArray(i)||i.length)){let a=new kR('Cannot `skipMiddlewareFunction()` with a value when using `.find().cursor()`, value must be nullish or empty array, got "'+ewt.inspect(i)+'".');this._markError(a),this.listeners("error").length>0&&this.emit("error",a);return}this.skipped=!0,this.emit("cursor",null);return}this._markError(n),this.listeners("error").length>0&&this.emit("error",n);return}Object.assign(this.options,t._optionsForExec()),this._transforms=this._transforms.concat(t._transforms.slice()),this.options.transform&&this._transforms.push(this.options.transform),this.options.batchSize&&(this.options._populateBatchSize=Math.min(this.options.batchSize,5e3)),t._mongooseOptions._asyncIterator&&(this._mongooseOptions._asyncIterator=!0),e.collection._shouldBufferCommands()&&e.collection.buffer?e.collection.queue.push([()=>JSt(t,this)]):JSt(t,this)};e.hooks.execPre("find",t).then(()=>r(null),n=>r(n))}ewt.inherits(hf,XSt);function JSt(t,e){try{let r=t.model.collection.find(t._conditions,e.options);e.cursor=r,e.emit("cursor",r)}catch(r){e._markError(r),e.listeners("error").length>0&&e.emit("error",e._error)}}hf.prototype._read=function(){UW(this,(t,e)=>{if(t)return this.emit("error",t);if(!e){this.push(null),this.cursor.close(function(r){if(r)return this.emit("error",r)});return}this.push(e)})};hf.prototype.getDriverCursor=async function(){return this.cursor?this.cursor:(await Ovn(this,"cursor"),this.cursor)};Object.defineProperty(hf.prototype,"map",{value:function(t){return this._transforms.push(t),this},enumerable:!0,configurable:!0,writable:!0});hf.prototype._markError=function(t){return this._error=t,this};hf.prototype.close=async function(){if(typeof arguments[0]=="function")throw new kR("QueryCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close(),this._closed=!0,this.emit("close")}catch(e){throw this.listeners("error").length>0&&this.emit("error",e),e}};hf.prototype._destroy=function(e,r){let n=null;return this.cursor?n=Promise.resolve():n=new Promise(i=>{this.once("cursor",i)}),n.then(()=>{this.cursor.close()}).then(()=>{this._closed=!0,r()}).catch(i=>{r(i)}),this};hf.prototype.rewind=function(){return twt(this,()=>{this.cursor.rewind()}),this};hf.prototype.next=async function(){if(typeof arguments[0]=="function")throw new kR("QueryCursor.prototype.next() no longer accepts a callback");if(this._closed)throw new kR("Cannot call `next()` on a closed cursor");return new Promise((e,r)=>{UW(this,function(n,i){if(n)return r(n);e(i)})})};hf.prototype.eachAsync=function(t,e){if(typeof arguments[2]=="function")throw new kR("QueryCursor.prototype.eachAsync() no longer accepts a callback");return typeof e=="function"&&(e={}),e=e||{},xvn(r=>UW(this,r),t,e)};hf.prototype.options;hf.prototype.addCursorFlag=function(t,e){return twt(this,()=>{this.cursor.addCursorFlag(t,e)}),this};Symbol.asyncIterator!=null&&(hf.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this});function UW(t,e){let r=e;if(r=function(n,i){return n?e(n):i===null?t._mongooseOptions._asyncIterator?e(null,{done:!0}):e(null,null):(t._transforms.length&&i!==null&&(i=t._transforms.reduce(function(a,s){return s.call(t,a)},i)),t._mongooseOptions._asyncIterator?e(null,{value:i,done:!1}):e(null,i))},t._error)return HAe(function(){r(t._error)});if(t.skipped)return HAe(()=>r(null,null));if(t.cursor)if(t.query._mongooseOptions.populate&&!t._pop&&(t._pop=QSt.preparePopulationOptionsMQ(t.query,t.query._mongooseOptions),t._pop.__noPromise=!0),t.query._mongooseOptions.populate&&t.options._populateBatchSize>1){if(t._batchDocs&&t._batchDocs.length)return LW(t,t._batchDocs.shift(),t._pop,r);if(t._batchExhausted)return r(null,null);t._batchDocs=[],t.cursor.next().then(n=>{jW.call({ctx:t,callback:r},null,n)},n=>{jW.call({ctx:t,callback:r},n)});return}else return t.cursor.next().then(n=>{if(!n){r(null,null);return}if(!t.query._mongooseOptions.populate)return LW(t,n,null,r);LW(t,n,t._pop,(i,a)=>{if(i!=null)return r(i);t.query.model.populate(a,t._pop).then(s=>r(null,s),s=>r(s))})},n=>{r(n)});else t.once("error",e),t.once("cursor",function(n){if(t.removeListener("error",e),n==null)return t.skipped?e(null,null):void 0;UW(t,e)})}function jW(t,e){if(t)return this.callback(t);if(!e)return this.ctx._batchExhausted=!0,ZSt.call(this);this.ctx._batchDocs.push(e),this.ctx._batchDocs.length<this.ctx.options._populateBatchSize?HAe(()=>this.ctx.cursor.next().then(r=>{jW.call(this,null,r)},r=>{jW.call(this,r)})):ZSt.call(this)}function ZSt(){if(!this.ctx._batchDocs.length)return this.callback(null,null);this.ctx.query.model.populate(this.ctx._batchDocs,this.ctx._pop).then(()=>{LW(this.ctx,this.ctx._batchDocs.shift(),this.ctx._pop,this.callback)},t=>{this.callback(t)})}function LW(t,e,r,n){if(t.query._mongooseOptions.lean)return t.model.hooks.execPost("find",t.query,[[e]]).then(()=>n(null,e),u=>n(u));let{model:i,_fields:a,_userProvidedFields:s,options:o}=t.query;QSt.createModelAndInit(i,e,a,s,o,r,(u,f)=>{if(u!=null)return n(u);o.session!=null&&f.$session(o.session),t.model.hooks.execPost("find",t.query,[[f]]).then(()=>n(null,f),c=>n(c))})}function twt(t,e){if(t.cursor)return e();t.once("cursor",function(r){r!=null&&e()})}rwt.exports=hf});var WAe=l((YEa,awt)=>{"use strict";var zAe=zt();function Cvn(t,e,r){iwt(t,e,r,"maxTimeMS")}function Ivn(t,e,r){iwt(t,e,r,"allowDiskUse")}awt.exports={applyGlobalMaxTimeMS:Cvn,applyGlobalDiskUse:Ivn};function iwt(t,e,r,n){zAe.hasUserDefinedProperty(t,n)||(zAe.hasUserDefinedProperty(e,n)?t[n]=e[n]:zAe.hasUserDefinedProperty(r,n)&&(t[n]=r[n]))}});var GAe=l((JEa,swt)=>{"use strict";swt.exports=function(e,r){if(r.readConcern!==void 0||r?.session?.transaction)return;let n=e.options?.readConcern?.level;n!=null&&(r.readConcern={level:n})}});var KAe=l((ZEa,owt)=>{"use strict";var Mvn=zt();owt.exports=function(e,r){if(r.writeConcern!=null||r?.session?.transaction)return;let n=e.options.writeConcern??{};Mvn.hasOwnKeys(n)?(r.writeConcern={},!("w"in r)&&n.w!=null&&(r.writeConcern.w=n.w),!("j"in r)&&n.j!=null&&(r.writeConcern.j=n.j),!("wtimeout"in r)&&n.wtimeout!=null&&(r.writeConcern.wtimeout=n.wtimeout)):(!("w"in r)&&n.w!=null&&(r.w=n.w),!("j"in r)&&n.j!=null&&(r.j=n.j),!("wtimeout"in r)&&n.wtimeout!=null&&(r.wtimeout=n.wtimeout))}});var lwt=l((XEa,fwt)=>{"use strict";var uwt=hR();fwt.exports=function(e,r,n){if(!Object.keys(n).some(uwt))return r.castForQuery(null,n,e);let a=Object.keys(n),s=a.length;for(;s--;){let o=a[s],u=n[o];if(o==="$not"){if(u&&r&&!r.embeddedSchemaType&&!r.Constructor){let f=Object.keys(u);if(f.length&&uwt(f[0]))for(let c of Object.keys(u))u[c]=r.castForQuery(c,u[c],e);else n[o]=r.castForQuery(o,u,e);continue}}else n[o]=r.castForQuery(o,u,e)}return n}});var dwt=l((QEa,cwt)=>{"use strict";var Pvn=/^\d+$/;cwt.exports=function(e,r,n){let i=e.path(r);if(i!=null)return i;let a=r.split("."),s="",o=!1;for(let u of a)if(!(o&&Pvn.test(u))){if(s=s.length===0?u:s+"."+u,i=e.path(s),i?.schema)e=i.schema,!o&&i.$isMongooseDocumentArray&&(o=!0),n&&n[s]&&(e=e.discriminators[n[s]]??e),s="";else if(i?.instance==="Mixed")break}return i}});var bwt=l((eSa,ywt)=>{"use strict";var Rvn=lwt(),pwt=lR(),hwt=dwt(),qvn=wAe(),Nvn=zt();ywt.exports=function(e){let r=e.options.arrayFilters;if(!Array.isArray(r))return;let n=e.getUpdate(),i=e.schema,a=qvn(n),s=i.options.strict;e._mongooseOptions.strict!=null&&(s=e._mongooseOptions.strict),e.model?.base.options.strictQuery!=null&&(s=e.model.base.options.strictQuery),i._userProvidedOptions.strictQuery!=null&&(s=i._userProvidedOptions.strictQuery),e._mongooseOptions.strictQuery!=null&&(s=e._mongooseOptions.strictQuery),mwt(r,i,s,a,e)};function mwt(t,e,r,n,i){let a={};for(let s of t){if(s==null)throw new Error(`Got null array filter in ${t}`);let o=Object.keys(s).filter(m=>s[m]!=null);if(o.length===0)continue;let u=o[0];if(u==="$and"||u==="$or"){for(let m of o)mwt(s[m],e,r,n,i);continue}let f=u.indexOf("."),c=f===-1?u:u.substring(0,f);if(n[c]==null)continue;let d=pwt(n[c]),h=hwt(e,d,a),p=h!=null?h.schema:null;p?.discriminators!=null&&s[c+"."+p.options.discriminatorKey]&&(p=p.discriminators[s[c+"."+p.options.discriminatorKey]]||p,a[d]=s[c+"."+p.options.discriminatorKey]);for(let m of o){if(n[m]===null||Nvn.hasOwnKeys(n)===!1)continue;let y=m.indexOf("."),b=y===-1?null:m.substring(y),v;if(b==null||p==null?v=h:(b=pwt(b),v=hwt(p,b,a)),v==null){if(!r)return;let E=b==null?d+".0":d+".0"+b;throw new Error(`Could not find path "${E}" in schema`)}typeof s[m]=="object"?s[m]=Rvn(i,v,s[m]):s[m]=v.castForQuery(null,s[m])}}}});var VW=l((tSa,gwt)=>{"use strict";var Dvn=S9(),kvn=y9();gwt.exports=function t(e){if(e==null)return!1;let r=Object.keys(e),n=r.length;if(n===0)return!1;for(let i=0;i<n;++i){let a=r[i];if(!a.startsWith("+")&&Dvn(e[a])&&e[a])return kvn(e[a])?t(e[a]):!!e[a]}return!1}});var _wt=l((rSa,vwt)=>{"use strict";vwt.exports=function(e,r){return e===r||r.startsWith(e+".")}});var Ewt=l(Is=>{"use strict";var YAe=["__proto__","constructor","prototype"],HW=Is.clone=function t(e,r){if(e==null)return e;if(Array.isArray(e))return Is.cloneArray(e,r);if(e.constructor){if(/ObjectI[dD]$/.test(e.constructor.name))return typeof e.clone=="function"?e.clone():new e.constructor(e.id);if(e.constructor.name==="ReadPreference")return new e.constructor(e.mode,t(e.tags,r));if(e._bsontype=="Binary"&&e.buffer&&e.value)return typeof e.clone=="function"?e.clone():new e.constructor(e.value(!0),e.sub_type);if(e.constructor.name==="Date"||e.constructor.name==="Function")return new e.constructor(+e);if(e.constructor.name==="RegExp")return new RegExp(e);if(e.constructor.name==="Buffer")return Buffer.from(e)}if(Bvn(e))return Is.cloneObject(e,r);if(e.valueOf)return e.valueOf()};Is.cloneObject=function(e,r){let n=r&&r.minimize,i={},a=Object.keys(e),s=a.length,o=!1,u,f="",c=0;for(c=0;c<s;++c)f=a[c],YAe.indexOf(f)===-1&&(u=HW(e[f],r),(!n||typeof u<"u")&&(o||(o=!0),i[f]=u));return n?o&&i:i};Is.cloneArray=function(e,r){let n=[],i=e.length,a=0;for(;a<i;a++)n.push(HW(e[a],r));return n};Is.merge=function t(e,r){let n=Object.keys(r);for(let i of n)YAe.indexOf(i)===-1&&(typeof e[i]>"u"?e[i]=r[i]:Is.isObject(r[i])?t(e[i],r[i]):e[i]=r[i])};Is.mergeClone=function t(e,r){let n=Object.keys(r);for(let i of n)YAe.indexOf(i)===-1&&(typeof e[i]>"u"?e[i]=HW(r[i]):Is.isObject(r[i])?t(e[i],r[i]):e[i]=HW(r[i]))};Is.readPref=function(e){switch(e){case"p":e="primary";break;case"pp":e="primaryPreferred";break;case"s":e="secondary";break;case"sp":e="secondaryPreferred";break;case"n":e="nearest";break}return e};Is.readConcern=function(e){if(typeof e=="string"){switch(e){case"l":e="local";break;case"a":e="available";break;case"m":e="majority";break;case"lz":e="linearizable";break;case"s":e="snapshot";break}e={level:e}}return e};var $vn=Object.prototype.toString;Is.toString=function(t){return $vn.call(t)};var Bvn=Is.isObject=function(t){return Is.toString(t)=="[object Object]"};Is.keys=Object.keys;Is.create=typeof Object.create=="function"?Object.create:Fvn;function Fvn(t){if(arguments.length>1)throw new Error("Adding properties is not supported");function e(){}return e.prototype=t,new e}Is.inherits=function(t,e){t.prototype=Is.create(e.prototype),t.prototype.constructor=t};Is.isArgumentsObject=function(t){return Object.prototype.toString.call(t)==="[object Arguments]"}});var wwt=l(Swt=>{"use strict";var ta=Swt;ta.distinct=function(t){if(t._fields&&Object.keys(t._fields).length>0)return"field selection and slice";let e=Object.keys(ta.distinct),r;return e.every(function(n){return t.options[n]?(r=n,!1):!0}),r};ta.distinct.select=ta.distinct.slice=ta.distinct.sort=ta.distinct.limit=ta.distinct.skip=ta.distinct.batchSize=ta.distinct.hint=ta.distinct.tailable=!0;ta.findOneAndUpdate=ta.findOneAndDelete=function(t){let e=Object.keys(ta.findOneAndUpdate),r;return e.every(function(n){return t.options[n]?(r=n,!1):!0}),r};ta.findOneAndUpdate.limit=ta.findOneAndUpdate.skip=ta.findOneAndUpdate.batchSize=ta.findOneAndUpdate.tailable=!0;ta.findOneAndReplace=function(t){let e=Object.keys(ta.findOneAndUpdate),r;return e.every(function(n){return t.options[n]?(r=n,!1):!0}),r};ta.countDocuments=function(t){if(t._fields&&Object.keys(t._fields).length>0)return"field selection and slice";let e=Object.keys(ta.countDocuments),r;return e.every(function(n){return t.options[n]?(r=n,!1):!0}),r};ta.countDocuments.slice=ta.countDocuments.batchSize=ta.countDocuments.tailable=!0});var JAe=l((d1,Awt)=>{"use strict";d1.isNode=typeof process<"u"&&typeof Awt=="object"&&typeof global=="object"&&typeof Buffer=="function"&&process.argv;d1.isMongo=!d1.isNode&&typeof printjson=="function"&&typeof ObjectId=="function"&&typeof rs=="function"&&typeof sh=="function";d1.isBrowser=!d1.isNode&&!d1.isMongo&&typeof window<"u";d1.type=d1.isNode?"node":d1.isMongo?"mongo":d1.isBrowser?"browser":"unknown"});var $R=l((xwt,Twt)=>{"use strict";var ZAe=["find","findOne","updateMany","updateOne","replaceOne","countDocuments","estimatedDocumentCount","distinct","findOneAndDelete","findOneAndReplace","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function XAe(){}for(let t=0,e=ZAe.length;t<e;++t){let r=ZAe[t];XAe.prototype[r]=Lvn(r)}Twt.exports=xwt=XAe;XAe.methods=ZAe;function Lvn(t){return function(){throw new Error("collection."+t+" not implemented")}}});var Iwt=l((Owt,Cwt)=>{"use strict";var jvn=$R(),QAe=class extends jvn{constructor(e){super(),this.collection=e,this.collectionName=e.collectionName}async find(e,r){return this.collection.find(e,r).toArray()}async findOne(e,r){return this.collection.findOne(e,r)}async countDocuments(e,r){return this.collection.countDocuments(e,r)}async estimatedDocumentCount(e,r){return this.collection.estimatedDocumentCount(e,r)}async distinct(e,r,n){return this.collection.distinct(e,r,n)}async updateMany(e,r,n){return this.collection.updateMany(e,r,n)}async updateOne(e,r,n){return this.collection.updateOne(e,r,n)}async replaceOne(e,r,n){return this.collection.replaceOne(e,r,n)}async deleteOne(e,r){return this.collection.deleteOne(e,r)}async deleteMany(e,r){return this.collection.deleteMany(e,r)}async findOneAndDelete(e,r){return this.collection.findOneAndDelete(e,r)}async findOneAndUpdate(e,r,n){return this.collection.findOneAndUpdate(e,r,n)}async findOneAndReplace(e,r,n){return this.collection.findOneAndReplace(e,r,n)}findCursor(e,r){return this.collection.find(e,r)}};Cwt.exports=Owt=QAe});var Pwt=l((aSa,Mwt)=>{"use strict";var exe=JAe();if(exe.type=="unknown")throw new Error("Unknown environment");Mwt.exports=exe.isNode?Iwt():exe.isMongo?$R():$R()});var ixe=l((Nwt,Dwt)=>{"use strict";var Uvn=fe("assert"),qwt=fe("util"),gn=Ewt(),$y=qwt.debuglog("mquery");function qe(t,e){if(!(this instanceof qe))return new qe(t,e);let r=this.constructor.prototype;this.op=r.op||void 0,this.options=Object.assign({},r.options),this._conditions=r._conditions?gn.clone(r._conditions):{},this._fields=r._fields?gn.clone(r._fields):void 0,this._updateDoc=r._updateDoc?gn.clone(r._updateDoc):void 0,this._path=r._path||void 0,this._distinctDoc=r._distinctDoc||void 0,this._collection=r._collection||void 0,this._traceFunction=r._traceFunction||void 0,e&&this.setOptions(e),t&&this.find(t)}qe.prototype.toConstructor=function(){function e(n,i){if(!(this instanceof e))return new e(n,i);qe.call(this,n,i)}gn.inherits(e,qe);let r=e.prototype;return r.options={},r.setOptions(this.options),r.op=this.op,r._conditions=gn.clone(this._conditions),r._fields=gn.clone(this._fields),r._updateDoc=gn.clone(this._updateDoc),r._path=this._path,r._distinctDoc=this._distinctDoc,r._collection=this._collection,r._traceFunction=this._traceFunction,e};qe.prototype.setOptions=function(t){if(!(t&&gn.isObject(t)))return this;let e=gn.keys(t),r;for(let n=0;n<e.length;++n)if(r=e[n],typeof this[r]=="function"){let i=Array.isArray(t[r])?t[r]:[t[r]];this[r].apply(this,i)}else this.options[r]=t[r];return this};qe.prototype.collection=function(e){return this._collection=new qe.Collection(e),this};qe.prototype.collation=function(t){return this.options.collation=t,this};qe.prototype.$where=function(t){return this._conditions.$where=t,this};qe.prototype.where=function(){if(!arguments.length)return this;this.op||(this.op="find");let t=typeof arguments[0];if(t=="string")return this._path=arguments[0],arguments.length===2&&(this._conditions[this._path]=arguments[1]),this;if(t=="object"&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw new TypeError("path must be a string or object")};qe.prototype.equals=function(e){this._ensurePath("equals");let r=this._path;return this._conditions[r]=e,this};qe.prototype.eq=function(e){this._ensurePath("eq");let r=this._path;return this._conditions[r]=e,this};qe.prototype.or=function(e){let r=this._conditions.$or||(this._conditions.$or=[]);return Array.isArray(e)||(e=[e]),r.push.apply(r,e),this};qe.prototype.nor=function(e){let r=this._conditions.$nor||(this._conditions.$nor=[]);return Array.isArray(e)||(e=[e]),r.push.apply(r,e),this};qe.prototype.and=function(e){let r=this._conditions.$and||(this._conditions.$and=[]);return Array.isArray(e)||(e=[e]),r.push.apply(r,e),this};"gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach(function(t){qe.prototype[t]=function(){let e,r;arguments.length===1?(this._ensurePath(t),r=arguments[0],e=this._path):(r=arguments[1],e=arguments[0]);let n=this._conditions[e]===null||typeof this._conditions[e]=="object"?this._conditions[e]:this._conditions[e]={};return n["$"+t]=r,this}});qe.prototype.mod=function(){let t,e;arguments.length===1?(this._ensurePath("mod"),t=arguments[0],e=this._path):arguments.length===2&&!Array.isArray(arguments[1])?(this._ensurePath("mod"),t=[arguments[0],arguments[1]],e=this._path):arguments.length===3?(t=[arguments[1],arguments[2]],e=arguments[0]):(t=arguments[1],e=arguments[0]);let r=this._conditions[e]||(this._conditions[e]={});return r.$mod=t,this};qe.prototype.exists=function(){let t,e;arguments.length===0?(this._ensurePath("exists"),t=this._path,e=!0):arguments.length===1?typeof arguments[0]=="boolean"?(this._ensurePath("exists"),t=this._path,e=arguments[0]):(t=arguments[0],e=!0):arguments.length===2&&(t=arguments[0],e=arguments[1]);let r=this._conditions[t]||(this._conditions[t]={});return r.$exists=e,this};qe.prototype.elemMatch=function(){if(arguments[0]==null)throw new TypeError("Invalid argument");let t,e,r;if(typeof arguments[0]=="function")this._ensurePath("elemMatch"),e=this._path,t=arguments[0];else if(gn.isObject(arguments[0]))this._ensurePath("elemMatch"),e=this._path,r=arguments[0];else if(typeof arguments[1]=="function")e=arguments[0],t=arguments[1];else if(arguments[1]&&gn.isObject(arguments[1]))e=arguments[0],r=arguments[1];else throw new TypeError("Invalid argument");t&&(r=new qe,t(r),r=r._conditions);let n=this._conditions[e]||(this._conditions[e]={});return n.$elemMatch=r,this};qe.prototype.within=function(){if(this._ensurePath("within"),this._geoComparison="$geoWithin",arguments.length===0)return this;if(arguments.length===2)return this.box.apply(this,arguments);if(2<arguments.length)return this.polygon.apply(this,arguments);let e=arguments[0];if(!e)throw new TypeError("Invalid argument");if(e.center)return this.circle(e);if(e.box)return this.box.apply(this,e.box);if(e.polygon)return this.polygon.apply(this,e.polygon);if(e.type&&e.coordinates)return this.geometry(e);throw new TypeError("Invalid argument")};qe.prototype.box=function(){let t,e;if(arguments.length===3)t=arguments[0],e=[arguments[1],arguments[2]];else if(arguments.length===2)this._ensurePath("box"),t=this._path,e=[arguments[0],arguments[1]];else throw new TypeError("Invalid argument");let r=this._conditions[t]||(this._conditions[t]={});return r[this._geoComparison||"$geoWithin"]={$box:e},this};qe.prototype.polygon=function(){let t,e;typeof arguments[0]=="string"?(t=Array.from(arguments),e=t.shift()):(this._ensurePath("polygon"),e=this._path,t=Array.from(arguments));let r=this._conditions[e]||(this._conditions[e]={});return r[this._geoComparison||"$geoWithin"]={$polygon:t},this};qe.prototype.circle=function(){let t,e;if(arguments.length===1)this._ensurePath("circle"),t=this._path,e=arguments[0];else if(arguments.length===2)t=arguments[0],e=arguments[1];else throw new TypeError("Invalid argument");if(!("radius"in e&&e.center))throw new Error("center and radius are required");let r=this._conditions[t]||(this._conditions[t]={}),n=e.spherical?"$centerSphere":"$center",i=this._geoComparison||"$geoWithin";return r[i]={},r[i][n]=[e.center,e.radius],"unique"in e&&(r[i].$uniqueDocs=!!e.unique),this};qe.prototype.near=function(){let e,r;if(this._geoComparison="$near",arguments.length===0)return this;if(arguments.length===1)this._ensurePath("near"),e=this._path,r=arguments[0];else if(arguments.length===2)e=arguments[0],r=arguments[1];else throw new TypeError("Invalid argument");if(!r.center)throw new Error("center is required");let n=this._conditions[e]||(this._conditions[e]={}),i=r.spherical?"$nearSphere":"$near";if(Array.isArray(r.center)){n[i]=r.center;let a="maxDistance"in r?r.maxDistance:null;a!=null&&(n.$maxDistance=a),r.minDistance!=null&&(n.$minDistance=r.minDistance)}else{if(r.center.type!="Point"||!Array.isArray(r.center.coordinates))throw new Error(qwt.format("Invalid GeoJSON specified for %s",i));n[i]={$geometry:r.center},"maxDistance"in r&&(n[i].$maxDistance=r.maxDistance),"minDistance"in r&&(n[i].$minDistance=r.minDistance)}return this};qe.prototype.intersects=function(){if(this._ensurePath("intersects"),this._geoComparison="$geoIntersects",arguments.length===0)return this;let e=arguments[0];if(e!=null&&e.type&&e.coordinates)return this.geometry(e);throw new TypeError("Invalid argument")};qe.prototype.geometry=function(){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 e,r;if(arguments.length===1)this._ensurePath("geometry"),r=this._path,e=arguments[0];else throw new TypeError("Invalid argument");if(!(e.type&&Array.isArray(e.coordinates)))throw new TypeError("Invalid argument");let n=this._conditions[r]||(this._conditions[r]={});return n[this._geoComparison]={$geometry:e},this};qe.prototype.select=function(){let e=arguments[0];if(!e)return this;if(arguments.length!==1)throw new Error("Invalid select: select only takes 1 argument");this._validate("select");let r=this._fields||(this._fields={}),n=typeof e,i,a;if((n=="string"||gn.isArgumentsObject(e))&&typeof e.length=="number"||Array.isArray(e)){for(n=="string"&&(e=e.split(/\s+/)),i=0,a=e.length;i<a;++i){let s=e[i];if(!s)continue;let o=s[0]=="-"?0:1;o===0&&(s=s.substring(1)),r[s]=o}return this}if(gn.isObject(e)){let s=gn.keys(e);for(i=0;i<s.length;++i)r[s[i]]=e[s[i]];return this}throw new TypeError("Invalid select() argument. Must be string or object.")};qe.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let t,e;if(arguments.length===1){let n=arguments[0];if(typeof n=="object"&&!Array.isArray(n)){let i=Object.keys(n),a=i.length;for(let s=0;s<a;++s)this.slice(i[s],n[i[s]]);return this}this._ensurePath("slice"),t=this._path,e=arguments[0]}else arguments.length===2?typeof arguments[0]=="number"?(this._ensurePath("slice"),t=this._path,e=[arguments[0],arguments[1]]):(t=arguments[0],e=arguments[1]):arguments.length===3&&(t=arguments[0],e=[arguments[1],arguments[2]]);let r=this._fields||(this._fields={});return r[t]={$slice:e},this};qe.prototype.sort=function(t){if(!t)return this;let e,r,n;this._validate("sort");let i=typeof t;if(Array.isArray(t)){for(r=t.length,e=0;e<t.length;++e){if(!Array.isArray(t[e]))throw new Error("Invalid sort() argument, must be array of arrays");Vvn(this.options,t[e][0],t[e][1])}return this}if(arguments.length===1&&i=="string"){for(t=t.split(/\s+/),r=t.length,e=0;e<r;++e){if(n=t[e],!n)continue;let a=n[0]=="-"?-1:1;a===-1&&(n=n.substring(1)),Rwt(this.options,n,a)}return this}if(gn.isObject(t)){let a=gn.keys(t);for(e=0;e<a.length;++e)n=a[e],Rwt(this.options,n,t[n]);return this}if(typeof Map<"u"&&t instanceof Map)return Hvn(this.options,t),this;throw new TypeError("Invalid sort() argument. Must be a string, object, or array.")};var txe={1:1,"-1":-1,asc:1,ascending:1,desc:-1,descending:-1};function Rwt(t,e,r){if(Array.isArray(t.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 n;if(r&&r.$meta){n=t.sort||(t.sort={}),n[e]={$meta:r.$meta};return}n=t.sort||(t.sort={});let i=String(r||1).toLowerCase();if(i=txe[i],!i)throw new TypeError("Invalid sort value: { "+e+": "+r+" }");n[e]=i}function Vvn(t,e,r){if(t.sort=t.sort||[],!Array.isArray(t.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 n=String(r||1).toLowerCase();if(n=txe[n],!n)throw new TypeError("Invalid sort value: [ "+e+", "+r+" ]");t.sort.push([e,n])}function Hvn(t,e){if(t.sort=t.sort||new Map,!(t.sort instanceof Map))throw new TypeError("Can't mix sort syntaxes. Use either array or object or map consistently");e.forEach(function(r,n){let i=String(r||1).toLowerCase();if(i=txe[i],!i)throw new TypeError("Invalid sort value: < "+n+": "+r+" >");t.sort.set(n,i)})}["limit","skip","batchSize","comment"].forEach(function(t){qe.prototype[t]=function(e){return this._validate(t),this.options[t]=e,this}});qe.prototype.maxTime=qe.prototype.maxTimeMS=function(t){return this._validate("maxTime"),this.options.maxTimeMS=t,this};qe.prototype.hint=function(){if(arguments.length===0)return this;this._validate("hint");let t=arguments[0];if(gn.isObject(t)){let e=this.options.hint||(this.options.hint={});for(let r in t)e[r]=t[r];return this}if(typeof t=="string")return this.options.hint=t,this;throw new TypeError("Invalid hint. "+t)};qe.prototype.j=function(e){return this.options.j=e,this};qe.prototype.slaveOk=function(t){return this.options.slaveOk=arguments.length?!!t:!0,this};qe.prototype.read=qe.prototype.setReadPreference=function(t){return arguments.length>1&&!qe.prototype.read.deprecationWarningIssued&&(console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),qe.prototype.read.deprecationWarningIssued=!0),this.options.readPreference=gn.readPref(t),this};qe.prototype.readConcern=qe.prototype.r=function(t){return this.options.readConcern=gn.readConcern(t),this};qe.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=arguments.length?!!arguments[0]:!0,this};qe.prototype.writeConcern=qe.prototype.w=function(e){return typeof e=="object"?(typeof e.j<"u"&&(this.options.j=e.j),typeof e.w<"u"&&(this.options.w=e.w),typeof e.wtimeout<"u"&&(this.options.wtimeout=e.wtimeout)):this.options.w=e==="m"?"majority":e,this};qe.prototype.wtimeout=qe.prototype.wTimeout=function(e){return this.options.wtimeout=e,this};qe.prototype.merge=function(t){if(!t)return this;if(!qe.canMerge(t))throw new TypeError("Invalid argument. Expected instanceof mquery or plain object");return t instanceof qe?(t._conditions&&gn.merge(this._conditions,t._conditions),t._fields&&(this._fields||(this._fields={}),gn.merge(this._fields,t._fields)),t.options&&(this.options||(this.options={}),gn.merge(this.options,t.options)),t._updateDoc&&(this._updateDoc||(this._updateDoc={}),gn.mergeClone(this._updateDoc,t._updateDoc)),t._distinctDoc&&(this._distinctDoc=t._distinctDoc),this):(gn.merge(this._conditions,t),this)};qe.prototype.find=function(t){return this.op="find",qe.canMerge(t)&&this.merge(t),this};qe.prototype._find=async function(){let e=this._conditions,r=this._optionsForExec();return this.$useProjection?r.projection=this._fieldsForExec():r.fields=this._fieldsForExec(),$y("find",this._collection.collectionName,e,r),this._collection.find(e,r)};qe.prototype.cursor=function(e){if(this.op){if(this.op!=="find")throw new TypeError(".cursor only support .find method")}else this.find(e);let r=this._conditions,n=this._optionsForExec();return this.$useProjection?n.projection=this._fieldsForExec():n.fields=this._fieldsForExec(),$y("findCursor",this._collection.collectionName,r,n),this._collection.findCursor(r,n)};qe.prototype.findOne=function(t){return this.op="findOne",qe.canMerge(t)&&this.merge(t),this};qe.prototype._findOne=async function(){let e=this._conditions,r=this._optionsForExec();return this.$useProjection?r.projection=this._fieldsForExec():r.fields=this._fieldsForExec(),$y("findOne",this._collection.collectionName,e,r),this._collection.findOne(e,r)};qe.prototype.countDocuments=function(t){return this.op="countDocuments",this._validate(),qe.canMerge(t)&&this.merge(t),this};qe.prototype._countDocuments=async function(){let e=this._conditions,r=this._optionsForExec();return $y("countDocuments",this._collection.collectionName,e,r),this._collection.countDocuments(e,r)};qe.prototype.estimatedDocumentCount=function(){return this.op="estimatedDocumentCount",this._validate(),this};qe.prototype._estimatedDocumentCount=async function(){let e=this._conditions,r=this._optionsForExec();return $y("estimatedDocumentCount",this._collection.collectionName,e,r),this._collection.estimatedDocumentCount(e,r)};qe.prototype.distinct=function(t,e){return this.op="distinct",this._validate(),!e&&typeof t=="string"&&(e=t,t=void 0),typeof e=="string"&&(this._distinctDoc=e),qe.canMerge(t)&&this.merge(t),this};qe.prototype._distinct=async function(){if(!this._distinctDoc)throw new Error("No value for `distinct` has been declared");let e=this._conditions,r=this._optionsForExec();return this._collection.distinct(this._distinctDoc,e,r)};qe.prototype.updateMany=function(e,r,n){return rxe(this,"updateMany",e,r,n)};qe.prototype._updateMany=async function(){return nxe(this,"updateMany")};qe.prototype.updateOne=function(e,r,n){return rxe(this,"updateOne",e,r,n)};qe.prototype._updateOne=async function(){return nxe(this,"updateOne")};qe.prototype.replaceOne=function(e,r,n){return this.setOptions({overwrite:!0}),rxe(this,"replaceOne",e,r,n)};qe.prototype._replaceOne=async function(){return nxe(this,"replaceOne")};function rxe(t,e,r,n,i){return t.op=e,qe.canMerge(r)&&t.merge(r),n&&t._mergeUpdate(n),gn.isObject(i)&&t.setOptions(i),t}async function nxe(t,e){let r=t._optionsForExec(),n=t._conditions,i=t._updateForExec();return $y(e,t._collection.collectionName,n,i,r),t._collection[e](n,i,r)}qe.prototype.deleteOne=function(t){return this.op="deleteOne",qe.canMerge(t)&&this.merge(t),this};qe.prototype._deleteOne=async function(){let t=this._optionsForExec();delete t.justOne;let e=this._conditions;return $y("deleteOne",this._collection.collectionName,e,t),this._collection.deleteOne(e,t)};qe.prototype.deleteMany=function(t){return this.op="deleteMany",qe.canMerge(t)&&this.merge(t),this};qe.prototype._deleteMany=async function(){let t=this._optionsForExec();delete t.justOne;let e=this._conditions;return this._collection.deleteMany(e,t)};qe.prototype.findOneAndUpdate=function(t,e,r){return this.op="findOneAndUpdate",this._validate(),qe.canMerge(t)&&this.merge(t),e&&this._mergeUpdate(e),r&&this.setOptions(r),this};qe.prototype._findOneAndUpdate=async function(){let t=this._conditions,e=this._updateForExec(),r=this._optionsForExec();return this._collection.findOneAndUpdate(t,e,r)};qe.prototype.findOneAndReplace=function(t,e,r){return this.op="findOneAndReplace",this._validate(),qe.canMerge(t)&&this.merge(t),e&&(this._updateDoc=e,this.options=this.options||{},this.options.overwrite=!0),r&&this.setOptions(r),this};qe.prototype._findOneAndReplace=async function(){let t=this._conditions,e=this._updateForExec(),r=this._optionsForExec();return $y("findOneAndReplace",this._collection.collectionName,t,e,r),this._collection.findOneAndReplace(t,e,r)};qe.prototype.findOneAndDelete=function(t,e){return this.op="findOneAndDelete",this._validate(),qe.canMerge(t)&&this.merge(t),e&&this.setOptions(e),this};qe.prototype._findOneAndDelete=async function(){let t=this._optionsForExec(),e=this._conditions;return $y("findOneAndDelete",this._collection.collectionName,e,t),this._collection.findOneAndDelete(e,t)};qe.prototype.setTraceFunction=function(t){return this._traceFunction=t,this};qe.prototype.exec=async function(e){typeof e=="string"&&(this.op=e),Uvn.ok(this.op,"Missing query type: (find, etc)");let r="_"+this.op;if(typeof this[r]!="function")throw new TypeError(`this[${r}] is not a function`);return this[r]()};qe.prototype.then=async function(t,e){return this.exec().then(t,e)};qe.prototype.cursor=function(){if(this.op!="find")throw new Error("cursor() is only available for find");let t=this._conditions,e=this._optionsForExec();return this.$useProjection?e.projection=this._fieldsForExec():e.fields=this._fieldsForExec(),this._collection.findCursor(t,e)};qe.prototype.selected=function(){return!!(this._fields&&Object.keys(this._fields).length>0)};qe.prototype.selectedInclusively=function(){if(!this._fields)return!1;let e=Object.keys(this._fields);if(e.length===0)return!1;for(let r=0;r<e.length;++r){let n=e[r];if(this._fields[n]===0||this._fields[n]&&typeof this._fields[n]=="object"&&this._fields[n].$meta)return!1}return!0};qe.prototype.selectedExclusively=function(){if(!this._fields)return!1;let e=Object.keys(this._fields);if(e.length===0)return!1;for(let r=0;r<e.length;++r){let n=e[r];if(this._fields[n]===0)return!0}return!1};qe.prototype._mergeUpdate=function(t){this._updateDoc||(this._updateDoc={}),t instanceof qe?t._updateDoc&&gn.mergeClone(this._updateDoc,t._updateDoc):gn.mergeClone(this._updateDoc,t)};qe.prototype._optionsForExec=function(){return gn.clone(this.options)};qe.prototype._fieldsForExec=function(){return gn.clone(this._fields)};qe.prototype._updateForExec=function(){let t=this._updateDoc==null?{}:gn.clone(this._updateDoc),e=gn.keys(t),r={};for(let n of e){if(this.options.overwrite){r[n]=t[n];continue}n[0]!=="$"?(r.$set||(t.$set?r.$set=t.$set:r.$set={}),r.$set[n]=t[n],~e.indexOf("$set")||e.push("$set")):n==="$set"&&r.$set||(r[n]=t[n])}return this._compiledUpdate=r,r};qe.prototype._ensurePath=function(t){if(!this._path){let e=t+"() must be used after where() when called with these arguments";throw new Error(e)}};qe.permissions=wwt();qe._isPermitted=function(t,e){let r=qe.permissions[e];return r?r[t]!==!0:!0};qe.prototype._validate=function(t){let e,r;if(t===void 0){if(r=qe.permissions[this.op],typeof r!="function")return!0;e=r(this)}else qe._isPermitted(t,this.op)||(e=t);if(e)throw new Error(e+" cannot be used with "+this.op)};qe.canMerge=function(t){return t instanceof qe||gn.isObject(t)};qe.setGlobalTraceFunction=function(t){qe.traceFunction=t};qe.utils=gn;qe.env=JAe();qe.Collection=Pwt();qe.BaseCollection=$R();Dwt.exports=Nwt=qe});var axe=l((sSa,kwt)=>{"use strict";kwt.exports=function(e,r){if(typeof e==="string"&&(e=e.split(/\s+/)),!Array.isArray(e)&&Object.prototype.toString.call(e)!=="[object Arguments]")return e;let i=e.length,a={};for(let s=0;s<i;++s){let o=e[s];if(!o)continue;let u=o[0]=="-"?0:1;!r&&u===0&&(o=o.substring(1)),a[o]=u}return a}});var Fwt=l((oSa,Bwt)=>{"use strict";Bwt.exports=function(e,r){let n=Object.keys(e).map(i=>Object.keys(e[i])).reduce((i,a)=>i.concat(a),[]);return r.filter(i=>$wt(i,n))};function $wt(t,e){let r=Object.keys(t)[0];if(r==="$and"||r==="$or")return Array.isArray(t[r])?t[r].find(a=>$wt(a,e))!=null:!1;let n=r.indexOf("."),i=n===-1?r:r.slice(0,n);return e.find(a=>a.includes("$["+i+"]"))!=null}});var zW=l((uSa,Lwt)=>{"use strict";Lwt.exports=function(e){if(typeof e!="object"||e===null)return!1;let r=Object.keys(e),n=r.length;for(let i=0;i<n;++i)if(r[i][0]==="$")return!0;return!1}});var sxe=l((fSa,jwt)=>{"use strict";var zvn=zW(),{trustedSymbol:Wvn}=b9();jwt.exports=function t(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e)){for(let n of e)t(n);return e}let r=Object.keys(e);for(let n of r){let i=e[n];if(!i?.[Wvn]){if(n==="$and"||n==="$or"){t(i);continue}if(zvn(i)){let a=Object.keys(i);if(a.length===1&&a[0]==="$eq")continue;e[n]={$eq:e[n]}}}}return e}});var Vwt=l((lSa,Uwt)=>{"use strict";Uwt.exports=function(e){if(e==null)return;let r=Object.keys(e);for(let n=0;n<r.length;++n)typeof e[r[n]]=="string"&&(e[r[n]]=1)}});var Wwt=l((cSa,zwt)=>{"use strict";var Gvn=w9(),Kvn=VW();zwt.exports=function(e,r,n){if(n==null)return;let i=Object.keys(n);if(r=r||{},Kvn(e))for(let a of i){Hwt(r,a)?r[a]===0&&delete e[a]:e[a]=1;let s=n[a]?.refPath;typeof s=="string"&&(Hwt(r,s)?r[s]===0&&delete e[s]:e[s]=1)}else if(Gvn(e))for(let a of i){r[a]==null&&delete e[a];let s=n[a]?.refPath;typeof s=="string"&&r[s]==null&&delete e[s]}};function Hwt(t,e){let r=e.split("."),n=r.length,i=r[0];for(let a=1;a<n;++a){if(t[i]!=null||t[i+".$"]!=null)return!0;i+="."+r[a]}return t[i]!=null||t[i+".$"]!=null}});var Jwt=l((dSa,Ywt)=>{"use strict";var Gwt=fv(),Yvn=lR(),Kwt=Tz().flatten;Ywt.exports=async function(e,r,n,i){let a=Object.keys(n||{}),s={},o={},u={},f={},c=a.length,d=!1,h,p;for(let M=0;M<c;++M)if(a[M].startsWith("$")){if(d=!0,a[M]==="$push"||a[M]==="$addToSet"){let R=Object.keys(n[a[M]]);for(let U=0;U<R.length;++U)h=n[a[M]][R[U]],h?.$each?f[R[U]]=(f[R[U]]||[]).concat(h.$each):f[R[U]]=(f[R[U]]||[]).concat([h]);continue}let N=Kwt(n[a[M]],null,null,r),P=Object.keys(N),k=P.length;for(let R=0;R<k;++R){let U=Yvn(P[R]);p=a[M],!U.includes("$")&&(p==="$set"||p==="$setOnInsert"||p==="$pull"||p==="$pullAll"?(o[U]=N[P[R]],u[U]=p==="$pull"||p==="$pullAll"):p==="$unset"&&(o[U]=void 0),s[U]=!0)}}d||(o=Kwt(n,null,null,r),s=Object.keys(o));let m=Object.keys(o),y=m.length,b=[],v=[],E=[],x=e;for(let M=0;M<y;++M){let N=o[m[M]],P=r._getSchema(m[M]);if(P!=null&&!(P.instance==="Mixed"&&P.path!==m[M]))if(N&&Array.isArray(N.$in))N.$in.forEach((k,R)=>{b.push(P.doValidate(k,x,{updateValidator:!0}).catch(U=>{U.path=m[R]+".$in."+R,v.push(U)}))});else{if(u[m[M]]&&P.$isMongooseArray)continue;if(P.$isMongooseDocumentArrayElement&&N?.$__!=null)E.push(m[M]),b.push(P.doValidate(N,x,{updateValidator:!0}).catch(k=>{if(k.errors)for(let R of Object.keys(k.errors)){let U=k.errors[R];U.path=m[M]+"."+R,v.push(U)}else k.path=m[M],v.push(k)}));else{if(E.find(R=>m[M].startsWith(R+".")))continue;P.$isSingleNested&&E.push(m[M]),b.push(P.doValidate(N,x,{updateValidator:!0}).catch(R=>{P.schema!=null&&P.schema.options.storeSubdocValidationError===!1&&R instanceof Gwt||R&&(R.path=m[M],v.push(R))}))}}}let w=Object.keys(f);for(let M of w){let N=r._getSchema(M);if(N&&N.$isMongooseDocumentArray)b.push(N.doValidate(f[M],i?.context==="query"?e:null).catch(P=>{P.path=M,v.push(P)}));else{N=r._getSchema(M+".0");for(let P of f[M])b.push(N.doValidate(P,i?.context==="query"?e:null,{updateValidator:!0}).catch(k=>{k.path=M,v.push(k)}))}}if(await Promise.all(b),v.length){let M=new Gwt(null);for(let N of v)M.addError(N.path,N);throw M}}});var YW=l((pSa,lAt)=>{"use strict";var BR=Iu(),Jvn=rz(),uxe=ov(),Ms=Ir(),By=_z(),Zwt=nwt(),Xwt=fv(),{applyGlobalMaxTimeMS:FR,applyGlobalDiskUse:LR}=WAe(),Zvn=lwe(),Xvn=GAe(),Qvn=KAe(),e_n=_v(),t_n=bwt(),GW=dR(),r_n=PAe(),mf=_a(),n_n=gc(),jR=rR(),i_n=i1().internalToObjectOptions,a_n=w9(),s_n=VW(),o_n=Iz(),Qwt=_wt(),tAt=bl(),KW=ixe(),u_n=axe(),f_n=Fwt(),l_n=sxe(),c_n=Vwt(),d_n=Wwt(),rAt=qAe(),WW=av(),p_n=Jwt(),Y9=fe("util"),rn=zt(),h_n=cR().queryMiddlewareFunctions,m_n=new Set(["allowDiskUse","batchSize","collation","comment","explain","hint","j","lean","limit","maxTimeMS","populate","projection","read","select","skip","slice","sort","tailable","w","writeConcern","wtimeout"]),y_n=new Map([["countDocuments","_countDocuments"],["distinct","__distinct"],["estimatedDocumentCount","_estimatedDocumentCount"],["find","_find"],["findOne","_findOne"],["findOneAndReplace","_findOneAndReplace"],["findOneAndUpdate","_findOneAndUpdate"],["replaceOne","_replaceOne"],["updateMany","_updateMany"],["updateOne","_updateOne"],["deleteMany","_deleteMany"],["deleteOne","_deleteOne"],["findOneAndDelete","_findOneAndDelete"]]);function Me(t,e,r,n){this._mongooseOptions||(this._mongooseOptions={}),e=e||{},this._transforms=[],this._hooks=new uxe,this._execCount=0;let i=Object.keys(e);for(let s of i)this._mongooseOptions[s]=e[s];n&&(this.mongooseCollection=n),r&&(this.model=r,this.schema=r.schema),this.model?._mapreduce&&this.lean(),KW.call(this,null,e),n&&this.collection(n),t&&this.find(t),this.options=this.options||{},this.$useProjection=!0;let a=this?.schema?.options?.collation||null;a!=null&&(this.options.collation=a)}function nAt(t){if(t==null||typeof t!="object"||rn.hasOwnKeys(t)===!1)return!0;for(let e of["$and","$or","$nor"])if(Array.isArray(t[e])&&(t[e].length===0||t[e].every(r=>nAt(r))))return!0;return!1}function J9(t,e){if(e?.requireFilter&&nAt(t))throw new Error("Empty or invalid filter not allowed with requireFilter enabled")}Me.prototype=new KW;Me.prototype.constructor=Me;Me.prototype.count=void 0;Me.prototype.findOneAndRemove=void 0;Me.base=KW.prototype;Object.defineProperty(Me.prototype,"_distinct",{configurable:!0,writable:!0,enumerable:!0,value:void 0});Me.use$geoWithin=KW.use$geoWithin;Me.prototype.toConstructor=function(){let e=this.model,r=this.mongooseCollection,n=function(s,o){if(!(this instanceof n))return new n(s,o);this._mongooseOptions=mf(i._mongooseOptions),Me.call(this,s,o||null,e,r)};Y9.inherits(n,e.Query);let i=n.prototype;i.options={};let a=Object.assign({},this.options);return a.sort!=null&&(i.sort(a.sort),delete a.sort),i.setOptions(a),i.op=this.op,i._conditions=mf(this._conditions),i._fields=mf(this._fields),i._update=mf(this._update,{flattenDecimals:!1}),i._path=this._path,i._distinct=this._distinct,i._collection=this._collection,i._mongooseOptions=this._mongooseOptions,n};Me.prototype.clone=function(){let t=this.model,e=this.mongooseCollection,r=new this.model.Query({},{},t,e),n=Object.assign({},this.options);return n.sort!=null&&(r.sort(n.sort),delete n.sort),r.setOptions(n),r.op=this.op,r._conditions=mf(this._conditions),r._fields=mf(this._fields),r._update=mf(this._update,{flattenDecimals:!1}),r._path=this._path,r._distinct=this._distinct,r._collection=this._collection,r._mongooseOptions=this._mongooseOptions,r};Me.prototype.slice=function(...t){if(t.length===0)return this;this._validate("slice");let e,r;if(t.length===1){let i=t[0];if(typeof i=="object"&&!Array.isArray(i)){let a=Object.keys(i),s=a.length;for(let o=0;o<s;++o)this.slice(a[o],i[a[o]]);return this}this._ensurePath("slice"),e=this._path,r=t[0]}else t.length===2?typeof t[0]=="number"?(this._ensurePath("slice"),e=this._path,r=[t[0],t[1]]):(e=t[0],r=t[1]):t.length===3&&(e=t[0],r=[t[1],t[2]]);let n={};return n[e]={$slice:r},this.select(n),this};var b_n=new Set(h_n);Me.prototype._validateOp=function(){if(this.op!=null&&!b_n.has(this.op)&&this.error(new Error('Query has invalid `op`: "'+this.op+'"')),this.op!=="estimatedDocumentCount"&&this._conditions==null)throw new By(this._conditions,"filter",this.op)};Me.prototype.mod=function(){let t,e;arguments.length===1?(this._ensurePath("mod"),t=arguments[0],e=this._path):arguments.length===2&&!Array.isArray(arguments[1])?(this._ensurePath("mod"),t=[arguments[0],arguments[1]],e=this._path):arguments.length===3?(t=[arguments[1],arguments[2]],e=arguments[0]):(t=arguments[1],e=arguments[0]);let r=this._conditions[e]||(this._conditions[e]={});return r.$mod=t,this};Me.prototype.limit=function(e){if(this._validate("limit"),typeof e=="string")try{e=GW(e)}catch{throw new BR("Number",e,"limit")}return this.options.limit=e,this};Me.prototype.skip=function(e){if(this._validate("skip"),typeof e=="string")try{e=GW(e)}catch{throw new BR("Number",e,"skip")}return this.options.skip=e,this};Me.prototype.projection=function(t){return arguments.length===0?this._fields:(this._fields={},this._userProvidedFields={},this.select(t),this._fields)};Me.prototype.select=function(){let e=arguments[0];if(!e)return this;if(arguments.length!==1)throw new Error("Invalid select: select only takes 1 argument");this._validate("select");let r=this._fields||(this._fields={}),n=this._userProvidedFields||(this._userProvidedFields={}),i;this.model!=null&&rn.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection")?i=this.model.db.options.sanitizeProjection:this.model!=null&&rn.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection")?i=this.model.base.options.sanitizeProjection:i=this._mongooseOptions.sanitizeProjection;function a(s){return typeof s=="string"&&i?s=1:s}if(e=u_n(e,!0),rn.isObject(e)){if(this.selectedInclusively())Object.entries(e).forEach(([s,o])=>{o?(r["-"+s]!=null&&delete r["-"+s],r[s]=n[s]=a(o)):Object.keys(n).forEach(u=>{Qwt(s,u)&&(delete r[u],delete n[u])})});else if(this.selectedExclusively())Object.entries(e).forEach(([s,o])=>{o?Object.keys(n).forEach(u=>{Qwt(s,u)&&(delete r[u],delete n[u])}):(r["+"+s]!=null&&delete r["+"+s],r[s]=n[s]=a(o))});else{let s=Object.keys(e);for(let o=0;o<s.length;++o){let u=e[s[o]],f=s[o];r[f]=a(u),n[f]=a(u)}}return this}throw new TypeError("Invalid select() argument. Must be string or object.")};Me.prototype.schemaLevelProjections=function(e){return this._mongooseOptions.schemaLevelProjections=e,this};Me.prototype.sanitizeProjection=function(e){return this._mongooseOptions.sanitizeProjection=e,this};Me.prototype.read=function(e,r){return typeof e=="string"?(e=Zvn(e),this.options.readPreference={mode:e,tags:r}):this.options.readPreference=e,this};Me.prototype.toString=function(){return this.op==="count"||this.op==="countDocuments"||this.op==="find"||this.op==="findOne"||this.op==="deleteMany"||this.op==="deleteOne"||this.op==="findOneAndDelete"||this.op==="remove"?`${this.model.modelName}.${this.op}(${Y9.inspect(this._conditions)})`:this.op==="distinct"?`${this.model.modelName}.distinct('${this._distinct}', ${Y9.inspect(this._conditions)})`:this.op==="findOneAndReplace"||this.op==="findOneAndUpdate"||this.op==="replaceOne"||this.op==="update"||this.op==="updateMany"||this.op==="updateOne"?`${this.model.modelName}.${this.op}(${Y9.inspect(this._conditions)}, ${Y9.inspect(this._update)})`:`${this.model.modelName}.${this.op}()`};Me.prototype.session=function(e){return e==null&&delete this.options.session,this.options.session=e,this};Me.prototype.writeConcern=function(e){return e==null?(delete this.options.writeConcern,this):(this.options.writeConcern=e,this)};Me.prototype.w=function(e){return e==null&&delete this.options.w,this.options.writeConcern!=null?this.options.writeConcern.w=e:this.options.w=e,this};Me.prototype.j=function(e){return e==null&&delete this.options.j,this.options.writeConcern!=null?this.options.writeConcern.j=e:this.options.j=e,this};Me.prototype.wtimeout=function(e){return e==null&&delete this.options.wtimeout,this.options.writeConcern!=null?this.options.writeConcern.wtimeout=e:this.options.wtimeout=e,this};Me.prototype.getOptions=function(){return this.options};Me.prototype.setOptions=function(t,e){if(e)return this._mongooseOptions=t&&mf(t)||{},this.options=t||{},"populate"in t&&this.populate(this._mongooseOptions),this;if(t==null)return this;if(typeof t!="object")throw new Error('Options must be an object, got "'+t+'"');if(t=Object.assign({},t),Array.isArray(t.populate)){let r=t.populate;delete t.populate;let n=r.length;for(let i=0;i<n;++i)this.populate(r[i])}if("setDefaultsOnInsert"in t&&(this._mongooseOptions.setDefaultsOnInsert=t.setDefaultsOnInsert,delete t.setDefaultsOnInsert),"overwriteDiscriminatorKey"in t&&(this._mongooseOptions.overwriteDiscriminatorKey=t.overwriteDiscriminatorKey,delete t.overwriteDiscriminatorKey),"overwriteImmutable"in t&&(this._mongooseOptions.overwriteImmutable=t.overwriteImmutable,delete t.overwriteImmutable),"updatePipeline"in t&&(this._mongooseOptions.updatePipeline=t.updatePipeline,delete t.updatePipeline),"sanitizeProjection"in t&&(t.sanitizeProjection&&!this._mongooseOptions.sanitizeProjection&&c_n(this._fields),this._mongooseOptions.sanitizeProjection=t.sanitizeProjection,delete t.sanitizeProjection),"sanitizeFilter"in t&&(this._mongooseOptions.sanitizeFilter=t.sanitizeFilter,delete t.sanitizeFilter),"timestamps"in t&&(this._mongooseOptions.timestamps=t.timestamps,delete t.timestamps),"defaults"in t&&(this._mongooseOptions.defaults=t.defaults),"translateAliases"in t&&(this._mongooseOptions.translateAliases=t.translateAliases,delete t.translateAliases),"schemaLevelProjections"in t&&(this._mongooseOptions.schemaLevelProjections=t.schemaLevelProjections,delete t.schemaLevelProjections),t.lean==null&&this.schema&&"lean"in this.schema.options&&(this._mongooseOptions.lean=this.schema.options.lean),typeof t.limit=="string")try{t.limit=GW(t.limit)}catch{throw new BR("Number",t.limit,"limit")}if(typeof t.skip=="string")try{t.skip=GW(t.skip)}catch{throw new BR("Number",t.skip,"skip")}for(let r of Object.keys(t))if(m_n.has(r)){let n=Array.isArray(t[r])?t[r]:[t[r]];this[r].apply(this,n)}else this.options[r]=t[r];return this};Me.prototype.explain=function(e){return arguments.length===0?this.options.explain=!0:e===!1?delete this.options.explain:this.options.explain=e,this};Me.prototype.allowDiskUse=function(t){return arguments.length===0?this.options.allowDiskUse=!0:t===!1?delete this.options.allowDiskUse:this.options.allowDiskUse=t,this};Me.prototype.maxTimeMS=function(t){return this.options.maxTimeMS=t,this};Me.prototype.getFilter=function(){return this._conditions};Me.prototype.getQuery=function(){return this._conditions};Me.prototype.setQuery=function(t){this._conditions=t};Me.prototype.getUpdate=function(){return this._update};Me.prototype.setUpdate=function(t){this._update=t};Me.prototype._fieldsForExec=function(){return this._fields==null||rn.hasOwnKeys(this._fields)===!1?null:mf(this._fields)};Me.prototype._updateForExec=function(){let t=mf(this._update,{transform:!1,depopulate:!0}),e=Object.keys(t),r=e.length,n={};for(;r--;){let i=e[r];i[0]!=="$"?(n.$set||(t.$set?n.$set=t.$set:n.$set={}),n.$set[i]=t[i],e.splice(r,1),~e.indexOf("$set")||e.push("$set")):i==="$set"&&n.$set||(n[i]=t[i])}return n};Me.prototype._optionsForExec=function(t){let e=mf(this.options);if(delete e.populate,t=t||this.model,!t)return e;Xvn(t.schema,e),Qvn(t.schema,e);let r=this.model?.db?.base.transactionAsyncLocalStorage?.getStore();!Object.hasOwn(this.options,"session")&&r?.session!=null&&(e.session=r.session);let n=t?.schema?.options?.read;if(!("readPreference"in e)&&n&&(e.readPreference=n),e.upsert!==void 0&&(e.upsert=!!e.upsert),e.writeConcern&&(e.j&&(e.writeConcern.j=e.j,delete e.j),e.w&&(e.writeConcern.w=e.w,delete e.w),e.wtimeout&&(e.writeConcern.wtimeout=e.wtimeout,delete e.wtimeout)),this._applyPaths(),this._fields!=null){this._fields=this._castFields(this._fields);let i=this._fieldsForExec();i!=null&&(e.projection=i)}if(this._mongooseOptions.populate){if(e.readPreference)for(let i of Object.values(this._mongooseOptions.populate))i.options?.readPreference===void 0&&(i.options||(i.options={}),i.options.readPreference=e.readPreference);if(e.readConcern)for(let i of Object.values(this._mongooseOptions.populate))i.options?.readConcern===void 0&&(i.options||(i.options={}),i.options.readConcern=e.readConcern)}return e};Me.prototype.lean=function(t){return this._mongooseOptions.lean=arguments.length?t:!0,this};Me.prototype.set=function(t,e){if(typeof t=="object"){let r=Object.keys(t);for(let n of r)this.set(n,t[n]);return this}return this._update=this._update||{},t in this._update&&delete this._update[t],this._update.$set=this._update.$set||{},this._update.$set[t]=e,this};Me.prototype.get=function(e){let r=this._update;if(r==null)return;let n=r.$set;if(n==null||rn.hasUserDefinedProperty(r,e))return r[e];if(rn.hasUserDefinedProperty(n,e))return n[e]};Me.prototype.error=function(e){return arguments.length===0?this._error:(this._error=e,this)};Me.prototype._unsetCastError=function(){if(!(this._error==null||!(this._error instanceof BR)))return this.error(null)};Me.prototype.mongooseOptions=function(t){return arguments.length>0&&(this._mongooseOptions=t),this._mongooseOptions};Me.prototype._castConditions=function(){let t;this.model?.db.options?.sanitizeFilter!=null?t=this.model.db.options.sanitizeFilter:this.model?.base.options?.sanitizeFilter!=null?t=this.model.base.options.sanitizeFilter:t=this._mongooseOptions.sanitizeFilter,t&&l_n(this._conditions);try{this.cast(this.model),this._unsetCastError()}catch(e){this.error(e)}};function iAt(t){try{t_n(t)}catch(e){t.error(e)}}Me.prototype._find=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let e=this._mongooseOptions,r=this._userProvidedFields||{},n=this.model.db.options,i=this.model.base.options;FR(this.options,n,i),LR(this.options,n,i);let a={session:this?.options?.session||null,lean:e.lean||null},s=this._optionsForExec(),o=this._conditions,u=s.projection,f=await this.mongooseCollection.find(o,s);if(s.explain)return f.explain();let c=await f.toArray();if(c.length===0)return c;if(!e.populate){let h=this.schema.options.versionKey;return e.lean?.versionKey===!1&&h&&c.forEach(p=>{h in p&&delete p[h]}),e.lean?sAt(this.model.schema,c,null,a):this._completeMany(c,u,r,a)}let d=jR.preparePopulationOptionsMQ(this,e);return e.lean?this.model.populate(c,d):(c=await this._completeMany(c,u,r,a),await this.model.populate(c,d),c)};Me.prototype.find=function(t){if(typeof t=="function"||typeof arguments[1]=="function")throw new Ms("Query.prototype.find() no longer accepts a callback");return this.op="find",Fy(t)?(this.merge(t),UR(this)):t!=null&&this.error(new By(t,"filter","find")),this};Me.prototype.merge=function(t){if(!t)return t===null&&(this._conditions=null),this;this._conditions=this._conditions??{};let e={overwrite:!0};return t instanceof Me?(t._conditions&&(e.omit={},this._conditions&&this._conditions.$and&&t._conditions.$and&&(e.omit.$and=!0,this._conditions.$and=this._conditions.$and.concat(t._conditions.$and)),this._conditions&&this._conditions.$or&&t._conditions.$or&&(e.omit.$or=!0,this._conditions.$or=this._conditions.$or.concat(t._conditions.$or)),rn.merge(this._conditions,t._conditions,e)),t._fields&&(this._fields||(this._fields={}),rn.merge(this._fields,t._fields,e)),t.options&&(this.options||(this.options={}),rn.merge(this.options,t.options,e)),t._update&&(this._update||(this._update={}),rn.mergeClone(this._update,t._update)),t._distinct&&(this._distinct=t._distinct),rn.merge(this._mongooseOptions,t._mongooseOptions),this):this.model!=null&&t instanceof this.model.base.Types.ObjectId?(rn.merge(this._conditions,{_id:t},e),this):(t?.$__&&(t=t.toObject(i_n)),e.omit={},Array.isArray(t.$and)&&(e.omit.$and=!0,this._conditions||(this._conditions={}),this._conditions.$and=(this._conditions.$and||[]).concat(t.$and.map(r=>rn.isPOJO(r)?rn.merge({},r):r))),Array.isArray(t.$or)&&(e.omit.$or=!0,this._conditions||(this._conditions={}),this._conditions.$or=(this._conditions.$or||[]).concat(t.$or.map(r=>rn.isPOJO(r)?rn.merge({},r):r))),rn.merge(this._conditions,t,e),this)};Me.prototype.collation=function(t){return this.options==null&&(this.options={}),this.options.collation=t,this};Me.prototype._completeOne=function(t,e,r,n){if(!t&&!this.options.includeResultMetadata)return n(null,null);let i=this.model,a=this._userProvidedFields||{},s=this._mongooseOptions,o=this.options;if(!o.lean&&s.lean&&(o.lean=s.lean),o.explain)return n(null,t);if(!s.populate){let f=this.schema.options.versionKey;return s.lean?.versionKey===!1&&f&&f in t&&delete t[f],s.lean?fxe(i.schema,t,null,e,o,n):eAt(i,t,e,o,r,a,null,n)}let u=jR.preparePopulationOptionsMQ(this,this._mongooseOptions);if(s.lean)return i.populate(t,u).then(f=>{fxe(i.schema,f,null,e,o,n)},f=>{n(f)});eAt(i,t,e,o,r,a,[],(f,c)=>{if(f!=null)return n(f);i.populate(c,u).then(d=>{n(null,d)},d=>{n(d)})})};Me.prototype._completeMany=async function(e,r,n,i){let a=this.model;return Promise.all(e.map(s=>new Promise((o,u)=>{let f=s;s=jR.createModel(a,s,r,n),i.session!=null&&s.$session(i.session),s.$init(f,i,c=>{if(c!=null)return u(c);o(s)})})))};Me.prototype._findOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let e=this.model.db.options,r=this.model.base.options;FR(this.options,e,r),LR(this.options,e,r);let n=this._optionsForExec(),i=await this.mongooseCollection.findOne(this._conditions,n);return new Promise((a,s)=>{this._completeOne(i,null,n.projection,(o,u)=>{if(o)return s(o);a(u)})})};Me.prototype.findOne=function(t,e,r){if(typeof t=="function"||typeof e=="function"||typeof r=="function"||typeof arguments[3]=="function")throw new Ms("Query.prototype.findOne() no longer accepts a callback");return this.op="findOne",r&&this.setOptions(r),e&&this.select(e),Fy(t)?(this.merge(t),UR(this)):t!=null&&this.error(new By(t,"filter","findOne")),this};Me.prototype._countDocuments=async function(){this._applyTranslateAliases();try{this.cast(this.model)}catch(a){this.error(a)}if(this.error())throw this.error();let e=this.model.db.options,r=this.model.base.options;FR(this.options,e,r),LR(this.options,e,r);let n=this._optionsForExec(),i=this._conditions;return this.mongooseCollection.countDocuments(i,n)};Me.prototype._applyTranslateAliases=function(){let e=!1;"translateAliases"in this._mongooseOptions?e=this._mongooseOptions.translateAliases:this.model?.schema?._userProvidedOptions?.translateAliases!=null?e=this.model.schema._userProvidedOptions.translateAliases:this.model?.base?.options?.translateAliases!=null&&(e=this.model.base.options.translateAliases),e&&this.model?.schema?.aliases&&rn.hasOwnKeys(this.model.schema.aliases)&&(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]))};Me.prototype._estimatedDocumentCount=async function(){if(this.error())throw this.error();let e=this._optionsForExec();return this.mongooseCollection.estimatedDocumentCount(e)};Me.prototype.estimatedDocumentCount=function(t){if(typeof t=="function"||typeof arguments[1]=="function")throw new Ms("Query.prototype.estimatedDocumentCount() no longer accepts a callback");return this.op="estimatedDocumentCount",t!=null&&this.setOptions(t),this};Me.prototype.countDocuments=function(t,e){if(typeof t=="function"||typeof e=="function"||typeof arguments[2]=="function")throw new Ms("Query.prototype.countDocuments() no longer accepts a callback");return this.op="countDocuments",Fy(t)&&this.merge(t),e!=null&&this.setOptions(e),this};Me.prototype.__distinct=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let e=this.model.db.options,r=this.model.base.options;FR(this.options,e,r),LR(this.options,e,r);let n=this._optionsForExec();return this.mongooseCollection.distinct(this._distinct,this._conditions,n)};Me.prototype.distinct=function(t,e,r){if(typeof t=="function"||typeof e=="function"||typeof r=="function"||typeof arguments[3]=="function")throw new Ms("Query.prototype.distinct() no longer accepts a callback");return this.op="distinct",Fy(e)?(this.merge(e),UR(this)):e!=null&&this.error(new By(e,"filter","distinct")),t!=null&&(this._distinct=t),r!=null&&this.setOptions(r),this};Me.prototype.sort=function(t,e){if(arguments.length>2)throw new Error("sort() takes at most 2 arguments");if(e!=null&&typeof e!="object")throw new Error("sort() options argument must be an object or nullish");this.options.sort==null&&(this.options.sort={}),e?.override&&(this.options.sort={});let r=this.options.sort;if(typeof t=="string"){let n=t.indexOf(" ")===-1?[t]:t.split(" ");for(let i of n){let a=i[0]=="-"?-1:1;a===-1&&(i=i.slice(1)),!WW.has(i)&&(r[i]=a)}}else if(Array.isArray(t))for(let n of t){if(!Array.isArray(n))throw new TypeError("Invalid sort() argument, must be array of arrays");let i=""+n[0];WW.has(i)||(r[i]=oxe(n[1],i))}else if(typeof t=="object"&&t!=null&&!(t instanceof Map))for(let n of Object.keys(t))WW.has(n)||(r[n]=oxe(t[n],n));else if(t instanceof Map)for(let n of t.keys())n=""+n,!WW.has(n)&&(r[n]=oxe(t.get(n),n));else if(t!=null)throw new TypeError("Invalid sort() argument. Must be a string, object, array, or map.");return this};function oxe(t,e){if(t===1||t==="asc"||t==="ascending")return 1;if(t===-1||t==="desc"||t==="descending")return-1;if(t?.$meta!=null)return{$meta:t.$meta};throw new TypeError("Invalid sort value: { "+e+": "+t+" }")}Me.prototype.deleteOne=function(e,r){if(typeof e=="function"||typeof r=="function"||typeof arguments[2]=="function")throw new Ms("Query.prototype.deleteOne() no longer accepts a callback");return this.op="deleteOne",this.setOptions(r),Fy(e)?(this.merge(e),UR(this)):e!=null&&this.error(new By(e,"filter","deleteOne")),this};Me.prototype._deleteOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),J9(this._conditions,this.options),this.error()!=null)throw this.error();let e=this._optionsForExec();return this.mongooseCollection.deleteOne(this._conditions,e)};Me.prototype.deleteMany=function(t,e){if(typeof t=="function"||typeof e=="function"||typeof arguments[2]=="function")throw new Ms("Query.prototype.deleteMany() no longer accepts a callback");return this.setOptions(e),this.op="deleteMany",Fy(t)?(this.merge(t),UR(this)):t!=null&&this.error(new By(t,"filter","deleteMany")),this};Me.prototype._deleteMany=async function(){if(this._applyTranslateAliases(),this._castConditions(),J9(this._conditions,this.options),this.error()!=null)throw this.error();let e=this._optionsForExec();return this.mongooseCollection.deleteMany(this._conditions,e)};function eAt(t,e,r,n,i,a,s,o){if(n.includeResultMetadata&&e==null)return u(null),null;jR.createModelAndInit(t,e,i,a,n,s,u);function u(f,c){if(f)return o(f);if(n.includeResultMetadata)return e&&c?(n.session!=null&&c.$session(n.session),r.value=c):r.value=null,o(null,r);n.session!=null&&c.$session(n.session),o(null,c)}}function UR(t){if(!t?.model?.schema)return;let e=t.model.schema;e?.discriminatorMapping&&!e.discriminatorMapping.isRoot&&(t._conditions[e.discriminatorMapping.key]=e.discriminatorMapping.value)}Me.prototype.findOneAndUpdate=function(t,e,r){if(typeof t=="function"||typeof e=="function"||typeof r=="function"||typeof arguments[3]=="function")throw new Ms("Query.prototype.findOneAndUpdate() no longer accepts a callback");switch(this.op="findOneAndUpdate",this._validate(),arguments.length){case 2:r=void 0;break;case 1:e=t,t=r=void 0;break}Fy(t)?this.merge(t):t!=null&&this.error(new By(t,"filter","findOneAndUpdate")),r=r?mf(r):{},r.projection&&(this.select(r.projection),delete r.projection),r.fields&&(this.select(r.fields),delete r.fields);let n=this?.model?.base?.options?.returnOriginal;r.new==null&&r.returnDocument==null&&r.returnOriginal==null&&n!=null&&(r.returnOriginal=n);let i=this?.model?.base?.options?.updatePipeline;return r.updatePipeline==null&&i!=null&&(r.updatePipeline=i),this.setOptions(r),e&&this._mergeUpdate(e),this};Me.prototype._findOneAndUpdate=async function(){if(this._applyTranslateAliases(),this._castConditions(),J9(this._conditions,this.options),iAt(this),this.error())throw this.error();let e=this.model.db.options,r=this.model.base.options;FR(this.options,e,r),LR(this.options,e,r),"strict"in this.options&&(this._mongooseOptions.strict=this.options.strict);let n=this._optionsForExec(this.model);aAt(n),this._update=this._castUpdate(this._update);let i=Object.assign({},n,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});if(this._update=rAt(this._conditions,this.model.schema,this._update,i),!this._update||rn.hasOwnKeys(this._update)===!1)if(n.upsert){let u=mf(this._update);delete u._id,this._update={$set:u}}else return this._execCount=0,await this._findOne();else{if(this._update instanceof Error)throw this._update;this._update.$set&&rn.hasOwnKeys(this._update.$set)===!1&&delete this._update.$set}lxe(this,"runValidators",!1)&&await this.validate(this._update,n,!1),this._update.toBSON&&(this._update=this._update.toBSON());let s=await this.mongooseCollection.findOneAndUpdate(this._conditions,this._update,n);for(let u of this._transforms)s=u(s);let o=n.includeResultMetadata?s.value:s;return new Promise((u,f)=>{this._completeOne(o,s,n.projection,(c,d)=>{if(c)return f(c);u(d)})})};Me.prototype.findOneAndDelete=function(t,e){if(typeof t=="function"||typeof e=="function"||typeof arguments[2]=="function")throw new Ms("Query.prototype.findOneAndDelete() no longer accepts a callback");return this.op="findOneAndDelete",this._validate(),Fy(t)&&this.merge(t),e&&this.setOptions(e),this};Me.prototype._findOneAndDelete=async function(){if(this._applyTranslateAliases(),this._castConditions(),J9(this._conditions,this.options),this.error()!=null)throw this.error();let e=this.options.includeResultMetadata,r=this._conditions,n=this._optionsForExec(this.model),i=await this.mongooseCollection.findOneAndDelete(r,n);for(let s of this._transforms)i=s(i);let a=e?i.value:i;return new Promise((s,o)=>{this._completeOne(a,i,n.projection,(u,f)=>{if(u)return o(u);s(f)})})};Me.prototype.findOneAndReplace=function(t,e,r){if(typeof t=="function"||typeof e=="function"||typeof r=="function"||typeof arguments[4]=="function")throw new Ms("Query.prototype.findOneAndReplace() no longer accepts a callback");this.op="findOneAndReplace",this._validate(),Fy(t)?this.merge(t):t!=null&&this.error(new By(t,"filter","findOneAndReplace")),e!=null&&this._mergeUpdate(e),r=r||{};let n=this?.model?.base?.options?.returnOriginal;return r.new==null&&r.returnDocument==null&&r.returnOriginal==null&&n!=null&&(r.returnOriginal=n),this.setOptions(r),this};Me.prototype._findOneAndReplace=async function(){if(this._applyTranslateAliases(),this._castConditions(),J9(this._conditions,this.options),this.error()!=null)throw this.error();"strict"in this.options&&(this._mongooseOptions.strict=this.options.strict,delete this.options.strict);let e=this._conditions,r=this._optionsForExec();aAt(r);let n=this.options.includeResultMetadata,i={skipId:!0};"strict"in this._mongooseOptions&&(i.strict=this._mongooseOptions.strict);let a=lxe(this,"runValidators",!1);try{let u=new this.model(this._update,null,i);if(a)await u.validate();else if(u.$__.validationError)throw u.$__.validationError;this._update=u.toBSON()}catch(u){if(u instanceof Xwt)throw u;let f=new Xwt;throw f.errors[u.path]=u,f}let s=await this.mongooseCollection.findOneAndReplace(e,this._update,r);for(let u of this._transforms)s=u(s);let o=n?s.value:s;return new Promise((u,f)=>{this._completeOne(o,s,r.projection,(c,d)=>{if(c)return f(c);u(d)})})};Me.prototype.findById=function(t,e,r){return this.findOne({_id:t},e,r)};Me.prototype.findByIdAndUpdate=function(t,e,r){return this.findOneAndUpdate({_id:t},e,r)};Me.prototype.findByIdAndDelete=function(t,e){return this.findOneAndDelete({_id:t},e)};function aAt(t){"new"in t&&(t.returnDocument=t.new?"after":"before",delete t.new),"returnOriginal"in t&&(t.returnDocument=t.returnOriginal?"before":"after",delete t.returnOriginal),typeof t.returnDocument=="string"&&(t.returnOriginal=t.returnDocument==="before")}function lxe(t,e,r){let n=t._optionsForExec(t.model);return e in n?n[e]:e in t.model.base.options?t.model.base.options[e]:r}function fxe(t,e,r,n,i,a){if(i.lean&&typeof i.lean.transform=="function"){i.lean.transform(e);for(let s=0;s<t.childSchemas.length;s++){let o=r?r+"."+t.childSchemas[s].model.path:t.childSchemas[s].model.path,u=t.childSchemas[s].schema,f=tAt.get(o,e);if(f!=null){if(Array.isArray(f))for(let c=0;c<f.length;c++)i.lean.transform(f[c]);else i.lean.transform(f);fxe(u,f,o,n,i)}}return a?a(null,e):void 0}return i.includeResultMetadata?a(null,n):a(null,e)}function sAt(t,e,r,n){if(n.lean&&typeof n.lean.transform=="function"){for(let i of e)n.lean.transform(i);for(let i=0;i<t.childSchemas.length;i++){let a=r?r+"."+t.childSchemas[i].model.path:t.childSchemas[i].model.path,s=t.childSchemas[i].schema,o=tAt.get(a,e);if(o!=null){o=o.flat();for(let u=0;u<o.length;u++)n.lean.transform(o[u]);sAt(s,o,a,n)}}}return e}Me.prototype._mergeUpdate=function(t){if(!this._mongooseOptions.updatePipeline&&Array.isArray(t))throw new Ms("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(this._update||(this._update=Array.isArray(t)?[]:{}),!(t==null||typeof t=="object"&&rn.hasOwnKeys(t)===!1))if(t instanceof Me){if(Array.isArray(this._update))throw new Ms(`Cannot mix array and object updates (current: ${G9(this._update)}, incoming: ${G9(t._update)})`);t._update&&rn.mergeClone(this._update,t._update)}else if(Array.isArray(t)){if(!Array.isArray(this._update))if(this._update==null||rn.isEmptyObject(this._update))this._update=[];else throw new Ms(`Cannot mix array and object updates (current: ${G9(this._update)}, incoming: ${G9(t)})`);this._update=this._update.concat(t)}else{if(Array.isArray(this._update))throw new Ms(`Cannot mix array and object updates (current: ${G9(this._update)}, incoming: ${G9(t)})`);rn.mergeClone(this._update,t)}};function G9(t){let e=Y9.inspect(t,{depth:2,maxArrayLength:5,breakLength:80,compact:!0});return e.length>200?`${e.slice(0,197)}...`:e}async function cxe(t){if(this._applyTranslateAliases(),this._castConditions(),J9(this._conditions,this.options),iAt(this),this.error()!=null)throw this.error();let e=this._conditions,r=this._optionsForExec(this.model);this._update=mf(this._update,r);let n=t==="replaceOne";if(n)this._update=new this.model(this._update,null,{skipId:!0});else{if(this._update=this._castUpdate(this._update),this._update==null||rn.hasOwnKeys(this._update)===!1)return{acknowledged:!1};let a=Object.assign({},r,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});this._update=rAt(this._conditions,this.model.schema,this._update,a)}return Array.isArray(r.arrayFilters)&&(r.arrayFilters=f_n(this._update,r.arrayFilters)),lxe(this,"runValidators",!1)&&await this.validate(this._update,r,n),this._update.toBSON&&(this._update=this._update.toBSON()),this.mongooseCollection[t](e,this._update,r)}Me.prototype.validate=async function(e,r,n){if(typeof arguments[3]=="function")throw new Ms("Query.prototype.validate() no longer accepts a callback");await uAt(this,"validate"),n?await e.$validate():await p_n(this,this.model.schema,e,r),await oAt(this,null,null,"validate")};Me.prototype._updateMany=async function(){return cxe.call(this,"updateMany")};Me.prototype._updateOne=async function(){return cxe.call(this,"updateOne")};Me.prototype._replaceOne=async function(){return cxe.call(this,"replaceOne")};Me.prototype.updateMany=function(t,e,r,n){return typeof r=="function"?(n=r,r=void 0):typeof e=="function"?(n=e,e=t,t={},r=void 0):typeof t=="function"?(n=t,t=void 0,e=void 0,r=void 0):typeof t=="object"&&!e&&!r&&!n&&(e=t,t=void 0,r=void 0,n=void 0),dxe(this,"updateMany",t,e,r,n)};Me.prototype.updateOne=function(t,e,r,n){return typeof r=="function"?(n=r,r=void 0):typeof e=="function"?(n=e,e=t,t={},r=void 0):typeof t=="function"?(n=t,t=void 0,e=void 0,r=void 0):typeof t=="object"&&!e&&!r&&!n&&(e=t,t=void 0,r=void 0,n=void 0),dxe(this,"updateOne",t,e,r,n)};Me.prototype.replaceOne=function(t,e,r,n){return typeof r=="function"?(n=r,r=void 0):typeof e=="function"?(n=e,e=t,t={},r=void 0):typeof t=="function"?(n=t,t=void 0,e=void 0,r=void 0):typeof t=="object"&&!e&&!r&&!n&&(e=t,t=void 0,r=void 0,n=void 0),dxe(this,"replaceOne",t,e,r,n)};function dxe(t,e,r,n,i,a){t.op=e,n=n||{},i!=null&&"strict"in i&&(t._mongooseOptions.strict=i.strict),!(r instanceof Me)&&r!=null&&r.toString()!=="[object Object]"?t.error(new By(r,"filter",e)):t.merge(r);let s=t?.model?.base?.options?.updatePipeline;return s!=null&&i?.updatePipeline==null&&(i=i||{},i.updatePipeline=s),rn.isObject(i)&&t.setOptions(i),t._mergeUpdate(n),a&&t.exec(a),t}Me.prototype.transform=function(t){return this._transforms.push(t),this};Me.prototype.orFail=function(t){return this.transform(e=>{switch(this.op){case"find":if(e.length===0)throw K9(t,this);break;case"findOne":if(e==null)throw K9(t,this);break;case"replaceOne":case"updateMany":case"updateOne":if(e?.matchedCount===0)throw K9(t,this);break;case"findOneAndDelete":case"findOneAndUpdate":case"findOneAndReplace":if(this.options.includeResultMetadata&&e!=null&&e.value==null)throw K9(t,this);if(!this.options.includeResultMetadata&&e==null)throw K9(t,this);break;case"deleteMany":case"deleteOne":if(e.deletedCount===0)throw K9(t,this);break;default:break}return e}),this};function K9(t,e){return typeof t=="function"&&(t=t.call(e)),t==null&&(t=new Jvn(e.getQuery(),e.model.modelName)),t}Me.prototype.isPathSelectedInclusive=function(t){return o_n(this._fields,t)};Me.prototype.exec=async function(e){if(typeof e=="function"||arguments.length>=2&&typeof arguments[1]=="function")throw new Ms("Query.prototype.exec() no longer accepts a callback");if(this._validateOp(),typeof e=="string"&&(this.op=e),this.op==null)throw new Ms("Query must have `op` before executing");if(this.model==null)throw new Ms("Query must have an associated model before executing");let r=y_n.get(this.op);if(!r)throw new Ms('Query has invalid `op`: "'+this.op+'"');if(this.options?.sort&&typeof this.options.sort=="object"&&Object.hasOwn(this.options.sort,""))throw new Error('Invalid field "" passed to sort()');if(this._execCount>0){let s=this.toString();throw s.length>60&&(s=s.slice(0,60)+"..."),new Ms("Query was already executed: "+s)}this._execCount++;let n=null;try{await this._hooks.execPre("exec",this,[])}catch(s){if(s instanceof uxe.skipWrappedFunction)n=s;else throw s}let i,a=null;try{await uAt(this),i=n?n.args[0]:await this[r]();for(let s of this._transforms)i=s(i)}catch(s){s instanceof uxe.skipWrappedFunction?i=s.args[0]:a=s,a=this.model.schema._transformDuplicateKeyError(a)}return i=await oAt(this,i,a),await this._hooks.execPost("exec",this,[]),i};function oAt(t,e,r,n){if(t._queryMiddleware==null){if(r!=null)throw r;return e}let i=r?{error:r}:{};return t._queryMiddleware.execPost(n||t.op,t,[e],i).then(a=>a[0])}function uAt(t,e){if(t._queryMiddleware!=null)return t._queryMiddleware.execPre(e||t.op,t,[])}Me.prototype.then=function(t,e){return this.exec().then(t,e)};Me.prototype.catch=function(t){return this.exec().then(null,t)};Me.prototype.finally=function(t){return this.exec().finally(t)};Me.prototype[Symbol.toStringTag]=function(){return`Query { ${this.op} }`};Me.prototype.pre=function(t){return this._hooks.pre("exec",t),this};Me.prototype.post=function(t){return this._hooks.post("exec",t),this};Me.prototype._castUpdate=function(e){let r=this.schema,n=r.options.discriminatorKey,i=r._baseSchema||r;if(this._mongooseOptions.overwriteDiscriminatorKey&&e[n]!=null&&i.discriminators){let s=Object.values(i.discriminators).find(o=>o.discriminatorMapping.value===e[n]);s!=null&&(r=s)}let a;return"upsert"in this.options&&(a=this.options.upsert),r_n(r,e,{strict:this._mongooseOptions.strict,upsert:a,arrayFilters:this.options.arrayFilters,overwriteDiscriminatorKey:this._mongooseOptions.overwriteDiscriminatorKey,overwriteImmutable:this._mongooseOptions.overwriteImmutable},this,this._conditions)};Me.prototype.populate=function(...t){if(!t.some(Boolean))return this;let e=rn.populate.apply(null,t),r=this._mongooseOptions;if(r.lean!=null){let i=r.lean;for(let a of e)a?.options?.lean==null&&(a.options=a.options||{},a.options.lean=i)}rn.isObject(r.populate)||(r.populate={});let n=r.populate;for(let i of e){let a=i.path;n[a]?.populate&&i.populate&&(i.populate=n[a].populate.concat(i.populate)),n[i.path]=i}return this};Me.prototype.getPopulatedPaths=function(){let e=this._mongooseOptions.populate||{},r=Object.keys(e);for(let n of Object.keys(e)){let i=e[n];Array.isArray(i.populate)&&fAt(r,i.populate,n+".")}return r};function fAt(t,e,r){for(let n of e)t.push(r+n.path),Array.isArray(n.populate)&&fAt(t,n.populate,r+n.path+".")}Me.prototype.cast=function(t,e){e||(e=this._conditions),t=t||this.model;let r=t.schema.options.discriminatorKey;e!=null&&Object.hasOwn(e,r)&&(t=n_n(t.discriminators,e[r])||t);let n={upsert:this.options?.upsert};this.options&&("strict"in this.options&&(n.strict=this.options.strict),"strictQuery"in this.options&&(n.strictQuery=this.options.strictQuery)),"sanitizeFilter"in this._mongooseOptions&&(n.sanitizeFilter=this._mongooseOptions.sanitizeFilter);try{return e_n(t.schema,e,n,this)}catch(i){throw typeof i.setModel=="function"&&i.setModel(t),i}};Me.prototype._castFields=function(e){let r,n,i,a,s;if(e){i=Object.keys(e),n=[];for(let o=0;o<i.length;++o)a=i[o],e[a].$elemMatch&&(r||(r={}),r[a]=e[a],n.push(a))}if(r){try{s=this.cast(this.model,r)}catch(o){return o}for(let o=0;o<n.length;++o)a=n[o],e[a]=s[a]}return e};Me.prototype._applyPaths=function(){if(!this.model)return;this._fields=this._fields||{};let e;this.model!=null&&rn.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection")?e=this.model.db.options.sanitizeProjection:this.model!=null&&rn.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection")?e=this.model.base.options.sanitizeProjection:e=this._mongooseOptions.sanitizeProjection,(this._mongooseOptions.schemaLevelProjections??!0)&&jR.applyPaths(this._fields,this.model.schema,e);let n=!0;"selectPopulatedPaths"in this.model.base.options&&(n=this.model.base.options.selectPopulatedPaths),"selectPopulatedPaths"in this.model.schema.options&&(n=this.model.schema.options.selectPopulatedPaths),n&&d_n(this._fields,this._userProvidedFields,this._mongooseOptions.populate)};Me.prototype.cursor=function(e){e&&this.setOptions(e);try{this.cast(this.model)}catch(r){return new Zwt(this)._markError(r)}return new Zwt(this)};Me.prototype.tailable=function(t,e){if(typeof t?.constructor=="function"&&t.constructor.name==="Object"&&(e=t,t=!0),t===void 0&&(t=!0),e&&typeof e=="object")for(let r of Object.keys(e))r==="awaitData"||r==="awaitdata"?this.options.awaitData=!!e[r]:this.options[r]=e[r];return this.options.tailable=arguments.length?!!t:!0,this};Me.prototype.near=function(){let t=[],e=this._mongooseOptions.nearSphere;if(arguments.length===1)if(Array.isArray(arguments[0]))t.push({center:arguments[0],spherical:e});else if(typeof arguments[0]=="string")t.push(arguments[0]);else if(rn.isObject(arguments[0]))typeof arguments[0].spherical!="boolean"&&(arguments[0].spherical=e),t.push(arguments[0]);else throw new TypeError("invalid argument");else if(arguments.length===2)if(typeof arguments[0]=="number"&&typeof arguments[1]=="number")t.push({center:[arguments[0],arguments[1]],spherical:e});else if(typeof arguments[0]=="string"&&Array.isArray(arguments[1]))t.push(arguments[0]),t.push({center:arguments[1],spherical:e});else if(typeof arguments[0]=="string"&&rn.isObject(arguments[1]))t.push(arguments[0]),typeof arguments[1].spherical!="boolean"&&(arguments[1].spherical=e),t.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")t.push(arguments[0]),t.push({center:[arguments[1],arguments[2]],spherical:e});else throw new TypeError("invalid argument");else throw new TypeError("invalid argument");return Me.base.near.apply(this,t)};Me.prototype.nearSphere=function(){return this._mongooseOptions.nearSphere=!0,this.near.apply(this,arguments),this};Me.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this.cursor()};Me.prototype.box=function(t,e){return!Array.isArray(t)&&rn.isObject(t)&&(e=t.ur,t=t.ll),Me.base.box.call(this,t,e)};Me.prototype.center=Me.base.circle;Me.prototype.centerSphere=function(){typeof arguments[0]?.constructor=="function"&&arguments[0].constructor.name==="Object"&&(arguments[0].spherical=!0),typeof arguments[1]?.constructor=="function"&&arguments[1].constructor.name==="Object"&&(arguments[1].spherical=!0),Me.base.circle.apply(this,arguments)};Me.prototype.selectedInclusively=function(){return s_n(this._fields)};Me.prototype.selectedExclusively=function(){return a_n(this._fields)};Me.prototype.model;function Fy(t){return t instanceof Me||rn.isObject(t)||t===null}lAt.exports=Me});var mAt=l((hSa,hAt)=>{"use strict";var VR=Ir(),dAt=fe("stream").Readable,g_n=VAe(),v_n=Eb(),__n=ov(),pAt=fe("util");function yf(t){dAt.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this.agg=t,this._transforms=[];let e=t._connection,r=t._model;delete t.options.cursor.useMongooseAggCursor,this._mongooseOptions={},e?(this.cursor=e.db.aggregate(t._pipeline,t.options||{}),setImmediate(()=>this.emit("cursor",this.cursor))):E_n(r,this,t)}pAt.inherits(yf,dAt);function E_n(t,e,r){t.collection.buffer?t.collection.emitter.once("queue",function(){t.hooks.execPre("aggregate",r).then(()=>n(null),i=>n(i))}):t.hooks.execPre("aggregate",r).then(()=>n(null),i=>n(i));function n(i){if(i!=null){S_n(e,i);return}typeof r.options?.cursor?.transform=="function"&&e._transforms.push(r.options.cursor.transform),e.cursor=t.collection.aggregate(r._pipeline,r.options||{}),e.emit("cursor",e.cursor)}}function S_n(t,e){if(e instanceof __n.skipWrappedFunction){let r=e.args[0];if(r!=null&&(!Array.isArray(r)||r.length)){let n=new VR('Cannot `skipMiddlewareFunction()` with a value when using `.aggregate().cursor()`, value must be nullish or empty array, got "'+pAt.inspect(r)+'".');t._markError(n),t.listeners("error").length>0&&t.emit("error",n);return}t.emit("cursor",null);return}t._markError(e),t.listeners("error").length>0&&t.emit("error",e)}yf.prototype._read=function(){let t=this;JW(this,function(e,r){if(e)return t.emit("error",e);if(!r){t.push(null),t.cursor.close(function(n){if(n)return t.emit("error",n)});return}t.push(r)})};if(Symbol.asyncIterator!=null){let t="Mongoose does not support using async iterators with an existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation";yf.prototype[Symbol.asyncIterator]=function(){throw new VR(t)}}Object.defineProperty(yf.prototype,"map",{value:function(t){return this._transforms.push(t),this},enumerable:!0,configurable:!0,writable:!0});yf.prototype._markError=function(t){return this._error=t,this};yf.prototype.close=async function(){if(typeof arguments[0]=="function")throw new VR("AggregationCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close()}catch(e){throw this.listeners("error").length>0&&this.emit("error",e),e}this.emit("close")};yf.prototype._destroy=function(e,r){let n=null;return this.cursor?n=Promise.resolve():n=new Promise(i=>{this.once("cursor",i)}),n.then(()=>this.cursor.close()).then(()=>{this._closed=!0,r()}).catch(i=>{r(i)}),this};yf.prototype.next=async function(){if(typeof arguments[0]=="function")throw new VR("AggregationCursor.prototype.next() no longer accepts a callback");return new Promise((e,r)=>{JW(this,(n,i)=>{if(n!=null)return r(n);e(i)})})};yf.prototype.eachAsync=function(t,e){if(typeof arguments[2]=="function")throw new VR("AggregationCursor.prototype.eachAsync() no longer accepts a callback");let r=this;return typeof e=="function"&&(e={}),e=e||{},g_n(function(n){return JW(r,n)},t,e)};Symbol.asyncIterator!=null&&(yf.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()});yf.prototype._transformForAsyncIterator=function(){return this._transforms.indexOf(cAt)===-1&&this.map(cAt),this};yf.prototype.transformNull=function(t){return arguments.length===0&&(t=!0),this._mongooseOptions.transformNull=t,this};function cAt(t){return t==null?{done:!0}:{value:t,done:!1}}yf.prototype.addCursorFlag=function(t,e){let r=this;return w_n(this,function(){r.cursor.addCursorFlag(t,e)}),this};function w_n(t,e){if(t.cursor)return e();t.once("cursor",function(){e()})}function JW(t,e){let r=e;if(t._transforms.length&&(r=function(n,i){if(n||i===null&&!t._mongooseOptions.transformNull)return e(n,i);e(n,t._transforms.reduce(function(a,s){return s(a)},i))}),t._error)return v_n(function(){r(t._error)});if(t.cursor)return t.cursor.next().then(n=>{if(!n)return r(null,null);r(null,n)},n=>r(n));t.once("error",e),t.once("cursor",function(){JW(t,e)})}hAt.exports=yf});var pxe=l((mSa,yAt)=>{"use strict";yAt.exports=function(e,r,n){let i=r?.discriminatorMapping;if(n=n||"",i&&!i.isRoot){let a=e,s=(n.length>0?n+".":n)+i.key,o=i.value;if(a[0]!=null&&a[0].$match&&(a[0].$match[s]===void 0||a[0].$match[s]===o))a[0].$match[s]=o;else if(a[0]?.$geoNear)a[0].$geoNear.query=a[0].$geoNear.query||{},a[0].$geoNear.query[s]=o;else if(a[0]?.$search)if(a[1]?.$match!=null)a[1].$match[s]=a[1].$match[s]||o;else{let u={};u[s]=o,a.splice(1,0,{$match:u})}else{let u={};u[s]=o,a.unshift({$match:u})}}}});var gAt=l((ySa,bAt)=>{"use strict";bAt.exports=function t(e){if(Array.isArray(e))for(let r of e){if(r==null)continue;let n=r.$group||r.$bucket||r.$bucketAuto;if(n!=null)for(let a of Object.keys(n))A_n(n[a]);let i=Object.keys(r)[0];if(i&&typeof r[i]=="object"){let a=r[i];for(let s of Object.keys(a))a[s]!=null&&a[s].$function!=null&&typeof a[s].$function.body=="function"&&(a[s].$function.body=a[s].$function.body.toString())}if(r.$facet!=null)for(let a of Object.keys(r.$facet))t(r.$facet[a])}};function A_n(t){if(!(t==null||t.$accumulator==null))for(let e of["init","accumulate","merge","finalize"])typeof t.$accumulator[e]=="function"&&(t.$accumulator[e]=String(t.$accumulator[e]))}});var mxe=l((bSa,wAt)=>{"use strict";var EAt=mAt(),Cv=Ir(),SAt=YW(),{applyGlobalMaxTimeMS:x_n,applyGlobalDiskUse:T_n}=WAe(),O_n=_a(),C_n=v0(),hxe=pxe(),I_n=gAt(),vAt=zt(),{modelSymbol:M_n}=Mt(),P_n=SAt.prototype.read,R_n=SAt.prototype.readConcern,_At=new Set(["$$DESCEND","$$PRUNE","$$KEEP"]);function Vr(t,e){this._pipeline=[],e==null||e[M_n]?this._model=e:this._connection=e,this.options={},arguments.length===1&&Array.isArray(t)&&this.append.apply(this,t)}Vr.prototype.options;Vr.prototype._optionsForExec=function(){let t=this.options||{},e=this.model()?.db?.base.transactionAsyncLocalStorage?.getStore();return!Object.hasOwn(t,"session")&&e?.session!=null&&(t.session=e.session),t};Vr.prototype.model=function(t){return arguments.length===0?this._model:(this._model=t,t.schema!=null&&(this.options.readPreference==null&&t.schema.options.read!=null&&(this.options.readPreference=t.schema.options.read),this.options.collation==null&&t.schema.options.collation!=null&&(this.options.collation=t.schema.options.collation)),t)};Vr.prototype.append=function(){let t=arguments.length===1&&Array.isArray(arguments[0])?arguments[0]:[...arguments];if(!t.every(q_n))throw new Error("Arguments must be aggregate pipeline operators");return this._pipeline=this._pipeline.concat(t),this};Vr.prototype.addFields=function(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new Error("Invalid addFields() argument. Must be an object");return this.append({$addFields:Object.assign({},t)})};Vr.prototype.project=function(t){let e={};if(typeof t=="object"&&!Array.isArray(t))Object.keys(t).forEach(function(r){e[r]=t[r]});else if(arguments.length===1&&typeof t=="string")t.split(/\s+/).forEach(function(r){if(!r)return;let n=r[0]==="-"?0:1;n===0&&(r=r.substring(1)),e[r]=n});else throw new Error("Invalid project() argument. Must be string or object");return this.append({$project:e})};Vr.prototype.near=function(t){if(t==null)throw new Cv("Aggregate `near()` must be called with non-nullish argument");if(t.near==null)throw new Cv("Aggregate `near()` argument must have a `near` property");let e=Array.isArray(t.near)?t.near:t.near.coordinates;if(typeof t.near=="object"&&(!Array.isArray(e)||e.length<2||e.find(n=>typeof n!="number")))throw new Cv(`Aggregate \`near()\` argument has invalid coordinates, got "${e}"`);let r={};return r.$geoNear=t,this.append(r)};"group match skip limit out densify fill".split(" ").forEach(function(t){Vr.prototype[t]=function(e){let r={};return r["$"+t]=e,this.append(r)}});Vr.prototype.unwind=function(){let t=[...arguments],e=[];for(let r of t)if(r&&typeof r=="object")e.push({$unwind:r});else if(typeof r=="string")e.push({$unwind:r[0]==="$"?r:"$"+r});else throw new Error('Invalid arg "'+r+'" to unwind(), must be string or object');return this.append.apply(this,e)};Vr.prototype.replaceRoot=function(t){let e;return typeof t=="string"?e=t.startsWith("$")?t:"$"+t:e=t,this.append({$replaceRoot:{newRoot:e}})};Vr.prototype.count=function(t){return this.append({$count:t})};Vr.prototype.sortByCount=function(t){if(t&&typeof t=="object")return this.append({$sortByCount:t});if(typeof t=="string")return this.append({$sortByCount:t[0]==="$"?t:"$"+t});throw new TypeError('Invalid arg "'+t+'" to sortByCount(), must be string or object')};Vr.prototype.lookup=function(t){return this.append({$lookup:t})};Vr.prototype.graphLookup=function(t){let e={};if(t){if(!vAt.isObject(t))throw new TypeError("Invalid graphLookup() argument. Must be an object.");vAt.mergeClone(e,t);let r=e.startWith;r&&typeof r=="string"&&(e.startWith=e.startWith.startsWith("$")?e.startWith:"$"+e.startWith)}return this.append({$graphLookup:e})};Vr.prototype.sample=function(t){return this.append({$sample:{size:t}})};Vr.prototype.sort=function(t){let e={};if(C_n(t)==="Object"){let r=["desc","descending",-1];Object.keys(t).forEach(function(n){if(t[n]instanceof Object&&t[n].$meta){e[n]=t[n];return}e[n]=r.indexOf(t[n])===-1?1:-1})}else if(arguments.length===1&&typeof t=="string")t.split(/\s+/).forEach(function(r){if(!r)return;let n=r[0]==="-"?-1:1;n===-1&&(r=r.substring(1)),e[r]=n});else throw new TypeError("Invalid sort() argument. Must be a string or object.");return this.append({$sort:e})};Vr.prototype.unionWith=function(t){return this.append({$unionWith:t})};Vr.prototype.read=function(t,e){return P_n.call(this,t,e),this};Vr.prototype.readConcern=function(t){return R_n.call(this,t),this};Vr.prototype.redact=function(t,e,r){if(arguments.length===3){if(typeof e=="string"&&!_At.has(e)||typeof r=="string"&&!_At.has(r))throw new Error("If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP");t={$cond:{if:t,then:e,else:r}}}else if(arguments.length!==1)throw new TypeError("Invalid arguments");return this.append({$redact:t})};Vr.prototype.explain=async function(e){if(typeof e=="function"||typeof arguments[1]=="function")throw new Cv("Aggregate.prototype.explain() no longer accepts a callback");let r=this._model;if(!this._pipeline.length)throw new Error("Aggregate has empty pipeline");hxe(this._pipeline,this._model.schema);try{await r.hooks.execPre("aggregate",this)}catch(a){return await r.hooks.execPost("aggregate",this,[null],{error:a})}let n=r.collection.aggregate(this._pipeline,this.options);e==null&&(e=!0);let i=null;try{i=await n.explain(e)}catch(a){return await r.hooks.execPost("aggregate",this,[null],{error:a})}return await r.hooks.execPost("aggregate",this,[i],{error:null}),i};Vr.prototype.allowDiskUse=function(t){return this.options.allowDiskUse=t,this};Vr.prototype.hint=function(t){return this.options.hint=t,this};Vr.prototype.session=function(t){return t==null?delete this.options.session:this.options.session=t,this};Vr.prototype.option=function(t){for(let e in t)this.options[e]=t[e];return this};Vr.prototype.cursor=function(t){return this._optionsForExec(),this.options.cursor=t||{},new EAt(this)};Vr.prototype.collation=function(t){return this.options.collation=t,this};Vr.prototype.facet=function(t){return this.append({$facet:t})};Vr.prototype.search=function(t){return this.append({$search:t})};Vr.prototype.pipeline=function(){return this._pipeline};Vr.prototype.exec=async function(){if(!this._model&&!this._connection)throw new Error("Aggregate not bound to any Model");if(typeof arguments[0]=="function")throw new Cv("Aggregate.prototype.exec() no longer accepts a callback");if(this._connection){if(!this._pipeline.length)throw new Cv("Aggregate has empty pipeline");return this._optionsForExec(),await(await this._connection.client.db().aggregate(this._pipeline,this.options)).toArray()}let e=this._model,r=this._model.collection;if(x_n(this.options,e.db.options,e.base.options),T_n(this.options,e.db.options,e.base.options),this._optionsForExec(),this.options?.cursor)return new EAt(this);hxe(this._pipeline,this._model.schema),I_n(this._pipeline);try{await e.hooks.execPre("aggregate",this)}catch(a){return await e.hooks.execPost("aggregate",this,[null],{error:a})}if(!this._pipeline.length)throw new Cv("Aggregate has empty pipeline");let n=O_n(this.options||{}),i;try{i=await(await r.aggregate(this._pipeline,n)).toArray()}catch(a){return await e.hooks.execPost("aggregate",this,[null],{error:a})}return await e.hooks.execPost("aggregate",this,[i],{error:null}),i};Vr.prototype.then=function(t,e){return this.exec().then(t,e)};Vr.prototype.catch=function(t){return this.exec().then(null,t)};Vr.prototype.finally=function(t){return this.exec().finally(t)};Vr.prototype[Symbol.asyncIterator]=function(){return this.cursor({useMongooseAggCursor:!0}).transformNull()._transformForAsyncIterator()};function q_n(t){if(typeof t!="object"||t===null)return!1;let e=Object.keys(t);return e.length===1&&e[0][0]==="$"}Vr._prepareDiscriminatorPipeline=hxe;wAt.exports=Vr});var xAt=l((gSa,AAt)=>{"use strict";var N_n=_a(),ZW=class{constructor(e){e!=null&&Object.assign(this,N_n(e))}};ZW.prototype.__subdocs=null;AAt.exports=ZW});var OAt=l((vSa,TAt)=>{"use strict";TAt.exports=function t(e,r){let n=Object.keys(r.paths),i=n.length;for(let a=0;a<i;++a){let s="",o=n[a],u=r.paths[o],f=u.splitPath(),c=f.length,d=e;for(let h=0;h<c&&d!=null;++h){let p=f[h];if(s+=(s.length?".":"")+p,h===c-1){if(typeof d[p]<"u"){u.$isSingleNested?t(d[p],u.schema):u.$isMongooseDocumentArray&&Array.isArray(d[p])&&d[p].forEach(y=>t(y,u.schema));break}let m=u.getDefault(e,!1,{skipCast:!0});typeof m<"u"&&(d[p]=m,u.$isSingleNested?t(m,u.schema):u.$isMongooseDocumentArray&&Array.isArray(m)&&m.forEach(y=>t(y,u.schema)))}else d[p]==null&&(d[p]={}),d=d[p]}}}});var bxe=l((_Sa,CAt)=>{"use strict";CAt.exports=yxe;function yxe(t,e=new WeakSet,r=!1){if(!e.has(t)){e.add(t);for(let n of Object.keys(t.paths)){let i=t.paths[n];if(i.schema&&(yxe(i.schema,e),!!i.schema._applyDiscriminators&&!(i._appliedDiscriminators&&!r))){for(let a of i.schema._applyDiscriminators.keys()){let{schema:s,options:o}=i.schema._applyDiscriminators.get(a);yxe(s,e),i.discriminator(a,s,r?{...o,overwriteExisting:!0}:o)}i._appliedDiscriminators=!0}}}}});var MAt=l((ESa,IAt)=>{"use strict";IAt.exports=HR;HR.middlewareFunctions=["deleteOne","remove","save","updateOne","validate","init"];var D_n=new Set(HR.middlewareFunctions.flatMap(t=>[t,`$__${t}`]));function HR(t,e,r){r=r||{};let n={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},i=r.decorateDoc?t:t.prototype;t.$appliedHooks=!0;for(let u of Object.keys(e.paths)){let f=e.paths[u],c=null,d=gxe(f);if(d)c=d.childModel,f=d.type;else continue;if(!c.$appliedHooks&&(HR(c,f.schema,{...r,decorateDoc:!1,isChildSchema:!0}),c.discriminators!=null)){let h=Object.keys(c.discriminators);for(let p of h)HR(c.discriminators[p],c.discriminators[p].schema,r)}}let a=e._getDocumentMiddleware();t._middleware=a,i.$__init=a.createWrapperSync("init",i.$__init,null,n);let s=Object.keys(e.methods),o=Object.assign({},n,{checkForPromise:!0});for(let u of s){if(D_n.has(u)||!a.hasHooks(u))continue;let f=i[u];i[`$__${u}`]=i[u],i[u]=a.createWrapper(u,f,null,o)}}function gxe(t){if(t.$isSingleNested||t.$isMongooseDocumentArray)return{childModel:t.Constructor,type:t};if(t.instance==="Array"){let e=t.getEmbeddedSchemaType();if(e)return gxe(e)}if(t.instance==="Map"){let e=t.getEmbeddedSchemaType();if(e)return gxe(e)}return null}});var RAt=l((SSa,PAt)=>{"use strict";var k_n=$a(),$_n=zt();PAt.exports=function t(e,r){let n=vxe();function i(a,s){Object.defineProperty(e.prototype,a,{get:function(){let o={};for(let u in s.methods[a])o[u]=s.methods[a][u].bind(this);return o},configurable:!0})}for(let a of Object.keys(r.methods)){let s=r.methods[a];if(Object.hasOwn(r.tree,a))throw new Error('You have a method and a property in your schema both named "'+a+'"');if(typeof s=="function"&&n.prototype[a]===s){delete r.methods[a];continue}r.reserved[a]&&!k_n(r,`methodOptions.${a}.suppressWarning`,!1)&&$_n.warn(`mongoose: the method name "${a}" 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('${a}', fn, { suppressWarning: true })\`.`),typeof s=="function"?e.prototype[a]=s:i(a,r)}e.$appliedMethods=!0;for(let a of Object.keys(r.paths)){let s=r.paths[a];s.$isSingleNested&&!s.Constructor.$appliedMethods&&t(s.Constructor,s.schema),s.$isMongooseDocumentArray&&!s.Constructor.$appliedMethods&&t(s.Constructor,s.schema)}}});var DAt=l((wSa,NAt)=>{"use strict";var qAt=SSe(),B_n=w9(),F_n=VW(),eG=zt().isPOJO;NAt.exports=function(e,r,n){if(r==null||e==null)return e;let i=null;return F_n(r)?i=!1:B_n(r)&&(i=!0),i==null?e:i?(n=n||qAt(r),XW(e,r,n)):(n=n||qAt(r),QW(e,r,n))};function XW(t,e,r,n,i){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>XW(s,e,r,n,i));let a={...t};n=i?n||{}:e;for(let s of Object.keys(a)){let o=i?i+"."+s:s;Object.hasOwn(e,o)||Object.hasOwn(n,s)?eG(e[o])||eG(n[s])?a[s]=XW(a[s],e,r,n[s],o):delete a[s]:r[o]&&(a[s]=XW(a[s],e,r,n[s],o))}return a}function QW(t,e,r,n,i){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>QW(s,e,r,n,i));let a={...t};n=i?n||{}:e;for(let s of Object.keys(a)){let o=i?i+"."+s:s;if(Object.hasOwn(e,o)||Object.hasOwn(n,s)){(eG(e[o])||eG(n[s]))&&(a[s]=QW(a[s],e,r,n[s],o));continue}else r[o]?a[s]=QW(a[s],e,r,n[s],o):delete a[s]}return a}});var $At=l((ASa,kAt)=>{"use strict";kAt.exports=function(e){let r=!1;for(let n of Object.keys(e))e[n]==="text"&&(r=!0);return r}});var FAt=l((xSa,BAt)=>{"use strict";var L_n=$At();BAt.exports=function(e,r,n){L_n(e)||Object.hasOwn(n,"collation")&&!Object.hasOwn(r,"collation")&&(r.collation=n.collation)}});var jAt=l((TSa,LAt)=>{"use strict";var{queryMiddlewareFunctions:j_n,aggregateMiddlewareFunctions:U_n,modelMiddlewareFunctions:V_n,documentMiddlewareFunctions:H_n}=cR(),z_n=Array.from(new Set([...j_n,...U_n,...V_n,...H_n]));LAt.exports=function(e,r,n){r=r.filter(i=>z_n.indexOf(i.name)!==-1?!!i.model:i.model!==!1);for(let i of Object.keys(n))if(r.hasHooks(i)){let a=e[i];e[i]=r.createWrapper(i,a)}}});var VAt=l((OSa,UAt)=>{"use strict";UAt.exports=function(e,r){for(let n in r.statics)e[n]=r.statics[n]}});var KAt=l((CSa,GAt)=>{"use strict";var HAt=Kz(),W_n=bl(),G_n=zt();GAt.exports=zAt;function zAt(t,e,r){return e==null?e:(K_n(t,e,r),WAt(t,e,r))}function K_n(t,e,r){for(let n of t.childSchemas){let i=n.model.path,a=n.schema;if(!i)continue;let s=W_n.get(i,e);s==null||Array.isArray(s)&&s.flat(1/0).length===0||zAt(a,s,r)}}function WAt(t,e,r){if(e==null||typeof e!="object")return;if(Array.isArray(e)){for(let o of e)WAt(t,o,r);return}if(t.discriminators&&G_n.hasOwnKeys(t.discriminators))for(let o of Object.keys(t.discriminators)){let u=t.discriminators[o],f=u.discriminatorMapping.key,c=u.discriminatorMapping.value;if(e[f]==c){t=u;break}}let n=HAt(t.options.timestamps,"createdAt"),i=HAt(t.options.timestamps,"updatedAt"),a=r?.currentTime,s=null;a!=null?s=a():t.base?.now?s=t.base.now():s=new Date,n&&e[n]==null&&!r?.isUpdate&&(e[n]=s),i&&(e[i]=s)}});var ZAt=l((ISa,JAt)=>{"use strict";var Y_n=bl(),J_n=zt();JAt.exports=YAt;function YAt(t,e,r){if(e==null)return e;let n=r,i=null;if(Array.isArray(r)){n=[],i=[];for(let a of r)a.length===1?i.push(a[0]):n.push(a)}return Z_n(t,e,n),_xe(t,e,i)}function Z_n(t,e,r){let n=!1;for(let i of t.childSchemas){let a=i.model.path,s=i.schema;if(!a)continue;let o=Y_n.get(a,e);if(o==null||Array.isArray(o)&&o.flat(1/0).length===0)continue;let u=null;if(Array.isArray(r)){u=[];for(let f of r)f[0]==a&&u.push(f.slice(1));if(u.length===0)continue}YAt(s,o,u),n=!0}r?.length&&!n&&_xe(t,e,r)}function _xe(t,e,r){if(!(e==null||typeof e!="object")){if(Array.isArray(e)){for(let n of e)_xe(t,n,r);return}if(t.discriminators&&J_n.hasOwnKeys(t.discriminators))for(let n of Object.keys(t.discriminators)){let i=t.discriminators[n],a=i.discriminatorMapping.key,s=i.discriminatorMapping.value;if(e[a]==s){t=i;break}}r==null&&(r=Object.keys(t.virtuals));for(let n of r){if(t.virtuals[n]==null)continue;let i=t.virtuals[n],a=Array.isArray(n)?n:n.indexOf(".")===-1?[n]:n.split("."),s=e;for(let f=0;f<a.length-1;++f)s[a[f]]=a[f]in s?s[a[f]]:{},s=s[a[f]];let o=i.applyGetters(s[a[a.length-1]],e);(i.options?.ref||i.options?.refPath)&&o===void 0&&(i.options.justOne?o=null:o=[]),s[a[a.length-1]]=o}}}});var tG=l((MSa,XAt)=>{"use strict";XAt.exports=function t(e){return this instanceof t?(this.val=e,this):new t(e)}});var zR=l((PSa,QAt)=>{"use strict";QAt.exports=new WeakMap});var nxt=l((RSa,rxt)=>{"use strict";var X_n=_a(),ext=zR(),Q_n=Mt().modelSymbol,e8n=zt();rxt.exports=txt;var rG=Symbol("mongoose#assignRawDocsToIdStructure#hasArray");function txt(t,e,r,n,i){let a=[],s=n.isVirtual&&n.justOne&&t.length>1?!1:n.sort&&t.length>1,o=n.$nullIfNotFound,u,f,c;e8n.isMongooseArray(t)&&(t=t.__array);let d=0,h=t.length;if(s&&i&&n[rG]===void 0){n[rG]=!1;for(let p in r)if(Array.isArray(r[p])){n[rG]=!0;break}}for(d=0;d<h;++d){if(c=t[d],Array.isArray(c)){txt(c,e,r,n,!0),a.push(c);continue}if(c===null&&s===!1){a.push(c);continue}if(f=String(c),u=e[f],n.clone&&u!=null)if(n.lean){let p=ext.get(u);u=X_n(u),ext.set(u,p)}else u=u.constructor.hydrate(u._doc);if(i)if(u)if(s){let p=r[f];n[rG]?a.push(u):a[p]=u}else a.push(u);else c?.[Q_n]!=null?a.push(c):a.push(n.retainNullValues||o?null:c);else a[d]=u||null}t.length=0,a.length&&a.forEach(function(p,m){t[m]=p})}});var Exe=l((qSa,ixt)=>{"use strict";ixt.exports=nG;function nG(t,e){if(t.virtuals[e])return{virtual:t.virtuals[e],path:void 0};let r=e.split("."),n="",i="";for(let a=0;a<r.length;++a){if(n+=(n.length>0?".":"")+r[a],t.virtuals[n]){if(a===r.length-1)return{virtual:t.virtuals[n],path:i};continue}if(!t.nested[n]){if(t.paths[n]&&t.paths[n].schema){t=t.paths[n].schema;let s=r.slice(a+1).join(".");if(t.virtuals[s]){if(a===r.length-2)return{virtual:t.virtuals[s],nestedSchemaPath:[i,n].filter(o=>!!o).join(".")};continue}if(a+1<r.length&&t.discriminators)for(let o of Object.keys(t.discriminators)){let u=nG(t.discriminators[o],s);if(u!=null){let f=[i,n,u.nestedSchemaPath].filter(c=>!!c).join(".");return{virtual:u.virtual,nestedSchemaPath:f}}}i+=(i.length>0?".":"")+n,n="";continue}else if(t.paths[n]?.$isSchemaMap&&t.paths[n].$__schemaType?.schema){t=t.paths[n].$__schemaType.schema,++a;let s=r.slice(a+1).join(".");if(t.virtuals[s]){if(a===r.length-2)return{virtual:t.virtuals[s],nestedSchemaPath:[i,n,"$*"].filter(o=>!!o).join(".")};continue}if(a+1<r.length&&t.discriminators)for(let o of Object.keys(t.discriminators)){let u=nG(t.discriminators[o],s);if(u!=null){let f=[i,n,u.nestedSchemaPath,"$*"].filter(c=>!!c).join(".");return{virtual:u.virtual,nestedSchemaPath:f}}}i+=(i.length>0?".":"")+"$*"+n,n=""}if(t.discriminators)for(let s of Object.keys(t.discriminators)){let o=nG(t.discriminators[s],e);if(o)return o}return null}}}});var sxt=l((iG,axt)=>{(function(t,e){typeof iG=="object"&&typeof axt<"u"?e(iG):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.sift={}))})(iG,(function(t){"use strict";var e=function($,G){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ne,pe){ne.__proto__=pe}||function(ne,pe){for(var De in pe)Object.prototype.hasOwnProperty.call(pe,De)&&(ne[De]=pe[De])},e($,G)};function r($,G){if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");e($,G);function ne(){this.constructor=$}$.prototype=G===null?Object.create(G):(ne.prototype=G.prototype,new ne)}typeof SuppressedError=="function"&&SuppressedError;var n=function($){var G="[object "+$+"]";return function(ne){return i(ne)===G}},i=function($){return Object.prototype.toString.call($)},a=function($){return $ instanceof Date?$.getTime():o($)?$.map(a):$&&typeof $.toJSON=="function"?$.toJSON():$},s=function($){return $??null},o=n("Array"),u=n("Object"),f=n("Function"),c=function($,G){return $.hasOwnProperty(G)&&!f($[G])},d=function($){return $&&($.constructor===Object||$.constructor===Array||$.constructor.toString()==="function Object() { [native code] }"||$.constructor.toString()==="function Array() { [native code] }")&&!$.toJSON},h=function($,G){if($==null&&$==G||$===G)return!0;if(Object.prototype.toString.call($)!==Object.prototype.toString.call(G))return!1;if(o($)){if($.length!==G.length)return!1;for(var ne=0,pe=$.length;ne<pe;ne++)if(!h($[ne],G[ne]))return!1;return!0}else if(u($)){if(Object.keys($).length!==Object.keys(G).length)return!1;for(var De in $)if(!h($[De],G[De]))return!1;return!0}return!1},p=function($,G,ne,pe,De,Be){var xe=G[pe];if(o($)&&isNaN(Number(xe))&&!c($,xe)){for(var ke=0,Xe=$.length;ke<Xe;ke++)if(!p($[ke],G,ne,pe,ke,$))return!1}return pe===G.length||$==null?ne($,De,Be,pe===0,pe===G.length):p($[xe],G,ne,pe+1,xe,$)},m=(function(){function $(G,ne,pe,De){this.params=G,this.owneryQuery=ne,this.options=pe,this.name=De,this.init()}return $.prototype.init=function(){},$.prototype.reset=function(){this.done=!1,this.keep=!1},$})(),y=(function($){r(G,$);function G(ne,pe,De,Be){var xe=$.call(this,ne,pe,De)||this;return xe.children=Be,xe}return G.prototype.reset=function(){this.keep=!1,this.done=!1;for(var ne=0,pe=this.children.length;ne<pe;ne++)this.children[ne].reset()},G.prototype.childrenNext=function(ne,pe,De,Be,xe){for(var ke=!0,Xe=!0,st=0,Pe=this.children.length;st<Pe;st++){var Fr=this.children[st];if(Fr.done||Fr.next(ne,pe,De,Be,xe),Fr.keep||(Xe=!1),Fr.done){if(!Fr.keep)break}else ke=!1}this.done=ke,this.keep=Xe},G})(m),b=(function($){r(G,$);function G(ne,pe,De,Be,xe){var ke=$.call(this,ne,pe,De,Be)||this;return ke.name=xe,ke}return G})(y),v=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.next=function(ne,pe,De,Be){this.childrenNext(ne,pe,De,Be)},G})(y),E=(function($){r(G,$);function G(ne,pe,De,Be,xe){var ke=$.call(this,pe,De,Be,xe)||this;return ke.keyPath=ne,ke.propop=!0,ke._nextNestedValue=function(Xe,st,Pe,Fr,ci){return ke.childrenNext(Xe,st,Pe,Fr,ci),!ke.done},ke}return G.prototype.next=function(ne,pe,De){p(ne,this.keyPath,this._nextNestedValue,0,pe,De)},G})(y),x=function($,G){if($ instanceof Function)return $;if($ instanceof RegExp)return function(pe){var De=typeof pe=="string"&&$.test(pe);return $.lastIndex=0,De};var ne=a($);return function(pe){return G(ne,a(pe))}},w=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.init=function(){this._test=x(this.params,this.options.compare)},G.prototype.next=function(ne,pe,De){(!Array.isArray(De)||De.hasOwnProperty(pe))&&this._test(ne,pe,De)&&(this.done=!0,this.keep=!0)},G})(m),M=function($,G,ne){return new w($,G,ne)},N=function($){return function(G,ne,pe,De){return $(G,ne,pe,De)}},P=function($){return N(function(G,ne,pe,De){var Be=typeof a(G),xe=$(G);return new w(function(ke){var Xe=s(ke);return typeof a(Xe)===Be&&xe(Xe)},ne,pe,De)})},k=function($,G,ne,pe){var De=pe.operations[$];return De||R($),De(G,ne,pe,$)},R=function($){throw new Error("Unsupported operation: ".concat($))},U=function($,G){for(var ne in $)if(G.operations.hasOwnProperty(ne)||ne.charAt(0)==="$")return!0;return!1},F=function($,G,ne,pe,De){if(U(G,De)){var Be=J(G,ne,De),xe=Be[0],ke=Be[1];if(ke.length)throw new Error("Property queries must contain only operations, or exact objects.");return new E($,G,pe,De,xe)}return new E($,G,pe,De,[new w(G,pe,De)])},V=function($,G,ne){G===void 0&&(G=null);var pe=ne===void 0?{}:ne,De=pe.compare,Be=pe.operations,xe={compare:De||h,operations:Object.assign({},Be||{})},ke=J($,null,xe),Xe=ke[0],st=ke[1],Pe=[];return Xe.length&&Pe.push(new E([],$,G,xe,Xe)),Pe.push.apply(Pe,st),Pe.length===1?Pe[0]:new v($,G,xe,Pe)},J=function($,G,ne){var pe=[],De=[];if(!d($))return pe.push(new w($,$,ne)),[pe,De];for(var Be in $)if(ne.operations.hasOwnProperty(Be)){var xe=k(Be,$[Be],$,ne);if(xe&&!xe.propop&&G&&!ne.operations[G])throw new Error("Malformed query. ".concat(Be," cannot be matched against property."));xe!=null&&pe.push(xe)}else Be.charAt(0)==="$"?R(Be):De.push(F(Be.split("."),$[Be],Be,$,ne));return[pe,De]},z=function($){return function(G,ne,pe){return $.reset(),$.next(G,ne,pe),$.keep}},re=function($,G){return G===void 0&&(G={}),z(V($,null,G))},K=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.init=function(){this._test=x(this.params,this.options.compare)},G.prototype.reset=function(){$.prototype.reset.call(this),this.keep=!0},G.prototype.next=function(ne){this._test(ne)&&(this.done=!0,this.keep=!1)},G})(m),ie=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.init=function(){if(!this.params||typeof this.params!="object")throw new Error("Malformed query. $elemMatch must by an object.");this._queryOperation=V(this.params,this.owneryQuery,this.options)},G.prototype.reset=function(){$.prototype.reset.call(this),this._queryOperation.reset()},G.prototype.next=function(ne){if(o(ne)){for(var pe=0,De=ne.length;pe<De;pe++){this._queryOperation.reset();var Be=ne[pe];this._queryOperation.next(Be,pe,ne,!1),this.keep=this.keep||this._queryOperation.keep}this.done=!0}else this.done=!1,this.keep=!1},G})(m),D=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.init=function(){this._queryOperation=V(this.params,this.owneryQuery,this.options)},G.prototype.reset=function(){$.prototype.reset.call(this),this._queryOperation.reset()},G.prototype.next=function(ne,pe,De,Be){this._queryOperation.next(ne,pe,De,Be),this.done=this._queryOperation.done,this.keep=!this._queryOperation.keep},G})(m),I=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.init=function(){},G.prototype.next=function(ne){o(ne)&&ne.length===this.params&&(this.done=!0,this.keep=!0)},G})(m),H=function($){if($.length===0)throw new Error("$and/$or/$nor must be a nonempty array")},Z=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!1,ne}return G.prototype.init=function(){var ne=this;H(this.params),this._ops=this.params.map(function(pe){return V(pe,null,ne.options)})},G.prototype.reset=function(){this.done=!1,this.keep=!1;for(var ne=0,pe=this._ops.length;ne<pe;ne++)this._ops[ne].reset()},G.prototype.next=function(ne,pe,De){for(var Be=!1,xe=!1,ke=0,Xe=this._ops.length;ke<Xe;ke++){var st=this._ops[ke];if(st.next(ne,pe,De),st.keep){Be=!0,xe=st.keep;break}}this.keep=xe,this.done=Be},G})(m),W=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!1,ne}return G.prototype.next=function(ne,pe,De){$.prototype.next.call(this,ne,pe,De),this.keep=!this.keep},G})(Z),se=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.init=function(){var ne=this,pe=Array.isArray(this.params)?this.params:[this.params];this._testers=pe.map(function(De){if(U(De,ne.options))throw new Error("cannot nest $ under ".concat(ne.name.toLowerCase()));return x(De,ne.options.compare)})},G.prototype.next=function(ne,pe,De){for(var Be=!1,xe=!1,ke=0,Xe=this._testers.length;ke<Xe;ke++){var st=this._testers[ke];if(st(ne)){Be=!0,xe=!0;break}}this.keep=xe,this.done=Be},G})(m),be=(function($){r(G,$);function G(ne,pe,De,Be){var xe=$.call(this,ne,pe,De,Be)||this;return xe.propop=!0,xe._in=new se(ne,pe,De,Be),xe}return G.prototype.next=function(ne,pe,De,Be){this._in.next(ne,pe,De),o(De)&&!Be?this._in.keep?(this.keep=!1,this.done=!0):pe==De.length-1&&(this.keep=!0,this.done=!0):(this.keep=!this._in.keep,this.done=!0)},G.prototype.reset=function(){$.prototype.reset.call(this),this._in.reset()},G})(m),_e=(function($){r(G,$);function G(){var ne=$!==null&&$.apply(this,arguments)||this;return ne.propop=!0,ne}return G.prototype.next=function(ne,pe,De,Be,xe){xe?De.hasOwnProperty(pe)===this.params&&(this.done=!0,this.keep=!0):(this.done=!0,this.keep=!this.params)},G})(m),dt=(function($){r(G,$);function G(ne,pe,De,Be){var xe=$.call(this,ne,pe,De,ne.map(function(ke){return V(ke,pe,De)}),Be)||this;return xe.propop=!1,H(ne),xe}return G.prototype.next=function(ne,pe,De,Be){this.childrenNext(ne,pe,De,Be)},G})(b),ln=(function($){r(G,$);function G(ne,pe,De,Be){var xe=$.call(this,ne,pe,De,ne.map(function(ke){return V(ke,pe,De)}),Be)||this;return xe.propop=!0,xe}return G.prototype.next=function(ne,pe,De,Be){this.childrenNext(ne,pe,De,Be)},G})(b),rr=function($,G,ne){return new w($,G,ne)},yr=function($,G,ne,pe){return new K($,G,ne,pe)},vr=function($,G,ne,pe){return new Z($,G,ne,pe)},Yi=function($,G,ne,pe){return new W($,G,ne,pe)},li=function($,G,ne,pe){return new ie($,G,ne,pe)},Li=function($,G,ne,pe){return new be($,G,ne,pe)},Ca=function($,G,ne,pe){return new se($,G,ne,pe)},_s=P(function($){return function(G){return G!=null&&G<$}}),lu=P(function($){return function(G){return G===$||G<=$}}),fo=P(function($){return function(G){return G!=null&&G>$}}),Po=P(function($){return function(G){return G===$||G>=$}}),ha=function($,G,ne){var pe=$[0],De=$[1];return new w(function(Be){return a(Be)%pe===De},G,ne)},Ha=function($,G,ne,pe){return new _e($,G,ne,pe)},Ro=function($,G,ne){return new w(new RegExp($,G.$options),G,ne)},Ll=function($,G,ne,pe){return new D($,G,ne,pe)},Mm={number:function($){return typeof $=="number"},string:function($){return typeof $=="string"},bool:function($){return typeof $=="boolean"},array:function($){return Array.isArray($)},null:function($){return $===null},timestamp:function($){return $ instanceof Date}},za=function($,G,ne){return new w(function(pe){if(typeof $=="string"){if(!Mm[$])throw new Error("Type alias does not exist");return Mm[$](pe)}return pe!=null?pe instanceof $||pe.constructor===$:!1},G,ne)},jl=function($,G,ne,pe){return new dt($,G,ne,pe)},q0=function($,G,ne,pe){return new ln($,G,ne,pe)},Ul=function($,G,ne){return new I($,G,ne,"$size")},cn=function(){return null},Pm=function($,G,ne){var pe;if(f($))pe=$;else if(!process.env.CSP_ENABLED)pe=new Function("obj","return "+$);else throw new Error('In CSP mode, sift does not support strings in "$where" condition');return new w(function(De){return pe.bind(De)(De)},G,ne)},Gc=Object.freeze({__proto__:null,$Size:I,$all:q0,$and:jl,$elemMatch:li,$eq:rr,$exists:Ha,$gt:fo,$gte:Po,$in:Ca,$lt:_s,$lte:lu,$mod:ha,$ne:yr,$nin:Li,$nor:Yi,$not:Ll,$options:cn,$or:vr,$regex:Ro,$size:Ul,$type:za,$where:Pm}),ce=function($,G,ne){var pe=ne===void 0?{}:ne,De=pe.compare,Be=pe.operations;return V($,G,{compare:De,operations:Object.assign({},Gc,Be||{})})},me=function($,G){G===void 0&&(G={});var ne=ce($,null,G);return z(ne)};t.$Size=I,t.$all=q0,t.$and=jl,t.$elemMatch=li,t.$eq=rr,t.$exists=Ha,t.$gt=fo,t.$gte=Po,t.$in=Ca,t.$lt=_s,t.$lte=lu,t.$mod=ha,t.$ne=yr,t.$nin=Li,t.$nor=Yi,t.$not=Ll,t.$options=cn,t.$or=vr,t.$regex=Ro,t.$size=Ul,t.$type=za,t.$where=Pm,t.EqualsOperation=w,t.createDefaultQueryOperation=ce,t.createEqualsOperation=M,t.createOperationTester=z,t.createQueryOperation=V,t.createQueryTester=re,t.default=me,Object.defineProperty(t,"__esModule",{value:!0})}))});var uxt=l((NSa,Sxe)=>{var oxt=sxt();Sxe.exports=oxt.default;Object.assign(Sxe.exports,oxt)});var hxt=l((DSa,pxt)=>{"use strict";var t8n=Jz(),r8n=tG(),n8n=nxt(),aG=$a(),i8n=Exe(),dxt=zR(),fxt=Wz(),a8n=ISe(),wxe=bl(),lxt=uxt().default,sG=zt(),{populateModelSymbol:s8n}=Mt();pxt.exports=function(e){let r=Object.assign({},aG(e,"allOptions.options.options"),aG(e,"allOptions.options")),n=Object.assign({},e.options,r,{justOne:e.justOne,isVirtual:e.isVirtual});n.$nullIfNotFound=e.isVirtual;let i=e.populatedModel,a=[].concat(e.rawIds);e.allIds=[].concat(e.allIds),n8n(e.rawIds,e.rawDocs,e.rawOrder,n);let s=e.docs,o=e.rawIds,u=e.options,f=e.count&&e.isVirtual,c,d=0;function h(p){if(++d,f)return p;if(p instanceof r8n)return p.val;if(p===void 0)return p;let m=e.allIds[c];if(e.path.endsWith(".$*"))return WR(p,u,n,m);if(e.justOne===!0&&Array.isArray(p)){let y=[];for(let b of p){let v=dxt.get(b);(v==null||v===i)&&y.push(b)}for(;p.length>y.length;)Array.prototype.pop.apply(p,[]);for(let b=0;b<y.length;++b)p[b]=y[b];return WR(p[0],u,n,m)}else{if(e.justOne===!1&&!Array.isArray(p))return WR([p],u,n,m);if(e.justOne===!0&&!Array.isArray(p)&&Array.isArray(m))return WR(p,u,n,p==null?p:m[d-1])}return WR(p,u,n,m)}for(c=0;c<s.length;++c){d=0;let p=e.path.endsWith(".$*")?e.path.slice(0,-3):e.path,m=wxe.get(p,s[c],fxt);if(m==null&&!i8n(e.originalModel.schema,p))continue;let y;f?y=o8n(o[c]):Array.isArray(e.match)?y=Array.isArray(o[c])?o[c].filter(M=>M==null||lxt(e.match[c])(M)):[o[c]].filter(M=>M==null||lxt(e.match[c])(M))[0]:y=o[c];let b=e.originalModel.schema,v=aG(s[c],"$__",null)!=null,E=v?m instanceof Map:sG.isPOJO(m);if(E=E&&aG(b._getSchema(p),"$isSchemaMap"),!e.isVirtual&&E){let M=m instanceof Map?Array.from(m.keys()):Object.keys(m);y=y.reduce((N,P,k)=>(N.set(M[k],P),N),new Map)}if(v&&Array.isArray(y))for(let M of y)M?.$__!=null&&(M.$__.parent=s[c]);else v&&y?.$__!=null&&(y.$__.parent=s[c]);if(e.isVirtual&&v){s[c].$populated(p,e.justOne?a[0]:a,e.allOptions),Array.isArray(y)&&(y=y.map(M=>M??void 0)),wxe.set(p,y,s[c],function(N,P,k){return arguments.length>=3?(N[P]=k,N[P]):N instanceof Map&&P==="$*"?[...N.values()]:N[P]},h,!1);continue}let x=p.split("."),w=s[c];for(let M=0;M<x.length-1&&!(Array.isArray(w)&&!sG.isArrayIndex(x[M])||x[M]==="$*");++M){if(w[x[M]]==null){let N=x.slice(0,M+1).join("."),P=b._getSchema(N);if(y==null&&P?.$isMongooseArray)break;w[x[M]]={}}if(w=w[x[M]],typeof w!="object")break}s[c].$__&&(e.allOptions.options[s8n]=e.allOptions.model,s[c].$populated(p,e.unpopulatedValues[c],e.allOptions.options),y?.$__!=null&&(y.$__.wasPopulated={value:e.unpopulatedValues[c]}),y instanceof Map&&!y.$isMongooseMap&&(y=new t8n(y,p,s[c],s[c].schema.path(p).$__schemaType))),wxe.set(p,y,s[c],fxt,h,!1),s[c].$__&&a8n(s[c],[e.allOptions.options])}};function o8n(t){return Array.isArray(t)?t.some(e=>Array.isArray(e)||e===null)?t.map(e=>e==null?0:Array.isArray(e)?e.filter(r=>r!=null).length:1):t.filter(e=>e!=null).length:t==null?0:1}function WR(t,e,r,n){let i=typeof r.transform=="function",a=i?r.transform:s=>s;if(Array.isArray(t)){let s=[],o=t.length;for(let c=0;c<o;++c){let d=t[c],h=Array.isArray(n)?n[c]:n;if(!(!Axe(d)&&(!r.retainNullValues||d!=null)&&!i)){{if(!r.retainNullValues&&d==null)continue;i&&(d=a(Axe(d)?d:null,h))}if(cxt(d,e),s.push(d),e.originalLimit&&s.length>=e.originalLimit)break}}let u=s.length;for(;t.length>u;)Array.prototype.pop.apply(t,[]);let f=0;if(sG.isMongooseArray(t))for(f=0;f<u;++f)t.set(f,s[f],!0);else for(f=0;f<u;++f)t[f]=s[f];return t}return Axe(t)||sG.isPOJO(t)?(cxt(t,e),a(t,n)):t instanceof Map?t:r.justOne===!1?[]:t==null?a(t,n):a(null,n)}function cxt(t,e){t!=null&&e.excludeId&&(typeof t.$__setValue=="function"?delete t._doc._id:delete t._id)}function Axe(t){return t==null?!1:Array.isArray(t)||t.$isMongooseMap||t.$__!=null||dxt.has(t)}});var gxt=l((kSa,bxt)=>{"use strict";var u8n=tG(),f8n=PSe(),{trusted:oG}=b9(),mxt=zW();bxt.exports=function(e,r,n,i,a){let s=l8n(r);if(n.size===1){let o=Array.from(n)[0],u=i.schema.path(o);if(o!=="_id"||!s._id)e=yxt(e,u,a),s[o]=oG({$in:e});else if(o==="_id"&&s._id){let c=mxt(s[o])?s[o]:{$eq:s[o]};s[o]={...oG({$in:e}),...c}}let f=f8n(o);for(let c=0;c<f.length-1;++c){let d=f[c];if(s[d]!=null&&s[d].$elemMatch!=null){s[d].$elemMatch[o.slice(d.length+1)]=oG({$in:e}),delete s[o];break}}}else{let o=[];Array.isArray(s.$or)?(s.$and=[{$or:s.$or},{$or:o}],delete s.$or):s.$or=o;for(let u of n)if(u!=="_id"||!s._id){let f=i.schema.path(u);e=yxt(e,f,a),o.push({[u]:{$in:e}})}else if(u==="_id"&&s._id){let f=mxt(s[u])?s[u]:{$eq:s[u]};s[u]={...oG({$in:e}),...f}}}return s};function yxt(t,e,r){return t=t.filter(n=>!(n instanceof u8n)),r?t.filter(n=>{try{return e.cast(n),!0}catch{return!1}}):t}function l8n(t){return Array.isArray(t)?t.length>1?{$or:[].concat(t.map(e=>Object.assign({},e)))}:Object.assign({},t[0]):Object.assign({},t)}});var _xt=l(($Sa,vxt)=>{"use strict";vxt.exports=function(e,r,n){if(e.length===0)return n();let i=e.length,a=null;for(let s of e)r(s,function(o){if(a==null){if(o!=null)return a=o,n(a);if(--i<=0)return n()}})}});var Axt=l((BSa,wxt)=>{"use strict";var Ext=cv(),c8n=$a(),d8n=gc(),Sxt=zR(),Z9=bl(),p8n=Mt().populateModelSymbol;wxt.exports=function t(e,r,n,i){let a=r.path(i),s=n;if(a)return a;let o=r.discriminatorMapping?.key;if(o&&e!=null){if(n?.[o]!=null)r=d8n(e.discriminators,n[o])?.schema||r;else if(e.discriminators!=null)return Object.keys(e.discriminators).reduce((c,d)=>{let h=e.discriminators[d];return c.concat(t(h,h.schema,null,i))},[])}function u(c,d,h,p){let m=c.length+1,y,b;for(;m--;){if(b=c.slice(0,m).join("."),y=d.path(b),y==null)continue;if(y.embeddedSchemaType||y.schema){if(y.embeddedSchemaType instanceof Ext)return y.embeddedSchemaType;let x=null;if(y.schema?.discriminators!=null){let w=y.schema.discriminators,M=b+"."+y.schema.options.discriminatorKey,N=h?Z9.get(M,h)||[]:[];x=Object.keys(w).reduce(function(P,k){let R=w[k].discriminatorMapping.value;return(n==null||N.indexOf(k)!==-1||N.indexOf(R)!==-1)&&P.push(w[k]),P},[])}if(m!==c.length&&y.schema){let w;if(c[m]==="$")return m+1===c.length?y:(w=u(c.slice(m+1),d,h?Z9.get(b,h):null,p.concat(c.slice(0,m))),w&&(w.$parentSchemaDocArray=w.$parentSchemaDocArray||(y.schema.$isSingleNested?null:y)),w);if(x!=null&&x.length>0){w=[];for(let M of x){let N=u(c.slice(m),M,h?Z9.get(b,h):null,p.concat(c.slice(0,m)));N!=null&&(N.$parentSchemaDocArray=N.$parentSchemaDocArray||(y.schema.$isSingleNested?null:y),N.$parentSchemaDocArray&&(w.$parentSchemaDocArray=N.$parentSchemaDocArray),w.push(N))}return w}else return w=u(c.slice(m),y.schema,h?Z9.get(b,h):null,p.concat(c.slice(0,m))),w&&(w.$parentSchemaDocArray=w.$parentSchemaDocArray||(y.schema.$isSingleNested?null:y)),w}else if(m!==c.length&&y.$isMongooseArray&&y.embeddedSchemaType.$isMongooseArray){let w=y;for(;w.$isMongooseArray&&!w.$isMongooseDocumentArray;)w=w.embeddedSchemaType;let M=u(c.slice(m),w.schema,null,p.concat(c.slice(0,m)));if(M!=null)return M;if(w.schema.discriminators){let N=[];for(let P of Object.keys(w.schema.discriminators)){let k=w.schema.discriminators[P]||w.schema,R=u(c.slice(m),k,null,p.concat(c.slice(0,m)));R!=null&&N.push(R)}if(N.length>0)return N}}}else if(y.$isSchemaMap&&y.$__schemaType instanceof Ext)return y.$__schemaType;let v=p.concat([b]).join(".");if(s?.$__&&s.$populated(v,!0)&&m<c.length){let x=s.$populated(v,!0).options[p8n];if(x!=null)return u(c.slice(m),x.schema,h?Z9.get(b,h):null,p.concat(c.slice(0,m)))}let E=c8n(s,b);if(E!=null){let w=(Array.isArray(E)&&E.length>0?Sxt.get(E[0]):Sxt.get(E))?.schema??null;if(w!=null){let M=u(c.slice(m),w,h?Z9.get(b,h):null,p.concat(c.slice(0,m)));if(M!=null)return M.$parentSchemaDocArray=M.$parentSchemaDocArray||(w.$isSingleNested?null:w),M}}return y}}let f=i.split(".");for(let c=0;c<f.length;++c)f[c]==="$"&&(f[c]="0");return u(f,r,n,[])}});var Mxt=l((FSa,Ixt)=>{"use strict";var Mxe=ml(),h8n=tG(),m8n=_a(),Ec=$a(),y8n=gc(),b8n=v0(),xxt=Axt(),g8n=Exe(),GR=Wz(),Iv=bl(),uG=swe(),Eo=zt(),Oxe=Mt().modelSymbol,xxe=Mt().populateModelSymbol,Cxe=lv().schemaMixedSymbol,v8n=ySe();Ixt.exports=function(e,r,n){let i,a=r.length,s=[],o=n.model?.modelName||n.model,u,f,c,d,h={},p=e.schema;if(n._localModel!=null&&n._localModel.schema.nested[n.path])return[];let m=g8n(e.schema,n.path);if((m==null?null:m.virtual)!=null)return _8n(e,r,n,m);let b=xxt(e,p,null,n.path);if(b=Array.isArray(b)?b:[b].filter(x=>x!=null),!(n.strictPopulate===!1||n.options?.strictPopulate===!1)&&b.length===0&&n._localModel!=null)return new v8n(n._fullPath||n.path);for(let x=0;x<a;x++){i=r[x];let w=null;if(i.$__!=null&&i.populated(n.path)&&(n.forceRepopulate??i.constructor.base.options.forceRepopulate)===!1)continue;let M=i?.$__!=null?i.$__schema:p;if(u=xxt(e,M,i,n.path),u!=null&&u.$isMongooseDocumentArray&&u.options.ref==null&&u.options.refPath==null)continue;if(u?.$parentSchemaDocArray&&Ec(n,"options.sort")!=null)return new Mxe("Cannot populate with `sort` on path "+n.path+" because it is a subproperty of a document array");c=null;let P=!1,k=null,R=null,U=null;if(u?.instance==="Embedded"){if(u.options.ref){let D={localField:n.path+"._id",foreignField:"_id",justOne:!0},I=E(i,u,o,e),H=Iv.get(n.path,i),Z=Iv.get("_id",H);Ixe(e,s,h,I.modelNames,n,D,Z,i,R,H)}continue}if(Array.isArray(u)){let D=u;for(let I of D){let H,Z;try{Z=E(i,I,o,e),H=Z.modelNames,P=P||Z.isRefPath,k=k||Z.refPath,w=Z.justOne}catch(W){return W}if(!(P&&!Z.isRefPath)&&H){c=c||[],d=d||new Set;for(let W of H)d.has(W)===!1&&(d.add(W),c.push(W))}}}else{try{let D=E(i,u,o,e);c=D.modelNames,P=D.isRefPath,k=k||D.refPath,w=D.justOne,R=Ec(u,"options.populate",null),P&&(U=c,c=Array.from(new Set(c)))}catch(D){return D}if(!c)continue}let F={},V=n.path,J="_id";if("justOne"in n&&n.justOne!==void 0?w=n.justOne:u&&!u[Cxe]&&(n.path.endsWith("."+u.path)||n.path===u.path)&&(w=Array.isArray(u)?u.every(D=>!D.$isMongooseArray):!u.$isMongooseArray),!c)continue;F.isVirtual=!1,F.justOne=w,F.localField=V,F.foreignField=J;let z=Oxt(i,V,e,n,null,u),re=String(Eo.getValue(J,i));n._docs[re]=Array.isArray(z)?z.slice():z;let K=Ec(n,"match",null),ie=typeof K=="function";ie&&(K=K.call(i,i)),Rxe(K),F.match=K,F.hasMatchFunction=ie,F.isRefPath=P,F.modelNamesInOrder=U,P&&(c=E8n(i,p,F,n,k,z)||c);try{Ixe(e,s,h,c,n,F,z,i,R)}catch(D){return D}}return s;function E(x,w,M,N){let P,k=!1,R=null,U=w;w?.instance==="Array"&&(w=w.embeddedSchemaType),w?.$isSchemaMap&&(w=w.$__schemaType);let F=w?.options?.ref;if(f=w?.options?.refPath,w!=null&&w[Cxe]&&!F&&!f&&!M)return{modelNames:null};if(M)P=[M];else if(f!=null){if(typeof f=="function"){let V=n.path.slice(0,n.path.length-w.path.length-1),J=Iv.get(V,x,GR),z=Array.isArray(J)?Eo.array.flatten(J):J?[J]:[];P=new Set;for(let re of z)f=f.call(re,re,n.path),uG(f,x,n.path,p,n._queryProjection).forEach(K=>P.add(K));P=Array.from(P)}else P=uG(f,x,n.path,p,n._queryProjection);k=!0}else{let V,J,z,re,K=N,ie=N.schema.options.discriminatorKey;if(!w&&ie&&(re=Eo.getValue(ie,x))){let D=y8n(N.discriminators,re)||N;if(D!=null)K=D;else try{K=Pxe(N.db,re)}catch(I){return I}z=K.schema._getSchema(n.path),z?.embeddedSchemaType&&(z=z.embeddedSchemaType)}else z=w;if(U&&U.path.endsWith(".$*")?R=!U.$isMongooseArray&&!U._arrayPath:z!=null&&(R=!z.$isMongooseArray&&!z._arrayPath),(V=Ec(z,"options.ref"))!=null)if(z!=null&&typeof V=="function"&&n.path.endsWith("."+z.path)){P=new Set;let D=n.path.slice(0,n.path.length-z.path.length-1),I=Iv.get(D,x,GR),H=Array.isArray(I)?Eo.array.flatten(I):I?[I]:[];for(let Z of H)P.add(Txe(V,Z));H.length===0?P=[Txe(V,x)]:P=Array.from(P)}else V=Txe(V,x),P=[V];else if((z=Ec(w,"options.refPath"))!=null)if(k=!0,typeof J=="function"){let D=n.path.slice(0,n.path.length-z.path.length-1),I=Iv.get(D,x,GR),H=Array.isArray(I)?Eo.array.flatten(I):I?[I]:[];P=new Set;for(let Z of H)J=J.call(Z,Z,n.path),uG(J,x,n.path,p,n._queryProjection).forEach(W=>P.add(W));P=Array.from(P)}else P=uG(J,x,n.path,p,n._queryProjection)}if(!P)if(n._localModel==null)P=[N.modelName];else return{modelNames:P,justOne:R,isRefPath:k,refPath:f};return Array.isArray(P)||(P=[P]),{modelNames:P,justOne:R,isRefPath:k,refPath:f}}};function _8n(t,e,r,n){let i=[],a={},s=n.virtual;for(let o of e){let u=null,f={},c,d=n.nestedSchemaPath?n.nestedSchemaPath+".":"";typeof r.localField=="string"?c=r.localField:typeof s.options.localField=="function"?c=d+s.options.localField.call(o,o):Array.isArray(s.options.localField)?c=s.options.localField.map(E=>d+E):c=d+s.options.localField,f.count=s.options.count,s.options.skip!=null&&!Object.hasOwn(r,"skip")&&(r.skip=s.options.skip),s.options.limit!=null&&!Object.hasOwn(r,"limit")&&(r.limit=s.options.limit),s.options.perDocumentLimit!=null&&!Object.hasOwn(r,"perDocumentLimit")&&(r.perDocumentLimit=s.options.perDocumentLimit);let h=s.options.foreignField;if(!c||!h)return new Mxe(`Cannot populate virtual \`${r.path}\` on model \`${t.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`);typeof c=="function"&&(c=c.call(o,o)),typeof h=="function"&&(h=h.call(o,o)),f.isRefPath=!1;let p=null;if("justOne"in r&&r.justOne!==void 0&&(p=r.justOne),n.nestedSchemaPath&&typeof s.options.ref=="function"){let E=Eo.getValue(n.nestedSchemaPath,o);u=Array.isArray(E)?E.flatMap(x=>s._getModelNamesForPopulate(x)):s._getModelNamesForPopulate(E)}else u=s._getModelNamesForPopulate(o);s.options.refPath?(p=!!s.options.justOne,f.isRefPath=!0):s.options.ref&&(p=!!s.options.justOne),f.isVirtual=!0,f.virtual=s,f.justOne=p;let m=Ec(f,"virtual.options.match",null)||Ec(f,"virtual.options.options.match",null),y=Ec(r,"match",null)||m,b=typeof y=="function";if(b&&(y=y.call(o,o,f.virtual)),Array.isArray(c)&&Array.isArray(h)&&c.length===h.length){y=Object.assign({},y);for(let E=1;E<c.length;++E)y[h[E]]=Cxt(Iv.get(c[E],o,GR),t.schema),b=!0;c=c[0],h=h[0]}f.localField=c,f.foreignField=h,f.match=y,f.hasMatchFunction=b,Rxe(y);let v=Oxt(o,c,t,r,s);try{Ixe(t,i,a,u,r,f,v,o)}catch(E){return E}}return i}function Ixe(t,e,r,n,i,a,s,o,u,f){let c=i.connection??t.db;if(f=f===void 0?s:f,Array.isArray(f)&&(f=Eo.cloneArrays(f)),n==null)return;let d=Eo.array.flatten(n),h=d.length;for(;h--;){let p=d[h];if(p==null)continue;let m;if(i.model&&i.model[Oxe])m=i.model;else if(p[Oxe])m=p,p=m.modelName;else try{m=Pxe(c,p)}catch(E){if(s!==void 0)throw E;m=null}let y=s,b=a.modelNamesInOrder||n;a.isRefPath&&Array.isArray(s)&&s.length===b.length&&(y=Txt(s,b,p));let v=i.perDocumentLimit==null?Ec(i,"options.perDocumentLimit",null):i.perDocumentLimit;if(!r[p]||v!=null){let E={model:m};a.isVirtual&&Ec(a.virtual,"options.options")?E.options=m8n(a.virtual.options.options):u!=null&&(E.options=Object.assign({},u)),Eo.merge(E,i),i[xxe]=m,E[xxe]=m,r[p]={model:m,options:E,match:a.hasMatchFunction?[a.match]:a.match,docs:[o],ids:[y],allIds:[s],unpopulatedValues:[f],localField:new Set([a.localField]),foreignField:new Set([a.foreignField]),justOne:a.justOne,isVirtual:a.isVirtual,virtual:a.virtual,count:a.count,[xxe]:m},e.push(r[p])}else r[p].localField.add(a.localField),r[p].foreignField.add(a.foreignField),r[p].docs.push(o),r[p].ids.push(y),r[p].allIds.push(s),r[p].unpopulatedValues.push(f),a.hasMatchFunction&&r[p].match.push(a.match)}}function Pxe(t,e){return t.models[e]==null&&t._parent!=null?Pxe(t._parent,e):t.model(e)}function Txt(t,e,r){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(e)?t.flatMap((n,i)=>Txt(n,e[i],r)):[]:e===r?Array.isArray(t)?Eo.array.flatten(t):[t]:[]}function Txe(t,e){return typeof t=="function"&&!t[Oxe]?t.call(e,e):t}function Oxt(t,e,r,n,i,a){let s=r.schema._getPathType(e),o=s==="real"?r.schema.path(e):s.schema,u=o?.getters||[];e=o?.instance==="Embedded"?e+"._id":e;let f=Ec(n,"options",{}),c="getters"in f?f.getters:Ec(i,"options.getters",!1);if(u.length!==0&&c){let d=t.$__!=null?t:r.hydrate(t),h=Eo.getValue(e,t);if(Array.isArray(h)){let p=Eo.getValue(e.split(".").slice(0,-1),d);return h.map((m,y)=>o.applyGetters(m,p[y]))}else return o.applyGetters(h,d)}else return Cxt(Iv.get(e,t,GR),a)}function Cxt(t,e){if(t?.$__!=null)return t._doc._id;if(t?._id!=null&&!e?.$isSchemaMap)return t._id;if(Array.isArray(t)){let r=t.__array??t;for(let n=0;n<r.length;++n)r[n]?.$__!=null&&(r[n]=r[n]._doc._id);return Eo.isMongooseArray(t)&&t.$schema()?t.$schema()._castForPopulate(t,t.$parent()):[].concat(t)}if(b8n(t)==="Object"&&e?.[Cxe]==null){let r=[];for(let n of Object.keys(t))r.push(t[n]);return r}return t instanceof Map?Array.from(t.values()):t}function E8n(t,e,r,n,i,a){if(!r.isRefPath||i==null)return;let s=i.split("."),o="",u;for(let f=0;f<s.length;++f){let c=s[f];o=o+(o.length===0?"":".")+c;let d=e.path(o);if(d!=null&&d.$isMongooseDocumentArray&&d.Constructor.discriminators!=null&&Eo.hasOwnKeys(d.Constructor.discriminators)){let h=Eo.getValue(o,t),p=n.path.substring(o.length+1),m=d.Constructor.schema.options.discriminatorKey;u=[];for(let y of h){let b=Eo.getValue(m,y),E=d.Constructor.discriminators[b]?.schema;if(E==null)continue;let x=E.path(p);if(x==null||x.options.refPath==null){let M=Eo.getValue(r.localField.substring(o.length+1),y);a.forEach((N,P)=>{N===M&&(a[P]=h8n(N))});continue}let w=Eo.getValue(s.slice(f+1).join("."),y);u.push(w)}}}return u}function Rxe(t){if(t!=null&&typeof t=="object")for(let e of Object.keys(t)){if(e==="$where")throw new Mxe("Cannot use $where filter with populate() match");t[e]!=null&&typeof t[e]=="object"&&Rxe(t[e])}}});var Rxt=l((LSa,Pxt)=>{"use strict";var S8n=$a();Pxt.exports=function(e){if(Array.isArray(e)){let n=Object.keys(e[0]);return n.length===1&&n[0]==="_id"&&e[0]._id!=="hashed"}if(typeof e!="object")return!1;let r=S8n(e,"key",{});return Object.keys(r).length===1&&Object.hasOwn(r,"_id")}});var Dxt=l((jSa,Nxt)=>{"use strict";var fG=$a(),qxt=zt();Nxt.exports=function(e,r,n){if(n.textIndexVersion!=null){delete n.key._fts,delete n.key._ftsx;let o={...n.weights,...n.key};if(Object.keys(o).length!==Object.keys(e).length)return!1;for(let u of Object.keys(o)){if(!(u in e))return!1;let f=o[u];if(f!==fG(r,"weights."+u)&&!(f===1&&fG(r,"weights."+u)==null))return!1}return r.default_language!==n.default_language?n.default_language==="english"&&r.default_language==null:!0}let i=["unique","partialFilterExpression","sparse","expireAfterSeconds","collation"];for(let o of i)if(!(!(o in r)&&!(o in n))){if(o==="collation"){if(r[o]==null||n[o]==null)return r[o]==null&&n[o]==null;let u=Object.keys(r.collation),f=r.collation,c=n.collation;for(let d of u)if(fG(f,d)!==fG(c,d))return!1}else if(!qxt.deepEqual(r[o],n[o]))return!1}let a=Object.keys(e),s=Object.keys(n.key);if(a.length!==s.length)return!1;for(let o=0;o<a.length;++o)if(a[o]!==s[o]||!qxt.deepEqual(e[a[o]],n.key[s[o]]))return!1;return!0}});var $xt=l((USa,kxt)=>{"use strict";kxt.exports=function(e,r){if(r.timeseries==null)return!1;let{timeField:n,metaField:i}=r.timeseries;return typeof n!="string"||typeof i!="string"?!1:Object.keys(e.key).length===2&&e.key[n]===1&&e.key[i]===1}});var jxt=l((VSa,Lxt)=>{"use strict";var w8n=zW();function A8n(t,e){return Fxt({baseModelName:t.baseModelName,discriminatorMapping:t.schema.discriminatorMapping,indexes:e,indexesType:"schema"})}function x8n(t,e){return Fxt({baseModelName:t.baseModelName,discriminatorMapping:t.schema.discriminatorMapping,indexes:e,indexesType:"db"})}Lxt.exports={getRelatedSchemaIndexes:A8n,getRelatedDBIndexes:x8n};function Fxt({baseModelName:t,discriminatorMapping:e,indexes:r,indexesType:n}){let i=e?.key,a=e?.value;return i?t?r.filter(o=>{let u=Bxt(o,n);return u&&u[i]===a}):r.filter(o=>{let u=Bxt(o,n);return!u||!u[i]||w8n(u[i])&&!("$eq"in u[i])}):r}function Bxt(t,e){return e==="schema"?t[1]?.partialFilterExpression:t.partialFilterExpression}});var Vxt=l((HSa,Uxt)=>{"use strict";Uxt.exports=T8n;async function T8n(t,e,r){if(r<=0)throw new Error("Limit must be positive");if(t.length===0)return[];let n=[],i=new Set;for(let a=0;a<t.length;a++){let s=t[a],o=e(s,a);n.push(o),i.add(o);let u=()=>i.delete(o);o.then(u).catch(u),i.size>=r&&await Promise.race(i)}return Promise.all(n)}});var zxt=l((zSa,Hxt)=>{"use strict";Hxt.exports=function t(e,r,n){if(r!=null)for(let i=0;i<r.length;++i)Array.isArray(r[i])?t(e,r[i],n+"."+i):e.push(n+"."+i)}});var Jxt=l((WSa,Yxt)=>{"use strict";var Wxt=$a(),Gxt=bl(),Kxt=axe();Yxt.exports=function(e,r,n){let i=Kxt(Wxt(r,"select",null),!0)||Kxt(Wxt(r,"options.select",null),!0);if(i!=null){for(let a of e)if(Object.hasOwn(i,"-"+a))for(let s of n)s.$__!=null?Gxt.unset(a,s._doc):Gxt.unset(a,s)}}});var vxe=l((mTt,yTt)=>{"use strict";var O8n=mxe(),C8n=iSe(),Fh=Dh(),I8n=rz(),Nxe=fe("events").EventEmitter,JR=ov(),dG=vAe(),hr=ml(),M8n=_z(),P8n=dSe(),lG=YW(),R8n=xAt(),Dxe=bv(),cG=fv(),aTt=lSe(),Zxt=cSe(),q8n=Sz(),N8n=OAt(),D8n=bxe(),k8n=MAt(),sTt=RAt(),$8n=DAt(),B8n=GAe(),oTt=FAt(),F8n=jAt(),uTt=VAt(),L8n=KAt(),fTt=KAe(),j8n=ZAt(),U8n=hxt(),V8n=NAe(),Ly=_a(),H8n=gxt(),lTt=RAe(),qxe=SAe(),cTt=Oz(),z8n=yW(),W8n=_xt(),ZR=$a(),G8n=v0(),KR=gc(),K8n=Mxt(),Xxt=Eb(),$xe=i1().internalToObjectOptions,Bxe=Rxt(),dTt=Dxt(),Y8n=$xt(),{getRelatedDBIndexes:J8n,getRelatedSchemaIndexes:Z8n}=jxt(),Fxe=uwe(),X8n=Iz(),Q8n=zR(),e4n=Vxt(),t4n=pxe(),pTt=zxt(),r4n=Jxt(),n4n=xAe(),Qxt=fe("util"),Yn=zt(),i4n=MSe(),a4n=pSe(),s4n=gz(),Mv=DAe(),Pv=Symbol("mongoose#Model#collection"),Rv=Symbol("mongoose#Model#db"),hTt=Mt().modelSymbol,YR=Symbol("mongoose#Model#subclassed"),{VERSION_INC:pG,VERSION_WHERE:eTt,VERSION_ALL:o4n}=Fh,u4n=Object.assign({},$xe,{bson:!0});function Ue(t,e,r){if(e instanceof Dxe)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 t=="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()`.");Fh.call(this,t,e,r)}Object.setPrototypeOf(Ue.prototype,Fh.prototype);Ue.prototype.$isMongooseModelPrototype=!0;Ue.prototype.db;Ue.useConnection=function(e){if(!e)throw new Error("Please provide a connection.");this.db&&(delete this.db.models[this.modelName],delete this.prototype.db,delete this.prototype[Rv],delete this.prototype.collection,delete this.prototype.$collection,delete this.prototype[Pv]),this.db=e;let r=e.collection(this.collection.collectionName,e.options);return this.prototype.collection=r,this.prototype.$collection=r,this.prototype[Pv]=r,this.prototype.db=e,this.prototype[Rv]=e,this.collection=r,this.$__collection=r,e.models[this.modelName]=this,this};Ue.prototype.collection;Ue.prototype.$__collection;Ue.prototype.modelName;Ue.prototype.$where;Ue.prototype.baseModelName;Ue.events;Ue._middleware;function kxe(t,e){if(t.$where!=null)for(let r of Object.keys(t.$where))e[r]=t.$where[r]}function f4n(t,e){let r={};fTt(t.$__schema,e),typeof e.writeConcern<"u"?(r.writeConcern={},"w"in e.writeConcern&&(r.writeConcern.w=e.writeConcern.w),"j"in e.writeConcern&&(r.writeConcern.j=e.writeConcern.j),"wtimeout"in e.writeConcern&&(r.writeConcern.wtimeout=e.writeConcern.wtimeout)):("w"in e&&(r.w=e.w),"j"in e&&(r.j=e.j),"wtimeout"in e&&(r.wtimeout=e.wtimeout)),"checkKeys"in e&&(r.checkKeys=e.checkKeys);let n=t.$session(),i=t[Rv].base.transactionAsyncLocalStorage?.getStore();return n!=null?r.session=n:!Object.hasOwn(e,"session")&&i?.session!=null&&(r.session=i.session),r}Ue.prototype.$__save=async function(e){try{await this._execDocumentPreHooks("save",e)}catch(s){await this._execDocumentPostHooks("save",s);return}let r=null,n=null;try{let s=f4n(this,e);if(this.$isNew){let o=this.toObject(u4n);if((o||{})._id===void 0)throw new hr("document must have an _id before saving");this.$__version(!0,o),this.$__reset(),X9(this,!1),this.$__.inserting=!0,r=await this[Pv].insertOne(o,s).catch(u=>{throw X9(this,!0),u})}else{this.$__.inserting=!1;let o=this.$__delta();if(e.pathsToSave){for(let u in o[1].$set)if(!e.pathsToSave.includes(u)){if(e.pathsToSave.some(f=>u.slice(0,f.length)===f&&u.charAt(f.length)==="."))continue;delete o[1].$set[u]}}if(o){n=this.$__where(o[0]),kxe(this,n);let u=o[1];if(this.$__schema.options.minimize){for(let f of Object.values(u))if(f!=null)for(let c of Object.keys(f))f[c]==null||typeof f[c]!="object"||Yn.isPOJO(f[c])&&(i4n(f[c]),Yn.hasOwnKeys(f[c])===!1&&(delete f[c],u.$unset=u.$unset||{},u.$unset[c]=1))}this.$__.modifiedPaths=this.modifiedPaths(),this.$__reset(),X9(this,!1),r=await this[Pv].updateOne(n,u,s).catch(f=>{throw this.$__undoReset(),f})}else n=this.$__where(),kxe(this,n),this.$__.version&&this.$__version(n,o),B8n(this.$__schema,s),r=await this.constructor.collection.findOne(n,{...s,projection:{_id:1}}).then(u=>({matchedCount:u?1:0}))}}catch(s){let o=this.$__schema._transformDuplicateKeyError(s);await this._execDocumentPostHooks("save",o);return}let i=0;if((e!=null?e.writeConcern!=null?e.writeConcern.w:e.w:0)!==0){if(r!=null&&(Array.isArray(r)?i=r.length:r.matchedCount!=null?i=r.matchedCount:i=r),this.$__.version&&!this.$__.inserting){let o=pG===(pG&this.$__.version);this.$__.version=void 0;let u=this.$__schema.options.versionKey,f=this.$__getValue(u)||0;if(i<=0){this.$__undoReset();let c=this.$__.$versionError||new aTt(this,f,this.$__.modifiedPaths);await this._execDocumentPostHooks("save",c);return}o&&this.$__setValue(u,f+1)}if(r!=null&&i<=0){this.$__undoReset();let o=new I8n(n,this.constructor.modelName,i,r);await this._execDocumentPostHooks("save",o);return}}this.$__.saving=void 0,this.$__.savedState={},this.$emit("save",this,i),this.constructor.emit("save",this,i),await this._execDocumentPostHooks("save")};function l4n(t,e,r){let n=t.$__schema.options.versionKey;if(!n)return null;let i=t.$__getValue(n)||0;return new aTt(t,i,e.concat(r))}Ue.prototype.save=async function(e){if(typeof e=="function"||typeof arguments[1]=="function")throw new hr("Model.prototype.save() no longer accepts a callback");let r;if(this.$op="save",this.$__.saving?r=new Zxt(this):this.$__.saving=new Zxt(this),e=new R8n(e),Object.hasOwn(e,"session")&&this.$session(e.session),this.$__.timestamps!=null&&(e.timestamps=this.$__.timestamps),this.$__.$versionError=l4n(this,this.modifiedPaths(),Object.keys(this.$__.activePaths.getStatePaths("default"))),r)throw this.$__handleReject(r),r;this.$__.saveOptions=e;try{await this.$__save(e)}catch(n){throw this.$__handleReject(n),n}finally{this.$__.saving=null,this.$__.saveOptions=null,this.$__.$versionError=null,this.$op=null}return this};Ue.prototype.$save=Ue.prototype.save;Ue.prototype.$__version=function(t,e){let r=this.$__schema.options.versionKey;if(t===!0){r&&(n4n(e,r,0),this.$__setValue(r,0));return}if(r!==!1&&this.$__isSelected(r)){if(eTt===(eTt&this.$__.version)){let n=this.$__getValue(r);n!=null&&(t[r]=n)}pG===(pG&this.$__.version)&&(ZR(e.$set,r,null)!=null?++e.$set[r]:(e.$inc=e.$inc||{},e.$inc[r]=1))}};Ue.prototype.increment=function(){return this.$__.version=o4n,this};Ue.prototype.$__where=function(e){if(e||(e={}),e._id||(e._id=this._doc._id),this._doc._id===void 0)throw new hr("No _id found on document!");return e};Ue.prototype.deleteOne=function(e){if(typeof e=="function"||typeof arguments[1]=="function")throw new hr("Model.prototype.deleteOne() no longer accepts a callback");e||(e={}),Object.hasOwn(e,"session")&&this.$session(e.session);let r=this,n=this.$__where(),i=r.constructor.deleteOne();return this.$session()!=null&&("session"in i.options||(i.options.session=this.$session())),i.pre(async function(){let s=await r.constructor._middleware.execPre("deleteOne",r,[r,e]);if(s[0]!==r||s[1]!==e)throw new Error("Document deleteOne pre hooks cannot overwrite arguments");return i.deleteOne(n,e),r.$where!=null&&this.where(r.$where),s}),i.pre(function(){return Promise.all(r.$getAllSubdocs().map(s=>s.constructor._middleware.execPre("deleteOne",s,[s])))}),i.pre(function(){if(r.$__.isDeleted)throw new JR.skipWrappedFunction}),i.post(function(){return Promise.all(r.$getAllSubdocs().map(s=>s.constructor._middleware.execPost("deleteOne",s,[s])))}),i.post(function(){return r.constructor._middleware.execPost("deleteOne",r,[r],{})}),i.transform(function(s){return s?.deletedCount>0&&r.$isDeleted(!0),s}),i};Ue.prototype.$model=function(e){return arguments.length===0?this.constructor:this[Rv].model(e)};Ue.prototype.model=Ue.prototype.$model;Ue.exists=function(e,r){if(Sr(this,"exists"),typeof arguments[2]=="function")throw new hr("Model.exists() no longer accepts a callback");return this.findOne(e).select({_id:1}).lean().setOptions(r)};Ue.discriminator=function(t,e,r){let n;if(typeof t=="function"&&(n=t,t=Yn.getFunctionName(n),!(n.prototype instanceof Ue)))throw new hr("The provided class "+t+" must extend Model");r=r||{};let i=Yn.isPOJO(r)?r.value:r,a=typeof r.clone=="boolean"?r.clone:!0,s=typeof r.mergePlugins=="boolean"?r.mergePlugins:!0,o=typeof r.overwriteModels=="boolean"?r.overwriteModels:!1;if(Sr(this,"discriminator"),Yn.isObject(e)&&!e.instanceOfSchema&&(e=new Dxe(e)),e instanceof Dxe&&a&&(e=e.clone()),e=z8n(this,t,e,i,s,r.mergeHooks,o),this.db.models[t]&&!e.options.overwriteModels&&!o)throw new P8n(t);e.$isRootDiscriminator=!0,e.$globalPluginsApplied=!0,n=this.db.model(n||t,e,this.$__collection.name),this.discriminators[t]=n;let u=this.discriminators[t];if(Object.setPrototypeOf(u.prototype,this.prototype),Object.defineProperty(u,"baseModelName",{value:this.modelName,configurable:!0,writable:!1}),sTt(u,e),uTt(u,e),this[YR]!=null)for(let f of this[YR])f.discriminators=f.discriminators||{},f.discriminators[t]=n.__subclass(n.db,e,f.collection.name);return u};function Sr(t,e){if(t==null||t===global)throw new hr("`Model."+e+"()` cannot run without a model as `this`. Make sure you are calling `MyModel."+e+"()` where `MyModel` is a Mongoose model.");if(t[hTt]==null)throw new hr("`Model."+e+"()` cannot run without a model as `this`. Make sure you are not calling `new Model."+e+"()`")}for(let t in Nxe.prototype)Ue[t]=Nxe.prototype[t];Ue.init=function(){if(Sr(this,"init"),typeof arguments[0]=="function")throw new hr("Model.init() no longer accepts a callback");if(this.schema.emit("init",this),this.$init!=null)return this.$init;let e=this.db,r=async()=>{if(Yn.getOption("autoIndex",this.schema.options,e.config,e.base.options))return await this.ensureIndexes({_automatic:!0})},n=async()=>{if(Yn.getOption("autoSearchIndex",this.schema.options,e.config,e.base.options))return await this.createSearchIndexes()},i=async()=>{let o=Yn.getOption("autoCreate",this.schema.options,e.config);if(o==null&&(await e._waitForConnect(!0),o=Yn.getOption("autoCreate",this.schema.options,e.config,e.base.options)),!!o)return await this.createCollection()};this.$init=i().then(()=>r()).then(()=>n());let a=this.$init.catch,s=this;return this.$init.catch=function(){return s.$caught=!0,a.apply(s.$init,arguments)},this.$init};Ue.createCollection=async function(e){if(Sr(this,"createCollection"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new hr("Model.createCollection() no longer accepts a callback");[e]=await this.hooks.execPre("createCollection",this,[e]).catch(o=>{if(o instanceof JR.skipWrappedFunction)return[o];throw o});let r=this?.schema?.options?.collectionOptions;r!=null&&(e=Object.assign({},r,e));let n=this?.schema?.options?.collation;n!=null&&(e=Object.assign({collation:n},e));let i=this?.schema?.options?.capped;i!=null&&(typeof i=="number"?e=Object.assign({capped:!0,size:i},e):typeof i=="object"&&(e=Object.assign({capped:!0},i,e)));let a=this?.schema?.options?.timeseries;a!=null&&(e=Object.assign({timeseries:a},e),e.expireAfterSeconds!=null||(e.expires!=null?Yn.expires(e):this.schema.options.expireAfterSeconds!=null?e.expireAfterSeconds=this.schema.options.expireAfterSeconds:this.schema.options.expires!=null&&(e.expires=this.schema.options.expires,Yn.expires(e))));let s=this?.schema?.options?.clusteredIndex;s!=null&&(e=Object.assign({clusteredIndex:{...s,unique:!0}},e));try{e instanceof JR.skipWrappedFunction||await this.db.createCollection(this.$__collection.collectionName,e)}catch(o){o!=null&&(o.name!=="MongoServerError"||o.code!==48)&&await this.hooks.execPost("createCollection",this,[null],{error:o})}return await this.hooks.execPost("createCollection",this,[this.$__collection]),this.$__collection};Ue.syncIndexes=async function(e){if(Sr(this,"syncIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new hr("Model.syncIndexes() no longer accepts a callback");if(e?.autoCreate??this.schema.options?.autoCreate??this.db.config.autoCreate??this.db.base?.options?.autoCreate??!0)try{await this.createCollection()}catch(a){if(a!=null&&(a.name!=="MongoServerError"||a.code!==48))throw a}let n=await this.diffIndexes({indexOptionsToCreate:!0}),i=await this.cleanIndexes({...e,toDrop:n.toDrop});return await this.createIndexes({...e,toCreate:n.toCreate}),i};Ue.createSearchIndex=async function(e){return Sr(this,"createSearchIndex"),await this.$__collection.createSearchIndex(e)};Ue.updateSearchIndex=async function(e,r){return Sr(this,"updateSearchIndex"),await this.$__collection.updateSearchIndex(e,r)};Ue.dropSearchIndex=async function(e){return Sr(this,"dropSearchIndex"),await this.$__collection.dropSearchIndex(e)};Ue.listSearchIndexes=async function(e){return Sr(this,"listSearchIndexes"),await(await this.$__collection.listSearchIndexes(e)).toArray()};Ue.diffIndexes=async function(e){if(typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new hr("Model.syncIndexes() no longer accepts a callback");let r=this,n=await r.listIndexes().catch(u=>{if(u.codeName!="NamespaceNotFound")throw u});n===void 0&&(n=[]),n=J8n(r,n);let i=r.schema,a=Z8n(r,i.indexes()),s=d4n(i,a,n),o=c4n(i,a,n,s,e);return{toDrop:s,toCreate:o}};function c4n(t,e,r,n,i){let a=[],s=i?.indexOptionsToCreate??!1;for(let[o,u]of e){let f=!1,c=Fxe(t,Ly(u));for(let d of r)if(!Bxe(d)&&dTt(o,c,d)&&!n.includes(d.name)){f=!0;break}f||(s?a.push([o,u]):a.push(o))}return a}function d4n(t,e,r){let n=[];for(let i of r){let a=!1;if(!Bxe(i)&&!Y8n(i,t.options)){for(let[s,o]of e){let u=Fxe(t,Ly(o));if(oTt(s,u,t.options),dTt(s,u,i)){a=!0;break}}a||n.push(i.name)}}return n}Ue.cleanIndexes=async function(e){if(Sr(this,"cleanIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new hr("Model.cleanIndexes() no longer accepts a callback");let r=this;if(Array.isArray(e?.toDrop))return await tTt(e.toDrop,r,e);let n=await r.diffIndexes();return await tTt(n.toDrop,r,e)};async function tTt(t,e,r){if(t.length===0)return[];let n=e.$__collection;return r?.hideIndexes?await Promise.all(t.map(i=>e.db.db.command({collMod:n.collectionName,index:{name:i,hidden:!0}}))):await Promise.all(t.map(i=>n.dropIndex(i))),t}Ue.listIndexes=async function(){if(Sr(this,"listIndexes"),typeof arguments[0]=="function")throw new hr("Model.listIndexes() no longer accepts a callback");return this.$__collection.buffer&&await new Promise(e=>{this.$__collection.addQueue(e)}),this.$__collection.listIndexes().toArray()};Ue.ensureIndexes=async function(e){if(Sr(this,"ensureIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new hr("Model.ensureIndexes() no longer accepts a callback");await new Promise((r,n)=>{p4n(this,e,i=>{if(i!=null)return n(i);r()})})};Ue.createIndexes=async function(e){if(Sr(this,"createIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new hr("Model.createIndexes() no longer accepts a callback");return this.ensureIndexes(e)};function p4n(t,e,r){let n=Array.isArray(e?.toCreate)?e.toCreate:t.schema.indexes(),i;e=e||{};let a=function(d){d&&!t.$caught&&t.emit("error",d),t.emit("index",d||i),r&&r(d||i)};for(let d of n)Bxe(d)&&Yn.warn('mongoose: Cannot specify a custom index on `_id` for model name "'+t.modelName+'", MongoDB does not allow overwriting the default `_id` index. See https://bit.ly/mongodb-id-index');if(!n.length){Xxt(function(){a()});return}let s=function(d,h,p,m){t.emit("index-single-done",d,h,p,m)},o=function(d,h){t.emit("index-single-start",d,h)},u=t.schema._baseSchema,f=u?u.indexes():[];Xxt(function(){e._automatic&&!t.collection.collection?t.collection.addQueue(c,[]):c()});function c(){if(e._automatic&&(t.schema.options.autoIndex===!1||t.schema.options.autoIndex==null&&t.db.config.autoIndex===!1))return a();let d=n.shift();if(!d)return a();if(e._automatic&&d[1]._autoIndex===!1||f.find(y=>Yn.deepEqual(y,d)))return c();let h=Ly(d[0]),p=Ly(d[1]);delete p._autoIndex,Fxe(t.schema,p),fTt(t.schema,p),oTt(h,p,t.schema.options),o(h,e);let m=null;try{m=t.collection.createIndex(h,p)}catch(y){i||(i=y),t.$caught||t.emit("error",y),s(y,h,p),c();return}m.then(y=>{s(null,h,p,y),c()},y=>{i||(i=y),t.$caught||t.emit("error",y),s(y,h,p),c()})}}Ue.createSearchIndexes=async function(){Sr(this,"createSearchIndexes");let e=[];for(let r of this.schema._searchIndexes)e.push(await this.createSearchIndex(r));return e};Ue.schema;Ue.db;Ue.collection;Ue.$__collection;Ue.base;Ue.discriminators;Ue.translateAliases=function(e,r){Sr(this,"translateAliases");let n=(i,a)=>{let s,o=[],u=i.split("."),f=this.schema;for(let d in u){let h=u[d];if(f?.aliases[h]){if(s=f.aliases[h],r&&s in e)throw new hr(`Provided object has both field "${h}" and its alias "${s}"`);o.push(s)}else s=h,o.push(h);f?.paths[s]?f=f.paths[s].schema:f=null}let c=o.join(".");return e instanceof Map?e.set(c,a):e[c]=a,c!==i&&(e instanceof Map?e.delete(i):delete e[i]),e};if(typeof e=="object"){if(e instanceof Map)for(let i of new Map(e))e=n(i[0],i[1]);else for(let i of Object.keys(e))if(e=n(i,e[i]),i[0]==="$")if(Array.isArray(e[i]))for(let a in e[i])e[i][a]=this.translateAliases(e[i][a]);else this.translateAliases(e[i]);return e}else return e};Ue.deleteOne=function(e,r){if(Sr(this,"deleteOne"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.prototype.deleteOne() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);return n.setOptions(r),n.deleteOne(e)};Ue.deleteMany=function(e,r){if(Sr(this,"deleteMany"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.deleteMany() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);return n.setOptions(r),n.deleteMany(e)};Ue.find=function(e,r,n){if(Sr(this,"find"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new hr("Model.find() no longer accepts a callback");let i=new this.Query({},{},this,this.$__collection);return i.select(r),i.setOptions(n),i.find(e)};Ue.findById=function(e,r,n){if(Sr(this,"findById"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.findById() no longer accepts a callback");return this.findOne({_id:e},r,n)};Ue.findOne=function(e,r,n){if(Sr(this,"findOne"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.findOne() no longer accepts a callback");let i=new this.Query({},{},this,this.$__collection);return i.select(r),i.setOptions(n),i.findOne(e)};Ue.estimatedDocumentCount=function(e){return Sr(this,"estimatedDocumentCount"),new this.Query({},{},this,this.$__collection).estimatedDocumentCount(e)};Ue.countDocuments=function(e,r){if(Sr(this,"countDocuments"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.countDocuments() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);return r!=null&&n.setOptions(r),n.countDocuments(e)};Ue.distinct=function(e,r,n){if(Sr(this,"distinct"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.distinct() no longer accepts a callback");let i=new this.Query({},{},this,this.$__collection);return n!=null&&i.setOptions(n),i.distinct(e,r)};Ue.where=function(e,r){Sr(this,"where");let n=new this.Query({},{},this,this.$__collection).find({});return n.where.apply(n,arguments)};Ue.$where=function(){Sr(this,"$where");let e=new this.Query({},{},this,this.$__collection).find({});return e.$where.apply(e,arguments)};Ue.findOneAndUpdate=function(t,e,r){if(Sr(this,"findOneAndUpdate"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new hr("Model.findOneAndUpdate() no longer accepts a callback");let n;r&&(n=r.fields||r.projection),e=Ly(e,{depopulate:!0,_isNested:!0}),lTt(e,r,this.schema.options.versionKey);let i=new this.Query({},{},this,this.$__collection);return i.select(n),i.findOneAndUpdate(t,e,r)};Ue.findByIdAndUpdate=function(t,e,r){if(Sr(this,"findByIdAndUpdate"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new hr("Model.findByIdAndUpdate() no longer accepts a callback");return t instanceof Fh&&(t=t._doc._id),this.findOneAndUpdate.call(this,{_id:t},e,r)};Ue.findOneAndDelete=function(t,e){if(Sr(this,"findOneAndDelete"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.findOneAndDelete() no longer accepts a callback");let r;e&&(r=e.select,e.select=void 0);let n=new this.Query({},{},this,this.$__collection);return n.select(r),n.findOneAndDelete(t,e)};Ue.findByIdAndDelete=function(t,e){if(Sr(this,"findByIdAndDelete"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new hr("Model.findByIdAndDelete() no longer accepts a callback");return this.findOneAndDelete({_id:t},e)};Ue.findOneAndReplace=function(t,e,r){if(Sr(this,"findOneAndReplace"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new hr("Model.findOneAndReplace() no longer accepts a callback");let n;r&&(n=r.select,r.select=void 0);let i=new this.Query({},{},this,this.$__collection);return i.select(n),i.findOneAndReplace(t,e,r)};Ue.create=async function(e,r){if(typeof r=="function"||typeof arguments[2]=="function")throw new hr("Model.create() no longer accepts a callback");Sr(this,"create");let n,i=this.schema.options.discriminatorKey;if(Array.isArray(e))n=e,r=r!=null&&typeof r=="object"?r:{};else{let o=arguments[arguments.length-1];if(r={},typeof o=="function"||typeof r=="function"||typeof arguments[2]=="function")throw new hr("Model.create() no longer accepts a callback");n=[...arguments],n.length>1&&!o&&n.pop(),n.length===2&&n[0]!=null&&n[1]!=null&&n[0].session==null&&o&&G8n(o.session)==="ClientSession"&&!this.schema.path("session")&&Yn.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(n.length===0)return Array.isArray(e)?[]:null;let a=[],s=typeof r.aggregateErrors=="boolean"?!r.aggregateErrors:!0;if(delete r.aggregateErrors,r.session&&!r.ordered&&n.length>1)throw new hr("Cannot call `create()` with a session and multiple documents unless `ordered: true` is set");if(r.ordered){for(let o=0;o<n.length;o++)try{let u=n[o],f=this.discriminators&&u[i]!=null?this.discriminators[u[i]]||KR(this.discriminators,u[i]):this;if(f==null)throw new hr(`Discriminator "${u[i]}" not found for model "${this.modelName}"`);let c=u;c instanceof f||(c=new f(c)),await c.$save(r),a.push(c)}catch(u){if(!s)a.push(u);else throw u}return a}else if(!s)a=await Promise.allSettled(n.map(async o=>{let u=this.discriminators&&o[i]!=null?this.discriminators[o[i]]||KR(this.discriminators,o[i]):this;if(u==null)throw new hr(`Discriminator "${o[i]}" not found for model "${this.modelName}"`);let f=o;return f instanceof u||(f=new u(f)),await f.$save(r),f})),a=a.map(o=>o.status==="fulfilled"?o.value:o.reason);else{let o=null;if(a=await Promise.all(n.map(async u=>{let f=this.discriminators&&u[i]!=null?this.discriminators[u[i]]||KR(this.discriminators,u[i]):this;if(f==null)throw new hr(`Discriminator "${u[i]}" not found for model "${this.modelName}"`);try{let c=u;return c instanceof f||(c=new f(c)),await c.$save(r),c}catch(c){o||(o=c)}})),o)throw o}return!Array.isArray(e)&&n.length===1?a[0]:a};Ue.insertOne=async function(e,r){Sr(this,"insertOne");let n=this.schema.options.discriminatorKey,i=this.discriminators&&e[n]!=null?this.discriminators[e[n]]||KR(this.discriminators,e[n]):this;if(i==null)throw new hr(`Discriminator "${e[n]}" not found for model "${this.modelName}"`);return e instanceof i||(e=new i(e)),await e.$save(r)};Ue.watch=function(t,e){Sr(this,"watch"),e=e||{};let r=e?.hydrate!==void 0?Yn.omit(e,["hydrate"]):{...e};e.model=this;let n=i=>{if(t=t||[],t4n(t,this.schema,"fullDocument"),this.$__collection.buffer)this.$__collection.addQueue(()=>{if(this.closed)return;let a=this.$__collection.watch(t,r);i(null,a)});else{let a=this.$__collection.watch(t,r);i(null,a)}};return new C8n(n,t,e)};Ue.startSession=function(){return Sr(this,"startSession"),this.db.startSession.apply(this.db,arguments)};Ue.insertMany=async function(e,r){if(Sr(this,"insertMany"),typeof r=="function"||typeof arguments[2]=="function")throw new hr("Model.insertMany() no longer accepts a callback");try{[e]=await this._middleware.execPre("insertMany",this,[e])}catch(w){await this._middleware.execPost("insertMany",this,[e],{error:w})}r=r||{};let n=this,i=r.limit||1e3,a=!!r.rawResult,s=typeof r.ordered=="boolean"?r.ordered:!0,o=typeof r.throwOnValidationError=="boolean"?r.throwOnValidationError:!1,u=!!r.lean,f=this.db.base.transactionAsyncLocalStorage?.getStore();(!r||!Object.hasOwn(r,"session"))&&f?.session!=null&&(r={...r,session:f.session}),Array.isArray(e)||(e=[e]);let c=[],d=new Map,h=s?null:new Array(e.length);async function p(w,M){if(u)return w;let N=!1;if(!(w instanceof n)){if(w!=null&&typeof w!="object")throw new M8n(w,"arr."+M,"insertMany");w=new n(w),N=!0}return r.session!=null&&w.$session(r.session),w.$validate(N?{_skipParallelValidateCheck:!0}:null).then(()=>w).catch(P=>{if(s===!1){P.index=M,c.push(P),d.set(P,M),h[M]=P;return}throw P})}let m=await e4n(e,p,i),y=new Map,b=new Map;for(let w=0;w<m.length;++w)y.set(m[w],w);let v=m.filter(function(w){return w!=null});for(let w=0;w<v.length;++w)b.set(w,y.get(v[w]));if(c.length>0&&c.sort((w,M)=>d.get(w)-d.get(M)),v.length===0){if(o)throw new dG(c,h,null,"insertMany");if(a){let w={acknowledged:!0,insertedCount:0,insertedIds:{}};return Mv(w,c,c),w}return[]}let E=u?v:v.map(function(w){return w.$__schema.options.versionKey&&(w[w.$__schema.options.versionKey]=0),r?.timestamps!==!1&&w.initializeTimestamps&&(!w.$__||w.$__.timestamps!==!1)&&w.initializeTimestamps(r?.timestamps),w.$__hasOnlyPrimitiveValues()?w.$__toObjectShallow():w.toObject($xe)}),x;try{x=await this.$__collection.insertMany(E,r)}catch(w){w.writeErrors==null&&w.result?.result?.writeErrors!=null&&(w.writeErrors=w.result.result.writeErrors);let M=w?.writeErrors,N=new Set((w?.writeErrors||[]).map(k=>k.index));if(w.writeErrors!=null)for(let k=0;k<w.writeErrors.length;++k){let R=b.get(w.writeErrors[k].index);w.writeErrors[k]={...w.writeErrors[k],index:R},s||(h[R]=w.writeErrors[k])}if(!s){for(let k=0;k<h.length;++k)h[k]===void 0&&(h[k]=m[k]);w.results=h}let P=-1;w.insertedDocs=v.filter((k,R)=>{let U=!M||N.has(R);if(s){if(P>-1)return R<P;U&&(P=R)}return!U}).map(function(R){return u||(R.$__reset(),X9(R,!1)),R}),a&&s===!1&&Mv(w,c,h),await this._middleware.execPost("insertMany",this,[e],{error:w})}if(!u)for(let w of v)w.$__reset(),X9(w,!1);if(s===!1&&o&&c.length>0){for(let w=0;w<h.length;++w)h[w]===void 0&&(h[w]=m[w]);throw new dG(c,h,x,"insertMany")}if(a){if(s===!1){for(let w=0;w<h.length;++w)h[w]===void 0&&(h[w]=m[w]);Mv(x,c,h)}return x}return r.populate!=null?this.populate(v,r.populate).catch(w=>{throw w!=null&&(w.insertedDocs=v),w}):await this._middleware.execPost("insertMany",this,[v]).then(w=>w[0])};function X9(t,e){t.$isNew=e,t.$emit("isNew",e),t.constructor.emit("isNew",e);let r=t.$getAllSubdocs({useCache:!0});for(let n of r)n.$isNew=e,n.$emit("isNew",e)}Ue.bulkWrite=async function(e,r){if(Sr(this,"bulkWrite"),typeof r=="function"||typeof arguments[2]=="function")throw new hr("Model.bulkWrite() no longer accepts a callback");r=r||{};try{[e,r]=await this.hooks.execPre("bulkWrite",this,[e,r])}catch(o){o instanceof JR.skipWrappedFunction?e=o:await this.hooks.execPost("bulkWrite",this,[null],{error:o})}if(e instanceof JR.skipWrappedFunction)return e.args[0];let n=r.ordered==null?!0:r.ordered;if(e.length===0){let o=this.base.driver.get().BulkWriteResult,u=new o(qxe(),!1);return u.n=0,Mv(u,[],[]),u}let i=r?._skipCastBulkWrite?[]:e.map(o=>V8n(this,o,r)),a=this.db.base.transactionAsyncLocalStorage?.getStore();(!r||!Object.hasOwn(r,"session"))&&a?.session!=null&&(r={...r,session:a.session});let s=null;if(n){await new Promise((o,u)=>{W8n(i,(f,c)=>f(c),f=>{if(f)return u(f);o()})});try{s=await this.$__collection.bulkWrite(e,r)}catch(o){await this.hooks.execPost("bulkWrite",this,[null],{error:o})}}else{let o=[],u=[],f=[];i.length>0?(o=await Promise.all(e.map((p,m)=>m>=i.length?m:new Promise(y=>{i[m](b=>{b==null?y(m):(u.push({index:m,error:b}),f[m]=b),y()})}))),o=o.filter(p=>p!=null)):o=e.map((p,m)=>m),u=u.sort((p,m)=>p.index-m.index).map(p=>p.error);let c=o.sort().map(p=>e[p]);if(c.length===0){if(r.throwOnValidationError&&u.length)throw new dG(u,f,s,"bulkWrite");let p=this.base.driver.get().BulkWriteResult,m=new p(qxe(),!1);return m.result=qxe(),Mv(m,u,f),m}let d;[s,d]=await this.$__collection.bulkWrite(c,r).then(p=>[p,null]).catch(p=>[null,p]);let h={};if(d?.writeErrors)for(let p of d.writeErrors)h[p.err.index]=p;for(let p=0;p<o.length;++p)f[o[p]]=h[p]??null;if(d&&(u.length>0&&Mv(d,u,f),await this.hooks.execPost("bulkWrite",this,[null],{error:d})),u.length>0){if(r.throwOnValidationError)throw new dG(u,f,s,"bulkWrite");Mv(s,u,f)}}return await this.hooks.execPost("bulkWrite",this,[s]),s};Ue.bulkSave=async function(e,r){if(r=r||{},r.timestamps!=null)for(let c of e)c.$__.saveOptions=c.$__.saveOptions||{},c.$__.saveOptions.timestamps=r.timestamps;else for(let c of e)c.$__.timestamps!=null&&(c.$__.saveOptions=c.$__.saveOptions||{},c.$__.saveOptions.timestamps=c.$__.timestamps);await Promise.all(e.map(c=>h4n(c,r)));let n=this.buildBulkWriteOperations(e,r),i={skipValidation:!0,_skipCastBulkWrite:!0,...r},{bulkWriteResult:a,bulkWriteError:s}=await this.bulkWrite(n,i).then(c=>({bulkWriteResult:c,bulkWriteError:null}),c=>({bulkWriteResult:null,bulkWriteError:c}));if(s!=null&&s.name!=="MongoBulkWriteError")throw s;let o=a?.matchedCount??0,u=a?.insertedCount??0;if(n.length>0&&o+u<n.length&&!s)throw new a4n(this.modelName,e,a);let f=[];for(let c=0;c<e.length;c++){let d=e[c];s?.writeErrors.find(p=>(p.err.op._id||p.err.op.q._id).toString()===d._doc._id.toString())==null&&f.push(d)}if(await Promise.all(f.map(c=>m4n(c))),s!=null)throw s;return a};async function h4n(t,e){let[r]=await t.schema.s.hooks.execPre("save",t,[e]);if(r!==e)throw new Error('Cannot overwrite options in pre("save") hook on bulkSave()')}async function m4n(t){return t.$isNew&&X9(t,!1),t.$__reset(),t._applyVersionIncrement(),t.schema.s.hooks.execPost("save",t,[t])}Ue.applyDefaults=function t(e){if(e==null)return e;if(e.$__!=null){q8n(e,e.$__.fields,e.$__.exclude);for(let r of e.$getAllSubdocs())t(r,r.$__.fields,r.$__.exclude);return e}return N8n(e,this.schema),e};Ue.applyVirtuals=function(e,r){return e==null||e.$__!=null||j8n(this.schema,e,r),e};Ue.applyTimestamps=function(e,r){return e==null||e.$__!=null||L8n(this.schema,e,r),e};Ue.castObject=function(e,r){r=r||{};let n={},i=this.schema,a=i.options.discriminatorKey;i.discriminators!=null&&e!=null&&e[a]!=null&&(i=cTt(i,e[a])||i);let s=Object.keys(i.paths);for(let u of s){if(!i.path(u)?.$isMongooseArray)continue;let c=ZR(e,u);pTt(s,c,u)}let o=null;for(let u of s){let f=i.path(u);if(f==null)continue;let c=ZR(e,u,void 0);if(c==null)continue;let d=u.indexOf(".")===-1?[u]:u.split("."),h=n;for(let p=0;p<d.length-1;++p)h[d[p]]==null&&(h[d[p]]=isNaN(d[p+1])?{}:[]),h=h[d[p]];if(f.$isMongooseDocumentArray){let p=f.options?.castNonArrays??f.constructor.options.castNonArrays;if(!Array.isArray(c)){p?h[d[d.length-1]]=[Ue.castObject.call(f.Constructor,c)]:r.ignoreCastErrors||(o=o||new cG,o.addError(u,new s4n(u,c)));continue}}if(f.$isSingleNested||f.$isMongooseDocumentArrayElement){try{c=Ue.castObject.call(f.Constructor,c)}catch(p){r.ignoreCastErrors||(o=o||new cG,o.addError(u,p));continue}h[d[d.length-1]]=c;continue}try{c=f.cast(c),h[d[d.length-1]]=c}catch(p){r.ignoreCastErrors||(o=o||new cG,o.addError(u,p));continue}}if(o!=null)throw o;return n};Ue.buildBulkWriteOperations=function(e,r){if(!Array.isArray(e))throw new Error(`bulkSave expects an array of documents to be passed, received \`${e}\` instead`);return i(),e.map((a,s)=>{if(!r.skipValidation){if(!(a instanceof Fh))throw new Error(`documents.${s} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`);if(r.validateBeforeSave==null||r.validateBeforeSave){let c=a.validateSync();if(c!=null)throw c}}if(a.isNew){let c={insertOne:{document:a}};return Yn.injectTimestampsOption(c.insertOne,r.timestamps),c}let u=a.$__delta();if(u!=null&&!Yn.isEmptyObject(u[0])){let c=a.$__where(u[0]),d=u[1];kxe(a,c);let h=this.schema.options.shardKey;if(h){let m=Object.keys(h),y=m.length;for(let b=0;b<y;++b)c[m[b]]=a[m[b]]}a.$__version(c,u);let p={updateOne:{filter:c,update:d}};return Yn.injectTimestampsOption(p.updateOne,r.timestamps),p}return null}).filter(a=>a!==null);function i(){r=r||{},r.skipValidation==null&&(r.skipValidation=!1)}};Ue.hydrate=function(t,e,r){if(Sr(this,"hydrate"),r?.virtuals&&r?.hydratedPopulatedDocs===!1)throw new hr("Cannot set `hydratedPopulatedDocs` option to false if `virtuals` option is truthy because `virtuals: true` also sets populated virtuals");e!=null&&(t?.$__!=null&&(t=t.toObject($xe)),t=$8n(t,e));let n=rR().createModel(this,t,e);return n.$init(t,r),n};Ue.updateMany=function(e,r,n){if(Sr(this,"updateMany"),r==null)throw new hr("updateMany `update` parameter cannot be nullish");return Lxe(this,"updateMany",e,r,n)};Ue.updateOne=function(e,r,n){return Sr(this,"updateOne"),Lxe(this,"updateOne",e,r,n)};Ue.replaceOne=function(e,r,n){Sr(this,"replaceOne");let i=this?.schema?.options?.versionKey||null;return i&&!r[i]&&(r[i]=0),Lxe(this,"replaceOne",e,r,n)};function Lxe(t,e,r,n,i){let a=new t.Query({},{},t,t.collection);r instanceof Fh?r=r.toObject():r=Ly(r),i=typeof i=="function"?i:Ly(i);let s=t?.schema?.options?.versionKey||null;return lTt(n,i,s),a[e](r,n,i)}Ue.aggregate=function(e,r){if(Sr(this,"aggregate"),typeof r=="function"||typeof arguments[2]=="function")throw new hr("Model.aggregate() no longer accepts a callback");let n=new O8n(e||[]);return n.model(this),r!=null&&n.option(r),n};Ue.validate=async function(e,r,n){if((arguments.length<3||arguments.length===3&&typeof arguments[2]=="function")&&(n=e),typeof n=="function"||typeof arguments[3]=="function")throw new hr("Model.validate() no longer accepts a callback");let i=this.schema,a=i.options.discriminatorKey;i.discriminators!=null&&e!=null&&e[a]!=null&&(i=cTt(i,e[a])||i);let s=Object.keys(i.paths);if(r!=null){let f=typeof r=="string"?new Set(r.split(" ")):Array.isArray(r)?new Set(r):new Set(s);s=s.filter(c=>{if(r.pathsToSkip){if(Array.isArray(r.pathsToSkip)){if(r.pathsToSkip.find(p=>p==c))return!1}else if(typeof r.pathsToSkip=="string"&&r.pathsToSkip.includes(c))return!1}let d=c.split("."),h=d[0];for(let p of d){if(f.has(h))return!0;h+="."+p}return f.has(c)})}for(let f of s){let c=i.path(f);if(!c?.$isMongooseArray||c.$isMongooseDocumentArray)continue;let d=ZR(e,f);pTt(s,d,f)}let o=null;s=new Set(s);try{e=this.castObject(e)}catch(f){o=f;for(let c of Object.keys(o.errors||{}))s.delete(c)}let u=[];for(let f of s){let c=i.path(f);if(c==null)continue;let d=f.indexOf(".")===-1?[f]:f.split("."),h=e;for(let m=0;m<d.length-1;++m)h=h[d[m]];let p=ZR(e,f,void 0);u.push(c.doValidate(p,n,{path:f}).catch(m=>{o=o||new cG,o.addError(f,m)}))}if(await Promise.all(u),o!=null)throw o;return e};Ue.populate=async function(e,r){if(Sr(this,"populate"),typeof r=="function"||typeof arguments[2]=="function")throw new hr("Model.populate() no longer accepts a callback");if(r=Yn.populate(r),r.length===0)return e;if(r.find(n=>n.ordered))for(let n of r)await rTt(this,e,n);else{let n=[];for(let i of r)n.push(rTt(this,e,i));await Promise.all(n)}return e};var y4n=/\s?-_id\s?/,b4n=/\s?-_id\s?/g;async function rTt(t,e,r){if(r.strictPopulate==null&&(r._localModel?.schema._userProvidedOptions.strictPopulate!=null?r.strictPopulate=r._localModel.schema._userProvidedOptions.strictPopulate:(r._localModel!=null&&t.base.options.strictPopulate!=null||t.base.options.strictPopulate!=null)&&(r.strictPopulate=t.base.options.strictPopulate)),Array.isArray(e)||(e=[e]),e.length===0||e.every(Yn.isNullOrUndefined))return;let n=K8n(t,e,r);if(n instanceof hr)throw n;let i=n.length,a=[];function s(f){return f!==void 0}let o=!1,u=[];for(let f=0;f<i;++f){let c=n[f],d=c.options.select,h=Yn.array.flatten(c.ids,s);h=Yn.array.unique(h);let p={};if(p.sort=c&&c.options&&c.options.options&&c.options.options.sort||void 0,p.excludeId=y4n.test(d)||d&&d._id===0,c.options&&c.options.options&&c.options.options.lean&&c.options.options.lean.transform&&(c.options.options._leanTransform=c.options.options.lean.transform,c.options.options.lean=!0),h.length===0||h.every(Yn.isNullOrUndefined)){iTt(t,[],c,p);continue}o=!0,typeof r.foreignField=="string"&&(c.foreignField.clear(),c.foreignField.add(r.foreignField));let m=H8n(h,c.match,c.foreignField,c.model,c.options.skipInvalidIds);p.excludeId&&(typeof d=="string"?d=d.replace(b4n," "):Array.isArray(d)?d=d.filter(y=>y!=="-_id"):(d={...d},delete d._id)),c.options.options?.limit!=null?p.originalLimit=c.options.options.limit:c.options.limit!=null&&(p.originalLimit=c.options.limit),u.push([c,m,d,p])}if(!o){if(n.length!==0)return;if(r.populate!=null){let f=Yn.populate(r.populate).map(c=>Object.assign({},c,{path:r.path+"."+c.path}));return t.populate(e,f)}return}if(r.ordered)for(let f of u)await nTt.apply(null,f).then(c=>{a=a.concat(c)});else{let f=[];for(let c of u)f.push(nTt.apply(null,c).then(d=>{a=a.concat(d)}));await Promise.all(f)}for(let f of u){let c=f[0],d=f[3];for(let h of a)c.options._childDocs.push(h);iTt(t,a,c,d)}for(let f of u)r4n(f[0].foreignField,f[0].options,a);for(let f of u){let c=f[0];if(c.options?.options?._leanTransform)for(let d of a)c.options.options._leanTransform(d)}}function nTt(t,e,r){let n=Ly(t.options.populate),i={};t.options.skip!==void 0&&(i.skip=t.options.skip),t.options.limit!==void 0&&(i.limit=t.options.limit),t.options.perDocumentLimit!==void 0&&(i.perDocumentLimit=t.options.perDocumentLimit),Object.assign(i,t.options.options),t.count&&delete i.skip,i.perDocumentLimit!=null?(i.limit=i.perDocumentLimit,delete i.perDocumentLimit):i.limit!=null&&(i.limit=i.limit*t.ids.length);let a=t.model.find(e,r,i);for(let s of t.foreignField)s!=="_id"&&a.selectedInclusively()&&!X8n(a._fields,s)&&a.select(s);if(t.count)for(let s of t.foreignField)a.select(s);if(n){t.model.baseModelName!=null&&(Array.isArray(n)?n.forEach(o=>{o.strictPopulate=!1}):typeof n=="string"?n={path:n,strictPopulate:!1}:n.strictPopulate=!1);let s=t.options._fullPath||t.options.path;if(Array.isArray(n))for(let o of n)o._fullPath=s+"."+o.path;else typeof n=="object"&&(n._fullPath=s+"."+n.path);a.populate(n)}return a.exec().then(s=>{for(let o of s)Q8n.set(o,t.model);return s})}function iTt(t,e,r,n){let i=r.options,a=r.isVirtual,s=r.justOne,o,u=i&&i.options&&i.options.lean||!1,f=e.length,c={},d={},h,p,m=Ly(r.allIds);for(let y=0;y<f;y++)if(p=e[y],p!=null)for(let b of r.foreignField){if(o=Yn.getValue(b,p),Array.isArray(o)){o=Yn.array.unique(Yn.array.flatten(o));for(let v of o)v instanceof Fh&&(v=v._doc._id),h=String(v),d[h]?Array.isArray(d[h])?(d[h].push(p),c[h].push(y)):(d[h]=[d[h],p],c[h]=[c[h],y]):a&&!s?(d[h]=[p],c[h]=[y]):(d[h]=p,c[h]=y)}else o instanceof Fh&&(o=o._doc._id),h=String(o),d[h]?Array.isArray(d[h])?(d[h].push(p),c[h].push(y)):(a||d[h].constructor!==p.constructor||(d[h]instanceof Fh?String(d[h]._doc._id):String(d[h]._id))!==(p instanceof Fh?String(p._doc._id):String(p._id)))&&(d[h]=[d[h],p],c[h]=[c[h],y]):(d[h]=p,c[h]=y);u||(p.$__.wasPopulated=p.$__.wasPopulated||{value:o})}U8n({originalModel:t,rawIds:r.isVirtual?m:r.allIds,allIds:m,unpopulatedValues:r.unpopulatedValues,foreignField:r.foreignField,rawDocs:d,rawOrder:c,docs:r.docs,path:i.path,options:n,justOne:r.justOne,isVirtual:r.isVirtual,allOptions:r,populatedModel:r.model,lean:u,virtual:r.virtual,count:r.count,match:r.match})}Ue.compile=function(e,r,n,i,a){if(r.options.versionKey!==!1&&!r.paths[r.options.versionKey]){let d={};d[r.options.versionKey]=Number,r.add(d)}let o;typeof e=="function"&&e.prototype instanceof Ue?(o=e,e=o.name,r.loadClass(o,!1),o.prototype.$isMongooseModelPrototype=!0):o=function d(h,p,m){if(d.hooks.execPreSync("createModel",h),!(this instanceof d))return new d(h,p,m);let y=d.schema.options.discriminatorKey;if(d.discriminators==null||h==null||h[y]==null){Ue.call(this,h,p,m);return}let b=d.discriminators[h[y]]||KR(d.discriminators,h[y]);if(b!=null)return new b(h,p,m);Ue.call(this,h,p,m)},o.hooks=r.s.hooks.clone(),o.base=a,o.modelName=e,o.prototype instanceof Ue||(Object.setPrototypeOf(o,Ue),Object.setPrototypeOf(o.prototype,Ue.prototype)),o.model=function(h){return this.db.model(h)},o.db=i,o.prototype.db=i,o.prototype[Rv]=i,o.discriminators=o.prototype.discriminators=void 0,o[hTt]=!0,o.events=new Nxe,r._preCompile();let f={schemaUserProvidedOptions:r._userProvidedOptions||{},capped:r.options.capped,Promise:o.base.Promise,modelName:e};r.options.autoCreate!==void 0&&(f.autoCreate=r.options.autoCreate);let c=i.collection(n,f);return o.prototype.collection=c,o.prototype.$collection=c,o.prototype[Pv]=c,o.prototype.$__setSchema(r),sTt(o,r),uTt(o,r),k8n(o,r),F8n(o,r.s.hooks,r.statics),o.schema=o.prototype.$__schema,o.collection=c,o.$__collection=c,o.Query=function(){lG.apply(this,arguments)},Object.setPrototypeOf(o.Query.prototype,lG.prototype),o.Query.base=lG.base,o.Query.prototype.constructor=lG,o._applyQueryMiddleware(),g4n(o,r.query),o};Ue.clientEncryption=function(){let e=this.base.driver.get().ClientEncryption;if(!e)throw new Error("The mongodb driver must be used to obtain a ClientEncryption object.");let r=this.collection?.conn?.client;if(!r)return null;let n=r.options.autoEncryption;if(!n)return null;let{keyVaultNamespace:i,keyVaultClient:a,kmsProviders:s,credentialProviders:o,proxyOptions:u,tlsOptions:f}=n;return new e(a??r,{keyVaultNamespace:i,kmsProviders:s,credentialProviders:o,proxyOptions:u,tlsOptions:f})};Ue.$__updateConnection=function(e){this.db=e,this.prototype.db=e,this.prototype[Rv]=e;let r=e.collection(this.collection.collectionName,this.collection.opts);this.prototype.collection=r,this.prototype.$collection=r,this.prototype[Pv]=r,this.collection=r,this.$__collection=r};function g4n(t,e){for(let r in e)t.Query.prototype[r]=e[r]}Ue.__subclass=function(e,r,n){let i=this,a=function c(d,h,p){if(!(this instanceof c))return new c(d,h,p);i.call(this,d,h,p)};if(Object.setPrototypeOf(a,i),Object.setPrototypeOf(a.prototype,i.prototype),a.db=e,a.prototype.db=e,a.prototype[Rv]=e,i[YR]=i[YR]||[],i[YR].push(a),i.discriminators!=null){a.discriminators={};for(let c of Object.keys(i.discriminators))a.discriminators[c]=i.discriminators[c].__subclass(i.db,i.discriminators[c].schema,n)}let s=r&&typeof r!="string"?r:i.prototype.$__schema,o=s.options||{},u=s._userProvidedOptions||{};n||(n=i.prototype.$__schema.get("collection")||Yn.toCollectionName(i.modelName,this.base.pluralize()));let f={schemaUserProvidedOptions:u,capped:s&&o.capped};return a.prototype.collection=e.collection(n,f),a.prototype.$collection=a.prototype.collection,a.prototype[Pv]=a.prototype.collection,a.collection=a.prototype.collection,a.$__collection=a.collection,a.init().catch(()=>{}),a};Ue.recompileSchema=function(){if(this.prototype.$__setSchema(this.schema),this.schema._applyDiscriminators!=null)for(let e of this.schema._applyDiscriminators.keys())this.discriminator(e,this.schema._applyDiscriminators.get(e));delete this.schema._defaultToObjectOptionsMap,D8n(this.schema,new WeakSet,!0)};Ue.inspect=function(){return`Model { ${this.modelName} }`};Ue.namespace=function(){return this.db.name+"."+this.collection.collectionName};Qxt.inspect.custom&&(Ue[Qxt.inspect.custom]=Ue.inspect);Ue._applyQueryMiddleware=function(){let e=this.Query,r=this.schema.s.hooks.filter(n=>{let i=v4n(n);return n.name==="validate"?!!i.query:n.name==="deleteOne"||n.name==="updateOne"?!!i.query||Yn.hasOwnKeys(i)===!1:n.query!=null||n.document!=null?!!n.query:!0});e.prototype._queryMiddleware=r};function v4n(t){let e={};return Object.hasOwn(t,"query")&&(e.query=t.query),Object.hasOwn(t,"document")&&(e.document=t.document),e}yTt.exports=mTt=Ue});var gTt=l((XR,bTt)=>{"use strict";bTt.exports=S4n;XR.pluralization=[[/human$/gi,"humans"],[/(m|wom)an$/gi,"$1en"],[/(pe)rson$/gi,"$1ople"],[/(child)$/gi,"$1ren"],[/^(ox)$/gi,"$1en"],[/(ax|test)is$/gi,"$1es"],[/(octop|cact|foc|fung|nucle)us$/gi,"$1i"],[/(alias|status|virus)$/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 _4n=XR.pluralization;XR.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 E4n=XR.uncountables;function S4n(t){let e;return t=t.toLowerCase(),!~E4n.indexOf(t)&&(e=_4n.filter(function(r){return t.match(r[0])}),e[0])?t.replace(e[0][0],e[0][1]):t}});var wTt=l((GSa,STt)=>{"use strict";var ETt=Ir(),vTt=fe("util"),_Tt=uSe(),rg=class t extends ETt{constructor(){super(""),this.errors={}}toString(){return _Tt(this)}inspect(){return Object.assign(new Error(this.message),this)}addError(e,r){if(r instanceof t){let{errors:n}=r;for(let i of Object.keys(n))this.addError(i,n[i]);return}this.errors[e]=r,this.message=_Tt(this)}};vTt.inspect.custom&&(rg.prototype[vTt.inspect.custom]=rg.prototype.inspect);Object.defineProperty(rg.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(rg.prototype,"name",{value:"SetOptionError"});var jxe=class extends ETt{constructor(e){super(`"${e}" is not a valid option to set`)}};rg.SetOptionInnerError=jxe;STt.exports=rg});var xTt=l(()=>{"use strict";var ATt=zt();typeof jest<"u"&&!process.env.SUPPRESS_JEST_WARNINGS&&(typeof window<"u"&&ATt.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."),typeof setTimeout.clock?.Date=="function"&&ATt.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 NTt=l((RTt,qTt)=>{"use strict";var w4n=Dh(),A4n=fe("events").EventEmitter,Uxe=ov(),jy=bv(),x4n=ka(),QR=mR(),T4n=Gz(),mG=ZM(),TTt=zSt(),O4n=M9(),C4n=YW(),OTt=vxe(),I4n=_Ae(),M4n=Wwe(),CTt=qW(),P4n=gTt(),yG=zt(),R4n=LAe(),q4n=_v(),N4n=mxe(),D4n=b9().trusted,k4n=sxe(),$4n=Jo(),Q9=Ir(),hG=wTt(),B4n=bxe(),ITt=Symbol.for("mongoose:default"),MTt=Symbol("mongoose:defaultConnection");xTt();var F4n=/^[0-9A-Fa-f]{24}$/,{AsyncLocalStorage:PTt}=fe("async_hooks");function ct(t){if(this.connections=[],this.nextConnectionId=0,this.models={},this.events=new A4n,this.__driver=CTt.get(),this.options=Object.assign({pluralization:!0,autoIndex:!0,autoCreate:!0,autoSearchIndex:!1},t),(yG.getOption("createInitialConnection",this.options)??!0)&&this.__driver!=null&&Vxe(this),this.options.pluralization&&(this._pluralize=P4n),t?.[ITt])for(let r of["Schema","model"])this[r]=ct.prototype[r];else{let r=this;this.Schema=function(){return this.base=r,jy.apply(this,arguments)},this.Schema.prototype=Object.create(jy.prototype),Object.assign(this.Schema,jy),this.Schema.base=this,this.Schema.Types=Object.assign({},jy.Types)}this.Schema.prototype.base=this,t?.transactionAsyncLocalStorage&&(this.transactionAsyncLocalStorage=new PTt),Object.defineProperty(this,"plugins",{configurable:!1,enumerable:!0,writable:!1,value:Object.values(M4n).map(r=>[r,{deduplicate:!0}])})}ct.prototype.cast=q4n;ct.prototype.STATES=mG;ct.prototype.ConnectionStates=mG;ct.prototype.driver=CTt;ct.prototype.setDriver=function(e){let r=this instanceof ct?this:Pu;if(r.__driver===e)return r;if(r.connections&&r.connections.find(s=>s.readyState!==mG.disconnected)){let s="Cannot modify Mongoose driver if a connection is already open. Call `mongoose.disconnect()` before modifying the driver";throw new Q9(s)}if(r.__driver=e,Array.isArray(e.plugins))for(let s of e.plugins)typeof s=="function"&&r.plugin(s);e.SchemaTypes!=null&&Object.assign(Pu.Schema.Types,e.SchemaTypes);let i=e.Connection,a=r.connections[0];if(r.connections=[new i(r)],r.connections[0].models=r.models,a==null)return r;for(let s of Object.values(r.models))s.db===a&&s.$__updateConnection(r.connections[0]);return r};ct.prototype.set=function(e,r){let n=this instanceof ct?this:Pu;if(arguments.length===1&&typeof e!="object"){if(TTt.indexOf(e)===-1){let s=new hG;throw s.addError(e,new hG.SetOptionInnerError(e)),s}return n.options[e]}let i={};arguments.length===2&&(i={[e]:r}),arguments.length===1&&typeof e=="object"&&(i=e);let a;for(let[s,o]of Object.entries(i)){if(TTt.indexOf(s)===-1){a||(a=new hG),a.addError(s,new hG.SetOptionInnerError(s));continue}n.options[s]=o,s==="objectIdGetter"?o?Object.defineProperty(n.Types.ObjectId.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}):delete n.Types.ObjectId.prototype._id:s==="transactionAsyncLocalStorage"?o&&!n.transactionAsyncLocalStorage?n.transactionAsyncLocalStorage=new PTt:!o&&n.transactionAsyncLocalStorage&&delete n.transactionAsyncLocalStorage:s==="createInitialConnection"&&(o&&!n.connection?Vxe(n):o===!1&&n.connection?.[MTt]&&n.connection.readyState===mG.disconnected&&yG.hasOwnKeys(n.connection.models)===!1&&n.connections.shift())}if(a)throw a;return n};ct.prototype.get=ct.prototype.set;ct.prototype.createConnection=function(e,r){let n=this instanceof ct?this:Pu,i=n.__driver.Connection,a=new i(n);return n.connections.push(a),n.nextConnectionId++,n.events.emit("createConnection",a),arguments.length>0&&a.openUri(e,{...r,_fireAndForget:!0}),a};ct.prototype.connect=async function(e,r){if(typeof r=="function"||arguments.length>=3&&typeof arguments[2]=="function")throw new Q9("Mongoose.prototype.connect() no longer accepts a callback");let n=this instanceof ct?this:Pu;return n.connection==null&&Vxe(n),n.connection.openUri(e,r).then(()=>n)};ct.prototype.disconnect=async function(){if(arguments.length>=1&&typeof arguments[0]=="function")throw new Q9("Mongoose.prototype.disconnect() no longer accepts a callback");let e=this instanceof ct?this:Pu;e.connections.length<=0||await Promise.all(e.connections.map(n=>n.close()))};ct.prototype.startSession=function(){let e=this instanceof ct?this:Pu;return e.connection.startSession.apply(e.connection,arguments)};ct.prototype.pluralize=function(e){let r=this instanceof ct?this:Pu;return arguments.length>0&&(r._pluralize=e),r._pluralize};ct.prototype.model=function(e,r,n,i){let a=this instanceof ct?this:Pu;if(typeof r=="string"&&(n=r,r=!1),arguments.length===1){let f=a.models[e];if(!f)throw new a.Error.MissingSchemaError(e);return f}if(yG.isObject(r)&&!(r instanceof jy)&&(r=new jy(r)),r&&!(r instanceof jy))throw new a.Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");i=i||{};let s=r;r&&(a.get("cloneSchemas")&&(r=r.clone()),a._applyPlugins(r));let o=Object.hasOwn(a.options,"overwriteModels")?a.options.overwriteModels:i.overwriteModels;if(Object.hasOwn(a.models,e)&&i.cache!==!1&&o!==!0){if(s?.instanceOfSchema&&s!==a.models[e].schema)throw new a.Error.OverwriteModelError(e);if(n&&n!==a.models[e].collection.name){let f=a.models[e];return r=f.prototype.schema,f.__subclass(a.connection,r,n)}return a.models[e]}if(r==null)throw new a.Error.MissingSchemaError(e);let u=a._model(e,r,n,i);return a.connection.models[e]=u,a.models[e]=u,u};ct.prototype._model=function(e,r,n,i){let a=this instanceof ct?this:Pu,s;if(typeof e=="function"&&(s=e,e=s.name,!(s.prototype instanceof OTt)))throw new a.Error("The provided class "+e+" must extend Model");r&&(a.get("cloneSchemas")&&(r=r.clone()),a._applyPlugins(r)),(r==null||!("pluralization"in r.options))&&(r.options.pluralization=a.options.pluralization),n||(n=r.get("collection")||yG.toCollectionName(e,a.pluralize())),B4n(r);let o=i.connection||a.connection;if(s=a.Model.compile(s||e,r,n,o,a),s.init().catch(function(){}),o.emit("model",s),r._applyDiscriminators!=null)for(let u of r._applyDiscriminators.keys()){let{schema:f,options:c}=r._applyDiscriminators.get(u);s.discriminator(u,f,c)}return s};ct.prototype.deleteModel=function(e){let r=this instanceof ct?this:Pu;return r.connection.deleteModel(e),delete r.models[e],r};ct.prototype.modelNames=function(){let e=this instanceof ct?this:Pu;return Object.keys(e.models)};ct.prototype._applyPlugins=function(e,r){let n=this instanceof ct?this:Pu;r=r||{},r.applyPluginsToDiscriminators=n.options?.applyPluginsToDiscriminators||!1,r.applyPluginsToChildSchemas=typeof n.options?.applyPluginsToChildSchemas=="boolean"?n.options.applyPluginsToChildSchemas:!0,I4n(e,n.plugins,r,"$globalPluginsApplied")};ct.prototype.plugin=function(e,r){let n=this instanceof ct?this:Pu;return n.plugins.push([e,r]),n};ct.prototype.__defineGetter__("connection",function(){return this.connections[0]});ct.prototype.__defineSetter__("connection",function(t){t instanceof this.__driver.Connection&&(this.connections[0]=t,this.models=t.models)});ct.prototype.connections;ct.prototype.nextConnectionId;ct.prototype.Aggregate=N4n;ct.prototype.BaseCollection=U_e();Object.defineProperty(ct.prototype,"Collection",{get:function(){return this.__driver.Collection},set:function(t){this.__driver.Collection=t}});Object.defineProperty(ct.prototype,"Connection",{get:function(){return this.__driver.Connection},set:function(t){t!==this.__driver.Connection&&(this.__driver.Connection=t)}});ct.prototype.BaseConnection=FAe();ct.prototype.version=R4n.version;ct.prototype.Mongoose=ct;ct.prototype.Schema=jy;ct.prototype.SchemaType=x4n;ct.prototype.SchemaTypes=jy.Types;ct.prototype.VirtualType=T4n;ct.prototype.Types=O4n;ct.prototype.Query=C4n;ct.prototype.Model=OTt;ct.prototype.Document=w4n;ct.prototype.ObjectId=QR.ObjectId;ct.prototype.isValidObjectId=function(e){return(this instanceof ct?this:Pu).Types.ObjectId.isValid(e)};ct.prototype.isObjectIdOrHexString=function(e){return $4n(e,"ObjectId")||typeof e=="string"&&F4n.test(e)};ct.prototype.syncIndexes=function(e){return(this instanceof ct?this:Pu).connection.syncIndexes(e)};ct.prototype.Decimal128=QR.Decimal128;ct.prototype.Mixed=QR.Mixed;ct.prototype.Date=QR.Date;ct.prototype.Number=QR.Number;ct.prototype.Error=Q9;ct.prototype.MongooseError=Q9;ct.prototype.now=function(){return new Date};ct.prototype.CastError=Q9.CastError;ct.prototype.SchemaTypeOptions=ff();ct.prototype.mquery=ixe();ct.prototype.sanitizeFilter=k4n;ct.prototype.trusted=D4n;ct.prototype.skipMiddlewareFunction=Uxe.skipWrappedFunction;ct.prototype.overwriteMiddlewareResult=Uxe.overwriteResult;ct.prototype.overwriteMiddlewareArguments=Uxe.overwriteArguments;ct.prototype.omitUndefined=bwe();function Vxe(t){if(t.connection)return;let e=t.createConnection();e[MTt]=!0,e.models=t.models}var Pu=qTt.exports=RTt=new ct({[ITt]:!0})});var $Tt=l((JSa,kTt)=>{"use strict";var DTt=VSt();qW().set(DTt);var Hxe=NTt();Hxe.setDriver(DTt);Hxe.Mongoose.prototype.mongo=Ob();kTt.exports=Hxe});var zxe=l((ZSa,er)=>{"use strict";var ir=$Tt();er.exports=ir;er.exports.default=ir;er.exports.mongoose=ir;er.exports.cast=ir.cast;er.exports.STATES=ir.STATES;er.exports.setDriver=ir.setDriver;er.exports.set=ir.set;er.exports.get=ir.get;er.exports.createConnection=ir.createConnection;er.exports.connect=ir.connect;er.exports.disconnect=ir.disconnect;er.exports.startSession=ir.startSession;er.exports.pluralize=ir.pluralize;er.exports.model=ir.model;er.exports.deleteModel=ir.deleteModel;er.exports.modelNames=ir.modelNames;er.exports.plugin=ir.plugin;er.exports.connections=ir.connections;er.exports.version=ir.version;er.exports.Aggregate=ir.Aggregate;er.exports.Mongoose=ir.Mongoose;er.exports.Schema=ir.Schema;er.exports.SchemaType=ir.SchemaType;er.exports.SchemaTypes=ir.SchemaTypes;er.exports.VirtualType=ir.VirtualType;er.exports.Types=ir.Types;er.exports.Query=ir.Query;er.exports.Model=ir.Model;er.exports.Document=ir.Document;er.exports.ObjectId=ir.ObjectId;er.exports.isValidObjectId=ir.isValidObjectId;er.exports.isObjectIdOrHexString=ir.isObjectIdOrHexString;er.exports.syncIndexes=ir.syncIndexes;er.exports.Decimal128=ir.Decimal128;er.exports.Mixed=ir.Mixed;er.exports.Date=ir.Date;er.exports.Number=ir.Number;er.exports.Error=ir.Error;er.exports.MongooseError=ir.MongooseError;er.exports.now=ir.now;er.exports.CastError=ir.CastError;er.exports.SchemaTypeOptions=ir.SchemaTypeOptions;er.exports.mongo=ir.mongo;er.exports.mquery=ir.mquery;er.exports.sanitizeFilter=ir.sanitizeFilter;er.exports.trusted=ir.trusted;er.exports.skipMiddlewareFunction=ir.skipMiddlewareFunction;er.exports.overwriteMiddlewareResult=ir.overwriteMiddlewareResult});var zTt=l((Txa,HTt)=>{var VTt=fe("stream").Stream,g7n=fe("util");HTt.exports=h1;function h1(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}g7n.inherits(h1,VTt);h1.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var i=t.emit;return t.emit=function(){return r._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(h1.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});h1.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};h1.prototype.resume=function(){this._released||this.release(),this.source.resume()};h1.prototype.pause=function(){this.source.pause()};h1.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};h1.prototype.pipe=function(){var t=VTt.prototype.pipe.apply(this,arguments);return this.resume(),t};h1.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};h1.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var YTt=l((Oxa,KTt)=>{var v7n=fe("util"),GTt=fe("stream").Stream,WTt=zTt();KTt.exports=La;function La(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}v7n.inherits(La,GTt);La.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};La.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};La.prototype.append=function(t){var e=La.isStreamLike(t);if(e){if(!(t instanceof WTt)){var r=WTt.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=r}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};La.prototype.pipe=function(t,e){return GTt.prototype.pipe.call(this,t,e),this.resume(),t};La.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};La.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=La.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};La.prototype._pipeNext=function(t){this._currentStream=t;var e=La.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var r=t;this.write(r),this._getNext()};La.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};La.prototype.write=function(t){this.emit("data",t)};La.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};La.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};La.prototype.end=function(){this._reset(),this.emit("end")};La.prototype.destroy=function(){this._reset(),this.emit("close")};La.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};La.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};La.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};La.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var JTt=l((Cxa,_7n)=>{_7n.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var XTt=l((Ixa,ZTt)=>{ZTt.exports=JTt()});var tOt=l(gf=>{"use strict";var qG=XTt(),E7n=fe("path").extname,QTt=/^\s*([^;\s]*)(?:;|\s|$)/,S7n=/^text\//i;gf.charset=eOt;gf.charsets={lookup:eOt};gf.contentType=w7n;gf.extension=A7n;gf.extensions=Object.create(null);gf.lookup=x7n;gf.types=Object.create(null);T7n(gf.extensions,gf.types);function eOt(t){if(!t||typeof t!="string")return!1;var e=QTt.exec(t),r=e&&qG[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&S7n.test(e[1])?"UTF-8":!1}function w7n(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?gf.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=gf.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}function A7n(t){if(!t||typeof t!="string")return!1;var e=QTt.exec(t),r=e&&gf.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}function x7n(t){if(!t||typeof t!="string")return!1;var e=E7n("x."+t).toLowerCase().substr(1);return e&&gf.types[e]||!1}function T7n(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(qG).forEach(function(i){var a=qG[i],s=a.extensions;if(!(!s||!s.length)){t[i]=s;for(var o=0;o<s.length;o++){var u=s[o];if(e[u]){var f=r.indexOf(qG[e[u]].source),c=r.indexOf(a.source);if(e[u]!=="application/octet-stream"&&(f>c||f===c&&e[u].substr(0,12)==="application/"))continue}e[u]=i}}})}});var nOt=l((Pxa,rOt)=>{rOt.exports=O7n;function O7n(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}});var lTe=l((Rxa,aOt)=>{var iOt=nOt();aOt.exports=C7n;function C7n(t){var e=!1;return iOt(function(){e=!0}),function(n,i){e?t(n,i):iOt(function(){t(n,i)})}}});var cTe=l((qxa,sOt)=>{sOt.exports=I7n;function I7n(t){Object.keys(t.jobs).forEach(M7n.bind(t)),t.jobs={}}function M7n(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}});var dTe=l((Nxa,uOt)=>{var oOt=lTe(),P7n=cTe();uOt.exports=R7n;function R7n(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=q7n(e,i,t[i],function(a,s){i in r.jobs&&(delete r.jobs[i],a?P7n(r):r.results[i]=s,n(a,r.results))})}function q7n(t,e,r,n){var i;return t.length==2?i=t(r,oOt(n)):i=t(r,e,oOt(n)),i}});var pTe=l((Dxa,fOt)=>{fOt.exports=N7n;function N7n(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,a){return e(t[i],t[a])}),n}});var hTe=l((kxa,lOt)=>{var D7n=cTe(),k7n=lTe();lOt.exports=$7n;function $7n(t){Object.keys(this.jobs).length&&(this.index=this.size,D7n(this),k7n(t)(null,this.results))}});var dOt=l(($xa,cOt)=>{var B7n=dTe(),F7n=pTe(),L7n=hTe();cOt.exports=j7n;function j7n(t,e,r){for(var n=F7n(t);n.index<(n.keyedList||t).length;)B7n(t,e,n,function(i,a){if(i){r(i,a);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return L7n.bind(n,r)}});var mTe=l((Bxa,NG)=>{var pOt=dTe(),U7n=pTe(),V7n=hTe();NG.exports=H7n;NG.exports.ascending=hOt;NG.exports.descending=z7n;function H7n(t,e,r,n){var i=U7n(t,r);return pOt(t,e,i,function a(s,o){if(s){n(s,o);return}if(i.index++,i.index<(i.keyedList||t).length){pOt(t,e,i,a);return}n(null,i.results)}),V7n.bind(i,n)}function hOt(t,e){return t<e?-1:t>e?1:0}function z7n(t,e){return-1*hOt(t,e)}});var yOt=l((Fxa,mOt)=>{var W7n=mTe();mOt.exports=G7n;function G7n(t,e,r){return W7n(t,e,null,r)}});var gOt=l((Lxa,bOt)=>{bOt.exports={parallel:dOt(),serial:yOt(),serialOrdered:mTe()}});var yTe=l((jxa,vOt)=>{"use strict";vOt.exports=Object});var EOt=l((Uxa,_Ot)=>{"use strict";_Ot.exports=Error});var wOt=l((Vxa,SOt)=>{"use strict";SOt.exports=EvalError});var xOt=l((Hxa,AOt)=>{"use strict";AOt.exports=RangeError});var OOt=l((zxa,TOt)=>{"use strict";TOt.exports=ReferenceError});var IOt=l((Wxa,COt)=>{"use strict";COt.exports=SyntaxError});var DG=l((Gxa,MOt)=>{"use strict";MOt.exports=TypeError});var ROt=l((Kxa,POt)=>{"use strict";POt.exports=URIError});var NOt=l((Yxa,qOt)=>{"use strict";qOt.exports=Math.abs});var kOt=l((Jxa,DOt)=>{"use strict";DOt.exports=Math.floor});var BOt=l((Zxa,$Ot)=>{"use strict";$Ot.exports=Math.max});var LOt=l((Xxa,FOt)=>{"use strict";FOt.exports=Math.min});var UOt=l((Qxa,jOt)=>{"use strict";jOt.exports=Math.pow});var HOt=l((eTa,VOt)=>{"use strict";VOt.exports=Math.round});var WOt=l((tTa,zOt)=>{"use strict";zOt.exports=Number.isNaN||function(e){return e!==e}});var KOt=l((rTa,GOt)=>{"use strict";var K7n=WOt();GOt.exports=function(e){return K7n(e)||e===0?e:e<0?-1:1}});var JOt=l((nTa,YOt)=>{"use strict";YOt.exports=Object.getOwnPropertyDescriptor});var bTe=l((iTa,ZOt)=>{"use strict";var kG=JOt();if(kG)try{kG([],"length")}catch{kG=null}ZOt.exports=kG});var QOt=l((aTa,XOt)=>{"use strict";var $G=Object.defineProperty||!1;if($G)try{$G({},"a",{value:1})}catch{$G=!1}XOt.exports=$G});var gTe=l((sTa,eCt)=>{"use strict";eCt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}});var nCt=l((oTa,rCt)=>{"use strict";var tCt=typeof Symbol<"u"&&Symbol,Y7n=gTe();rCt.exports=function(){return typeof tCt!="function"||typeof Symbol!="function"||typeof tCt("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Y7n()}});var vTe=l((uTa,iCt)=>{"use strict";iCt.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var _Te=l((fTa,aCt)=>{"use strict";var J7n=yTe();aCt.exports=J7n.getPrototypeOf||null});var uCt=l((lTa,oCt)=>{"use strict";var Z7n="Function.prototype.bind called on incompatible ",X7n=Object.prototype.toString,Q7n=Math.max,e9n="[object Function]",sCt=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var a=0;a<r.length;a+=1)n[a+e.length]=r[a];return n},t9n=function(e,r){for(var n=[],i=r||0,a=0;i<e.length;i+=1,a+=1)n[a]=e[i];return n},r9n=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};oCt.exports=function(e){var r=this;if(typeof r!="function"||X7n.apply(r)!==e9n)throw new TypeError(Z7n+r);for(var n=t9n(arguments,1),i,a=function(){if(this instanceof i){var c=r.apply(this,sCt(n,arguments));return Object(c)===c?c:this}return r.apply(e,sCt(n,arguments))},s=Q7n(0,r.length-n.length),o=[],u=0;u<s;u++)o[u]="$"+u;if(i=Function("binder","return function ("+r9n(o,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var f=function(){};f.prototype=r.prototype,i.prototype=new f,f.prototype=null}return i}});var sq=l((cTa,fCt)=>{"use strict";var n9n=uCt();fCt.exports=Function.prototype.bind||n9n});var BG=l((dTa,lCt)=>{"use strict";lCt.exports=Function.prototype.call});var ETe=l((pTa,cCt)=>{"use strict";cCt.exports=Function.prototype.apply});var pCt=l((hTa,dCt)=>{"use strict";dCt.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var mCt=l((mTa,hCt)=>{"use strict";var i9n=sq(),a9n=ETe(),s9n=BG(),o9n=pCt();hCt.exports=o9n||i9n.call(s9n,a9n)});var bCt=l((yTa,yCt)=>{"use strict";var u9n=sq(),f9n=DG(),l9n=BG(),c9n=mCt();yCt.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new f9n("a function is required");return c9n(u9n,l9n,e)}});var wCt=l((bTa,SCt)=>{"use strict";var d9n=bCt(),gCt=bTe(),_Ct;try{_Ct=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var STe=!!_Ct&&gCt&&gCt(Object.prototype,"__proto__"),ECt=Object,vCt=ECt.getPrototypeOf;SCt.exports=STe&&typeof STe.get=="function"?d9n([STe.get]):typeof vCt=="function"?function(e){return vCt(e==null?e:ECt(e))}:!1});var CCt=l((gTa,OCt)=>{"use strict";var ACt=vTe(),xCt=_Te(),TCt=wCt();OCt.exports=ACt?function(e){return ACt(e)}:xCt?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return xCt(e)}:TCt?function(e){return TCt(e)}:null});var FG=l((vTa,ICt)=>{"use strict";var p9n=Function.prototype.call,h9n=Object.prototype.hasOwnProperty,m9n=sq();ICt.exports=m9n.call(p9n,h9n)});var kCt=l((_Ta,DCt)=>{"use strict";var Hr,y9n=yTe(),b9n=EOt(),g9n=wOt(),v9n=xOt(),_9n=OOt(),uE=IOt(),oE=DG(),E9n=ROt(),S9n=NOt(),w9n=kOt(),A9n=BOt(),x9n=LOt(),T9n=UOt(),O9n=HOt(),C9n=KOt(),qCt=Function,wTe=function(t){try{return qCt('"use strict"; return ('+t+").constructor;")()}catch{}},oq=bTe(),I9n=QOt(),ATe=function(){throw new oE},M9n=oq?(function(){try{return arguments.callee,ATe}catch{try{return oq(arguments,"callee").get}catch{return ATe}}})():ATe,aE=nCt()(),So=CCt(),P9n=_Te(),R9n=vTe(),NCt=ETe(),uq=BG(),sE={},q9n=typeof Uint8Array>"u"||!So?Hr:So(Uint8Array),kv={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Hr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Hr:ArrayBuffer,"%ArrayIteratorPrototype%":aE&&So?So([][Symbol.iterator]()):Hr,"%AsyncFromSyncIteratorPrototype%":Hr,"%AsyncFunction%":sE,"%AsyncGenerator%":sE,"%AsyncGeneratorFunction%":sE,"%AsyncIteratorPrototype%":sE,"%Atomics%":typeof Atomics>"u"?Hr:Atomics,"%BigInt%":typeof BigInt>"u"?Hr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Hr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Hr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Hr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":b9n,"%eval%":eval,"%EvalError%":g9n,"%Float16Array%":typeof Float16Array>"u"?Hr:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Hr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Hr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Hr:FinalizationRegistry,"%Function%":qCt,"%GeneratorFunction%":sE,"%Int8Array%":typeof Int8Array>"u"?Hr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Hr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Hr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":aE&&So?So(So([][Symbol.iterator]())):Hr,"%JSON%":typeof JSON=="object"?JSON:Hr,"%Map%":typeof Map>"u"?Hr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!aE||!So?Hr:So(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":y9n,"%Object.getOwnPropertyDescriptor%":oq,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Hr:Promise,"%Proxy%":typeof Proxy>"u"?Hr:Proxy,"%RangeError%":v9n,"%ReferenceError%":_9n,"%Reflect%":typeof Reflect>"u"?Hr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Hr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!aE||!So?Hr:So(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Hr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":aE&&So?So(""[Symbol.iterator]()):Hr,"%Symbol%":aE?Symbol:Hr,"%SyntaxError%":uE,"%ThrowTypeError%":M9n,"%TypedArray%":q9n,"%TypeError%":oE,"%Uint8Array%":typeof Uint8Array>"u"?Hr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Hr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Hr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Hr:Uint32Array,"%URIError%":E9n,"%WeakMap%":typeof WeakMap>"u"?Hr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Hr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Hr:WeakSet,"%Function.prototype.call%":uq,"%Function.prototype.apply%":NCt,"%Object.defineProperty%":I9n,"%Object.getPrototypeOf%":P9n,"%Math.abs%":S9n,"%Math.floor%":w9n,"%Math.max%":A9n,"%Math.min%":x9n,"%Math.pow%":T9n,"%Math.round%":O9n,"%Math.sign%":C9n,"%Reflect.getPrototypeOf%":R9n};if(So)try{null.error}catch(t){MCt=So(So(t)),kv["%Error.prototype%"]=MCt}var MCt,N9n=function t(e){var r;if(e==="%AsyncFunction%")r=wTe("async function () {}");else if(e==="%GeneratorFunction%")r=wTe("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=wTe("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&So&&(r=So(i.prototype))}return kv[e]=r,r},PCt={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},fq=sq(),LG=FG(),D9n=fq.call(uq,Array.prototype.concat),k9n=fq.call(NCt,Array.prototype.splice),RCt=fq.call(uq,String.prototype.replace),jG=fq.call(uq,String.prototype.slice),$9n=fq.call(uq,RegExp.prototype.exec),B9n=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F9n=/\\(\\)?/g,L9n=function(e){var r=jG(e,0,1),n=jG(e,-1);if(r==="%"&&n!=="%")throw new uE("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new uE("invalid intrinsic syntax, expected opening `%`");var i=[];return RCt(e,B9n,function(a,s,o,u){i[i.length]=o?RCt(u,F9n,"$1"):s||a}),i},j9n=function(e,r){var n=e,i;if(LG(PCt,n)&&(i=PCt[n],n="%"+i[0]+"%"),LG(kv,n)){var a=kv[n];if(a===sE&&(a=N9n(n)),typeof a>"u"&&!r)throw new oE("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new uE("intrinsic "+e+" does not exist!")};DCt.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new oE("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new oE('"allowMissing" argument must be a boolean');if($9n(/^%?[^%]*%?$/,e)===null)throw new uE("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=L9n(e),i=n.length>0?n[0]:"",a=j9n("%"+i+"%",r),s=a.name,o=a.value,u=!1,f=a.alias;f&&(i=f[0],k9n(n,D9n([0,1],f)));for(var c=1,d=!0;c<n.length;c+=1){var h=n[c],p=jG(h,0,1),m=jG(h,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new uE("property names with quotes must have matching quotes");if((h==="constructor"||!d)&&(u=!0),i+="."+h,s="%"+i+"%",LG(kv,s))o=kv[s];else if(o!=null){if(!(h in o)){if(!r)throw new oE("base intrinsic for "+e+" exists, but the property is not available.");return}if(oq&&c+1>=n.length){var y=oq(o,h);d=!!y,d&&"get"in y&&!("originalValue"in y.get)?o=y.get:o=o[h]}else d=LG(o,h),o=o[h];d&&!u&&(kv[s]=o)}}return o}});var BCt=l((ETa,$Ct)=>{"use strict";var U9n=gTe();$Ct.exports=function(){return U9n()&&!!Symbol.toStringTag}});var jCt=l((STa,LCt)=>{"use strict";var V9n=kCt(),FCt=V9n("%Object.defineProperty%",!0),H9n=BCt()(),z9n=FG(),W9n=DG(),UG=H9n?Symbol.toStringTag:null;LCt.exports=function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new W9n("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");UG&&(n||!z9n(e,UG))&&(FCt?FCt(e,UG,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[UG]=r)}});var VCt=l((wTa,UCt)=>{"use strict";UCt.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var ITe=l((ATa,HCt)=>{"use strict";var CTe=YTt(),G9n=fe("util"),xTe=fe("path"),K9n=fe("http"),Y9n=fe("https"),J9n=fe("url").parse,Z9n=fe("fs"),X9n=fe("stream").Stream,Q9n=fe("crypto"),TTe=tOt(),eEn=gOt(),tEn=jCt(),ng=FG(),OTe=VCt();function un(t){if(!(this instanceof un))return new un(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],CTe.call(this),t=t||{};for(var e in t)this[e]=t[e]}G9n.inherits(un,CTe);un.LINE_BREAK=`\r
|
|
105
|
-
`;un.DEFAULT_CONTENT_TYPE="application/octet-stream";un.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=CTe.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),a=this._multiPartFooter();n(i),n(e),n(a),this._trackLength(i,e,r)};un.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+un.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&ng(e,"httpVersion"))&&!(e instanceof X9n))&&(r.knownLength||this._valuesToMeasure.push(e))};un.prototype._lengthRetriever=function(t,e){ng(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):Z9n.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):ng(t,"httpVersion")?e(null,Number(t.headers["content-length"])):ng(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};un.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),a="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&OTe(s,r.header);var o;for(var u in s)if(ng(s,u)){if(o=s[u],o==null)continue;Array.isArray(o)||(o=[o]),o.length&&(a+=u+": "+o.join("; ")+un.LINE_BREAK)}return"--"+this.getBoundary()+un.LINE_BREAK+a+un.LINE_BREAK};un.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=xTe.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=xTe.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&ng(t,"httpVersion")&&(r=xTe.basename(t.client._httpMessage.path||"")),r)return'filename="'+r+'"'};un.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=TTe.lookup(t.name)),!r&&t&&t.path&&(r=TTe.lookup(t.path)),!r&&t&&t.readable&&ng(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=TTe.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=un.DEFAULT_CONTENT_TYPE),r};un.prototype._multiPartFooter=function(){return function(t){var e=un.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};un.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+un.LINE_BREAK};un.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)ng(t,e)&&(r[e.toLowerCase()]=t[e]);return r};un.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};un.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};un.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(un.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};un.prototype._generateBoundary=function(){this._boundary="--------------------------"+Q9n.randomBytes(12).toString("hex")};un.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};un.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};un.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}eEn.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};un.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=J9n(t),n=OTe({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=OTe(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=Y9n.request(n):r=K9n.request(n),this.getLength(function(a,s){if(a&&a!=="Unknown stream"){this._error(a);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),e){var o,u=function(f,c){return r.removeListener("error",u),r.removeListener("response",o),e.call(this,f,c)};o=u.bind(this,null),r.on("error",u),r.on("response",o)}}.bind(this)),r};un.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};un.prototype.toString=function(){return"[object FormData]"};tEn(un.prototype,"FormData");HCt.exports=un});import{Agent as VG}from"http";import{Agent as HG}from"https";import zG from"axios";async function S0(){let t=dEn();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}async function Lh(){let t=GCt();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}async function zCt(){let t=cEn();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}async function WCt(){let t=GCt();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}function GCt(){let t=iEn;return process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="testnet"?t=rEn:process.env.TRUEBIT_ENV==="staging"&&(t=nEn),t}function cEn(){let t=oEn;return process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="testnet"?t=aEn:process.env.TRUEBIT_ENV==="staging"&&(t=sEn),t}function dEn(){let t=lEn;return process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="testnet"?t=uEn:process.env.TRUEBIT_ENV==="staging"&&(t=fEn),t}var rEn,nEn,iEn,aEn,sEn,oEn,uEn,fEn,lEn,El=nr(()=>{"use strict";rEn="http://localhost:3000/",nEn="https://worker01-staging.truebit.network/http-adapter/",iEn="https://worker01-prod.truebit.network/http-adapter/",aEn="http://localhost:
|
|
105
|
+
`;un.DEFAULT_CONTENT_TYPE="application/octet-stream";un.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=CTe.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),a=this._multiPartFooter();n(i),n(e),n(a),this._trackLength(i,e,r)};un.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+un.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&ng(e,"httpVersion"))&&!(e instanceof X9n))&&(r.knownLength||this._valuesToMeasure.push(e))};un.prototype._lengthRetriever=function(t,e){ng(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):Z9n.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):ng(t,"httpVersion")?e(null,Number(t.headers["content-length"])):ng(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};un.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),a="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&OTe(s,r.header);var o;for(var u in s)if(ng(s,u)){if(o=s[u],o==null)continue;Array.isArray(o)||(o=[o]),o.length&&(a+=u+": "+o.join("; ")+un.LINE_BREAK)}return"--"+this.getBoundary()+un.LINE_BREAK+a+un.LINE_BREAK};un.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=xTe.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=xTe.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&ng(t,"httpVersion")&&(r=xTe.basename(t.client._httpMessage.path||"")),r)return'filename="'+r+'"'};un.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=TTe.lookup(t.name)),!r&&t&&t.path&&(r=TTe.lookup(t.path)),!r&&t&&t.readable&&ng(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=TTe.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=un.DEFAULT_CONTENT_TYPE),r};un.prototype._multiPartFooter=function(){return function(t){var e=un.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};un.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+un.LINE_BREAK};un.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)ng(t,e)&&(r[e.toLowerCase()]=t[e]);return r};un.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};un.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};un.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(un.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};un.prototype._generateBoundary=function(){this._boundary="--------------------------"+Q9n.randomBytes(12).toString("hex")};un.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};un.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};un.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}eEn.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};un.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=J9n(t),n=OTe({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=OTe(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=Y9n.request(n):r=K9n.request(n),this.getLength(function(a,s){if(a&&a!=="Unknown stream"){this._error(a);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),e){var o,u=function(f,c){return r.removeListener("error",u),r.removeListener("response",o),e.call(this,f,c)};o=u.bind(this,null),r.on("error",u),r.on("response",o)}}.bind(this)),r};un.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};un.prototype.toString=function(){return"[object FormData]"};tEn(un.prototype,"FormData");HCt.exports=un});import{Agent as VG}from"http";import{Agent as HG}from"https";import zG from"axios";async function S0(){let t=dEn();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}async function Lh(){let t=GCt();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}async function zCt(){let t=cEn();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}async function WCt(){let t=GCt();return zG.create({headers:{Connection:"keep-alive"},httpAgent:new VG({keepAlive:!0}),httpsAgent:new HG({keepAlive:!0}),baseURL:t,timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0})}function GCt(){let t=iEn;return process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="testnet"?t=rEn:process.env.TRUEBIT_ENV==="staging"&&(t=nEn),t}function cEn(){let t=oEn;return process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="testnet"?t=aEn:process.env.TRUEBIT_ENV==="staging"&&(t=sEn),t}function dEn(){let t=lEn;return process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="testnet"?t=uEn:process.env.TRUEBIT_ENV==="staging"&&(t=fEn),t}var rEn,nEn,iEn,aEn,sEn,oEn,uEn,fEn,lEn,El=nr(()=>{"use strict";rEn="http://localhost:3000/",nEn="https://worker01-staging.truebit.network/http-adapter/",iEn="https://worker01-prod.truebit.network/http-adapter/",aEn="http://localhost:4010/user/tee/",sEn="https://staging.truebit.network/user/tee/",oEn="https://run.truebit.network/user/tee/",uEn="http://localhost:4010/",fEn="https://staging.truebit.network/",lEn="https://run.truebit.network/"});import*as wc from"fs";import*as lq from"path";import*as KCt from"os";function MTe(){return pEn}function YCt(t=MTe()){let e=jh(),r=lq.join(e,".truebit"),n=lq.join(r,"secret.json");wc.existsSync(r)||wc.mkdirSync(r,{recursive:!0}),wc.writeFileSync(n,JSON.stringify(t,null,2),{encoding:"utf8"})}function w0(){let t=jh(),e=lq.join(t,".truebit","secret.json");if(!wc.existsSync(e))return null;let r=wc.readFileSync(e,{encoding:"utf8"});try{return JSON.parse(r)}catch(n){return console.error("Error parsing secret config file:",n),null}}function cq(t){let e=jh(),r=lq.join(e,".truebit","secret.json");if(!wc.existsSync(r))return;let n=wc.readFileSync(r,{encoding:"utf8"});try{let a={...JSON.parse(n),...t};wc.writeFileSync(r,JSON.stringify(a,null,2),{encoding:"utf8"})}catch(i){console.error("Error updating secret config file:",i)}}function jh(){return process.env.TRUEBIT_PATH||(process.env.TRUEBIT_PATH=KCt.homedir()),process.env.TRUEBIT_PATH}function Dn(t){let e=w0();if(e&&t in e)return e[t]}function WG(){let t=w0();if(!t){console.error("Secret config file does not exist.");return}let e=!1,r=["privateKey","address"];for(let n of r)n in t||(t[n]="",e=!0);e&&(cq(t),console.log("Configuration has been updated with default values for missing properties."))}function JCt(){let t="ed9005372c18624701ec0998cd12bd22";return(process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="staging"||process.env.TRUEBIT_ENV==="testnet")&&(t="6de18f3bc3d0865f3b4a3676ae16908d"),t}var pEn,ZCt,A0=nr(()=>{"use strict";pEn={privateKey:"",address:"",eula:"",RPC_URL:""};ZCt="rs"});import tu from"chalk";var Ri,ig=nr(()=>{"use strict";A0();Ri=class t{static EULA_TERMS_LINK="https://truebit.io/terms/";static SETUP_INTRODUCTION=`
|
|
106
106
|
Your all-in-one solution to develop, build, test, and deploy tasks seamlessly.
|
|
107
107
|
Let's get started by setting up your account and configuring your wallet.
|
|
108
108
|
We'll guide you through each step to ensure a smooth experience.
|
|
@@ -513,7 +513,7 @@ ${r.data.payload.instrumentedTaskId}`);else throw"Malformed instrumentation serv
|
|
|
513
513
|
`+Fi.cyan("=".repeat(60))),console.log(Fi.cyan.bold(" Quota Status")),console.log(Fi.cyan("=".repeat(60))+`
|
|
514
514
|
`),console.log(Fi.white("Wallet Address: ")+Fi.yellow(e)),console.log(Fi.white("Subscription Tier: ")+Fi.green(s.userSubscription.toUpperCase())),s.maxSolutions!==void 0&&console.log(Fi.white("Max Solutions: ")+Fi.green(`${s.maxSolutions}`)),s.quotaMax===0)console.log(Fi.white("Monthly Quota: ")+Fi.green("UNLIMITED")),s.currentUsage!==void 0&&console.log(Fi.white("Current Usage: ")+Fi.yellow(`${s.currentUsage} executions`));else{if(console.log(Fi.white("Monthly Quota: ")+Fi.green(`${s.quotaMax} executions`)),s.currentUsage!==void 0&&(console.log(Fi.white("Current Usage: ")+Fi.yellow(`${s.currentUsage} executions`)),s.remaining!==void 0)){let c=s.remaining===0?Fi.red:s.remaining<s.quotaMax*.2?Fi.yellow:Fi.green;console.log(Fi.white("Remaining: ")+c(`${s.remaining} executions`))}console.log(Fi.white("Quota Resets On: ")+Fi.yellow(f))}console.log(`
|
|
515
515
|
`+Fi.cyan("=".repeat(60))+`
|
|
516
|
-
`)}catch(t){throw t instanceof Error?console.error(Fi.red("Error fetching quota status: ")+t.message):console.error(Fi.red("Error fetching quota status: ")+String(t)),t}}HKe();El();async function c_r(t){try{console.log("Fetching execution status...");let r=await(await Lh()).get(`api/execution/${t}`).catch(Ac);if(r.data.message)throw r.data.message;console.log("Task execution status: ",r.data.status),r.data.output&&console.log("Task execution output: ",r.data.output)}catch(e){console.error(`Couldn't fetch execution status for executionId ${t}: ${e}`)}}var d_r=cr(bV(),1),Ok=class{tokens=[];authInputs;parse(e,r){let n=this.parseKeyValuePairs(r);if(e.length==0){this.authInputs=n;return}let i=Object.keys(n);if(e.every(a=>i.includes(a))){let a={};for(let s of e)a[s]=n[s];this.authInputs=a}else throw new Error(`Invalid authString: ${e} are required`)}parseKeyValuePairs(e){try{let r=e.split(","),n={};for(let i of r){let[a,s]=i.split(":");n[a.trim()]=s.trim()}return n}catch{throw new Error("Invalid auth string")}}},Rpe=class extends Ok{tokens=["accessKey","secretKey"];constructor(e){super(),this.parse(this.tokens,e)}authHeaders(e){return d_r.default.sign(e,{accessKeyId:this.authInputs.accessKey,secretAccessKey:this.authInputs.secretKey}).headers||{}}},qpe=class extends Ok{tokens=["username","password"];constructor(e){super(),this.parse(this.tokens,e)}authHeaders(e){return{Authorization:`Basic ${btoa(`${this.authInputs.username}:${this.authInputs.password}`)}`}}},Npe=class extends Ok{tokens=[];constructor(e){super(),this.parse([],e)}authHeaders(e){return{...this.authInputs}}};var F1;(function(t){t.AWS_SIGNATURE="aws-signature",t.BASIC_AUTH="basic-auth",t.CUSTOM_HEADER="custom-header"})(F1||(F1={}));var zKe=(t,e)=>{switch(t){case F1.AWS_SIGNATURE:return new Rpe(e);case F1.BASIC_AUTH:return new qpe(e);case F1.CUSTOM_HEADER:return new Npe(e);default:throw new Error(`Invalid authentication method specified. Should be one of <${Object.values(F1)}>`)}};import m_r from"chalk";import{ethers as u0a}from"ethers";El();import*as Dpe from"crypto";import a0a from"axios";import WKe from"chalk";function p_r(t){if(a0a.isAxiosError(t)&&t.response?.data){let e=t.response.data;return console.log(WKe.red(e.message)),typeof e=="string"?e:e.message||JSON.stringify(e)}return t instanceof Error?t.message:String(t)}async function s0a(t,e){try{let r=xc({namespace:e});return(await t.post("getkey",r)).data}catch(r){return p_r(r),console.error(WKe.red("Failed to retrieve encryption key from Hub-TEE-KMS. Please try again")),null}}function o0a(t,e){try{let r=Buffer.from(e,"base64"),n=Dpe.randomBytes(16),i=Dpe.createCipheriv("aes-256-cbc",r,n),a=Buffer.concat([i.update(t,"utf8"),i.final()]);return r.fill(0),{encrypted_authString:a.toString("base64"),iv:n.toString("base64")}}catch{return null}}async function h_r(t,e,r){try{let n=await s0a(t,r);if(!n)return null;let i=o0a(e,n.plaintext_key);return i?{encrypted_authString:i.encrypted_authString,encrypted_data_key:n.encryption_key,iv:i.iv}:null}catch(n){return p_r(n),console.error(WKe.red("Failed to encrypt credentials. Please try again.")),null}}async function y_r(t,e,r,n,i,a,s){console.log("Deploying the API Authentication Credentials");try{if(!Gvr(a))throw"Invalid private key provided";if(!u0a.isAddress(s))throw"Invalid address provided";if(zKe(n,i),!dT(t))throw"Invalid taskId";let o=await zCt();console.log("Encrypting credentials...");let u=await h_r(o,i,e);if(!u)return;let f=xc({taskId:t,namespace:e,taskName:r,method:n,encrypted_authString:u.encrypted_authString,encrypted_data_key:u.encrypted_data_key,iv:u.iv});await o.post("credentials",f).catch(Ac),console.log("The encrypted credentials were deployed "+m_r.green("Successfully"))}catch(o){let u=o instanceof Error?o.message:String(o);console.error(m_r.red(u));return}}import{inspect as Zfa}from"util";import Ju from"ora";import{v4 as Xfa}from"uuid";import{ethers as Ype}from"ethers";var b_r={name:"@truebit/cli",version:"1.120.0-beta.262",private:!1,description:"truebit-cli is a basic command line that allows interaction between users and truebit nextgen node.",author:{name:"Truebit Co.",url:"https://truebit.io/"},license:"https://truebit.io/terms/",repository:{type:"git",url:"https://github.com/TruebitProtocol"},homepage:"https://truebit.io/",main:"build/index.mjs",module:"build/index.mjs",types:"build/types/index.d.ts",type:"module",scripts:{prebuild:"rimraf build logs","prebuild:dev":"rimraf build logs","build:dev":"tsc && chmod +x build/index.mjs",build:"NODE_ENV=production node esbuild.config.mjs && chmod +x build/index.mjs",dev:"export NODE_ENV=development && npx nodemon",test:"vitest run --passWithNoTests tests/"},dependencies:{axios:"1.13.3",chalk:"5.6.2",colors:"1.4.0",commander:"14.0.2",ethers:"6.16.0",figlet:"1.10.0","form-data":"4.0.5","openapi-enforcer":"1.23.0",ora:"9.1.0","public-ip":"8.0.0","ts-retry":"6.0.0",uuid:"13.0.0"},bin:{truebit:"build/index.mjs"},files:["build"],devDependencies:{"@types/figlet":"1.7.0","@vitest/coverage-v8":"4.0.18",esbuild:"0.27.2",typescript:"5.9.3",vitest:"4.0.18"},engines:{node:">=22.13.0"}};A0();El();f6();A0();import{createInterface as m0a}from"node:readline/promises";import x2 from"chalk";El();import Ck from"axios";import{ethers as pT}from"ethers";import{randomBytes as l0a}from"crypto";import{v4 as c0a}from"uuid";A0();import{ethers as kpe}from"ethers";async function g_r(t){i8(t);let e=gi(Ru(),Vt.AVAX),r=kpe.keccak256(kpe.toUtf8Bytes(t));return await e.authorization.registerAuthorization(r),r}async function GKe(t,e,r=Dn("address")){i8(t);let n=gi(Ru(),Vt.AVAX),i=await n.authorization.getEIP712Domain(),a=await n.authorization.nonces(r),s=Math.floor(Date.now()/1e3)+3600,o={RegisterMeta:[{name:"user",type:"address"},{name:"apiKeyHash",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},u=kpe.keccak256(kpe.toUtf8Bytes(t)),f={user:r,apiKeyHash:u,nonce:Number(a),deadline:s};if(!n.utils)throw new Error("Private key is required for signing operations");let c=await n.utils.signMeta(i,o,f);return(await Yvr(r,u,s,c,e)).status==201?u:null}A0();f6();import{isTooManyTries as v_r,retryAsync as __r}from"ts-retry";var E_r="0x0000000000000000000000000000000000000000";async function S_r(t){let e=!0;return t===""?(e=!1,console.log("An email address is required. Please provide your email address to proceed.")):new RegExp(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)?await d0a(t)&&(e=!1,console.log("The provided email address is already in use. Please enter a different email address.")):(e=!1,console.log("The email address provided is not valid. Please try again.")),e}function a8(t){return t==="Y"||t==="N"}function w_r(t){return!pT.isAddress(t)||t.length!==42||!t.startsWith("0x")}async function A_r(){let t=Ru(),e=gi(t,Vt.AVAX),r=Dn("address"),n=await h0a(),i=await p0a();i8(i);let a=pT.keccak256(pT.toUtf8Bytes(i)),s=Math.floor(Date.now()/1e3)+3600,o=await e.taskRegistry.getEIP712Domain(),u=await e.authorization.getEIP712Domain(),f={RegisterTaskNamespaceMeta:[{name:"user",type:"address"},{name:"namespace",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},c={RegisterMeta:[{name:"user",type:"address"},{name:"apiKeyHash",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},d=BigInt(await e.taskRegistry.nonces(r)),h=await e.authorization.nonces(r),p={user:pT.getAddress(r),namespace:n,nonce:d,deadline:s},m={user:r,apiKeyHash:a,nonce:Number(h),deadline:s};if(!e.utils)throw new Error("Private key is required for signing operations");let y=await e.utils.signMeta(o,f,p),b=await e.utils.signMeta(u,c,m),v={user:r,namespace:n,apiKeyHash:a,namespaceSignature:y,apiKeySignature:b,namespaceDeadline:s,apiKeyDeadline:s};try{let E=await Jvr(v);if(E.status!==201)throw new Error("Registration failed with unexpected status");if(!E.data.namespaceRegistration.success)throw new Error("Namespace registration failed");if(!E.data.apiKeyRegistration.success)throw new Error("API key registration failed");return{namespace:n,apiKey:i,hashedApiKey:a}}catch(E){let x=E.message;throw new Error(`Combined registration failed: ${x}`)}}async function d0a(t){let e=await S0();try{return(await e.get(`userexistence/${t}`)).data===!0}catch(r){if(Ck.isAxiosError(r)&&r.response?.status===404&&typeof r.response?.data?.message=="string"&&r.response.data.message.includes("User not found"))return!1;throw r}}async function $pe(t,e){try{let r={message:"I am a Truebit User"};if(!e)throw Error("Secret.json does not exists");let n=e.privateKey,i=e.address,a=Zf.createSignedBody(r,n,i);return(await(await S0()).get(`user/${t}`,{headers:{"truebit-auth":JSON.stringify(a)}})).data}catch(r){if(Ck.isAxiosError(r)&&r.response?.status===401&&r.response?.data.message.includes("Entitlement Validation Error")||Ck.isAxiosError(r)&&r.response?.status==404&&r.response?.data.message&&r.response?.data.message.includes("User not found"))return null;throw Ck.isAxiosError(r)?r.response?Error(`The server responding with an error -> ${r.response.data.message||r.response.status+" - "+r.response.statusText}`):r.request?Error(`The server is not responding -> ${r.message}`):Error(`There was an error in the communication with the server -> ${r.message}`):Error(typeof r=="string"?`There was an error in the communication with the server -> ${r}`:"There was an error in the communication with the server.")}}async function x_r(t){try{return await(await S0()).post("user/register",t)}catch(e){throw Ck.isAxiosError(e)?e.response?Error(`The server responding with an error -> ${e.response.data.message||e.response.status+" - "+e.response.statusText}`):e.request?Error(`The server is not responding -> ${e.message}`):Error(`There was an error in the communication with the server -> ${e.message}`):Error(typeof e=="string"?`There was an error in the communication with the server -> ${e}`:"There was an error in the communication with the server.")}}async function p0a(){let t=Ru(),e=gi(t,Vt.AVAX),r="";try{await __r(async()=>{r=c0a();let n=pT.keccak256(pT.toUtf8Bytes(r));return await e.authorization.getPayerAddress(n)===E_r},{delay:500,maxTry:5,until:n=>n===!0})}catch(n){throw v_r(n)?Error("Attempts to generate unique Api Key for the user exhausted."):n}return r}async function h0a(){let t=Ru(),e=gi(t,Vt.AVAX),r="";try{await __r(async()=>(r=l0a(4).toString("hex"),await e.taskRegistry.getNamespaceOwner(r)===E_r),{delay:500,maxTry:5,until:n=>n===!0})}catch(n){throw v_r(n)?Error("Attempts to generate unique namespace for the user exhausted."):n}return r}function T_r(t){t.fullNameAnswer="",t.emailAddressAnswer="",t.companyNameAnswer="",t.jobPositionAnswer="",t.eulaAnswer="",t.confirmRegistration=""}f6();ig();import y0a from"ora";import*as Bpe from"os";async function O_r(t,e,r){let n=w0(),i=n!==null,a=0,s,o=m0a({input:process.stdin,output:process.stdout,terminal:!0});switch(i&&(w_r(n.address)?a=1:(s=await $pe(n.address,n),s?a=2:a=3)),a){case 1:console.log("The wallet set in the configuration must be a valid ethereum address. (ENS not supported yet)");break;case 2:console.log(Ri.SETUP_STEP1_SCENARIO1_P2(s));break;case 3:{console.log(Ri.SETUP_STEP2_SCENARIO3_P1),console.log();let u={user_ip:t,date_time:us(),os_version:Bpe.type+"_"+Bpe.release,node_version:process.version,cli_version:e};await r.sendEventToMixpanel("user_registration_begin",u);let f={confirmRegistration:"",fullNameAnswer:"",emailAddressAnswer:"",companyNameAnswer:"",jobPositionAnswer:"",eulaAnswer:""};try{for(;f.confirmRegistration!="Y";){for(f.fullNameAnswer=(await o.question(x2.bold(" 1. Full Name: "))).trim();f.fullNameAnswer==="";)console.log("Your full name is required. Please provide your first and last name to proceed."),f.fullNameAnswer=(await o.question(x2.bold(" 1. Full Name: "))).trim();for(f.emailAddressAnswer=(await o.question(x2.bold(" 2. Email Address: "))).trim();!await S_r(f.emailAddressAnswer);)f.emailAddressAnswer=(await o.question(x2.bold(" 2. Email Address: "))).trim();for(f.companyNameAnswer=(await o.question(x2.bold(" 3. Company Name: "))).trim(),f.jobPositionAnswer=(await o.question(x2.bold(" 4. Job Position: "))).trim();!a8(f.eulaAnswer);)f.eulaAnswer=(await o.question(x2.bold(` 5. Accept EULA? [Y|N] (${Ri.EULA_TERMS_LINK}): `))).toUpperCase();if(f.eulaAnswer=="N"){console.log(Ri.EULA_REGISTRATION_NO_ACCEPTED);break}for(;!a8(f.confirmRegistration);)console.log(`
|
|
516
|
+
`)}catch(t){throw t instanceof Error?console.error(Fi.red("Error fetching quota status: ")+t.message):console.error(Fi.red("Error fetching quota status: ")+String(t)),t}}HKe();El();async function c_r(t){try{console.log("Fetching execution status...");let r=await(await Lh()).get(`api/execution/${t}`).catch(Ac);if(r.data.message)throw r.data.message;console.log("Task execution status: ",r.data.status),r.data.output&&console.log("Task execution output: ",r.data.output)}catch(e){console.error(`Couldn't fetch execution status for executionId ${t}: ${e}`)}}var d_r=cr(bV(),1),Ok=class{tokens=[];authInputs;parse(e,r){let n=this.parseKeyValuePairs(r);if(e.length==0){this.authInputs=n;return}let i=Object.keys(n);if(e.every(a=>i.includes(a))){let a={};for(let s of e)a[s]=n[s];this.authInputs=a}else throw new Error(`Invalid authString: ${e} are required`)}parseKeyValuePairs(e){try{let r=e.split(","),n={};for(let i of r){let[a,s]=i.split(":");n[a.trim()]=s.trim()}return n}catch{throw new Error("Invalid auth string")}}},Rpe=class extends Ok{tokens=["accessKey","secretKey"];constructor(e){super(),this.parse(this.tokens,e)}authHeaders(e){return d_r.default.sign(e,{accessKeyId:this.authInputs.accessKey,secretAccessKey:this.authInputs.secretKey}).headers||{}}},qpe=class extends Ok{tokens=["username","password"];constructor(e){super(),this.parse(this.tokens,e)}authHeaders(e){return{Authorization:`Basic ${btoa(`${this.authInputs.username}:${this.authInputs.password}`)}`}}},Npe=class extends Ok{tokens=[];constructor(e){super(),this.parse([],e)}authHeaders(e){return{...this.authInputs}}};var F1;(function(t){t.AWS_SIGNATURE="aws-signature",t.BASIC_AUTH="basic-auth",t.CUSTOM_HEADER="custom-header"})(F1||(F1={}));var zKe=(t,e)=>{switch(t){case F1.AWS_SIGNATURE:return new Rpe(e);case F1.BASIC_AUTH:return new qpe(e);case F1.CUSTOM_HEADER:return new Npe(e);default:throw new Error(`Invalid authentication method specified. Should be one of <${Object.values(F1)}>`)}};import m_r from"chalk";import{ethers as u0a}from"ethers";El();import*as Dpe from"crypto";import a0a from"axios";import WKe from"chalk";function p_r(t){if(a0a.isAxiosError(t)&&t.response?.data){let e=t.response.data;return console.log(WKe.red(e.message)),typeof e=="string"?e:e.message||JSON.stringify(e)}return t instanceof Error?t.message:String(t)}async function s0a(t,e){try{let r=xc({namespace:e});return(await t.post("getkey",r)).data}catch(r){return p_r(r),console.error(WKe.red("Failed to retrieve encryption key from Hub-TEE-KMS. Please try again")),null}}function o0a(t,e){try{let r=Buffer.from(e,"base64"),n=Dpe.randomBytes(16),i=Dpe.createCipheriv("aes-256-cbc",r,n),a=Buffer.concat([i.update(t,"utf8"),i.final()]);return r.fill(0),{encrypted_authString:a.toString("base64"),iv:n.toString("base64")}}catch{return null}}async function h_r(t,e,r){try{let n=await s0a(t,r);if(!n)return null;let i=o0a(e,n.plaintext_key);return i?{encrypted_authString:i.encrypted_authString,encrypted_data_key:n.encryption_key,iv:i.iv}:null}catch(n){return p_r(n),console.error(WKe.red("Failed to encrypt credentials. Please try again.")),null}}async function y_r(t,e,r,n,i,a,s){console.log("Deploying the API Authentication Credentials");try{if(!Gvr(a))throw"Invalid private key provided";if(!u0a.isAddress(s))throw"Invalid address provided";if(zKe(n,i),!dT(t))throw"Invalid taskId";let o=await zCt();console.log("Encrypting credentials...");let u=await h_r(o,i,e);if(!u)return;let f=xc({taskId:t,namespace:e,taskName:r,method:n,encrypted_authString:u.encrypted_authString,encrypted_data_key:u.encrypted_data_key,iv:u.iv});await o.post("credentials",f).catch(Ac),console.log("The encrypted credentials were deployed "+m_r.green("Successfully"))}catch(o){let u=o instanceof Error?o.message:String(o);console.error(m_r.red(u));return}}import{inspect as Zfa}from"util";import Ju from"ora";import{v4 as Xfa}from"uuid";import{ethers as Ype}from"ethers";var b_r={name:"@truebit/cli",version:"1.120.0-beta.264",private:!1,description:"truebit-cli is a basic command line that allows interaction between users and truebit nextgen node.",author:{name:"Truebit Co.",url:"https://truebit.io/"},license:"https://truebit.io/terms/",repository:{type:"git",url:"https://github.com/TruebitProtocol"},homepage:"https://truebit.io/",main:"build/index.mjs",module:"build/index.mjs",types:"build/types/index.d.ts",type:"module",scripts:{prebuild:"rimraf build logs","prebuild:dev":"rimraf build logs","build:dev":"tsc && chmod +x build/index.mjs",build:"NODE_ENV=production node esbuild.config.mjs && chmod +x build/index.mjs",dev:"export NODE_ENV=development && npx nodemon",test:"vitest run --passWithNoTests tests/"},dependencies:{axios:"1.13.3",chalk:"5.6.2",colors:"1.4.0",commander:"14.0.2",ethers:"6.16.0",figlet:"1.10.0","form-data":"4.0.5","openapi-enforcer":"1.23.0",ora:"9.1.0","public-ip":"8.0.0","ts-retry":"6.0.0",uuid:"13.0.0"},bin:{truebit:"build/index.mjs"},files:["build"],devDependencies:{"@types/figlet":"1.7.0","@vitest/coverage-v8":"4.0.18",esbuild:"0.27.2",typescript:"5.9.3",vitest:"4.0.18"},engines:{node:">=22.13.0"}};A0();El();f6();A0();import{createInterface as m0a}from"node:readline/promises";import x2 from"chalk";El();import Ck from"axios";import{ethers as pT}from"ethers";import{randomBytes as l0a}from"crypto";import{v4 as c0a}from"uuid";A0();import{ethers as kpe}from"ethers";async function g_r(t){i8(t);let e=gi(Ru(),Vt.AVAX),r=kpe.keccak256(kpe.toUtf8Bytes(t));return await e.authorization.registerAuthorization(r),r}async function GKe(t,e,r=Dn("address")){i8(t);let n=gi(Ru(),Vt.AVAX),i=await n.authorization.getEIP712Domain(),a=await n.authorization.nonces(r),s=Math.floor(Date.now()/1e3)+3600,o={RegisterMeta:[{name:"user",type:"address"},{name:"apiKeyHash",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},u=kpe.keccak256(kpe.toUtf8Bytes(t)),f={user:r,apiKeyHash:u,nonce:Number(a),deadline:s};if(!n.utils)throw new Error("Private key is required for signing operations");let c=await n.utils.signMeta(i,o,f);return(await Yvr(r,u,s,c,e)).status==201?u:null}A0();f6();import{isTooManyTries as v_r,retryAsync as __r}from"ts-retry";var E_r="0x0000000000000000000000000000000000000000";async function S_r(t){let e=!0;return t===""?(e=!1,console.log("An email address is required. Please provide your email address to proceed.")):new RegExp(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)?await d0a(t)&&(e=!1,console.log("The provided email address is already in use. Please enter a different email address.")):(e=!1,console.log("The email address provided is not valid. Please try again.")),e}function a8(t){return t==="Y"||t==="N"}function w_r(t){return!pT.isAddress(t)||t.length!==42||!t.startsWith("0x")}async function A_r(){let t=Ru(),e=gi(t,Vt.AVAX),r=Dn("address"),n=await h0a(),i=await p0a();i8(i);let a=pT.keccak256(pT.toUtf8Bytes(i)),s=Math.floor(Date.now()/1e3)+3600,o=await e.taskRegistry.getEIP712Domain(),u=await e.authorization.getEIP712Domain(),f={RegisterTaskNamespaceMeta:[{name:"user",type:"address"},{name:"namespace",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},c={RegisterMeta:[{name:"user",type:"address"},{name:"apiKeyHash",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},d=BigInt(await e.taskRegistry.nonces(r)),h=await e.authorization.nonces(r),p={user:pT.getAddress(r),namespace:n,nonce:d,deadline:s},m={user:r,apiKeyHash:a,nonce:Number(h),deadline:s};if(!e.utils)throw new Error("Private key is required for signing operations");let y=await e.utils.signMeta(o,f,p),b=await e.utils.signMeta(u,c,m),v={user:r,namespace:n,apiKeyHash:a,namespaceSignature:y,apiKeySignature:b,namespaceDeadline:s,apiKeyDeadline:s};try{let E=await Jvr(v);if(E.status!==201)throw new Error("Registration failed with unexpected status");if(!E.data.namespaceRegistration.success)throw new Error("Namespace registration failed");if(!E.data.apiKeyRegistration.success)throw new Error("API key registration failed");return{namespace:n,apiKey:i,hashedApiKey:a}}catch(E){let x=E.message;throw new Error(`Combined registration failed: ${x}`)}}async function d0a(t){let e=await S0();try{return(await e.get(`userexistence/${t}`)).data===!0}catch(r){if(Ck.isAxiosError(r)&&r.response?.status===404&&typeof r.response?.data?.message=="string"&&r.response.data.message.includes("User not found"))return!1;throw r}}async function $pe(t,e){try{let r={message:"I am a Truebit User"};if(!e)throw Error("Secret.json does not exists");let n=e.privateKey,i=e.address,a=Zf.createSignedBody(r,n,i);return(await(await S0()).get(`user/${t}`,{headers:{"truebit-auth":JSON.stringify(a)}})).data}catch(r){if(Ck.isAxiosError(r)&&r.response?.status===401&&r.response?.data.message.includes("Entitlement Validation Error")||Ck.isAxiosError(r)&&r.response?.status==404&&r.response?.data.message&&r.response?.data.message.includes("User not found"))return null;throw Ck.isAxiosError(r)?r.response?Error(`The server responding with an error -> ${r.response.data.message||r.response.status+" - "+r.response.statusText}`):r.request?Error(`The server is not responding -> ${r.message}`):Error(`There was an error in the communication with the server -> ${r.message}`):Error(typeof r=="string"?`There was an error in the communication with the server -> ${r}`:"There was an error in the communication with the server.")}}async function x_r(t){try{return await(await S0()).post("user/register",t)}catch(e){throw Ck.isAxiosError(e)?e.response?Error(`The server responding with an error -> ${e.response.data.message||e.response.status+" - "+e.response.statusText}`):e.request?Error(`The server is not responding -> ${e.message}`):Error(`There was an error in the communication with the server -> ${e.message}`):Error(typeof e=="string"?`There was an error in the communication with the server -> ${e}`:"There was an error in the communication with the server.")}}async function p0a(){let t=Ru(),e=gi(t,Vt.AVAX),r="";try{await __r(async()=>{r=c0a();let n=pT.keccak256(pT.toUtf8Bytes(r));return await e.authorization.getPayerAddress(n)===E_r},{delay:500,maxTry:5,until:n=>n===!0})}catch(n){throw v_r(n)?Error("Attempts to generate unique Api Key for the user exhausted."):n}return r}async function h0a(){let t=Ru(),e=gi(t,Vt.AVAX),r="";try{await __r(async()=>(r=l0a(4).toString("hex"),await e.taskRegistry.getNamespaceOwner(r)===E_r),{delay:500,maxTry:5,until:n=>n===!0})}catch(n){throw v_r(n)?Error("Attempts to generate unique namespace for the user exhausted."):n}return r}function T_r(t){t.fullNameAnswer="",t.emailAddressAnswer="",t.companyNameAnswer="",t.jobPositionAnswer="",t.eulaAnswer="",t.confirmRegistration=""}f6();ig();import y0a from"ora";import*as Bpe from"os";async function O_r(t,e,r){let n=w0(),i=n!==null,a=0,s,o=m0a({input:process.stdin,output:process.stdout,terminal:!0});switch(i&&(w_r(n.address)?a=1:(s=await $pe(n.address,n),s?a=2:a=3)),a){case 1:console.log("The wallet set in the configuration must be a valid ethereum address. (ENS not supported yet)");break;case 2:console.log(Ri.SETUP_STEP1_SCENARIO1_P2(s));break;case 3:{console.log(Ri.SETUP_STEP2_SCENARIO3_P1),console.log();let u={user_ip:t,date_time:us(),os_version:Bpe.type+"_"+Bpe.release,node_version:process.version,cli_version:e};await r.sendEventToMixpanel("user_registration_begin",u);let f={confirmRegistration:"",fullNameAnswer:"",emailAddressAnswer:"",companyNameAnswer:"",jobPositionAnswer:"",eulaAnswer:""};try{for(;f.confirmRegistration!="Y";){for(f.fullNameAnswer=(await o.question(x2.bold(" 1. Full Name: "))).trim();f.fullNameAnswer==="";)console.log("Your full name is required. Please provide your first and last name to proceed."),f.fullNameAnswer=(await o.question(x2.bold(" 1. Full Name: "))).trim();for(f.emailAddressAnswer=(await o.question(x2.bold(" 2. Email Address: "))).trim();!await S_r(f.emailAddressAnswer);)f.emailAddressAnswer=(await o.question(x2.bold(" 2. Email Address: "))).trim();for(f.companyNameAnswer=(await o.question(x2.bold(" 3. Company Name: "))).trim(),f.jobPositionAnswer=(await o.question(x2.bold(" 4. Job Position: "))).trim();!a8(f.eulaAnswer);)f.eulaAnswer=(await o.question(x2.bold(` 5. Accept EULA? [Y|N] (${Ri.EULA_TERMS_LINK}): `))).toUpperCase();if(f.eulaAnswer=="N"){console.log(Ri.EULA_REGISTRATION_NO_ACCEPTED);break}for(;!a8(f.confirmRegistration);)console.log(`
|
|
517
517
|
Is the information provided above correct?`),f.confirmRegistration=(await o.question(x2.bold("Press [Y] to confirm or [N] to edit: "))).toUpperCase();f.confirmRegistration=="N"&&(console.log(`
|
|
518
518
|
Please provide the following information:`),T_r(f))}}catch(h){if(h.name==="AbortError"||h.message.includes("Ctrl+C")){let p=h.message,m=u;m.error_details=p,m.date_time=us();let y={fullname:f.fullNameAnswer,email:f.emailAddressAnswer,company:f.companyNameAnswer,role:f.jobPositionAnswer};m.user_info=JSON.stringify(y),await r.sendEventToMixpanel("user_registration_failed",m),process.exit(0)}}if(f.eulaAnswer=="N")break;let c=u;console.log(),console.log("By completing registration, you'll be automatically subscribed to our newsletter."),console.log("To opt-out, please follow the steps described in our documentation portal."),console.log();let d=y0a({text:x2.bold("... registering your account."),stream:process.stdout}).start();try{let{namespace:h,apiKey:p}=await A_r(),m={name:f.fullNameAnswer,email:f.emailAddressAnswer,walletAddress:n?.address,company:f.companyNameAnswer,jobDescription:f.jobPositionAnswer,EULA:Zf.createSignedBody({ip:await GG(),date:new Date().toISOString()},n.privateKey),defaultNamespace:h,defaultApiKey:p};await x_r(m),d.stop(),console.log(Ri.SETUP_STEP2_SCENARIO3_P2(f,n.address,h,p)),c.distinct_id=m.walletAddress,c.date_time=us(),c.fullname=m.name,c.email=m.email,c.company=m.company,c.role=m.jobDescription,c.namespace=m.defaultNamespace,c.api_key=p,c.wallet_address=m.walletAddress,await r.sendEventToMixpanel("user_registration_success",c),await r.registerUserMixpanel(c.wallet_address,b0a(c))}catch(h){d.stop();let p=h.message,m=u;m.error_details=p,m.date_time=us();let y={fullname:f.fullNameAnswer,email:f.emailAddressAnswer,company:f.companyNameAnswer,role:f.jobPositionAnswer};m.user_info=JSON.stringify(y),await r.sendEventToMixpanel("user_registration_failed",m);let b=p?p.match(/CreateUserValidation - (.*?.*)/)?.[1]:null;if(b)throw Error(b);if(p.includes("Sender doesn't have enough funds to send tx"))throw Error("We are currently experiencing technical difficulties. Please try again later.");console.error(Ri.SETUP_STEP2_UNHANDLED_ERROR),process.exit(1)}finally{d.clear()}break}default:throw Error("An unexpected error occurred.")}o.close()}function b0a(t){return{apiKey:t.api_key,name:t.fullname,email:t.email,ip:t.user_ip,company:t.company,role:t.role,namespace:t.namespace,walletAddress:t.wallet_address}}import{setDefaultAutoSelectFamily as Qfa}from"node:net";import g0a from"chalk";A0();ig();import{createInterface as v0a}from"node:readline/promises";import*as Fpe from"os";async function C_r(t,e,r){let n=w0(),i=n!==null,a=0;switch(i?i&&!n.eula?a=2:a=3:a=1,a){case 1:case 2:{let s=v0a({input:process.stdin,output:process.stdout,terminal:!0}),o="",u={user_ip:t,date_time:us(),os_version:Fpe.type+"_"+Fpe.release,node_version:process.version,cli_version:e};for(console.log(Ri.EULA_INSTALLATION);!a8(o);)o=(await s.question(g0a.bold(`
|
|
519
519
|
Have you read, and do you accept the Terms of Use? [Y|N]: `))).toUpperCase(),await r.sendEventToMixpanel("TOS_shown",u);if(o=="N")throw u.date_time=us(),await r.sendEventToMixpanel("TOS_rejected",u),Ri.EULA_INSTALLATION_NO_ACCEPTED;u.date_time=us(),await r.sendEventToMixpanel("TOS_accepted",u);let f=Math.round(new Date().getTime()).toString();if(a===1){let c={...MTe(),eula:f};YCt(c)}else a===2&&cq({eula:f});s.close()}break;default:break}}A0();ig();async function Hc(t=!1){let e=w0(),r=e!==null,n=null,i=0;switch(r?r&&(!e.privateKey||!e.address)?i=2:(n=await $pe(e.address,e),n?i=4:i=3):i=1,i){case 1:case 2:case 3:console.log(Ri.USER_NO_REGISTERED),process.exit(1);break;case 4:t&&console.log(`You are logged in as: ${n?.name} - ${n?.email}`);break}}import{createInterface as _0a}from"node:readline/promises";ig();A0();import E0a from"chalk";async function I_r(){console.log(E0a.bold(`
|