2 lines
577 KiB
JavaScript
2 lines
577 KiB
JavaScript
/*! For license information please see browser.umd.js.LICENSE.txt */
|
||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mongoose=e():t.mongoose=e()}("undefined"!=typeof self?self:this,()=>(()=>{var t={118:t=>{"use strict";t.exports=function(t){return t!=t}},170:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(3609),i=r(8995),s=r(7768),a=r(7236),u=new Set(["$and","$or"]),c=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),l=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),f=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),p=new Set(["$arrayElemAt","$first","$last"]),h=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),y=new Set(["$not"]);function d(t,e,r){if(g(t)||null===t)return t;null!=t.$cond?Array.isArray(t.$cond)?t.$cond=t.$cond.map(function(t){return d(t,e,r)}):(t.$cond.if=d(t.$cond.if,e,r),t.$cond.then=d(t.$cond.then,e,r),t.$cond.else=d(t.$cond.else,e,r)):null!=t.$ifNull?t.$ifNull.map(function(t){return d(t,e,r)}):null!=t.$switch&&(Array.isArray(t.$switch.branches)&&(t.$switch.branches=t.$switch.branches.map(function(t){return d(t,e,r)})),"default"in t.$switch&&(t.$switch.default=d(t.$switch.default,e,r)));for(var n=0,s=Object.keys(t);n<s.length;n++){var p=s[n];u.has(p)?t[p]=t[p].map(function(t){return d(t,e,r)}):c.has(p)?t[p]=v(t[p],e,r):l.has(p)?t[p]=m(t[p]):f.has(p)?t[p]=b(t[p]):y.has(p)&&(t[p]=d(t[p],e,r))}if(t.$in&&(t.$in=function(t,e,r){var n=t[1];if(!g(n))return t;var o=t[0],s=e.path(n.slice(1));if(null!==s){if(!s.$isMongooseArray)throw new Error("Path must be an array for $in");return[s.$isMongooseDocumentArray?s.$embeddedSchemaType.cast(o):s.caster.cast(o),n]}if(!1===r)return t;if("throw"===r)throw new i("$in")}(t.$in,e,r)),t.$size&&(t.$size=b(t.$size)),t.$round){var h=t.$round;if(!Array.isArray(h)||h.length<1||h.length>2)throw new o("Array",h,"$round");t.$round=h.map(function(t){return b(t)})}return a(t),t}function b(t){if(!_(t))return t;try{return s(t)}catch(e){throw new o("Number",t)}}function m(t){if(!Array.isArray(t)){if(!_(t))return t;try{return s(t)}catch(e){throw new o("Number",t)}}return t.map(function(t){if(!_(t))return t;try{return s(t)}catch(e){throw new o("Number",t)}})}function v(t,e,r){if(!Array.isArray(t)||2!==t.length)throw new Error("Comparison operator must be an array of length 2");t[0]=d(t[0],e,r);var a=t[0];if(_(t[1])){var u=null,c=null,l=null;if(g(a))u=a.slice(1),c=e.path(u);else if("object"===n(a)&&null!=a)for(var f=0,y=Object.keys(a);f<y.length;f++){var b=y[f];h.has(b)&&g(a[b])?(u=a[b].slice(1)+"."+b,l=s):p.has(b)&&g(a[b])&&(u=a[b].slice(1)+"."+b,null!=(c=e.path(a[b].slice(1)))&&(c.$isMongooseDocumentArray?c=c.$embeddedSchemaType:c.$isMongooseArray&&(c=c.caster)))}var m="object"===n(t[1])&&null!=t[1]&&null!=t[1].$literal;if(null!=c)t[1]=m?{$literal:c.cast(t[1].$literal)}:c.cast(t[1]);else if(null!=l)if(m)try{t[1]={$literal:l(t[1].$literal)}}catch(e){throw new o(l.name.replace(/^cast/,""),t[1],u+".$literal")}else try{t[1]=l(t[1])}catch(e){throw new o(l.name.replace(/^cast/,""),t[1],u)}else{if(null!=u&&!0===r)return;if(null!=u&&"throw"===r)throw new i(u)}}else t[1]=d(t[1]);return t}function g(t){return"string"==typeof t&&"$"===t[0]}function _(t){return!("string"==typeof t&&"$"===t[0]||"object"===n(t)&&null!==t&&Object.keys(t).find(function(t){return"$"===t[0]})&&null==t.$literal)}t.exports=function(t,e,r){if("boolean"==typeof t)return t;if("object"!==n(t)||null===t)throw new Error("`$expr` must be an object or boolean literal");return d(t,e,r)}},209:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(2403),i=r(5825),s=r(6583);t.exports=o?function(t){return o(t)}:i?function(t){if(!t||"object"!==n(t)&&"function"!=typeof t)throw new TypeError("getProto: not an object");return i(t)}:s?function(t){return s(t)}:null},241:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"of",u),t.exports=a},354:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r=1e3,n=60*r,o=60*n,i=24*o,s=7*i;function a(t,e,r,n){var o=e>=1.5*r;return Math.round(t/r)+" "+n+(o?"s":"")}t.exports=function(t,u){u=u||{};var c,l,f=e(t);if("string"===f&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(t);if("number"===f&&isFinite(t))return u.long?(c=t,(l=Math.abs(c))>=i?a(c,l,i,"day"):l>=o?a(c,l,o,"hour"):l>=n?a(c,l,n,"minute"):l>=r?a(c,l,r,"second"):c+" ms"):function(t){var e=Math.abs(t);return e>=i?Math.round(t/i)+"d":e>=o?Math.round(t/o)+"h":e>=n?Math.round(t/n)+"m":e>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},433:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(3609),u=r(6426),c=r(5413),l=r(4327),f=r(9460);function p(t,e){u.call(this,t,e,"Int32")}p.schemaName="Int32",p.defaultOptions={},p.prototype=Object.create(u.prototype),p.prototype.constructor=p,p._cast=c,p.set=u.set,p.setters=[],p.get=u.get,p._defaultCaster=function(t){if(null!=t&&("number"!=typeof t||t!==(0|t)||t<-2147483648||t>2147483647))throw new Error;return t},p.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},p._checkRequired=function(t){return null!=t},p.checkRequired=u.checkRequired,p.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},p.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():p.cast();try{return e(t)}catch(e){throw new a("Int32",t,this.path,e,this)}};var h=i(i({},u.prototype.$conditionalHandlers),{},{$gt:y,$gte:y,$lt:y,$lte:y,$bitsAllClear:f,$bitsAnyClear:f,$bitsAllSet:f,$bitsAnySet:f});function y(t,e){return this.castForQuery(null,t,e)}Object.defineProperty(p.prototype,"$conditionalHandlers",{enumerable:!1,value:h}),p.prototype.castForQuery=function(t,e,r){var n;if(null!=t)return(n=this.$conditionalHandlers[t])?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(t){throw t instanceof a&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},p.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return l("number","int",null==t?void 0:t.useBsonType,e)},p.prototype.autoEncryptionType=function(){return"int"},t.exports=p},486:t=>{"use strict";t.exports=function(t){var e={_id:{auto:!0}};e._id[t.options.typeKey]="ObjectId",t.add(e)}},533:(t,e,r)=>{"use strict";var n=r(8213),o=r(7352);t.exports=function(t,e){if("string"!=typeof t&&"function"!=typeof t)throw new n('Invalid ref at path "'+e+'". Got '+o.inspect(t,{depth:0}))}},542:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){return!!t&&("object"===e(t)||"function"==typeof t)&&"function"==typeof t.then}},608:(t,e,r)=>{"use strict";var n=r(5832).hp;t.exports=function(t){return n.isBuffer(t)||"[object Object]"===Object.prototype.toString.call(t)}},622:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(4009),s=r(8768),a=r(7930).modelSymbol;function u(t,e){this.path=e,this.getters=[],this.setters=[],this.options=Object.assign({},t)}u.prototype._applyDefaultGetters=function(){if(!(this.getters.length>0||this.setters.length>0)){var t="$"+this.path;this.getters.push(function(){return this.$locals[t]}),this.setters.push(function(e){this.$locals[t]=e})}},u.prototype.clone=function(){var t=new u(this.options,this.path);return t.getters=[].concat(this.getters),t.setters=[].concat(this.setters),t},u.prototype.get=function(t){return this.getters.push(t),this},u.prototype.set=function(t){return this.setters.push(t),this},u.prototype.applyGetters=function(t,e){s.hasUserDefinedProperty(this.options,["ref","refPath"])&&e.$$populatedVirtuals&&e.$$populatedVirtuals.hasOwnProperty(this.path)&&(t=e.$$populatedVirtuals[this.path]);var r,o=t,i=n(this.getters);try{for(i.s();!(r=i.n()).done;)o=r.value.call(e,o,this,e)}catch(t){i.e(t)}finally{i.f()}return o},u.prototype.applySetters=function(t,e){var r,o=t,i=n(this.setters);try{for(i.s();!(r=i.n()).done;)o=r.value.call(e,o,this,e)}catch(t){i.e(t)}finally{i.f()}return o},u.prototype._getModelNamesForPopulate=function(t){if(this.options.refPath)return i(this.options.refPath,t,this.path);var e;return null==(e="function"!=typeof this.options.ref||this.options.ref[a]?this.options.ref:this.options.ref.call(t,t))||Array.isArray(e)?e:[e]},t.exports=u},668:(t,e,r)=>{"use strict";var n=Array.prototype.slice,o=r(6312),i=Object.keys,s=i?function(t){return i(t)}:r(6544),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},674:(t,e,r)=>{"use strict";var n=r(3414);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},766:(t,e)=>{"use strict";var r=t.exports={};r.DocumentNotFoundError=null,r.general={},r.general.default="Validator failed for path `{PATH}` with value `{VALUE}`",r.general.required="Path `{PATH}` is required.",r.Number={},r.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).",r.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).",r.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",r.Date={},r.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).",r.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).",r.String={},r.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",r.String.match="Path `{PATH}` is invalid ({VALUE}).",r.String.minlength="Path `{PATH}` (`{VALUE}`, length {LENGTH}) is shorter than the minimum allowed length ({MINLENGTH}).",r.String.maxlength="Path `{PATH}` (`{VALUE}`, length {LENGTH}) is longer than the maximum allowed length ({MAXLENGTH})."},783:t=>{"use strict";t.exports=ReferenceError},791:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(3703);t.exports=function(t,e,r){var o,s=null!=r?Object.keys(i(t.tree,r,{})):Object.keys(t.tree),a=new Set(Object.keys(e));if(a.size>1){o=new Set;var u,c=n(s);try{for(c.s();!(u=c.n()).done;){var l=u.value;a.has(l)&&o.add(l)}}catch(t){c.e(t)}finally{c.f()}var f,p=n(a);try{for(p.s();!(f=p.n()).done;){var h=f.value;o.has(h)||o.add(h)}}catch(t){p.e(t)}finally{p.f()}o=Array.from(o)}else o=Array.from(a);return o}},863:(t,e,r)=>{"use strict";var n=r(3305),o=r(5549);t.exports=function(t){if(null==t)return t;if(n(t,"ObjectId"))return t;if(t._id){if(n(t._id,"ObjectId"))return t._id;if(t._id.toString instanceof Function)return new o(t._id.toString())}return t.toString instanceof Function?new o(t.toString()):new o(t)}},953:(t,e,r)=>{"use strict";var n=r(5484);t.exports=function(){return n()&&!!Symbol.toStringTag}},988:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},1007:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"min",u),Object.defineProperty(a.prototype,"max",u),Object.defineProperty(a.prototype,"enum",u),Object.defineProperty(a.prototype,"populate",u),t.exports=a},1058:(t,e,r)=>{"use strict";var n=r(2696);t.exports=function(t,e){if(null==t)return null;for(var r=0,o=Object.keys(t);r<o.length;r++){var i=t[o[r]];if(i.schema&&i.schema.discriminatorMapping&&n(i.schema.discriminatorMapping.value,e))return i}return null}},1091:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){return null!=t&&"object"===e(t)&&null==t.$slice&&null==t.$elemMatch&&null==t.$meta&&null==t.$}},1129:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=r(8213),u=r(7352),c=function(t){function e(t,r,s,c){var l;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var f=a.messages;return(l=function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,[null!=f.DocumentNotFoundError?"function"==typeof f.DocumentNotFoundError?f.DocumentNotFoundError(t,r):f.DocumentNotFoundError:'No document found for query "'+u.inspect(t)+'" on model "'+r+'"'])).result=c,l.numAffected=s,l.filter=t,l.query=t,l}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(a);Object.defineProperty(c.prototype,"name",{value:"DocumentNotFoundError"}),t.exports=c},1199:t=>{"use strict";t.exports=function(t,e){var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o];if(i!==n[o]||t[i]!==e[i])return!1}return!0}},1226:t=>{"use strict";t.exports=function(t){return null==t?null:Object.keys(t)[0]}},1243:(t,e)=>{"use strict";e.isMongooseArray=function(t){return Array.isArray(t)&&t.isMongooseArray}},1244:(t,e,r)=>{"use strict";var n=r(3609);t.exports=function(t,e){if(null==t)return t;if(t._id&&"string"==typeof t._id)return t._id;if(t.toString&&t.toString!==Object.prototype.toString&&!Array.isArray(t))return t.toString();throw new n("string",t,e)}},1260:(t,e)=>{"use strict";var r=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]).concat(["validate"]);e.Ut=r},1313:(t,e,r)=>{"use strict";var n=r(486);t.exports=function(t,e){return null==e||null==e._id||(t=t.clone(),e._id?t.paths._id||(n(t),t.options._id=!0):(t.remove("_id"),t.options._id=!1)),t}},1344:(t,e,r)=>{"use strict";t.exports=r(6353).UUID},1347:(t,e)=>{"use strict";e.isMongooseDocumentArray=function(t){return Array.isArray(t)&&t.isMongooseDocumentArray}},1350:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t,r,s){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,['Parameter "'+r+'" to '+s+'() must be an object, got "'+t.toString()+'" (type '+n(t)+")"])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"ObjectParameterError"}),t.exports=a},1417:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,["For your own good, using `document.save()` to update an array which was selected using an $elemMatch projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n "+t.join("\n ")+"\nUse Model.updateOne() to update these arrays instead."])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"DivergentArrayError"}),t.exports=a},1464:(t,e,r)=>{"use strict";var n=r(5807);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},1469:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof c?n:c,l=Object.create(s.prototype);return a(l,"_invoke",function(r,n,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(r,n){for(s=r,a=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,s=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,y),s=l,a=y;(e=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),l}var u={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(a(e={},n,function(){return this}),e),h=f.prototype=c.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,a(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,o,"GeneratorFunction"),a(h),a(h,o,"Generator"),a(h,n,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:i,m:y}})()}function a(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}a=function(t,e,r,n){function i(e,r){a(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},a(t,e,r,n)}function u(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=l(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function l(t,e){if(t){if("string"==typeof t)return f(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var p=r(5022),h=r(8442),y=r(4450),d=r(2068).X,b=r(3703),m=r(8768),v=r(4301),g={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0,statics:!0};t.exports=function(t,e,r,n,a,l,f){if(!r||!r.instanceOfSchema)throw new Error("You must pass a valid discriminator Schema");if(l=null==l||l,t.schema.discriminatorMapping&&!t.schema.discriminatorMapping.isRoot)throw new Error('Discriminator "'+e+'" can only be a discriminator of the root model');if(a){var _=b(t.base,"options.applyPluginsToDiscriminators",!1)||!l;t.base._applyPlugins(r,{skipTopLevel:!_})}else l||h(r);var w=t.schema.options.discriminatorKey,O=t.schema.path(w);if(null!=O)m.hasUserDefinedProperty(O.options,"select")||(O.options.select=!0),O.options.$skipDiscriminatorCheck=!0;else{var S={};S[w]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},S[w][t.schema.options.typeKey]=String,t.schema.add(S),d({prop:w,prototype:t.prototype,options:t.schema.options})}if(r.path(w)&&!0!==r.path(w).options.$skipDiscriminatorCheck)throw new Error('Discriminator "'+e+'" cannot have field with name "'+w+'"');var $=e;if(("string"==typeof n&&n.length||null!=n)&&($=n),function(t,e){var r=s().m(l);if(null!=t.encryptionType()||null!=e.encryptionType()){var n,o=c(l(a(t),a(e)));try{for(o.s();!(n=o.n()).done;){var i=n.value;if(t._hasEncryptedField(i)&&e._hasEncryptedField(i))throw new Error("encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=".concat(i));if(t._hasEncryptedField(i)||e._hasEncryptedField(i))throw new Error("encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=".concat(i))}}catch(t){o.e(t)}finally{o.f()}}function a(t){return[].concat(u(Object.keys(t.paths)),u(Object.keys(t.singleNestedPaths)))}function l(t,e){var n,o,i,a,u;return s().w(function(r){for(;;)switch(r.p=r.n){case 0:n=new Set(t),o=c(e),r.p=1,o.s();case 2:if((i=o.n()).done){r.n=4;break}if(a=i.value,!n.has(a)){r.n=3;break}return r.n=3,a;case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,u=r.v,o.e(u);case 6:return r.p=6,o.f(),r.f(6);case 7:return r.a(2)}},r,null,[[1,5,6,7]])}}(t.schema,r),function(e,r){e._baseSchema=r,r.paths._id&&r.paths._id.options&&!r.paths._id.options.auto&&e.remove("_id");for(var n=[],s=0,u=Object.keys(r.paths);s<u.length;s++){var f=u[s];if(e.nested[f])n.push(f);else if(-1!==f.indexOf(".")){var h,d="",b=c(f.split(".").slice(0,-1));try{for(b.s();!(h=b.n()).done;){var _=h.value;d+=(d.length?".":"")+_,(e.paths[d]instanceof p||e.singleNestedPaths[d]instanceof p)&&n.push(f)}}catch(t){b.e(t)}finally{b.f()}}}e.obj=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},e.obj),v(e,r),e._gatherChildSchemas();for(var S=0,j=n;S<j.length;S++){var P=j[S];delete e.paths[P]}e.childSchemas.forEach(function(t){t.model.prototype.$__setSchema(t.schema)});var A={};A[w]={default:$,select:!0,set:function(t){if(t===$||Array.isArray($)&&m.deepEqual(t,$))return $;throw new Error("Can't set discriminator key \""+w+'"')},$skipDiscriminatorCheck:!0},A[w][e.options.typeKey]=O?O.options[e.options.typeKey]:String,e.add(A),e.discriminatorMapping={key:w,value:$,isRoot:!1},r.options.collection&&(e.options.collection=r.options.collection);var E=e.options.toJSON,x=e.options.toObject,T=e.options._id,k=e.options.id,N=Object.keys(e.options);e.options.discriminatorKey=r.options.discriminatorKey;for(var I=e._userProvidedOptions,B=0,D=N;B<D.length;B++){var M=D[B];if(!g[M]&&M in I&&!m.deepEqual(e.options[M],r.options[M]))throw new Error("Can't customize discriminator option "+M+" (can only modify "+Object.keys(g).join(", ")+")")}e.options=y(r.options);for(var R=0,U=Object.keys(I);R<U.length;R++){var C=U[R];e.options[C]=I[C]}E&&(e.options.toJSON=E),x&&(e.options.toObject=x),void 0!==T&&(e.options._id=T),e.options.id=k,l&&(e.s.hooks=t.schema.s.hooks.merge(e.s.hooks)),a&&(e.plugins=Array.prototype.slice.call(r.plugins)),e.callQueue=r.callQueue.concat(e.callQueue),delete e._requiredpaths}(r,t.schema),t.discriminators||(t.discriminators={}),t.schema.discriminatorMapping||(t.schema.discriminatorMapping={key:w,value:null,isRoot:!0}),t.schema.discriminators||(t.schema.discriminators={}),t.schema.discriminators[e]=r,t.discriminators[e]&&!r.options.overwriteModels&&!f)throw new Error('Discriminator with name "'+e+'" already exists');return r}},1505:t=>{"use strict";t.exports=function(t,e,r,n,o){var i=null!=e&&!1===e.updatedAt,s=null!=e&&!1===e.createdAt,a=null!=r?r():t.ownerDocument().constructor.base.now();if(!s&&(t.isNew||t.$isSubdocument)&&n&&!t.$__getValue(n)&&t.$__isSelected(n)&&t.$set(n,a,void 0,{overwriteImmutable:!0}),!i&&o&&(t.isNew||t.$isModified())){var u=a;t.isNew&&null!=n&&(u=t.$__getValue(n)),t.$set(o,u)}}},1635:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,["Can't validate() the same doc multiple times in parallel. Document: "+t._doc._id])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"ParallelValidateError"}),t.exports=a},1679:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},1697:t=>{"use strict";t.exports=Math.max},1732:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(3609),u=r(6426),c=r(3704),l=r(4327);function f(t,e){u.call(this,t,e,"Double")}function p(t){return this.cast(t)}f.schemaName="Double",f.defaultOptions={},f.prototype=Object.create(u.prototype),f.prototype.constructor=f,f._cast=c,f.set=u.set,f.setters=[],f.get=u.get,f._defaultCaster=function(t){if(null!=t&&"Double"!==t._bsontype)throw new Error;return t},f.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},f._checkRequired=function(t){return null!=t},f.checkRequired=u.checkRequired,f.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},f.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():f.cast();try{return e(t)}catch(e){throw new a("Double",t,this.path,e,this)}};var h=i(i({},u.prototype.$conditionalHandlers),{},{$gt:p,$gte:p,$lt:p,$lte:p});Object.defineProperty(f.prototype,"$conditionalHandlers",{enumerable:!1,value:h}),f.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return l("number","double",null==t?void 0:t.useBsonType,e)},f.prototype.autoEncryptionType=function(){return"double"},t.exports=f},1793:(t,e,r)=>{"use strict";var n=r(7300),o=r(2789);t.exports=function t(e){if(null==e)return null;var r=Object.keys(e),i=null;if(1===r.length&&"_id"===r[0])i=!e._id;else for(var s=0;s<r.length;++s){var a,u=r[s];if("_id"!==u&&n(e[u])&&null!=(i=o(e[u])?null!==(a=t(e[u]))&&void 0!==a?a:i:!e[u]))break}return i}},1824:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(3703);t.exports=function(t,e,r,i,s,a){var u=i,c=u,l=o(s,"timestamps",!0);if(!l||null==u)return i;var f,p,h,y=null!=l&&!1===l.createdAt,d=null!=l&&!1===l.updatedAt;if(a)return i&&i.$set&&(i=i.$set,u.$set={},c=u.$set),d||!r||i[r]||(c[r]=t),y||!e||i[e]||(c[e]=t),u;if(i=i||{},Array.isArray(u))return null==r||u.push({$set:(f={},p=r,h=t,(p=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(p))in f?Object.defineProperty(f,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[p]=h,f)}),u;if(u.$set=u.$set||{},!d&&r&&(!i.$currentDate||!i.$currentDate[r])){var b=!1;if(-1!==r.indexOf("."))for(var m=r.split("."),v=1;v<m.length;++v){var g=m.slice(-v).join("."),_=m.slice(0,-v).join(".");if(null!=i[_]){i[_][g]=t,b=!0;break}if(i.$set&&i.$set[_]){i.$set[_][g]=t,b=!0;break}}b||(u.$set[r]=t),u.hasOwnProperty(r)&&delete u[r]}if(!y&&e){i[e]&&delete i[e],i.$set&&i.$set[e]&&delete i.$set[e];var w=!1;if(-1!==e.indexOf("."))for(var O=e.split("."),S=1;S<O.length;++S){var $=O.slice(-S).join("."),j=O.slice(0,-S).join(".");if(null!=i[j]){i[j][$]=t,w=!0;break}if(i.$set&&i.$set[j]){i.$set[j][$]=t,w=!0;break}}w||(u.$setOnInsert=u.$setOnInsert||{},u.$setOnInsert[e]=t)}return 0===Object.keys(u.$set).length&&delete u.$set,u}},1849:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var o=r(8768);t.exports=function(t,e){if(null!=t._doc._id&&null!=e&&0!==e.length){var r,i=String(t._doc._id),s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}(e);try{for(s.s();!(r=s.n()).done;){var a=r.value;if(!a.isVirtual)for(var u=a.path.split("."),c=0;c<u.length-1;++c){var l=u.slice(0,c+1).join("."),f=u.slice(c+1).join("."),p=t.get(l);if(null!=p&&o.isMongooseDocumentArray(p)){for(var h=0;h<p.length;++h)p[h]&&p[h].populated(f,null==a._docs[i]?void 0:a._docs[i][h],a);break}}}}catch(t){s.e(t)}finally{s.f()}}}},1875:t=>{"use strict";t.exports=function(t){for(var e,r=Object.keys(t.errors||{}),n=r.length,o=[],i=0;i<n;++i)e=r[i],t!==t.errors[e]&&o.push(e+": "+t.errors[e].message);return o.join(", ")}},1898:(t,e,r)=>{"use strict";e.saveSubdocs=r(4432),e.sharding=r(2824),e.trackTransaction=r(5889),e.validateBeforeSave=r(9848)},1905:(t,e,r)=>{"use strict";var n=r(3071),o=r(2724)(/^\s*(?:function)?\*/),i=r(953)(),s=r(209),a=n("Object.prototype.toString"),u=n("Function.prototype.toString"),c=r(8690);t.exports=function(t){if("function"!=typeof t)return!1;if(o(u(t)))return!0;if(!i)return"[object GeneratorFunction]"===a(t);if(!s)return!1;var e=c();return e&&s(t)===e.prototype}},2003:(t,e,r)=>{"use strict";var n=r(3703),o=r(608),i=r(2423);t.exports=function(t){var e=[],r=new WeakMap,s=t.constructor.indexTypes,a=new Map;return function t(u,c,l){if(!r.has(u)){r.set(u,!0),c=c||"";for(var f=0,p=Object.keys(u.paths);f<p.length;f++){var h=p[f],y=u.paths[h];if(null==l||!l.paths[h]){if(null!=y._duplicateKeyErrorMessage&&(u._duplicateKeyErrorMessagesByPath=u._duplicateKeyErrorMessagesByPath||{},u._duplicateKeyErrorMessagesByPath[h]=y._duplicateKeyErrorMessage),y.$isMongooseDocumentArray||y.$isSingleNested){if(!0!==n(y,"options.excludeIndexes")&&!0!==n(y,"schemaOptions.excludeIndexes")&&!0!==n(y,"schema.options.excludeIndexes")&&t(y.schema,c+h+"."),null!=y.schema.discriminators)for(var d=y.schema.discriminators,b=0,m=Object.keys(d);b<m.length;b++){t(d[m[b]],c+h+".",y.schema)}if(y.$isMongooseDocumentArray)continue}var v=y._index||y.caster&&y.caster._index;if(!1!==v&&null!=v){var g={},_=o(v),w=_?v:{},O="string"==typeof v?v:!!_&&v.type;if(O&&-1!==s.indexOf(O))g[c+h]=O;else if(w.text)g[c+h]="text",delete w.text;else{var S;S="descending"===v||"desc"===v||"ascending"!==v&&"asc"!==v&&-1===Number(v),g[c+h]=S?-1:1}delete w.type,"background"in w||(w.background=!0),null!=u.options.autoIndex&&(w._autoIndex=u.options.autoIndex);var $=w&&w.name;"string"==typeof $&&a.has($)?Object.assign(a.get($),g):(e.push([g,w]),a.set($,g))}}}r.delete(u),c?function(t,r){for(var n=t._indexes,o=n.length,i=0;i<o;++i){for(var s=n[i][0],a=n[i][1],u=Object.keys(s),c=u.length,l={},f=0;f<c;++f){var p=u[f];l[r+p]=s[p]}var h=Object.assign({},a);if(null!=a&&null!=a.partialFilterExpression){h.partialFilterExpression={};for(var y=a.partialFilterExpression,d=0,b=Object.keys(y);d<b.length;d++){var m=b[d];h.partialFilterExpression[r+m]=y[m]}}e.push([l,h])}}(u,c):(u._indexes.forEach(function(t){var e=t[1];"background"in e||(e.background=!0),i(u,e)}),e=e.concat(u._indexes))}}(t),e}},2064:(t,e,r)=>{"use strict";var n=r(2273),o=r(9122),i=r(4756),s=r(2481),a=r(9247),u=o(s(),Object);n(u,{getPolyfill:s,implementation:i,shim:a}),t.exports=u},2068:(t,e,r)=>{"use strict";var n,o=r(4450),i=r(7930).documentSchemaSymbol,s=r(3303)._,a=r(8768),u=r(7930).getSymbol,c=r(7930).scopeSymbol,l=a.isPOJO;e.w=h,e.X=y;var f=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),p=Object.freeze({noDottedPath:!0});function h(t,e,o,i){n=n||r(2400);for(var s=i.typeKey,a=0,u=Object.keys(t);a<u.length;a++){var c=u[a],f=t[c];y({prop:c,subprops:l(f)&&Object.keys(f).length>0&&(!f[s]||"type"===s&&l(f.type)&&f.type.type)?f:null,prototype:e,prefix:o,options:i})}}function y(t){var e=t.prop,a=t.subprops,l=t.prototype,y=t.prefix,d=t.options;n=n||r(2400);var b=(y?y+".":"")+e,m=(y=y||"")?Object.freeze({}):p;a?Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){var t,e,r=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[b]){var s=Object.create(n.prototype,(t=this,e={},Object.getOwnPropertyNames(t).forEach(function(r){-1===["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(r)||(e[r]=Object.getOwnPropertyDescriptor(t,r),e[r].enumerable=!1)}),e));y||(s.$__[c]=this),s.$__.nestedPath=b,Object.defineProperty(s,"schema",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(s,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(s,i,{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(s,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o(r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(s,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null})}}),Object.defineProperty(s,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toJSON&&this.schema.options.toJSON.virtuals||null})}}),Object.defineProperty(s,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(s,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(b,null,f)||{}).length}}),Object.defineProperty(s,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),h(a,s,b,d),this.$__.getters[b]=s}return this.$__.getters[b]},set:function(t){null!=t&&t.$__isNested?t=t.$__get():t instanceof n&&!t.$__isNested&&(t=t.$toObject(s)),(this.$__[c]||this).$set(b,t)}}):Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){return this[u].call(this.$__[c]||this,b,null,m)},set:function(t){this.$set.call(this.$__[c]||this,b,t)}})}},2069:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function i(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}var a=r(5761),u=i(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.assign(this,e),null!=e&&null!=e.options&&(this.options=Object.assign({},e.options))});Object.defineProperty(u.prototype,"ref",a),Object.defineProperty(u.prototype,"refPath",a),Object.defineProperty(u.prototype,"localField",a),Object.defineProperty(u.prototype,"foreignField",a),Object.defineProperty(u.prototype,"justOne",a),Object.defineProperty(u.prototype,"count",a),Object.defineProperty(u.prototype,"match",a),Object.defineProperty(u.prototype,"options",a),Object.defineProperty(u.prototype,"skip",a),Object.defineProperty(u.prototype,"limit",a),Object.defineProperty(u.prototype,"perDocumentLimit",a),t.exports=u},2073:t=>{"use strict";t.exports=function t(e){if(!Array.isArray(e))return{min:0,max:0,containsNonArrayItem:!0};if(0===e.length)return{min:1,max:1,containsNonArrayItem:!1};if(1===e.length&&!Array.isArray(e[0]))return{min:1,max:1,containsNonArrayItem:!1};for(var r=t(e[0]),n=1;n<e.length;++n){var o=t(e[n]);o.min<r.min&&(r.min=o.min),o.max>r.max&&(r.max=o.max),r.containsNonArrayItem=r.containsNonArrayItem||o.containsNonArrayItem}return r.min=r.min+1,r.max=r.max+1,r}},2081:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function u(t,e,r,n){var o=c(h(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof o?function(t){return o.apply(r,t)}:o}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},c.apply(null,arguments)}function l(t){var e="function"==typeof Map?new Map:void 0;return l=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(f())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&p(o,r.prototype),o}(t,arguments,h(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,t)},l(t)}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}var y=r(5022),d=r(8213),b=r(4450),m=r(8768).deepEqual,v=r(8260),g=r(3216),_=r(7352),w=r(2793),O=r(3305),S=r(4473),$=r(7930).populateModelSymbol,j=function(t){function e(t,r,o,i,s){var a,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"Object"===v(t)&&(t=Object.keys(t).reduce(function(e,r){return e.concat([[r,t[r]]])},[])),(u=function(t,e,r){return e=h(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,r||[],h(t).constructor):e.apply(t,r))}(this,e,[t])).$__parent=null!=o&&null!=o.$__?o:null,null!==(a=u.$__parent)&&void 0!==a&&a.$isSingleNested&&u.$__parent.$basePath?(u.$__path=u.$__parent.$basePath+"."+r,u.$__pathRelativeToParent=r):null!=s&&s.path?(u.$__path=s.path,u.$__pathRelativeToParent=null):(u.$__path=r,u.$__pathRelativeToParent=null),u.$__schemaType=null==i?new y(r):i,u.$__runDeferred(),u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(e,t),r=e,i=[{key:"$init",value:function(t,r){P(t),u(e,"set",this,3)([t,r]),null!=r&&r.$isSingleNested&&(r.$basePath=this.$__path+"."+t,null!=this.$__pathRelativeToParent?r.$pathRelativeToParent=this.$__pathRelativeToParent+"."+t:r.$pathRelativeToParent=this.$__path+"."+t)}},{key:"$__set",value:function(t,r){u(e,"set",this,3)([t,r])}},{key:"get",value:function(t,r){return O(t,"ObjectId")&&(t=t.toString()),!1===(r=r||{}).getters?u(e,"get",this,3)([t]):this.$__schemaType.applyGetters(u(e,"get",this,3)([t]),this.$__parent)}},{key:"set",value:function(t,r){if(O(t,"ObjectId")&&(t=t.toString()),P(t),r=g(r),null==this.$__schemaType)return this.$__deferred=this.$__deferred||[],void this.$__deferred.push({key:t,value:r});var n,o,i=this.$__parent,s=null!=i&&i.$__&&i.$__.populated?i.$populated(l.call(this),!0)||i.$populated(this.$__path,!0):null,a=this.get(t);if(null!=s){if(this.$__schemaType.$isSingleNested)throw new d("Cannot manually populate single nested subdoc underneath Map "+'at path "'.concat(this.$__path,'". Try using an array instead of a Map.'));Array.isArray(r)&&this.$__schemaType.$isMongooseArray?r=r.map(function(t){return null==t.$__&&(t=new s.options[$](t)),t.$__.wasPopulated={value:t._doc._id},t}):null!=r&&(null==r.$__&&(r=new s.options[$](r)),r.$__.wasPopulated={value:r._doc._id})}else try{var c=null;(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested||this.$__schemaType.$isMongooseArray||this.$__schemaType.$isSchemaMap)&&(c={path:l.call(this)},this.$__schemaType.$isSingleNested&&(c.pathRelativeToParent=null!=this.$__pathRelativeToParent?this.$__pathRelativeToParent+"."+t:this.$__path+"."+t)),r=this.$__schemaType.applySetters(r,this.$__parent,!1,this.get(t),c)}catch(t){if(null!=this.$__parent&&null!=this.$__parent.$__)return void this.$__parent.invalidate(l.call(this),t);throw t}function l(){return n||(n=this.$__path+"."+t)}u(e,"set",this,3)([t,r]),null!=r&&r.$isSingleNested&&(null!=this.$__pathRelativeToParent?r.$pathRelativeToParent=this.$__pathRelativeToParent+"."+t:r.$pathRelativeToParent=this.$__path+"."+t),null==i||null==i.$__||m(r,a)||(o=null!=this.$__pathRelativeToParent?this.$__pathRelativeToParent+"."+t:l.call(this),i.markModified(o),(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested)&&S(i,o))}},{key:"clear",value:function(){u(e,"clear",this,3)([]);var t=this.$__parent;null!=t&&t.markModified(this.$__path)}},{key:"delete",value:function(t){return O(t,"ObjectId")&&(t=t.toString()),this.set(t,void 0),u(e,"delete",this,3)([t])}},{key:"toBSON",value:function(){return new Map(this)}},{key:"toObject",value:function(t){if(t&&t.flattenMaps){var e,r={},n=o(this.keys());try{for(n.s();!(e=n.n()).done;){var i=e.value;r[i]=b(this.get(i),t)}}catch(t){n.e(t)}finally{n.f()}return r}return new Map(this)}},{key:"$toObject",value:function(){return this.constructor.prototype.toObject.apply(this,arguments)}},{key:"toJSON",value:function(t){if("boolean"!=typeof(t&&t.flattenMaps)||t.flattenMaps){var e,r={},n=o(this.keys());try{for(n.s();!(e=n.n()).done;){var i=e.value;r[i]=b(this.get(i),t)}}catch(t){n.e(t)}finally{n.f()}return r}return new Map(this)}},{key:"inspect",value:function(){return new Map(this)}},{key:"$__runDeferred",value:function(){if(this.$__deferred){var t,e=o(this.$__deferred);try{for(e.s();!(t=e.n()).done;){var r=t.value;this.set(r.key,r.value)}}catch(t){e.e(t)}finally{e.f()}this.$__deferred=null}}}],i&&s(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(l(Map));function P(t){var e=n(t);if("string"!==e)throw new TypeError("Mongoose maps only support string keys, got ".concat(e));if(t.startsWith("$"))throw new Error('Mongoose maps do not support keys that start with "$", got "'.concat(t,'"'));if(t.includes("."))throw new Error('Mongoose maps do not support keys that contain ".", got "'.concat(t,'"'));if(w.has(t))throw new Error('Mongoose maps do not support reserved key name "'.concat(t,'"'))}_.inspect.custom&&Object.defineProperty(j.prototype,_.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:j.prototype.inspect}),Object.defineProperty(j.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(j.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(j.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(j.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(j.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0}),Object.defineProperty(j.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0}),t.exports=j},2097:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(9166),a=r(1824),u=r(3703),c=r(3696),l=r(1505),f=r(7160),p=new Set(["replaceOne","findOneAndReplace"]);t.exports=function(t,e){var r=t.childSchemas.find(function(t){return!!t.schema.options.timestamps});if(e||r){var n=c(e,"createdAt"),h=c(e,"updatedAt"),y=null!=e&&e.hasOwnProperty("currentTime")?e.currentTime:null,d={};if(t.$timestamps={createdAt:n,updatedAt:h},n&&!t.paths[n]){var b=null!=t.base?t.base.get("timestamps.createdAt.immutable"):null,m=null==b||b;d[n]=i(i({},t.options.typeKey||"type",Date),"immutable",m)}h&&!t.paths[h]&&(d[h]=Date),t.add(d),t.pre("save",function(t){var e=u(this,"$__.saveOptions.timestamps");if(!1===e)return t();l(this,e,y,n,h),t()}),t.methods.initializeTimestamps=function(){var t=null!=y?y():this.constructor.base.now();if(n&&!this.get(n)&&this.$set(n,t),h&&!this.get(h)&&this.$set(h,t),this.$isSubdocument)return this;var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}(this.$getAllSubdocs());try{for(r.s();!(e=r.n()).done;){var i=e.value;i.initializeTimestamps&&i.initializeTimestamps()}}catch(t){r.e(t)}finally{r.f()}return this},g[f.builtInMiddleware]=!0;var v={query:!0,model:!1};t.pre("findOneAndReplace",v,g),t.pre("findOneAndUpdate",v,g),t.pre("replaceOne",v,g),t.pre("update",v,g),t.pre("updateOne",v,g),t.pre("updateMany",v,g)}function g(t){var e=null!=y?y():this.model.base.now();p.has(this.op)&&null==this.getUpdate()&&this.setUpdate({}),a(e,n,h,this.getUpdate(),this._mongooseOptions,p.has(this.op)),s(e,this.getUpdate(),this.model.schema),t()}}},2134:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=r(6365),c=r(6426),l=c.CastError,f=r(8250),p=r(4327),h=r(8768),y=r(9460),d=f.UUID_FORMAT,b=u.Binary;function m(t){var e;return"string"!=typeof t&&null!=t?(e=t.toString("hex")).substring(0,8)+"-"+e.substring(8,12)+"-"+e.substring(12,16)+"-"+e.substring(16,20)+"-"+e.substring(20,32):t}function v(t,e){c.call(this,t,e,"UUID"),this.getters.push(function(t){return null!=t&&null!=t.$__?t:n.isBuffer(t)?m(t):t instanceof b?m(t.buffer):h.isPOJO(t)&&"Buffer"===t.type&&Array.isArray(t.data)?m(n.from(t.data)):t})}function g(t){return this.cast(t)}function _(t){var e=this;return t.map(function(t){return e.cast(t)})}v.schemaName="UUID",v.defaultOptions={},v.prototype=Object.create(c.prototype),v.prototype.constructor=v,v._cast=f,v.get=c.get,v.set=c.set,v.setters=[],v.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},v._checkRequired=function(t){return null!=t},v.checkRequired=c.checkRequired,v.prototype.checkRequired=function(t){return n.isBuffer(t)&&(t=m(t)),null!=t&&d.test(t)},v.prototype.cast=function(t,e,r,n,o){if(h.isNonBuiltinObject(t)&&c._isRef(this,t,e,r))return this._castRef(t,e,r,o);var i;i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():v.cast();try{return i(t)}catch(e){throw new l(v.schemaName,t,this.path,e,this)}};var w=s(s({},c.prototype.$conditionalHandlers),{},{$bitsAllClear:y,$bitsAnyClear:y,$bitsAllSet:y,$bitsAnySet:y,$all:_,$gt:g,$gte:g,$in:_,$lt:g,$lte:g,$ne:g,$nin:_});Object.defineProperty(v.prototype,"$conditionalHandlers",{enumerable:!1,value:w}),v.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with UUID.");return n.call(this,e,r)}try{return this.applySetters(e,r)}catch(t){throw t instanceof l&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},v.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return p("string","binData",null==t?void 0:t.useBsonType,e)},v.prototype.autoEncryptionType=function(){return"binData"},t.exports=v},2151:t=>{"use strict";t.exports=Math.round},2268:t=>{"use strict";t.exports=TypeError},2273:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(668),i="function"==typeof Symbol&&"symbol"===n(Symbol("foo")),s=Object.prototype.toString,a=Array.prototype.concat,u=r(6750),c=r(3191)(),l=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==s.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},n=o(e);i&&(n=a.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s<n.length;s+=1)l(t,n[s],e[n[s]],r[n[s]])};f.supportsDescriptors=!!c,t.exports=f},2307:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var u=r(6365),c=r(2945),l=r(6426),f=r(4327),p=r(9460),h=r(8768),y=u.Binary,d=l.CastError;function b(t,e){l.call(this,t,e,"Buffer")}function m(t,e){return this.castForQuery(null,t,e)}b.schemaName="Buffer",b.defaultOptions={},b.prototype=Object.create(l.prototype),b.prototype.constructor=b,b.prototype.OptionsConstructor=c,b._checkRequired=function(t){return!(!t||!t.length)},b.set=l.set,b.setters=[],b.get=l.get,b.checkRequired=l.checkRequired,b.prototype.checkRequired=function(t,e){return l._isRef(this,t,e,!0)?!!t:this.constructor._checkRequired(t)},b.prototype.cast=function(t,e,r,o,i){var s;if(l._isRef(this,t,e,r)){if(t&&t.isMongooseBuffer)return t;if(n.isBuffer(t))return t&&t.isMongooseBuffer||(t=new u(t,[this.path,e]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof y){if(s=new u(t.value(!0),[this.path,e]),"number"!=typeof t.sub_type)throw new d("Buffer",t,this.path,null,this);return s._subtype=t.sub_type,s}if(null==t||h.isNonBuiltinObject(t))return this._castRef(t,e,r,i)}if(t&&t._id&&(t=t._id),t&&t.isMongooseBuffer)return t;if(n.isBuffer(t))return t&&t.isMongooseBuffer||(t=new u(t,[this.path,e]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof y){if(s=new u(t.value(!0),[this.path,e]),"number"!=typeof t.sub_type)throw new d("Buffer",t,this.path,null,this);return s._subtype=t.sub_type,s}if(null===t)return t;var c=a(t);if("string"===c||"number"===c||Array.isArray(t)||"object"===c&&"Buffer"===t.type&&Array.isArray(t.data))return"number"===c&&(t=[t]),s=new u(t,[this.path,e]),null!=this.options.subtype&&(s._subtype=this.options.subtype),s;if(h.isPOJO(t)&&(t.$binary instanceof y||"string"==typeof t.$binary)){var f=this.cast(n.from(t.$binary,"base64"));if(null!=t.$type)return f._subtype=t.$type,f}throw new d("Buffer",t,this.path,null,this)},b.prototype.subtype=function(t){return this.options.subtype=t,this};var v=i(i({},l.prototype.$conditionalHandlers),{},{$bitsAllClear:p,$bitsAnyClear:p,$bitsAllSet:p,$bitsAnySet:p,$gt:m,$gte:m,$lt:m,$lte:m});Object.defineProperty(b.prototype,"$conditionalHandlers",{enumerable:!1,value:v}),b.prototype.castForQuery=function(t,e,r){var n,o;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with Buffer.");return n.call(this,e)}try{o=this.applySetters(e,r)}catch(t){throw t instanceof d&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}return o?o.toObject({transform:!1,virtuals:!1}):o},b.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return f("string","binData",null==t?void 0:t.useBsonType,e)},b.prototype.autoEncryptionType=function(){return"binData"},t.exports=b},2345:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var a=r(3672),u=r(3731),c=r(6426),l=r(2477),f=r(4327),p=r(8260),h=r(8768),y=c.CastError;function d(t,e){c.call(this,t,e,"Date")}function b(t){return this.cast(t)}d.schemaName="Date",d.defaultOptions={},d.prototype=Object.create(c.prototype),d.prototype.constructor=d,d.prototype.OptionsConstructor=u,d._cast=l,d.set=c.set,d.setters=[],d.get=c.get,d.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},d._defaultCaster=function(t){if(null!=t&&!(t instanceof Date))throw new Error;return t},d.prototype.expires=function(t){return"Object"!==p(this._index)&&(this._index={}),this._index.expires=t,h.expires(this._index),this},d._checkRequired=function(t){return t instanceof Date},d.checkRequired=c.checkRequired,d.prototype.checkRequired=function(t,e){return"object"===s(t)&&c._isRef(this,t,e,!0)?null!=t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():d.checkRequired())(t)},d.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.minValidator},this)),t){var r=e||a.messages.Date.min;"string"==typeof r&&(r=r.replace(/{MIN}/,t===Date.now?"Date.now()":t.toString()));var n=this;this.validators.push({validator:this.minValidator=function(e){var r=t;"function"==typeof t&&t!==Date.now&&(r=r.call(this));var o=r===Date.now?r():n.cast(r);return null===e||e.valueOf()>=o.valueOf()},message:r,type:"min",min:t})}return this},d.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.maxValidator},this)),t){var r=e||a.messages.Date.max;"string"==typeof r&&(r=r.replace(/{MAX}/,t===Date.now?"Date.now()":t.toString()));var n=this;this.validators.push({validator:this.maxValidator=function(e){var r=t;"function"==typeof r&&r!==Date.now&&(r=r.call(this));var o=r===Date.now?r():n.cast(r);return null===e||e.valueOf()<=o.valueOf()},message:r,type:"max",max:t})}return this},d.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():d.cast();try{return e(t)}catch(e){throw new y("date",t,this.path,e,this)}};var m=o(o({},c.prototype.$conditionalHandlers),{},{$gt:b,$gte:b,$lt:b,$lte:b});Object.defineProperty(d.prototype,"$conditionalHandlers",{enumerable:!1,value:m}),d.prototype.castForQuery=function(t,e,r){if(null==t)try{return this.applySetters(e,r)}catch(t){throw t instanceof y&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}var n=this.$conditionalHandlers[t];if(!n)throw new Error("Can't use "+t+" with Date.");return n.call(this,e)},d.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return f("string","date",null==t?void 0:t.useBsonType,e)},d.prototype.autoEncryptionType=function(){return"date"},t.exports=d},2354:(t,e,r)=>{"use strict";var n=r(6730);t.exports=Function.prototype.bind||n},2400:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,i){var a=n&&n.prototype instanceof c?n:c,l=Object.create(a.prototype);return s(l,"_invoke",function(r,n,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(r,n){for(s=r,a=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,s=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,y),s=l,a=y;(e=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),l}var u={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),h=f.prototype=c.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=f,s(h,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(h),s(h,o,"Generator"),s(h,n,function(){return this}),s(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:y}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){function i(e,r){s(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},s(t,e,r,n)}function a(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function s(t){a(i,n,o,s,u,"next",t)}function u(t){a(i,n,o,s,u,"throw",t)}s(void 0)})}}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach(function(e){f(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(t,e,r){return(e=function(t){var e=function(t){if("object"!=d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==d(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=h(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function h(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}var b,m,v,g=r(1417),_=r(3550).EventEmitter,w=r(4224),O=r(6365),S=r(3672),$=r(5022),j=r(6140),P=r(3441),A=r(1350),E=r(1635),x=r(7058),T=r(8995),k=r(6949),N=r(9538),I=r(6814),B=r(5335),D=r(4473),M=r(4450),R=r(2068).w,U=r(2068).X,C=r(1226),F=r(7430).B,L=r(5152),V=r(791),q=r(2692),J=r(3216),z=r(2746),K=r(3305),H=r(7300),W=r(1793),G=r(5188),Q=r(7352).inspect,Y=r(3303)._,Z=r(1849),X=r(6451),tt=r(5678),et=r(6223),rt=r(3892),nt=r(8768),ot=r(542),it=nt.deepEqual,st=nt.isMongooseObject,at=r(7930).arrayAtomicsBackupSymbol,ut=r(7930).arrayAtomicsSymbol,ct=r(7930).documentArrayParent,lt=r(7930).documentIsModified,ft=r(7930).documentModifiedPaths,pt=r(7930).documentSchemaSymbol,ht=r(7930).getSymbol,yt=r(7930).modelSymbol,dt=r(7930).populateModelSymbol,bt=r(7930).scopeSymbol,mt=r(7160).schemaMixedSymbol,vt=r(5346),gt=r(7930).sessionNewDocuments,_t=nt.specialProperties;function wt(t,e,r,n){if("object"===d(r)&&null!=r&&(r=(n=r).skipId),n=Object.assign({},n),null==this.$__schema){var o=nt.isObject(e)&&!e.instanceOfSchema?new x(e):e;this.$__setSchema(o),e=r,r=n,n=arguments[4]||{}}if(this.$__=new w,null!=n.isNew&&!0!==n.isNew&&(this.$isNew=n.isNew),null!=n.priorDoc&&(this.$__.priorDoc=n.priorDoc),r&&(this.$__.skipId=r),null!=t&&"object"!==d(t))throw new A(t,"obj","Document");var i=!0;void 0!==n.defaults&&(this.$__.defaults=n.defaults,i=n.defaults);var s=this.$__schema;"boolean"==typeof e||"throw"===e?(!0!==e&&(this.$__.strictMode=e),e=void 0):!0!==s.options.strict&&(this.$__.strictMode=s.options.strict);var a,u=p(s.requiredPaths(!0));try{for(u.s();!(a=u.n()).done;){var c=a.value;this.$__.activePaths.require(c)}}catch(t){u.e(t)}finally{u.f()}var l=null;nt.isPOJO(e)&&Object.keys(e).length>0&&(l=W(e),this.$__.selected=e,this.$__.exclude=l);var f=!1===l&&e?I(e):null;if(null==this._doc&&(this.$__buildDoc(t,e,r,l,f,!1),i&&B(this,e,l,f,!0,null,{skipParentChangeTracking:!0})),t&&(this.$__original_set?this.$__original_set(t,void 0,!0,n):this.$set(t,void 0,!0,n),t instanceof wt&&(this.$isNew=t.$isNew)),n.willInit&&i?n.skipDefaults&&(this.$__.skipDefaults=n.skipDefaults):i&&B(this,e,l,f,!1,n.skipDefaults),!this.$__.strictMode&&t){var h=this;Object.keys(this._doc).forEach(function(t){t in s.tree||t in s.methods||t in s.virtuals||t.startsWith("$")||U({prop:t,subprops:null,prototype:h})})}!function(t){var e=t.$__schema&&t.$__schema.callQueue;if(e.length){var r,n=p(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;"pre"!==o[0]&&"post"!==o[0]&&"on"!==o[0]&&t[o[0]].apply(t,o[1])}}catch(t){n.e(t)}finally{n.f()}}}(this)}for(var Ot in wt.prototype.$isMongooseDocumentPrototype=!0,Object.defineProperty(wt.prototype,"isNew",{get:function(){return this.$isNew},set:function(t){this.$isNew=t}}),Object.defineProperty(wt.prototype,"errors",{get:function(){return this.$errors},set:function(t){this.$errors=t}}),wt.prototype.$isNew=!0,nt.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(t){wt.prototype[t]=function(){if(!this.$__.emitter){if("emit"===t)return;this.$__.emitter=new _,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[t].apply(this.$__.emitter,arguments)},wt.prototype["$".concat(t)]=wt.prototype[t]}),wt.prototype.constructor=wt,_.prototype)wt[Ot]=_.prototype[Ot];function St(t,e,r){if(null!=t)for(var n=Object.keys(r.$__schema.paths),o=n.length,i=-1===e.indexOf(".")?[e]:e.split("."),s=0;s<o;++s){var a="",u=n[s];if(u.startsWith(e+".")){var c=r.$__schema.paths[u],l=c.splitPath().slice(i.length),f=l.length;if(void 0!==c.defaultValue)for(var p=t,h=0;h<f&&null!=p;++h){var y=l[h];if(h===f-1){if(void 0!==p[y])break;try{var d=c.getDefault(r,!1);void 0!==d&&(p[y]=d)}catch(t){r.invalidate(e+"."+a,t);break}break}a+=(a.length?".":"")+y,p[y]=p[y]||{},p=p[y]}}}}function $t(t,e,r,n,o){o=o||"",null!=e.$__&&(e=e._doc);for(var i,s,a,u=Object.keys(e),c=u.length,l=t.$__.strictMode,f=t.$__schema,p=0;p<c;++p)if(a=u[p],!_t.has(a)&&(s=o?o+a:a,i=f.path(s),!f.$isRootDiscriminator||t.$__isSelected(s))){var h=e[a];if(!i&&nt.isPOJO(h))r[a]||(r[a]={},l||a in f.tree||a in f.methods||a in f.virtuals?null!=n&&n.virtuals&&a in f.virtuals&&(t[a]=r[a]):t[a]=r[a]),$t(t,h,r[a],n,s+".");else if(i){if(r.hasOwnProperty(a)&&void 0!==h&&!n.hydratedPopulatedDocs&&delete r[a],null===h)r[a]=i._castNullish(null);else if(void 0!==h){var y=null==h.$__?null:h.$__.wasPopulated;if(!i||y||n.hydratedPopulatedDocs)if(i&&n.hydratedPopulatedDocs){var d;r[a]=i.cast(h,t,!0,void 0,{hydratedPopulatedDocs:!0}),r[a]&&r[a].$__&&r[a].$__.wasPopulated?t.$populated(s,r[a].$__.wasPopulated.value,r[a].$__.wasPopulated.options):Array.isArray(r[a])&&r[a].length&&null!==(d=r[a][0])&&void 0!==d&&null!==(d=d.$__)&&void 0!==d&&d.wasPopulated&&t.$populated(s,r[a].map(function(t){var e;return null==t||null===(e=t.$__)||void 0===e||null===(e=e.wasPopulated)||void 0===e?void 0:e.value}).filter(function(t){return null!=t}),r[a][0].$__.wasPopulated.options)}else r[a]=h;else try{n&&n.setters?r[a]=i.applySetters(h,t,!1,null,n):r[a]=i.cast(h,t,!0,void 0,n)}catch(e){t.invalidate(e.path,new N({path:e.path,message:e.message,type:"cast",value:e.value,reason:e}))}}t.$isModified(s)||t.$__.activePaths.init(s)}else r[a]=h,l||o?null!=n&&n.virtuals&&a in f.virtuals&&(t[a]=h):t[a]=h}}function jt(t){if(null==t)return!0;if("object"!==d(t)||Array.isArray(t))return!1;for(var e=0,r=Object.keys(t);e<r.length;e++)if(!jt(t[r[e]]))return!1;return!0}function Pt(t,e,r,n){var o={};!function(t){var e=Object.keys(t.$__.activePaths.getStatePaths("require")),r=0,n=e.length;for(r=0;r<n;++r){var o=e[r],i=t.$__schema.path(o);if(null!=i&&"function"==typeof i.originalRequiredValue){t.$__.cachedRequired=t.$__.cachedRequired||{};try{t.$__.cachedRequired[o]=i.originalRequiredValue.call(t,t)}catch(e){t.invalidate(o,e)}}}}(t);var i=new Set(Object.keys(t.$__.activePaths.getStatePaths("require")).filter(function(e){return!(!t.$__isSelected(e)&&!t.$isModified(e))&&!e.endsWith(".$*")&&(null==t.$__.cachedRequired||!(e in t.$__.cachedRequired)||t.$__.cachedRequired[e])}));function s(t){t.endsWith(".$*")||i.add(t)}if(Object.keys(t.$__.activePaths.getStatePaths("init")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("modify")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("default")).forEach(s),!n){for(var a=[],u=0,c=Object.keys(t.$__schema.paths);u<c.length;u++){var l=c[u],f=t.$__schema.path(l);if(f.$isSingleNested){var h=t.$get(l);h&&a.push(h)}else if(f.$isMongooseDocumentArray){var y=t.$get(l);if(y&&y.length){var d,b=p(y);try{for(b.s();!(d=b.n()).done;){var m=d.value;m&&a.push(m)}}catch(t){b.e(t)}finally{b.f()}}}}for(var v=t.modifiedPaths(),g=0,_=a;g<_.length;g++){var w=_[g];if(w.$basePath){var O,S=w.$__pathRelativeToParent(),$=p(w.modifiedPaths());try{for($.s();!(O=$.n()).done;){var j=O.value;i.delete(S+"."+j)}}catch(t){$.e(t)}finally{$.f()}var P=w.$parent();if(null==P)throw new Error("Cannot validate subdocument that does not have a parent");!t.$isModified(S,null,v)||P.$__.activePaths.getStatePaths("modify").hasOwnProperty(S)||P.$isDefault(S)||(i.add(S),null==t.$__.pathsToScopes&&(t.$__.pathsToScopes={}),t.$__.pathsToScopes[S]=w.$isDocumentArrayElement?w.__parentArray:w.$parent(),o[S]={skipSchemaValidators:!0},w.$isDocumentArrayElement&&null!=w.__index&&(o[S].index=w.__index))}}}var A,E=p(i);try{for(E.s();!(A=E.n()).done;){var x=A.value,T=t.$__schema.path(x);if(T){if(T.$isMongooseDocumentArray){var k,N=p(i);try{for(N.s();!(k=N.n()).done;){var I=k.value;(null==I||I.startsWith(T.path+"."))&&i.delete(I)}}catch(t){N.e(t)}finally{N.f()}}(T.caster||0!==T.validators.length||T.$parentSchemaDocArray)&&(!T.$isMongooseArray||T.$isMongooseDocumentArray||T.$embeddedSchemaType.$isMongooseArray||0!==T.validators.length||0!==T.$embeddedSchemaType.validators.length)||i.delete(x)}}}catch(t){E.e(t)}finally{E.f()}Array.isArray(e)?i=function(t,e){var r,n=new Set(e),o=new Map([]),i=p(e);try{for(i.s();!(r=i.n()).done;){var s=r.value;if(-1!==s.indexOf("."))for(var a=s.split("."),u=a[0],c=1;c<a.length;++c)o.set(u,s),u=u+"."+a[c]}}catch(t){i.e(t)}finally{i.f()}var l,f=new Set,h=p(t);try{for(h.s();!(l=h.n()).done;){var y=l.value;n.has(y)?f.add(y):o.has(y)&&f.add(o.get(y))}}catch(t){h.e(t)}finally{h.f()}return f}(i,e):Array.isArray(r)&&(i=function(t,e){return e=new Set(e),t=Array.from(t).filter(function(t){return!e.has(t)}),new Set(t)}(i,r)),function(t,e){var r,n=p(e);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=t.$__schema.path(o);i&&i.$isMongooseArray&&(Array.isArray(i)||!i.$isMongooseDocumentArray||i&&i.schemaOptions&&i.schemaOptions.required)&&(!i.$isMongooseArray||i.$isMongooseDocumentArray||i.$embeddedSchemaType.$isMongooseArray||0!==i.$embeddedSchemaType.validators.length)&&At(t.$__getValue(o),e,o)}}catch(t){n.e(t)}finally{n.f()}}(t,i);var B,D={skipArrays:!0},M=p(i);try{for(M.s();!(B=M.n()).done;){var R=B.value;if(t.$__schema.nested[R]){var U=t.$__getValue(R);st(U)&&(U=U.toObject({transform:!1}));var C=F(U,R,D,t.$__schema);Object.keys(C).filter(function(e){return!t.$__schema.singleNestedPaths.hasOwnProperty(e)}).forEach(s)}}}catch(t){M.e(t)}finally{M.f()}var L,V=p(i);try{for(V.s();!(L=V.n()).done;){var q=L.value,J=t.$__schema.path(q);if(J&&(J.$parentSchemaDocArray&&"string"==typeof J.$parentSchemaDocArray.path&&i.add(J.$parentSchemaDocArray.path),J.$isSchemaMap)){var z=t.$__getValue(q);if(null!=z){var K,H=p(z.keys());try{for(H.s();!(K=H.n()).done;){var W=K.value;i.add(q+"."+W)}}catch(t){H.e(t)}finally{H.f()}}}}}catch(t){V.e(t)}finally{V.f()}return[i=Array.from(i),o]}function At(t,e,r){if(null!=t)for(var n=t.length,o=0;o<n;++o)Array.isArray(t[o])?At(t[o],e,r+"."+o):e.add(r+"."+o)}function Et(t,e,r,n){var o,i,s,a=t.$__schema,u=a.virtuals,c=Object.keys(u),l=c.length,f=l,p=t._doc,h="boolean"!=typeof(n&&n.aliases)||n.aliases;r=r||{};var y=null;if(Array.isArray(r.virtuals))y=new Set(r.virtuals);else if(r.virtuals&&r.virtuals.pathsToSkip){y=new Set(c);for(var d=0;d<r.virtuals.pathsToSkip.length;d++)y.has(r.virtuals.pathsToSkip[d])&&y.delete(r.virtuals.pathsToSkip[d])}if(!p)return e;for(l=0;l<f;++l)if(o=c[l],(null==y||y.has(o))&&(h||!a.aliases.hasOwnProperty(o))){if(i=o,null!=r.path){if(!o.startsWith(r.path+"."))continue;i=o.substring(r.path.length+1)}if(-1!==i.indexOf(".")||i!==o){var b=i.split(".");if(void 0!==(s=M(t.get(o),r))){var m=b.length;p=e;for(var v=0;v<m-1;++v)p[b[v]]=p[b[v]]||{},p=p[b[v]];p[b[m-1]]=s}}else{if(void 0===(s=u[o].applyGetters(void 0,t)))continue;s=M(s,r),e[i]=s}}return e}function xt(t,e){if(ot(e))throw new Error("`transform` function must be synchronous, but the transform on path `"+t+"` returned a promise.")}function Tt(t,e,r){var n=t.$populated(e,!0);if(!n&&t.$__.selected){var o=e.split(".")[0];if(t.$__.selected[o+".$"])return o}if(n&&nt.isMongooseArray(r)&&(n.options.match||n.options.options&&nt.object.hasOwnProperty(n.options.options,"limit")||n.options.options&&n.options.options.skip||n.options.select&&(0===n.options.select._id||/\s?-_id\s?/.test(n.options.select)))){var i=r[ut];if(0===Object.keys(i).length||i.$set||i.$pop)return e}}function kt(t,e,r,n,o,i){if(i||(i="$set"),r[i]||(r[i]={}),r[i][n.path]=o,!1!==t.$__schema.options.versionKey&&!function(t,e){var r=t.$__schema.options.skipVersioning;return!!r&&r[e=e.replace(/\.\d+\./,".")]}(t,n.path)&&3&~t.$__.version&&!t.$__schema.options.optimisticConcurrency){switch(i){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}"$push"===i||"$addToSet"===i||"$pullAll"===i||"$pull"===i?/\.\d+\.|\.\d+$/.test(n.path)?t.$__.version=3:t.$__.version=2:/^\$p/.test(i)||Array.isArray(o)?t.$__.version=3:/\.\d+\.|\.\d+$/.test(n.path)&&(t.$__.version=1)}}function Nt(t,e,r,n,o){if(!r.$set||!r.$set[n.path])if("function"!=typeof o.$__getAtomics){var i,s,a=o[ut],u=Object.keys(a),c=u.length;if(0===c)return nt.isMongooseObject(o)?o=o.toObject({depopulate:1,_isNested:!0}):o.valueOf&&(o=o.valueOf()),kt(t,0,r,n,o);for(;c--;)i=a[s=u[c]],nt.isMongooseObject(i)?i=i.toObject({depopulate:!0,transform:!1,_isNested:!0}):Array.isArray(i)?i=i.map(l):i.valueOf&&(i=i.valueOf()),"$addToSet"===s&&(i={$each:i}),kt(t,0,r,n,i,s)}else o.$__getAtomics().forEach(function(e){var o=e[0],i=e[1];kt(t,0,r,n,i,o)});function l(t){return nt.isMongooseObject(t)?t.toObject({depopulate:1,_isNested:!0}):t}}wt.prototype.$__schema,wt.prototype.schema,Object.defineProperty(wt.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){return null==this.$__.locals&&(this.$__.locals={}),this.$__.locals},set:function(t){this.$__.locals=t}}),wt.prototype.isNew,Object.defineProperty(wt.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0}),wt.prototype.id,wt.prototype.$errors,Object.defineProperty(wt.prototype,"$op",{get:function(){return this.$__.op||null},set:function(t){this.$__.op=t}}),wt.prototype.$__buildDoc=function(t,e,r,n,o){for(var i={},s=Object.keys(this.$__schema.paths).filter(function(t){return!t.includes("$*")}),a=s.length,u=0;u<a;++u){var c=s[u];if("_id"===c){if(r)continue;if(t&&"_id"in t)continue}for(var l=this.$__schema.paths[c].splitPath(),f=l.length,p=f-1,h="",y=i,d=!1,b=0;b<f;++b){var m=l[b];if(h.length?h+="."+m:h=m,!0===n){if(h in e)break}else if(!1===n&&e&&!d)if(h in e)d=!0;else if(!o[h])break;b<p&&(y=y[m]||(y[m]={}))}}this._doc=i},wt.prototype.toBSON=function(){return this.toObject(Y)},wt.prototype.init=function(t,e,r){return"function"==typeof e&&(r=e,e=null),this.$__init(t,e),r&&r(null,this),this},wt.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)},wt.prototype.$__init=function(t,e){if(this.$isNew=!1,e=e||{},null!=t._id&&e.populated&&e.populated.length){var r,n=String(t._id),o=p(e.populated);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(i.isVirtual?this.$populated(i.path,nt.getValue(i.path,t),i):this.$populated(i.path,i._docs[n],i),null!=i._childDocs){var s,a=p(i._childDocs);try{for(a.s();!(s=a.n()).done;){var u=s.value;null!=u&&null!=u.$__&&(u.$__.parent=this)}}catch(t){a.e(t)}finally{a.f()}i._childDocs=[]}}}catch(t){o.e(t)}finally{o.f()}}$t(this,t,this._doc,e),Z(this,e.populated),this.$emit("init",this),this.constructor.emit("init",this);var c=!1===this.$__.exclude&&this.$__.selected?I(this.$__.selected):null;return B(this,this.$__.selected,this.$__.exclude,c,!1,this.$__.skipDefaults),this},wt.prototype.updateOne=function(t,e,r){var n=this.constructor.updateOne({_id:this._doc._id},t,e),o=this;return n.pre(function(t){o.constructor._middleware.execPre("updateOne",o,[o],t)}),n.post(function(t){o.constructor._middleware.execPost("updateOne",o,[o],{},t)}),null!=this.$session()&&("session"in n.options||(n.options.session=this.$session())),null!=r?n.exec(r):n},wt.prototype.replaceOne=function(){var t=Array.prototype.slice.call(arguments);return t.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,t)},wt.prototype.$session=function(t){if(0===arguments.length)return null!=this.$__.session&&this.$__.session.hasEnded?(this.$__.session=null,null):this.$__.session;if(null!=t&&t.hasEnded)throw new S("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(null!=t||null!=this.$__.session){if(this.$__.session=t,!this.$isSubdocument){var e,r=p(this.$getAllSubdocs());try{for(r.s();!(e=r.n()).done;)e.value.$session(t)}catch(t){r.e(t)}finally{r.f()}}return t}},wt.prototype.$timestamps=function(t){return 0===arguments.length?null!=this.$__.timestamps?this.$__.timestamps:this.$__schema?this.$__schema.options.timestamps:void 0:(t!==this.$timestamps()&&(this.$__.timestamps=t),this)},wt.prototype.overwrite=function(t){for(var e=0,r=Array.from(new Set(Object.keys(this._doc).concat(Object.keys(t))));e<r.length;e++){var n=r[e];"_id"!==n&&(this.$__schema.options.versionKey&&n===this.$__schema.options.versionKey||this.$__schema.options.discriminatorKey&&n===this.$__schema.options.discriminatorKey||this.$set(n,t[n]))}return this},wt.prototype.$set=function(t,e,r,n){var o=this;nt.isPOJO(r)&&(n=r,r=void 0);var i,s,a,u,c=n&&n.merge,h=r&&!0!==r,y=!0===r,b=0,m=n&&"strict"in n,v=m?n.strict:this.$__.strictMode;if(h&&((this.$__.adhocPaths||(this.$__.adhocPaths={}))[t]=this.$__schema.interpretAsType(t,r,this.$__schema.options)),null==t){var g=[e,t];t=g[0],e=g[1]}else if("string"!=typeof t){if(t instanceof wt&&(t=t.$__isNested?t.toObject():t.$__schema===this.$__schema?Et(t,l({},t._doc)):t._doc),null==t){var _=[e,t];t=_[0],e=_[1]}u=e?e+".":"";var w=(i=V(this.$__schema,t)).length,O=n&&n._skipMinimizeTopLevel||!1;if(0===w&&O)return delete n._skipMinimizeTopLevel,e&&this.$set(e,{}),this;n=Object.assign({},n,{_skipMinimizeTopLevel:!1});for(var j=0;j<w;++j){a=i[j];var A=u?u+a:a;s=this.$__schema.pathType(A);var E=t[a];if(!0!==r||u||null==E||"nested"!==s||null==this._doc[a]||delete this._doc[a],nt.isNonBuiltinObject(E)&&"nested"===s)this.$set(A,E,y,n),St(this.$get(A),A,this);else if(v){if(y&&void 0===E&&void 0!==this.$get(A))continue;if("adhocOrUndefined"===s&&(s=L(this,A,{typeOnly:!0})),"real"===s||"virtual"===s)this.$set(A,E,y,n);else if("nested"===s&&E instanceof wt)this.$set(A,E.toObject({transform:!1}),y,n);else{if("throw"===v)throw"nested"===s?new P(a,E):new T(a);"nested"===s&&null==E&&this.$set(A,E,y,n)}}else this.$set(A,E,y,n)}for(var x={},k=Object.keys(this.$__schema.tree),N=0,I=k.length;N<I;++N)(a=k[N])&&this._doc.hasOwnProperty(a)&&(x[a]=void 0);return this._doc=Object.assign(x,this._doc),this}var B=this.$__schema.pathType(t),M=null;if("adhocOrUndefined"===B&&(M=-1===t.indexOf(".")?[t]:t.split("."),B=L(this,M,{typeOnly:!0})),"adhocOrUndefined"===B&&!m){null==M&&(M=-1===t.indexOf(".")?[t]:t.split("."));var R=q(this.$__schema,M);void 0!==R&&(v=R)}e=J(e,!0);var U,C=null!=o.$__.priorDoc?o.$__.priorDoc.$__getValue(t):y?void 0:o.$__getValue(t);if("nested"===B&&e){if("object"===d(e)&&null!=e){if(null!=e.$__&&(e=e.toObject(Y)),null==e)return this.invalidate(t,new S.CastError("Object",e,t)),this;var F=this.$isModified(t),z=null!=this.$__.savedState&&this.$__.savedState.hasOwnProperty(t);if(null!=this.$__.savedState&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(t)){var K=this.$__getValue(t);this.$__.savedState[t]=K;for(var H=0,W=Object.keys(K||{});H<W.length;H++){var G=W[H];this.$__.savedState[t+"."+G]=K[G]}}if(c)return this.$set(e,t,y,n);this.$__setValue(t,null),D(this,t);var Q=V(this.$__schema,e,t);this.$__setValue(t,{});var Z,X=p(Q);try{for(X.s();!(Z=X.n()).done;){var et=Z.value;this.$set(t+"."+et,e[et],y,l(l({},n),{},{_skipMarkModified:!0}))}}catch(t){X.e(t)}finally{X.f()}return null==C||F&&!z||!nt.deepEqual(z?this.$__.savedState[t]:C,e)?this.markModified(t):this.unmarkModified(t),this}return this.invalidate(t,new S.CastError("Object",e,t)),this}if(null==M&&(M=-1===t.indexOf(".")?[t]:t.split(".")),"string"==typeof this.$__schema.aliases[M[0]]&&(M[0]=this.$__schema.aliases[M[0]]),"adhocOrUndefined"===B&&v){var rt;for(b=0;b<M.length;++b){var ot=M.slice(0,b+1).join(".");if(b+1<M.length&&"virtual"===this.$__schema.pathType(ot))return tt.set(t,e,this),this;if(null!=(U=this.$__schema.path(ot))){if(U instanceof $){rt=!0;break}if(U.$isSchemaMap&&U.$__schemaType instanceof $&&b<M.length-1){rt=!0,U=U.$__schemaType;break}}}if(null==U&&(U=L(this,t)),!rt&&!U){if("throw"===v)throw new T(t);return this}}else{if("virtual"===B)return(U=this.$__schema.virtualpath(t)).applySetters(e,this),this;U=this.$__path(t)}var it,st=this._doc,at="";for(b=0;b<M.length-1;++b)st=st instanceof Map?st.get(M[b]):st[M[b]],at+=(0!==at.length?".":"")+M[b],st||(this.$set(at,{}),this.$__isSelected(at)||this.unmarkModified(at),st=this.$__getValue(at));if(M.length<=1)it=t;else{var ut=M.length;for(b=0;b<ut;++b){var ct=M.slice(0,b+1).join(".");if(null===this.$get(ct,null,{getters:!1})){it=ct;break}}it||(it=t)}if(!U)return this.$__set(it,t,n,y,M,U,e,C),"nested"===B&&null==e&&D(this,t),this;if((U.$isSingleNested||U.$isMongooseArray)&&function(t,e){if(t.$__.validationError){for(var r=0,n=Object.keys(t.$__.validationError.errors);r<n.length;r++){var o=n[r];o.startsWith(e+".")&&delete t.$__.validationError.errors[o]}0===Object.keys(t.$__.validationError.errors).length&&(t.$__.validationError=null)}}(this,t),null!=e&&c&&U.$isSingleNested){e instanceof wt&&(e=e.toObject({virtuals:!1,transform:!1}));for(var lt=0,ft=Object.keys(e);lt<ft.length;lt++){var pt=ft[lt];this.$set(t+"."+pt,e[pt],y,n)}return this}var ht=!0;try{var bt,mt=function(){if(null==U.options)return!1;if(!(e instanceof wt))return!1;var t=e.constructor,r="function"!=typeof U.options.ref||U.options.ref[yt]?U.options.ref:U.options.ref.call(o,o),n=(null==r?void 0:r.modelName)||r;if(null!=n&&(n===t.modelName||n===t.baseModelName))return!0;var i=U.options.refPath;if(null==i)return!1;var s=e.get(i);return s===t.modelName||s===t.baseModelName}(),_t=!1;if(mt&&e instanceof wt&&(!e.$__.wasPopulated||nt.deepEqual(e.$__.wasPopulated.value,e._doc._id))){var Ot=U&&U.$isSingleNested?U.cast(e,this):e._doc._id;this.$populated(t,Ot,f({},dt,e.constructor)),e.$__.wasPopulated={value:Ot},_t=!0}var $t=this.$__schema.options.typeKey;if(U.options&&Array.isArray(U.options[$t])&&U.options[$t].length&&U.options[$t][0]&&U.options[$t][0].ref&&function(t,e){if(!Array.isArray(t))return!1;if(0===t.length)return!1;var r,n=p(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(!(o instanceof wt))return!1;if(null==o.constructor.modelName)return!1;if(o.constructor.modelName!=e&&o.constructor.baseModelName!=e)return!1}}catch(t){n.e(t)}finally{n.f()}return!0}(e,U.options[$t][0].ref)){bt=f({},dt,e[0].constructor),this.$populated(t,e.map(function(t){return t._doc._id}),bt);var jt,Pt=p(e);try{for(Pt.s();!(jt=Pt.n()).done;){var At=jt.value;At.$__.wasPopulated={value:At._doc._id}}}catch(t){Pt.e(t)}finally{Pt.f()}_t=!0}if(!mt||!U.$isSingleNested||!e.$__){var xt=this;null!=this.$__schema.singleNestedPaths[t]&&M.length>1&&(xt=vt(this,M,this.schema)),e=null!=n&&n.overwriteImmutable?U.applySetters(e,xt,!1,C,{path:t,overwriteImmutable:!0}):U.applySetters(e,xt,!1,C,{path:t})}if(Array.isArray(e)&&!Array.isArray(U)&&U.$isMongooseDocumentArray&&0!==e.length&&null!=e[0]&&null!=e[0].$__&&null!=e[0].$__.populated){for(var Tt=Object.keys(e[0].$__.populated),kt=function(){var r=It[Nt];o.$populated(t+"."+r,e.map(function(t){return t.$populated(r)}),e[0].$__.populated[r].options)},Nt=0,It=Tt;Nt<It.length;Nt++)kt();_t=!0}if(!_t&&this.$__.populated){if(Array.isArray(e)&&this.$__.populated[t])for(var Bt=0;Bt<e.length;++Bt)e[Bt]instanceof wt&&e.set(Bt,e[Bt]._doc._id,!0);delete this.$__.populated[t]}null!=e&&U.$isSingleNested&&function(t,e,r){var n=e.schema;if(null!=n)for(var o=0,i=Object.keys(n.paths);o<i.length;o++){var s=i[o],a=n.paths[s];if(null!=a.$immutableSetter){var u=null==r?void 0:r.$__getValue(s);a.$immutableSetter.call(t,u)}}}(e,U,C),this.$markValid(t)}catch(r){r instanceof S.StrictModeError&&r.isImmutableError?this.invalidate(t,r):r instanceof S.CastError?(this.invalidate(r.path,r),r.$originalErrorPath&&this.invalidate(t,new S.CastError(U.instance,e,t,r.$originalErrorPath))):this.invalidate(t,new S.CastError(U.instance,e,t,r)),ht=!1}if(ht){var Dt,Mt=null,Rt=null;if(!y){var Ut=this.$isSubdocument?this.ownerDocument():this;Mt=Ut.$__.savedState,Rt=this.$isSubdocument?this.$__.fullPath+"."+t:t,Ut.$__saveInitialState(Rt)}this.$__set(it,t,n,y,M,U,e,C);var Ct=!(null===(Dt=this.$__.session)||void 0===Dt||!Dt.transaction),Ft=this.$__.session&&this.$__.session[gt]&&this.$__.session[gt].has(this)&&this.$__.session[gt].get(this).modifiedPaths&&!this.$__.session[gt].get(this).modifiedPaths.has(Rt);null!=Mt&&Mt.hasOwnProperty(Rt)&&(!Ct||Ft)&&nt.deepEqual(e,Mt[Rt])&&this.unmarkModified(t)}return(U.$isSingleNested&&(this.isDirectModified(t)||null==e)||U.$isSchemaMap&&null==e)&&D(this,t),this},wt.prototype.set=wt.prototype.$set,wt.prototype.$__shouldModify=function(t,e,r,n,o,i,s,a){return!(r&&r._skipMarkModified||!this.$isNew&&!(e in this.$__.activePaths.getStatePaths("modify"))&&(void 0!==s||this.$__isSelected(e))&&(void 0===s&&e in this.$__.activePaths.getStatePaths("default")||this.$populated(e)&&s instanceof wt&&it(s._doc._id,a)||it(s,void 0!==a?a:nt.getValue(e,this))&&(n||null==s||!(e in this.$__.activePaths.getStatePaths("default"))||!it(s,i.getDefault(this,n)))))},wt.prototype.$__set=function(t,e,n,o,i,s,a,u){v=v||r(6547);var c=this.$__shouldModify(t,e,n,o,i,s,a,u);c?(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[e]&&(delete this.$__.primitiveAtomics[e],0===Object.keys(this.$__.primitiveAtomics).length&&delete this.$__.primitiveAtomics),this.markModified(t),m||(m=r(7557)),a&&nt.isMongooseArray(a)&&(a._registerAtomic("$set",a),nt.isMongooseDocumentArray(a)&&a.forEach(function(t){t&&t.__parentArray&&(t.__parentArray=a)}))):Array.isArray(a)&&Array.isArray(u)&&nt.isMongooseArray(a)&&nt.isMongooseArray(u)&&(a[ut]=u[ut],a[at]=u[at],nt.isMongooseDocumentArray(a)&&a.forEach(function(t){null!=t&&(t.$isNew=!1)}));for(var l=this._doc,f=0,p=i.length,h="";f<p;f++){var y=f+1===p;if(h+=h?"."+i[f]:i[f],!_t.has(i[f]))if(y)l instanceof Map?l.set(i[f],a):l.$isSingleNested?(i[f]in l||(l[i[f]]=a),l._doc[i[f]]=a,c&&l.markModified(i[f])):l[i[f]]=a;else{var d=l instanceof Map,b=d?l.get(i[f]):l[i[f]];nt.isPOJO(b)||b&&b instanceof v||b&&!Array.isArray(b)&&b.$isSingleNested||b&&Array.isArray(b)?l=b:null==b?(b={},d?l.set(i[f],b):l[i[f]]=b,l=b):l=b}}},wt.prototype.$__getValue=function(t){if("string"!=typeof t&&!Array.isArray(t))throw new TypeError('Invalid `path`. Must be either string or array. Got "'.concat(t,'" (type ').concat(d(t),")"));return nt.getValue(t,this._doc)},wt.prototype.$inc=function(t,e){var r=this;if(null==e&&(e=1),Array.isArray(t))return t.forEach(function(t){return r.$inc(t,e)}),this;var n=this.$__path(t);if(null==n){if("throw"===this.$__.strictMode)throw new T(t);if(!0===this.$__.strictMode)return this}else if("Number"!==n.instance)return this.invalidate(t,new S.CastError(n.instance,e,t)),this;var o=this.$__getValue(t)||0,i=!1,s=null,a=e;try{e=n.cast(e),a=(s=n.applySetters(o+e,this))-o,i=!0}catch(r){this.invalidate(t,new S.CastError("number",e,t,r))}return i&&(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},null==this.$__.primitiveAtomics[t]?this.$__.primitiveAtomics[t]={$inc:a}:this.$__.primitiveAtomics[t].$inc+=a,this.markModified(t),this.$__setValue(t,s)),this},wt.prototype.$__setValue=function(t,e){return nt.setValue(t,e,this._doc),this},wt.prototype.get=function(t,e,r){var n;null==r&&(r={}),e&&(n=this.$__schema.interpretAsType(t,e,this.$__schema.options));var o=r.noDottedPath,i=o?this.$__schema.paths[t]:this.$__path(t);if(null==i&&null!=(i=this.$__schema.virtualpath(t)))return i.applyGetters(void 0,this);if(o){var s=this._doc[t];return n&&(s=n.cast(s)),null!=i&&!1!==r.getters?i.applyGetters(s,this):s}if(null!=i&&"Mixed"===i.instance){var a=this.$__schema.virtualpath(t);null!=a&&(i=a)}var u=-1!==t.indexOf("."),c=this._doc,l=u?t.split("."):[t];"string"==typeof this.$__schema.aliases[l[0]]&&(l[0]=this.$__schema.aliases[l[0]]);for(var f=0,p=l.length;f<p;f++)c&&c._doc&&(c=c._doc),c=null==c?void 0:c instanceof Map?c.get(l[f],{getters:!1}):f===p-1?nt.getValue(l[f],c):c[l[f]];if(n&&(c=n.cast(c)),null!=i&&!1!==r.getters)c=i.applyGetters(c,this);else if(this.$__schema.nested[t]&&r.virtuals)return Et(this,M(c)||{},{path:t});return c},wt.prototype[ht]=wt.prototype.get,wt.prototype.$get=wt.prototype.get,wt.prototype.$__path=function(t){var e=this.$__.adhocPaths;return(e&&e.hasOwnProperty(t)?e[t]:null)||this.$__schema.path(t)},wt.prototype.markModified=function(t,e){this.$__saveInitialState(t),this.$__.activePaths.modify(t),null==e||this.$isSubdocument||(this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[t]=e)},wt.prototype.$__saveInitialState=function(t){var e=this.$__.savedState,r=t;if(null!=e){var n=r.indexOf("."),o=-1===n?r:r.slice(0,n);e.hasOwnProperty(o)||(e[o]=M(this.$__getValue(o)))}},wt.prototype.unmarkModified=function(t){this.$__.activePaths.init(t),null!=this.$__.pathsToScopes&&delete this.$__.pathsToScopes[t]},wt.prototype.$ignore=function(t){this.$__.activePaths.ignore(t)},wt.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))},wt.prototype.$isEmpty=function(t){var e={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(0!==arguments.length){var r=this.$get(t);return null==r||"object"===d(r)&&(nt.isPOJO(r)?jt(r):0===Object.keys(r.toObject(e)).length)}return 0===Object.keys(this.toObject(e)).length},wt.prototype.modifiedPaths=function(t){t=t||{};var e=Object.keys(this.$__.activePaths.getStatePaths("modify")),r=new Set,n=0,o=0,i=e.length;for(n=0;n<i;++n){var s=e[n],a=et(s),u=a.length;for(o=0;o<u;++o)r.add(a[o]);if(t.includeChildren){var c=0,l=this.$get(s);if("object"===d(l)&&null!==l){l._doc&&(l=l._doc);var f=l.length;if(Array.isArray(l))for(c=0;c<f;++c){var p=s+"."+c;if(!r.has(p)&&(r.add(p),null!=l[c]&&l[c].$__)){var h=l[c].modifiedPaths(),y=0,b=h.length;for(y=0;y<b;++y)r.add(p+"."+h[y])}}else{var m=Object.keys(l),v=0,g=m.length;for(v=0;v<g;++v)r.add(s+"."+m[v])}}}}return Array.from(r)},wt.prototype[ft]=wt.prototype.modifiedPaths,wt.prototype.isModified=function(t,e,r){var n=this;if(t){var o=e&&e.ignoreAtomics,i=this.$__.activePaths.states.modify;if(null==i)return!1;"string"==typeof t&&(t=-1===t.indexOf(" ")?[t]:t.split(" "));var s,a=p(t);try{for(a.s();!(s=a.n()).done;)if(null!=i[s.value])return!0}catch(t){a.e(t)}finally{a.f()}var u=r||this[ft](),c=t.some(function(t){return!!~u.indexOf(t)}),l=Object.keys(i);return o&&(l=l.filter(function(t){var e=n.$__getValue(t);return null==e||null==e[ut]||void 0!==e[ut].$set})),c||t.some(function(t){return l.some(function(e){return e===t||t.startsWith(e+".")})})}return this.$__.activePaths.some("modify")},wt.prototype.$isModified=wt.prototype.isModified,wt.prototype[lt]=wt.prototype.isModified,wt.prototype.$isDefault=function(t){var e=this;if(null==t)return this.$__.activePaths.some("default");if("string"==typeof t&&-1===t.indexOf(" "))return this.$__.activePaths.getStatePaths("default").hasOwnProperty(t);var r=t;return Array.isArray(r)||(r=r.split(" ")),r.some(function(t){return e.$__.activePaths.getStatePaths("default").hasOwnProperty(t)})},wt.prototype.$isDeleted=function(t){return 0===arguments.length?!!this.$__.isDeleted:(this.$__.isDeleted=!!t,this)},wt.prototype.isDirectModified=function(t){var e=this;if(null==t)return this.$__.activePaths.some("modify");if("string"==typeof t&&-1===t.indexOf(" ")){var r=this.$__.activePaths.getStatePaths("modify").hasOwnProperty(t);if(r||-1===t.indexOf("."))return r;for(var n=t.split("."),o=0;o<n.length-1;++o){var i=n.slice(0,o+1).join("."),s=this.$get(i);if(null!=s&&null!=s.$__&&s.isDirectModified(n.slice(o+1).join(".")))return!0}return!1}var a=t;return"string"==typeof a&&(a=a.split(" ")),a.some(function(t){return e.isDirectModified(t)})},wt.prototype.isInit=function(t){var e=this;if(null==t)return this.$__.activePaths.some("init");if("string"==typeof t&&-1===t.indexOf(" "))return this.$__.activePaths.getStatePaths("init").hasOwnProperty(t);var r=t;return Array.isArray(r)||(r=r.split(" ")),r.some(function(t){return e.$__.activePaths.getStatePaths("init").hasOwnProperty(t)})},wt.prototype.isSelected=function(t){var e=this;if(null==this.$__.selected)return!0;if(!t)return!1;if("_id"===t)return 0!==this.$__.selected._id;if(-1!==t.indexOf(" ")&&(t=t.split(" ")),Array.isArray(t))return t.some(function(t){return e.$__isSelected(t)});var r=Object.keys(this.$__.selected),n=null;if(1===r.length&&"_id"===r[0])return 0===this.$__.selected._id;for(var o=0,i=r;o<i.length;o++){var s=i[o];if("_id"!==s&&H(this.$__.selected[s])){n=!!this.$__.selected[s];break}}if(null===n)return!0;if(t in this.$__.selected)return n;for(var a=t+".",u=0,c=r;u<c.length;u++){var l=c[u];if("_id"!==l){if(l.startsWith(a))return n||l!==a;if(a.startsWith(l+"."))return n}}return!n},wt.prototype.$__isSelected=wt.prototype.isSelected,wt.prototype.isDirectSelected=function(t){var e=this;if(null==this.$__.selected)return!0;if("_id"===t)return 0!==this.$__.selected._id;if(-1!==t.indexOf(" ")&&(t=t.split(" ")),Array.isArray(t))return t.some(function(t){return e.isDirectSelected(t)});var r=Object.keys(this.$__.selected),n=null;if(1===r.length&&"_id"===r[0])return 0===this.$__.selected._id;for(var o=0,i=r;o<i.length;o++){var s=i[o];if("_id"!==s&&H(this.$__.selected[s])){n=!!this.$__.selected[s];break}}return null===n||(this.$__.selected.hasOwnProperty(t)?n:!n)},wt.prototype.validate=function(){var t=u(i().m(function t(e,r){var n,o,s=this,a=arguments;return i().w(function(t){for(;;)switch(t.n){case 0:if("function"!=typeof e&&"function"!=typeof r&&"function"!=typeof a[2]){t.n=1;break}throw new S("Document.prototype.validate() no longer accepts a callback");case 1:if(this.$op="validate",1===a.length&&("object"!==d(a[0])||Array.isArray(a[0])||(r=a[0],e=null)),r&&"string"==typeof r.pathsToSkip&&(n=-1===r.pathsToSkip.indexOf(" "),r.pathsToSkip=n?[r.pathsToSkip]:r.pathsToSkip.split(" ")),o=r&&r._skipParallelValidateCheck,null==this.$isSubdocument){t.n=2;break}t.n=4;break;case 2:if(!this.$__.validating||o){t.n=3;break}throw new E(this);case 3:o||(this.$__.validating=!0);case 4:return t.a(2,new Promise(function(t,n){s.$__validate(e,r,function(e){if(s.$op=null,s.$__.validating=null,null!=e)return n(e);t()})}))}},t,this)}));return function(e,r){return t.apply(this,arguments)}}(),wt.prototype.$validate=wt.prototype.validate,wt.prototype.$__validate=function(t,e,r){var n,i=this;this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!t?t=o(this.$__.saveOptions.pathsToSave):"function"==typeof t?(r=t,e=null,t=null):"function"==typeof e&&(r=e,e=null);var s,a=e&&"object"===d(e)&&"validateModifiedOnly"in e,u=e&&e.pathsToSkip||null;s=a?!!e.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var c=e&&e.validateAllPaths;if(c){if(u)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(a&&s)throw new TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}var f,h,y=this,b=function(){var t=i.$__.validationError;if(i.$__.validationError=null,i.$__.validating=null,s&&null!=t){for(var e=0,r=Object.keys(t.errors);e<r.length;e++){var n=r[e];i.$isModified(n)||delete t.errors[n]}0===Object.keys(t.errors).length&&(t=void 0)}if(i.$__.cachedRequired={},i.$emit("validate",y),i.constructor.emit("validate",y),t){for(var o in t.errors)!i[ct]&&t.errors[o]instanceof S.CastError&&i.invalidate(o,t.errors[o]);return t}};if(c){var m,v=p(f=new Set(Object.keys(this.$__schema.paths)));try{for(v.s();!(m=v.n()).done;){var g=m.value,_=this.$__schema.path(g);if(_&&_.$isMongooseArray){var w=this.$__getValue(g);w&&At(w,f,g)}}}catch(t){v.e(t)}finally{v.f()}f=o(f),h={}}else{var O=Pt(this,t,u,e&&e._nestedValidate);f=s?O[0].filter(function(t){return i.$isModified(t)}):O[0],h=O[1]}if("string"==typeof t&&(t=t.split(" ")),0===f.length)return z(function(){var t=b();if(t)return y.$__schema.s.hooks.execPost("validate:error",y,[y],{error:t},function(t){r(t)});r(null,y)});var $={},j=0,P=null===(n=this.$__.saveOptions)||void 0===n?void 0:n.pathsToSave;if(Array.isArray(P)){P=new Set(P);var A,E=p(f);try{for(E.s();!(A=E.n()).done;){var x=A.value;P.has(x)&&I(x)}}catch(t){E.e(t)}finally{E.f()}}else{var T,N=p(f);try{for(N.s();!(T=N.n()).done;)I(T.value)}catch(t){N.e(t)}finally{N.f()}}function I(t){null==t||$[t]||($[t]=!0,j++,z(function(){var e=y.$__schema.path(t);if(!e)return--j||B();if(y.$isValid(t)){if(null!=e[mt]&&t!==e.path)return--j||B();var r,n=y.$__getValue(t);(r=y.$populated(t))?n=r:null!=n&&null!=n.$__&&n.$__.wasPopulated&&(n=n._doc._id);var o=null!=y.$__.pathsToScopes&&t in y.$__.pathsToScopes?y.$__.pathsToScopes[t]:y,i=l(l({},h[t]),{},{path:t,validateAllPaths:c,_nestedValidate:!0});e.doValidate(n,function(r){if(r){if((e.$isSingleNested||e.$isArraySubdocument||e.$isMongooseDocumentArray)&&r instanceof k)return--j||B();y.invalidate(t,r,void 0,!0)}--j||B()},o,i)}else--j||B()}))}function B(){var t=b();if(t)return y.$__schema.s.hooks.execPost("validate:error",y,[y],{error:t},function(t){r(t)});r(null,y)}},wt.prototype.validateSync=function(t,e){var r,n=this,i=this;1!==arguments.length||"object"!==d(arguments[0])||Array.isArray(arguments[0])||(e=arguments[0],t=null),r=e&&"object"===d(e)&&"validateModifiedOnly"in e?!!e.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var s,a,u=e&&e.pathsToSkip,c=e&&e.validateAllPaths;if(c){if(u)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`")}if("string"==typeof t){var l=-1===t.indexOf(" ");t=l?[t]:t.split(" ")}else"string"==typeof u&&-1!==u.indexOf(" ")&&(u=u.split(" "));if(c){var f,h=p(s=new Set(Object.keys(this.$__schema.paths)));try{for(h.s();!(f=h.n()).done;){var y=f.value,b=this.$__schema.path(y);if(b&&b.$isMongooseArray){var m=this.$__getValue(y);m&&At(m,s,y)}}}catch(A){h.e(A)}finally{h.f()}s=o(s),a={}}else{var v=Pt(this,t,u);s=r?v[0].filter(function(t){return n.$isModified(t)}):v[0],a=v[1]}for(var g={},_=0,w=s.length;_<w;++_){var O=s[_];if(!g[O]){g[O]=!0;var $=i.$__schema.path(O);if($&&i.$isValid(O)){var j=i.$__getValue(O),P=$.doValidateSync(j,i,{skipSchemaValidators:a[O],path:O,validateModifiedOnly:r,validateAllPaths:c});if(P){if(($.$isSingleNested||$.$isArraySubdocument||$.$isMongooseDocumentArray)&&P instanceof k)continue;i.invalidate(O,P,void 0,!0)}}}}var A=i.$__.validationError;if(i.$__.validationError=void 0,i.$emit("validate",i),i.constructor.emit("validate",i),A)for(var E in A.errors)A.errors[E]instanceof S.CastError&&i.invalidate(E,A.errors[E]);return A},wt.prototype.invalidate=function(t,e,r,n){if(this.$__.validationError||(this.$__.validationError=new k(this)),!this.$__.validationError.errors[t])return e&&"string"!=typeof e||(e=new N({path:t,message:e,type:n||"user defined",value:r})),this.$__.validationError===e||this.$__.validationError.addError(t,e),this.$__.validationError},wt.prototype.$markValid=function(t){this.$__.validationError&&this.$__.validationError.errors[t]&&(delete this.$__.validationError.errors[t],0===Object.keys(this.$__.validationError.errors).length&&(this.$__.validationError=null))},wt.prototype.$isValid=function(t){var e=this;return null==this.$__.validationError||0===Object.keys(this.$__.validationError.errors).length||null!=t&&(-1!==t.indexOf(" ")&&(t=t.split(" ")),Array.isArray(t)?t.some(function(t){return null==e.$__.validationError.errors[t]}):null==this.$__.validationError.errors[t])},wt.prototype.$__reset=function(){var t,e=this.$isSubdocument?null:this.$getAllSubdocs({useCache:!0});if(e&&e.length>0){var r,n=p(e);try{for(n.s();!(r=n.n()).done;)r.value.$__reset()}catch(t){n.e(t)}finally{n.f()}}return this.$__dirty().forEach(function(t){var e=t.value;e&&e[ut]&&(e[at]=e[ut],e[ut]={})}),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,t=this,this.$__schema.requiredPaths().forEach(function(e){t.$__.activePaths.require(e)}),this},wt.prototype.$__undoReset=function(){if(null!=this.$__.backup&&null!=this.$__.backup.activePaths){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;var t,e=p(this.$__dirty());try{for(e.s();!(t=e.n()).done;){var r=t.value.value;r&&r[ut]&&r[at]&&(r[ut]=r[at])}}catch(t){e.e(t)}finally{e.f()}if(!this.$isSubdocument){var n,o=p(this.$getAllSubdocs());try{for(o.s();!(n=o.n()).done;)n.value.$__undoReset()}catch(t){o.e(t)}finally{o.f()}}}},wt.prototype.$__dirty=function(){var t=this,e=this.$__.activePaths.map("modify",function(e){return{path:e,value:t.$__getValue(e),schema:t.$__path(e)}});e=e.concat(this.$__.activePaths.map("default",function(e){if("_id"!==e&&null!=t.$__getValue(e))return{path:e,value:t.$__getValue(e),schema:t.$__path(e)}}));var r=new Map(e.filter(function(t){return null!=t}).map(function(t){return[t.path,t.value]})),n=[];return e.forEach(function(t){if(t){for(var e=null,o=et(t.path),i=0;i<o.length-1;i++)if(r.has(o[i])){e=r.get(o[i]);break}null==e?n.push(t):null!=e&&null!=e[ut]&&e.hasAtomics()&&(e[ut]={},e[ut].$set=e)}}),n},wt.prototype.$__setSchema=function(t){R(t.tree,this,void 0,t.options);for(var e=0,r=Object.keys(t.virtuals);e<r.length;e++){var n=r[e];t.virtuals[n]._applyDefaultGetters()}null==t.path("schema")&&(this.schema=t),this.$__schema=t,this[pt]=t},wt.prototype.$__getArrayPathsToValidate=function(){return b||(b=r(4878)),this.$__.activePaths.map("init","modify",function(t){return this.$__getValue(t)}.bind(this)).filter(function(t){return t&&Array.isArray(t)&&nt.isMongooseDocumentArray(t)&&t.length}).reduce(function(t,e){return t.concat(e)},[]).filter(function(t){return t})},wt.prototype.$getAllSubdocs=function(t){var e;if(null!=t&&t.useCache&&null!==(e=this.$__.saveOptions)&&void 0!==e&&e.__subdocs)return this.$__.saveOptions.__subdocs;b||(b=r(4878)),v=v||r(6547);var n=[];return function t(e){var r,o=[],i=p(e.$__schema.childSchemas);try{for(i.s();!(r=i.n()).done;){var s=r.value.model,a=e.$__getValue(s.path);if(null!=a){if(a.$__&&o.push(a),Array.isArray(a)){var u,c=p(a);try{for(c.s();!(u=c.n()).done;){var l=u.value;null!=l&&l.$__&&o.push(l)}}catch(t){c.e(t)}finally{c.f()}}if(a instanceof Map){var f,h=p(a.values());try{for(h.s();!(f=h.n()).done;){var y=f.value;null!=y&&y.$__&&o.push(y)}}catch(t){h.e(t)}finally{h.f()}}}}}catch(t){i.e(t)}finally{i.f()}for(var d=0,b=o;d<b.length;d++)t(b[d]);n.push.apply(n,o)}(this),this.$__.saveOptions&&(this.$__.saveOptions.__subdocs=n),n},wt.prototype.$__handleReject=function(t){this.$listeners("error").length?this.$emit("error",t):this.constructor.listeners&&this.constructor.listeners("error").length&&this.constructor.emit("error",t)},wt.prototype.$toObject=function(t,e){var r,n,o,i,s,a,u,c,f,p,h,y,b,m,v,g=this.$__schema._defaultToObjectOptions(e),_=this.$__hasOnlyPrimitiveValues();(t=nt.isPOJO(t)?l({},t):{})._calledWithOptions=t._calledWithOptions||l({},t),v=null!=t._calledWithOptions.minimize?t.minimize:null!=(null===(r=this.$__schemaTypeOptions)||void 0===r?void 0:r.minimize)?this.$__schemaTypeOptions.minimize:null!=g&&null!=g.minimize?g.minimize:this.$__schema.options.minimize,t.minimize=v,_||(t._seen=t._seen||new Map);var w=null!==(n=null!==(o=null!==(i=t._calledWithOptions.depopulate)&&void 0!==i?i:null==g?void 0:g.depopulate)&&void 0!==o?o:t.depopulate)&&void 0!==n&&n;if(w&&t._isNested&&this.$__.wasPopulated)return M(this.$__.wasPopulated.value||this._doc._id,t);if(w&&(t.depopulate=!0),null!=g)for(var O=0,S=Object.keys(g);O<S.length;O++){var $=S[O];null==t[$]&&(t[$]=g[$])}t._isNested=!0,t.json=e,t.minimize=v;var j=t._parentOptions;t._parentOptions=this.$isSubdocument?t:null;var P,A=null!==(s=null!==(a=null!==(u=t._calledWithOptions.schemaFieldsOnly)&&void 0!==u?u:t.schemaFieldsOnly)&&void 0!==a?a:g.schemaFieldsOnly)&&void 0!==s&&s;if(_&&!t.flattenObjectIds)P=this.$__toObjectShallow(A);else if(A){P={};for(var E=0,x=Object.keys(this.$__schema.paths);E<x.length;E++){var T=x[E],k=this.$__getValue(T);if(void 0!==k){var N=T,I=P;if(-1!==T.indexOf(".")){var B=T.split(".");N=B[B.length-1];for(var D=0;D<B.length-1;++D){var R;I[B[D]]=null!==(R=I[B[D]])&&void 0!==R?R:{},I=I[B[D]]}}I[N]=null!==k?M(k,t):null}}}else P=M(this._doc,t)||{};var U=null!==(c=null!==(f=null!==(p=t._calledWithOptions.getters)&&void 0!==p?p:t.getters)&&void 0!==f?f:g.getters)&&void 0!==c&&c;U&&(function(t,e){var r,n,o=t.$__schema,i=Object.keys(o.paths),s=i.length,a=t._doc;if(!a)return e;for(;s--;){var u=(r=i[s]).split("."),c=u.length,l=c-1,f=e,p=void 0;if(a=t._doc,t.$__isSelected(r))for(var h=0;h<c&&(n=a[p=u[h]],null==f||"object"===d(f));++h){if(h===l){if(f[p]=o.paths[r].applyGetters(f[p],t),Array.isArray(f[p])&&o.paths[r].$embeddedSchemaType)for(var y=0;y<f[p].length;++y)f[p][y]=o.paths[r].$embeddedSchemaType.applyGetters(f[p][y],t)}else{if(null==n){p in a&&(f[p]=n);break}f=f[p]||(f[p]={})}a=n}}}(this,P),t.minimize&&(P=X(P)||{}));var C=null!==(h=null!==(y=null!==(b=t._calledWithOptions.virtuals)&&void 0!==b?b:g.virtuals)&&void 0!==y?y:null==j?void 0:j.virtuals)&&void 0!==h?h:void 0;(C||U&&!1!==C)&&Et(this,P,t,t),!1===t.versionKey&&this.$__schema.options.versionKey&&delete P[this.$__schema.options.versionKey];var F=null===(m=t._calledWithOptions.transform)||void 0===m||m,L=void 0;if(!0===F?L=g.transform:"function"==typeof F&&(L=F),F&&function(t,e){var r=t.$__schema,n=Object.keys(r.paths||{});if(!t._doc)return e;for(var o=0,i=n;o<i.length;o++){var s,a,u,c,l,f=i[o],p=r.paths[f],h=null!==(s=p.options.transform)&&void 0!==s?s:null===(a=p.constructor)||void 0===a||null===(a=a.defaultOptions)||void 0===a?void 0:a.transform,y=null!==(u=null===(c=p.$embeddedSchemaType)||void 0===c||null===(c=c.options)||void 0===c?void 0:c.transform)&&void 0!==u?u:null===(l=p.$embeddedSchemaType)||void 0===l||null===(l=l.constructor)||void 0===l||null===(l=l.defaultOptions)||void 0===l?void 0:l.transform;if("function"==typeof h){var d=t.$get(f);if(void 0===d)continue;var b=h.call(t,d);xt(f,b),nt.setValue(f,b,e)}else if("function"==typeof y){var m=t.$get(f);if(void 0===m)continue;for(var v=[].concat(m),g=0;g<v.length;++g){var _=y.call(t,v[g]);v[g]=_,xt(f,_)}e[f]=v}}}(this,P),t.useProjection&&function(t,e){var r=t.$__schema,n=Object.keys(r.paths||{});if(!t._doc)return e;var o=t.$__.selected;if(void 0===o&&(o={},rt.applyPaths(o,r)),null==o||0===Object.keys(o).length)return e;for(var i=0,s=n;i<s.length;i++){var a=s[i];null==o[a]||o[a]||delete e[a]}}(this,P),"function"==typeof L){var V=L(this,P,t);void 0!==V&&(P=V)}return P},wt.prototype.$__toObjectShallow=function(t){var e={};if(null!=this._doc){var r,n=p(t?Object.keys(this.$__schema.paths):Object.keys(this._doc));try{for(n.s();!(r=n.n()).done;){var o=r.value,i=this._doc[o];i instanceof Date?e[o]=new Date(i):void 0!==i&&(e[o]=i)}}catch(t){n.e(t)}finally{n.f()}}return e},wt.prototype.toObject=function(t){return this.$toObject(t)},wt.prototype.toJSON=function(t){return this.$toObject(t,!0)},wt.prototype.ownerDocument=function(){return this},wt.prototype.parent=function(){return this.$isSubdocument||this.$__.wasPopulated?this.$__.parent:this},wt.prototype.$parent=wt.prototype.parent,wt.prototype.inspect=function(t){var e;nt.isPOJO(t)&&((e=t).minimize=!1);var r=arguments.length>0?this.toObject(e):this.toObject();return null==r?"MongooseDocument { "+r+" }":r},Q.custom&&(wt.prototype[Q.custom]=wt.prototype.inspect),wt.prototype.toString=function(){var t=this.inspect();return"string"==typeof t?t:Q(t)},wt.prototype.equals=function(t){if(!t)return!1;var e=this.$__getValue("_id"),r=null!=t.$__?t.$__getValue("_id"):t;return e||r?e&&e.equals?e.equals(r):e===r:it(this,t)},wt.prototype.populate=function(){var t=u(i().m(function t(){var e,r,n,o,s,a,u,c,l,f,h=arguments;return i().w(function(t){for(;;)switch(t.n){case 0:if(e={},"function"!=typeof(r=Array.prototype.slice.call(h))[r.length-1]){t.n=1;break}throw new S("Document.prototype.populate() no longer accepts a callback");case 1:if(0!==r.length){n=nt.populate.apply(null,r),o=p(n);try{for(o.s();!(s=o.n()).done;)a=s.value,e[a.path]=a}catch(t){o.e(t)}finally{o.f()}}return u=nt.object.vals(e),c=this.constructor,this.$__isNested&&(c=this.$__[bt].constructor,l=this.$__.nestedPath,u.forEach(function(t){t.path=l+"."+t.path})),null!=this.$session()&&(f=this.$session(),u.forEach(function(t){null!=t.options?"session"in t.options||(t.options.session=f):t.options={session:f}})),u.forEach(function(t){t._localModel=c}),t.a(2,c.populate(this,u))}},t,this)}));return function(){return t.apply(this,arguments)}}(),wt.prototype.$getPopulatedDocs=function(){var t=[];null!=this.$__.populated&&(t=t.concat(Object.keys(this.$__.populated)));var e,r=[],n=p(t);try{for(n.s();!(e=n.n()).done;){var o=e.value,i=this.$get(o);Array.isArray(i)?r=r.concat(i):i instanceof wt&&r.push(i)}}catch(t){n.e(t)}finally{n.f()}return r},wt.prototype.populated=function(t,e,r){if(null==e||!0===e){if(!this.$__.populated)return;if("string"!=typeof t)return;var n=t.endsWith(".$*")?t.replace(/\.\$\*$/,""):t,o=this.$__.populated[n];return o?!0===e?o:o.value:void 0}this.$__.populated||(this.$__.populated={}),this.$__.populated[t]={value:e,options:r};for(var i=t.split("."),s=0;s<i.length-1;++s){var a=i.slice(0,s+1).join("."),u=this.$get(a);if(null!=u&&null!=u.$__&&this.$populated(a)){var c=i.slice(s+1).join(".");u.$populated(c,e,r);break}}return e},wt.prototype.$populated=wt.prototype.populated,wt.prototype.$assertPopulated=function(t,e){var r=this;if(Array.isArray(t))return t.forEach(function(t){return r.$assertPopulated(t,e)}),this;if(arguments.length>1&&this.$set(e),!this.$populated(t))throw new S('Expected path "'.concat(t,'" to be populated'));return this},wt.prototype.depopulate=function(t){var e;"string"==typeof t&&(t=-1===t.indexOf(" ")?[t]:t.split(" "));var r=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],n=this.$__&&this.$__.populated||{};if(0===arguments.length){var o,i=p(r);try{for(i.s();!(o=i.n()).done;){var s=o.value;delete this.$$populatedVirtuals[s],delete this._doc[s],delete n[s]}}catch(t){i.e(t)}finally{i.f()}for(var a=0,u=Object.keys(n);a<u.length;a++){var c=u[a];if(e=this.$populated(c))if(delete n[c],Array.isArray(e)){var l=nt.getValue(c,this._doc);if(l.isMongooseArray)for(var f=l.__array,h=0;h<f.length;++h){var y=f[h];null!=y&&(f[h]=y instanceof wt?y._doc._id:y._id)}else nt.setValue(c,e,this._doc)}else nt.setValue(c,e,this._doc)}return this}var d,b=p(t);try{for(b.s();!(d=b.n()).done;){var m=d.value;if(e=this.$populated(m),delete n[m],-1!==r.indexOf(m))delete this.$$populatedVirtuals[m],delete this._doc[m];else if(e)if(Array.isArray(e)){var v=nt.getValue(m,this._doc);if(v.isMongooseArray)for(var g=v.__array,_=0;_<g.length;++_){var w=g[_];null!=w&&(g[_]=w instanceof wt?w._doc._id:w._id)}else nt.setValue(m,e,this._doc)}else nt.setValue(m,e,this._doc)}}catch(t){b.e(t)}finally{b.f()}return this},wt.prototype.$__fullPath=function(t){return t||""},wt.prototype.getChanges=function(){var t=this.$__delta();return t?t[1]:{}},wt.prototype.$__delta=function(){var t=this,e=this.$__dirty(),r=this.$__schema.options.optimisticConcurrency;if(r)if(Array.isArray(r)){var o=new Set(r);this.modifiedPaths().find(function(t){return o.has(t)})&&(this.$__.version=e.length?3:1)}else this.$__.version=e.length?3:1;if(e.length||3===this.$__.version){var i={},s={},a=e.length,u=[],c=0;for(i._id=this._doc._id,null!=(i&&i._id&&i._id.$__||null)&&(i._id=i._id.toObject({transform:!1,depopulate:!0}));c<a;++c){var l=e[c],f=l.value,p=Tt(this,l.path,f);if(p)u.push(p);else{if(!this.$populated(l.path,!0)&&this.$__.selected){var h=l.path.split("."),y=h[0];if(this.$__.selected[y]&&this.$__.selected[y].$elemMatch){if(!(h.length>1&&0==h[1]&&void 0===i[y])){u.push(l.path);continue}i[y]=this.$__.selected[y],h[1]="$",l.path=h.join(".")}}if(this.$isDefault(l.path)&&this.$__.selected){if(-1===l.path.indexOf(".")&&G(this.$__.selected,l.path))continue;if(et(l.path).find(function(e){return G(t.$__.isSelected,e)}))continue}if(!u.length)if(void 0===f)kt(this,0,s,l,1,"$unset");else if(null===f)kt(this,0,s,l,null);else if(nt.isMongooseArray(f)&&f.$path()&&f[ut])Nt(this,0,s,l,f);else if(f[O.pathSymbol]&&n.isBuffer(f))kt(this,0,s,l,f=f.toObject());else if(this.$__.primitiveAtomics&&null!=this.$__.primitiveAtomics[l.path]){var d=this.$__.primitiveAtomics[l.path],b=C(d);kt(this,0,s,l,d[b],b)}else kt(this,0,s,l,f=M(f,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}))}}return u.length?new g(u):(this.$__.version&&this.$__version(i,s),0===Object.keys(s).length?[i,null]:[i,s])}},wt.prototype.$clone=function(){var t=new(0,this.constructor);if(t.$isNew=this.$isNew,this._doc&&(t._doc=M(this._doc,{retainDocuments:!0})),this.$__){var e,r=new(0,this.$__.constructor),n=p(Object.getOwnPropertyNames(this.$__));try{for(n.s();!(e=n.n()).done;){var o=e.value;"activePaths"!==o&&(r[o]=M(this.$__[o]))}}catch(t){n.e(t)}finally{n.f()}Object.assign(r.activePaths,M(l({},this.$__.activePaths))),t.$__=r}return t},wt.prototype.$createModifiedPathsSnapshot=function(){var t=new WeakMap;if(!this.$isSubdocument){var e,r=p(this.$getAllSubdocs());try{for(r.s();!(e=r.n()).done;){var n=e.value;t.set(n,n.$__.activePaths.clone())}}catch(t){r.e(t)}finally{r.f()}}return new j(t,this.$__.activePaths.clone(),this.$__.version)},wt.prototype.$restoreModifiedPathsSnapshot=function(t){if(this.$__.activePaths=t.activePaths.clone(),this.$__.version=t.version,!this.$isSubdocument){var e,r=p(this.$getAllSubdocs());try{for(r.s();!(e=r.n()).done;){var n=e.value;t.subdocSnapshot.has(n)&&(n.$__.activePaths=t.subdocSnapshot.get(n))}}catch(t){r.e(t)}finally{r.f()}}return this},wt.prototype.$clearModifiedPaths=function(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){var t,e=p(this.$getAllSubdocs());try{for(e.s();!(t=e.n()).done;)t.value.$clearModifiedPaths()}catch(t){e.e(t)}finally{e.f()}}return this},wt.prototype.$__hasOnlyPrimitiveValues=function(){return!this.$__.populated&&!this.$__.wasPopulated&&(null==this._doc||Object.values(this._doc).every(function(t){return null==t||"object"!==d(t)||nt.isNativeObject(t)&&!Array.isArray(t)||K(t,"ObjectId")||K(t,"Decimal128")}))},wt.VERSION_WHERE=1,wt.VERSION_INC=2,wt.VERSION_ALL=3,wt.ValidationError=k,t.exports=wt},2401:t=>{"use strict";t.exports=Math.floor},2402:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(t)}var i,s,a=r(3743).codes,u=a.ERR_AMBIGUOUS_ARGUMENT,c=a.ERR_INVALID_ARG_TYPE,l=a.ERR_INVALID_ARG_VALUE,f=a.ERR_INVALID_RETURN_VALUE,p=a.ERR_MISSING_ARGS,h=r(9068),y=r(7352).inspect,d=r(7352).types,b=d.isPromise,m=d.isRegExp,v=Object.assign?Object.assign:r(6182).assign,g=Object.is?Object.is:r(2064);function _(){var t=r(6193);i=t.isDeepEqual,s=t.isDeepStrictEqual}new Map;var w=!1,O=t.exports=P,S={};function $(t){if(t.message instanceof Error)throw t.message;throw new h(t)}function j(t,e,r,n){if(!r){var o=!1;if(0===e)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new h({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw i.generatedMessage=o,i}}function P(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j.apply(void 0,[P,e.length].concat(e))}O.fail=function t(e,r,n,o,i){var s,a=arguments.length;if(0===a?s="Failed":1===a?(n=e,e=void 0):(!1===w&&(w=!0,({env:{}}.emitWarning?{env:{}}.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===a&&(o="!=")),n instanceof Error)throw n;var u={actual:e,expected:r,operator:void 0===o?"fail":o,stackStartFn:i||t};void 0!==n&&(u.message=n);var c=new h(u);throw s&&(c.message=s,c.generatedMessage=!0),c},O.AssertionError=h,O.ok=P,O.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&$({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},O.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&$({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},O.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),i(e,r)||$({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},O.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),i(e,r)&&$({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},O.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),s(e,r)||$({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},O.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),s(e,r)&&$({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},O.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");g(e,r)||$({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},O.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");g(e,r)&&$({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var A=function t(e,r,n){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach(function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&m(e[t])&&e[t].test(n[t])?o[t]=n[t]:o[t]=e[t])})};function E(t,e,r,n){if("function"!=typeof e){if(m(e))return e.test(t);if(2===arguments.length)throw new c("expected",["Function","RegExp"],e);if("object"!==o(t)||null===t){var a=new h({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw a.operator=n.name,a}var u=Object.keys(e);if(e instanceof Error)u.push("name","message");else if(0===u.length)throw new l("error",e,"may not be an empty object");return void 0===i&&_(),u.forEach(function(o){"string"==typeof t[o]&&m(e[o])&&e[o].test(t[o])||function(t,e,r,n,o,i){if(!(r in t)||!s(t[r],e[r])){if(!n){var a=new A(t,o),u=new A(e,o,t),c=new h({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:i});throw c.actual=t,c.expected=e,c.operator=i.name,c}$({actual:t,expected:e,message:n,operator:i.name,stackStartFn:i})}}(t,e,o,r,u,n)}),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function x(t){if("function"!=typeof t)throw new c("fn","Function",t);try{t()}catch(t){return t}return S}function T(t){return b(t)||null!==t&&"object"===o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function k(t){return Promise.resolve().then(function(){var e;if("function"==typeof t){if(!T(e=t()))throw new f("instance of Promise","promiseFn",e)}else{if(!T(t))throw new c("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then(function(){return e}).then(function(){return S}).catch(function(t){return t})})}function N(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new c("error",["Object","Error","Function","RegExp"],r);if("object"===o(e)&&null!==e){if(e.message===r)throw new u("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new u("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new c("error",["Object","Error","Function","RegExp"],r);if(e===S){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===t.name?"rejection":"exception";$({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:t})}if(r&&!E(e,r,n,t))throw e}function I(t,e,r,n){if(e!==S){if("string"==typeof r&&(n=r,r=void 0),!r||E(e,r)){var o=n?": ".concat(n):".",i="doesNotReject"===t.name?"rejection":"exception";$({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function B(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j.apply(void 0,[B,e.length].concat(e))}O.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];N.apply(void 0,[t,x(e)].concat(n))},O.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return k(e).then(function(e){return N.apply(void 0,[t,e].concat(n))})},O.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];I.apply(void 0,[t,x(e)].concat(n))},O.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return k(e).then(function(e){return I.apply(void 0,[t,e].concat(n))})},O.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===o(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=y(e);var n=new h({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),i=e.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),u=0;u<s.length;u++){var c=a.indexOf(s[u]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},O.strict=v(B,O,{equal:O.strictEqual,deepEqual:O.deepStrictEqual,notEqual:O.notStrictEqual,notDeepEqual:O.notDeepStrictEqual}),O.strict.strict=O.strict},2403:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},2423:t=>{"use strict";t.exports=function(t,e){var r=t.discriminatorMapping&&t.discriminatorMapping.value;if(r&&!("sparse"in e)){var n=t.options.discriminatorKey;e.partialFilterExpression=e.partialFilterExpression||{},e.partialFilterExpression[n]=r}return e}},2477:(t,e,r)=>{"use strict";var n=r(2402);t.exports=function(t){return null==t||""===t?null:t instanceof Date?(n.ok(!isNaN(t.valueOf())),t):(n.ok("boolean"!=typeof t),e=t instanceof Number||"number"==typeof t?new Date(t):"string"==typeof t&&!isNaN(Number(t))&&(Number(t)>=275761||Number(t)<-271820)?new Date(Number(t)):"function"==typeof t.valueOf?new Date(t.valueOf()):new Date(t),isNaN(e.valueOf())?void n.ok(!1):e);var e}},2481:(t,e,r)=>{"use strict";var n=r(4756);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2486:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=256*i+t[e+f],f+=p,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=c}return(h?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[r+h]=255&a,h+=y,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+h]=255&s,h+=y,s/=256,c-=8);t[r+h-y]|=128*d}},2497:(t,e,r)=>{"use strict";var n=r(1243).isMongooseArray;t.exports=function(t){return null!=t&&(n(t)||null!=t.$__||t.isMongooseBuffer||t.$isMongooseMap)}},2555:t=>{"use strict";t.exports=function(t){if(Array.isArray(t)){if(!t.every(function(t){return"number"==typeof t||"string"==typeof t}))throw new Error("$type array values must be strings or numbers");return t}if("number"!=typeof t&&"string"!=typeof t)throw new Error("$type parameter must be number, string, or array of numbers and strings");return t}},2580:(t,e,r)=>{"use strict";var n=r(2400),o=r(3550).EventEmitter,i=r(3672),s=r(7058),a=r(5549),u=i.ValidationError,c=r(4957),l=r(608);function f(t,e,r,o,u){if(!(this instanceof f))return new f(t,e,r,o,u);if(l(e)&&!e.instanceOfSchema&&(e=new s(e)),e=this.schema||e,!this.schema&&e.options._id&&void 0===(t=t||{})._id&&(t._id=new a),!e)throw new i.MissingSchemaError;for(var p in this.$__setSchema(e),n.call(this,t,r,o,u),c(this,e,{decorateDoc:!0}),e.methods)this[p]=e.methods[p];for(var h in e.statics)this[h]=e.statics[h]}f.prototype=Object.create(n.prototype),f.prototype.constructor=f,f.events=new o,f.$emitter=new o,["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"].forEach(function(t){f[t]=function(){return f.$emitter[t].apply(f.$emitter,arguments)}}),f.ValidationError=u,t.exports=f},2653:t=>{"use strict";t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},2692:t=>{"use strict";t.exports=function(t,e){if(1!==e.length){for(var r=e[0],n=void 0,o=0;o<e.length-1;++o){var i=t.path(r);i&&i.schema?(n=i.schema.options.strict,t=i.schema,r=i.$isMongooseDocumentArray&&!isNaN(e[o+1])?"":e[o+1]):r+=r.length?"."+e[o+1]:e[o+1]}return n}}},2696:(t,e,r)=>{"use strict";var n=r(3305);t.exports=function(t,e){return"string"==typeof t&&"string"==typeof e||"number"==typeof t&&"number"==typeof e?t===e:!(!n(t,"ObjectId")||!n(e,"ObjectId"))&&t.toString()===e.toString()}},2724:(t,e,r)=>{"use strict";var n=r(3071),o=r(9344),i=n("RegExp.prototype.exec"),s=r(2268);t.exports=function(t){if(!o(t))throw new s("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},2746:t=>{"use strict";var e="function"==typeof{env:{}}.nextTick?{env:{}}.nextTick.bind({env:{}}):function(t){return setTimeout(t,0)};t.exports=function(t){return e(t)}},2789:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){if(null==t||"object"!==e(t))return!1;var r=Object.getPrototypeOf(t);return!r||"Object"===r.constructor.name}},2793:t=>{"use strict";t.exports=new Set(["__proto__","constructor","prototype"])},2822:(t,e,r)=>{"use strict";t.exports=r(6353).Double},2824:(t,e,r)=>{"use strict";var n=r(7930).objectIdSymbol,o=r(8768);function i(){var t,e;if(this.$__.shardval){e=(t=Object.keys(this.$__.shardval)).length,this.$where=this.$where||{};for(var r=0;r<e;++r)this.$where[t[r]]=this.$__.shardval[t[r]]}}function s(){var t=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(o.isPOJO(t))for(var e,r=this.$__.shardval={},i=Object.keys(t),s=i.length,a=0;a<s;++a)null==(e=this.$__getValue(i[a]))?r[i[a]]=e:o.isMongooseObject(e)?r[i[a]]=e.toObject({depopulate:!0,_isNested:!0}):e instanceof Date||e[n]?r[i[a]]=e:"function"==typeof e.valueOf?r[i[a]]=e.valueOf():r[i[a]]=e}t.exports=function(t){t.post("init",function(){return s.call(this),this}),t.pre("save",function(t){i.call(this),t()}),t.pre("remove",function(t){i.call(this),t()}),t.post("save",function(){s.call(this)})},t.exports.storeShard=s},2900:(t,e,r)=>{"use strict";var n=r(8260);t.exports=function(t){if("TopologyDescription"!==n(t))return!1;var e=Array.from(t.servers.values());return e.length>0&&e.every(function(t){return"Unknown"===t.type})}},2914:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(7860),i=["__proto__","constructor","prototype"];function s(t,e,r,n,o,i){for(var a,u=0;u<t.length&&u<e.length;++u)a=t[u],Array.isArray(a)&&Array.isArray(e[u])?s(a,e[u],r,n,o,i):a&&(n?n(a,r,i(e[u])):(a[o]&&(a=a[o]),a[r]=i(e[u])))}function a(t){return t}e.get=function(t,r,i,s){var u;"function"==typeof i&&(i.length<2?(s=i,i=void 0):(u=i,i=void 0)),s||(s=a);var c="string"==typeof t?o(t):t;if(!Array.isArray(c))throw new TypeError("Invalid `path`. Must be either string or array");for(var l,f=r,p=0;p<c.length;++p){if(l=c[p],"string"!=typeof c[p]&&"number"!=typeof c[p])throw new TypeError("Each segment of path to `get()` must be a string or number, got "+n(c[p]));if(Array.isArray(f)&&!/^\d+$/.test(l)){var h=c.slice(p);return[].concat(f).map(function(t){return t?e.get(h,t,i||u,s):s(void 0)})}if(u)f=u(f,l);else{var y=i&&f[i]?f[i]:f;f=y instanceof Map?y.get(l):y[l]}if(!f)return s(f)}return s(f)},e.has=function(t,e){var r="string"==typeof t?o(t):t;if(!Array.isArray(r))throw new TypeError("Invalid `path`. Must be either string or array");for(var i=r.length,s=e,a=0;a<i;++a){if("string"!=typeof r[a]&&"number"!=typeof r[a])throw new TypeError("Each segment of path to `has()` must be a string or number, got "+n(r[a]));if(null==s||"object"!==n(s)||!(r[a]in s))return!1;s=s[r[a]]}return!0},e.unset=function(t,e){var r="string"==typeof t?o(t):t;if(!Array.isArray(r))throw new TypeError("Invalid `path`. Must be either string or array");for(var s=r.length,a=e,u=0;u<s;++u){if(null==a||"object"!==n(a)||!(r[u]in a))return!1;if("string"!=typeof r[u]&&"number"!=typeof r[u])throw new TypeError("Each segment of path to `unset()` must be a string or number, got "+n(r[u]));if(-1!==i.indexOf(r[u]))return!1;if(u===s-1)return delete a[r[u]],!0;a=a instanceof Map?a.get(r[u]):a[r[u]]}return!0},e.set=function(t,r,u,c,l,f){var p;"function"==typeof c&&(c.length<2?(l=c,c=void 0):(p=c,c=void 0)),l||(l=a);var h="string"==typeof t?o(t):t;if(!Array.isArray(h))throw new TypeError("Invalid `path`. Must be either string or array");if(null!=u){for(var y=0;y<h.length;++y){if("string"!=typeof h[y]&&"number"!=typeof h[y])throw new TypeError("Each segment of path to `set()` must be a string or number, got "+n(h[y]));if(-1!==i.indexOf(h[y]))return}for(var d,b=f||/\$/.test(t)&&!1!==f,m=u,v=(y=0,h.length-1);y<v;++y)if("$"!=(d=h[y])){if(Array.isArray(m)&&!/^\d+$/.test(d)){var g=h.slice(y);if(!b&&Array.isArray(r))for(var _=0;_<m.length&&_<r.length;++_)e.set(g,r[_],m[_],c||p,l,b);else for(_=0;_<m.length;++_)e.set(g,r,m[_],c||p,l,b);return}if(p)m=p(m,d);else{var w=c&&m[c]?m[c]:m;m=w instanceof Map?w.get(d):w[d]}if(!m)return}else if(y==v-1)break;if(d=h[v],c&&m[c]&&(m=m[c]),Array.isArray(m)&&!/^\d+$/.test(d))if(!b&&Array.isArray(r))s(m,r,d,p,c,l);else for(_=0;_<m.length;++_){var O=m[_];O&&(p?p(O,d,l(r)):(O[c]&&(O=O[c]),O[d]=l(r)))}else p?p(m,d,l(r)):m instanceof Map?m.set(d,l(r)):m[d]=l(r)}},e.stringToParts=o},2945:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"subtype",u),t.exports=a},3071:(t,e,r)=>{"use strict";var n=r(6400),o=r(8863),i=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o([r]):r}},3091:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a,u=r(4625),c=r(6426),l=r(863),f=r(4327),p=r(8260),h=r(5549),y=r(3305),d=r(8768),b=c.CastError;function m(t,e){var r="string"==typeof t&&24===t.length&&/^[a-f0-9]+$/i.test(t),n=e&&e.suppressWarning;!r&&void 0!==t||n||d.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."),c.call(this,t,e,"ObjectId")}function v(t){return this.cast(t)}m.schemaName="ObjectId",m.defaultOptions={},m.prototype=Object.create(c.prototype),m.prototype.constructor=m,m.prototype.OptionsConstructor=u,m.get=c.get,m.set=c.set,m.setters=[],m.prototype.auto=function(t){return t&&(this.default(_),this.set(w)),this},m._checkRequired=function(t){return y(t,"ObjectId")},m._cast=l,m.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},m._defaultCaster=function(t){if(!y(t,"ObjectId"))throw new Error(t+" is not an instance of ObjectId");return t},m.checkRequired=c.checkRequired,m.prototype.checkRequired=function(t,e){return c._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():m.checkRequired())(t)},m.prototype.cast=function(t,e,r,n,o){if(!y(t,"ObjectId")&&c._isRef(this,t,e,r)){if("objectid"===(p(t)||"").toLowerCase())return new h(t.toHexString());if(null==t||d.isNonBuiltinObject(t))return this._castRef(t,e,r,o)}var i;i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():m.cast();try{return i(t)}catch(e){throw new b("ObjectId",t,this.path,e,this)}};var g=i(i({},c.prototype.$conditionalHandlers),{},{$gt:v,$gte:v,$lt:v,$lte:v});function _(){return new h}function w(t){return a||(a=r(2400)),this instanceof a&&void 0===t?new h:t}Object.defineProperty(m.prototype,"$conditionalHandlers",{enumerable:!1,value:g}),_.$runBeforeSetters=!0,m.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required||"_id"===this.path;return f("string","objectId",null==t?void 0:t.useBsonType,e)},m.prototype.autoEncryptionType=function(){return"objectId"},t.exports=m},3123:t=>{"use strict";t.exports=Function.prototype.call},3191:(t,e,r)=>{"use strict";var n=r(988),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3216:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var a=r(8768),u=new Set(["__index","__parentArray","_doc"]);t.exports=function(t,e){if(a.isPOJO(t)&&null!=t.$__&&null!=t._doc){if(e){for(var r={},n=0,i=Object.keys(t);n<i.length;n++){var c=i[n];"symbol"!==s(c)&&"$"!==c[0]&&(u.has(c)||(r[c]=t[c]))}return o(o({},t._doc),r)}return t._doc}return t}},3279:t=>{"use strict";t.exports=Function.prototype.apply},3303:(t,e)=>{"use strict";e._={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1,versionKey:!0,flattenObjectIds:!1}},3305:t=>{"use strict";t.exports=function(t,e){return null!=t&&t._bsontype===e}},3318:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(3609),u=r(6426),c=r(4058),l=r(4327);function f(t,e){u.call(this,t,e,"BigInt")}f.schemaName="BigInt",f.defaultOptions={},f.prototype=Object.create(u.prototype),f.prototype.constructor=f,f._cast=c,f.set=u.set,f.setters=[],f.get=u.get,f.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},f._checkRequired=function(t){return null!=t},f.checkRequired=u.checkRequired,f.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},f.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():f.cast();try{return e(t)}catch(e){throw new a("BigInt",t,this.path,e,this)}};var p=i(i({},u.prototype.$conditionalHandlers),{},{$gt:h,$gte:h,$lt:h,$lte:h});function h(t,e){return this.castForQuery(null,t,e)}Object.defineProperty(f.prototype,"$conditionalHandlers",{enumerable:!1,value:p}),f.prototype.castForQuery=function(t,e,r){var n;if(null!=t)return(n=this.$conditionalHandlers[t])?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(t){throw t instanceof a&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},f.prototype._castNullish=function(t){return void 0===t||("function"==typeof this.constructor.cast?this.constructor.cast():f.cast()),t},f.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return l("string","long",null==t?void 0:t.useBsonType,e)},f.prototype.autoEncryptionType=function(){return"long"},t.exports=f},3381:t=>{"use strict";function e(){return null!=this._id?this._id.toString():null}t.exports=function(t){return!t.paths.id&&t.paths._id&&t.options.id?(t.aliases&&t.aliases.id||t.virtual("id").get(e),t):t}},3388:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},3414:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},3426:(t,e,r)=>{"use strict";var n=r(2653),o="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof o[n[e]]&&(t[t.length]=n[e]);return t}},3441:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t,r){var s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=Array.isArray(r)?"array":"primitive value";return(s=function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,["Tried to set nested object field `"+t+"` to ".concat(a," `")+r+"`"])).path=t,s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"ObjectExpectedError"}),t.exports=a},3550:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r,n="object"===("undefined"==typeof Reflect?"undefined":e(Reflect))?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise(function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}b(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&b(t,"error",e,{once:!0})}(t,o)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+e(t))}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var o,i,s,a;if(u(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),s=i[e]),void 0===s)s=i[e]=r,++t._eventsCount;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(t))>0&&s.length>o&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=f.bind(n);return o.listener=r,n.wrapFn=o,o}function h(t,e,r){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):d(o,o.length)}function y(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function b(t,r,n,o){if("function"==typeof t.on)o.once?t.once(r,n):t.on(r,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+e(t));t.addEventListener(r,function e(i){o.once&&t.removeEventListener(r,e),n(i)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=d(u,c);for(r=0;r<c;++r)o(l[r],this,e)}return!0},s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return u(e),this.on(t,p(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,p(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,o,i,s;if(u(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return h(this,t,!0)},s.prototype.rawListeners=function(t){return h(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},s.prototype.listenerCount=y,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},3609:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function s(t,e,r){return e=c(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return a(t)}(t,u()?Reflect.construct(e,r||[],c(t).constructor):e.apply(t,r))}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(u=function(){return!!t})()}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}var f=r(8213),p=r(7352),h=function(t){function e(t,r,n,o,i){var u;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),arguments.length>0){var c=d(r);(u=s(this,e,[m(null,t,r,n,b(i),c,o)])).init(t,r,n,o,i)}else u=s(this,e,[m()]);return a(u)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(e,t),r=e,(n=[{key:"toJSON",value:function(){return{stringValue:this.stringValue,valueType:this.valueType,kind:this.kind,value:this.value,path:this.path,reason:this.reason,name:this.name,message:this.message}}},{key:"init",value:function(t,e,r,n,o){this.stringValue=y(e),this.messageFormat=b(o),this.kind=t,this.value=e,this.path=r,this.reason=n,this.valueType=d(e)}},{key:"copy",value:function(t){this.messageFormat=t.messageFormat,this.stringValue=t.stringValue,this.kind=t.kind,this.value=t.value,this.path=t.path,this.reason=t.reason,this.message=t.message,this.valueType=t.valueType}},{key:"setModel",value:function(t){this.message=m(t,this.kind,this.value,this.path,this.messageFormat,this.valueType)}}])&&o(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(f);function y(t){var e=p.inspect(t);return(e=e.replace(/^'|'$/g,'"')).startsWith('"')||(e='"'+e+'"'),e}function d(t){if(null==t)return""+t;var e=n(t);return"object"!==e||"function"!=typeof t.constructor?e:t.constructor.name}function b(t){var e=t&&t._castErrorMessage||null;if("string"==typeof e||"function"==typeof e)return e}function m(t,e,r,n,o,i,s){if("string"==typeof o){var a=y(r),u=o.replace("{KIND}",e).replace("{VALUE}",a).replace("{PATH}",n);return null!=t&&(u=u.replace("{MODEL}",t.modelName)),u}if("function"==typeof o)return o(r,n,t,e);var c="Cast to "+e+" failed for value "+y(r)+(i?" (type "+i+")":"")+' at path "'+n+'"';return null!=t&&(c+=' for model "'+t.modelName+'"'),null!=s&&"function"==typeof s.constructor&&"AssertionError"!==s.constructor.name&&"Error"!==s.constructor.name&&(c+=' because of "'+s.constructor.name+'"'),c}Object.defineProperty(h.prototype,"name",{value:"CastError"}),t.exports=h},3622:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t,r,n){if(null==t)return t;if(null!=t._doc&&(t=t._doc),arguments.length>=3){if("object"!==e(t))return;if(void 0===n)return;return t instanceof Map?t.set(r,n):t[r]=n,n}return"$*"===r?t instanceof Map?Array.from(t.values()):Object.keys(t).map(function(e){return t[e]}):t instanceof Map?t.get(r):t[r]}},3644:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,["Cannot overwrite `"+t+"` model once compiled."])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"OverwriteModelError"}),t.exports=a},3660:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var a=r(3672),u=r(1007),c=r(6426),l=r(7768),f=r(4327),p=r(9460),h=r(8768),y=c.CastError;function d(t,e){c.call(this,t,e,"Number")}function b(t){return this.cast(t)}d.get=c.get,d.set=c.set,d.setters=[],d._cast=l,d.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},d._defaultCaster=function(t){if("number"!=typeof t)throw new Error;return t},d.schemaName="Number",d.defaultOptions={},d.prototype=Object.create(c.prototype),d.prototype.constructor=d,d.prototype.OptionsConstructor=u,d._checkRequired=function(t){return"number"==typeof t||t instanceof Number},d.checkRequired=c.checkRequired,d.prototype.checkRequired=function(t,e){return"object"===s(t)&&c._isRef(this,t,e,!0)?null!=t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():d.checkRequired())(t)},d.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.minValidator},this)),null!=t){var r=e||a.messages.Number.min;r=r.replace(/{MIN}/,t),this.validators.push({validator:this.minValidator=function(e){return null==e||e>=t},message:r,type:"min",min:t})}return this},d.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.maxValidator},this)),null!=t){var r=e||a.messages.Number.max;r=r.replace(/{MAX}/,t),this.validators.push({validator:this.maxValidator=function(e){return null==e||e<=t},message:r,type:"max",max:t})}return this},d.prototype.enum=function(t,e){return this.enumValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.enumValidator},this)),Array.isArray(t)||(h.isPOJO(t)&&null!=t.values?(e=t.message,t=t.values):"number"==typeof t&&(t=Array.prototype.slice.call(arguments),e=null),h.isPOJO(t)&&(t=Object.values(t)),e=e||a.messages.Number.enum),e=null==e?a.messages.Number.enum:e,this.enumValidator=function(e){return null==e||-1!==t.indexOf(e)},this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:t}),this},d.prototype.cast=function(t,e,r,n,o){if("number"!=typeof t&&c._isRef(this,t,e,r)&&(null==t||h.isNonBuiltinObject(t)))return this._castRef(t,e,r,o);var i,s=t&&void 0!==t._id?t._id:t;i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():d.cast();try{return i(s)}catch(t){throw new y("Number",s,this.path,t,this)}};var m=o(o({},c.prototype.$conditionalHandlers),{},{$bitsAllClear:p,$bitsAnyClear:p,$bitsAllSet:p,$bitsAnySet:p,$gt:b,$gte:b,$lt:b,$lte:b,$mod:function(t){var e=this;return Array.isArray(t)?t.map(function(t){return e.cast(t)}):[this.cast(t)]}});Object.defineProperty(d.prototype,"$conditionalHandlers",{enumerable:!1,value:m}),d.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw new y("number",e,this.path,null,this);return n.call(this,e,r)}try{e=this.applySetters(e,r)}catch(t){throw t instanceof y&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}return e},d.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required||"_id"===this.path;return f("number","number",null==t?void 0:t.useBsonType,e)},t.exports=d},3672:(t,e,r)=>{"use strict";var n=r(8213);t.exports=n,n.messages=r(766),n.Messages=n.messages,n.CastError=r(3609),n.DocumentNotFoundError=r(1129),n.ValidationError=r(6949),n.ValidatorError=r(9538),n.VersionError=r(6996),n.ParallelSaveError=r(3940),n.OverwriteModelError=r(3644),n.MissingSchemaError=r(8063),n.MongooseBulkSaveIncompleteError=r(8517),n.MongooseServerSelectionError=r(7219),n.DivergentArrayError=r(1417),n.StrictModeError=r(8995),n.StrictPopulateError=r(6801)},3696:t=>{"use strict";t.exports=function(t,e){return null==t?null:"boolean"==typeof t?e:"boolean"==typeof t[e]?t[e]?e:null:e in t?t[e]:e}},3703:t=>{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function r(t,e){return null==t?t:t instanceof Map?t.get(e):t[e]}t.exports=function(t,n,o){var i,s=!1;if("string"==typeof n){if(-1===n.indexOf(".")){var a=r(t,n);return null==a?o:a}i=n.split(".")}else if(s=!0,1===(i=n).length){var u=r(t,i[0]);return null==u?o:u}var c,l=n,f=t,p=function(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}(i);try{for(p.s();!(c=p.n()).done;){var h=c.value;if(null==f)return o;if(!s&&null!=f[l])return f[l];f=r(f,h),s||(l=l.substr(h.length+1))}}catch(t){p.e(t)}finally{p.f()}return null==f?o:f}},3704:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(2402),i=r(6353),s=r(3305);t.exports=function(t){if(null==t||""===t)return null;var e;if(s(t,"Long"))e=t.toNumber();else if("string"==typeof t)try{return i.Double.fromString(t)}catch(t){o.ok(!1)}else if("object"===n(t)){var r,a=null!==(r=t.valueOf())&&void 0!==r?r:t.toString();if("string"==typeof a)try{return i.Double.fromString(t)}catch(t){o.ok(!1)}else e=Number(a)}else e=Number(t);return new i.Double(e)}},3731:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"min",u),Object.defineProperty(a.prototype,"max",u),Object.defineProperty(a.prototype,"expires",u),t.exports=a},3743:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}var a,u,c={};function l(t,e,r){r||(r=Error);var n=function(r){function n(r,s,a){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),u=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i(n).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,s,a))),u.code=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(n,r),n}(r);c[t]=n}function f(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(t,e,n){var i,s,u,c,l;if(void 0===a&&(a=r(2402)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(0,4)===s)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))u="The ".concat(t," ").concat(i," ").concat(f(e,"type"));else{var p=("number"!=typeof l&&(l=0),l+1>(c=t).length||-1===c.indexOf(".",l)?"argument":"property");u='The "'.concat(t,'" ').concat(p," ").concat(i," ").concat(f(e,"type"))}return u+". Received type ".concat(o(n))},TypeError),l("ERR_INVALID_ARG_VALUE",function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(7352));var o=u.inspect(e);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(o)},TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",function(t,e,r){var n;return n=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(o(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(n,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===a&&(a=r(2402)),a(e.length>0,"At least one arg needs to be specified");var o="The ",i=e.length;switch(e=e.map(function(t){return'"'.concat(t,'"')}),i){case 1:o+="".concat(e[0]," argument");break;case 2:o+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:o+=e.slice(0,i-1).join(", "),o+=", and ".concat(e[i-1]," arguments")}return"".concat(o," must be specified")},TypeError),t.exports.codes=c},3777:(t,e,r)=>{"use strict";var n=r(9809),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=r),a=t,"[object Array]"===o.call(a)?function(t,e,r){for(var n=0,o=t.length;n<o;n++)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s):"string"==typeof t?function(t,e,r){for(var n=0,o=t.length;n<o;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,s):function(t,e,r){for(var n in t)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s)}},3892:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){u(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function u(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c=r(6948),l=r(3916),f=r(3703),p=r(1058),h=r(7300),y=r(4450),d=r(6665);e.preparePopulationOptionsMQ=function(t,e){var r,n=t._mongooseOptions.populate,o=Object.keys(n).reduce(function(t,e){return t.concat([n[e]])},[]);null!=e.lean&&o.filter(function(t){return null==(t&&t.options&&t.options.lean)}).forEach((r=e.lean,function(t){t.options||(t.options={}),null!=r&&Array.isArray(r.virtuals)&&((r=Object.assign({},r)).virtuals=r.virtuals.filter(function(e){return"string"==typeof e&&e.startsWith(t.path+".")}).map(function(e){return e.slice(t.path.length+1)})),t.options.lean=r}));var i=t&&t.options&&t.options.session||null;null!=i&&o.forEach(function(t){null!=t.options?"session"in t.options||(t.options.session=i):t.options={session:i}});for(var s=t._fieldsForExec(),u=0;u<o.length;++u)o[u]instanceof c?o[u]=new c(a(a({},o[u]),{},{_queryProjection:s,_localModel:t.model})):(o[u]._queryProjection=s,o[u]._localModel=t.model);return o},e.createModel=function(t,r,n,o,i){t.hooks.execPreSync("createModel",r);var s=t.schema?t.schema.discriminatorMapping:null,a=s&&s.isRoot?s.key:null,u=r[a];if(a&&u&&t.discriminators){var c=t.discriminators[u]||p(t.discriminators,u);if(c){var l=y(o);return e.applyPaths(l,c.schema),new c(void 0,l,!0)}}var f={skipId:!0,isNew:!1,willInit:!0};return null!=i&&"defaults"in i&&(f.defaults=i.defaults),new t(void 0,n,f)},e.createModelAndInit=function(t,r,n,o,i,s,a){var u=s?{populated:s}:void 0,c=e.createModel(t,r,n,o,i);try{c.$init(r,u,a)}catch(t){a(t,c)}},e.applyPaths=function(t,e,r){var i,s,a=new Set;if(t){s=Object.keys(t);for(var u=[],c=0;c<s.length;++c){var p=s[c];"-"===s[c][0]&&(delete t[p],"-_id"===p?t._id=0:u.push(p.slice(1)))}s=Object.keys(t);for(var y=0;y<s.length;++y)if("+"!==s[y][0]){var b=t[s[y]];if(h(b)&&!("_id"===s[y]&&s.length>1)&&(!(s[y]===e.options.discriminatorKey&&s.length>1&&null!=b)||b)){i=!b;break}}for(var m=0,v=u;m<v.length;m++){var g=v[m],_=e.path(g);_&&_.selected&&!1===i?_&&_.selected&&!1===i&&a.add(g):(t[g]=0,i=!0)}}var w=[],O=[],S=[];switch(function e(r,n){if(n||(n=""),-1!==S.indexOf(r))return[];S.push(r);var o=[];return r.eachPath(function(r,s){if(n&&(r=n+"."+r),s.$isSchemaMap||r.endsWith(".$*")){var a=t&&"+"+r in t;s.options&&!1===s.options.select&&!a&&O.push(r)}else{var u=M(r,s);if(null!=u||Array.isArray(s)||!s.$isMongooseArray||s.$isMongooseDocumentArray||(u=M(r,s.caster)),null!=u&&o.push(u),s.schema){var c=e(s.schema,r);!1===i&&l(t,r,s.schema,w,c)}}}),S.pop(),o}(e),i){case!0:var $,j=o(O);try{for(j.s();!($=j.n()).done;){var P=$.value;t[P]=0}}catch(t){j.e(t)}finally{j.f()}break;case!1:e&&e.paths._id&&e.paths._id.options&&!1===e.paths._id.options.select&&(t._id=0);var A,E=o(w);try{for(E.s();!(A=E.n()).done;){var x=A.value;a.has(x)||d(t,x)||(t[x]=t[x]||1)}}catch(t){E.e(t)}finally{E.f()}break;case void 0:if(null==t)break;for(var T=0,k=Object.keys(t||{});T<k.length;T++){var N=k[T];N.startsWith("+")&&delete t[N]}var I,B=o(O);try{for(B.s();!(I=B.n()).done;){var D=I.value;null==t[D]&&(t[D]=0)}}catch(t){B.e(t)}finally{B.f()}}function M(o,a){if(null!=t&&"boolean"==typeof a.selected)if(!1===a.selected&&t[o])r&&(t[o]=0);else if(i||!a.selected||o!==e.options.discriminatorKey||null==t[o]||t[o]){if(!1!==i||!a.selected||null==t[o]||t[o]){var u="+"+o;if(t&&u in t)return delete t[u],void(!1===i&&s.length>1&&!~s.indexOf(o)&&!r?t[o]=1:null==i&&r&&!1===a.selected&&(t[o]=0));for(var c=o.split("."),l="",p=0;p<c.length;++p)if(l+=l.length?"."+c[p]:c[p],-1!==O.indexOf(l))return;if(!i&&a&&a.options&&a.options.$skipDiscriminatorCheck)for(var h="",y=0;y<c.length;++y){h+=(0===h.length?"":".")+c[y];var d=f(t,h,!1)||f(t,h+".$",!1);if(d&&"object"!==n(d))return}return(a.selected?w:O).push(o),o}delete t[o]}else delete t[o]}}},3900:(t,e,r)=>{"use strict";var n=r(6400),o=r(6750),i=r(3191)(),s=r(1464),a=r(2268),u=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||u(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(c=!1)}return(n||c||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},3916:t=>{"use strict";t.exports=function(t,e,r,n,o){var i=Object.keys(t).reduce(function(t,r){return t||r.startsWith(e+".")},!1),s=e+"."+r.options.discriminatorKey;i||1!==o.length||o[0]!==s||n.splice(n.indexOf(s),1)}},3940:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,["Can't save() the same doc multiple times in parallel. Document: "+t._doc._id])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"ParallelSaveError"}),t.exports=a},4009:(t,e,r)=>{"use strict";var n=r(8213),o=r(5188),i=r(3622),s=r(5678),a=r(7352),u=r(8768),c=/(\.\d+$|\.\d+\.)/g;t.exports=function(t,e,r,l,f){if(null==t)return[];if("string"==typeof t&&null!=f&&o(f,t))throw new n("refPath `"+t+"` must not be excluded in projection, got "+a.inspect(f));if(c.test(r)){var p=r.split(c);if(""===p[p.length-1])throw new Error("Can't populate individual element in an array");for(var h="",y=t,d=0;d<p.length;d+=2){var b=p[d];if(!y.startsWith(b+".")){if(d===p.length-1){h+=y,y="";break}throw new Error("Could not normalize ref path, chunk "+b+" not in populated path")}h+=y.substring(0,b.length)+p[d+1],y=y.substring(b.length+1)}var m=s.get(h,e,i),v=Array.isArray(m)?m:[m];return u.array.flatten(v)}var g=s.get(t,e,i);return null!=l&&l.virtuals.hasOwnProperty(t)?[l.virtuals[t].applyGetters(void 0,e)]:Array.isArray(g)?g:[g]}},4026:(t,e)=>{"use strict";e.Collection=function(){throw new Error("Cannot create a collection from browser library")},e.Connection=function(){throw new Error("Cannot create a connection from browser library")},e.BulkWriteResult=function(){}},4058:(t,e,r)=>{"use strict";var n=r(6353).Long,o=9223372036854775807n,i=-9223372036854775808n,s="Mongoose only supports BigInts between ".concat(i," and ").concat(o," because MongoDB does not support arbitrary precision integers");t.exports=function(t){if(null==t)return t;if(""===t)return null;if("bigint"==typeof t){if(t>o||t<i)throw new Error(s);return t}if(t instanceof n)return t.toBigInt();if("string"==typeof t||"number"==typeof t){if((t=BigInt(t))>o||t<i)throw new Error(s);return t}throw new Error('Cannot convert value to BigInt: "'.concat(t,'"'))}},4070:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var o=r(8260);t.exports=function(t){if("TopologyDescription"!==o(t))return!1;if(0===t.servers.size)return!1;var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}(t.servers.values());try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!1===i.host.endsWith(".mongodb.net")||27017!==i.port)return!1}}catch(t){r.e(t)}finally{r.f()}return!0}},4183:(t,e,r)=>{"use strict";var n=r(118);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},4224:(t,e,r)=>{"use strict";var n=r(6511).ctor("require","modify","init","default","ignore");function o(){this.activePaths=new n}t.exports=o,o.prototype.strictMode=!0,o.prototype.fullPath=void 0,o.prototype.selected=void 0,o.prototype.shardval=void 0,o.prototype.saveError=void 0,o.prototype.validationError=void 0,o.prototype.adhocPaths=void 0,o.prototype.removing=void 0,o.prototype.inserting=void 0,o.prototype.saving=void 0,o.prototype.version=void 0,o.prototype._id=void 0,o.prototype.ownerDocument=void 0,o.prototype.populate=void 0,o.prototype.populated=void 0,o.prototype.primitiveAtomics=void 0,o.prototype.wasPopulated=!1,o.prototype.scope=void 0,o.prototype.session=null,o.prototype.pathsToScopes=null,o.prototype.cachedRequired=null},4301:(t,e,r)=>{"use strict";var n=r(9539),o=r(2793),i=r(3305),s=r(5549),a=r(608);t.exports=function t(e,r,u,c){var l,f=Object.keys(r),p=0,h=f.length;if(u=u||"",!(c=c||new WeakSet).has(r)){for(c.add(r);p<h;)if(l=f[p++],(u||"discriminators"!==l&&"base"!==l&&"_applyDiscriminators"!==l&&"_userProvidedOptions"!==l&&"options"!==l&&"tree"!==l)&&!("tree"===u&&null!=r&&r.instanceOfSchema||o.has(l)))if(null==e[l])e[l]=r[l];else if(a(r[l])){if(a(e[l])||(e[l]={}),null!=r[l]){if(r[l].$isSingleNested&&e[l].$isMongooseDocumentArray||r[l].$isMongooseDocumentArray&&e[l].$isSingleNested||r[l].$isMongooseDocumentArrayElement&&e[l].$isMongooseDocumentArrayElement)continue;if(r[l].instanceOfSchema){e[l].instanceOfSchema?n(e[l],r[l].clone(),!0):e[l]=r[l].clone();continue}if(i(r[l],"ObjectId")){e[l]=new s(r[l]);continue}}t(e[l],r[l],u?u+"."+l:l,c)}null!=r&&r.instanceOfSchema&&(e.tree=Object.assign({},r.tree,e.tree))}}},4327:t=>{"use strict";t.exports=function(t,e,r,n){return r?n?{bsonType:e}:{bsonType:[e,"null"]}:n?{type:t}:{type:[t,"null"]}}},4432:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(n(t)+" is not iterable")}function i(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,i){var a=n&&n.prototype instanceof c?n:c,l=Object.create(a.prototype);return s(l,"_invoke",function(r,n,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(r,n){for(s=r,a=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,s=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,y),s=l,a=y;(e=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),l}var u={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),h=f.prototype=c.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=f,s(h,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(h),s(h,o,"Generator"),s(h,n,function(){return this}),s(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:y}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){function i(e,r){s(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},s(t,e,r,n)}function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function s(t){c(i,n,o,s,a,"next",t)}function a(t){c(i,n,o,s,a,"throw",t)}s(void 0)})}}var f=r(5782);t.exports=function(t){var e=!0;t.s.hooks.pre("save",!1,function(t){if(this.$isSubdocument)t();else{var e=this,r=this.$getAllSubdocs({useCache:!0});r.length?f(r,function(t,e){t.$__schema.s.hooks.execPre("save",t,function(t){e(t)})},function(r){if(e.$__.saveOptions&&(e.$__.saveOptions.__subdocs=null),r)return e.$__schema.s.hooks.execPost("save:error",e,[e],{error:r},function(e){t(e)});t()}):t()}},null,e),t.s.hooks.post("save",function(){var t=l(i().m(function t(){var e,r,n,s,u,c;return i().w(function(t){for(;;)switch(t.p=t.n){case 0:if((e=this.$__.removedSubdocs)&&e.length){t.n=1;break}return t.a(2);case 1:r=[],n=a(e),t.p=2,u=i().m(function t(){var e;return i().w(function(t){for(;;)switch(t.n){case 0:e=s.value,r.push(new Promise(function(t,r){e.$__schema.s.hooks.execPost("deleteOne",e,[e],function(e){if(e)return r(e);t()})}));case 1:return t.a(2)}},t)}),n.s();case 3:if((s=n.n()).done){t.n=5;break}return t.d(o(u()),4);case 4:t.n=3;break;case 5:t.n=7;break;case 6:t.p=6,c=t.v,n.e(c);case 7:return t.p=7,n.f(),t.f(7);case 8:return this.$__.removedSubdocs=null,t.n=9,Promise.all(r);case 9:return t.a(2)}},t,this,[[2,6,7,8]])}));return function(){return t.apply(this,arguments)}}()),t.s.hooks.post("save",function(){var t=l(i().m(function t(){var e,r,n,s,u,c,l,f,p=this;return i().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!this.$isSubdocument){t.n=1;break}return t.a(2);case 1:if(e=this,(r=this.$getAllSubdocs({useCache:!0})).length){t.n=2;break}return t.a(2);case 2:n=[],s=a(r),t.p=3,c=i().m(function t(){var e;return i().w(function(t){for(;;)switch(t.n){case 0:e=u.value,n.push(new Promise(function(t,r){e.$__schema.s.hooks.execPost("save",e,[e],function(e){if(e)return r(e);t()})}));case 1:return t.a(2)}},t)}),s.s();case 4:if((u=s.n()).done){t.n=6;break}return t.d(o(c()),5);case 5:t.n=4;break;case 6:t.n=8;break;case 7:t.p=7,l=t.v,s.e(l);case 8:return t.p=8,s.f(),t.f(8);case 9:return t.p=9,t.n=10,Promise.all(n);case 10:t.n=12;break;case 11:return t.p=11,f=t.v,t.n=12,new Promise(function(t,r){p.$__schema.s.hooks.execPost("save:error",e,[e],{error:f},function(e){if(e)return r(e);t()})});case 12:return t.a(2)}},t,this,[[9,11],[3,7,8,9]])}));return function(){return t.apply(this,arguments)}}(),null,e)}},4450:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(9639),i=r(5549),s=r(2793),a=r(2497),u=r(9696),c=r(3305),l=r(1243).isMongooseArray,f=r(608),p=r(2789),h=r(7930),y=r(7291).trustedSymbol,d=r(6353);function b(t,e,r){if(null==t)return t;if(c(t,"Double"))return new d.Double(t.value);if("number"==typeof t||"string"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return t;if(Array.isArray(t))return function(t,e){var r=0,n=t.length,o=null;for(o=null!=e&&e.retainDocuments?t.isMongooseDocumentArray?new(t.$schemaType().schema.base.Types.DocumentArray)([],t.$path(),t.$parent(),t.$schemaType()):t.isMongooseArray?new(t.$parent().schema.base.Types.Array)([],t.$path(),t.$parent(),t.$schemaType()):new Array(n):new Array(n),t=l(t)?t.__array:t,r=0;r<n;++r)o[r]=b(t[r],e,!0);return o}(t,e);if(a(t)){if(e&&e.retainDocuments&&null!=t.$__){var s=t.$clone();return null!=t.__index&&(s.__index=t.__index),null!=t.__parentArray&&(s.__parentArray=t.__parentArray),s.$__parent=t.$__parent,s}return p(t)&&null!=t.$__&&null!=t._doc?t._doc:e&&e.json&&"function"==typeof t.toJSON?t.toJSON(e):t.toObject(e)}var y,v,g=t.constructor;if(g)switch(u(g)){case"Object":return m(t,e,r);case"Date":return new g(+t);case"RegExp":return y=t,(v=new RegExp(y.source,y.flags)).lastIndex!==y.lastIndex&&(v.lastIndex=y.lastIndex),v}return c(t,"ObjectId")?e&&e.flattenObjectIds?t.toJSON():new i(t.id):c(t,"Decimal128")?e&&e.flattenDecimals?t.toJSON():o.fromString(t.toString()):!g&&f(t)?m(t,e,r):"object"===n(t)&&t[h.schemaTypeSymbol]?t.clone():e&&e.bson&&"function"==typeof t.toBSON?t:"function"==typeof t.valueOf?t.valueOf():m(t,e,r)}function m(t,e,r){var n,o=e&&e.minimize,i=e&&e.omitUndefined,a=e&&e._seen,u={};if(a&&a.has(t))return a.get(t);a&&a.set(t,u),y in t&&!1!==(null==e?void 0:e.copyTrustedSymbol)&&(u[y]=t[y]);for(var c=Object.keys(t),l=c.length,f=0;f<l;++f){var p=c[f];if(!s.has(p)){var h=b(t[p],e,!1);!1!==o&&!i||void 0!==h?!0===o&&void 0===h||(n||(n=!0),u[p]=h):delete u[p]}}return o&&!r?n&&u:u}t.exports=b},4473:t=>{"use strict";function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(n.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");var o=t.$parent(),i=t.$__pathRelativeToParent(void 0,!1)+"."+r;o.$__.activePaths.clearPath(i),o.$isSubdocument&&e(o,i,n)}t.exports=function(t,r,n){var o=(n=n||{}).skipDocArrays,i=0;if(!t)return i;for(var s=0,a=Object.keys(t.$__.activePaths.getStatePaths("modify"));s<a.length;s++){var u=a[s];if(o){var c=t.$__schema.path(u);if(c&&c.$isMongooseDocumentArray)continue}u.startsWith(r+".")&&(t.$__.activePaths.clearPath(u),++i,t.$isSubdocument&&e(t,u))}return i}},4561:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"excludeIndexes",u),Object.defineProperty(a.prototype,"_id",u),t.exports=a},4592:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"enum",u),Object.defineProperty(a.prototype,"of",u),Object.defineProperty(a.prototype,"castNonArrays",u),t.exports=a},4625:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"auto",u),Object.defineProperty(a.prototype,"populate",u),t.exports=a},4756:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},4829:(t,e,r)=>{"use strict";t.exports=r(8533)},4859:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var s=r(8920),a=r(2400),u=r(863),c=r(1058),l=r(3303)._,f=r(8768),p=r(3305),h=r(7930).arrayParentSymbol,y=r(7930).arrayPathSymbol,d=r(7930).arraySchemaSymbol,b=r(7930).documentArrayParent,m=Array.prototype.toString,v={toBSON:function(){return this.toObject(l)},toString:function(){return m.call(this.__array.map(function(t){return null!=t&&null!=t.$__?t.toString():t}))},getArrayParent:function(){return this[h]},$schemaType:function(){return this[d]},_cast:function(t,e,r){if(null==this[d])return t;var o=this[d].casterConstructor;if((o.$isMongooseDocumentArray?f.isMongooseDocumentArray(t):t instanceof o)||t&&t.constructor&&t.constructor.baseCasterConstructor===o)return t[b]&&t.__parentArray||(t[b]=this[h],t.__parentArray=this),t.$setIndex(e),t;if(null==t)return null;if((n.isBuffer(t)||p(t,"ObjectId")||!f.isObject(t))&&(t={_id:t}),t&&o.discriminators&&o.schema&&o.schema.options&&o.schema.options.discriminatorKey)if("string"==typeof t[o.schema.options.discriminatorKey]&&o.discriminators[t[o.schema.options.discriminatorKey]])o=o.discriminators[t[o.schema.options.discriminatorKey]];else{var i=c(o.discriminators,t[o.schema.options.discriminatorKey]);i&&(o=i)}if(o.$isMongooseDocumentArray)return o.cast(t,this,void 0,void 0,e);var s=new o(t,this,r,void 0,e);return s.isNew=!0,s},id:function(t){var e,r,n;try{e=u(t).toString()}catch(t){e=null}var i,s=o(this);try{for(s.s();!(i=s.n()).done;){var c=i.value;if(c&&null!=(n=c.get("_id")))if(n instanceof a){if(r||(r=String(t)),r==n._id)return c}else if(p(t,"ObjectId")||p(n,"ObjectId")){if(e==n)return c}else if(t==n||f.deepEqual(t,n))return c}}catch(t){s.e(t)}finally{s.f()}return null},toObject:function(t){return[].concat(this.map(function(e){return null==e?null:"function"!=typeof e.toObject?e:e.toObject(t)}))},$toObject:function(){return this.constructor.prototype.toObject.apply(this,arguments)},push:function(){var t=s.push.apply(this,arguments);return g(this),t},pull:function(){var t=s.pull.apply(this,arguments);return g(this),t},shift:function(){var t=s.shift.apply(this,arguments);return g(this),t},splice:function(){var t=s.splice.apply(this,arguments);return g(this),t},inspect:function(){return this.toObject()},create:function(t){var e=this[d].casterConstructor;if(t&&e.discriminators&&e.schema&&e.schema.options&&e.schema.options.discriminatorKey)if("string"==typeof t[e.schema.options.discriminatorKey]&&e.discriminators[t[e.schema.options.discriminatorKey]])e=e.discriminators[t[e.schema.options.discriminatorKey]];else{var r=c(e.discriminators,t[e.schema.options.discriminatorKey]);r&&(e=r)}return new e(t,this)},notify:function(t){var e=this;return function r(n,o){for(var i=(o=o||e).length;i--;)null!=o[i]&&("save"===t&&(n=e[i]),f.isMongooseArray(o[i])?r(n,o[i]):o[i]&&o[i].emit(t,n))}},set:function(t,e,r){var n=this.__array;if(r)return n[t]=e,this;var o=v._cast.call(this,e,t);return v._markModified.call(this,t),n[t]=o,this},_markModified:function(t,e){var r,n=this[h];if(n){if(r=this[y],arguments.length&&(r=null!=e?r+"."+t.__index+"."+e:r+"."+t),null!=r&&r.endsWith(".$"))return this;n.markModified(r,0!==arguments.length?t:n)}return this}};function g(t){var e=t[h];if(e&&null!=e.$__.populated){var r,n=o(Object.keys(e.$__.populated).filter(function(e){return e.startsWith(t[y]+".")}));try{var i=function(){var n=r.value,o=n.slice((t[y]+".").length);if(!Array.isArray(e.$__.populated[n].value))return 1;e.$__.populated[n].value=t.map(function(t){return t.$populated(o)})};for(n.s();!(r=n.n()).done;)i()}catch(t){n.e(t)}finally{n.f()}}}t.exports=v},4878:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(8920),s=r(4859),a=r(7930).arrayAtomicsSymbol,u=r(7930).arrayAtomicsBackupSymbol,c=r(7930).arrayParentSymbol,l=r(7930).arrayPathSymbol,f=r(7930).arraySchemaSymbol,p=Array.prototype.push,h=/^\d+$/;t.exports=function(t,e,r,n){var y=[],d=o(o(o(o(o({},a,{}),u,void 0),l,e),f,void 0),c,void 0);if(Array.isArray(t)&&(t[l]===e&&t[c]===r&&(d[a]=Object.assign({},t[a])),t.forEach(function(t){p.call(y,t)})),d[l]=e,d.__array=y,r&&r.$__)for(d[c]=r,d[f]=r.$__schema.path(e);null!=d[f]&&d[f].$isMongooseArray&&!d[f].$isMongooseDocumentArray;)d[f]=d[f].casterConstructor;var b=new Proxy(y,{get:function(t,e){return"isMongooseArray"===e||"isMongooseArrayProxy"===e||"isMongooseDocumentArray"===e||"isMongooseDocumentArrayProxy"===e||(d.hasOwnProperty(e)?d[e]:s.hasOwnProperty(e)?s[e]:n&&n.virtuals&&n.virtuals.hasOwnProperty(e)?n.virtuals[e].applyGetters(void 0,t):i.hasOwnProperty(e)?i[e]:y[e])},set:function(t,e,r){return"string"==typeof e&&h.test(e)?s.set.call(b,e,r,!1):d.hasOwnProperty(e)?d[e]=r:n&&n.virtuals&&n.virtuals.hasOwnProperty(e)?n.virtuals[e].applySetters(r,t):y[e]=r,!0}});return b}},4957:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(7160),u=r(5268);t.exports=l,l.middlewareFunctions=["deleteOne","save","validate","remove","updateOne","init"];var c=new Set(l.middlewareFunctions.flatMap(function(t){return[t,"$__".concat(t)]}));function l(t,e,r){var n={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},o=(r=r||{}).decorateDoc?t:t.prototype;t.$appliedHooks=!0;for(var s=0,f=Object.keys(e.paths);s<f.length;s++){var p=f[s],h=e.paths[p],y=null;if(h.$isSingleNested)y=h.caster;else{if(!h.$isMongooseDocumentArray)continue;y=h.Constructor}if(!y.$appliedHooks&&(l(y,h.schema,i(i({},r),{},{isChildSchema:!0})),null!=y.discriminators))for(var d=0,b=Object.keys(y.discriminators);d<b.length;d++){var m=b[d];l(y.discriminators[m],y.discriminators[m].schema,r)}}var v=e.s.hooks.filter(function(t){return"updateOne"===t.name||"deleteOne"===t.name?!!t.document:"remove"===t.name||"init"===t.name?null==t.document||!!t.document:null==t.query&&null==t.document||!1!==t.document}).filter(function(t){return!e.methods[t.name]||!t.fn[a.builtInMiddleware]});t._middleware=v,o.$__originalValidate=o.$__originalValidate||o.$__validate;for(var g=0,_=r&&r.isChildSchema?["save","validate","deleteOne"]:["save","validate"];g<_.length;g++){var w=_[g],O="validate"===w?"$__originalValidate":"$__".concat(w),S=v.createWrapper(w,o[O],null,n);o["$__".concat(w)]=S}o.$__init=v.createWrapperSync("init",o.$__init,null,n);for(var $=Object.keys(e.methods),j=Object.assign({},n,{checkForPromise:!0}),P=function(){var e=E[A];if(c.has(e))return 0;if(!v.hasHooks(e))return 0;var r=o[e];o[e]=function(){var r=this,n=Array.prototype.slice.call(arguments),o=n.slice(-1).pop(),i="function"==typeof o?n.slice(0,n.length-1):n;return u(o,function(t){return r["$__".concat(e)].apply(r,i.concat([t]))},t.events)},o["$__".concat(e)]=v.createWrapper(e,r,null,j)},A=0,E=$;A<E.length;A++)P()}},5022:(t,e,r)=>{"use strict";var n=r(6426),o=r(7160),i=r(608),s=r(8768);function a(t,e){if(e&&e.default){var r=e.default;Array.isArray(r)&&0===r.length?e.default=Array:!e.shared&&i(r)&&0===Object.keys(r).length&&(e.default=function(){return{}})}n.call(this,t,e,"Mixed"),this[o.schemaMixedSymbol]=!0}a.schemaName="Mixed",a.defaultOptions={},a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.get=n.get,a.set=n.set,a.setters=[],a.prototype.cast=function(t){return t instanceof Error?s.errorToPOJO(t):t},a.prototype.castForQuery=function(t,e){return e},a.prototype.toJSONSchema=function(t){return{}},t.exports=a},5098:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a,u=r(3609),c=r(3550).EventEmitter,l=r(3441),f=r(7494),p=r(6426),h=r(5335),y=r(8499),d=r(5558).G,b=r(4327),m=r(1469),v=r(9604),g=r(7910),_=r(1313),w=r(3303)._,O=r(1793),S=r(8768),$=r(5537);function j(t,e,r){if(t.options.timeseries)throw new $(e,"timeseries");var n=j.defaultOptions&&j.defaultOptions._id;null!=n&&((r=r||{})._id=n),t=_(t,r),this.caster=P(t,null,r),this.caster.path=e,this.caster.prototype.$basePath=e,this.schema=t,this.$isSingleNested=!0,this.base=t.base,p.call(this,e,r,"Embedded")}function P(t,e,n){a||(a=r(9380));var o=function(t,e,r){this.$__parent=r,a.apply(this,arguments),null!=r&&this.$session(r.$session())};t._preCompile();var i=null!=e?e.prototype:a.prototype;for(var s in(o.prototype=Object.create(i)).$__setSchema(t),o.prototype.constructor=o,o.prototype.$__schemaTypeOptions=n,o.$__required=null==n?void 0:n.required,o.base=t.base,o.schema=t,o.$isSingleNested=!0,o.events=new c,o.prototype.toBSON=function(){return this.toObject(w)},t.methods)o.prototype[s]=t.methods[s];for(var u in t.statics)o[u]=t.statics[u];for(var l in c.prototype)o[l]=c.prototype[l];return o}t.exports=j,j.prototype=Object.create(p.prototype),j.prototype.constructor=j,j.prototype.OptionsConstructor=f;var A=i({},p.prototype.$conditionalHandlers);A.$geoWithin=function(t,e){return{$geometry:this.castForQuery(null,t.$geometry,e)}},A.$near=A.$nearSphere=v.cast$near,A.$within=A.$geoWithin=v.cast$within,A.$geoIntersects=v.cast$geoIntersects,A.$minDistance=d,A.$maxDistance=d,A.$exists=y,Object.defineProperty(j.prototype,"$conditionalHandlers",{enumerable:!1,value:A}),j.prototype.cast=function(t,e,r,o,s){if(t&&t.$isSingleNested&&t.parent===e)return t;if(null!=t&&("object"!==n(t)||Array.isArray(t)))throw new l(this.path,t);var a,u=this.schema.path(this.schema.options.discriminatorKey),c=null==u?null:u.getDefault(e),f=g(this.caster,t,c),p=e&&e.$__&&e.$__.selected,y=this.path,d=null==p?null:Object.keys(p).reduce(function(t,e){return e.startsWith(y+".")&&((t=t||{})[e.substring(y.length+1)]=p[e]),t},null);if(!r)return s=Object.assign({},s,{priorDoc:o}),0===Object.keys(t).length?new f({},d,e,void 0,s):new f(t,d,e,void 0,s);delete(a=new f(void 0,d,e,!1,{defaults:!1})).$__.defaults,null!=s.path&&delete(s=i({},s)).path,a.$init(t,s);var b=O(d);return h(a,d,b),a},j.prototype.castForQuery=function(t,e,r,n){var o;if(null!=t){if(!(o=this.$conditionalHandlers[t]))throw new Error("Can't use "+t);return o.call(this,e)}if(null==e)return e;var i=g(this.caster,e);if(e instanceof i)return e;this.options.runSetters&&(e=this._applySetters(e,r));var s=null!=n&&null!=n.strict?n.strict:void 0;try{e=new i(e,s)}catch(t){if(!(t instanceof u))throw new u("Embedded",e,this.path,t,this);throw t}return e},j.prototype.doValidate=function(t,e,r,n){var o=g(this.caster,t);if(!t||t instanceof o||(t=new o(t,null,null!=r&&null!=r.$__?r:null)),n&&n.skipSchemaValidators)return t?t.validate().then(function(){return e(null)},function(t){return e(t)}):e(null);p.prototype.doValidate.call(this,t,function(r){return r?e(r):t?void t.validate().then(function(){return e(null)},function(t){return e(t)}):e(null)},r,n)},j.prototype.doValidateSync=function(t,e,r){if(!r||!r.skipSchemaValidators){var n=p.prototype.doValidateSync.call(this,t,e);if(n)return n}if(t)return t.validateSync()},j.prototype.discriminator=function(t,e,r){r=r||{};var n=S.isPOJO(r)?r.value:r,o="boolean"!=typeof r.clone||r.clone;return e.instanceOfSchema&&o&&(e=e.clone()),e=m(this.caster,t,e,n,null,null,r.overwriteExisting),this.caster.discriminators[t]=P(e,this.caster),this.caster.discriminators[t]},j.defaultOptions={},j.set=p.set,j.setters=[],j.get=p.get,j.prototype.toJSON=function(){return{path:this.path,options:this.options}},j.prototype.clone=function(){var t=new this.constructor(this.schema,this.path,i(i({},this.options),{},{_skipApplyDiscriminators:!0}));return t.validators=this.validators.slice(),void 0!==this.requiredValidator&&(t.requiredValidator=this.requiredValidator),t.caster.discriminators=Object.assign({},this.caster.discriminators),t._appliedDiscriminators=this._appliedDiscriminators,t},j.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return i(i({},this.schema.toJSONSchema(t)),b("object","object",null==t?void 0:t.useBsonType,e))}},5110:t=>{"use strict";var e=new Set(["$ref","$id","$db"]);t.exports=function(t){return"$"===t[0]&&!e.has(t)}},5152:(t,e,r)=>{"use strict";var n=r(3703),o=r(7425);t.exports=function t(e,r,i){for(var s=(i=i||{}).typeOnly,a=Array.isArray(r)?r:-1===r.indexOf(".")?[r]:r.split("."),u=null,c="adhocOrUndefined",l=o(e.schema,e.get(e.schema.options.discriminatorKey))||e.schema,f=0;f<a.length;++f){var p=a.slice(0,f+1).join(".");if(null!=(u=l.path(p))){if("Mixed"===u.instance)return s?"real":u;if(c=l.pathType(p),(u.$isSingleNested||u.$isMongooseDocumentArrayElement)&&null!=u.schema.discriminators){var h=u.schema.discriminators,y=e.get(p+"."+n(u,"schema.options.discriminatorKey"));if(null==y||null==h[y])continue;var d=a.slice(f+1).join(".");return t(e.get(p),d,i)}}else c="adhocOrUndefined"}return s?c:u}},5188:(t,e,r)=>{"use strict";var n=r(7300);t.exports=function(t,e){if(null==t)return!1;if("_id"===e)return 0===t._id;for(var r=null,o=0,i=Object.keys(t);o<i.length;o++){var s=i[o];if(n(t[s])){r=1===t[e]?"inclusive":"exclusive";break}}return"inclusive"===r?1!==t[e]:"exclusive"===r&&0===t[e]}},5268:(t,e,r)=>{"use strict";var n=r(2746),o=Symbol("mongoose#emitted");t.exports=function(t,e,i,s){if("function"==typeof t)try{return e(function(e){if(null==e)t.apply(this,arguments);else{null!=i&&null!=i.listeners&&i.listeners("error").length>0&&!e[o]&&(e[o]=!0,i.emit("error",e));try{t(e)}catch(e){return n(function(){throw e})}}})}catch(e){return null!=i&&null!=i.listeners&&i.listeners("error").length>0&&!e[o]&&(e[o]=!0,i.emit("error",e)),t(e)}return new(s=s||r.g.Promise)(function(t,r){e(function(e,n){return null!=e?(null!=i&&null!=i.listeners&&i.listeners("error").length>0&&!e[o]&&(e[o]=!0,i.emit("error",e)),r(e)):arguments.length>2?t(Array.prototype.slice.call(arguments,1)):void t(n)})})}},5289:t=>{"use strict";t.exports=function(t){switch(t){case"p":t="primary";break;case"pp":t="primaryPreferred";break;case"s":t="secondary";break;case"sp":t="secondaryPreferred";break;case"n":t="nearest"}return t}},5335:(t,e,r)=>{"use strict";var n=r(1091);function o(t,e,r){t.$__.activePaths.default(e),!r&&t.$isSubdocument&&t.$isSingleNested&&null!=t.$parent()&&t.$parent().$__.activePaths.default(t.$__pathRelativeToParent(e))}t.exports=function(t,e,r,i,s,a,u){for(var c=Object.keys(t.$__schema.paths),l=c.length,f=u&&u.skipParentChangeTracking,p=0;p<l;++p){var h=void 0,y="",d=c[p];if("_id"!==d||!t.$__.skipId){var b=t.$__schema.paths[d],m=b.splitPath(),v=m.length;if("$*"!==m[v-1])for(var g=!1,_=t._doc,w=0;w<v&&null!=_;++w){var O=m[w];if(y+=(y.length?".":"")+O,!0===r){if(y in e)break}else if(!1===r&&e&&!g){var S=b.$isSingleNested||b.$isMongooseDocumentArray;if(y in e&&!n(e[y])||w===v-1&&S&&null!=i&&i[y])g=!0;else if(null!=i&&!i[y])break}if(w===v-1){if(void 0!==_[O])break;if(null!=s)if("function"==typeof b.defaultValue){if(!b.defaultValue.$runBeforeSetters&&s)break;if(b.defaultValue.$runBeforeSetters&&!s)break}else if(!s)continue;if(a&&a[y])break;if(e&&null!==r){if(!0===r){if(d in e)continue;try{h=b.getDefault(t,!1)}catch(e){t.invalidate(d,e);break}void 0!==h&&(_[O]=h,o(t,d,f))}else if(g){try{h=b.getDefault(t,!1)}catch(e){t.invalidate(d,e);break}void 0!==h&&(_[O]=h,o(t,d,f))}}else{try{h=b.getDefault(t,!1)}catch(e){t.invalidate(d,e);break}void 0!==h&&(_[O]=h,o(t,d,f))}}else _=_[O]}}}}},5346:t=>{"use strict";t.exports=function(t,e,r){for(var n=e[0],o=r,i=t,s=0;s<e.length-1;++s){var a=o.path(n);if(a&&a.schema){var u=i.get(n);if(o=a.schema,n=e[s+1],Array.isArray(u)&&!isNaN(n)&&(u=u[n],n=""),null==u)break;i=u}else n+=n.length?"."+e[s+1]:e[s+1]}return i}},5413:(t,e,r)=>{"use strict";var n=r(3305),o=r(2402);t.exports=function(t){if(null==t)return t;if(""===t)return null;var e=n(t,"Long")?t.toNumber():Number(t);if(e===(0|e)&&e>=-2147483648&&e<=2147483647)return e;o.ok(!1)}},5477:(t,e,r)=>{"use strict";var n=r(2354),o=r(3279),i=r(3123),s=r(3388);t.exports=s||n.call(i,o)},5484:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===e(Symbol.iterator))return!0;var t={},r=Symbol("test"),n=Object(r);if("string"==typeof r)return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var o in t[r]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==r)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(t,r);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},5497:(t,e,r)=>{"use strict";var n=r(8260);t.exports=function(t){if("TopologyDescription"!==n(t))return!1;var e=Array.from(t.servers.values());return e.length>0&&e.every(function(t){return t.error&&-1!==t.error.message.indexOf("Client network socket disconnected before secure TLS connection was established")})}},5510:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o="undefined"!=typeof Symbol&&Symbol,i=r(5484);t.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"===n(o("foo"))&&"symbol"===n(Symbol("bar"))&&i()}},5537:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,['Cannot create use schema for property "'.concat(t,'" because the schema has the ').concat(r," option enabled.")])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"InvalidSchemaOptionError"}),t.exports=a},5549:(t,e,r)=>{"use strict";var n=r(6353).ObjectId,o=r(7930).objectIdSymbol;Object.defineProperty(n.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}),n.prototype.hasOwnProperty("valueOf")||(n.prototype.valueOf=function(){return this.toString()}),n.prototype[o]=!0,t.exports=n},5558:(t,e,r)=>{"use strict";var n=r(3660);function o(t){return n.cast()(t)}e.G=o,e.p=function t(e,r){e.forEach(function(n,i){Array.isArray(n)?t(n,r):e[i]=o.call(r,n)})}},5678:(t,e,r)=>{"use strict";t.exports=r(2914)},5761:t=>{"use strict";t.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})},5782:t=>{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t,r,n){if(0===t.length)return n();var o,i=t.length,s=null,a=function(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}(t);try{for(a.s();!(o=a.n()).done;)r(o.value,function(t){if(null==s)return null!=t?n(s=t):--i<=0?n():void 0})}catch(s){a.e(s)}finally{a.f()}}},5804:(t,e,r)=>{"use strict";var n=r(2354),o=r(3279),i=r(5477);t.exports=function(){return i(n,o,arguments)}},5807:t=>{"use strict";t.exports=Object.getOwnPropertyDescriptor},5825:(t,e,r)=>{"use strict";var n=r(8093);t.exports=n.getPrototypeOf||null},5832:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(6775),i=r(2486),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=c,e.IS=50;var a=2147483647;function u(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return p(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=u(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){var e=new Uint8Array(t);return y(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t));if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return y(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return y(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return c.from(o,e,r);var i=function(t){if(c.isBuffer(t)){var e=0|d(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?u(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t))}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function p(t){return f(t),u(t<0?0:0|d(t))}function h(t){for(var e=t.length<0?0:0|d(t.length),r=u(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function y(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function d(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+n(t));var r=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return o?-1:C(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var f=!0,p=0;p<u;p++)if(c(t,i+p)!==c(e,p)){f=!1;break}if(f)return i}return-1}function w(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(q(a))return s;t[r+s]=a}return s}function O(t,e,r,n){return L(C(e,t.length-r),t,r,n)}function S(t,e,r,n){return L(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function $(t,e,r,n){return L(F(e),t,r,n)}function j(t,e,r,n){return L(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function P(t,e,r){return 0===e&&r===t.length?o.fromByteArray(t):o.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,c=t[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=E));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},c.allocUnsafe=function(t){return p(t)},c.allocUnsafeSlow=function(t){return p(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(V(i,Uint8Array))o+i.length>n.length?c.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},c.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(t,e,r,o,i){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+n(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||r>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=r)return 0;if(o>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(o>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(s,a),l=this.slice(o,i),f=t.slice(e,r),p=0;p<u;++p)if(l[p]!==f[p]){s=l[p],a=f[p];break}return s<a?-1:a<s?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return $(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function x(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=J[t[i]];return o}function N(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function D(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=c.isBuffer(t)?t:c.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var U=/[^+/0-9A-Za-z-_]/g;function C(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function F(t){return o.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var J=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}()},5889:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=o(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var s=r(7930).arrayAtomicsSymbol,a=r(7930).sessionNewDocuments,u=r(8768);function c(t,e){return t=t||{},null!=e.$pullAll&&(t.$pullAll=(t.$pullAll||[]).concat(e.$pullAll)),null!=e.$push&&(t.$push=t.$push||{},t.$push.$each=(t.$push.$each||[]).concat(e.$push.$each)),null!=e.$addToSet&&(t.$addToSet=(t.$addToSet||[]).concat(e.$addToSet)),null!=e.$set&&(t.$set=Array.isArray(e.$set)?function(t){if(Array.isArray(t))return i(t)}(r=e.$set)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||o(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():Object.assign({},e.$set)),t;var r}t.exports=function(t){t.pre("save",function(){var t=this.$session();if(null!=t&&null!=t.transaction&&null!=t[a]&&!t[a].has(this)){var e={};this.isNew&&(e.isNew=!0),this.$__schema.options.versionKey&&(e.versionKey=this.get(this.$__schema.options.versionKey)),e.modifiedPaths=new Set(Object.keys(this.$__.activePaths.getStatePaths("modify"))),e.atomics=function(t,e){var r=new Map;e=e||new Map;var o,i=n(Object.keys(t.$__.activePaths.init).concat(Object.keys(t.$__.activePaths.modify)));try{for(i.s();!(o=i.n()).done;){var a=o.value,l=t.$__getValue(a);if(null!=l&&Array.isArray(l)&&u.isMongooseDocumentArray(l)&&l.length&&null!=l[s]&&0!==Object.keys(l[s]).length){var f=e.get(a)||{};r.set(a,c(f,l[s]))}}}catch(t){i.e(t)}finally{i.f()}var p,h=n(t.$__dirty());try{for(h.s();!(p=h.n()).done;){var y=p.value,d=y.path,b=y.value;if(null!=b&&null!=b[s]&&0!==Object.keys(b[s]).length){var m=e.get(d)||{};r.set(d,c(m,b[s]))}}}catch(t){h.e(t)}finally{h.f()}return r}(this),t[a].set(this,e)}})}},5899:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(953)(),i=r(3071)("Object.prototype.toString"),s=function(t){return!(o&&t&&"object"===n(t)&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!s(t)||null!==t&&"object"===n(t)&&"length"in t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"callee"in t&&"[object Function]"===i(t.callee)},u=function(){return s(arguments)}();s.isLegacyArguments=a,t.exports=u?s:a},5994:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(2354);t.exports=i.call(n,o)},6062:(t,e,r)=>{"use strict";var n=r(9122),o=r(2273),i=r(118),s=r(4183),a=r(7878),u=n(s(),Number);o(u,{getPolyfill:s,implementation:i,shim:a}),t.exports=u},6140:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}t.exports=n(function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subdocSnapshot=e,this.activePaths=r,this.version=n})},6155:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){for(var r=Object.keys(t),n=!0,o=0,i=r.length;o<i;++o)if("object"===e(t[r[o]])&&null!==t[r[o]]){n=!1;break}return n}},6182:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),s=0,a=i.length;s<a;s++){var u=i[s],c=Object.getOwnPropertyDescriptor(o,u);void 0!==c&&c.enumerable&&(r[u]=o[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},6193:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},i(t)}var s=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach(function(t){return e.push(t)}),e},u=function(t){var e=[];return t.forEach(function(t,r){return e.push([r,t])}),e},c=Object.is?Object.is:r(2064),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(6062);function p(t){return t.call.bind(t)}var h=p(Object.prototype.hasOwnProperty),y=p(Object.prototype.propertyIsEnumerable),d=p(Object.prototype.toString),b=r(7352).types,m=b.isAnyArrayBuffer,v=b.isArrayBufferView,g=b.isDate,_=b.isMap,w=b.isRegExp,O=b.isSet,S=b.isNativeError,$=b.isBoxedPrimitive,j=b.isNumberObject,P=b.isStringObject,A=b.isBooleanObject,E=b.isBigIntObject,x=b.isSymbolObject,T=b.isFloat32Array,k=b.isFloat64Array;function N(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(N).concat(l(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function B(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function D(t,e,r,n){if(t===e)return 0!==t||!r||c(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&f(t)&&f(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var o,a,u,l,p=d(t);if(p!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var h=I(t),y=I(e);return h.length===y.length&&R(t,e,r,n,1,h)}if("[object Object]"===p&&(!_(t)&&_(e)||!O(t)&&O(e)))return!1;if(g(t)){if(!g(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(u=t,l=e,!(s?u.source===l.source&&u.flags===l.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(l))))return!1}else if(S(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(v(t)){if(r||!T(t)&&!k(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===B(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var b=I(t),N=I(e);return b.length===N.length&&R(t,e,r,n,0,b)}if(O(t))return!(!O(e)||t.size!==e.size)&&R(t,e,r,n,2);if(_(t))return!(!_(e)||t.size!==e.size)&&R(t,e,r,n,3);if(m(t)){if(a=e,(o=t).byteLength!==a.byteLength||0!==B(new Uint8Array(o),new Uint8Array(a)))return!1}else if($(t)&&!function(t,e){return j(t)?j(e)&&c(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):P(t)?P(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):A(t)?A(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):E(t)?E(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):x(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return R(t,e,r,n,0)}function M(t,e){return e.filter(function(e){return y(t,e)})}function R(t,e,r,n,s,c){if(5===arguments.length){c=Object.keys(t);var f=Object.keys(e);if(c.length!==f.length)return!1}for(var p=0;p<c.length;p++)if(!h(e,c[p]))return!1;if(r&&5===arguments.length){var d=l(t);if(0!==d.length){var b=0;for(p=0;p<d.length;p++){var m=d[p];if(y(t,m)){if(!y(e,m))return!1;c.push(m),b++}else if(y(e,m))return!1}var v=l(e);if(d.length!==v.length&&M(e,v).length!==b)return!1}else{var g=l(e);if(0!==g.length&&0!==M(e,g).length)return!1}}if(0===c.length&&(0===s||1===s&&0===t.length||0===t.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var _=n.val1.get(t);if(void 0!==_){var w=n.val2.get(e);if(void 0!==w)return _===w}n.position++}n.val1.set(t,n.position),n.val2.set(e,n.position);var O=function(t,e,r,n,s,c){var l=0;if(2===c){if(!function(t,e,r,n){for(var o=null,s=a(t),u=0;u<s.length;u++){var c=s[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!e.has(c)){if(r)return!1;if(!F(t,e,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=a(e),f=0;f<l.length;f++){var p=l[f];if("object"===i(p)&&null!==p){if(!U(o,p,r,n))return!1}else if(!r&&!t.has(p)&&!U(o,p,r,n))return!1}return 0===o.size}return!0}(t,e,r,s))return!1}else if(3===c){if(!function(t,e,r,n){for(var s=null,a=u(t),c=0;c<a.length;c++){var l=o(a[c],2),f=l[0],p=l[1];if("object"===i(f)&&null!==f)null===s&&(s=new Set),s.add(f);else{var h=e.get(f);if(void 0===h&&!e.has(f)||!D(p,h,r,n)){if(r)return!1;if(!L(t,e,f,p,n))return!1;null===s&&(s=new Set),s.add(f)}}}if(null!==s){for(var y=u(e),d=0;d<y.length;d++){var b=o(y[d],2),m=(f=b[0],b[1]);if("object"===i(f)&&null!==f){if(!V(s,t,f,m,r,n))return!1}else if(!(r||t.has(f)&&D(t.get(f),m,!1,n)||V(s,t,f,m,!1,n)))return!1}return 0===s.size}return!0}(t,e,r,s))return!1}else if(1===c)for(;l<t.length;l++){if(!h(t,l)){if(h(e,l))return!1;for(var f=Object.keys(t);l<f.length;l++){var p=f[l];if(!h(e,p)||!D(t[p],e[p],r,s))return!1}return f.length===Object.keys(e).length}if(!h(e,l)||!D(t[l],e[l],r,s))return!1}for(l=0;l<n.length;l++){var y=n[l];if(!D(t[y],e[y],r,s))return!1}return!0}(t,e,r,c,n,s);return n.val1.delete(t),n.val2.delete(e),O}function U(t,e,r,n){for(var o=a(t),i=0;i<o.length;i++){var s=o[i];if(D(e,s,r,n))return t.delete(s),!0}return!1}function C(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(f(t))return!1}return!0}function F(t,e,r){var n=C(r);return null!=n?n:e.has(n)&&!t.has(n)}function L(t,e,r,n,o){var i=C(r);if(null!=i)return i;var s=e.get(i);return!(void 0===s&&!e.has(i)||!D(n,s,!1,o))&&!t.has(i)&&D(n,s,!1,o)}function V(t,e,r,n,o,i){for(var s=a(t),u=0;u<s.length;u++){var c=s[u];if(D(r,c,o,i)&&D(n,e.get(c),o,i))return t.delete(c),!0}return!1}t.exports={isDeepEqual:function(t,e){return D(t,e,!1)},isDeepStrictEqual:function(t,e){return D(t,e,!0)}}},6223:t=>{"use strict";var e=/\./g;t.exports=function(t){if(-1===t.indexOf("."))return[t];for(var r=t.split(e),n=r.length,o=new Array(n),i="",s=0;s<n;++s)i+=0!==i.length?"."+r[s]:r[s],o[s]=i;return o}},6312:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r=Object.prototype.toString;t.exports=function(t){var n=r.call(t),o="[object Arguments]"===n;return o||(o="[object Array]"!==n&&null!==t&&"object"===e(t)&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),o}},6353:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BSON:()=>ze,BSONError:()=>q,BSONOffsetError:()=>K,BSONRegExp:()=>Ht,BSONRuntimeError:()=>z,BSONSymbol:()=>Wt,BSONType:()=>V,BSONValue:()=>nt,BSONVersionError:()=>J,Binary:()=>ut,Code:()=>ht,DBRef:()=>dt,Decimal128:()=>Rt,Double:()=>Ut,EJSON:()=>Ie,Int32:()=>Ct,Long:()=>$t,MaxKey:()=>Ft,MinKey:()=>Lt,ObjectId:()=>Jt,Timestamp:()=>Qt,UUID:()=>pt,calculateObjectSize:()=>qe,deserialize:()=>Ve,deserializeStream:()=>Je,onDemand:()=>Me,serialize:()=>Fe,serializeWithBufferAndIndex:()=>Le,setInternalBufferSize:()=>Ce});var n=r(5832).hp;const o=(()=>{const t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get;return e=>t.call(e)})();function i(t){return"Uint8Array"===o(t)}function s(t){return"object"==typeof t&&null!=t&&Symbol.toStringTag in t&&("ArrayBuffer"===t[Symbol.toStringTag]||"SharedArrayBuffer"===t[Symbol.toStringTag])}function a(t){return t instanceof RegExp||"[object RegExp]"===Object.prototype.toString.call(t)}function u(t){return"object"==typeof t&&null!=t&&Symbol.toStringTag in t&&"Map"===t[Symbol.toStringTag]}function c(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function l(t,e){return JSON.stringify(t,(t,e)=>"bigint"==typeof e?{$numberLong:`${e}`}:u(e)?Object.fromEntries(e):e)}const f=6,p=Symbol.for("@@mdb.bson.version"),h=2147483647,y=-2147483648,d=Math.pow(2,63)-1,b=-Math.pow(2,63),m=Math.pow(2,53),v=-Math.pow(2,53),g=1,_=2,w=3,O=4,S=5,$=6,j=7,P=8,A=9,E=10,x=11,T=12,k=13,N=14,I=15,B=16,D=17,M=18,R=19,U=255,C=127,F=0,L=4,V=Object.freeze({double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:-1,maxKey:127});class q extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(t,e){super(t,e)}static isBSONError(t){return null!=t&&"object"==typeof t&&"bsonError"in t&&!0===t.bsonError&&"name"in t&&"message"in t&&"stack"in t}}class J extends q{get name(){return"BSONVersionError"}constructor(){super(`Unsupported BSON version, bson types must be from bson ${f}.x.x`)}}class z extends q{get name(){return"BSONRuntimeError"}constructor(t){super(t)}}class K extends q{get name(){return"BSONOffsetError"}constructor(t,e,r){super(`${t}. offset: ${e}`,r),this.offset=e}}let H,W;function G(t,e,r,n){if(n){H??=new TextDecoder("utf8",{fatal:!0});try{return H.decode(t.subarray(e,r))}catch(t){throw new q("Invalid UTF-8 string in BSON document",{cause:t})}}return W??=new TextDecoder("utf8",{fatal:!1}),W.decode(t.subarray(e,r))}function Q(t,e,r){if(0===t.length)return"";const n=r-e;if(0===n)return"";if(n>20)return null;if(1===n&&t[e]<128)return String.fromCharCode(t[e]);if(2===n&&t[e]<128&&t[e+1]<128)return String.fromCharCode(t[e])+String.fromCharCode(t[e+1]);if(3===n&&t[e]<128&&t[e+1]<128&&t[e+2]<128)return String.fromCharCode(t[e])+String.fromCharCode(t[e+1])+String.fromCharCode(t[e+2]);const o=[];for(let n=e;n<r;n++){const e=t[n];if(e>127)return null;o.push(e)}return String.fromCharCode(...o)}const Y={toLocalBufferType(t){if(n.isBuffer(t))return t;if(ArrayBuffer.isView(t))return n.from(t.buffer,t.byteOffset,t.byteLength);const e=t?.[Symbol.toStringTag]??Object.prototype.toString.call(t);if("ArrayBuffer"===e||"SharedArrayBuffer"===e||"[object ArrayBuffer]"===e||"[object SharedArrayBuffer]"===e)return n.from(t);throw new q("Cannot create Buffer from the passed potentialBuffer.")},allocate:t=>n.alloc(t),allocateUnsafe:t=>n.allocUnsafe(t),equals:(t,e)=>Y.toLocalBufferType(t).equals(e),fromNumberArray:t=>n.from(t),fromBase64:t=>n.from(t,"base64"),toBase64:t=>Y.toLocalBufferType(t).toString("base64"),fromISO88591:t=>n.from(t,"binary"),toISO88591:t=>Y.toLocalBufferType(t).toString("binary"),fromHex:t=>n.from(t,"hex"),toHex:t=>Y.toLocalBufferType(t).toString("hex"),toUTF8(t,e,r,n){const o=r-e<=20?Q(t,e,r):null;if(null!=o)return o;const i=Y.toLocalBufferType(t).toString("utf8",e,r);if(n)for(let n=0;n<i.length;n++)if(65533===i.charCodeAt(n)){G(t,e,r,!0);break}return i},utf8ByteLength:t=>n.byteLength(t,"utf8"),encodeUTF8Into(t,e,r){const n=function(t,e,r){if(0===e.length)return 0;if(e.length>25)return null;if(t.length-r<e.length)return null;for(let n=0,o=r;n<e.length;n++,o++){const r=e.charCodeAt(n);if(r>127)return null;t[o]=r}return e.length}(t,e,r);return null!=n?n:Y.toLocalBufferType(t).write(e,r,void 0,"utf8")},randomBytes:function(t){return Y.fromNumberArray(Array.from({length:t},()=>Math.floor(256*Math.random())))},swap32:t=>Y.toLocalBufferType(t).swap32()};function Z(t){if(t<0)throw new RangeError(`The argument 'byteLength' is invalid. Received ${t}`);return et.fromNumberArray(Array.from({length:t},()=>Math.floor(256*Math.random())))}const X=(()=>{const{crypto:t}=globalThis;if(null!=t&&"function"==typeof t.getRandomValues)return e=>t.getRandomValues(et.allocate(e));if(function(){const{navigator:t}=globalThis;return"object"==typeof t&&"ReactNative"===t.product}()){const{console:t}=globalThis;t?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return Z})(),tt=/(\d|[a-f])/i,et={toLocalBufferType(t){const e=t?.[Symbol.toStringTag]??Object.prototype.toString.call(t);if("Uint8Array"===e)return t;if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));if("ArrayBuffer"===e||"SharedArrayBuffer"===e||"[object ArrayBuffer]"===e||"[object SharedArrayBuffer]"===e)return new Uint8Array(t);throw new q("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(t){if("number"!=typeof t)throw new TypeError(`The "size" argument must be of type number. Received ${String(t)}`);return new Uint8Array(t)},allocateUnsafe:t=>et.allocate(t),equals(t,e){if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},fromNumberArray:t=>Uint8Array.from(t),fromBase64:t=>Uint8Array.from(atob(t),t=>t.charCodeAt(0)),toBase64:t=>btoa(et.toISO88591(t)),fromISO88591:t=>Uint8Array.from(t,t=>255&t.charCodeAt(0)),toISO88591:t=>Array.from(Uint16Array.from(t),t=>String.fromCharCode(t)).join(""),fromHex(t){const e=t.length%2==0?t:t.slice(0,t.length-1),r=[];for(let t=0;t<e.length;t+=2){const n=e[t],o=e[t+1];if(!tt.test(n))break;if(!tt.test(o))break;const i=Number.parseInt(`${n}${o}`,16);r.push(i)}return Uint8Array.from(r)},toHex:t=>Array.from(t,t=>t.toString(16).padStart(2,"0")).join(""),toUTF8(t,e,r,n){const o=r-e<=20?Q(t,e,r):null;return null!=o?o:G(t,e,r,n)},utf8ByteLength:t=>(new TextEncoder).encode(t).byteLength,encodeUTF8Into(t,e,r){const n=(new TextEncoder).encode(e);return t.set(n,r),n.byteLength},randomBytes:X,swap32(t){if(t.length%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t.length;e+=4){const r=t[e],n=t[e+1],o=t[e+2],i=t[e+3];t[e]=i,t[e+1]=o,t[e+2]=n,t[e+3]=r}return t}},rt="function"==typeof n&&!0!==n.prototype?._isBuffer?Y:et;class nt{get[p](){return f}[Symbol.for("nodejs.util.inspect.custom")](t,e,r){return this.inspect(t,e,r)}}const ot=new Float64Array(1),it=new Uint8Array(ot.buffer,0,8);ot[0]=-1;const st=0===it[7],at={isBigEndian:st,getNonnegativeInt32LE(t,e){if(t[e+3]>127)throw new RangeError(`Size cannot be negative at offset: ${e}`);return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24},getInt32LE:(t,e)=>t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24,getUint32LE:(t,e)=>t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3],getUint32BE:(t,e)=>t[e+3]+256*t[e+2]+65536*t[e+1]+16777216*t[e],getBigInt64LE(t,e){const r=BigInt(t[e+4]+256*t[e+5]+65536*t[e+6]+(t[e+7]<<24)),n=BigInt(t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]);return(r<<BigInt(32))+n},getFloat64LE:st?(t,e)=>(it[7]=t[e],it[6]=t[e+1],it[5]=t[e+2],it[4]=t[e+3],it[3]=t[e+4],it[2]=t[e+5],it[1]=t[e+6],it[0]=t[e+7],ot[0]):(t,e)=>(it[0]=t[e],it[1]=t[e+1],it[2]=t[e+2],it[3]=t[e+3],it[4]=t[e+4],it[5]=t[e+5],it[6]=t[e+6],it[7]=t[e+7],ot[0]),setInt32BE:(t,e,r)=>(t[e+3]=r,r>>>=8,t[e+2]=r,r>>>=8,t[e+1]=r,r>>>=8,t[e]=r,4),setInt32LE:(t,e,r)=>(t[e]=r,r>>>=8,t[e+1]=r,r>>>=8,t[e+2]=r,r>>>=8,t[e+3]=r,4),setBigInt64LE(t,e,r){const n=BigInt(4294967295);let o=Number(r&n);t[e]=o,o>>=8,t[e+1]=o,o>>=8,t[e+2]=o,o>>=8,t[e+3]=o;let i=Number(r>>BigInt(32)&n);return t[e+4]=i,i>>=8,t[e+5]=i,i>>=8,t[e+6]=i,i>>=8,t[e+7]=i,8},setFloat64LE:st?(t,e,r)=>(ot[0]=r,t[e]=it[7],t[e+1]=it[6],t[e+2]=it[5],t[e+3]=it[4],t[e+4]=it[3],t[e+5]=it[2],t[e+6]=it[1],t[e+7]=it[0],8):(t,e,r)=>(ot[0]=r,t[e]=it[0],t[e+1]=it[1],t[e+2]=it[2],t[e+3]=it[3],t[e+4]=it[4],t[e+5]=it[5],t[e+6]=it[6],t[e+7]=it[7],8)};class ut extends nt{get _bsontype(){return"Binary"}constructor(t,e){if(super(),null!=t&&"string"==typeof t&&!ArrayBuffer.isView(t)&&!s(t)&&!Array.isArray(t))throw new q("Binary can only be constructed from Uint8Array or number[]");this.sub_type=e??ut.BSON_BINARY_SUBTYPE_DEFAULT,null==t?(this.buffer=rt.allocate(ut.BUFFER_SIZE),this.position=0):(this.buffer=Array.isArray(t)?rt.fromNumberArray(t):rt.toLocalBufferType(t),this.position=this.buffer.byteLength)}put(t){if("string"==typeof t&&1!==t.length)throw new q("only accepts single character String");if("number"!=typeof t&&1!==t.length)throw new q("only accepts single character Uint8Array or Array");let e;if(e="string"==typeof t?t.charCodeAt(0):"number"==typeof t?t:t[0],e<0||e>255)throw new q("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=e;else{const t=rt.allocate(ut.BUFFER_SIZE+this.buffer.length);t.set(this.buffer,0),this.buffer=t,this.buffer[this.position++]=e}}write(t,e){if(e="number"==typeof e?e:this.position,this.buffer.byteLength<e+t.length){const e=rt.allocate(this.buffer.byteLength+t.length);e.set(this.buffer,0),this.buffer=e}if(ArrayBuffer.isView(t))this.buffer.set(rt.toLocalBufferType(t),e),this.position=e+t.byteLength>this.position?e+t.length:this.position;else if("string"==typeof t)throw new q("input cannot be string")}read(t,e){const r=t+(e=e&&e>0?e:this.position);return this.buffer.subarray(t,r>this.position?this.position:r)}value(){return this.buffer.length===this.position?this.buffer:this.buffer.subarray(0,this.position)}length(){return this.position}toJSON(){return rt.toBase64(this.buffer.subarray(0,this.position))}toString(t){return"hex"===t?rt.toHex(this.buffer.subarray(0,this.position)):"base64"===t?rt.toBase64(this.buffer.subarray(0,this.position)):rt.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(t){t=t||{},this.sub_type===ut.SUBTYPE_VECTOR&&ct(this);const e=rt.toBase64(this.buffer),r=Number(this.sub_type).toString(16);return t.legacy?{$binary:e,$type:1===r.length?"0"+r:r}:{$binary:{base64:e,subType:1===r.length?"0"+r:r}}}toUUID(){if(this.sub_type===ut.SUBTYPE_UUID)return new pt(this.buffer.subarray(0,this.position));throw new q(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${ut.SUBTYPE_UUID}" is currently supported.`)}static createFromHexString(t,e){return new ut(rt.fromHex(t),e)}static createFromBase64(t,e){return new ut(rt.fromBase64(t),e)}static fromExtendedJSON(t,e){let r,n;if(e=e||{},"$binary"in t?e.legacy&&"string"==typeof t.$binary&&"$type"in t?(n=t.$type?parseInt(t.$type,16):0,r=rt.fromBase64(t.$binary)):"string"!=typeof t.$binary&&(n=t.$binary.subType?parseInt(t.$binary.subType,16):0,r=rt.fromBase64(t.$binary.base64)):"$uuid"in t&&(n=4,r=pt.bytesFromString(t.$uuid)),!r)throw new q(`Unexpected Binary Extended JSON format ${JSON.stringify(t)}`);return n===L?new pt(r):new ut(r,n)}inspect(t,e,r){return r??=l,`Binary.createFromBase64(${r(rt.toBase64(this.buffer.subarray(0,this.position)),e)}, ${r(this.sub_type,e)})`}toInt8Array(){if(this.sub_type!==ut.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ut.VECTOR_TYPE.Int8)throw new q("Binary datatype field is not Int8");return ct(this),new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==ut.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ut.VECTOR_TYPE.Float32)throw new q("Binary datatype field is not Float32");ct(this);const t=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));return at.isBigEndian&&rt.swap32(t),new Float32Array(t.buffer)}toPackedBits(){if(this.sub_type!==ut.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ut.VECTOR_TYPE.PackedBit)throw new q("Binary datatype field is not packed bit");return ct(this),new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==ut.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ut.VECTOR_TYPE.PackedBit)throw new q("Binary datatype field is not packed bit");ct(this);const t=8*(this.length()-2)-this.buffer[1],e=new Int8Array(t);for(let t=0;t<e.length;t++){const r=t/8|0,n=this.buffer[r+2]>>7-t%8&1;e[t]=n}return e}static fromInt8Array(t){const e=rt.allocate(t.byteLength+2);e[0]=ut.VECTOR_TYPE.Int8,e[1]=0;const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);e.set(r,2);const n=new this(e,this.SUBTYPE_VECTOR);return ct(n),n}static fromFloat32Array(t){const e=rt.allocate(t.byteLength+2);e[0]=ut.VECTOR_TYPE.Float32,e[1]=0;const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);e.set(r,2),at.isBigEndian&&rt.swap32(new Uint8Array(e.buffer,2));const n=new this(e,this.SUBTYPE_VECTOR);return ct(n),n}static fromPackedBits(t,e=0){const r=rt.allocate(t.byteLength+2);r[0]=ut.VECTOR_TYPE.PackedBit,r[1]=e,r.set(t,2);const n=new this(r,this.SUBTYPE_VECTOR);return ct(n),n}static fromBits(t){const e=t.length+7>>>3,r=new Uint8Array(e+2);r[0]=ut.VECTOR_TYPE.PackedBit;const n=t.length%8;r[1]=0===n?0:8-n;for(let e=0;e<t.length;e++){const n=e>>>3,o=t[e];if(0!==o&&1!==o)throw new q(`Invalid bit value at ${e}: must be 0 or 1, found ${t[e]}`);if(0===o)continue;const i=7-e%8;r[n+2]|=o<<i}return new this(r,ut.SUBTYPE_VECTOR)}}function ct(t){if(t.sub_type!==ut.SUBTYPE_VECTOR)return;const e=t.position,r=t.buffer[0],n=t.buffer[1];if((r===ut.VECTOR_TYPE.Float32||r===ut.VECTOR_TYPE.Int8)&&0!==n)throw new q("Invalid Vector: padding must be zero for int8 and float32 vectors");if(r===ut.VECTOR_TYPE.Float32&&0!==e&&e-2!=0&&(e-2)%4!=0)throw new q("Invalid Vector: Float32 vector must contain a multiple of 4 bytes");if(r===ut.VECTOR_TYPE.PackedBit&&0!==n&&2===e)throw new q("Invalid Vector: padding must be zero for packed bit vectors that are empty");if(r===ut.VECTOR_TYPE.PackedBit&&n>7)throw new q(`Invalid Vector: padding must be a value between 0 and 7. found: ${n}`)}ut.BSON_BINARY_SUBTYPE_DEFAULT=0,ut.BUFFER_SIZE=256,ut.SUBTYPE_DEFAULT=0,ut.SUBTYPE_FUNCTION=1,ut.SUBTYPE_BYTE_ARRAY=2,ut.SUBTYPE_UUID_OLD=3,ut.SUBTYPE_UUID=4,ut.SUBTYPE_MD5=5,ut.SUBTYPE_ENCRYPTED=6,ut.SUBTYPE_COLUMN=7,ut.SUBTYPE_SENSITIVE=8,ut.SUBTYPE_VECTOR=9,ut.SUBTYPE_USER_DEFINED=128,ut.VECTOR_TYPE=Object.freeze({Int8:3,Float32:39,PackedBit:16});const lt=/^[0-9A-F]{32}$/i,ft=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class pt extends ut{constructor(t){let e;if(null==t)e=pt.generate();else if(t instanceof pt)e=rt.toLocalBufferType(new Uint8Array(t.buffer));else if(ArrayBuffer.isView(t)&&16===t.byteLength)e=rt.toLocalBufferType(t);else{if("string"!=typeof t)throw new q("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");e=pt.bytesFromString(t)}super(e,L)}get id(){return this.buffer}set id(t){this.buffer=t}toHexString(t=!0){return t?[rt.toHex(this.buffer.subarray(0,4)),rt.toHex(this.buffer.subarray(4,6)),rt.toHex(this.buffer.subarray(6,8)),rt.toHex(this.buffer.subarray(8,10)),rt.toHex(this.buffer.subarray(10,16))].join("-"):rt.toHex(this.buffer)}toString(t){return"hex"===t?rt.toHex(this.id):"base64"===t?rt.toBase64(this.id):this.toHexString()}toJSON(){return this.toHexString()}equals(t){if(!t)return!1;if(t instanceof pt)return rt.equals(t.id,this.id);try{return rt.equals(new pt(t).id,this.id)}catch{return!1}}toBinary(){return new ut(this.id,ut.SUBTYPE_UUID)}static generate(){const t=rt.randomBytes(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,t}static isValid(t){return!!t&&("string"==typeof t?pt.isValidUUIDString(t):i(t)?16===t.byteLength:"Binary"===t._bsontype&&t.sub_type===this.SUBTYPE_UUID&&16===t.buffer.byteLength)}static createFromHexString(t){const e=pt.bytesFromString(t);return new pt(e)}static createFromBase64(t){return new pt(rt.fromBase64(t))}static bytesFromString(t){if(!pt.isValidUUIDString(t))throw new q("UUID string representation must be 32 hex digits or canonical hyphenated representation");return rt.fromHex(t.replace(/-/g,""))}static isValidUUIDString(t){return lt.test(t)||ft.test(t)}inspect(t,e,r){return r??=l,`new UUID(${r(this.toHexString(),e)})`}}class ht extends nt{get _bsontype(){return"Code"}constructor(t,e){super(),this.code=t.toString(),this.scope=e??null}toJSON(){return null!=this.scope?{code:this.code,scope:this.scope}:{code:this.code}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(t){return new ht(t.$code,t.$scope)}inspect(t,e,r){r??=l;let n=r(this.code,e);const o=n.includes("\n");return null!=this.scope&&(n+=`,${o?"\n":" "}${r(this.scope,e)}`),`new Code(${o?"\n":""}${n}${o&&null===this.scope?"\n":""})`}}function yt(t){return null!=t&&"object"==typeof t&&"$id"in t&&null!=t.$id&&"$ref"in t&&"string"==typeof t.$ref&&(!("$db"in t)||"$db"in t&&"string"==typeof t.$db)}class dt extends nt{get _bsontype(){return"DBRef"}constructor(t,e,r,n){super();const o=t.split(".");2===o.length&&(r=o.shift(),t=o.shift()),this.collection=t,this.oid=e,this.db=r,this.fields=n||{}}get namespace(){return this.collection}set namespace(t){this.collection=t}toJSON(){const t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(t.$db=this.db),t}toExtendedJSON(t){t=t||{};let e={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(e.$db=this.db),e=Object.assign(e,this.fields)),e}static fromExtendedJSON(t){const e=Object.assign({},t);return delete e.$ref,delete e.$id,delete e.$db,new dt(t.$ref,t.$id,t.$db,e)}inspect(t,e,r){r??=l;const n=[r(this.namespace,e),r(this.oid,e),...this.db?[r(this.db,e)]:[],...Object.keys(this.fields).length>0?[r(this.fields,e)]:[]];return n[1]=r===l?`new ObjectId(${n[1]})`:n[1],`new DBRef(${n.join(", ")})`}}function bt(t){if(""===t)return t;let e=0;const r="-"===t[e],n="+"===t[e];(n||r)&&(e+=1);let o=!1;for(;e<t.length&&"0"===t[e];++e)o=!0;return o?`${r?"-":""}${t.length===e?"0":t.slice(e)}`:n?t.slice(1):t}let mt;try{mt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}const vt=4294967296,gt=0x10000000000000000,_t=gt/2,wt={},Ot={},St=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class $t extends nt{get _bsontype(){return"Long"}get __isLong__(){return!0}constructor(t=0,e,r){super();const n="boolean"==typeof e?e:Boolean(r),o="number"==typeof e?e:0,i="string"==typeof t?$t.fromString(t,n):"bigint"==typeof t?$t.fromBigInt(t,n):{low:0|t,high:0|o,unsigned:n};this.low=i.low,this.high=i.high,this.unsigned=i.unsigned}static fromBits(t,e,r){return new $t(t,e,r)}static fromInt(t,e){let r,n,o;return e?(o=0<=(t>>>=0)&&t<256)&&(n=Ot[t],n)?n:(r=$t.fromBits(t,(0|t)<0?-1:0,!0),o&&(Ot[t]=r),r):(o=-128<=(t|=0)&&t<128)&&(n=wt[t],n)?n:(r=$t.fromBits(t,t<0?-1:0,!1),o&&(wt[t]=r),r)}static fromNumber(t,e){if(isNaN(t))return e?$t.UZERO:$t.ZERO;if(e){if(t<0)return $t.UZERO;if(t>=gt)return $t.MAX_UNSIGNED_VALUE}else{if(t<=-0x8000000000000000)return $t.MIN_VALUE;if(t+1>=_t)return $t.MAX_VALUE}return t<0?$t.fromNumber(-t,e).neg():$t.fromBits(t%vt|0,t/vt|0,e)}static fromBigInt(t,e){const r=BigInt(4294967295),n=BigInt(32);return new $t(Number(t&r),Number(t>>n&r),e)}static _fromString(t,e,r){if(0===t.length)throw new q("empty string");if(r<2||36<r)throw new q("radix");let n;if((n=t.indexOf("-"))>0)throw new q("interior hyphen");if(0===n)return $t._fromString(t.substring(1),e,r).neg();const o=$t.fromNumber(Math.pow(r,8));let i=$t.ZERO;for(let e=0;e<t.length;e+=8){const n=Math.min(8,t.length-e),s=parseInt(t.substring(e,e+n),r);if(n<8){const t=$t.fromNumber(Math.pow(r,n));i=i.mul(t).add($t.fromNumber(s))}else i=i.mul(o),i=i.add($t.fromNumber(s))}return i.unsigned=e,i}static fromStringStrict(t,e,r){let n=!1;if("number"==typeof e?(r=e,e=!1):n=!!e,r??=10,t.trim()!==t)throw new q(`Input: '${t}' contains leading and/or trailing whitespace`);if(!function(t,e){const r="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,e=e??10);return!new RegExp(`[^-+${r}]`,"i").test(t)&&t}(t,r))throw new q(`Input: '${t}' contains invalid characters for radix: ${r}`);const o=bt(t),i=$t._fromString(o,n,r);if(i.toString(r).toLowerCase()!==o.toLowerCase())throw new q(`Input: ${t} is not representable as ${i.unsigned?"an unsigned":"a signed"} 64-bit Long ${null!=r?`with radix: ${r}`:""}`);return i}static fromString(t,e,r){let n=!1;return"number"==typeof e?(r=e,e=!1):n=!!e,r??=10,"NaN"===t&&r<24||("Infinity"===t||"+Infinity"===t||"-Infinity"===t)&&r<35?$t.ZERO:$t._fromString(t,n,r)}static fromBytes(t,e,r){return r?$t.fromBytesLE(t,e):$t.fromBytesBE(t,e)}static fromBytesLE(t,e){return new $t(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)}static fromBytesBE(t,e){return new $t(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}static isLong(t){return null!=t&&"object"==typeof t&&"__isLong__"in t&&!0===t.__isLong__}static fromValue(t,e){return"number"==typeof t?$t.fromNumber(t,e):"string"==typeof t?$t.fromString(t,e):$t.fromBits(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}add(t){$t.isLong(t)||(t=$t.fromValue(t));const e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=t.high>>>16,s=65535&t.high,a=t.low>>>16;let u=0,c=0,l=0,f=0;return f+=o+(65535&t.low),l+=f>>>16,f&=65535,l+=n+a,c+=l>>>16,l&=65535,c+=r+s,u+=c>>>16,c&=65535,u+=e+i,u&=65535,$t.fromBits(l<<16|f,u<<16|c,this.unsigned)}and(t){return $t.isLong(t)||(t=$t.fromValue(t)),$t.fromBits(this.low&t.low,this.high&t.high,this.unsigned)}compare(t){if($t.isLong(t)||(t=$t.fromValue(t)),this.eq(t))return 0;const e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1}comp(t){return this.compare(t)}divide(t){if($t.isLong(t)||(t=$t.fromValue(t)),t.isZero())throw new q("division by zero");if(mt){if(!this.unsigned&&-2147483648===this.high&&-1===t.low&&-1===t.high)return this;const e=(this.unsigned?mt.div_u:mt.div_s)(this.low,this.high,t.low,t.high);return $t.fromBits(e,mt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?$t.UZERO:$t.ZERO;let e,r,n;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return $t.UZERO;if(t.gt(this.shru(1)))return $t.UONE;n=$t.UZERO}else{if(this.eq($t.MIN_VALUE))return t.eq($t.ONE)||t.eq($t.NEG_ONE)?$t.MIN_VALUE:t.eq($t.MIN_VALUE)?$t.ONE:(e=this.shr(1).div(t).shl(1),e.eq($t.ZERO)?t.isNegative()?$t.ONE:$t.NEG_ONE:(r=this.sub(t.mul(e)),n=e.add(r.div(t)),n));if(t.eq($t.MIN_VALUE))return this.unsigned?$t.UZERO:$t.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();n=$t.ZERO}for(r=this;r.gte(t);){e=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));const o=Math.ceil(Math.log(e)/Math.LN2),i=o<=48?1:Math.pow(2,o-48);let s=$t.fromNumber(e),a=s.mul(t);for(;a.isNegative()||a.gt(r);)e-=i,s=$t.fromNumber(e,this.unsigned),a=s.mul(t);s.isZero()&&(s=$t.ONE),n=n.add(s),r=r.sub(a)}return n}div(t){return this.divide(t)}equals(t){return $t.isLong(t)||(t=$t.fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low}eq(t){return this.equals(t)}getHighBits(){return this.high}getHighBitsUnsigned(){return this.high>>>0}getLowBits(){return this.low}getLowBitsUnsigned(){return this.low>>>0}getNumBitsAbs(){if(this.isNegative())return this.eq($t.MIN_VALUE)?64:this.neg().getNumBitsAbs();const t=0!==this.high?this.high:this.low;let e;for(e=31;e>0&&!(t&1<<e);e--);return 0!==this.high?e+33:e+1}greaterThan(t){return this.comp(t)>0}gt(t){return this.greaterThan(t)}greaterThanOrEqual(t){return this.comp(t)>=0}gte(t){return this.greaterThanOrEqual(t)}ge(t){return this.greaterThanOrEqual(t)}isEven(){return!(1&this.low)}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return!(1&~this.low)}isPositive(){return this.unsigned||this.high>=0}isZero(){return 0===this.high&&0===this.low}lessThan(t){return this.comp(t)<0}lt(t){return this.lessThan(t)}lessThanOrEqual(t){return this.comp(t)<=0}lte(t){return this.lessThanOrEqual(t)}modulo(t){if($t.isLong(t)||(t=$t.fromValue(t)),mt){const e=(this.unsigned?mt.rem_u:mt.rem_s)(this.low,this.high,t.low,t.high);return $t.fromBits(e,mt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))}mod(t){return this.modulo(t)}rem(t){return this.modulo(t)}multiply(t){if(this.isZero())return $t.ZERO;if($t.isLong(t)||(t=$t.fromValue(t)),mt){const e=mt.mul(this.low,this.high,t.low,t.high);return $t.fromBits(e,mt.get_high(),this.unsigned)}if(t.isZero())return $t.ZERO;if(this.eq($t.MIN_VALUE))return t.isOdd()?$t.MIN_VALUE:$t.ZERO;if(t.eq($t.MIN_VALUE))return this.isOdd()?$t.MIN_VALUE:$t.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt($t.TWO_PWR_24)&&t.lt($t.TWO_PWR_24))return $t.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);const e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=t.high>>>16,s=65535&t.high,a=t.low>>>16,u=65535&t.low;let c=0,l=0,f=0,p=0;return p+=o*u,f+=p>>>16,p&=65535,f+=n*u,l+=f>>>16,f&=65535,f+=o*a,l+=f>>>16,f&=65535,l+=r*u,c+=l>>>16,l&=65535,l+=n*a,c+=l>>>16,l&=65535,l+=o*s,c+=l>>>16,l&=65535,c+=e*u+r*a+n*s+o*i,c&=65535,$t.fromBits(f<<16|p,c<<16|l,this.unsigned)}mul(t){return this.multiply(t)}negate(){return!this.unsigned&&this.eq($t.MIN_VALUE)?$t.MIN_VALUE:this.not().add($t.ONE)}neg(){return this.negate()}not(){return $t.fromBits(~this.low,~this.high,this.unsigned)}notEquals(t){return!this.equals(t)}neq(t){return this.notEquals(t)}ne(t){return this.notEquals(t)}or(t){return $t.isLong(t)||(t=$t.fromValue(t)),$t.fromBits(this.low|t.low,this.high|t.high,this.unsigned)}shiftLeft(t){return $t.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?$t.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):$t.fromBits(0,this.low<<t-32,this.unsigned)}shl(t){return this.shiftLeft(t)}shiftRight(t){return $t.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?$t.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):$t.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)}shr(t){return this.shiftRight(t)}shiftRightUnsigned(t){if($t.isLong(t)&&(t=t.toInt()),0==(t&=63))return this;{const e=this.high;if(t<32){const r=this.low;return $t.fromBits(r>>>t|e<<32-t,e>>>t,this.unsigned)}return 32===t?$t.fromBits(e,0,this.unsigned):$t.fromBits(e>>>t-32,0,this.unsigned)}}shr_u(t){return this.shiftRightUnsigned(t)}shru(t){return this.shiftRightUnsigned(t)}subtract(t){return $t.isLong(t)||(t=$t.fromValue(t)),this.add(t.neg())}sub(t){return this.subtract(t)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*vt+(this.low>>>0):this.high*vt+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(t){return t?this.toBytesLE():this.toBytesBE()}toBytesLE(){const t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]}toBytesBE(){const t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]}toSigned(){return this.unsigned?$t.fromBits(this.low,this.high,!1):this}toString(t){if((t=t||10)<2||36<t)throw new q("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq($t.MIN_VALUE)){const e=$t.fromNumber(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}const e=$t.fromNumber(Math.pow(t,6),this.unsigned);let r=this,n="";for(;;){const o=r.div(e);let i=(r.sub(o.mul(e)).toInt()>>>0).toString(t);if(r=o,r.isZero())return i+n;for(;i.length<6;)i="0"+i;n=""+i+n}}toUnsigned(){return this.unsigned?this:$t.fromBits(this.low,this.high,!0)}xor(t){return $t.isLong(t)||(t=$t.fromValue(t)),$t.fromBits(this.low^t.low,this.high^t.high,this.unsigned)}eqz(){return this.isZero()}le(t){return this.lessThanOrEqual(t)}toExtendedJSON(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(t,e){const{useBigInt64:r=!1,relaxed:n=!0}={...e};if(t.$numberLong.length>20)throw new q("$numberLong string is too long");if(!St.test(t.$numberLong))throw new q(`$numberLong string "${t.$numberLong}" is in an invalid format`);if(r){const e=BigInt(t.$numberLong);return BigInt.asIntN(64,e)}const o=$t.fromString(t.$numberLong);return n?o.toNumber():o}inspect(t,e,r){return r??=l,`new Long(${r(this.toString(),e)}${this.unsigned?`, ${r(this.unsigned,e)}`:""})`}}$t.TWO_PWR_24=$t.fromInt(1<<24),$t.MAX_UNSIGNED_VALUE=$t.fromBits(-1,-1,!0),$t.ZERO=$t.fromInt(0),$t.UZERO=$t.fromInt(0,!0),$t.ONE=$t.fromInt(1),$t.UONE=$t.fromInt(1,!0),$t.NEG_ONE=$t.fromInt(-1),$t.MAX_VALUE=$t.fromBits(-1,2147483647,!1),$t.MIN_VALUE=$t.fromBits(0,-2147483648,!1);const jt=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Pt=/^(\+|-)?(Infinity|inf)$/i,At=/^(\+|-)?NaN$/i,Et=6111,xt=-6176,Tt=rt.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),kt=rt.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),Nt=rt.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),It=/^([-+])?(\d+)?$/;function Bt(t){return!isNaN(parseInt(t,10))}function Dt(t){const e=$t.fromNumber(1e9);let r=$t.fromNumber(0);if(!(t.parts[0]||t.parts[1]||t.parts[2]||t.parts[3]))return{quotient:t,rem:r};for(let n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new $t(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function Mt(t,e){throw new q(`"${t}" is not a valid Decimal128 string - ${e}`)}class Rt extends nt{get _bsontype(){return"Decimal128"}constructor(t){if(super(),"string"==typeof t)this.bytes=Rt.fromString(t).bytes;else{if(!(t instanceof Uint8Array||i(t)))throw new q("Decimal128 must take a Buffer or string");if(16!==t.byteLength)throw new q("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}}static fromString(t){return Rt._fromString(t,{allowRounding:!1})}static fromStringWithRounding(t){return Rt._fromString(t,{allowRounding:!0})}static _fromString(t,e){let r=!1,n=!1,o=!1,i=!1,s=0,a=0,u=0,c=0,l=0;const f=[0];let p=0,h=0,y=0,d=0,b=new $t(0,0),m=new $t(0,0),v=0,g=0;if(t.length>=7e3)throw new q(t+" not a valid Decimal128 string");const _=t.match(jt),w=t.match(Pt),O=t.match(At);if(!_&&!w&&!O||0===t.length)throw new q(t+" not a valid Decimal128 string");if(_){const e=_[2],r=_[4],n=_[5],o=_[6];r&&void 0===o&&Mt(t,"missing exponent power"),r&&void 0===e&&Mt(t,"missing exponent base"),void 0===r&&(n||o)&&Mt(t,"missing e before exponent")}if("+"!==t[g]&&"-"!==t[g]||(n=!0,r="-"===t[g++]),!Bt(t[g])&&"."!==t[g]){if("i"===t[g]||"I"===t[g])return new Rt(r?kt:Nt);if("N"===t[g])return new Rt(Tt)}for(;Bt(t[g])||"."===t[g];)"."!==t[g]?(p<34&&("0"!==t[g]||i)&&(i||(l=a),i=!0,f[h++]=parseInt(t[g],10),p+=1),i&&(u+=1),o&&(c+=1),a+=1,g+=1):(o&&Mt(t,"contains multiple periods"),o=!0,g+=1);if(o&&!a)throw new q(t+" not a valid Decimal128 string");if("e"===t[g]||"E"===t[g]){const e=t.substr(++g).match(It);if(!e||!e[2])return new Rt(Tt);d=parseInt(e[0],10),g+=e[0].length}if(t[g])return new Rt(Tt);if(p){if(y=p-1,s=u,1!==s)for(;"0"===t[l+s-1+Number(n)+Number(o)];)s-=1}else f[0]=0,u=1,p=1,s=0;for(d<=c&&c>d+16384?d=xt:d-=c;d>Et;){if(y+=1,y>=34){if(0===s){d=Et;break}Mt(t,"overflow")}d-=1}if(e.allowRounding){for(;d<xt||p<u;){if(0===y&&s<p){d=xt,s=0;break}if(p<u?u-=1:y-=1,d<Et)d+=1;else{if(f.join("").match(/^0+$/)){d=Et;break}Mt(t,"overflow")}}if(y+1<s){let e=a;o&&(l+=1,e+=1),n&&(l+=1,e+=1);const i=parseInt(t[l+y+1],10);let s=0;if(i>=5&&(s=1,5===i)){s=f[y]%2==1?1:0;for(let r=l+y+2;r<e;r++)if(parseInt(t[r],10)){s=1;break}}if(s){let t=y;for(;t>=0&&++f[t]>9;t--)if(f[t]=0,0===t){if(!(d<Et))return new Rt(r?kt:Nt);d+=1,f[t]=1}}}}else{for(;d<xt||p<u;){if(0===y){if(0===s){d=xt;break}Mt(t,"exponent underflow")}p<u?("0"!==t[u-1+Number(n)+Number(o)]&&0!==s&&Mt(t,"inexact rounding"),u-=1):(0!==f[y]&&Mt(t,"inexact rounding"),y-=1),d<Et?d+=1:Mt(t,"overflow")}y+1<s&&(o&&(l+=1),n&&(l+=1),0!==parseInt(t[l+y+1],10)&&Mt(t,"inexact rounding"))}if(b=$t.fromNumber(0),m=$t.fromNumber(0),0===s)b=$t.fromNumber(0),m=$t.fromNumber(0);else if(y<17){let t=0;for(m=$t.fromNumber(f[t++]),b=new $t(0,0);t<=y;t++)m=m.multiply($t.fromNumber(10)),m=m.add($t.fromNumber(f[t]))}else{let t=0;for(b=$t.fromNumber(f[t++]);t<=y-17;t++)b=b.multiply($t.fromNumber(10)),b=b.add($t.fromNumber(f[t]));for(m=$t.fromNumber(f[t++]);t<=y;t++)m=m.multiply($t.fromNumber(10)),m=m.add($t.fromNumber(f[t]))}const S=function(t,e){if(!t&&!e)return{high:$t.fromNumber(0),low:$t.fromNumber(0)};const r=t.shiftRightUnsigned(32),n=new $t(t.getLowBits(),0),o=e.shiftRightUnsigned(32),i=new $t(e.getLowBits(),0);let s=r.multiply(o),a=r.multiply(i);const u=n.multiply(o);let c=n.multiply(i);return s=s.add(a.shiftRightUnsigned(32)),a=new $t(a.getLowBits(),0).add(u).add(c.shiftRightUnsigned(32)),s=s.add(a.shiftRightUnsigned(32)),c=a.shiftLeft(32).add(new $t(c.getLowBits(),0)),{high:s,low:c}}(b,$t.fromString("100000000000000000"));S.low=S.low.add(m),function(t,e){const r=t.high>>>0,n=e.high>>>0;return r<n||r===n&&t.low>>>0<e.low>>>0}(S.low,m)&&(S.high=S.high.add($t.fromNumber(1))),v=d+6176;const $={low:$t.fromNumber(0),high:$t.fromNumber(0)};S.high.shiftRightUnsigned(49).and($t.fromNumber(1)).equals($t.fromNumber(1))?($.high=$.high.or($t.fromNumber(3).shiftLeft(61)),$.high=$.high.or($t.fromNumber(v).and($t.fromNumber(16383).shiftLeft(47))),$.high=$.high.or(S.high.and($t.fromNumber(0x7fffffffffff)))):($.high=$.high.or($t.fromNumber(16383&v).shiftLeft(49)),$.high=$.high.or(S.high.and($t.fromNumber(562949953421311)))),$.low=S.low,r&&($.high=$.high.or($t.fromString("9223372036854775808")));const j=rt.allocateUnsafe(16);return g=0,j[g++]=255&$.low.low,j[g++]=$.low.low>>8&255,j[g++]=$.low.low>>16&255,j[g++]=$.low.low>>24&255,j[g++]=255&$.low.high,j[g++]=$.low.high>>8&255,j[g++]=$.low.high>>16&255,j[g++]=$.low.high>>24&255,j[g++]=255&$.high.low,j[g++]=$.high.low>>8&255,j[g++]=$.high.low>>16&255,j[g++]=$.high.low>>24&255,j[g++]=255&$.high.high,j[g++]=$.high.high>>8&255,j[g++]=$.high.high>>16&255,j[g++]=$.high.high>>24&255,new Rt(j)}toString(){let t,e=0;const r=new Array(36);for(let t=0;t<r.length;t++)r[t]=0;let n,o,i,s=0,a=!1,u={parts:[0,0,0,0]};const c=[];s=0;const l=this.bytes,f=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,p=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,h=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,y=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24;s=0,(new $t(f,p),new $t(h,y)).lessThan($t.ZERO)&&c.push("-");const d=y>>26&31;if(d>>3==3){if(30===d)return c.join("")+"Infinity";if(31===d)return"NaN";t=y>>15&16383,n=8+(y>>14&1)}else n=y>>14&7,t=y>>17&16383;const b=t-6176;if(u.parts[0]=(16383&y)+((15&n)<<14),u.parts[1]=h,u.parts[2]=p,u.parts[3]=f,0===u.parts[0]&&0===u.parts[1]&&0===u.parts[2]&&0===u.parts[3])a=!0;else for(i=3;i>=0;i--){let t=0;const e=Dt(u);if(u=e.quotient,t=e.rem.low,t)for(o=8;o>=0;o--)r[9*i+o]=t%10,t=Math.floor(t/10)}if(a)e=1,r[s]=0;else for(e=36;!r[s];)e-=1,s+=1;const m=e-1+b;if(m>=34||m<=-7||b>0){if(e>34)return c.push("0"),b>0?c.push(`E+${b}`):b<0&&c.push(`E${b}`),c.join("");c.push(`${r[s++]}`),e-=1,e&&c.push(".");for(let t=0;t<e;t++)c.push(`${r[s++]}`);c.push("E"),m>0?c.push(`+${m}`):c.push(`${m}`)}else if(b>=0)for(let t=0;t<e;t++)c.push(`${r[s++]}`);else{let t=e+b;if(t>0)for(let e=0;e<t;e++)c.push(`${r[s++]}`);else c.push("0");for(c.push(".");t++<0;)c.push("0");for(let n=0;n<e-Math.max(t-1,0);n++)c.push(`${r[s++]}`)}return c.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(t){return Rt.fromString(t.$numberDecimal)}inspect(t,e,r){return r??=l,`new Decimal128(${r(this.toString(),e)})`}}class Ut extends nt{get _bsontype(){return"Double"}constructor(t){super(),t instanceof Number&&(t=t.valueOf()),this.value=+t}static fromString(t){const e=Number(t);if("NaN"===t)return new Ut(NaN);if("Infinity"===t)return new Ut(1/0);if("-Infinity"===t)return new Ut(-1/0);if(!Number.isFinite(e))throw new q(`Input: ${t} is not representable as a Double`);if(t.trim()!==t)throw new q(`Input: '${t}' contains whitespace`);if(""===t)throw new q("Input is an empty string");if(/[^-0-9.+eE]/.test(t))throw new q(`Input: '${t}' is not in decimal or exponential notation`);return new Ut(e)}valueOf(){return this.value}toJSON(){return this.value}toString(t){return this.value.toString(t)}toExtendedJSON(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-0.0"}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(t,e){const r=parseFloat(t.$numberDouble);return e&&e.relaxed?r:new Ut(r)}inspect(t,e,r){return r??=l,`new Double(${r(this.value,e)})`}}class Ct extends nt{get _bsontype(){return"Int32"}constructor(t){super(),t instanceof Number&&(t=t.valueOf()),this.value=0|+t}static fromString(t){const e=bt(t),r=Number(t);if(h<r)throw new q(`Input: '${t}' is larger than the maximum value for Int32`);if(y>r)throw new q(`Input: '${t}' is smaller than the minimum value for Int32`);if(!Number.isSafeInteger(r))throw new q(`Input: '${t}' is not a safe integer`);if(r.toString()!==e)throw new q(`Input: '${t}' is not a valid Int32 string`);return new Ct(r)}valueOf(){return this.value}toString(t){return this.value.toString(t)}toJSON(){return this.value}toExtendedJSON(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(t,e){return e&&e.relaxed?parseInt(t.$numberInt,10):new Ct(t.$numberInt)}inspect(t,e,r){return r??=l,`new Int32(${r(this.value,e)})`}}class Ft extends nt{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new Ft}inspect(){return"new MaxKey()"}}class Lt extends nt{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new Lt}inspect(){return"new MinKey()"}}let Vt=null;const qt=new WeakMap;class Jt extends nt{get _bsontype(){return"ObjectId"}constructor(t){let e;if(super(),"object"==typeof t&&t&&"id"in t){if("string"!=typeof t.id&&!ArrayBuffer.isView(t.id))throw new q("Argument passed in must have an id that is of type string or Buffer");e="toHexString"in t&&"function"==typeof t.toHexString?rt.fromHex(t.toHexString()):t.id}else e=t;if(null==e||"number"==typeof e)this.buffer=Jt.generate("number"==typeof e?e:void 0);else if(ArrayBuffer.isView(e)&&12===e.byteLength)this.buffer=rt.toLocalBufferType(e);else{if("string"!=typeof e)throw new q("Argument passed in does not match the accepted types");if(!Jt.validateHexString(e))throw new q("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");this.buffer=rt.fromHex(e),Jt.cacheHexString&&qt.set(this,e)}}get id(){return this.buffer}set id(t){this.buffer=t,Jt.cacheHexString&&qt.set(this,rt.toHex(t))}static validateHexString(t){if(24!==t?.length)return!1;for(let e=0;e<24;e++){const r=t.charCodeAt(e);if(!(r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70))return!1}return!0}toHexString(){if(Jt.cacheHexString){const t=qt.get(this);if(t)return t}const t=rt.toHex(this.id);return Jt.cacheHexString&&qt.set(this,t),t}static getInc(){return Jt.index=(Jt.index+1)%16777215}static generate(t){"number"!=typeof t&&(t=Math.floor(Date.now()/1e3));const e=Jt.getInc(),r=rt.allocateUnsafe(12);return at.setInt32BE(r,0,t),null===Vt&&(Vt=rt.randomBytes(5)),r[4]=Vt[0],r[5]=Vt[1],r[6]=Vt[2],r[7]=Vt[3],r[8]=Vt[4],r[11]=255&e,r[10]=e>>8&255,r[9]=e>>16&255,r}toString(t){return"base64"===t?rt.toBase64(this.id):this.toHexString()}toJSON(){return this.toHexString()}static is(t){return null!=t&&"object"==typeof t&&"_bsontype"in t&&"ObjectId"===t._bsontype}equals(t){if(null==t)return!1;if(Jt.is(t))return this.buffer[11]===t.buffer[11]&&rt.equals(this.buffer,t.buffer);if("string"==typeof t)return t.toLowerCase()===this.toHexString();if("object"==typeof t&&"function"==typeof t.toHexString){const e=t.toHexString(),r=this.toHexString();return"string"==typeof e&&e.toLowerCase()===r}return!1}getTimestamp(){const t=new Date,e=at.getUint32BE(this.buffer,0);return t.setTime(1e3*Math.floor(e)),t}static createPk(){return new Jt}serializeInto(t,e){return t[e]=this.buffer[0],t[e+1]=this.buffer[1],t[e+2]=this.buffer[2],t[e+3]=this.buffer[3],t[e+4]=this.buffer[4],t[e+5]=this.buffer[5],t[e+6]=this.buffer[6],t[e+7]=this.buffer[7],t[e+8]=this.buffer[8],t[e+9]=this.buffer[9],t[e+10]=this.buffer[10],t[e+11]=this.buffer[11],12}static createFromTime(t){const e=rt.allocate(12);for(let t=11;t>=4;t--)e[t]=0;return at.setInt32BE(e,0,t),new Jt(e)}static createFromHexString(t){if(24!==t?.length)throw new q("hex string must be 24 characters");return new Jt(rt.fromHex(t))}static createFromBase64(t){if(16!==t?.length)throw new q("base64 string must be 16 characters");return new Jt(rt.fromBase64(t))}static isValid(t){if(null==t)return!1;if("string"==typeof t)return Jt.validateHexString(t);try{return new Jt(t),!0}catch{return!1}}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(t){return new Jt(t.$oid)}isCached(){return Jt.cacheHexString&&qt.has(this)}inspect(t,e,r){return r??=l,`new ObjectId(${r(this.toHexString(),e)})`}}function zt(t,e,r){let n=5;if(Array.isArray(t))for(let o=0;o<t.length;o++)n+=Kt(o.toString(),t[o],e,!0,r);else{"function"==typeof t?.toBSON&&(t=t.toBSON());for(const o of Object.keys(t))n+=Kt(o,t[o],e,!1,r)}return n}function Kt(t,e,r=!1,n=!1,o=!1){switch("function"==typeof e?.toBSON&&(e=e.toBSON()),typeof e){case"string":return 1+rt.utf8ByteLength(t)+1+4+rt.utf8ByteLength(e)+1;case"number":return Math.floor(e)===e&&e>=v&&e<=m&&e>=y&&e<=h?(null!=t?rt.utf8ByteLength(t)+1:0)+5:(null!=t?rt.utf8ByteLength(t)+1:0)+9;case"undefined":return n||!o?(null!=t?rt.utf8ByteLength(t)+1:0)+1:0;case"boolean":return(null!=t?rt.utf8ByteLength(t)+1:0)+2;case"object":if(null!=e&&"string"==typeof e._bsontype&&e[p]!==f)throw new J;if(null==e||"MinKey"===e._bsontype||"MaxKey"===e._bsontype)return(null!=t?rt.utf8ByteLength(t)+1:0)+1;if("ObjectId"===e._bsontype)return(null!=t?rt.utf8ByteLength(t)+1:0)+13;if(e instanceof Date||c(e))return(null!=t?rt.utf8ByteLength(t)+1:0)+9;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||s(e))return(null!=t?rt.utf8ByteLength(t)+1:0)+6+e.byteLength;if("Long"===e._bsontype||"Double"===e._bsontype||"Timestamp"===e._bsontype)return(null!=t?rt.utf8ByteLength(t)+1:0)+9;if("Decimal128"===e._bsontype)return(null!=t?rt.utf8ByteLength(t)+1:0)+17;if("Code"===e._bsontype)return null!=e.scope&&Object.keys(e.scope).length>0?(null!=t?rt.utf8ByteLength(t)+1:0)+1+4+4+rt.utf8ByteLength(e.code.toString())+1+zt(e.scope,r,o):(null!=t?rt.utf8ByteLength(t)+1:0)+1+4+rt.utf8ByteLength(e.code.toString())+1;if("Binary"===e._bsontype){const r=e;return r.sub_type===ut.SUBTYPE_BYTE_ARRAY?(null!=t?rt.utf8ByteLength(t)+1:0)+(r.position+1+4+1+4):(null!=t?rt.utf8ByteLength(t)+1:0)+(r.position+1+4+1)}if("Symbol"===e._bsontype)return(null!=t?rt.utf8ByteLength(t)+1:0)+rt.utf8ByteLength(e.value)+4+1+1;if("DBRef"===e._bsontype){const n=Object.assign({$ref:e.collection,$id:e.oid},e.fields);return null!=e.db&&(n.$db=e.db),(null!=t?rt.utf8ByteLength(t)+1:0)+1+zt(n,r,o)}return e instanceof RegExp||a(e)?(null!=t?rt.utf8ByteLength(t)+1:0)+1+rt.utf8ByteLength(e.source)+1+(e.global?1:0)+(e.ignoreCase?1:0)+(e.multiline?1:0)+1:"BSONRegExp"===e._bsontype?(null!=t?rt.utf8ByteLength(t)+1:0)+1+rt.utf8ByteLength(e.pattern)+1+rt.utf8ByteLength(e.options)+1:(null!=t?rt.utf8ByteLength(t)+1:0)+zt(e,r,o)+1;case"function":return r?(null!=t?rt.utf8ByteLength(t)+1:0)+1+4+rt.utf8ByteLength(e.toString())+1:0;case"bigint":return(null!=t?rt.utf8ByteLength(t)+1:0)+9;case"symbol":return 0;default:throw new q("Unrecognized JS type: "+typeof e)}}Jt.index=Math.floor(16777215*Math.random());class Ht extends nt{get _bsontype(){return"BSONRegExp"}constructor(t,e){if(super(),this.pattern=t,this.options=(e??"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new q(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(-1!==this.options.indexOf("\0"))throw new q(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let t=0;t<this.options.length;t++)if("i"!==this.options[t]&&"m"!==this.options[t]&&"x"!==this.options[t]&&"l"!==this.options[t]&&"s"!==this.options[t]&&"u"!==this.options[t])throw new q(`The regular expression option [${this.options[t]}] is not supported`)}static parseOptions(t){return t?t.split("").sort().join(""):""}toExtendedJSON(t){return(t=t||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(t){if("$regex"in t){if("string"==typeof t.$regex)return new Ht(t.$regex,Ht.parseOptions(t.$options));if("BSONRegExp"===t.$regex._bsontype)return t}if("$regularExpression"in t)return new Ht(t.$regularExpression.pattern,Ht.parseOptions(t.$regularExpression.options));throw new q(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(t)}`)}inspect(t,e,r){const n=function(t){if(null!=t&&"object"==typeof t&&"stylize"in t&&"function"==typeof t.stylize)return t.stylize}(e)??(t=>t);return r??=l,`new BSONRegExp(${n(r(this.pattern),"regexp")}, ${n(r(this.options),"regexp")})`}}class Wt extends nt{get _bsontype(){return"BSONSymbol"}constructor(t){super(),this.value=t}valueOf(){return this.value}toString(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(t){return new Wt(t.$symbol)}inspect(t,e,r){return r??=l,`new BSONSymbol(${r(this.value,e)})`}}const Gt=$t;class Qt extends Gt{get _bsontype(){return"Timestamp"}get i(){return this.low>>>0}get t(){return this.high>>>0}constructor(t){if(null==t)super(0,0,!0);else if("bigint"==typeof t)super(t,!0);else if($t.isLong(t))super(t.low,t.high,!0);else{if("object"!=typeof t||!("t"in t)||!("i"in t))throw new q("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }");{if("number"!=typeof t.t&&("object"!=typeof t.t||"Int32"!==t.t._bsontype))throw new q("Timestamp constructed from { t, i } must provide t as a number");if("number"!=typeof t.i&&("object"!=typeof t.i||"Int32"!==t.i._bsontype))throw new q("Timestamp constructed from { t, i } must provide i as a number");const e=Number(t.t),r=Number(t.i);if(e<0||Number.isNaN(e))throw new q("Timestamp constructed from { t, i } must provide a positive t");if(r<0||Number.isNaN(r))throw new q("Timestamp constructed from { t, i } must provide a positive i");if(e>4294967295)throw new q("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(r>4294967295)throw new q("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(r,e,!0)}}}toJSON(){return{$timestamp:this.toString()}}static fromInt(t){return new Qt($t.fromInt(t,!0))}static fromNumber(t){return new Qt($t.fromNumber(t,!0))}static fromBits(t,e){return new Qt({i:t,t:e})}static fromString(t,e){return new Qt($t.fromString(t,!0,e))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(t){const e=$t.isLong(t.$timestamp.i)?t.$timestamp.i.getLowBitsUnsigned():t.$timestamp.i,r=$t.isLong(t.$timestamp.t)?t.$timestamp.t.getLowBitsUnsigned():t.$timestamp.t;return new Qt({t:r,i:e})}inspect(t,e,r){return r??=l,`new Timestamp({ t: ${r(this.t,e)}, i: ${r(this.i,e)} })`}}Qt.MAX_VALUE=$t.MAX_UNSIGNED_VALUE;const Yt=$t.fromNumber(m),Zt=$t.fromNumber(v);function Xt(t,e,r){const n=(e=null==e?{}:e)&&e.index?e.index:0,o=at.getInt32LE(t,n);if(o<5)throw new q(`bson size must be >= 5, is ${o}`);if(e.allowObjectSmallerThanBufferSize&&t.length<o)throw new q(`buffer length ${t.length} must be >= bson size ${o}`);if(!e.allowObjectSmallerThanBufferSize&&t.length!==o)throw new q(`buffer length ${t.length} must === bson size ${o}`);if(o+n>t.byteLength)throw new q(`(bson size ${o} + options.index ${n} must be <= buffer length ${t.byteLength})`);if(0!==t[n+o-1])throw new q("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return ee(t,n,e,r)}const te=/^\$ref$|^\$id$|^\$db$/;function ee(t,e,r,n=!1){const o=null==r.fieldsAsRaw?null:r.fieldsAsRaw,i=null!=r.raw&&r.raw,s="boolean"==typeof r.bsonRegExp&&r.bsonRegExp,a=r.promoteBuffers??!1,u=r.promoteLongs??!0,c=r.promoteValues??!0,l=r.useBigInt64??!1;if(l&&!c)throw new q("Must either request bigint or Long for int64 deserialization");if(l&&!u)throw new q("Must either request bigint or Long for int64 deserialization");let f,p,h=!0;const y=(null==r.validation?{utf8:!0}:r.validation).utf8;if("boolean"==typeof y)f=y;else{h=!1;const t=Object.keys(y).map(function(t){return y[t]});if(0===t.length)throw new q("UTF-8 validation setting cannot be empty");if("boolean"!=typeof t[0])throw new q("Invalid UTF-8 validation option, must specify boolean values");if(f=t[0],!t.every(t=>t===f))throw new q("Invalid UTF-8 validation option - keys must be all true or all false")}if(!h){p=new Set;for(const t of Object.keys(y))p.add(t)}const d=e;if(t.length<5)throw new q("corrupt bson message < 5 bytes long");const b=at.getInt32LE(t,e);if(e+=4,b<5||b>t.length)throw new q("corrupt bson message");const m=n?[]:{};let v=0,F=!n&&null;for(;;){const y=t[e++];if(0===y)break;let d=e;for(;0!==t[d]&&d<t.length;)d++;if(d>=t.byteLength)throw new q("Bad BSON Document: illegal CString");const b=n?v++:rt.toUTF8(t,e,d,!1);let V,J=!0;if(J=h||p?.has(b)?f:!f,!1!==F&&"$"===b[0]&&(F=te.test(b)),e=d+1,y===_){const r=at.getInt32LE(t,e);if(e+=4,r<=0||r>t.length-e||0!==t[e+r-1])throw new q("bad string length in bson");V=rt.toUTF8(t,e,e+r-1,J),e+=r}else if(y===j){const r=rt.allocateUnsafe(12);for(let n=0;n<12;n++)r[n]=t[e+n];V=new Jt(r),e+=12}else if(y===B&&!1===c)V=new Ct(at.getInt32LE(t,e)),e+=4;else if(y===B)V=at.getInt32LE(t,e),e+=4;else if(y===g)V=at.getFloat64LE(t,e),e+=8,!1===c&&(V=new Ut(V));else if(y===A){const r=at.getInt32LE(t,e),n=at.getInt32LE(t,e+4);e+=8,V=new Date(new $t(r,n).toNumber())}else if(y===P){if(0!==t[e]&&1!==t[e])throw new q("illegal boolean type value");V=1===t[e++]}else if(y===w){const n=e,o=at.getInt32LE(t,e);if(o<=0||o>t.length-e)throw new q("bad embedded document length in bson");if(i)V=t.subarray(e,e+o);else{let e=r;h||(e={...r,validation:{utf8:J}}),V=ee(t,n,e,!1)}e+=o}else if(y===O){const n=e,i=at.getInt32LE(t,e);let s=r;const a=e+i;if(o&&o[b]&&(s={...r,raw:!0}),h||(s={...s,validation:{utf8:J}}),V=ee(t,n,s,!0),0!==t[(e+=i)-1])throw new q("invalid array terminator byte");if(e!==a)throw new q("corrupted array bson")}else if(y===$)V=void 0;else if(y===E)V=null;else if(y===M)if(l)V=at.getBigInt64LE(t,e),e+=8;else{const r=at.getInt32LE(t,e),n=at.getInt32LE(t,e+4);e+=8;const o=new $t(r,n);V=u&&!0===c&&o.lessThanOrEqual(Yt)&&o.greaterThanOrEqual(Zt)?o.toNumber():o}else if(y===R){const r=rt.allocateUnsafe(16);for(let n=0;n<16;n++)r[n]=t[e+n];e+=16,V=new Rt(r)}else if(y===S){let r=at.getInt32LE(t,e);e+=4;const n=r,o=t[e++];if(r<0)throw new q("Negative binary type element size found");if(r>t.byteLength)throw new q("Binary type size larger than document size");if(o===ut.SUBTYPE_BYTE_ARRAY){if(r=at.getInt32LE(t,e),e+=4,r<0)throw new q("Negative binary type element size found for subtype 0x02");if(r>n-4)throw new q("Binary type with subtype 0x02 contains too long binary size");if(r<n-4)throw new q("Binary type with subtype 0x02 contains too short binary size")}a&&c?V=rt.toLocalBufferType(t.subarray(e,e+r)):(V=new ut(t.subarray(e,e+r),o),o===L&&pt.isValid(V)&&(V=V.toUUID())),e+=r}else if(y===x&&!1===s){for(d=e;0!==t[d]&&d<t.length;)d++;if(d>=t.length)throw new q("Bad BSON Document: illegal CString");const r=rt.toUTF8(t,e,d,!1);for(d=e=d+1;0!==t[d]&&d<t.length;)d++;if(d>=t.length)throw new q("Bad BSON Document: illegal CString");const n=rt.toUTF8(t,e,d,!1);e=d+1;const o=new Array(n.length);for(d=0;d<n.length;d++)switch(n[d]){case"m":o[d]="m";break;case"s":o[d]="g";break;case"i":o[d]="i"}V=new RegExp(r,o.join(""))}else if(y===x&&!0===s){for(d=e;0!==t[d]&&d<t.length;)d++;if(d>=t.length)throw new q("Bad BSON Document: illegal CString");const r=rt.toUTF8(t,e,d,!1);for(d=e=d+1;0!==t[d]&&d<t.length;)d++;if(d>=t.length)throw new q("Bad BSON Document: illegal CString");const n=rt.toUTF8(t,e,d,!1);e=d+1,V=new Ht(r,n)}else if(y===N){const r=at.getInt32LE(t,e);if(e+=4,r<=0||r>t.length-e||0!==t[e+r-1])throw new q("bad string length in bson");const n=rt.toUTF8(t,e,e+r-1,J);V=c?n:new Wt(n),e+=r}else if(y===D)V=new Qt({i:at.getUint32LE(t,e),t:at.getUint32LE(t,e+4)}),e+=8;else if(y===U)V=new Lt;else if(y===C)V=new Ft;else if(y===k){const r=at.getInt32LE(t,e);if(e+=4,r<=0||r>t.length-e||0!==t[e+r-1])throw new q("bad string length in bson");const n=rt.toUTF8(t,e,e+r-1,J);V=new ht(n),e+=r}else if(y===I){const n=at.getInt32LE(t,e);if(e+=4,n<13)throw new q("code_w_scope total size shorter minimum expected length");const o=at.getInt32LE(t,e);if(e+=4,o<=0||o>t.length-e||0!==t[e+o-1])throw new q("bad string length in bson");const i=rt.toUTF8(t,e,e+o-1,J),s=e+=o,a=at.getInt32LE(t,e),u=ee(t,s,r,!1);if(e+=a,n<8+a+o)throw new q("code_w_scope total size is too short, truncating scope");if(n>8+a+o)throw new q("code_w_scope total size is too long, clips outer document");V=new ht(i,u)}else{if(y!==T)throw new q(`Detected unknown BSON type ${y.toString(16)} for fieldname "${b}"`);{const r=at.getInt32LE(t,e);if(e+=4,r<=0||r>t.length-e||0!==t[e+r-1])throw new q("bad string length in bson");const n=rt.toUTF8(t,e,e+r-1,J);e+=r;const o=rt.allocateUnsafe(12);for(let r=0;r<12;r++)o[r]=t[e+r];const i=new Jt(o);e+=12,V=new dt(n,i)}}"__proto__"===b?Object.defineProperty(m,b,{value:V,writable:!0,enumerable:!0,configurable:!0}):m[b]=V}if(b!==e-d){if(n)throw new q("corrupt array bson");throw new q("corrupt object bson")}if(!F)return m;if(yt(m)){const t=Object.assign({},m);return delete t.$ref,delete t.$id,delete t.$db,new dt(m.$ref,m.$id,m.$db,t)}return m}const re=/\x00/,ne=new Set(["$db","$ref","$id","$clusterTime"]);function oe(t,e,r,n){t[n++]=_,t[(n=n+rt.encodeUTF8Into(t,e,n)+1)-1]=0;const o=rt.encodeUTF8Into(t,r,n+4);return at.setInt32LE(t,n,o+1),n=n+4+o,t[n++]=0,n}function ie(t,e,r,n){const o=!Object.is(r,-0)&&Number.isSafeInteger(r)&&r<=h&&r>=y?B:g;return t[n++]=o,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,n+(o===B?at.setInt32LE(t,n,r):at.setFloat64LE(t,n,r))}function se(t,e,r,n){return t[n++]=M,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,n+at.setBigInt64LE(t,n,r)}function ae(t,e,r,n){return t[n++]=E,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,n}function ue(t,e,r,n){return t[n++]=P,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,t[n++]=r?1:0,n}function ce(t,e,r,n){t[n++]=A,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const o=$t.fromNumber(r.getTime()),i=o.getLowBits(),s=o.getHighBits();return(n+=at.setInt32LE(t,n,i))+at.setInt32LE(t,n,s)}function le(t,e,r,n){if(t[n++]=x,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,r.source&&null!=r.source.match(re))throw new q("value "+r.source+" must not contain null bytes");return n+=rt.encodeUTF8Into(t,r.source,n),t[n++]=0,r.ignoreCase&&(t[n++]=105),r.global&&(t[n++]=115),r.multiline&&(t[n++]=109),t[n++]=0,n}function fe(t,e,r,n){if(t[n++]=x,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,null!=r.pattern.match(re))throw new q("pattern "+r.pattern+" must not contain null bytes");n+=rt.encodeUTF8Into(t,r.pattern,n),t[n++]=0;const o=r.options.split("").sort().join("");return n+=rt.encodeUTF8Into(t,o,n),t[n++]=0,n}function pe(t,e,r,n){return null===r?t[n++]=E:"MinKey"===r._bsontype?t[n++]=U:t[n++]=C,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,n}function he(t,e,r,n){return t[n++]=j,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,n+r.serializeInto(t,n)}function ye(t,e,r,n){t[n++]=S,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const o=r.length;if(n+=at.setInt32LE(t,n,o),t[n++]=F,o<=16)for(let e=0;e<o;e++)t[n+e]=r[e];else t.set(r,n);return n+o}function de(t,e,r,n,o,i,s,a,u){if(u.has(r))throw new q("Cannot convert circular structure to BSON");u.add(r),t[n++]=Array.isArray(r)?O:w,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const c=je(t,r,o,n,i+1,s,a,u);return u.delete(r),c}function be(t,e,r,n){t[n++]=R,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;for(let e=0;e<16;e++)t[n+e]=r.bytes[e];return n+16}function me(t,e,r,n){t[n++]="Long"===r._bsontype?M:D,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const o=r.getLowBits(),i=r.getHighBits();return(n+=at.setInt32LE(t,n,o))+at.setInt32LE(t,n,i)}function ve(t,e,r,n){return r=r.valueOf(),t[n++]=B,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,n+at.setInt32LE(t,n,r)}function ge(t,e,r,n){return t[n++]=g,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0,n+at.setFloat64LE(t,n,r.value)}function _e(t,e,r,n){t[n++]=k,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const o=r.toString(),i=rt.encodeUTF8Into(t,o,n+4)+1;return at.setInt32LE(t,n,i),n=n+4+i-1,t[n++]=0,n}function we(t,e,r,n,o=!1,i=0,s=!1,a=!0,u){if(r.scope&&"object"==typeof r.scope){t[n++]=I,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;let c=n;const l=r.code;n+=4;const f=rt.encodeUTF8Into(t,l,n+4)+1;at.setInt32LE(t,n,f),t[n+4+f-1]=0,n=n+f+4;const p=je(t,r.scope,o,n,i+1,s,a,u);n=p-1;const h=p-c;c+=at.setInt32LE(t,c,h),t[n++]=0}else{t[n++]=k,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const o=r.code.toString(),i=rt.encodeUTF8Into(t,o,n+4)+1;at.setInt32LE(t,n,i),n=n+4+i-1,t[n++]=0}return n}function Oe(t,e,r,n){t[n++]=S,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const o=r.buffer;let i=r.position;if(r.sub_type===ut.SUBTYPE_BYTE_ARRAY&&(i+=4),n+=at.setInt32LE(t,n,i),t[n++]=r.sub_type,r.sub_type===ut.SUBTYPE_BYTE_ARRAY&&(i-=4,n+=at.setInt32LE(t,n,i)),r.sub_type===ut.SUBTYPE_VECTOR&&ct(r),i<=16)for(let e=0;e<i;e++)t[n+e]=o[e];else t.set(o,n);return n+r.position}function Se(t,e,r,n){t[n++]=N,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;const o=rt.encodeUTF8Into(t,r.value,n+4)+1;return at.setInt32LE(t,n,o),n=n+4+o-1,t[n++]=0,n}function $e(t,e,r,n,o,i,s){t[n++]=w,n+=rt.encodeUTF8Into(t,e,n),t[n++]=0;let a=n,u={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(u.$db=r.db),u=Object.assign(u,r.fields);const c=je(t,u,!1,n,o+1,i,!0,s),l=c-a;return a+=at.setInt32LE(t,n,l),c}function je(t,e,r,n,o,l,h,y){if(null==y){if(null==e)return t[0]=5,t[1]=0,t[2]=0,t[3]=0,t[4]=0,5;if(Array.isArray(e))throw new q("serialize does not support an array as the root input");if("object"!=typeof e)throw new q("serialize does not support non-object as the root input");if("_bsontype"in e&&"string"==typeof e._bsontype)throw new q("BSON types cannot be serialized as a document");if(c(e)||a(e)||i(e)||s(e))throw new q("date, regexp, typedarray, and arraybuffer cannot be BSON documents");y=new Set}y.add(e);let d=n+4;if(Array.isArray(e))for(let n=0;n<e.length;n++){const s=`${n}`;let u=e[n];"function"==typeof u?.toBSON&&(u=u.toBSON());const b=typeof u;if(void 0===u)d=ae(t,s,0,d);else if(null===u)d=ae(t,s,0,d);else if("string"===b)d=oe(t,s,u,d);else if("number"===b)d=ie(t,s,u,d);else if("bigint"===b)d=se(t,s,u,d);else if("boolean"===b)d=ue(t,s,u,d);else if("object"===b&&null==u._bsontype)d=u instanceof Date||c(u)?ce(t,s,u,d):u instanceof Uint8Array||i(u)?ye(t,s,u,d):u instanceof RegExp||a(u)?le(t,s,u,d):de(t,s,u,d,r,o,l,h,y);else if("object"===b){if(u[p]!==f)throw new J;if("ObjectId"===u._bsontype)d=he(t,s,u,d);else if("Decimal128"===u._bsontype)d=be(t,s,u,d);else if("Long"===u._bsontype||"Timestamp"===u._bsontype)d=me(t,s,u,d);else if("Double"===u._bsontype)d=ge(t,s,u,d);else if("Code"===u._bsontype)d=we(t,s,u,d,r,o,l,h,y);else if("Binary"===u._bsontype)d=Oe(t,s,u,d);else if("BSONSymbol"===u._bsontype)d=Se(t,s,u,d);else if("DBRef"===u._bsontype)d=$e(t,s,u,d,o,l,y);else if("BSONRegExp"===u._bsontype)d=fe(t,s,u,d);else if("Int32"===u._bsontype)d=ve(t,s,u,d);else if("MinKey"===u._bsontype||"MaxKey"===u._bsontype)d=pe(t,s,u,d);else if(void 0!==u._bsontype)throw new q(`Unrecognized or invalid _bsontype: ${String(u._bsontype)}`)}else"function"===b&&l&&(d=_e(t,s,u,d))}else if(e instanceof Map||u(e)){const n=e.entries();let s=!1;for(;!s;){const e=n.next();if(s=!!e.done,s)continue;const u=e.value?e.value[0]:void 0;let b=e.value?e.value[1]:void 0;"function"==typeof b?.toBSON&&(b=b.toBSON());const m=typeof b;if("string"==typeof u&&!ne.has(u)){if(null!=u.match(re))throw new q("key "+u+" must not contain null bytes");if(r){if("$"===u[0])throw new q("key "+u+" must not start with '$'");if(u.includes("."))throw new q("key "+u+" must not contain '.'")}}if(void 0===b)!1===h&&(d=ae(t,u,0,d));else if(null===b)d=ae(t,u,0,d);else if("string"===m)d=oe(t,u,b,d);else if("number"===m)d=ie(t,u,b,d);else if("bigint"===m)d=se(t,u,b,d);else if("boolean"===m)d=ue(t,u,b,d);else if("object"===m&&null==b._bsontype)d=b instanceof Date||c(b)?ce(t,u,b,d):b instanceof Uint8Array||i(b)?ye(t,u,b,d):b instanceof RegExp||a(b)?le(t,u,b,d):de(t,u,b,d,r,o,l,h,y);else if("object"===m){if(b[p]!==f)throw new J;if("ObjectId"===b._bsontype)d=he(t,u,b,d);else if("Decimal128"===b._bsontype)d=be(t,u,b,d);else if("Long"===b._bsontype||"Timestamp"===b._bsontype)d=me(t,u,b,d);else if("Double"===b._bsontype)d=ge(t,u,b,d);else if("Code"===b._bsontype)d=we(t,u,b,d,r,o,l,h,y);else if("Binary"===b._bsontype)d=Oe(t,u,b,d);else if("BSONSymbol"===b._bsontype)d=Se(t,u,b,d);else if("DBRef"===b._bsontype)d=$e(t,u,b,d,o,l,y);else if("BSONRegExp"===b._bsontype)d=fe(t,u,b,d);else if("Int32"===b._bsontype)d=ve(t,u,b,d);else if("MinKey"===b._bsontype||"MaxKey"===b._bsontype)d=pe(t,u,b,d);else if(void 0!==b._bsontype)throw new q(`Unrecognized or invalid _bsontype: ${String(b._bsontype)}`)}else"function"===m&&l&&(d=_e(t,u,b,d))}}else{if("function"==typeof e?.toBSON&&null!=(e=e.toBSON())&&"object"!=typeof e)throw new q("toBSON function did not return an object");for(const n of Object.keys(e)){let s=e[n];"function"==typeof s?.toBSON&&(s=s.toBSON());const u=typeof s;if("string"==typeof n&&!ne.has(n)){if(null!=n.match(re))throw new q("key "+n+" must not contain null bytes");if(r){if("$"===n[0])throw new q("key "+n+" must not start with '$'");if(n.includes("."))throw new q("key "+n+" must not contain '.'")}}if(void 0===s)!1===h&&(d=ae(t,n,0,d));else if(null===s)d=ae(t,n,0,d);else if("string"===u)d=oe(t,n,s,d);else if("number"===u)d=ie(t,n,s,d);else if("bigint"===u)d=se(t,n,s,d);else if("boolean"===u)d=ue(t,n,s,d);else if("object"===u&&null==s._bsontype)d=s instanceof Date||c(s)?ce(t,n,s,d):s instanceof Uint8Array||i(s)?ye(t,n,s,d):s instanceof RegExp||a(s)?le(t,n,s,d):de(t,n,s,d,r,o,l,h,y);else if("object"===u){if(s[p]!==f)throw new J;if("ObjectId"===s._bsontype)d=he(t,n,s,d);else if("Decimal128"===s._bsontype)d=be(t,n,s,d);else if("Long"===s._bsontype||"Timestamp"===s._bsontype)d=me(t,n,s,d);else if("Double"===s._bsontype)d=ge(t,n,s,d);else if("Code"===s._bsontype)d=we(t,n,s,d,r,o,l,h,y);else if("Binary"===s._bsontype)d=Oe(t,n,s,d);else if("BSONSymbol"===s._bsontype)d=Se(t,n,s,d);else if("DBRef"===s._bsontype)d=$e(t,n,s,d,o,l,y);else if("BSONRegExp"===s._bsontype)d=fe(t,n,s,d);else if("Int32"===s._bsontype)d=ve(t,n,s,d);else if("MinKey"===s._bsontype||"MaxKey"===s._bsontype)d=pe(t,n,s,d);else if(void 0!==s._bsontype)throw new q(`Unrecognized or invalid _bsontype: ${String(s._bsontype)}`)}else"function"===u&&l&&(d=_e(t,n,s,d))}}y.delete(e),t[d++]=0;const b=d-n;return n+=at.setInt32LE(t,n,b),d}const Pe={$oid:Jt,$binary:ut,$uuid:ut,$symbol:Wt,$numberInt:Ct,$numberDecimal:Rt,$numberDouble:Ut,$numberLong:$t,$minKey:Lt,$maxKey:Ft,$regex:Ht,$regularExpression:Ht,$timestamp:Qt};function Ae(t,e={}){if("number"==typeof t){const r=t<=h&&t>=y,n=t<=d&&t>=b;if(e.relaxed||e.legacy)return t;if(Number.isInteger(t)&&!Object.is(t,-0)){if(r)return new Ct(t);if(n)return e.useBigInt64?BigInt(t):$t.fromNumber(t)}return new Ut(t)}if(null==t||"object"!=typeof t)return t;if(t.$undefined)return null;const r=Object.keys(t).filter(e=>e.startsWith("$")&&null!=t[e]);for(let n=0;n<r.length;n++){const o=Pe[r[n]];if(o)return o.fromExtendedJSON(t,e)}if(null!=t.$date){const r=t.$date,n=new Date;if(e.legacy)if("number"==typeof r)n.setTime(r);else if("string"==typeof r)n.setTime(Date.parse(r));else{if("bigint"!=typeof r)throw new z("Unrecognized type for EJSON date: "+typeof r);n.setTime(Number(r))}else if("string"==typeof r)n.setTime(Date.parse(r));else if($t.isLong(r))n.setTime(r.toNumber());else if("number"==typeof r&&e.relaxed)n.setTime(r);else{if("bigint"!=typeof r)throw new z("Unrecognized type for EJSON date: "+typeof r);n.setTime(Number(r))}return n}if(null!=t.$code){const e=Object.assign({},t);return t.$scope&&(e.$scope=Ae(t.$scope)),ht.fromExtendedJSON(t)}if(yt(t)||t.$dbPointer){const e=t.$ref?t:t.$dbPointer;if(e instanceof dt)return e;const r=Object.keys(e).filter(t=>t.startsWith("$"));let n=!0;if(r.forEach(t=>{-1===["$ref","$id","$db"].indexOf(t)&&(n=!1)}),n)return dt.fromExtendedJSON(e)}return t}function Ee(t){const e=t.toISOString();return 0!==t.getUTCMilliseconds()?e:e.slice(0,-5)+"Z"}function xe(t,e){if(t instanceof Map||u(t)){const r=Object.create(null);for(const[e,n]of t){if("string"!=typeof e)throw new q("Can only serialize maps with string keys");r[e]=n}return xe(r,e)}if(("object"==typeof t||"function"==typeof t)&&null!==t){const r=e.seenObjects.findIndex(e=>e.obj===t);if(-1!==r){const t=e.seenObjects.map(t=>t.propertyName),n=t.slice(0,r).map(t=>`${t} -> `).join(""),o=t[r],i=" -> "+t.slice(r+1,t.length-1).map(t=>`${t} -> `).join(""),s=t[t.length-1],a=" ".repeat(n.length+o.length/2),u="-".repeat(i.length+(o.length+s.length)/2-1);throw new q(`Converting circular structure to EJSON:\n ${n}${o}${i}${s}\n ${a}\\${u}/`)}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return function(t,e){return t.map((t,r)=>{e.seenObjects.push({propertyName:`index ${r}`,obj:null});try{return xe(t,e)}finally{e.seenObjects.pop()}})}(t,e);if(void 0===t)return null;if(t instanceof Date||c(t)){const r=t.getTime(),n=r>-1&&r<2534023188e5;return e.legacy?e.relaxed&&n?{$date:t.getTime()}:{$date:Ee(t)}:e.relaxed&&n?{$date:Ee(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(!("number"!=typeof t||e.relaxed&&isFinite(t))){if(Number.isInteger(t)&&!Object.is(t,-0)){if(t>=y&&t<=h)return{$numberInt:t.toString()};if(t>=b&&t<=d)return{$numberLong:t.toString()}}return{$numberDouble:Object.is(t,-0)?"-0.0":t.toString()}}if("bigint"==typeof t)return e.relaxed?Number(BigInt.asIntN(64,t)):{$numberLong:BigInt.asIntN(64,t).toString()};if(t instanceof RegExp||a(t)){let r=t.flags;if(void 0===r){const e=t.toString().match(/[gimuy]*$/);e&&(r=e[0])}return new Ht(t.source,r).toExtendedJSON(e)}return null!=t&&"object"==typeof t?function(t,e){if(null==t||"object"!=typeof t)throw new q("not an object instance");const r=t._bsontype;if(void 0===r){const r={};for(const n of Object.keys(t)){e.seenObjects.push({propertyName:n,obj:null});try{const o=xe(t[n],e);"__proto__"===n?Object.defineProperty(r,n,{value:o,writable:!0,enumerable:!0,configurable:!0}):r[n]=o}finally{e.seenObjects.pop()}}return r}if(null!=t&&"object"==typeof t&&"string"==typeof t._bsontype&&t[p]!==f)throw new J;if(function(t){return null!=t&&"object"==typeof t&&"_bsontype"in t&&"string"==typeof t._bsontype}(t)){let n=t;if("function"!=typeof n.toExtendedJSON){const e=Te[t._bsontype];if(!e)throw new q("Unrecognized or invalid _bsontype: "+t._bsontype);n=e(n)}return"Code"===r&&n.scope?n=new ht(n.code,xe(n.scope,e)):"DBRef"===r&&n.oid&&(n=new dt(xe(n.collection,e),xe(n.oid,e),xe(n.db,e),xe(n.fields,e))),n.toExtendedJSON(e)}throw new q("_bsontype must be a string, but was: "+typeof r)}(t,e):t}const Te={Binary:t=>new ut(t.value(),t.sub_type),Code:t=>new ht(t.code,t.scope),DBRef:t=>new dt(t.collection||t.namespace,t.oid,t.db,t.fields),Decimal128:t=>new Rt(t.bytes),Double:t=>new Ut(t.value),Int32:t=>new Ct(t.value),Long:t=>$t.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_),MaxKey:()=>new Ft,MinKey:()=>new Lt,ObjectId:t=>new Jt(t),BSONRegExp:t=>new Ht(t.pattern,t.options),BSONSymbol:t=>new Wt(t.value),Timestamp:t=>Qt.fromBits(t.low,t.high)};function ke(t,e){const r={useBigInt64:e?.useBigInt64??!1,relaxed:e?.relaxed??!0,legacy:e?.legacy??!1};return JSON.parse(t,(t,e)=>{if(-1!==t.indexOf("\0"))throw new q(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(t)}`);return Ae(e,r)})}function Ne(t,e,r,n){null!=r&&"object"==typeof r&&(n=r,r=0),null==e||"object"!=typeof e||Array.isArray(e)||(n=e,e=void 0,r=0);const o=xe(t,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(o,e,r)}const Ie=Object.create(null);Ie.parse=ke,Ie.stringify=Ne,Ie.serialize=function(t,e){return e=e||{},JSON.parse(Ne(t,e))},Ie.deserialize=function(t,e){return e=e||{},ke(JSON.stringify(t),e)},Object.freeze(Ie);function Be(t,e){try{return at.getNonnegativeInt32LE(t,e)}catch(t){throw new K("BSON size cannot be negative",e,{cause:t})}}function De(t,e){let r=e;for(;0!==t[r];r++);if(r===t.length-1)throw new K("Null terminator not found",e);return r}const Me=Object.create(null);Me.parseToElements=function(t,e=0){if(e??=0,t.length<5)throw new K(`Input must be at least 5 bytes, got ${t.length} bytes`,e);const r=Be(t,e);if(r>t.length-e)throw new K(`Parsed documentSize (${r} bytes) does not match input length (${t.length} bytes)`,e);if(0!==t[e+r-1])throw new K("BSON documents must end in 0x00",e+r);const n=[];let o=e+4;for(;o<=r+e;){const i=t[o];if(o+=1,0===i){if(o-e!==r)throw new K("Invalid 0x00 type byte",o);break}const s=o,a=De(t,o)-s;let u;if(o+=a+1,1===i||18===i||9===i||17===i)u=8;else if(16===i)u=4;else if(7===i)u=12;else if(19===i)u=16;else if(8===i)u=1;else if(10===i||6===i||127===i||255===i)u=0;else if(11===i)u=De(t,De(t,o)+1)+1-o;else if(3===i||4===i||15===i)u=Be(t,o);else{if(2!==i&&5!==i&&12!==i&&13!==i&&14!==i)throw new K(`Invalid 0x${i.toString(16).padStart(2,"0")} type byte`,o);u=Be(t,o)+4,5===i&&(u+=1),12===i&&(u+=12)}if(u>r)throw new K("value reports length larger than document",o);n.push([i,s,a,o,u]),o+=u}return n},Me.ByteUtils=rt,Me.NumberUtils=at,Object.freeze(Me);const Re=17825792;let Ue=rt.allocate(Re);function Ce(t){Ue.length<t&&(Ue=rt.allocate(t))}function Fe(t,e={}){const r="boolean"==typeof e.checkKeys&&e.checkKeys,n="boolean"==typeof e.serializeFunctions&&e.serializeFunctions,o="boolean"!=typeof e.ignoreUndefined||e.ignoreUndefined,i="number"==typeof e.minInternalBufferSize?e.minInternalBufferSize:Re;Ue.length<i&&(Ue=rt.allocate(i));const s=je(Ue,t,r,0,0,n,o,null),a=rt.allocateUnsafe(s);return a.set(Ue.subarray(0,s),0),a}function Le(t,e,r={}){const n="boolean"==typeof r.checkKeys&&r.checkKeys,o="boolean"==typeof r.serializeFunctions&&r.serializeFunctions,i="boolean"!=typeof r.ignoreUndefined||r.ignoreUndefined,s="number"==typeof r.index?r.index:0,a=je(Ue,t,n,0,0,o,i,null);return e.set(Ue.subarray(0,a),s),s+a-1}function Ve(t,e={}){return Xt(rt.toLocalBufferType(t),e)}function qe(t,e={}){return zt(t,"boolean"==typeof(e=e||{}).serializeFunctions&&e.serializeFunctions,"boolean"!=typeof e.ignoreUndefined||e.ignoreUndefined)}function Je(t,e,r,n,o,i){const s=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},i),a=rt.toLocalBufferType(t);let u=e;for(let t=0;t<r;t++){const e=at.getInt32LE(a,u);s.index=u,n[o+t]=Xt(a,s),u+=e}return u}var ze=Object.freeze({__proto__:null,BSONError:q,BSONOffsetError:K,BSONRegExp:Ht,BSONRuntimeError:z,BSONSymbol:Wt,BSONType:V,BSONValue:nt,BSONVersionError:J,Binary:ut,Code:ht,DBRef:dt,Decimal128:Rt,Double:Ut,EJSON:Ie,Int32:Ct,Long:$t,MaxKey:Ft,MinKey:Lt,ObjectId:Jt,Timestamp:Qt,UUID:pt,calculateObjectSize:qe,deserialize:Ve,deserializeStream:Je,onDemand:Me,serialize:Fe,serializeWithBufferAndIndex:Le,setInternalBufferSize:Ce})},6365:(t,e,r)=>{"use strict";var n=r(5832).hp,o=r(6353).Binary,i=r(6353).UUID,s=r(8768);function a(t,e,r){var o,i,u,l,f=t;return null==t&&(f=0),Array.isArray(e)?(i=e[0],u=e[1]):o=e,l="number"==typeof f||f instanceof Number?n.alloc(f):n.from(f,o,r),s.decorate(l,a.mixin),l.isMongooseBuffer=!0,l[a.pathSymbol]=i,l[c]=u,l._subtype=0,l}var u=Symbol.for("mongoose#Buffer#_path"),c=Symbol.for("mongoose#Buffer#_parent");a.pathSymbol=u,a.mixin={_subtype:void 0,_markModified:function(){var t=this[c];return t&&t.markModified(this[a.pathSymbol]),this},write:function(){var t=n.prototype.write.apply(this,arguments);return t>0&&this._markModified(),t},copy:function(t){var e=n.prototype.copy.apply(this,arguments);return t&&t.isMongooseBuffer&&t._markModified(),e}},s.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){n.prototype[t]&&(a.mixin[t]=function(){var e=n.prototype[t].apply(this,arguments);return this._markModified(),e})}),a.mixin.toObject=function(t){var e="number"==typeof t?t:this._subtype||0;return new o(n.from(this),e)},a.mixin.$toObject=a.mixin.toObject,a.mixin.toBSON=function(){return new o(this,this._subtype||0)},a.mixin.toUUID=function(){if(4!==this._subtype)throw new Error("Cannot convert a Buffer with subtype "+this._subtype+" to a UUID");return new i(this)},a.mixin.equals=function(t){if(!n.isBuffer(t))return!1;if(this.length!==t.length)return!1;for(var e=0;e<this.length;++e)if(this[e]!==t[e])return!1;return!0},a.mixin.subtype=function(t){if("number"!=typeof t)throw new TypeError("Invalid subtype. Expected a number");this._subtype!==t&&this._markModified(),this._subtype=t},a.Binary=o,t.exports=a},6400:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o,i=r(8093),s=r(9870),a=r(9206),u=r(9939),c=r(783),l=r(9907),f=r(2268),p=r(8188),h=r(9471),y=r(2401),d=r(1697),b=r(8435),m=r(8633),v=r(2151),g=r(674),_=Function,w=function(t){try{return _('"use strict"; return ('+t+").constructor;")()}catch(t){}},O=r(1464),S=r(988),$=function(){throw new f},j=O?function(){try{return $}catch(t){try{return O(arguments,"callee").get}catch(t){return $}}}():$,P=r(5510)(),A=r(209),E=r(5825),x=r(2403),T=r(3279),k=r(3123),N={},I="undefined"!=typeof Uint8Array&&A?A(Uint8Array):o,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":P&&A?A([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?o:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?o:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":N,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":P&&A?A(A([][Symbol.iterator]())):o,"%JSON%":"object"===("undefined"==typeof JSON?"undefined":n(JSON))?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&P&&A?A((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":O,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":u,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&P&&A?A((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":P&&A?A(""[Symbol.iterator]()):o,"%Symbol%":P?Symbol:o,"%SyntaxError%":l,"%ThrowTypeError%":j,"%TypedArray%":I,"%TypeError%":f,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":T,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":E,"%Math.abs%":h,"%Math.floor%":y,"%Math.max%":d,"%Math.min%":b,"%Math.pow%":m,"%Math.round%":v,"%Math.sign%":g,"%Reflect.getPrototypeOf%":x};if(A)try{null.error}catch(t){var D=A(A(t));B["%Error.prototype%"]=D}var M=function t(e){var r;if("%AsyncFunction%"===e)r=w("async function () {}");else if("%GeneratorFunction%"===e)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&A&&(r=A(o.prototype))}return B[e]=r,r},R={__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"]},U=r(2354),C=r(5994),F=U.call(k,Array.prototype.concat),L=U.call(T,Array.prototype.splice),V=U.call(k,String.prototype.replace),q=U.call(k,String.prototype.slice),J=U.call(k,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,H=function(t,e){var r,n=t;if(C(R,n)&&(n="%"+(r=R[n])[0]+"%"),C(B,n)){var o=B[n];if(o===N&&(o=M(n)),void 0===o&&!e)throw new f("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new f('"allowMissing" argument must be a boolean');if(null===J(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=q(t,0,1),r=q(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return V(t,z,function(t,e,r,o){n[n.length]=r?V(o,K,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",o=H("%"+n+"%",e),i=o.name,s=o.value,a=!1,u=o.alias;u&&(n=u[0],L(r,F([0,1],u)));for(var c=1,p=!0;c<r.length;c+=1){var h=r[c],y=q(h,0,1),d=q(h,-1);if(('"'===y||"'"===y||"`"===y||'"'===d||"'"===d||"`"===d)&&y!==d)throw new l("property names with quotes must have matching quotes");if("constructor"!==h&&p||(a=!0),C(B,i="%"+(n+="."+h)+"%"))s=B[i];else if(null!=s){if(!(h in s)){if(!e)throw new f("base intrinsic for "+t+" exists, but the property is not available.");return}if(O&&c+1>=r.length){var b=O(s,h);s=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:s[h]}else p=C(s,h),s=s[h];p&&!a&&(B[i]=s)}}return s}},6413:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(3609),a=r(6426),u=r(8953),c=r(4327);function l(t,e){a.call(this,t,e,"Boolean")}l.schemaName="Boolean",l.defaultOptions={},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l._cast=u,l.set=a.set,l.setters=[],l.get=a.get,l.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},l._defaultCaster=function(t){if(null!=t&&"boolean"!=typeof t)throw new Error;return t},l._checkRequired=function(t){return!0===t||!1===t},l.checkRequired=a.checkRequired,l.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},Object.defineProperty(l,"convertToTrue",{get:function(){return u.convertToTrue},set:function(t){u.convertToTrue=t}}),Object.defineProperty(l,"convertToFalse",{get:function(){return u.convertToFalse},set:function(t){u.convertToFalse=t}}),l.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():l.cast();try{return e(t)}catch(e){throw new s("Boolean",t,this.path,e,this)}};var f=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},a.prototype.$conditionalHandlers);Object.defineProperty(l.prototype,"$conditionalHandlers",{enumerable:!1,value:f}),l.prototype.castForQuery=function(t,e,r){var n;if(null!=t)return(n=this.$conditionalHandlers[t])?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(t){throw t instanceof s&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},l.prototype._castNullish=function(t){if(void 0===t)return t;var e="function"==typeof this.constructor.cast?this.constructor.cast():l.cast();return null==e?t:!(e.convertToFalse instanceof Set&&e.convertToFalse.has(t))&&(!!(e.convertToTrue instanceof Set&&e.convertToTrue.has(t))||t)},l.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return c("boolean","bool",null==t?void 0:t.useBsonType,e)},l.prototype.autoEncryptionType=function(){return"bool"},t.exports=l},6426:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var i=r(3672),s=r(8879),a=r(8499),u=r(2555),c=r(4450),l=r(8133),f=r(9183),p=r(6155),h=r(2746),y=r(7930).schemaTypeSymbol,d=r(8768),b=r(7930).validatorErrorSymbol,m=r(7930).documentIsModified,v=r(7930).populateModelSymbol,g=i.CastError,_=i.ValidatorError,w={_skipMarkModified:!0};function O(t,e,r){this[y]=!0,this.path=t,this.instance=r,this.schemaName=this.constructor.schemaName,this.validators=[],this.getters=this.constructor.hasOwnProperty("getters")?this.constructor.getters.slice():[],this.setters=this.constructor.hasOwnProperty("setters")?this.constructor.setters.slice():[],this.splitPath(),e=e||{};for(var n=this.constructor.defaultOptions||{},i=0,a=Object.keys(n);i<a.length;i++){var u=a[i];"validate"===u?this.validate(n.validate):n.hasOwnProperty(u)&&!Object.prototype.hasOwnProperty.call(e,u)&&(e[u]=n[u])}null==e.select&&delete e.select;var c=this.OptionsConstructor||s;this.options=new c(e),this._index=null,d.hasUserDefinedProperty(this.options,"immutable")&&(this.$immutable=this.options.immutable,l(this));for(var f=0,p=Object.keys(this.options);f<p.length;f++){var h=p[f];if("cast"!==h){if(d.hasUserDefinedProperty(this.options,h)&&"function"==typeof this[h]){if("index"===h&&this._index){if(!1===e.index){var b=this._index;if("object"===o(b)&&null!=b){if(b.unique)throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(b.sparse)throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}var m=e[h];if("default"===h){this.default(m);continue}var v=Array.isArray(m)?m:[m];this[h].apply(this,v)}}else Array.isArray(this.options[h])?this.castFunction.apply(this,this.options[h]):this.castFunction(this.options[h])}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}function S(t,e){if(void 0!==t&&!t){var r=new(e.ErrorConstructor||_)(e);return r[b]=!0,r}}function $(t,e){return this.castForQuery(null,t,e)}function j(t,e){var r=this;return Array.isArray(t)?t.map(function(t){return Array.isArray(t)&&0===t.length?t:r.castForQuery(null,t,e)}):[this.castForQuery(null,t,e)]}O.prototype.OptionsConstructor=s,O.prototype.path,O.prototype.validators,O.prototype.isRequired,O.prototype.splitPath=function(){return null!=this._presplitPath?this._presplitPath:null!=this.path?(this._presplitPath=-1===this.path.indexOf(".")?[this.path]:this.path.split("."),this._presplitPath):void 0},O.cast=function(t){return 0===arguments.length||(!1===t&&(t=function(t){return t}),this._cast=t),this._cast},O.prototype.castFunction=function(t,e){return 0===arguments.length?this._castFunction:(!1===t&&(t=this.constructor._defaultCaster||function(t){return t}),"string"==typeof t?(this._castErrorMessage=t,this._castFunction):(null!=t&&(this._castFunction=t),null!=e&&(this._castErrorMessage=e),this._castFunction))},O.prototype.cast=function(){throw new Error("Base SchemaType class does not implement a `cast()` function")},O.set=function(t,e){this.hasOwnProperty("defaultOptions")||(this.defaultOptions=Object.assign({},this.defaultOptions)),this.defaultOptions[t]=e},O.get=function(t){this.getters=this.hasOwnProperty("getters")?this.getters:[],this.getters.push(t)},O.prototype.default=function(t){if(1===arguments.length){if(void 0===t)return void(this.defaultValue=void 0);if(null!=t&&t.instanceOfSchema)throw new i("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=t,this.defaultValue}return arguments.length>1&&(this.defaultValue=Array.prototype.slice.call(arguments)),this.defaultValue},O.prototype.index=function(t){return this._index=t,d.expires(this._index),this},O.prototype.unique=function(t,e){if(!1===this._index){if(!t)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null==this._index||!0===this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.unique=!!t,"string"==typeof e&&(this._duplicateKeyErrorMessage=e),this):this},O.prototype.text=function(t){if(!1===this._index){if(!t)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null===this._index||void 0===this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.text=t,this):this},O.prototype.sparse=function(t){if(!1===this._index){if(!t)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null==this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.sparse=t,this):this},O.prototype.immutable=function(t){return this.$immutable=t,l(this),this},O.prototype.transform=function(t){return this.options.transform=t,this},O.prototype.set=function(t){if("function"!=typeof t)throw new TypeError("A setter must be a function.");return this.setters.push(t),this},O.prototype.get=function(t){if("function"!=typeof t)throw new TypeError("A getter must be a function.");return this.getters.push(t),this},O.prototype.validateAll=function(t){for(var e=0;e<t.length;e++)this.validate(t[e]);return this},O.prototype.validate=function(t,e,r){var n,s,a,u;if("function"==typeof t||t&&"RegExp"===d.getFunctionName(t.constructor))return"function"==typeof e?(n={validator:t,message:e}).type=r||"user defined":e instanceof Object&&!r?((n=p(e)?Object.assign({},e):c(e)).message||(n.message=n.msg),n.validator=t,n.type=n.type||"user defined"):(null==e&&(e=i.messages.general.default),r||(r="user defined"),n={message:e,type:r,validator:t}),this.validators.push(n),this;for(s=0,a=arguments.length;s<a;s++){if(u=arguments[s],!d.isPOJO(u)){var l="Invalid validator. Received ("+o(u)+") "+u+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()";throw new Error(l)}this.validate(u.validator,u)}return this},O.prototype.required=function(t,e){var r={};if(arguments.length>0&&null==t)return this.validators=this.validators.filter(function(t){return t.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;if("object"===o(t)&&(e=(r=t).message||e,t=t.isRequired),!1===t)return this.validators=this.validators.filter(function(t){return t.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;var n=this;this.isRequired=!0,this.requiredValidator=function(e){var r=this&&this.$__&&this.$__.cachedRequired;if(null!=r&&!this.$__isSelected(n.path)&&!this[m](n.path))return!0;if(null!=r&&n.path in r){var o=!r[n.path]||n.checkRequired(e,this);return delete r[n.path],o}return"function"==typeof t&&!t.apply(this)||n.checkRequired(e,this)},this.originalRequiredValue=t,"string"==typeof t&&(e=t,t=void 0);var s=e||i.messages.general.required;return this.validators.unshift(Object.assign({},r,{validator:this.requiredValidator,message:s,type:"required"})),this},O.prototype.ref=function(t){return this.options.ref=t,this},O.prototype.getDefault=function(t,e,r){var n;if(null==this.defaultValue)return this.defaultValue;if(null!=(n="function"==typeof this.defaultValue?this.defaultValue===Date.now||this.defaultValue===Array||"objectid"===this.defaultValue.name.toLowerCase()?this.defaultValue.call(t):this.defaultValue.call(t,t):this.defaultValue)){if("object"!==o(n)||this.options&&this.options.shared||(n=c(n)),r&&r.skipCast)return this._applySetters(n,t);var i=this.applySetters(n,t,e,void 0,w);return i&&!Array.isArray(i)&&i.$isSingleNested&&(i.$__parent=t),i}return n},O.prototype._applySetters=function(t,e,r,n,o){var i=t;if(r)return i;for(var s=this.setters,a=s.length-1;a>=0;a--)i=s[a].call(e,i,n,this,o);return i},O.prototype._castNullish=function(t){return t},O.prototype.applySetters=function(t,e,r,n,o){var i=this._applySetters(t,e,r,n,o);return null==i?this._castNullish(i):i=this.cast(i,e,r,n,o)},O.prototype.applyGetters=function(t,e){var r=t,n=this.getters,o=n.length;if(0===o)return r;for(var i=0;i<o;++i)r=n[i].call(e,r,this);return r},O.prototype.select=function(t){return this.selected=!!t,this},O.prototype.doValidate=function(t,e,r,n){var i=this,s=!1,a=this.path;if("function"!=typeof e)throw new TypeError("Must pass callback function to doValidate(), got ".concat(o(e)));var u=this.validators.filter(function(t){return"object"===o(t)&&null!==t}),l=u.length;if(!l)return e(null);for(var f=function(){if(s)return 0;var e,o=u[y],l=o.validator,f=p(o)?Object.assign({},o):c(o);if(f.path=n&&n.path?n.path:a,f.fullPath=i.$fullPath,f.value=t,"string"==typeof t&&(f.length=t.length,f.value.length>30&&(f.value=f.value.slice(0,30)+"...")),l instanceof RegExp)return m(l.test(t),f,r),1;if("function"!=typeof l)return 1;if(void 0===t&&l!==i.requiredValidator)return m(!0,f,r),1;try{e=f.propsParameter?l.call(r,t,f):l.call(r,t)}catch(t){e=!1,f.reason=t,t.message&&(f.message=t.message)}null!=e&&"function"==typeof e.then?e.then(function(t){m(t,f,r)},function(t){f.reason=t,f.message=t.message,m(e=!1,f,r)}):m(e,f,r)},y=0,d=u.length;y<d&&0!==f();++y);function m(t,r,n){if(!s)if(void 0===t||t)--l<=0&&h(function(){e(null)});else{var o=r.ErrorConstructor||_;(s=new o(r,n))[b]=!0,h(function(){e(s)})}}},O.prototype.doValidateSync=function(t,e,r){var n=this.path;if(!this.validators.length)return null;var i=this.validators;if(void 0===t){if(0===this.validators.length||"required"!==this.validators[0].type)return null;i=[this.validators[0]]}var s=null,a=0,u=i.length;for(a=0;a<u;++a){var l=i[a];if(null!==l&&"object"===o(l)){var h=l.validator,y=p(l)?Object.assign({},l):c(l);y.path=r&&r.path?r.path:n,y.fullPath=this.$fullPath,y.value=t,"string"==typeof t&&(y.length=t.length,y.value.length>30&&(y.value=y.value.slice(0,30)+"..."));var d=!1;if(!f(h))if(h instanceof RegExp)s=S(h.test(t),y);else if("function"==typeof h){try{d=y.propsParameter?h.call(e,t,y):h.call(e,t)}catch(t){d=!1,y.reason=t}if((null==d||"function"!=typeof d.then)&&(s=S(d,y)))break}}}return s},O._isRef=function(t,e,r,o){var i=o&&t.options&&(t.options.ref||t.options.refPath);if(!i&&r&&null!=r.$__){var s=r.$__fullPath(t.path,!0),a=r.ownerDocument();i=null!=s&&a.$populated(s)||r.$populated(t.path)}return!!i&&(null==e||!(n.isBuffer(e)||"Binary"===e._bsontype||!d.isObject(e))||o)},O.prototype._castRef=function(t,e,r,i){if(null==t)return t;if(null!=t.$__)return t.$__.wasPopulated=t.$__.wasPopulated||{value:t._doc._id},t;if(n.isBuffer(t)||!d.isObject(t)){if(r)return t;throw new g(this.instance,t,this.path,null,this)}var s,a,u,c=e.$__fullPath(this.path,!0),l=e.ownerDocument().$populated(c,!0),f=t;if(!(e.$__.populated&&e.$__.populated[c]&&e.$__.populated[c].options&&e.$__.populated[c].options.options&&e.$__.populated[c].options.options.lean)){var p=l?l.options[v]:e.constructor.db.model(this.options.ref);(f=p.hydrate(t,null,i)).$__.wasPopulated={value:f._doc._id,options:(s={},a=v,u=p,(a=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(a))in s?Object.defineProperty(s,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):s[a]=u,s)}}return f},O.prototype.$conditionalHandlers={$all:function(t,e){var r=this;return Array.isArray(t)?t.map(function(t){return r.castForQuery(null,t,e)}):[this.castForQuery(null,t,e)]},$eq:$,$in:j,$ne:$,$nin:j,$exists:a,$type:u},O.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t);return n.call(this,e,r)}try{return this.applySetters(e,r)}catch(t){throw t instanceof g&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},O.checkRequired=function(t){return 0!==arguments.length&&(this._checkRequired=t),this._checkRequired},O.prototype.checkRequired=function(t){return null!=t},O.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.constructor(this.path,t,this.instance);return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),void 0!==this.defaultValue&&(e.defaultValue=this.defaultValue),void 0!==this.$immutable&&void 0===this.options.immutable&&(e.$immutable=this.$immutable,l(e)),void 0!==this._index&&(e._index=this._index),void 0!==this.selected&&(e.selected=this.selected),void 0!==this.isRequired&&(e.isRequired=this.isRequired),void 0!==this.originalRequiredValue&&(e.originalRequiredValue=this.originalRequiredValue),e.getters=this.getters.slice(),e.setters=this.setters.slice(),e},O.prototype.getEmbeddedSchemaType=function(){return this.$embeddedSchemaType},O.prototype._duplicateKeyErrorMessage=null,O.prototype.toJSONSchema=function(t){throw new Error("Converting unsupported SchemaType to JSON Schema: ".concat(this.instance,' at path "').concat(this.path,'"'))},O.prototype.autoEncryptionType=function(){return null},t.exports=e=O,e.CastError=g,e.ValidatorError=_},6451:(t,e,r)=>{"use strict";var n=r(8768).isPOJO;t.exports=function t(e){for(var r,o,i,s=Object.keys(e),a=s.length;a--;)i=e[o=s[a]],n(i)&&(e[o]=t(i)),void 0!==e[o]?r=!0:delete e[o];return r?e:void 0}},6511:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r(8768);var u=t.exports=function(){};u.ctor=function(){var t=Array.prototype.slice.call(arguments),e=function(){u.apply(this,arguments),this.paths={},this.states={}};return(e.prototype=new u).constructor=e,e.prototype.stateNames=t,t.forEach(function(t){e.prototype[t]=function(e){this._changeState(e,t)}}),e},u.prototype._changeState=function(t,e){var r=this.paths[t];if(r!==e){var n=this.states[r];n&&delete n[t],this.paths[t]=e,this.states[e]=this.states[e]||{},this.states[e][t]=!0}},u.prototype.clear=function(t){if(null!=this.states[t])for(var e,r=Object.keys(this.states[t]),n=r.length;n--;)e=r[n],delete this.states[t][e],delete this.paths[e]},u.prototype.clearPath=function(t){var e=this.paths[t];e&&(delete this.paths[t],delete this.states[e][t])},u.prototype.getStatePaths=function(t){return null!=this.states[t]?this.states[t]:{}},u.prototype.some=function(){var t=this,e=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(e,function(e){return null!=t.states[e]&&Object.keys(t.states[e]).length})},u.prototype._iter=function(t){return function(){var e=Array.prototype.slice.call(arguments),r=e.pop();e.length||(e=this.stateNames);var n=this;return e.reduce(function(t,e){return null==n.states[e]?t:t.concat(Object.keys(n.states[e]))},[])[t](function(t,e,n){return r(t,e,n)})}},u.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)},u.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)},u.prototype.clone=function(){var t=new this.constructor;t.paths=s({},this.paths);var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}(this.stateNames);try{for(r.s();!(e=r.n()).done;){var n=e.value;n in this.states&&(t.states[n]=null==this.states[n]?this.states[n]:s({},this.states[n]))}}catch(t){r.e(t)}finally{r.f()}return t}},6544:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o;if(!Object.keys){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,a=r(6312),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),l=u.call(function(){},"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"===n(window[t]))try{p(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();o=function(t){var e=null!==t&&"object"===n(t),r="[object Function]"===s.call(t),o=a(t),u=e&&"[object String]"===s.call(t),h=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(u&&t.length>0&&!i.call(t,0))for(var b=0;b<t.length;++b)h.push(String(b));if(o&&t.length>0)for(var m=0;m<t.length;++m)h.push(String(m));else for(var v in t)d&&"prototype"===v||!i.call(t,v)||h.push(String(v));if(c)for(var g=function(t){if("undefined"==typeof window||!y)return p(t);try{return p(t)}catch(t){return!1}}(t),_=0;_<f.length;++_)g&&"constructor"===f[_]||!i.call(t,f[_])||h.push(f[_]);return h}}t.exports=o},6547:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t,e,r){return(e=function(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var s=r(3550).EventEmitter,a=r(9380),u=r(8768),c=r(7930).documentArrayParent;function l(t,e,r,s,l){var f;u.isMongooseDocumentArray(e)?(this.__parentArray=e,this[c]=e.$parent()):(this.__parentArray=void 0,this[c]=void 0),this.$setIndex(l),this.$__parent=this[c],"object"===i(r)&&null!=r?(f=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){o(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({isNew:!0},r),r=void 0):f={isNew:!0},a.call(this,t,s,this[c],r,f)}for(var f in l.prototype=Object.create(a.prototype),l.prototype.constructor=l,Object.defineProperty(l.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1}),Object.defineProperty(l.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0}),s.prototype)l[f]=s.prototype[f];l.prototype.$setIndex=function(t){if(this.__index=t,null!=this.$__&&null!=this.$__.validationError)for(var e=0,r=Object.keys(this.$__.validationError.errors);e<r.length;e++){var n=r[e];this.invalidate(n,this.$__.validationError.errors[n])}},l.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")`')},l.prototype.$__removeFromParent=function(){var 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})},l.prototype.$__fullPath=function(t,e){return null==this.__index?null:(this.$__.fullPath||this.ownerDocument(),e?t?this.$__.fullPath+"."+t:this.$__.fullPath:t?this.$__.fullPath+"."+this.__index+"."+t:this.$__.fullPath+"."+this.__index)},l.prototype.$__pathRelativeToParent=function(t,e){return null!=this.__index&&this.__parentArray&&this.__parentArray.$path?e?null==t?this.__parentArray.$path():this.__parentArray.$path()+"."+t:null==t?this.__parentArray.$path()+"."+this.__index:this.__parentArray.$path()+"."+this.__index+"."+t:null},l.prototype.$parent=function(){return this[c]},l.prototype.parentArray=function(){return this.__parentArray},t.exports=l},6583:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o,i=r(8863),s=r(1464);try{o=[].__proto__===Array.prototype}catch(t){if(!t||"object"!==n(t)||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var a=!!o&&s&&s(Object.prototype,"__proto__"),u=Object,c=u.getPrototypeOf;t.exports=a&&"function"==typeof a.get?i([a.get]):"function"==typeof c&&function(t){return c(null==t?t:u(t))}},6665:t=>{"use strict";t.exports=function(t,e){for(var r,n,o,i=e.split("."),s="",a=0;a<i.length;++a)if(t[s+=s.length?".":""+i[a]]){for(o=(n=Object.keys(t)).length,r=0;r<o;++r)0!==n[a].indexOf(s+".")||n[a].indexOf(e);return!0}return!1}},6730:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r};t.exports=function(t){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,s=function(t){for(var e=[],r=1,n=0;r<t.length;r+=1,n+=1)e[n]=t[r];return e}(arguments),a=r(0,o.length-s.length),u=[],c=0;c<a;c++)u[c]="$"+c;if(i=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(u)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var e=o.apply(this,n(s,arguments));return Object(e)===e?e:this}return o.apply(t,n(s,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},6750:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(988),i=r(9907),s=r(2268),a=r(1464);t.exports=function(t,e,r){if(!t||"object"!==n(t)&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!==n(e))throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],p=!!a&&a(t,e);if(o)o(t,e,{configurable:null===l&&p?p.configurable:!l,enumerable:null===u&&p?p.enumerable:!u,value:r,writable:null===c&&p?p.writable:!c});else{if(!f&&(u||c||l))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},6775:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=a(t),s=i[0],u=i[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),l=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,u=n-o;a<u;a+=s)i.push(c(t,a,a+s>u?u:a+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function c(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(u(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6801:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t,r){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(s=function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,[r=r||"Cannot populate path `"+t+"` because it is not in your schema. Set the `strictPopulate` option to false to override."])).path=t,s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"StrictPopulateError"}),t.exports=a},6814:t=>{"use strict";t.exports=function(t){for(var e={},r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];if(-1!==o.indexOf("."))for(var i=o.split("."),s=i[0],a=0;a<i.length;++a)e[s]=1,a+1<i.length&&(s=s+"."+i[a+1]);else e[o]=1}return e}},6867:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},f.apply(null,arguments)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}var y=r(2081),d=r(241),b=r(6426),m=r(4327),v=function(t){function e(t,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=function(t,e,r){return e=p(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,l()?Reflect.construct(e,r||[],p(t).constructor):e.apply(t,r))}(this,e,[t,r,"Map"])).$isSchemaMap=!0,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),o=e,s=[{key:"set",value:function(t,e){return b.set(t,e)}},{key:"cast",value:function(t,e,n,o,s){if(t instanceof y)return t;var u=this.path;if(n){var c=new y({},u,e,this.$__schemaType,s),l=null!=c.$__pathRelativeToParent?c.$__pathRelativeToParent:c.$__path;if(t instanceof r.g.Map){var f,p=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}(t.keys());try{for(p.s();!(f=p.n()).done;){var h=f.value,d=t.get(h);d=null==d?c.$__schemaType._castNullish(d):c.$__schemaType.cast(d,e,!0,null,i(i({},s),{},{path:l+"."+h})),c.$init(h,d)}}catch(t){p.e(t)}finally{p.f()}}else for(var b=0,m=Object.keys(t);b<m.length;b++){var v=m[b],g=t[v];g=null==g?c.$__schemaType._castNullish(g):c.$__schemaType.cast(g,e,!0,null,i(i({},s),{},{path:l+"."+v})),c.$init(v,g)}return c}return new y(t,u,e,this.$__schemaType,s)}},{key:"clone",value:function(){var t,r,n,o=(t=e,r=this,"function"==typeof(n=f(p(1&3?t.prototype:t),"clone",r))?function(t){return n.apply(r,t)}:n)([]);return null!=this.$__schemaType&&(o.$__schemaType=this.$__schemaType.clone()),o}},{key:"getEmbeddedSchemaType",value:function(){return this.$__schemaType}},{key:"toJSONSchema",value:function(t){var e=null==t?void 0:t.useBsonType,r=this.getEmbeddedSchemaType(),n=this.options.required&&"function"!=typeof this.options.required,o=m("object","object",e,n);return o.additionalProperties=r.toJSONSchema(t),o}},{key:"autoEncryptionType",value:function(){return"object"}}],s&&u(o.prototype,s),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,s}(b);v.schemaName="Map",v.prototype.OptionsConstructor=d,v.defaultOptions={},t.exports=v},6948:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function i(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}var a=r(4450),u=i(function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._docs={},this._childDocs=[],null!=e&&(e=a(e),Object.assign(this,e),"object"===n(e.subPopulate)&&(this.populate=e.subPopulate),null!=e.perDocumentLimit&&null!=e.limit))throw new Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+e.path+"`.")});t.exports=u},6949:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}var c=r(8213),l=r(8260),f=r(7352),p=r(1875),h=function(t){function e(t){var r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,r){return e=a(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}(this,e,[o="model"===l(t)?t.constructor.modelName+" validation failed":"Validation failed"])).errors={},r._message=o,t&&(t.$errors=r.errors),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(e,t),r=e,(i=[{key:"toString",value:function(){return this.name+": "+p(this)}},{key:"inspect",value:function(){return Object.assign(new Error(this.message),this)}},{key:"addError",value:function(t,r){if(r instanceof e)for(var n=r.errors,o=0,i=Object.keys(n);o<i.length;o++){var s=i[o];this.addError("".concat(t,".").concat(s),n[s])}else this.errors[t]=r,this.message=this._message+": "+p(this)}}])&&o(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(c);f.inspect.custom&&(h.prototype[f.inspect.custom]=h.prototype.inspect),Object.defineProperty(h.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}}),Object.defineProperty(h.prototype,"name",{value:"ValidationError"}),t.exports=h},6974:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"of",u),t.exports=a},6996:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t,r,s){var a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var u=s.join(", ");return(a=function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,['No matching document found for id "'+t._doc._id+'" version '+r+' modifiedPaths "'+u+'"'])).version=r,a.modifiedPaths=s,a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"VersionError"}),t.exports=a},7045:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(6426),u=a.CastError,c=r(9553),l=r(4327),f=r(3305);function p(t,e){a.call(this,t,e,"Decimal128")}function h(t){return this.cast(t)}p.schemaName="Decimal128",p.defaultOptions={},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,p._cast=c,p.set=a.set,p.setters=[],p.get=a.get,p.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},p._defaultCaster=function(t){if(null!=t&&!f(t,"Decimal128"))throw new Error;return t},p._checkRequired=function(t){return f(t,"Decimal128")},p.checkRequired=a.checkRequired,p.prototype.checkRequired=function(t,e){return a._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():p.checkRequired())(t)},p.prototype.cast=function(t,e,r,n,o){if(a._isRef(this,t,e,r))return f(t,"Decimal128")?t:this._castRef(t,e,r,o);var i;i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():p.cast();try{return i(t)}catch(e){throw new u("Decimal128",t,this.path,e,this)}};var y=i(i({},a.prototype.$conditionalHandlers),{},{$gt:h,$gte:h,$lt:h,$lte:h});Object.defineProperty(p.prototype,"$conditionalHandlers",{enumerable:!1,value:y}),p.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return l("string","decimal",null==t?void 0:t.useBsonType,e)},p.prototype.autoEncryptionType=function(){return"decimal"},t.exports=p},7058:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,s,a=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,e)||f(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function f(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var h,y=r(3550).EventEmitter,d=r(8297),b=r(8213),m=r(6426),v=r(8879),g=r(2069),_=r(622),w=r(486),O=r(4450),S=r(3703),$=r(8260),j=r(2003),P=r(5289),A=r(3381),E=r(1199),x=r(9539),T=r(5678),k=r(7834),N=r(2097),I=r(8768),B=r(533),D=/\.\d+(\.|$)/,M=r(1260).Ut,R=r(4957).middlewareFunctions,U=M.concat(R).reduce(function(t,e){return t.add(e)},new Set),C=I.isPOJO,F=0,L=/^\d+$/;function V(t,e){if(!(this instanceof V))return new V(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&&e.methods||{},this.methodOptions={},this.statics=e&&e.statics||{},this.tree={},this.query=e&&e.query||{},this.childSchemas=[],this.plugins=[],this.$id=++F,this.mapPaths=[],this.encryptedFields={},this.s={hooks:new d},this.options=this.defaultOptions(e),Array.isArray(t)){var r,n=l(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.add(o)}}catch(t){n.e(t)}finally{n.f()}}else t&&this.add(t);if(e&&e.virtuals)for(var i=e.virtuals,s=0,a=Object.keys(i);s<a.length;s++){var u=a[s],c=i[u].options?i[u].options:void 0,f=this.virtual(u,c);i[u].get&&f.get(i[u].get),i[u].set&&f.set(i[u].set)}var p=t&&t._id&&I.isObject(t._id);!this.paths._id&&this.options._id&&!p&&w(this),this.setupTimestamp(this.options.timestamps)}function q(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r],i=null;if(null!=e[o])i=e[o];else{var s=S(t.paths[o],"options");if(null==s)continue;i=s.alias}if(i){var a=t.paths[o].path;if(Array.isArray(i)){var u,c=l(i);try{for(c.s();!(u=c.n()).done;){var f=u.value;if("string"!=typeof f)throw new Error("Invalid value for alias option on "+a+", got "+f);t.aliases[f]=a,t.virtual(f).get(function(t){return function(){return"function"==typeof this.get?this.get(t):this[t]}}(a)).set(function(t){return function(e){return this.$set(t,e)}}(a))}}catch(t){c.e(t)}finally{c.f()}}else{if("string"!=typeof i)throw new Error("Invalid value for alias option on "+a+", got "+i);t.aliases[i]=a,t.virtual(i).get(function(t){return function(){return"function"==typeof this.get?this.get(t):this[t]}}(a)).set(function(t){return function(e){return this.$set(t,e)}}(a))}}}}V.prototype=Object.create(y.prototype),V.prototype.constructor=V,V.prototype.instanceOfSchema=!0,Object.defineProperty(V.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0}),Object.defineProperty(V.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0}),Object.defineProperty(V.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0}),V.prototype.obj,V.prototype.paths,V.prototype.tree,V.prototype.clone=function(){var t=this,e=this._clone();return e.on("init",function(e){return t.emit("init",e)}),e},V.prototype._clone=function(t){var e=new(t=t||(null==this.base?V:this.base.Schema))({},this._userProvidedOptions);e.base=this.base,e.obj=this.obj,e.options=O(this.options),e.callQueue=this.callQueue.map(function(t){return t}),e.methods=O(this.methods),e.methodOptions=O(this.methodOptions),e.statics=O(this.statics),e.query=O(this.query),e.plugins=Array.prototype.slice.call(this.plugins),e._indexes=O(this._indexes),e._searchIndexes=O(this._searchIndexes),e.s.hooks=this.s.hooks.clone(),e.tree=O(this.tree),e.paths=Object.fromEntries(Object.entries(this.paths).map(function(t){var e=c(t,2);return[e[0],e[1].clone()]})),e.nested=O(this.nested),e.subpaths=O(this.subpaths);for(var r=0,n=Object.values(e.paths);r<n.length;r++){var o=n[r];if(o.$isSingleNested){for(var i=o.path,s=0,a=Object.keys(o.schema.paths);s<a.length;s++){var u=a[s];e.singleNestedPaths[i+"."+u]=o.schema.paths[u]}for(var l=0,f=Object.keys(o.schema.singleNestedPaths);l<f.length;l++){var p=f[l];e.singleNestedPaths[i+"."+p]=o.schema.singleNestedPaths[p]}for(var h=0,y=Object.keys(o.schema.subpaths);h<y.length;h++){var d=y[h];e.singleNestedPaths[i+"."+d]=o.schema.subpaths[d]}for(var b=0,m=Object.keys(o.schema.nested);b<m.length;b++){var v=m[b];e.singleNestedPaths[i+"."+v]="nested"}}}return e._gatherChildSchemas(),e.virtuals=O(this.virtuals),e.$globalPluginsApplied=this.$globalPluginsApplied,e.$isRootDiscriminator=this.$isRootDiscriminator,e.$implicitlyCreated=this.$implicitlyCreated,e.$id=++F,e.$originalSchemaId=this.$id,e.mapPaths=[].concat(this.mapPaths),null!=this.discriminatorMapping&&(e.discriminatorMapping=Object.assign({},this.discriminatorMapping)),null!=this.discriminators&&(e.discriminators=Object.assign({},this.discriminators)),null!=this._applyDiscriminators&&(e._applyDiscriminators=new Map(this._applyDiscriminators)),e.aliases=Object.assign({},this.aliases),e.encryptedFields=O(this.encryptedFields),e},V.prototype.pick=function(t,e){var r=new V({},e||this.options);if(!Array.isArray(t))throw new b('Schema#pick() only accepts an array argument, got "'+u(t)+'"');var n,o=l(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(this._hasEncryptedField(i)){var s=this.encryptedFields[i],c=this.path(i);r.add(a({},i,a({encrypt:s},this.options.typeKey,c)))}else if(this.nested[i])r.add(a({},i,S(this.tree,i)));else{var f=this.path(i);if(null==f)throw new b("Path `"+i+"` is not in the schema");r.add(a({},i,f))}}}catch(t){o.e(t)}finally{o.f()}return this._hasEncryptedFields()||(r.options.encryptionType=null),r},V.prototype.omit=function(t,e){var r=new V(this,e||this.options);if(!Array.isArray(t))throw new b('Schema#omit() only accepts an array argument, got "'+u(t)+'"');for(var n in r.remove(t),r.singleNestedPaths)t.includes(n)&&delete r.singleNestedPaths[n];return r},V.prototype.defaultOptions=function(t){this._userProvidedOptions=null==t?{}:O(t);var e=this.base&&this.base.options||{};if((t=s({strict:!("strict"in e)||e.strict,strictQuery:"strictQuery"in e&&e.strictQuery,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:!("id"in e)||e.id,typeKey:"type"},t)).versionKey&&"string"!=typeof t.versionKey)throw new b("`versionKey` must be falsy or string, got `"+u(t.versionKey)+"`");if("string"==typeof t.read?t.read=P(t.read):Array.isArray(t.read)&&"string"==typeof t.read[0]&&(t.read={mode:P(t.read[0]),tags:t.read[1]}),t.optimisticConcurrency&&!t.versionKey)throw new b("Must set `versionKey` if using `optimisticConcurrency`");return t},V.prototype.discriminator=function(t,e,r){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(t,{schema:e,options:r}),this},V.prototype._defaultToObjectOptions=function(t){var e=t?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&this._defaultToObjectOptionsMap[e])return this._defaultToObjectOptionsMap[e];var r=this.base&&this.base.options&&this.base.options[e]||{},n=this.options[e]||{},o=Object.assign({},r,n);return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[e]=o,o},V.prototype.encryptionType=function(t){if(0===arguments.length)return this.options.encryptionType;if("string"!=typeof t&&null!==t)throw new Error("invalid `encryptionType`: ${encryptionType}");this.options.encryptionType=t},V.prototype.add=function(t,e){if(t instanceof V||null!=t&&t.instanceOfSchema)return x(this,t),this;if(!1===t._id&&null==e&&(this.options._id=!1),"__proto__."===(e=e||"")||"constructor."===e||"prototype."===e)return this;for(var r=Object.keys(t),n=this.options.typeKey,o=0,i=r;o<i.length;o++){var s=i[o];if(!I.specialProperties.has(s)){var l=e+s,f=t[s];if(null==f)throw new TypeError("Invalid value for schema path `"+l+'`, got value "'+f+'"');if("_id"!==s||!1!==f){var p=!1;if("string"==typeof f&&(p=null!=(null!=this.base?this.base.Schema.Types:V.Types)[f.charAt(0).toUpperCase()+f.substring(1)]),"_id"!==s&&("object"!==u(f)&&"function"!=typeof f&&!p||null==f))throw new TypeError("Invalid schema configuration: `".concat(f,"` is not ")+"a valid type at path `".concat(s,"`. See ")+"https://bit.ly/mongoose-schematypes for a list of valid schema types.");if(f instanceof _||"VirtualType"===(f.constructor&&f.constructor.name||null))this.virtual(f);else{if(Array.isArray(f)&&1===f.length&&null==f[0])throw new TypeError("Invalid value for schema Array path `"+l+'`, got value "'+f[0]+'"');if(C(f)||f instanceof v)if(Object.keys(f).length<1)e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(l,f);else if(!f[n]||"type"===n&&C(f.type)&&f.type.type)this.nested[l]=!0,this.add(f,l+".");else{var h=f[n];if(C(h)&&Object.keys(h).length>0){e&&(this.nested[e.substring(0,e.length-1)]=!0);var y={};this._userProvidedOptions.typeKey&&(y.typeKey=this._userProvidedOptions.typeKey),null!=this._userProvidedOptions.strict&&(y.strict=this._userProvidedOptions.strict),null!=this._userProvidedOptions.toObject&&(y.toObject=I.omit(this._userProvidedOptions.toObject,["transform"])),null!=this._userProvidedOptions.toJSON&&(y.toJSON=I.omit(this._userProvidedOptions.toJSON,["transform"]));var d=new V(h,y);d.$implicitlyCreated=!0;var b=Object.assign({},f,a({},n,d));this.path(e+s,b)}else if(e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+s,f),null!=f&&!f.instanceOfSchema&&I.isPOJO(f.discriminators)){var m=this.path(e+s);for(var g in f.discriminators)m.discriminator(g,f.discriminators[g])}}else if(e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+s,f),null!=f[0]&&!f[0].instanceOfSchema&&I.isPOJO(f[0].discriminators)){var w=this.path(e+s);for(var O in f[0].discriminators)w.discriminator(O,f[0].discriminators[O])}if(f.instanceOfSchema&&null!=f.encryptionType()){if(this.encryptionType()!=f.encryptionType())throw new Error("encryptionType of a nested schema must match the encryption type of the parent schema.");for(var S=0,$=Object.entries(f.encryptedFields);S<$.length;S++){var j=c($[S],2),P=j[0],A=j[1],E=l+"."+P;this._addEncryptedField(E,A)}}else if("object"===u(f)&&"encrypt"in f){var T=f.encrypt;if(null==this.encryptionType())throw new Error("encryptionType must be provided");this._addEncryptedField(l,T)}else this._removeEncryptedField(l)}}}}var k=Object.fromEntries(Object.entries(t).map(function(t){var r=c(t,1)[0];return[e+r,null]}));return q(this,k),this},V.prototype._addEncryptedField=function(t,e){if(null==this.path(t).autoEncryptionType())throw new Error("Invalid BSON type for FLE field: '".concat(t,"'"));this.encryptedFields[t]=O(e)},V.prototype._removeEncryptedField=function(t){delete this.encryptedFields[t]},V.prototype._hasEncryptedFields=function(){return Object.keys(this.encryptedFields).length>0},V.prototype._hasEncryptedField=function(t){return t in this.encryptedFields},V.prototype._buildEncryptedFields=function(){var t=this;return{fields:Object.entries(this.encryptedFields).map(function(e){var r=c(e,2),n=r[0],o=r[1];return s({path:n,bsonType:t.path(n).autoEncryptionType()},o)})}},V.prototype._buildSchemaMap=function(){var t=this;return{bsonType:"object",properties:Object.entries(this.encryptedFields).reduce(function(e,r){var n=c(r,2),o=n[0],i=n[1],a=t.path(o).autoEncryptionType();return function(t,e,r){for(var n=0,o=t[n];n<t.length-1;o=t[++n])e[o]=null==e[o]?{bsonType:"object",properties:{}}:e[o],e=e[o].properties;e[o]=r}(o.split("."),e,{encrypt:s(s({},i),{},{bsonType:a})}),e},{})}},V.prototype.alias=function(t,e){return q(this,a({},t,e)),this},V.prototype.removeIndex=function(t){if(arguments.length>1)throw new Error("removeIndex() takes only 1 argument");if("object"!==u(t)&&"string"!=typeof t)throw new Error("removeIndex() may only take either an object or a string as an argument");if("object"===u(t))for(var e=this._indexes.length-1;e>=0;--e)E(this._indexes[e][0],t)&&this._indexes.splice(e,1);else for(var r=this._indexes.length-1;r>=0;--r)null!=this._indexes[r][1]&&this._indexes[r][1].name===t&&this._indexes.splice(r,1);return this},V.prototype.clearIndexes=function(){return this._indexes.length=0,this},V.prototype.searchIndex=function(t){return this._searchIndexes.push(t),this},V.reserved=Object.create(null),V.prototype.reserved=V.reserved;var J=V.reserved;function z(t){return/\.\d+/.test(t)?t.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$"):t}function K(t,e){if(0===t.mapPaths.length)return null;var r,n=l(t.mapPaths);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=o.path.replace(/\.\$\*/g,"");if(e===i||e.startsWith(i+".")&&-1===e.slice(i.length+1).indexOf("."))return o;if(o.schema&&e.startsWith(i+".")){var s=e.slice(i.length+1);return s=s.slice(s.indexOf(".")+1),o.schema.paths[s]}if(o.$isSchemaMap&&e.startsWith(i+".")){var a=e.slice(i.length+1);a=a.slice(a.indexOf(".")+1);var u=o.$__schemaType._presplitPath;if(-1===a.indexOf(".")&&"$*"===u[u.length-1])return o.$__schemaType;if(-1!==a.indexOf(".")&&o.$__schemaType.schema&&"$*"===u[u.length-1])return o.$__schemaType.schema.path(a.slice(a.indexOf(".")+1))}}}catch(t){n.e(t)}finally{n.f()}return null}function H(t,e,r){var n=e.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(n.length<2)return t.paths.hasOwnProperty(n[0])?t.paths[n[0]]:"adhocOrUndefined";var o=t.path(n[0]),i=!1;if(!o)return"adhocOrUndefined";for(var s=n.length-1,a=1;a<n.length;++a){i=!1;var u=n[a];if(a===s&&o&&!/\D/.test(u)){o=o.$isMongooseDocumentArray?o.$embeddedSchemaType:o instanceof h.Array?o.caster:void 0;break}if(/\D/.test(u)){if(!o||!o.schema){o=void 0;break}i="nested"===o.schema.pathType(u),o=o.schema.path(u)}else o instanceof h.Array&&a!==s&&(o=o.caster)}return t.subpaths[r]=o,o?"real":i?"nested":"adhocOrUndefined"}function W(t,e){var r,n=l(t.childSchemas);try{for(n.s();!(r=n.n()).done;){var o=r.value.schema;o.$implicitlyCreated&&(Object.assign(o.options,e),W(o,e))}}catch(t){n.e(t)}finally{n.f()}}J.prototype=J.emit=J.listeners=J.removeListener=J.collection=J.errors=J.get=J.init=J.isModified=J.isNew=J.populated=J.remove=J.save=J.toObject=J.validate=1,J.collection=1,V.prototype.path=function(t,e){if(void 0===e){if(null!=this.paths[t])return this.paths[t];var r=z(t),n=function(t,e,r){if(t.paths.hasOwnProperty(e))return t.paths[e];if(t.subpaths.hasOwnProperty(r)){var n=t.subpaths[r];if("nested"===n)return;return n}if(t.singleNestedPaths.hasOwnProperty(r)&&"object"===u(t.singleNestedPaths[r])){var o=t.singleNestedPaths[r];if("nested"===o)return;return o}return null}(this,t,r);if(null!=n)return n;var o=K(this,t);return null!=o?o:null!=(n=this.hasMixedParent(r))?n:D.test(t)?function(t,e,r){return H(t,e,r),t.subpaths[r]}(this,t,r):void 0}var i=t.split(".")[0];if(J[i]&&!this.options.suppressReservedKeysWarning){var s="`".concat(i,"` 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.";I.warn(s)}"object"===u(e)&&I.hasUserDefinedProperty(e,"ref")&&B(e.ref,t);var a,c=t.split(/\./),f=c.pop(),p=this.tree,h="",y=l(c);try{for(y.s();!(a=y.n()).done;){var d=a.value;if(I.specialProperties.has(d))throw new Error("Cannot set special property `"+d+"` on a schema");if(h=h+=(h.length>0?".":"")+d,p[d]||(this.nested[h]=!0,p[d]={}),"object"!==u(p[d])){var b="Cannot set nested path `"+t+"`. Parent path `"+h+"` already set to type "+p[d].name+".";throw new Error(b)}p=p[d]}}catch(t){y.e(t)}finally{y.f()}p[f]=O(e),this.paths[t]=this.interpretAsType(t,e,this.options);var v=this.paths[t];if(this.childSchemas=this.childSchemas.filter(function(e){return e.path!==t}),v.$isSchemaMap){var g=t+".$*";this.paths[g]=v.$__schemaType,this.mapPaths.push(this.paths[g]),v.$__schemaType.$isSingleNested&&this.childSchemas.push({schema:v.$__schemaType.schema,model:v.$__schemaType.caster,path:t})}if(v.$isSingleNested){for(var _=0,w=Object.keys(v.schema.paths);_<w.length;_++){var S=w[_];this.singleNestedPaths[t+"."+S]=v.schema.paths[S]}for(var $=0,j=Object.keys(v.schema.singleNestedPaths);$<j.length;$++){var P=j[$];this.singleNestedPaths[t+"."+P]=v.schema.singleNestedPaths[P]}for(var A=0,E=Object.keys(v.schema.subpaths);A<E.length;A++){var x=E[A];this.singleNestedPaths[t+"."+x]=v.schema.subpaths[x]}for(var T=0,k=Object.keys(v.schema.nested);T<k.length;T++){var N=k[T];this.singleNestedPaths[t+"."+N]="nested"}Object.defineProperty(v.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),v.caster.base=this.base,this.childSchemas.push({schema:v.schema,model:v.caster,path:t})}else v.$isMongooseDocumentArray&&(Object.defineProperty(v.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),v.casterConstructor.base=this.base,this.childSchemas.push({schema:v.schema,model:v.casterConstructor,path:t}));if(v.$isMongooseArray&&v.caster instanceof m){for(var M=t,R=v;R.$isMongooseArray;)M+=".$",R.$isMongooseDocumentArray?(R.$embeddedSchemaType._arrayPath=M,R.$embeddedSchemaType._arrayParentPath=t,R=R.$embeddedSchemaType):(R.caster._arrayPath=M,R.caster._arrayParentPath=t,R=R.caster),this.subpaths[M]=R;for(var U=0,C=[];U<C.length;U++){var F=C[U];this.subpaths[F.path]=F}}if(v.$isMongooseDocumentArray){for(var L=0,V=Object.keys(v.schema.paths);L<V.length;L++){var q=V[L],W=v.schema.paths[q];this.subpaths[t+"."+q]=W,"object"===u(W)&&null!=W&&null==W.$parentSchemaDocArray&&(W.$parentSchemaDocArray=v)}for(var G=0,Q=Object.keys(v.schema.subpaths);G<Q.length;G++){var Y=Q[G],Z=v.schema.subpaths[Y];this.subpaths[t+"."+Y]=Z,"object"===u(Z)&&null!=Z&&null==Z.$parentSchemaDocArray&&(Z.$parentSchemaDocArray=v)}for(var X=0,tt=Object.keys(v.schema.singleNestedPaths);X<tt.length;X++){var et=tt[X],rt=v.schema.singleNestedPaths[et];this.subpaths[t+"."+et]=rt,"object"===u(rt)&&null!=rt&&null==rt.$parentSchemaDocArray&&(rt.$parentSchemaDocArray=v)}}return this},V.prototype._gatherChildSchemas=function(){for(var t=[],e=0,r=Object.keys(this.paths);e<r.length;e++){var n=r[e];if("string"==typeof n){var o=this.paths[n];o.$isMongooseDocumentArray||o.$isSingleNested?t.push({schema:o.schema,model:o.caster,path:n}):o.$isSchemaMap&&o.$__schemaType.$isSingleNested&&t.push({schema:o.$__schemaType.schema,model:o.$__schemaType.caster,path:n})}}return this.childSchemas=t,t},Object.defineProperty(V.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null}),V.prototype.interpretAsType=function(t,e,o){if(e instanceof m){if(e.path===t)return e;var i=e.clone();return i.path=t,i}var s=null!=this.base?this.base.Schema.Types:V.Types,c=null!=this.base?this.base.Types:r(9600);if(!(I.isPOJO(e)||e instanceof v)&&"Object"!==I.getFunctionName(e.constructor)){var l=e;(e={})[o.typeKey]=l}var f,p=e[o.typeKey]&&(e[o.typeKey]instanceof Function||"type"!==o.typeKey||!e.type.type)?e[o.typeKey]:{};if(p instanceof m){if(p.path===t)return p;var h=p.clone();return h.path=t,h}if(I.isPOJO(p)||"mixed"===p)return new s.Mixed(t,e);if(Array.isArray(p)||p===Array||"array"===p||p===s.Array){var y=p===Array||"array"===p?e.cast||e.of:p[0];if(y&&y.instanceOfSchema){if(!(y instanceof V)){if(!this.options._isMerging)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: "+"".concat(t,": new Schema(...)"));y=new V(y)}return new s.DocumentArray(t,y,e)}if(y&&y[o.typeKey]&&y[o.typeKey].instanceOfSchema){if(!(y[o.typeKey]instanceof V)){if(!this.options._isMerging)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: "+"".concat(t,": new Schema(...)"));y[o.typeKey]=new V(y[o.typeKey])}return new s.DocumentArray(t,y[o.typeKey],e,y)}if(void 0!==y&&(Array.isArray(y)||y.type===Array||"Array"==y.type))return y&&"Array"==y.type&&(y.type=Array),new s.Array(t,this.interpretAsType(t,y,o),e);var d=null==y||!y[o.typeKey]||"type"===o.typeKey&&y.type.type?y:y[o.typeKey];if("string"==typeof y)y=s[y.charAt(0).toUpperCase()+y.substring(1)];else if(I.isPOJO(d)){if(Object.keys(d).length){var g={minimize:o.minimize};o.typeKey&&(g.typeKey=o.typeKey),o.hasOwnProperty("strict")&&(g.strict=o.strict),o.hasOwnProperty("strictQuery")&&(g.strictQuery=o.strictQuery),o.hasOwnProperty("toObject")&&(g.toObject=I.omit(o.toObject,["transform"])),o.hasOwnProperty("toJSON")&&(g.toJSON=I.omit(o.toJSON,["transform"])),this._userProvidedOptions.hasOwnProperty("_id")?g._id=this._userProvidedOptions._id:null!=V.Types.DocumentArray.defaultOptions._id&&(g._id=V.Types.DocumentArray.defaultOptions._id);var _=new V(d,g);return _.$implicitlyCreated=!0,new s.DocumentArray(t,_,e)}return new s.Array(t,s.Mixed,e)}if(y){if(p=!y[o.typeKey]||"type"===o.typeKey&&y.type.type?y:y[o.typeKey],Array.isArray(p))return new s.Array(t,this.interpretAsType(t,p,o),e);if("ClockDate"===(f="string"==typeof p?p:p.schemaName||I.getFunctionName(p))&&(f="Date"),void 0===f)throw new TypeError("Invalid schema configuration: "+"Could not determine the embedded type for array `".concat(t,"`. ")+"See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(!s.hasOwnProperty(f))throw new TypeError("Invalid schema configuration: "+"`".concat(f,"` is not a valid type within the array `").concat(t,"`.")+"See https://bit.ly/mongoose-schematypes for a list of valid schema types.")}return new s.Array(t,y||s.Mixed,e,o)}if(p&&p.instanceOfSchema)return new s.Subdocument(p,t,e);if((f=n.isBuffer(p)?"Buffer":"function"==typeof p||"object"===u(p)?p.schemaName||I.getFunctionName(p):p===c.ObjectId?"ObjectId":p===c.Decimal128?"Decimal128":null==p?""+p:p.toString())&&(f=f.charAt(0).toUpperCase()+f.substring(1)),"ObjectID"===f&&(f="ObjectId"),"ClockDate"===f&&(f="Date"),void 0===f)throw new TypeError("Invalid schema configuration: `".concat(t,"` schematype definition is ")+"invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(null==s[f])throw new TypeError("Invalid schema configuration: `".concat(f,"` is not ")+"a valid type at path `".concat(t,"`. See ")+"https://bit.ly/mongoose-schematypes for a list of valid schema types.");"Union"===f&&(e.parentSchema=this);var w=new s[f](t,e,o);return w.$isSchemaMap&&function(t,e,r,n,o){var i=r+".$*",s={type:{}};I.hasUserDefinedProperty(n,"of")&&((s=I.isPOJO(n.of)&&Object.keys(n.of).length>0&&!I.hasUserDefinedProperty(n.of,t.options.typeKey)?a({},t.options.typeKey,new V(n.of)):I.isPOJO(n.of)?Object.assign({},n.of):a({},t.options.typeKey,n.of))[t.options.typeKey]&&s[t.options.typeKey].instanceOfSchema&&s[t.options.typeKey].eachPath(function(t,e){if(!0===e.options.select||!1===e.options.select)throw new b('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+r+"."+t+'"')}),I.hasUserDefinedProperty(n,"ref")&&(s.ref=n.ref)),e.$__schemaType=t.interpretAsType(i,s,o)}(this,w,t,e,o),w},V.prototype.eachPath=function(t){for(var e=Object.keys(this.paths),r=e.length,n=0;n<r;++n)t(e[n],this.paths[e[n]]);return this},V.prototype.requiredPaths=function(t){if(this._requiredpaths&&!t)return this._requiredpaths;for(var e=Object.keys(this.paths),r=e.length,n=[];r--;){var o=e[r];this.paths[o].isRequired&&n.push(o)}return this._requiredpaths=n,this._requiredpaths},V.prototype.indexedPaths=function(){return this._indexedpaths||(this._indexedpaths=this.indexes()),this._indexedpaths},V.prototype.pathType=function(t){if(this.paths.hasOwnProperty(t))return"real";if(this.virtuals.hasOwnProperty(t))return"virtual";if(this.nested.hasOwnProperty(t))return"nested";var e=z(t);if(this.subpaths.hasOwnProperty(e)||this.subpaths.hasOwnProperty(t))return"real";var r=this.singleNestedPaths.hasOwnProperty(e)||this.singleNestedPaths.hasOwnProperty(t);return r?"nested"===r?"nested":"real":null!=K(this,t)?"real":/\.\d+\.|\.\d+$/.test(t)?H(this,t,e):"adhocOrUndefined"},V.prototype.hasMixedParent=function(t){var e=t.split(/\./g);t="";for(var r=0;r<e.length;++r)if(t=r>0?t+"."+e[r]:e[r],this.paths.hasOwnProperty(t)&&this.paths[t]instanceof h.Mixed)return this.paths[t];return null},V.prototype.setupTimestamp=function(t){return N(this,t)},V.prototype.queue=function(t,e){return this.callQueue.push([t,e]),this},V.prototype.pre=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=l(U);try{for(n.s();!(e=n.n()).done;){var o=e.value;t.test(o)&&this.pre.apply(this,[o].concat(r))}}catch(t){n.e(t)}finally{n.f()}return this}if(Array.isArray(t)){var i,s=Array.prototype.slice.call(arguments,1),a=l(t);try{for(a.s();!(i=a.n()).done;){var u=i.value;this.pre.apply(this,[u].concat(s))}}catch(t){a.e(t)}finally{a.f()}return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this},V.prototype.post=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=l(U);try{for(n.s();!(e=n.n()).done;){var o=e.value;t.test(o)&&this.post.apply(this,[o].concat(r))}}catch(t){n.e(t)}finally{n.f()}return this}if(Array.isArray(t)){var i,s=Array.prototype.slice.call(arguments,1),a=l(t);try{for(a.s();!(i=a.n()).done;){var u=i.value;this.post.apply(this,[u].concat(s))}}catch(t){a.e(t)}finally{a.f()}return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this},V.prototype.plugin=function(t,e){if("function"!=typeof t)throw new Error('First param to `schema.plugin()` must be a function, got "'+u(t)+'"');if(e&&e.deduplicate){var r,n=l(this.plugins);try{for(n.s();!(r=n.n()).done;)if(r.value.fn===t)return this}catch(t){n.e(t)}finally{n.f()}}return this.plugins.push({fn:t,opts:e}),t(this,e),this},V.prototype.method=function(t,e,r){if("string"!=typeof t)for(var n in t)this.methods[n]=t[n],this.methodOptions[n]=O(r);else this.methods[t]=e,this.methodOptions[t]=O(r);return this},V.prototype.static=function(t,e){if("string"!=typeof t)for(var r in t)this.statics[r]=t[r];else this.statics[t]=e;return this},V.prototype.index=function(t,e){for(var r in t||(t={}),e||(e={}),e.expires&&I.expires(e),t)this.aliases[r]&&(t=I.renameObjKey(t,r,this.aliases[r]));for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];"ascending"===t[i]||"asc"===t[i]?t[i]=1:"descending"!==t[i]&&"desc"!==t[i]||(t[i]=-1)}var s,a=l(this.indexes());try{for(a.s();!(s=a.n()).done;){var u=s.value;null==e.name&&null==u[1].name&&E(u[0],t)&&I.warn("Duplicate schema index on ".concat(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.'))}}catch(t){a.e(t)}finally{a.f()}return this._indexes.push([t,e]),this},V.prototype.set=function(t,e,r){if(1===arguments.length)return this.options[t];switch(t){case"read":"string"==typeof e?this.options[t]={mode:P(e),tags:r}:Array.isArray(e)&&"string"==typeof e[0]?this.options[t]={mode:P(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?w(this):!e&&null!=this.paths._id&&this.paths._id.auto&&this.remove("_id");break;default:this.options[t]=e,this._userProvidedOptions[t]=this.options[t]}return"strict"===t&&W(this,{strict:e}),"strictQuery"===t&&W(this,{strictQuery:e}),"toObject"===t&&(delete(e=s({},e)).transform,W(this,{toObject:e})),"toJSON"===t&&(delete(e=s({},e)).transform,W(this,{toJSON:e})),this},V.prototype.get=function(t){return this.options[t]};var G="2d 2dsphere hashed text".split(" ");function Q(t,e){var r,n=e.split("."),o=n.pop(),i=t.tree,s=l(n);try{for(s.s();!(r=s.n()).done;)i=i[r.value]}catch(t){s.e(t)}finally{s.f()}delete i[o]}function Y(t){return t.startsWith("$[")&&t.endsWith("]")}Object.defineProperty(V,"indexTypes",{get:function(){return G},set:function(){throw new Error("Cannot overwrite Schema.indexTypes")}}),V.prototype.indexes=function(){return j(this)},V.prototype.virtual=function(t,e){if(t instanceof _||"VirtualType"===$(t))return this.virtual(t.path,t.options);if(e=new g(e),I.hasUserDefinedProperty(e,["ref","refPath"])){if(null==e.localField)throw new Error("Reference virtuals require `localField` option");if(null==e.foreignField)throw new Error("Reference virtuals require `foreignField` option");var r=this.virtual(t);r.options=e,this.pre("init",function(n,o){if(T.has(t,n)){var i=T.get(t,n);if(this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?this.$$populatedVirtuals[t]=Array.isArray(i)?i[0]:i:this.$$populatedVirtuals[t]=Array.isArray(i)?i:null==i?[]:[i],null!=o&&o.hydratedPopulatedDocs&&!e.count){var s=r._getModelNamesForPopulate(this),a=this.$$populatedVirtuals[t];if(Array.isArray(a)||a.$__||1!==(null==s?void 0:s.length)){if(Array.isArray(a)&&1===(null==s?void 0:s.length)){for(var u=this.db.model(s[0]),c=0;c<a.length;++c)a[c].$__||(a[c]=u.hydrate(a[c],null,{hydratedPopulatedDocs:!0}));var l=e.foreignField;this.$populated(t,a.map(function(t){return null==t?t:t.get("function"==typeof l?l.call(t,t):l)}),{populateModelSymbol:u})}}else{var f=this.db.model(s[0]);this.$$populatedVirtuals[t]=f.hydrate(a)}}T.unset(t,n)}}),r.set(function(r){return this.$$populatedVirtuals||(this.$$populatedVirtuals={}),k(this.$$populatedVirtuals,t,r,e)}),"function"==typeof e.get&&r.get(e.get);for(var n=t.split("."),o=n[0],i=0;i<n.length-1;++i)if(null!=this.paths[o]){if(this.paths[o].$isMongooseDocumentArray||this.paths[o].$isSingleNested){var s=n.slice(i+1).join(".");this.paths[o].schema.virtual(s,e);break}if(this.paths[o].$isSchemaMap){var a=n.slice(i+2).join(".");this.paths[o].$__schemaType.schema.virtual(a,e);break}o+="."+n[i+1]}return r}var u=this.virtuals,c=t.split(".");if("real"===this.pathType(t))throw new Error('Virtual path "'+t+'" conflicts with a real path in the schema');if(u[t]=c.reduce(function(r,n,o){return r[n]||(r[n]=o===c.length-1?new _(e,t):{}),r[n]},this.tree),e&&e.applyToArray&&c.length>1){var l=this.path(c.slice(0,-1).join("."));if(l&&l.$isMongooseArray)return l.virtual(c[c.length-1],e);throw new b('Path "'.concat(l,'" is not an array'))}return u[t]},V.prototype.virtualpath=function(t){return this.virtuals.hasOwnProperty(t)?this.virtuals[t]:null},V.prototype.remove=function(t){return"string"==typeof t&&(t=[t]),Array.isArray(t)&&t.forEach(function(t){if(null!=this.path(t)||this.nested[t]){if(this.nested[t]){var e,r=l(Object.keys(this.paths).concat(Object.keys(this.nested)));try{for(r.s();!(e=r.n()).done;){var n=e.value;n.startsWith(t+".")&&(delete this.paths[n],delete this.nested[n],Q(this,n))}}catch(t){r.e(t)}finally{r.f()}return delete this.nested[t],void Q(this,t)}delete this.paths[t],Q(this,t),this._removeEncryptedField(t)}},this),this},V.prototype.removeVirtual=function(t){if("string"==typeof t&&(t=[t]),Array.isArray(t)){var e,r=l(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(null==this.virtuals[n])throw new b('Attempting to remove virtual "'.concat(n,'" that does not exist.'))}}catch(t){r.e(t)}finally{r.f()}var o,i=l(t);try{for(i.s();!(o=i.n()).done;){var s=o.value;delete this.paths[s],delete this.virtuals[s],-1!==s.indexOf(".")?T.unset(s,this.tree):delete this.tree[s]}}catch(t){i.e(t)}finally{i.f()}}return this},V.prototype.loadClass=function(t,e){return t===Object.prototype||t===Function.prototype||t.prototype.hasOwnProperty("$isMongooseModelPrototype")||t.prototype.hasOwnProperty("$isMongooseDocumentPrototype")||(this.loadClass(Object.getPrototypeOf(t),e),e||Object.getOwnPropertyNames(t).forEach(function(e){if(!e.match(/^(length|name|prototype|constructor|__proto__)$/)){var r=Object.getOwnPropertyDescriptor(t,e);r.hasOwnProperty("value")&&this.static(e,r.value)}},this),Object.getOwnPropertyNames(t.prototype).forEach(function(r){if(!r.match(/^(constructor)$/)){var n=Object.getOwnPropertyDescriptor(t.prototype,r);e||"function"==typeof n.value&&this.method(r,n.value),"function"==typeof n.get&&(this.virtuals[r]&&(this.virtuals[r].getters=[]),this.virtual(r).get(n.get)),"function"==typeof n.set&&(this.virtuals[r]&&(this.virtuals[r].setters=[]),this.virtual(r).set(n.set))}},this)),this},V.prototype._getSchema=function(t){var e=this.path(t),r=[];if(e)return e.$fullPath=t,e;for(var n=t.split("."),o=0;o<n.length;++o)("$"===n[o]||Y(n[o]))&&(n[o]="0"),L.test(n[o])&&(n[o]="$");return function t(e,n){for(var o,i,s=e.length+1;s--;)if(i=e.slice(0,s).join("."),o=n.path(i)){if(r.push(i),o.caster){if(o.caster instanceof h.Mixed)return o.caster.$fullPath=r.join("."),o.caster;if(s!==e.length){if(s+1===e.length&&o.$embeddedSchemaType&&("$"===e[s]||Y(e[s])))return o.$embeddedSchemaType;if(o.schema){var a=void 0;return"$"===e[s]||Y(e[s])?s+1===e.length?o.$embeddedSchemaType:((a=t(e.slice(s+1),o.schema))&&(a.$parentSchemaDocArray=a.$parentSchemaDocArray||(o.schema.$isSingleNested?null:o)),a):((a=t(e.slice(s),o.schema))&&(a.$parentSchemaDocArray=a.$parentSchemaDocArray||(o.schema.$isSingleNested?null:o)),a)}}}else if(o.$isSchemaMap){if(s>=e.length)return o;if(s+1>=e.length)return o.$__schemaType;if(o.$__schemaType instanceof h.Mixed)return o.$__schemaType;if(null!=o.$__schemaType.schema)return t(e.slice(s+1),o.$__schemaType.schema)}return o.$fullPath=r.join("."),o}}(n,this)},V.prototype._getPathType=function(t){return this.path(t)?"real":function t(e,r){for(var n,o,i=e.length+1;i--;){if(o=e.slice(0,i).join("."),n=r.path(o))return n.caster?n.caster instanceof h.Mixed?{schema:n,pathType:"mixed"}:i!==e.length&&n.schema?"$"===e[i]||Y(e[i])?i===e.length-1?{schema:n,pathType:"nested"}:t(e.slice(i+1),n.schema):t(e.slice(i),n.schema):{schema:n,pathType:n.$isSingleNested?"nested":"array"}:{schema:n,pathType:"real"};if(i===e.length&&r.nested[o])return{schema:r,pathType:"nested"}}return{schema:n||r,pathType:"undefined"}}(t.split("."),this)},V.prototype._transformDuplicateKeyError=function(t){if(!this._duplicateKeyErrorMessagesByPath)return t;if(11e3!==t.code&&11001!==t.code)return t;if(null!=t.keyPattern){var e=t.keyPattern,r=Object.keys(e);if(1!==r.length)return t;var n=r[0];return this._duplicateKeyErrorMessagesByPath.hasOwnProperty(n)?new b(this._duplicateKeyErrorMessagesByPath[n],{cause:t}):t}return t},V.prototype._preCompile=function(){this.plugin(A,{deduplicate:!0})},V.prototype.toJSONSchema=function(t){for(var e,r=null!==(e=null==t?void 0:t.useBsonType)&&void 0!==e&&e,n=r?{required:[],properties:{}}:{type:"object",required:[],properties:{}},i=0,s=Object.keys(this.paths);i<s.length;i++){var a=s[i],u=this.paths[a];if(-1===u._presplitPath.indexOf("$*")){var c=n;if(u._presplitPath.length>1)for(var l=0;l<u._presplitPath.length-1;++l){var f=u._presplitPath[l];null==c.properties[f]&&(c.properties[f]=r?{bsonType:["object","null"],properties:{}}:{type:["object","null"],properties:{}}),c=c.properties[f]}var p=u._presplitPath[u._presplitPath.length-1],h=!1;"_id"===a?(c.required||(c.required=[]),c.required.push("_id"),h=!0):u.options.required&&"function"!=typeof u.options.required&&(c.required||(c.required=[]),c.required.push(p),h=!0),c.properties[p]=u.toJSONSchema(t),u.options.enum&&(c.properties[p].enum=h?u.options.enum:[].concat(o(u.options.enum),[null]))}}return 0===n.required.length&&delete n.required,n},t.exports=e=V,V.Types=h=r(7953),e.ObjectId=h.ObjectId},7160:(t,e)=>{"use strict";e.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed"),e.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")},7219:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}var c=r(8213),l=r(2900),f=r(4070),p=r(5497),h=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=a(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(e,t),r=e,(i=[{key:"assimilateError",value:function(t){var e=t.reason,r=f(e)&&l(e)&&-1===t.message.indexOf("bad auth")&&-1===t.message.indexOf("Authentication failed");for(var n in r?this.message="Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/":p(e)?this.message="Mongoose is connecting with SSL enabled, but the server is not accepting SSL connections. Please ensure that the MongoDB server you are connecting to is configured to accept SSL connections. Learn more: https://mongoosejs.com/docs/tutorials/ssl.html":this.message=t.message,t)"name"!==n&&(this[n]=t[n]);return this.cause=e,this}}])&&o(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(c);Object.defineProperty(h.prototype,"name",{value:"MongooseServerSelectionError"}),t.exports=h},7236:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){if(null==t||"object"!==e(t))return t;if(Array.isArray(t))for(var r=t.length-1;r>=0;--r)void 0===t[r]&&t.splice(r,1);for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];void 0===t[i]&&delete t[i]}return t}},7291:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var n=Symbol("mongoose#trustedSymbol");e.trustedSymbol=n,e.trusted=function(t){return null==t||"object"!==r(t)||(t[n]=!0),t}},7300:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){return null==t||"object"!==e(t)||!("$meta"in t)&&!("$slice"in t)}},7352:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(c(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),a=n[r];r<o;a=n[++r])m(a)||!O(a)?s+=" "+a:s+=" "+c(a);return s},e.deprecate=function(t,e){if(!0==={env:{}}.noDeprecation)return t;var r=!1;return function(){if(!r){if({env:{}}.throwDeprecation)throw new Error(e);!{env:{}}.traceDeprecation?console.error(e):console.trace(e),r=!0}return t.apply(this,arguments)}};var s={},a=/^$/;if({}.NODE_DEBUG){var u={}.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+u+"$","i")}function c(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&e._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),p(n,t,n.depth)}function l(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function f(t,e){return t}function p(t,r,n){if(t.customInspect&&r&&j(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return g(o)||(o=p(t,o,n)),o}var i=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return v(e)?t.stylize(""+e,"number"):b(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(i)return i;var s=Object.keys(r),a=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),$(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(r);if(0===s.length){if(j(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if($(r))return h(r)}var c,l="",f=!1,O=["{","}"];return d(r)&&(f=!0,O=["[","]"]),j(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(l=" "+RegExp.prototype.toString.call(r)),S(r)&&(l=" "+Date.prototype.toUTCString.call(r)),$(r)&&(l=" "+h(r)),0!==s.length||f&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=f?function(t,e,r,n,o){for(var i=[],s=0,a=e.length;s<a;++s)x(e,String(s))?i.push(y(t,e,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(y(t,e,r,n,o,!0))}),i}(t,r,n,a,s):s.map(function(e){return y(t,r,n,a,e,f)}),t.seen.pop(),function(t,e,r){return t.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,O)):O[0]+l+O[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function y(t,e,r,n,o,i){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),x(n,o)||(s="["+o+"]"),a||(t.seen.indexOf(u.value)<0?(a=m(r)?p(t,u.value,null):p(t,u.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map(function(t){return" "+t}).join("\n").slice(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),_(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function d(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return"number"==typeof t}function g(t){return"string"==typeof t}function _(t){return void 0===t}function w(t){return O(t)&&"[object RegExp]"===P(t)}function O(t){return"object"===n(t)&&null!==t}function S(t){return O(t)&&"[object Date]"===P(t)}function $(t){return O(t)&&("[object Error]"===P(t)||t instanceof Error)}function j(t){return"function"==typeof t}function P(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r={env:{}}.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(7595),e.isArray=d,e.isBoolean=b,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=g,e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=_,e.isRegExp=w,e.types.isRegExp=w,e.isObject=O,e.isDate=S,e.types.isDate=S,e.isError=$,e.types.isNativeError=$,e.isFunction=j,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===n(t)||void 0===t},e.isBuffer=r(7944);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[A((t=new Date).getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(1679),e._extend=function(t,e){if(!e||!O(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function k(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e;if("function"!=typeof(e=t[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(t,n){t?r(t):e(n)});try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),T&&Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=T,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var o=this,i=function(){return n.apply(o,arguments)};t.apply(this,e).then(function(t){({env:{}}).nextTick(i.bind(null,null,t))},function(t){({env:{}}).nextTick(k.bind(null,t,i))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,o(t)),e}},7425:(t,e,r)=>{"use strict";var n=r(2696);t.exports=function(t,e){if(null==t||null==t.discriminators)return null;for(var r=0,o=Object.keys(t.discriminators);r<o.length;r++){var i=o[r],s=t.discriminators[i];if(null!=s.discriminatorMapping&&n(s.discriminatorMapping.value,e))return s}return null}},7430:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var i=r(6353).Binary,s=r(3305),a=r(2497);r(3672),r(7352);function u(t){return t&&"object"===o(t)&&!(t instanceof Date)&&!s(t,"ObjectId")&&(!Array.isArray(t)||0!==t.length)&&!(t instanceof n)&&!s(t,"Decimal128")&&!(t instanceof i)}e.B=function t(e,r,o,i){var s,c=(s=e&&a(e)&&!n.isBuffer(e)?Object.keys(e.toObject({transform:!1,virtuals:!1})||{}):Object.keys(e||{})).length,l={};r=r?r+".":"";for(var f=0;f<c;++f){var p=s[f],h=e[p];l[r+p]=h;var y=i&&i.path&&i.path(r+p),d=i&&i.nested&&i.nested[r+p];if(!y||"Mixed"!==y.instance){if(u(h)){if(o&&o.skipArrays&&Array.isArray(h))continue;var b=t(h,r+p,o,i);for(var m in b)l[m]=b[m];Array.isArray(h)&&(l[r+p]=h)}if(d)for(var v=0,g=Object.keys(i.paths);v<g.length;v++){var _=g[v];_.startsWith(r+p+".")&&!l.hasOwnProperty(_)&&(l[_]=void 0)}}}return l}},7494:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"_id",u),Object.defineProperty(a.prototype,"minimize",u),t.exports=a},7557:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(8920),s=r(7930).arrayAtomicsSymbol,a=r(7930).arrayAtomicsBackupSymbol,u=r(7930).arrayParentSymbol,c=r(7930).arrayPathSymbol,l=r(7930).arraySchemaSymbol,f=Array.prototype.push,p=/^\d+$/;t.exports=function(t,e,r,n){var h;if(Array.isArray(t)){var y=t.length;if(0===y)h=new Array;else if(1===y)(h=new Array(1))[0]=t[0];else if(y<1e4)h=new Array,f.apply(h,t);else{h=new Array;for(var d=0;d<y;++d)f.call(h,t[d])}}else h=[];var b=o(o(o(o(o(o(o(o({},s,{}),a,void 0),c,e),l,n),u,void 0),"isMongooseArray",!0),"isMongooseArrayProxy",!0),"__array",h);t&&null!=t[s]&&(b[s]=t[s]),null!=r&&r.$__&&(b[u]=r,b[l]=n||r.schema.path(e));var m=new Proxy(h,{get:function(t,e){return b.hasOwnProperty(e)?b[e]:i.hasOwnProperty(e)?i[e]:n&&n.virtuals&&n.virtuals.hasOwnProperty(e)?n.virtuals[e].applyGetters(void 0,t):"string"==typeof e&&p.test(e)&&null!=(null==n?void 0:n.$embeddedSchemaType)?n.$embeddedSchemaType.applyGetters(h[e],r):h[e]},set:function(t,e,r){return"string"==typeof e&&p.test(e)?i.set.call(m,e,r,!1):b.hasOwnProperty(e)?b[e]=r:n&&n.virtuals&&n.virtuals.hasOwnProperty(e)?n.virtuals[e].applySetters(r,t):h[e]=r,!0}});return m}},7591:t=>{"use strict";var e=null;t.exports.get=function(){return e},t.exports.set=function(t){e=t}},7595:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(5899),i=r(1905),s=r(9834),a=r(7911);function u(t){return t.call.bind(t)}var c="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,f=u(Object.prototype.toString),p=u(Number.prototype.valueOf),h=u(String.prototype.valueOf),y=u(Boolean.prototype.valueOf);if(c)var d=u(BigInt.prototype.valueOf);if(l)var b=u(Symbol.prototype.valueOf);function m(t,e){if("object"!==n(t))return!1;try{return e(t),!0}catch(t){return!1}}function v(t){return"[object Map]"===f(t)}function g(t){return"[object Set]"===f(t)}function _(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function O(t){return"[object ArrayBuffer]"===f(t)}function S(t){return"undefined"!=typeof ArrayBuffer&&(O.working?O(t):t instanceof ArrayBuffer)}function $(t){return"[object DataView]"===f(t)}function j(t){return"undefined"!=typeof DataView&&($.working?$(t):t instanceof DataView)}e.isArgumentsObject=o,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"===n(t)&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||j(t)},e.isUint8Array=function(t){return"Uint8Array"===s(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===s(t)},e.isUint16Array=function(t){return"Uint16Array"===s(t)},e.isUint32Array=function(t){return"Uint32Array"===s(t)},e.isInt8Array=function(t){return"Int8Array"===s(t)},e.isInt16Array=function(t){return"Int16Array"===s(t)},e.isInt32Array=function(t){return"Int32Array"===s(t)},e.isFloat32Array=function(t){return"Float32Array"===s(t)},e.isFloat64Array=function(t){return"Float64Array"===s(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===s(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===s(t)},v.working="undefined"!=typeof Map&&v(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(v.working?v(t):t instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(g.working?g(t):t instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(_.working?_(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},O.working="undefined"!=typeof ArrayBuffer&&O(new ArrayBuffer),e.isArrayBuffer=S,$.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&$(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=j;var P="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===f(t)}function E(t){return void 0!==P&&(void 0===A.working&&(A.working=A(new P)),A.working?A(t):t instanceof P)}function x(t){return m(t,p)}function T(t){return m(t,h)}function k(t){return m(t,y)}function N(t){return c&&m(t,d)}function I(t){return l&&m(t,b)}e.isSharedArrayBuffer=E,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=x,e.isStringObject=T,e.isBooleanObject=k,e.isBigIntObject=N,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return x(t)||T(t)||k(t)||N(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(S(t)||E(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})},7760:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var u,c,l=r(8499),f=r(2555),p=r(8213),h=r(4592),y=r(6426),d=y.CastError,b=r(5022),m=r(2069),v=r(622),g=r(2073),_=r(7982),w=r(4450),O=r(8260),S=r(5110),$=r(7352),j=r(8768),P=r(5558).G,A=r(4327),E=r(9604),x=r(1058),T=Symbol("mongoose#isNestedArray"),k=Object.freeze({});function N(t,e,n,o){c||(c=r(9600).Embedded);var i,s,a="type";if(o&&o.typeKey&&(a=o.typeKey),this.schemaOptions=o,e){var u={};j.isPOJO(e)&&(e[a]?(delete(u=w(e))[a],e=e[a]):e=b),null!=n&&null!=n.ref&&null==u.ref&&(u.ref=n.ref),e===Object&&(e=b);var l="string"==typeof e?e:j.getFunctionName(e),f=r(7953),p=f.hasOwnProperty(l)?f[l]:e;if(this.casterConstructor=p,this.casterConstructor instanceof N&&(this.casterConstructor[T]=!0),"function"!=typeof p||p.$isArraySubdocument||p.$isSchemaMap)this.caster=p,this.caster instanceof c||(this.caster.path=t);else{var h=this.caster instanceof c?null:t;this.caster=new p(h,u)}this.$embeddedSchemaType=this.caster}if(this.$isMongooseArray=!0,y.call(this,t,n,"Array"),null!=this.defaultValue&&(i=this.defaultValue,s="function"==typeof i),!("defaultValue"in this)||null!=this.defaultValue){var d=function(){return s?i.call(this):null!=i?[].concat(i):[]};d.$runBeforeSetters=!s,this.default(d)}}N.schemaName="Array",N.options={castNonArrays:!0},N.defaultOptions={},N.set=y.set,N.setters=[],N.get=y.get,N.prototype=Object.create(y.prototype),N.prototype.constructor=N,N.prototype.OptionsConstructor=h,N._checkRequired=y.prototype.checkRequired,N.checkRequired=y.checkRequired,N.prototype.virtuals=null,N.prototype.checkRequired=function(t,e){return"object"===a(t)&&y._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():N.checkRequired())(t)},N.prototype.enum=function(){for(var t=this;;){var e=t&&t.caster&&t.caster.instance;if("Array"!==e){if("String"!==e&&"Number"!==e)throw new Error("`enum` can only be set on an array of strings or numbers , not "+e);break}t=t.caster}var r=arguments;return!Array.isArray(arguments)&&j.isObject(arguments)&&(r=j.object.vals(r)),t.caster.enum.apply(t.caster,r),this},N.prototype.applyGetters=function(t,e){return null!=e&&null!=e.$__&&e.$populated(this.path)?t:y.prototype.applyGetters.call(this,t,e)},N.prototype._applySetters=function(t,e,r,n){if(this.casterConstructor.$isMongooseArray&&N.options.castNonArrays&&!this[T]){for(var o=0,i=this;null!=i&&i.$isMongooseArray&&!i.$isMongooseDocumentArray;)++o,i=i.casterConstructor;if(null!=t&&0!==t.length){var s=g(t);if(s.min===s.max&&s.max<o&&s.containsNonArrayItem)for(var a=s.max;a<o;++a)t=[t]}}return y.prototype._applySetters.call(this,t,e,r,n)},N.prototype.cast=function(t,e,n,o,i){var s,a;if(u||(u=r(9600).Array),Array.isArray(t)){if(!t.length&&e){var c=e.schema.indexedPaths(),l=this.path;for(s=0,a=c.length;s<a;++s){var f=c[s][0][l];if("2dsphere"===f||"2d"===f)return}var p=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(null!=p)for(s=0,a=c.length;s<a;++s)if("2dsphere"===c[s][0][p])return}i=i||k;var h=j.isMongooseArray(t)?t.__array:t,y=i.path||this.path;if(null!=i.arrayPathIndex&&(y+="."+i.arrayPathIndex),h=(t=u(h,y,e,this)).__array,n&&null!=e&&null!=e.$__&&e.$populated(this.path))return t;var m=this.caster,v=m.$isMongooseArray;if(m&&this.casterConstructor!==b)try{var g=h.length;for(s=0;s<g;s++){var _={};v&&(null!=i.arrayPath||null!=m._arrayParentPath)&&(_.arrayPathIndex=s),i.hydratedPopulatedDocs&&(_.hydratedPopulatedDocs=i.hydratedPopulatedDocs),h[s]=m.applySetters(h[s],e,n,void 0,_)}}catch(e){throw new d("["+e.kind+"]",$.inspect(t),this.path+"."+s,e,this)}return t}var w=null!=this.options.castNonArrays?this.options.castNonArrays:N.options.castNonArrays;if(n||w)return e&&n&&e.markModified(this.path),this.cast([t],e,n);throw new d("Array",$.inspect(t),this.path,null,this)},N.prototype._castForPopulate=function(t,e){if(u||(u=r(9600).Array),Array.isArray(t)){var n,o=t.__array?t.__array:t,i=o.length,s=this.caster;if(s&&this.casterConstructor!==b)try{for(n=0;n<i;n++){var a={};s.$isMongooseArray&&null!=s._arrayParentPath&&(a.arrayPathIndex=n),o[n]=s.cast(o[n],e,!1,void 0,a)}}catch(e){throw new d("["+e.kind+"]",$.inspect(t),this.path+"."+n,e,this)}return t}throw new d("Array",$.inspect(t),this.path,null,this)},N.prototype.$toObject=N.prototype.toObject,N.prototype.discriminator=function(){for(var t,e=this;e.$isMongooseArray&&!e.$isMongooseDocumentArray;)if(null==(e=e.casterConstructor)||"function"==typeof e)throw new p("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return(t=e).discriminator.apply(t,arguments)},N.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.constructor(this.path,this.caster,t,this.schemaOptions);return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),e},N.prototype._castForQuery=function(t,e){var r=this,n=this.casterConstructor;if(t&&n.discriminators&&n.schema&&n.schema.options&&n.schema.options.discriminatorKey)if("string"==typeof t[n.schema.options.discriminatorKey]&&n.discriminators[t[n.schema.options.discriminatorKey]])n=n.discriminators[t[n.schema.options.discriminatorKey]];else{var o=x(n.discriminators,t[n.schema.options.discriminatorKey]);o&&(n=o)}var i=this.casterConstructor.prototype,s=i&&i.castForQuery,a=i&&i.cast,u=n.castForQuery,c=this.caster;return Array.isArray(t)?(this.setters.reverse().forEach(function(e){t=e.call(r,t,r)}),t=t.map(function(t){return j.isObject(t)&&t.$elemMatch?t:s?t=s.call(c,null,t,e):a?t=a.call(c,t):u?t=u.call(c,null,t,e):null!=t?t=new n(t):t})):s?t=s.call(c,null,t,e):a?t=a.call(c,t):u?t=u.call(c,null,t,e):null!=t&&(t=new n(t)),t},N.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with Array.");return n.call(this,e,r)}return this._castForQuery(e,r)},N.prototype.virtual=function(t,e){if(t instanceof v||"VirtualType"===O(t))return this.virtual(t.path,t.options);if(e=new m(e),j.hasUserDefinedProperty(e,["ref","refPath"]))throw new p("Cannot set populate virtual as a property of an array");var r=new v(e,t);return null===this.virtuals&&(this.virtuals={}),this.virtuals[t]=r,r};var I=N.prototype.$conditionalHandlers={};function B(t){return function(e,r){if(!Array.isArray(e))throw new TypeError("conditional "+t+" requires an array");var n,o=[],i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(i.s();!(n=i.n()).done;){var a,u=n.value;o.push(_(null!==(a=this.casterConstructor.schema)&&void 0!==a?a:r.schema,u,null,this&&this.$$context))}}catch(t){i.e(t)}finally{i.f()}return o}}I.$all=function(t,e){var r=this;return Array.isArray(t)||(t=[t]),t=t.map(function(t){if(!j.isObject(t))return t;if(null!=t.$elemMatch)return{$elemMatch:_(r.casterConstructor.schema,t.$elemMatch,null,r&&r.$$context)};var e={};return e[r.path]=t,_(r.casterConstructor.schema,e,null,r&&r.$$context)[r.path]},this),this.castForQuery(null,t,e)},I.$options=String,I.$elemMatch=function(t,e){for(var r=Object.keys(t),n=r.length,o=0;o<n;++o){var i=r[o],s=t[i];S(i)&&null!=s&&(t[i]=this.castForQuery(i,s,e))}return t},I.$geoIntersects=E.cast$geoIntersects,I.$or=B("$or"),I.$and=B("$and"),I.$nor=B("$nor"),I.$near=I.$nearSphere=E.cast$near,I.$within=I.$geoWithin=E.cast$within,I.$size=I.$minDistance=I.$maxDistance=P,I.$exists=l,I.$type=f,I.$eq=I.$gt=I.$gte=I.$lt=I.$lte=I.$not=I.$regex=I.$ne=N.prototype._castForQuery,I.$nin=y.prototype.$conditionalHandlers.$nin,I.$in=y.prototype.$conditionalHandlers.$in,N.prototype.toJSONSchema=function(t){var e=this.getEmbeddedSchemaType(),r=this.options.required&&"function"!=typeof this.options.required;return o(o({},A("array","array",null==t?void 0:t.useBsonType,r)),{},{items:e.toJSONSchema(t)})},N.prototype.autoEncryptionType=function(){return"array"},t.exports=N},7768:(t,e,r)=>{"use strict";var n=r(2402);t.exports=function(t){return null==t?t:""===t?null:("string"!=typeof t&&"boolean"!=typeof t||(t=Number(t)),n.ok(!isNaN(t)),t instanceof Number?t.valueOf():"number"==typeof t?t:Array.isArray(t)||"function"!=typeof t.valueOf?t.toString&&!Array.isArray(t)&&t.toString()==Number(t)?Number(t):void n.ok(!1):Number(t.valueOf()))}},7834:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t,r,n,o){return o.justOne||o.count?(t[r]=Array.isArray(n)?n[0]:n,"object"!==e(t[r])&&(t[r]=o.count?n:null)):(t[r]=Array.isArray(n)?n:null==n?[]:[n],t[r]=t[r].filter(function(t){return t&&"object"===e(t)})),t[r]}},7860:t=>{"use strict";t.exports=function(t){for(var e=[],r="",n="DEFAULT",o=0;o<t.length;++o)"IN_SQUARE_BRACKETS"!==n||/\d/.test(t[o])||"]"===t[o]||(n="DEFAULT",r=e[e.length-1]+"["+r,e.splice(e.length-1,1)),"["===t[o]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(e.push(r),r=""),n="IN_SQUARE_BRACKETS"):"]"===t[o]?"IN_SQUARE_BRACKETS"===n?(n="IMMEDIATELY_AFTER_SQUARE_BRACKETS",e.push(r),r=""):(n="DEFAULT",r+=t[o]):"."===t[o]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(e.push(r),r=""),n="DEFAULT"):r+=t[o];return"IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&e.push(r),e}},7878:(t,e,r)=>{"use strict";var n=r(2273),o=r(4183);t.exports=function(){var t=o();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},7910:(t,e,r)=>{"use strict";var n=r(1058);t.exports=function(t,e,r){var o=t.schema.options.discriminatorKey,i=null!=e&&e[o];if(null==i&&(i=r),t.discriminators&&null!=i)if(t.discriminators[i])t=t.discriminators[i];else{var s=n(t.discriminators,i);s&&(t=s)}return t}},7911:(t,e,r)=>{"use strict";var n=r(9834);t.exports=function(t){return!!n(t)}},7930:(t,e)=>{"use strict";e.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup"),e.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics"),e.arrayParentSymbol=Symbol("mongoose#Array#_parent"),e.arrayPathSymbol=Symbol("mongoose#Array#_path"),e.arraySchemaSymbol=Symbol("mongoose#Array#_schema"),e.documentArrayParent=Symbol("mongoose#documentArrayParent"),e.documentIsSelected=Symbol("mongoose#Document#isSelected"),e.documentIsModified=Symbol("mongoose#Document#isModified"),e.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths"),e.documentSchemaSymbol=Symbol("mongoose#Document#schema"),e.getSymbol=Symbol("mongoose#Document#get"),e.modelSymbol=Symbol("mongoose#Model"),e.objectIdSymbol=Symbol("mongoose#ObjectId"),e.populateModelSymbol=Symbol("mongoose#PopulateOptions#Model"),e.schemaTypeSymbol=Symbol("mongoose#schemaType"),e.sessionNewDocuments=Symbol("mongoose#ClientSession#newDocuments"),e.scopeSymbol=Symbol("mongoose#Document#scope"),e.validatorErrorSymbol=Symbol("mongoose#validatorError")},7944:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){return t&&"object"===e(t)&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},7953:(t,e,r)=>{"use strict";e.Array=r(7760),e.BigInt=r(3318),e.Boolean=r(6413),e.Buffer=r(2307),e.Date=r(2345),e.Decimal128=e.Decimal=r(7045),e.DocumentArray=r(9123),e.Double=r(1732),e.Int32=r(433),e.Map=r(6867),e.Mixed=r(5022),e.Number=r(3660),e.ObjectId=r(3091),e.String=r(8728),e.Subdocument=r(5098),e.UUID=r(2134),e.Union=r(8866),e.Oid=e.ObjectId,e.Object=e.Mixed,e.Bool=e.Boolean,e.ObjectID=e.ObjectId},7982:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var s=r(3609),a=r(8995),u=r(7953),c=r(170),l=r(1244),f=r(9064),p=r(3703),h=r(7425),y=r(5110),d=r(7352),b=r(608),m=r(2497),v=r(8768),g=["Polygon","MultiPolygon"];function _(t,e,r){if(Array.isArray(t))t.forEach(function(n,o){if(Array.isArray(n)||b(n))return _(n,e,r);t[o]=e.castForQuery(null,n,r)});else for(var n=Object.keys(t),o=n.length;o--;){var i=n[o],s=t[i];Array.isArray(s)||b(s)?(_(s,e,r),t[i]=s):t[i]=e.castForQuery({val:s,context:r})}}function w(t,e,r,n){if("strictQuery"in t)return t.strictQuery;if("strictQuery"in e)return e.strictQuery;var o=n&&n.mongooseCollection&&n.mongooseCollection.conn&&n.mongooseCollection.conn.base&&n.mongooseCollection.conn.base.options;return o&&"strictQuery"in o?o.strictQuery:r.strictQuery}t.exports=function t(e,r,o,O){if(Array.isArray(r))throw new Error("Query filter must be an object, got an array ",d.inspect(r));if(null==r)return r;null!=e&&null!=e.discriminators&&null!=r[e.options.discriminatorKey]&&(e=h(e,r[e.options.discriminatorKey])||e);var S,$,j,P,A,E,x=Object.keys(r),T=x.length;for(o=o||{};T--;)if(E=r[P=x[T]],"$or"===P||"$nor"===P||"$and"===P){if(!Array.isArray(E))throw new s("Array",E,P);for(var k=E.length-1;k>=0;k--){if(null==E[k]||"object"!==i(E[k]))throw new s("Object",E[k],P+"."+k);var N=Object.keys(E[k]).length,I=E[k][e.options.discriminatorKey];if(null==I)E[k]=t(e,E[k],o,O);else{var B=h(O.schema,I);E[k]=t(B||e,E[k],o,O)}0===Object.keys(E[k]).length&&0!==N&&E.splice(k,1)}0===E.length&&delete r[P]}else{if("$where"===P){if("string"!==(A=i(E))&&"function"!==A)throw new Error("Must have a string or function for $where");"function"===A&&(r[P]=E.toString());continue}if("$expr"===P){E=c(E,e);continue}if("$elemMatch"===P)E=t(e,E,o,O);else if("$text"===P)E=f(E,P);else if("$comment"!==P||e.paths.hasOwnProperty("$comment")){if(!e)continue;if(!($=e.path(P)))for(var D=P.split("."),M=D.length;M--;){var R=D.slice(0,M).join("."),U=D.slice(M).join("."),C=e.path(R),F=C&&C.schema&&C.schema.options&&C.schema.options.discriminatorKey;if(null!=C&&null!=(C.schema&&C.schema.discriminators)&&null!=F&&U!==F){var L=p(r,R+"."+F),V=C.schema.discriminators;"string"==typeof L&&null!=V[L]?$=V[L].path(U):null!=L&&1===Object.keys(L).length&&Array.isArray(L.$in)&&1===L.$in.length&&"string"==typeof L.$in[0]&&null!=V[L.$in[0]]&&($=V[L.$in[0]].path(U))}}if($){if(null==E)continue;if(v.isPOJO(E))if(Object.keys(E).some(y))for(var q=Object.keys(E),J=void 0,z=q.length;z--;)if(j=E[J=q[z]],"$elemMatch"===J)j&&null!=$&&null!=$.schema?t($.schema,j,o,O):j&&null!=$&&$.$isMongooseArray&&(v.isPOJO(j)&&null!=j.$not?t(e,j,o,O):E[J]=$.castForQuery(J,j,O));else if("$not"===J){if(j&&$){if((S=Object.keys(j)).length&&y(S[0]))for(var K in j)j[K]=$.castForQuery(K,j[K],O);else E[J]=$.castForQuery(J,j,O);continue}}else E[J]=$.castForQuery(J,j,O);else r[P]=$.castForQuery(null,E,O);else if(Array.isArray(E)&&-1===["Buffer","Array"].indexOf($.instance)&&!o.sanitizeFilter){var H,W=[],G=n(E);try{for(G.s();!(H=G.n()).done;){var Q=H.value;W.push($.castForQuery(null,Q,O))}}catch(t){G.e(t)}finally{G.f()}r[P]={$in:W}}else r[P]=$.castForQuery(null,E,O)}else{for(var Y=P.split("."),Z=Y.length,X=void 0,tt=void 0,et=void 0;Z--&&(X=Y.slice(0,Z).join("."),!($=e.path(X))););if($){if($.caster&&$.caster.schema){(et={})[tt=Y.slice(Z).join(".")]=E;var rt=t($.caster.schema,et,o,O)[tt];void 0===rt?delete r[P]:r[P]=rt}else r[P]=E;continue}if(b(E)){var nt="";if(E.$near?nt="$near":E.$nearSphere?nt="$nearSphere":E.$within?nt="$within":E.$geoIntersects?nt="$geoIntersects":E.$geoWithin&&(nt="$geoWithin"),nt){var ot=new u.Number("__QueryCasting__"),it=E[nt];if(null!=E.$maxDistance&&(E.$maxDistance=ot.castForQuery(null,E.$maxDistance,O)),null!=E.$minDistance&&(E.$minDistance=ot.castForQuery(null,E.$minDistance,O)),"$within"===nt){var st=it.$center||it.$centerSphere||it.$box||it.$polygon;if(!st)throw new Error("Bad $within parameter: "+JSON.stringify(E));it=st}else if("$near"===nt&&"string"==typeof it.type&&Array.isArray(it.coordinates))it=it.coordinates;else if(("$near"===nt||"$nearSphere"===nt||"$geoIntersects"===nt)&&it.$geometry&&"string"==typeof it.$geometry.type&&Array.isArray(it.$geometry.coordinates))null!=it.$maxDistance&&(it.$maxDistance=ot.castForQuery(null,it.$maxDistance,O)),null!=it.$minDistance&&(it.$minDistance=ot.castForQuery(null,it.$minDistance,O)),m(it.$geometry)&&(it.$geometry=it.$geometry.toObject({transform:!1,virtuals:!1})),it=it.$geometry.coordinates;else if("$geoWithin"===nt)if(it.$geometry){m(it.$geometry)&&(it.$geometry=it.$geometry.toObject({virtuals:!1}));var at=it.$geometry.type;if(-1===g.indexOf(at))throw new Error('Invalid geoJSON type for $geoWithin "'+at+'", must be "Polygon" or "MultiPolygon"');it=it.$geometry.coordinates}else it=it.$box||it.$polygon||it.$center||it.$centerSphere,m(it)&&(it=it.toObject({virtuals:!1}));_(it,ot,O);continue}}if(e.nested[P])continue;var ut="strict"in o?o.strict:e.options.strict,ct=w(o,e._userProvidedOptions,e.options,O);if(o.upsert&&ut){if("throw"===ut)throw new a(P);throw new a(P,'Path "'+P+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if("throw"===ct)throw new a(P,'Path "'+P+"\" is not in schema and strictQuery is 'throw'.");ct&&delete r[P]}}else E=l(E,P),r[P]=E}return r}},8063:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,["Schema hasn't been registered for model \""+t+'".\nUse mongoose.model(name, schema)'])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"MissingSchemaError"}),t.exports=a},8093:t=>{"use strict";t.exports=Object},8133:(t,e,r)=>{"use strict";var n=r(8995);t.exports=function(t){var e,r;t.$immutable?(t.$immutableSetter=(e=t.path,r=t.options.immutable,function(t,o,i,s){if(null==this||null==this.$__)return t;if(this.isNew)return t;if(s&&s.overwriteImmutable)return t;if(!("function"==typeof r?r.call(this,this):r))return t;var a=null!=this.$__.priorDoc?this.$__.priorDoc.$__getValue(e):this.$__getValue(e);if("throw"===this.$__.strictMode&&t!==a)throw new n(e,"Path `"+e+"` is immutable and strict mode is set to throw.",!0);return a}),t.set(t.$immutableSetter)):t.$immutableSetter&&(t.setters=t.setters.filter(function(e){return e!==t.$immutableSetter}),delete t.$immutableSetter)}},8188:t=>{"use strict";t.exports=URIError},8213:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t){var e="function"==typeof Map?new Map:void 0;return r=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(n())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var s=new(t.bind.apply(t,i));return r&&o(s,r.prototype),s}(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)},r(t)}function n(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(n=function(){return!!t})()}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}var s=function(t){function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,r,o){return r=i(r),function(t,r){if(r&&("object"==e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,n()?Reflect.construct(r,o||[],i(t).constructor):r.apply(t,o))}(this,r,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(r,t),s=r,Object.defineProperty(s,"prototype",{writable:!1}),s;var s}(r(Error));Object.defineProperty(s.prototype,"name",{value:"MongooseError"}),t.exports=s},8235:(t,e,r)=>{"use strict";var n=r(8213),o=r(6426),i=r(5098),s=r(7910);function a(t,e){if(this.$parentSchemaType=e&&e.$parentSchemaType,!this.$parentSchemaType)throw new n("Cannot create DocumentArrayElement schematype without a parent");delete e.$parentSchemaType,o.call(this,t,e,"DocumentArrayElement"),this.$isMongooseDocumentArrayElement=!0}a.schemaName="DocumentArrayElement",a.defaultOptions={},a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype.cast=function(){var t;return(t=this.$parentSchemaType).cast.apply(t,arguments)[0]},a.prototype.doValidate=function(t,e,r,n){var o=s(this.caster,t);return!t||t instanceof o||(t=new o(t,r,null,null,n&&null!=n.index?n.index:null)),i.prototype.doValidate.call(this,t,e,r,n)},a.prototype.clone=function(){this.options.$parentSchemaType=this.$parentSchemaType;var t=o.prototype.clone.apply(this,arguments);return delete this.options.$parentSchemaType,t.caster=this.caster,t.schema=this.schema,t},t.exports=a},8250:(t,e,r)=>{"use strict";var n=r(5832).hp,o=r(6365),i=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,s=o.Binary;function a(t){"string"!=typeof t&&(t="");var e,r=null!=(e=t.replace(/[{}-]/g,""))&&n.from(e,"hex"),i=new o(r);return i._subtype=4,i}t.exports=function(t){if(null==t)return t;function e(t){var e=new o(t);return e._subtype=4,e}if("string"==typeof t){if(i.test(t))return a(t);throw new Error('"'.concat(t,'" is not a valid UUID string'))}if(n.isBuffer(t))return e(t);if(t instanceof s)return e(t.value(!0));if(t.toString&&t.toString!==Object.prototype.toString&&i.test(t.toString()))return a(t.toString());throw new Error('"'.concat(t,'" cannot be casted to a UUID'))},t.exports.UUID_FORMAT=i},8260:t=>{"use strict";t.exports=function(t){if(null!=t&&"function"==typeof t.constructor)return t.constructor.name}},8285:(t,e,r)=>{"use strict";var n=r(2400),o=r(2580),i=!1;t.exports=function(){return i?o:n},t.exports.setBrowser=function(t){i=t}},8297:t=>{"use strict";function e(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=n(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e,r){if(a())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&s(o,r.prototype),o}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(a=function(){return!!t})()}function u(){this._pres=new Map,this._posts=new Map}function c(t,e,r,n,o,i,s){return i.useErrorHandlers?t.execPost(r,n,o,{error:e},function(t){return"function"==typeof s&&s(t)}):"function"==typeof s&&s(e)}function l(t,e,r,n){var o;try{o=t.apply(e,r)}catch(t){return n(t)}f(o)&&o.then(function(){return n()},function(t){return n(t)})}function f(t){return"object"===r(t)&&null!==t&&"function"==typeof t.then}function p(t){var e=!1,r=this;return function(){var n=arguments;if(!e)return e=!0,h(function(){return t.apply(r,n)})}}u.skipWrappedFunction=function(){if(!(this instanceof u.skipWrappedFunction))return i(u.skipWrappedFunction,Array.prototype.slice.call(arguments));this.args=Array.prototype.slice.call(arguments)},u.overwriteResult=function(){if(!(this instanceof u.overwriteResult))return i(u.overwriteResult,Array.prototype.slice.call(arguments));this.args=Array.prototype.slice.call(arguments)},u.prototype.execPre=function(t,e,r,n){3===arguments.length&&(n=r,r=[]);var o=this._pres.get(t)||[],i=o.length,s=o.numAsync||0,a=0,c=s,y=!1,d=r,b=null;if(!i)return h(function(){n(null)});function m(){if(!(a>=i)){var t=o[a];if(t.isAsync){var r=[p(v),p(function(t){if(t){if(y)return;if(!(t instanceof u.skipWrappedFunction))return y=!0,n(t);b=t}if(0===--c&&a>=i)return n(b)})];l(t.fn,e,r,r[0])}else if(t.fn.length>0){for(var s=[p(v)],g=arguments.length>=2?arguments:[null].concat(d),_=1;_<g.length;++_)_===g.length-1&&"function"==typeof g[_]||s.push(g[_]);l(t.fn,e,s,s[0])}else{var w=null;try{w=t.fn.call(e)}catch(t){if(null!=t)return n(t)}if(f(w))w.then(function(){return v()},function(t){return v(t)});else{if(++a>=i)return c>0?void 0:h(function(){n(b)});m()}}}}function v(t){if(t){if(y)return;if(!(t instanceof u.skipWrappedFunction))return y=!0,n(t);b=t}if(++a>=i)return c>0?void 0:n(b);m.apply(e,arguments)}m.apply(null,[null].concat(r))},u.prototype.execPreSync=function(t,e,r){for(var n=this._pres.get(t)||[],o=n.length,i=0;i<o;++i)n[i].fn.apply(e,r||[])},u.prototype.execPost=function(t,e,r,n,o){arguments.length<5&&(o=n,n=null);var i=this._posts.get(t)||[],s=i.length,a=0,c=null;if(n&&n.error&&(c=n.error),!s)return h(function(){o.apply(null,[c].concat(r))});!function t(){for(var n=i[a].fn,h=0,d=r.length,b=[],m=0;m<d;++m)h+=r[m]&&r[m]._kareemIgnore?0:1,r[m]&&r[m]._kareemIgnore||b.push(r[m]);if(c)if(y(i[a],h)){var v=p(function(e){if(e){if(e instanceof u.overwriteResult)return r=e.args,++a>=s?o.call(null,c):t();c=e}if(++a>=s)return o.call(null,c);t()});l(n,e,[c].concat(b).concat([v]),v)}else{if(++a>=s)return o.call(null,c);t()}else{var g=p(function(e){return e?e instanceof u.overwriteResult?(r=e.args,++a>=s?o.apply(null,[null].concat(r)):t()):(c=e,t()):++a>=s?o.apply(null,[null].concat(r)):void t()});if(y(i[a],h))return++a>=s?o.apply(null,[null].concat(r)):t();if(n.length===h+1)l(n,e,b.concat([g]),g);else{var _,w;try{w=n.apply(e,b)}catch(t){_=t,c=t}if(f(w))return w.then(function(t){g(t instanceof u.overwriteResult?t:null)},function(t){return g(t)});if(w instanceof u.overwriteResult&&(r=w.args),++a>=s)return o.apply(null,[_].concat(r));t()}}}()},u.prototype.execPostSync=function(t,e,r){for(var n=this._posts.get(t)||[],o=n.length,i=0;i<o;++i){var s=n[i].fn.apply(e,r||[]);s instanceof u.overwriteResult&&(r=s.args)}return r},u.prototype.createWrapperSync=function(t,e){var r=this;return function(){r.execPreSync(t,this,arguments);var n=e.apply(this,arguments);return r.execPostSync(t,this,[n])[0]}},u.prototype.wrap=function(t,e,r,i,s){var a=i.length>0?i[i.length-1]:null,l=Array.from(i);"function"==typeof a&&l.pop();var p=this,h=(s=s||{}).checkForPromise;this.execPre(t,r,i,function(i){if(i&&!(i instanceof u.skipWrappedFunction)){for(var y=s.numCallbackParams||0,d=s.contextParameter?[r]:[],b=d.length;b<y;++b)d.push(null);return c(p,i,t,r,d,s,a)}var m,v,g=e.length;if(i instanceof u.skipWrappedFunction)return m=i.args[0],_.apply(void 0,[null].concat(function(t){if(Array.isArray(t))return o(t)}(v=i.args)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(v)||n(v)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));try{m=e.apply(r,l.concat(_))}catch(t){return _(t)}if(h){if(f(m))return m.then(function(t){return _(null,t)},function(t){return _(t)});if(g<l.length+1)return _(null,m)}function _(){var e=Array.from(arguments);if(e.shift(),s.nullResultByDefault&&0===e.length&&e.push(null),arguments[0])return c(p,arguments[0],t,r,e,s,a);p.execPost(t,r,e,function(){null!==a&&(arguments[0]?a(arguments[0]):a.apply(r,arguments))})}})},u.prototype.filter=function(t){for(var e=this,r=this.clone(),n=Array.from(r._pres.keys()),o=function(){var n=s[i],o=e._pres.get(n).map(function(t){return Object.assign({},t,{name:n})}).filter(t);if(0===o.length)return r._pres.delete(n),1;o.numAsync=o.filter(function(t){return t.isAsync}).length,r._pres.set(n,o)},i=0,s=n;i<s.length;i++)o();for(var a=Array.from(r._posts.keys()),u=function(){var n=l[c],o=e._posts.get(n).map(function(t){return Object.assign({},t,{name:n})}).filter(t);if(0===o.length)return r._posts.delete(n),1;r._posts.set(n,o)},c=0,l=a;c<l.length;c++)u();return r},u.prototype.hasHooks=function(t){return this._pres.has(t)||this._posts.has(t)},u.prototype.createWrapper=function(t,e,r,n){var o=this;return this.hasHooks(t)?function(){var i=r||this;o.wrap(t,e,i,Array.from(arguments),n)}:function(){var t=arguments,r=this;h(function(){return e.apply(r,t)})}},u.prototype.pre=function(t,e,n,o,i){var s={};"object"===r(e)&&null!==e?e=(s=e).isAsync:"boolean"!=typeof arguments[1]&&(n=e,e=!1);var a=this._pres.get(t)||[];if(this._pres.set(t,a),e&&(a.numAsync=a.numAsync||0,++a.numAsync),"function"!=typeof n)throw new Error('pre() requires a function, got "'+r(n)+'"');return i?a.unshift(Object.assign({},s,{fn:n,isAsync:e})):a.push(Object.assign({},s,{fn:n,isAsync:e})),this},u.prototype.post=function(t,e,n,o){var i=this._posts.get(t)||[];if("function"==typeof e&&(o=!!n,n=e,e={}),"function"!=typeof n)throw new Error('post() requires a function, got "'+r(n)+'"');return o?i.unshift(Object.assign({},e,{fn:n})):i.push(Object.assign({},e,{fn:n})),this._posts.set(t,i),this},u.prototype.clone=function(){var t,r=new u,n=e(this._pres.keys());try{for(n.s();!(t=n.n()).done;){var o=t.value,i=this._pres.get(o).slice();i.numAsync=this._pres.get(o).numAsync,r._pres.set(o,i)}}catch(t){n.e(t)}finally{n.f()}var s,a=e(this._posts.keys());try{for(a.s();!(s=a.n()).done;){var c=s.value;r._posts.set(c,this._posts.get(c).slice())}}catch(t){a.e(t)}finally{a.f()}return r},u.prototype.merge=function(t,r){var n,o=(r=1===arguments.length||r)?this.clone():this,i=e(t._pres.keys());try{var s=function(){var e=n.value,r=o._pres.get(e)||[],i=t._pres.get(e).filter(function(t){return-1===r.map(function(t){return t.fn}).indexOf(t.fn)}),s=r.concat(i);s.numAsync=r.numAsync||0,s.numAsync+=i.filter(function(t){return t.isAsync}).length,o._pres.set(e,s)};for(i.s();!(n=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}var a,u=e(t._posts.keys());try{var c=function(){var e=a.value,r=o._posts.get(e)||[],n=t._posts.get(e).filter(function(t){return-1===r.indexOf(t)});o._posts.set(e,r.concat(n))};for(u.s();!(a=u.n()).done;)c()}catch(t){u.e(t)}finally{u.f()}return o};var h="object"===r({env:{}})&&null!=={env:{}}&&{env:{}}.nextTick||function(t){setTimeout(t,0)};function y(t,e){return!!t.errorHandler||t.fn.length===e+2}t.exports=u},8435:t=>{"use strict";t.exports=Math.min},8442:(t,e,r)=>{"use strict";var n=r(1898);t.exports=function(t){for(var e=0,r=Object.values(n);e<r.length;e++)(0,r[e])(t,{deduplicate:!0});t.plugins=Object.values(n).map(function(t){return{fn:t,opts:{deduplicate:!0}}}).concat(t.plugins)}},8499:(t,e,r)=>{"use strict";var n=r(8953);t.exports=function(t){var e=null!=this?this.path:null;return n(t,e)}},8517:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t,r,s){var a,u,c;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var l=null!==(a=null==s?void 0:s.matchedCount)&&void 0!==a?a:0,f=null!==(u=null==s?void 0:s.insertedCount)&&void 0!==u?u:0,p=r.map(function(t){return t._id}).join(", ");p.length>100&&(p=p.slice(0,100)+"...");var h=r.length-l-f;return(c=function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,["".concat(t,".bulkSave() was not able to update ").concat(h," of the given documents due to incorrect version or optimistic concurrency, document ids: ").concat(p)])).modelName=t,c.documents=r,c.bulkWriteResult=s,c.numDocumentsNotUpdated=h,c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"MongooseBulkSaveIncompleteError"}),t.exports=a},8533:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(i=function(){return!!t})()}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}r(7591).set(r(4026));var u=r(8285);u.setBrowser(!0),e.Error=r(3672),e.Schema=r(7058),e.Types=r(9600),e.VirtualType=r(622),e.SchemaType=r(6426),e.SchemaTypeOptions=r(8879),e.utils=r(8768),e.Document=u(),e.model=function(t,r){var n=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=s(e),function(t,e){if(e&&("object"==o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,i()?Reflect.construct(e,r||[],s(t).constructor):e.apply(t,r))}(this,e,[t,r,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(e.Document);return n.modelName=t,n},"undefined"!=typeof window&&(window.mongoose=t.exports,window.Buffer=n)},8633:t=>{"use strict";t.exports=Math.pow},8690:t=>{"use strict";function e(){var t,n,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function a(e,o,i,s){var a=o&&o.prototype instanceof c?o:c,l=Object.create(a.prototype);return r(l,"_invoke",function(e,r,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(e,r){for(s=e,a=r,n=0;!f&&c&&!o&&n<l.length;n++){var o,i=l[n],h=p.p,y=i[2];e>3?(o=y===r)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=e<2&&h<i[1])?(s=0,p.v=r,p.n=i[1]):h<y&&(o=e<3||i[0]>r||r>y)&&(i[4]=e,i[5]=r,p.n=y,s=0))}if(o||e>1)return u;throw f=!0,r}return function(o,l,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,y),s=l,a=y;(n=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(c=2,i){if(s||(o="next"),n=i[o]){if(!(n=n.call(i,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,s<2&&(s=0)}else 1===s&&(n=i.return)&&n.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((n=(f=p.n<0)?a:e.call(r,p))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:n,done:f}}}(e,i,s),!0),l}var u={};function c(){}function l(){}function f(){}n=Object.getPrototypeOf;var p=[][i]?n(n([][i]())):(r(n={},i,function(){return this}),n),h=f.prototype=c.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,r(t,s,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=f,r(h,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(h),r(h,s,"Generator"),r(h,i,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(e=function(){return{w:a,m:y}})()}function r(t,e,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}r=function(t,e,n,o){function s(e,n){r(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[e]=n:(s("next",0),s("throw",1),s("return",2))},r(t,e,n,o)}var n=e().m(function t(){return e().w(function(t){for(;;)if(0===t.n)return t.a(2)},t)}).constructor;t.exports=function(){return n}},8728:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var u=r(6426),c=r(3672),l=r(9528),f=r(1244),p=r(4327),h=r(8768),y=r(3305),d=u.CastError;function b(t,e){this.enumValues=[],this.regExp=null,u.call(this,t,e,"String")}function m(t,e){return this.castForQuery(null,t,e)}function v(t){return null==t?this._castNullish(t):this.cast(t,this)}b.schemaName="String",b.defaultOptions={},b.prototype=Object.create(u.prototype),b.prototype.constructor=b,Object.defineProperty(b.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:l}),b._cast=f,b.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},b._defaultCaster=function(t){if(null!=t&&"string"!=typeof t)throw new Error;return t},b.get=u.get,b.set=u.set,b.setters=[],b._checkRequired=function(t){return(t instanceof String||"string"==typeof t)&&t.length},b.checkRequired=u.checkRequired,b.prototype.enum=function(){if(this.enumValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.enumValidator},this),this.enumValidator=!1),void 0===arguments[0]||!1===arguments[0])return this;var t,e;h.isObject(arguments[0])?Array.isArray(arguments[0].values)?(t=arguments[0].values,e=arguments[0].message):(t=h.object.vals(arguments[0]),e=c.messages.String.enum):(t=arguments,e=c.messages.String.enum);var r,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;void 0!==o&&this.enumValues.push(this.cast(o))}}catch(t){n.e(t)}finally{n.f()}var i=this.enumValues;return this.enumValidator=function(t){return null==t||~i.indexOf(t)},this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:i}),this},b.prototype.lowercase=function(t){var e=this;return arguments.length>0&&!t?this:this.set(function(t){return"string"!=typeof t&&(t=e.cast(t)),t?t.toLowerCase():t})},b.prototype.uppercase=function(t){var e=this;return arguments.length>0&&!t?this:this.set(function(t){return"string"!=typeof t&&(t=e.cast(t)),t?t.toUpperCase():t})},b.prototype.trim=function(t){var e=this;return arguments.length>0&&!t?this:this.set(function(t){return"string"!=typeof t&&(t=e.cast(t)),t?t.trim():t})},b.prototype.minlength=function(t,e){if(this.minlengthValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.minlengthValidator},this)),null!=t){var r=e||c.messages.String.minlength;r=r.replace(/{MINLENGTH}/,t),this.validators.push({validator:this.minlengthValidator=function(e){return null===e||e.length>=t},message:r,type:"minlength",minlength:t})}return this},b.prototype.minLength=b.prototype.minlength,b.prototype.maxlength=function(t,e){if(this.maxlengthValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.maxlengthValidator},this)),null!=t){var r=e||c.messages.String.maxlength;r=r.replace(/{MAXLENGTH}/,t),this.validators.push({validator:this.maxlengthValidator=function(e){return null===e||e.length<=t},message:r,type:"maxlength",maxlength:t})}return this},b.prototype.maxLength=b.prototype.maxlength,b.prototype.match=function(t,e){var r=e||c.messages.String.match;return this.validators.push({validator:function(e){return!!t&&(t.lastIndex=0,null==e||""===e||t.test(e))},message:r,type:"regexp",regexp:t}),this},b.prototype.checkRequired=function(t,e){return"object"===s(t)&&u._isRef(this,t,e,!0)?null!=t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():b.checkRequired())(t)},b.prototype.cast=function(t,e,r,n,o){if("string"!=typeof t&&u._isRef(this,t,e,r))return this._castRef(t,e,r,o);var i;i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():b.cast();try{return i(t)}catch(e){throw new d("string",t,this.path,null,this)}};var g=o(o({},u.prototype.$conditionalHandlers),{},{$all:function(t,e){var r=this;return Array.isArray(t)?t.map(function(t){return r.castForQuery(null,t,e)}):[this.castForQuery(null,t,e)]},$gt:m,$gte:m,$lt:m,$lte:m,$options:v,$regex:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)?t:v.call(this,t)},$not:m});Object.defineProperty(b.prototype,"$conditionalHandlers",{enumerable:!1,value:g}),b.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with String.");return n.call(this,e,r)}if("[object RegExp]"===Object.prototype.toString.call(e)||y(e,"BSONRegExp"))return e;try{return this.applySetters(e,r)}catch(t){throw t instanceof d&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},b.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return p("string","string",null==t?void 0:t.useBsonType,e)},b.prototype.autoEncryptionType=function(){return"string"},t.exports=b},8759:t=>{"use strict";t.exports=function(t){return t.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}},8768:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}function a(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}var l,f=r(6353).UUID,p=r(354),h=r(5678),y=r(5549),d=r(6948),b=r(4450),m=r(2746),v=r(608),g=r(1243),_=r(1347),w=r(3305),O=r(2789),S=r(9696),$=r(2497),j=r(5268),P=r(9539),A=r(2793),E=r(7291).trustedSymbol;e.specialProperties=A,e.isMongooseArray=g.isMongooseArray,e.isMongooseDocumentArray=_.isMongooseDocumentArray,e.registerMongooseArray=g.registerMongooseArray,e.registerMongooseDocumentArray=_.registerMongooseDocumentArray;var x=/\s/,T=/\s+/;e.toCollectionName=function(t,e){if("system.profile"===t)return t;if("system.indexes"===t)return t;if("function"==typeof e){if("string"!=typeof t)throw new TypeError("Collection name must be a string");if(0===t.length)throw new TypeError("Collection name cannot be empty");return e(t)}return t},e.deepEqual=function t(r,o){if(r===o)return!0;if("object"!==c(r)||"object"!==c(o))return r===o;if(r instanceof Date&&o instanceof Date)return r.getTime()===o.getTime();if(w(r,"ObjectId")&&w(o,"ObjectId")||w(r,"Decimal128")&&w(o,"Decimal128"))return r.toString()===o.toString();if(r instanceof RegExp&&o instanceof RegExp)return r.source===o.source&&r.ignoreCase===o.ignoreCase&&r.multiline===o.multiline&&r.global===o.global&&r.dotAll===o.dotAll&&r.unicode===o.unicode&&r.sticky===o.sticky&&r.hasIndices===o.hasIndices;if(null==r||null==o)return!1;if(r.prototype!==o.prototype)return!1;if(r instanceof Map||o instanceof Map)return r instanceof Map&&o instanceof Map&&t(Array.from(r.keys()),Array.from(o.keys()))&&t(Array.from(r.values()),Array.from(o.values()));if(r instanceof Number&&o instanceof Number)return r.valueOf()===o.valueOf();if(n.isBuffer(r))return e.buffer.areEqual(r,o);if(Array.isArray(r)||Array.isArray(o)){if(!Array.isArray(r)||!Array.isArray(o))return!1;var i=r.length;if(i!==o.length)return!1;for(var s=0;s<i;++s)if(!t(r[s],o[s]))return!1;return!0}null!=r.$__?r=r._doc:$(r)&&(r=r.toObject()),null!=o.$__?o=o._doc:$(o)&&(o=o.toObject());var a=Object.keys(r),u=Object.keys(o),l=a.length;if(l!==u.length)return!1;for(var f=l-1;f>=0;f--)if(a[f]!==u[f])return!1;for(var p=0,h=a;p<h.length;p++){var y=h[p];if(!t(r[y],o[y]))return!1}return!0},e.last=function(t){if(t.length>0)return t[t.length-1]},e.promiseOrCallback=j,e.cloneArrays=function(t){return Array.isArray(t)?t.map(function(t){return e.cloneArrays(t)}):t},e.omit=function(t,e){if(null==e)return Object.assign({},t);Array.isArray(e)||(e=[e]);var r,n=Object.assign({},t),o=s(e);try{for(o.s();!(r=o.n()).done;)delete n[r.value]}catch(t){o.e(t)}finally{o.f()}return n},e.clonePOJOsAndArrays=function(t){if(null==t)return t;if(null!=t.$__)return t;if(O(t)){t=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t);for(var r=0,n=Object.keys(t);r<n.length;r++){var s=n[r];t[s]=e.clonePOJOsAndArrays(t[s])}return t}if(Array.isArray(t)){t=function(t){if(Array.isArray(t))return u(t)}(l=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(l)||a(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();for(var c=0;c<t.length;++c)t[c]=e.clonePOJOsAndArrays(t[c]);return t}var l;return t},e.merge=function t(r,n,o,i){o=o||{};var s,a=Object.keys(n),u=0,c=a.length;n[E]&&(r[E]=n[E]),i=i||"";for(var l=o.omitNested||{};u<c;)if(s=a[u++],!(o.omit&&o.omit[s]||l[i]||A.has(s)))if(null==r[s])r[s]=e.clonePOJOsAndArrays(n[s]);else if(e.isObject(n[s])){if(e.isObject(r[s])||(r[s]={}),null!=n[s]){if(o.isDiscriminatorSchemaMerge&&n[s].$isSingleNested&&r[s].$isMongooseDocumentArray||n[s].$isMongooseDocumentArray&&r[s].$isSingleNested)continue;if(n[s].instanceOfSchema){r[s].instanceOfSchema?P(r[s],n[s].clone(),o.isDiscriminatorSchemaMerge):r[s]=n[s].clone();continue}if(w(n[s],"ObjectId")){r[s]=new y(n[s]);continue}}t(r[s],n[s],o,i?i+"."+s:s)}else o.overwrite&&(r[s]=n[s]);return r},e.toObject=function t(n){var o;if(l||(l=r(2400)),null==n)return n;if(n instanceof l)return n.toObject();if(Array.isArray(n)){o=[];var i,a=s(n);try{for(a.s();!(i=a.n()).done;){var u=i.value;o.push(t(u))}}catch(t){a.e(t)}finally{a.f()}return o}if(e.isPOJO(n)){o={},n[E]&&(o[E]=n[E]);for(var c=0,f=Object.keys(n);c<f.length;c++){var p=f[c];A.has(p)||(o[p]=t(n[p]))}return o}return n},e.isObject=v,e.isPOJO=r(2789),e.isNonBuiltinObject=function(t){return!("object"!==c(t)||e.isNativeObject(t)||e.isMongooseType(t)||t instanceof f||null==t)},e.isNativeObject=function(t){return Array.isArray(t)||t instanceof Date||t instanceof Boolean||t instanceof Number||t instanceof String},e.isEmptyObject=function(t){return null!=t&&"object"===c(t)&&0===Object.keys(t).length},e.hasKey=function(t,r){for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];if(i===r)return!0;if(e.isPOJO(t[i])&&e.hasKey(t[i],r))return!0}return!1},e.tick=function(t){if("function"==typeof t)return function(){try{t.apply(this,arguments)}catch(t){m(function(){throw t})}}},e.isMongooseType=function(t){return w(t,"ObjectId")||w(t,"Decimal128")||t instanceof n},e.isMongooseObject=$,e.expires=function(t){t&&"Object"===t.constructor.name&&"expires"in t&&(t.expireAfterSeconds="string"!=typeof t.expires?t.expires:Math.round(p(t.expires)/1e3),delete t.expires)},e.populate=function(t,r,n,o,i,a,u,l){var f,p=null;if(1===arguments.length){if(t instanceof d)return t._docs={},t._childDocs=[],[t];if(Array.isArray(t)){var h=(f=[],t.forEach(function(t){x.test(t.path)?t.path.split(T).forEach(function(e){var r=Object.assign({},t);r.path=e,f.push(r)}):f.push(t)}),f);return h.map(function(t){return e.populate(t)[0]})}p=e.isObject(t)?Object.assign({},t):{path:t}}else p="object"===c(n)?{path:t,select:r,match:n,options:o}:{path:t,select:r,model:n,match:o,options:i,populate:a,justOne:u,count:l};if(!("string"==typeof p.path||Array.isArray(p.path)&&p.path.every(function(t){return"string"==typeof t})))throw new TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `"+c(t)+"`");return function(t){if(Array.isArray(t.populate)){var r=[];t.populate.forEach(function(t){if(x.test(t.path)){var n=Object.assign({},t);n.path.split(T).forEach(function(t){n.path=t,r.push(e.populate(n)[0])})}else r.push(e.populate(t)[0])}),t.populate=e.populate(r)}else null!=t.populate&&"object"===c(t.populate)&&(t.populate=e.populate(t.populate));var n=[],o=x.test(t.path)?t.path.split(T):Array.isArray(t.path)?t.path:[t.path];null!=t.options&&(t.options=b(t.options));var i,a=s(o);try{for(a.s();!(i=a.n()).done;){var u=i.value;n.push(new d(Object.assign({},t,{path:u})))}}catch(t){a.e(t)}finally{a.f()}return n}(p)},e.getValue=function(t,e,r){return h.get(t,e,N,r)};var k=Object.freeze({getters:!1});function N(t,e){if("$*"===e&&t instanceof Map)return t;var r=(null==t?void 0:t._doc)||t;return null!=r&&r.isMongooseArrayProxy&&(r=r.__array),r instanceof Map?r.get(e,k):r[e]}e.setValue=function(t,e,r,n,o){h.set(t,e,r,"_doc",n,o)},e.object={},e.object.vals=function(t){for(var e=Object.keys(t),r=e.length,n=[];r--;)n.push(t[e[r]]);return n};var I=Object.prototype.hasOwnProperty;e.object.hasOwnProperty=function(t,e){return I.call(t,e)},e.isNullOrUndefined=function(t){return null==t},e.array={},e.array.flatten=function t(e,r,n){return n||(n=[]),e.forEach(function(e){Array.isArray(e)?t(e,r,n):r&&!r(e)||n.push(e)}),n};var B=Object.prototype.hasOwnProperty;e.hasUserDefinedProperty=function(t,r){if(null==t)return!1;if(Array.isArray(r)){var n,o=s(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(e.hasUserDefinedProperty(t,i))return!0}}catch(t){o.e(t)}finally{o.f()}return!1}if(B.call(t,r))return!0;if("object"===c(t)&&r in t){var a=t[r];return a!==Object.prototype[r]&&a!==Array.prototype[r]}return!1};var D=Math.pow(2,32)-1;e.isArrayIndex=function(t){return"number"==typeof t?t>=0&&t<=D:"string"==typeof t&&!!/^\d+$/.test(t)&&(t=+t)>=0&&t<=D},e.array.unique=function(t){var e,r=new Set,n=new Set,o=[],i=s(t);try{for(i.s();!(e=i.n()).done;){var a=e.value;if("number"==typeof a||"string"==typeof a||null==a){if(r.has(a))continue;o.push(a),r.add(a)}else if(w(a,"ObjectId")){if(n.has(a.toString()))continue;o.push(a),n.add(a.toString())}else o.push(a)}}catch(t){i.e(t)}finally{i.f()}return o},e.buffer={},e.buffer.areEqual=function(t,e){if(!n.isBuffer(t))return!1;if(!n.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(var r=0,o=t.length;r<o;++r)if(t[r]!==e[r])return!1;return!0},e.getFunctionName=S,e.decorate=function(t,e){for(var r in e)A.has(r)||(t[r]=e[r])},e.mergeClone=function(t,r){$(r)&&(r=r.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1}));for(var o,i=Object.keys(r),s=i.length,a=0;a<s;)if(o=i[a++],!A.has(o))if(void 0===t[o])t[o]=b(r[o],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{var u=r[o];if(null==u||!u.valueOf||u instanceof Date||(u=u.valueOf()),e.isObject(u)){var c=u;$(u)&&!u.isMongooseBuffer&&(c=c.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1})),u.isMongooseBuffer&&(c=n.from(c)),e.mergeClone(t[o],c)}else t[o]=b(u,{flattenDecimals:!1})}},e.each=function(t,e){var r,n=s(t);try{for(n.s();!(r=n.n()).done;)e(r.value)}catch(t){n.e(t)}finally{n.f()}},e.renameObjKey=function(t,e,r){return Object.keys(t).reduce(function(n,o){return o===e?n[r]=t[e]:n[o]=t[o],n},{})},e.getOption=function(t){var e,r=s(Array.prototype.slice.call(arguments,1));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(null!=n&&null!=n[t])return n[t]}}catch(t){r.e(t)}finally{r.f()}return null},e.noop=function(){},e.errorToPOJO=function(t){if(!(t instanceof Error))throw new Error("`error` must be `instanceof Error`.");var e,r={},n=s(Object.getOwnPropertyNames(t));try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=t[o]}}catch(t){n.e(t)}finally{n.f()}return r},e.warn=function(t){return{env:{}}.emitWarning(t,{code:"MONGOOSE"})},e.injectTimestampsOption=function(t,e){null!=e&&(t.timestamps=e)}},8863:(t,e,r)=>{"use strict";var n=r(2354),o=r(2268),i=r(3123),s=r(5477);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return s(n,i,t)}},8866:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},a.apply(null,arguments)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var l=r(6974),f=r(6426),p=Symbol("firstValue"),h=function(t){function e(t,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o=function(t,e,r){return e=u(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,r||[],u(t).constructor):e.apply(t,r))}(this,e,[t,r,"Union"]),!r||!Array.isArray(r.of)||0===r.of.length)throw new Error("Union schema type requires an array of types");return o.schemaTypes=r.of.map(function(e){return r.parentSchema.interpretAsType(t,e,i)}),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),r=e,i=[{key:"cast",value:function(t,e,r,n,o){for(var i,s=p,a=0;a<this.schemaTypes.length;++a)try{var u=this.schemaTypes[a].cast(t,e,r,n,o);if(u===t)return u;s===p&&(s=u)}catch(t){i=t}if(s!==p)return s;throw i}},{key:"applySetters",value:function(t,e,r,n,o){for(var i,s=p,a=0;a<this.schemaTypes.length;++a)try{var u=this.schemaTypes[a]._applySetters(t,e,r,n,o);if((u=null==u?this.schemaTypes[a]._castNullish(u):this.schemaTypes[a].cast(u,e,r,n,o))===t)return u;s===p&&(s=u)}catch(t){i=t}if(s!==p)return s;throw i}},{key:"clone",value:function(){var t,r,n,o=(t=e,r=this,"function"==typeof(n=a(u(1&3?t.prototype:t),"clone",r))?function(t){return n.apply(r,t)}:n)([]);return o.schemaTypes=this.schemaTypes.map(function(t){return t.clone()}),o}}],i&&o(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(f);h.schemaName="Union",h.defaultOptions={},h.prototype.OptionsConstructor=l,t.exports=h},8879:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function i(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}var a=r(4450),u=i(function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e)return this;Object.assign(this,a(e))}),c=r(5761);Object.defineProperty(u.prototype,"type",c),Object.defineProperty(u.prototype,"validate",c),Object.defineProperty(u.prototype,"cast",c),Object.defineProperty(u.prototype,"required",c),Object.defineProperty(u.prototype,"default",c),Object.defineProperty(u.prototype,"ref",c),Object.defineProperty(u.prototype,"refPath",c),Object.defineProperty(u.prototype,"select",c),Object.defineProperty(u.prototype,"index",c),Object.defineProperty(u.prototype,"unique",c),Object.defineProperty(u.prototype,"immutable",c),Object.defineProperty(u.prototype,"sparse",c),Object.defineProperty(u.prototype,"text",c),Object.defineProperty(u.prototype,"transform",c),t.exports=u},8920:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=s(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var u=r(2400),c=r(6547),l=r(8213),f=r(4473),p=r(4450),h=r(3303)._,y=r(5678),d=r(8768),b=r(3305),m=r(7930).arrayAtomicsSymbol,v=r(7930).arrayParentSymbol,g=r(7930).arrayPathSymbol,_=r(7930).arraySchemaSymbol,w=r(7930).populateModelSymbol,O=Symbol("mongoose#Array#sliced"),S=Array.prototype.push,$={$__getAtomics:function(){var t=[],e=Object.keys(this[m]||{}),r=e.length,n=Object.assign({},h,{_isNested:!0});if(0===r)return t[0]=["$set",this.toObject(n)],t;for(;r--;){var o=e[r],i=this[m][o];d.isMongooseObject(i)?i=i.toObject(n):Array.isArray(i)?i=this.toObject.call(i,n):null!=i&&Array.isArray(i.$each)?i.$each=this.toObject.call(i.$each,n):null!=i&&"function"==typeof i.valueOf&&(i=i.valueOf()),"$addToSet"===o&&(i={$each:i}),t.push([o,i])}return t},$atomics:function(){return this[m]},$parent:function(){return this[v]},$path:function(){return this[g]},$schemaType:function(){return this[_]},$shift:function(){this._registerAtomic("$pop",-1),this._markModified();var t=this.__array;if(!t._shifted)return t._shifted=!0,[].shift.call(t)},$pop:function(){if(this._registerAtomic("$pop",1),this._markModified(),!this._popped)return this._popped=!0,[].pop.call(this)},$schema:function(){return this[_]},_cast:function(t){var e,r=!1,o=this[v];if(o&&(r=o.$populated(this[g],!0)),r&&null!=t){if(null==(e=r.options[w]))throw new l("No populated model found for path `"+this[g]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");return(n.isBuffer(t)||b(t,"ObjectId")||!d.isObject(t))&&(t={_id:t}),t.schema&&t.schema.discriminatorMapping&&void 0!==t.schema.discriminatorMapping.key||(t=new e(t)),this[_].caster.applySetters(t,o,!0)}return this[_].caster.applySetters(t,o,!1)},_mapCast:function(t,e){return this._cast(t,this.length+e)},_markModified:function(t){var e,r=this[v];if(r){if(e=this[g],arguments.length&&(e=e+"."+t),null!=e&&e.endsWith(".$"))return this;r.markModified(e,0!==arguments.length?t:r)}return this},_registerAtomic:function(t,e){if(!this[O]){if("$set"===t)return this[m]={$set:e},f(this[v],this[g]),this._markModified(),this;var r,n=this[m];if("$pop"===t&&!("$pop"in n)){var o=this;this[v].once("save",function(){o._popped=o._shifted=null})}if(n.$set||Object.keys(n).length&&!(t in n))return this[m]={$set:this},this;if("$pullAll"===t||"$addToSet"===t)n[t]||(n[t]=[]),n[t]=n[t].concat(e);else if("$pullDocs"===t){var u=n.$pull||(n.$pull={});e[0]instanceof c?(r=u.$or||(u.$or=[]),Array.prototype.push.apply(r,e.map(function(t){return t.toObject({transform:function(e,r){return null==t||null==t.$__||Object.keys(t.$__.activePaths.getStatePaths("default")).forEach(function(t){y.unset(t,r),j(r,t)}),r},virtuals:!1})}))):(r=u._id||(u._id={$in:[]})).$in=r.$in.concat(e)}else if("$push"===t)if(n.$push=n.$push||{$each:[]},null!=e&&d.hasUserDefinedProperty(e,"$each"))n.$push=e;else if(1===e.length)n.$push.$each.push(e[0]);else if(e.length<1e4){var l;(l=n.$push.$each).push.apply(l,function(t){if(Array.isArray(t))return a(t)}(_=e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(_)||s(_)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else{var p,h=i(e);try{for(h.s();!(p=h.n()).done;){var b=p.value;n.$push.$each.push(b)}}catch(t){h.e(t)}finally{h.f()}}else n[t]=e;return this}var _},addToSet:function(){P(this,arguments),A(this,arguments);var t=[].map.call(arguments,this._mapCast,this),e=[],r="";t[0]instanceof c?r="doc":t[0]instanceof Date?r="date":b(t[0],"ObjectId")&&(r="ObjectId");var n=d.isMongooseArray(t)?t.__array:t,o=d.isMongooseArray(this)?this.__array:this;return n.forEach(function(t){var n,i=+t;switch(r){case"doc":n=this.some(function(e){return e.equals(t)});break;case"date":n=this.some(function(t){return+t===i});break;case"ObjectId":n=this.find(function(e){return e.toString()===t.toString()});break;default:n=~this.indexOf(t)}n||(this._markModified(),o.push(t),this._registerAtomic("$addToSet",t),[].push.call(e,t))},this),e},hasAtomics:function(){return d.isPOJO(this[m])?Object.keys(this[m]).length:0},includes:function(t,e){return-1!==this.indexOf(t,e)},indexOf:function(t,e){b(t,"ObjectId")&&(t=t.toString()),e=null==e?0:e;for(var r=this.length,n=e;n<r;++n)if(t==this[n])return n;return-1},inspect:function(){return JSON.stringify(this)},nonAtomicPush:function(){var t=[].map.call(arguments,this._mapCast,this);this._markModified();var e=[].push.apply(this,t);return this._registerAtomic("$set",this),e},pop:function(){this._markModified();var t=[].pop.call(this);return this._registerAtomic("$set",this),t},pull:function(){var t=this,e=[].map.call(arguments,function(e,r){return t._cast(e,r,{defaults:!1})},this),r=this;d.isMongooseArray(r)&&(r=r.__array);var n,o=r.length;for(this._markModified();o--;)(n=r[o])instanceof u?e.some(function(t){return n.equals(t)})&&r.splice(o,1):~this.indexOf.call(e,n)&&r.splice(o,1);return e[0]instanceof c?this._registerAtomic("$pullDocs",e.map(function(t){var e=t.$__getValue("_id");return void 0===e||t.$isDefault("_id")?t:e})):this._registerAtomic("$pullAll",e),f(this[v],this[g])>0&&this._registerAtomic("$set",this),this},push:function(){var t,e=arguments,r=e,n=null!=e[0]&&d.hasUserDefinedProperty(e[0],"$each"),o=d.isMongooseArray(this)?this.__array:this;if(n&&(r=e[0],e=e[0].$each),null==this[_])return S.apply(this,e);P(this,e),A(this,e),e=[].map.call(e,this._mapCast,this);var i=this[m];return this._markModified(),n?(r.$each=e,0!==(i.$push&&i.$push.$each&&i.$push.$each.length||0)&&i.$push.$position!=r.$position?(null!=r.$position?([].splice.apply(o,[r.$position,0].concat(e)),t=o.length):t=[].push.apply(o,e),this._registerAtomic("$set",this)):null!=r.$position?([].splice.apply(o,[r.$position,0].concat(e)),t=this.length):t=[].push.apply(o,e)):(r=e,t=S.apply(o,e)),this._registerAtomic("$push",r),t},remove:function(){return this.pull.apply(this,arguments)},set:function(t,e,r){var n=this.__array;if(r)return n[t]=e,this;var o=$._cast.call(this,e,t);return $._markModified.call(this,t),n[t]=o,this},shift:function(){var t=d.isMongooseArray(this)?this.__array:this;this._markModified();var e=[].shift.call(t);return this._registerAtomic("$set",this),e},sort:function(){var t=d.isMongooseArray(this)?this.__array:this,e=[].sort.apply(t,arguments);return this._registerAtomic("$set",this),e},splice:function(){var t,e=d.isMongooseArray(this)?this.__array:this;if(this._markModified(),P(this,Array.prototype.slice.call(arguments,2)),arguments.length){var r;if(null==this[_])r=arguments;else{r=[];for(var 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:function(){return this.toObject(h)},toObject:function(t){var e=d.isMongooseArray(this)?this.__array:this;return t&&t.depopulate?((t=p(t))._isNested=!0,[].concat(e).map(function(e){return e instanceof u?e.toObject(t):e})):[].concat(e)},$toObject:function(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift:function(){var t;P(this,arguments),t=null==this[_]?arguments:[].map.call(arguments,this._cast,this);var e=d.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(e,t),this._registerAtomic("$set",this),this.length}};function j(t,e,r){if("string"==typeof e){if(-1===e.indexOf("."))return;e=y.stringToParts(e)}(r=r||0)>=e.length||null!=t&&"object"===o(t)&&(j(t[e[0]],e,r+1),null!=t[e[0]]&&"object"===o(t[e[0]])&&0===Object.keys(t[e[0]]).length&&delete t[e[0]])}function P(t,e){var r,n,s,a=null==t?null:t[_]&&t[_].caster&&t[_].caster.options&&t[_].caster.options.ref||null;0===t.length&&0!==e.length&&function(t,e){if(!e)return!1;var r,n=i(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(null==o)return!1;var s=o.constructor;if(!(o instanceof u)||s.modelName!==e&&s.baseModelName!==e)return!1}}catch(t){n.e(t)}finally{n.f()}return!0}(e,a)&&t[v].$populated(t[g],[],(r={},n=w,s=e[0].constructor,(n=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(n))in r?Object.defineProperty(r,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[n]=s,r))}function A(t,e){var r=null==t?null:t[_]&&t[_].caster&&t[_].caster.options&&t[_].caster.options.ref||null,s=t[v],a=t[g];if(r&&s.populated(a)){var u,c=i(e);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(null!=l&&("object"!==o(l)||l instanceof String||l instanceof Number||l instanceof n||d.isMongooseType(l))){s.depopulate(a);break}}}catch(t){c.e(t)}finally{c.f()}}}for(var E=function(){var t=T[x];if(null==Array.prototype[t])return 1;$[t]=function(){var e=d.isMongooseArray(this)?this.__array:this,r=[].concat(e);return r[t].apply(r,arguments)}},x=0,T=["filter","flat","flatMap","map","slice"];x<T.length;x++)E();t.exports=$},8953:(t,e,r)=>{"use strict";var n=r(3609);t.exports=function(e,r){if(t.exports.convertToTrue.has(e))return!0;if(t.exports.convertToFalse.has(e))return!1;if(null==e)return e;throw new n("boolean",e,r)},t.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]),t.exports.convertToFalse=new Set([!1,"false",0,"0","no"])},8995:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(t,r,s){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(a=function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,[r=r||"Field `"+t+"` is not in schema and strict mode is set to throw."])).isImmutableError=!!s,a.path=t,a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8213));Object.defineProperty(a.prototype,"name",{value:"StrictModeError"}),t.exports=a},9064:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(3609),i=r(8953),s=r(1244);t.exports=function(t,e){if(null==t||"object"!==n(t))throw new o("$text",t,e);return null!=t.$search&&(t.$search=s(t.$search,e+".$search")),null!=t.$language&&(t.$language=s(t.$language,e+".$language")),null!=t.$caseSensitive&&(t.$caseSensitive=i(t.$caseSensitive,e+".$castSensitive")),null!=t.$diacriticSensitive&&(t.$diacriticSensitive=i(t.$diacriticSensitive,e+".$diacriticSensitive")),t}},9068:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?a(t):e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,f(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,t)},u(t)}function c(t,e,r){return c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&l(o,r.prototype),o},c.apply(null,arguments)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function p(t){return p="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},p(t)}var h=r(7352).inspect,y=r(3743).codes.ERR_INVALID_ARG_TYPE;function d(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var b="",m="",v="",g="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach(function(e){r[e]=t[e]}),Object.defineProperty(r,"message",{value:t.message}),r}function O(t){return h(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var S=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==p(t)||null===t)throw new y("options","Object",t);var n=t.message,o=t.operator,i=t.stackStartFn,u=t.actual,c=t.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)r=s(this,f(e).call(this,String(n)));else if({env:{}}.stderr&&{env:{}}.stderr.isTTY&&({env:{}}.stderr&&{env:{}}.stderr.getColorDepth&&1!=={env:{}}.stderr.getColorDepth()?(b="[34m",m="[32m",g="[39m",v="[31m"):(b="",m="",g="",v="")),"object"===p(u)&&null!==u&&"object"===p(c)&&null!==c&&"stack"in u&&u instanceof Error&&"stack"in c&&c instanceof Error&&(u=w(u),c=w(c)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,f(e).call(this,function(t,e,r){var n="",o="",i=0,s="",a=!1,u=O(t),c=u.split("\n"),l=O(e).split("\n"),f=0,h="";if("strictEqual"===r&&"object"===p(t)&&"object"===p(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===c.length&&1===l.length&&c[0]!==l[0]){var y=c[0].length+l[0].length;if(y<=10){if(!("object"===p(t)&&null!==t||"object"===p(e)&&null!==e||0===t&&0===e))return"".concat(_[r],"\n\n")+"".concat(c[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r&&y<({env:{}}.stderr&&{env:{}}.stderr.isTTY?{env:{}}.stderr.columns:80)){for(;c[0][f]===l[0][f];)f++;f>2&&(h="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",f),"^"),f=0)}}for(var w=c[c.length-1],S=l[l.length-1];w===S&&(f++<2?s="\n ".concat(w).concat(s):n=w,c.pop(),l.pop(),0!==c.length&&0!==l.length);)w=c[c.length-1],S=l[l.length-1];var $=Math.max(c.length,l.length);if(0===$){var j=u.split("\n");if(j.length>30)for(j[26]="".concat(b,"...").concat(g);j.length>27;)j.pop();return"".concat(_.notIdentical,"\n\n").concat(j.join("\n"),"\n")}f>3&&(s="\n".concat(b,"...").concat(g).concat(s),a=!0),""!==n&&(s="\n ".concat(n).concat(s),n="");var P=0,A=_[r]+"\n".concat(m,"+ actual").concat(g," ").concat(v,"- expected").concat(g),E=" ".concat(b,"...").concat(g," Lines skipped");for(f=0;f<$;f++){var x=f-i;if(c.length<f+1)x>1&&f>2&&(x>4?(o+="\n".concat(b,"...").concat(g),a=!0):x>3&&(o+="\n ".concat(l[f-2]),P++),o+="\n ".concat(l[f-1]),P++),i=f,n+="\n".concat(v,"-").concat(g," ").concat(l[f]),P++;else if(l.length<f+1)x>1&&f>2&&(x>4?(o+="\n".concat(b,"...").concat(g),a=!0):x>3&&(o+="\n ".concat(c[f-2]),P++),o+="\n ".concat(c[f-1]),P++),i=f,o+="\n".concat(m,"+").concat(g," ").concat(c[f]),P++;else{var T=l[f],k=c[f],N=k!==T&&(!d(k,",")||k.slice(0,-1)!==T);N&&d(T,",")&&T.slice(0,-1)===k&&(N=!1,k+=","),N?(x>1&&f>2&&(x>4?(o+="\n".concat(b,"...").concat(g),a=!0):x>3&&(o+="\n ".concat(c[f-2]),P++),o+="\n ".concat(c[f-1]),P++),i=f,o+="\n".concat(m,"+").concat(g," ").concat(k),n+="\n".concat(v,"-").concat(g," ").concat(T),P+=2):(o+=n,n="",1!==x&&0!==f||(o+="\n ".concat(k),P++))}if(P>20&&f<$-2)return"".concat(A).concat(E,"\n").concat(o,"\n").concat(b,"...").concat(g).concat(n,"\n")+"".concat(b,"...").concat(g)}return"".concat(A).concat(a?E:"","\n").concat(o).concat(n).concat(s).concat(h)}(u,c,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var h=_[o],S=O(u).split("\n");if("notStrictEqual"===o&&"object"===p(u)&&null!==u&&(h=_.notStrictEqualObject),S.length>30)for(S[26]="".concat(b,"...").concat(g);S.length>27;)S.pop();r=1===S.length?s(this,f(e).call(this,"".concat(h," ").concat(S[0]))):s(this,f(e).call(this,"".concat(h,"\n\n").concat(S.join("\n"),"\n")))}else{var $=O(u),j="",P=_[o];"notDeepEqual"===o||"notEqual"===o?($="".concat(_[o],"\n\n").concat($)).length>1024&&($="".concat($.slice(0,1021),"...")):(j="".concat(O(c)),$.length>512&&($="".concat($.slice(0,509),"...")),j.length>512&&(j="".concat(j.slice(0,509),"...")),"deepEqual"===o||"equal"===o?$="".concat(P,"\n\n").concat($,"\n\nshould equal\n\n"):j=" ".concat(o," ").concat(j)),r=s(this,f(e).call(this,"".concat($).concat(j)))}return Error.stackTraceLimit=l,r.generatedMessage=!n,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=c,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),i),r.stack,r.name="AssertionError",s(r)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,t),r=e,n=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:h.custom,value:function(t,e){return h(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){o(t,e,r[e])})}return t}({},e,{customInspect:!1,depth:0}))}}],n&&i(r.prototype,n),e}(u(Error));t.exports=S},9122:(t,e,r)=>{"use strict";var n=r(3900),o=r(988),i=r(8863),s=r(5804);t.exports=function(t){var e=i(arguments),r=t.length-(arguments.length-1);return n(e,1+(r>0?r:0),!0)},o?o(t.exports,"apply",{value:s}):t.exports.apply=s},9123:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a,u,c=r(3609),l=r(8235),f=r(3550).EventEmitter,p=r(7760),h=r(4561),y=r(6426),d=r(7982),b=r(4327),m=r(1469),v=r(1313),g=r(3216),_=r(5110),w=r(8768),O=r(7910),S=r(5537),$=r(7930).arrayAtomicsSymbol,j=r(7930).arrayPathSymbol,P=r(7930).documentArrayParent;function A(t,e,r,n){if(e.options&&e.options.timeseries)throw new S(t,"timeseries");var o=A.defaultOptions&&A.defaultOptions._id;null!=o&&((n=n||{})._id=o),null!=n&&null!=n._id?e=v(e,n):null!=r&&null!=r._id&&(e=v(e,r));var s=E(e,r);s.prototype.$basePath=t,p.call(this,t,s,r),this.schema=e,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=s,s.base=e.base;var a=this.defaultValue;"defaultValue"in this&&null==a||this.default(function(){var t=a.call(this);return null==t||Array.isArray(t)||(t=[t]),t}),this.$embeddedSchemaType=new l(t+".$",i(i({},n||{}),{},{$parentSchemaType:this})),this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}function E(t,e,n){function o(){u.apply(this,arguments),null!=this.__parentArray&&null!=this.__parentArray.getArrayParent()&&this.$session(this.__parentArray.getArrayParent().$session())}u||(u=r(6547)),t._preCompile();var i=null!=n?n.prototype:u.prototype;for(var s in o.prototype=Object.create(i),o.prototype.$__setSchema(t),o.schema=t,o.prototype.constructor=o,o.$isArraySubdocument=!0,o.events=new f,o.base=t.base,t.methods)o.prototype[s]=t.methods[s];for(var a in t.statics)o[a]=t.statics[a];for(var c in f.prototype)o[c]=f.prototype[c];return o.options=e,o}A.schemaName="DocumentArray",A.options={castNonArrays:!0},A.prototype=Object.create(p.prototype),A.prototype.constructor=A,A.prototype.OptionsConstructor=h,Object.defineProperty(A.prototype,"$conditionalHandlers",{enumerable:!1,value:i({},p.prototype.$conditionalHandlers)}),A.prototype.discriminator=function(t,e,r){var n;"function"==typeof t&&(t=w.getFunctionName(t)),r=r||{};var o=w.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;e.instanceOfSchema&&i&&(e=e.clone());var s=E(e=m(this.casterConstructor,t,e,o,null,null,null===(n=r)||void 0===n?void 0:n.overwriteExisting),null,this.casterConstructor);s.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(s,"name",{value:t})}catch(t){}return this.casterConstructor.discriminators[t]=s,this.casterConstructor.discriminators[t]},A.prototype.doValidate=function(t,e,n,o){a||(a=r(4878));var i=this;try{y.prototype.doValidate.call(this,t,function(r){if(r)return e(r);var s,c=t&&t.length;if(!c)return e();if(o&&o.updateValidator)return e();function l(t){null!=t&&(s=t),--c||e(s)}w.isMongooseDocumentArray(t)||(t=new a(t,i.path,n));for(var f=0,p=c;f<p;++f){var h=t[f];if(null!=h){if(!(h instanceof u)){var y=O(i.casterConstructor,t[f]);h=t[f]=new y(h,t,void 0,void 0,f)}null==o||!o.validateModifiedOnly||h.$isModified()?h.$__validate(null,o,l):--c||e(s)}else--c||e(s)}},n)}catch(t){return e(t)}},A.prototype.doValidateSync=function(t,e,r){var n=y.prototype.doValidateSync.call(this,t,e);if(null!=n)return n;var o=t&&t.length,i=null;if(o){for(var s=0,a=o;s<a;++s){var c=t[s];if(c){if(!(c instanceof u)){var l=O(this.casterConstructor,t[s]);c=t[s]=new l(c,t,void 0,void 0,s)}if(null==r||!r.validateModifiedOnly||c.$isModified()){var f=c.validateSync(r);f&&null==i&&(i=f)}}}return i}},A.prototype.getDefault=function(t,e,n){var o="function"==typeof this.defaultValue?this.defaultValue.call(t):this.defaultValue;if(null==o)return o;if(n&&n.skipCast)return o;a||(a=r(4878)),Array.isArray(o)||(o=[o]),o=new a(o,this.path,t);for(var i=0;i<o.length;++i){var s=new(O(this.casterConstructor,o[i]))({},o,void 0,void 0,i);s.$init(o[i]),s.isNew=!0,Object.assign(s.$__.activePaths.default,s.$__.activePaths.init),s.$__.activePaths.init={},o[i]=s}return o};var x=Object.freeze({transform:!1,virtuals:!1}),T=Object.freeze({skipId:!1,willInit:!0});function k(t,e,r){if(r&&e){for(var n,o,i,s=t.path+".",a=Object.keys(e),u=a.length,c={};u--;)if((o=a[u]).startsWith(s)){if("$"===(i=o.substring(s.length)))continue;i.startsWith("$.")&&(i=i.substring(2)),n||(n=!0),c[i]=e[o]}return n&&c||void 0}}A.prototype.cast=function(t,e,n,o,i){if(a||(a=r(4878)),null!=t&&null!=t[j]&&t===o)return t;var s,l,f=(i=i||{}).path||this.path;if(!Array.isArray(t)){if(!n&&!A.options.castNonArrays)throw new c("DocumentArray",t,this.path,null,this);return e&&n&&e.markModified(f),this.cast([t],e,n,o,i)}i.skipDocumentArrayCast&&!w.isMongooseDocumentArray(t)||(t=new a(t,f,e,this)),null!=o&&(t[$]=o[$]||{}),null!=i.arrayPathIndex&&(t[j]=f+"."+i.arrayPathIndex);for(var p=w.isMongooseDocumentArray(t)?t.__array:t,h=p.length,y=0;y<h;++y)if(p[y]){var d=O(this.casterConstructor,p[y]),b=g(p[y],!0);if(p[y]!==b&&(p[y]=b),p[y]instanceof u){if(p[y][P]!==e)if(n){var m=new d(null,t,T,s,y);p[y]=m.$init(p[y])}else{var v=new d(p[y],t,void 0,void 0,y);p[y]=v}null==p[y].__index&&p[y].$setIndex(y)}else if(null!=p[y])if(n)e?s||(s=k(this,e.$__.selected,n)):s=!0,l=new d(null,t,T,s,y),p[y]=l.$init(p[y],i);else if(o&&"function"==typeof o.id&&(l=o.id(p[y]._id)),o&&l&&w.deepEqual(l.toObject(x),p[y]))l.set(p[y]),p[y]=l;else try{l=new d(p[y],t,void 0,void 0,y),p[y]=l}catch(e){throw new c("embedded",p[y],t[j],e,this)}}return t},A.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.constructor(this.path,this.schema,t,this.schemaOptions);return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),e.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),e._appliedDiscriminators=this._appliedDiscriminators,e},A.prototype.applyGetters=function(t,e){return y.prototype.applyGetters.call(this,t,e)},A.defaultOptions={},A.set=y.set,A.setters=[],A.get=y.get,A.prototype.$conditionalHandlers.$elemMatch=function(t,e){for(var r,n=Object.keys(t),o=n.length,i=0;i<o;++i){var s=n[i],a=t[s];_(s)&&null!=a&&(t[s]=this.castForQuery(s,a,e))}var u=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.options&&this.casterConstructor.schema.options.discriminatorKey,c=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.discriminators||{};if(null!=u&&null!=t[u]&&null!=c[t[u]])return d(c[t[u]],t,null,this&&this.$$context);var l=null!==(r=this.casterConstructor.schema)&&void 0!==r?r:e.schema;return d(l,t,null,this&&this.$$context)},A.prototype.toJSONSchema=function(t){var e=b("object","object",null==t?void 0:t.useBsonType,!1),r=this.options.required&&"function"!=typeof this.options.required;return i(i({},b("array","array",null==t?void 0:t.useBsonType,r)),{},{items:i(i({},e),this.schema.toJSONSchema(t))})},t.exports=A},9166:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(8759),s=r(3696);function a(t,e,r){if(null!=e){var o=Object.keys(e).some(function(t){return"$"===t[0]});if(o){if(e.$push&&v(e.$push),e.$addToSet&&v(e.$addToSet),null!=e.$set)for(var i=0,c=Object.keys(e.$set);i<c.length;i++){var l=c[i];u(r,l,e.$set,t)}if(null!=e.$setOnInsert)for(var f=0,p=Object.keys(e.$setOnInsert);f<p.length;f++){var h=p[f];u(r,h,e.$setOnInsert,t)}}var y,d=Object.keys(e).filter(function(t){return"$"!==t[0]}),b=n(d);try{for(b.s();!(y=b.n()).done;){var m=y.value;u(r,m,e,t)}}catch(t){b.e(t)}finally{b.f()}}function v(e){for(var n=function(){var n=i[o],u=r.path(n.replace(/\.\$\./i,".").replace(/.\$$/,""));if(e[n]&&u&&u.$isMongooseDocumentArray&&u.schema.options.timestamps){var c=u.schema.options.timestamps,l=s(c,"createdAt"),f=s(c,"updatedAt");e[n].$each?e[n].$each.forEach(function(e){null!=f&&(e[f]=t),null!=l&&(e[l]=t),a(t,e,u.schema)}):(null!=f&&(e[n][f]=t),null!=l&&(e[n][l]=t),a(t,e[n],u.schema))}},o=0,i=Object.keys(e);o<i.length;o++)n()}}function u(t,e,r,o){var u=i(e),c=t.path(u);if(c){for(var l=[],f=u.split("."),p=f.length-1;p>0;--p){var h=t.path(f.slice(0,p).join("."));null!=h&&(h.$isMongooseDocumentArray||h.$isSingleNested)&&l.push({parentPath:e.split(".").slice(0,p).join("."),parentSchemaType:h})}if(Array.isArray(r[e])&&c.$isMongooseDocumentArray)!function(t,e,r){var n=e.schema.options.timestamps,o=t.length;if(n)for(var i=s(n,"createdAt"),u=s(n,"updatedAt"),c=0;c<o;++c)null!=u&&(t[c][u]=r),null!=i&&(t[c][i]=r),a(r,t[c],e.schema);else for(var l=0;l<o;++l)a(r,t[l],e.schema)}(r[e],c,o);else if(r[e]&&c.$isSingleNested)!function(t,e,r){var n=e.schema.options.timestamps;if(n){var o=s(n,"createdAt"),i=s(n,"updatedAt");null!=i&&(t[i]=r),null!=o&&(t[o]=r),a(r,t,e.schema)}else a(r,t,e.schema)}(r[e],c,o);else if(l.length>0){var y,d=n(l);try{for(d.s();!(y=d.n()).done;){var b=y.value,m=b.parentPath,v=b.parentSchemaType,g=v.schema.options.timestamps,_=s(g,"updatedAt");if(g&&null!=_)if(v.$isSingleNested)r[m+"."+_]=o;else if(v.$isMongooseDocumentArray){var w=e.substring(m.length+1);if(/^\d+$/.test(w)){r[m+"."+w][_]=o;continue}var O=w.indexOf(".");r[m+"."+(w=-1!==O?w.substring(0,O):w)+"."+_]=o}}}catch(t){d.e(t)}finally{d.f()}}else if(null!=c.schema&&c.schema!=t&&r[e]){var S=c.schema.options.timestamps,$=s(S,"createdAt"),j=s(S,"updatedAt");if(!S)return;null!=j&&(r[e][j]=o),null!=$&&(r[e][$]=o)}}}t.exports=a},9183:t=>{"use strict";t.exports=function(t){return"function"==typeof t&&t.constructor&&"AsyncFunction"===t.constructor.name}},9206:t=>{"use strict";t.exports=EvalError},9247:(t,e,r)=>{"use strict";var n=r(2481),o=r(2273);t.exports=function(){var t=n();return o(Object,{is:t},{is:function(){return Object.is!==t}}),t}},9344:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o,i=r(3071),s=r(953)(),a=r(5994),u=r(1464);if(s){var c=i("RegExp.prototype.exec"),l={},f=function(){throw l},p={toString:f,valueOf:f};"symbol"===n(Symbol.toPrimitive)&&(p[Symbol.toPrimitive]=f),o=function(t){if(!t||"object"!==n(t))return!1;var e=u(t,"lastIndex");if(!e||!a(e,"value"))return!1;try{c(t,p)}catch(t){return t===l}}}else{var h=i("Object.prototype.toString");o=function(t){return!(!t||"object"!==n(t)&&"function"!=typeof t)&&"[object RegExp]"===h(t)}}t.exports=o},9380:(t,e,r)=>{"use strict";function n(){var t,e,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function a(r,n,i,s){var a=n&&n.prototype instanceof c?n:c,l=Object.create(a.prototype);return o(l,"_invoke",function(r,n,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(r,n){for(s=r,a=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,s=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,y),s=l,a=y;(e=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:e,done:f}}}(r,i,s),!0),l}var u={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=[][i]?e(e([][i]())):(o(e={},i,function(){return this}),e),h=f.prototype=c.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,o(t,s,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=f,o(h,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,s,"GeneratorFunction"),o(h),o(h,s,"Generator"),o(h,i,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(n=function(){return{w:a,m:y}})()}function o(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}o=function(t,e,r,n){function s(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(s("next",0),s("throw",1),s("return",2))},o(t,e,r,n)}function i(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var a=r(2400),u=r(2746),c=r(3303)._,l=r(7352),f=r(8768);function p(t,e,r,n,o){if("object"===s(n)&&null!=n&&null==o&&(o=n,n=void 0),null!=r){var i={isNew:r.isNew};"defaults"in r.$__&&(i.defaults=r.$__.defaults),o=Object.assign(i,o)}null!=o&&null!=o.path&&(this.$basePath=o.path),null!=o&&null!=o.pathRelativeToParent&&(this.$pathRelativeToParent=o.pathRelativeToParent);var u=o;null!=o&&null!=o.path&&delete(u=Object.assign({},o)).path,a.call(this,t,e,n,u),delete this.$__.priorDoc}t.exports=p,p.prototype=Object.create(a.prototype),Object.defineProperty(p.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0}),Object.defineProperty(p.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0}),p.prototype.toBSON=function(){return this.toObject(c)},p.prototype.save=function(){var t,e=(t=n().m(function t(e){var r=this;return n().w(function(t){for(;;)if(0===t.n)return(e=e||{}).suppressWarning||f.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."),t.a(2,new Promise(function(t,e){r.$__save(function(n){if(null!=n)return e(n);t(r)})}))},t)}),function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function a(t){i(s,n,o,a,u,"next",t)}function u(t){i(s,n,o,a,u,"throw",t)}a(void 0)})});return function(t){return e.apply(this,arguments)}}(),p.prototype.$__fullPath=function(t){return this.$__.fullPath||this.ownerDocument(),t?this.$__.fullPath+"."+t:this.$__.fullPath},p.prototype.$__pathRelativeToParent=function(t){return null!=this.$pathRelativeToParent?null==t?this.$pathRelativeToParent:this.$pathRelativeToParent+"."+t:null==t?this.$basePath:this.$basePath?[this.$basePath,t].join("."):t},p.prototype.$__save=function(t){var e=this;return u(function(){return t(null,e)})},p.prototype.$isValid=function(t){var e=this.$parent(),r=this.$__pathRelativeToParent(t);return null!=e&&null!=r?e.$isValid(r):a.prototype.$isValid.call(this,t)},p.prototype.markModified=function(t){a.prototype.markModified.call(this,t);var e=this.$parent();if(null!=e){var r=this.$__pathRelativeToParent(t);if(null!=r){var n=this.$__pathRelativeToParent().replace(/\.$/,"");e.isDirectModified(n)||this.isNew||this.$__parent.markModified(r,this)}}},p.prototype.isModified=function(t,e,r){var n=this,o=this.$parent();return null!=o?(Array.isArray(t)||"string"==typeof t?t=(t=Array.isArray(t)?t:t.split(" ")).map(function(t){return n.$__pathRelativeToParent(t)}).filter(function(t){return null!=t}):t||(t=this.$__pathRelativeToParent()),o.$isModified(t,e,r)):a.prototype.isModified.call(this,t,e,r)},p.prototype.$markValid=function(t){a.prototype.$markValid.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$markValid(r)},p.prototype.invalidate=function(t,e,r){a.prototype.invalidate.call(this,t,e,r);var n=this.$parent(),o=this.$__pathRelativeToParent(t);if(null!=n&&null!=o)n.invalidate(o,e,r);else if("cast"===e.kind||"CastError"===e.name||null==o)throw e;return this.ownerDocument().$__.validationError},p.prototype.$ignore=function(t){a.prototype.$ignore.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$ignore(r)},p.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;for(var t=this,e=[],r=new Set([t]);"function"==typeof t.$__pathRelativeToParent;){e.unshift(t.$__pathRelativeToParent(void 0,!0));var n=t.$parent();if(null==n)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},p.prototype.$__fullPathWithIndexes=function(){for(var t=this,e=[],r=new Set([t]);"function"==typeof t.$__pathRelativeToParent;){e.unshift(t.$__pathRelativeToParent(void 0,!1));var n=t.$parent();if(null==n)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(".")},p.prototype.parent=function(){return this.$__parent},p.prototype.$parent=p.prototype.parent,p.prototype.$__deleteOne=function(t){if(null!=t)return t(null,this)},p.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)},p.prototype.deleteOne=function(t,e){if("function"==typeof t&&(e=t,t=null),function(t){var 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)}(this),!t||!t.noop){this.$__removeFromParent();var r=this.ownerDocument();r.$__.removedSubdocs=r.$__.removedSubdocs||[],r.$__.removedSubdocs.push(this)}return this.$__deleteOne(e)},p.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")`')},p.prototype.inspect=function(){return this.toObject()},l.inspect.custom&&(p.prototype[l.inspect.custom]=p.prototype.inspect),p.prototype.$toObject=function(t,e){var r,n,o,i,s=a.prototype.$toObject.call(this,t,e);if(0!==Object.keys(s).length||null==(null==t?void 0:t._calledWithOptions)||!(null!==(r=null!==(n=null===(o=t._calledWithOptions)||void 0===o?void 0:o.minimize)&&void 0!==n?n:null==this||null===(i=this.$__schemaTypeOptions)||void 0===i?void 0:i.minimize)&&void 0!==r?r:t.minimize)||this.constructor.$__required)return s}},9460:(t,e,r)=>{"use strict";var n=r(5832).hp,o=r(3609);function i(t,e){var r=Number(e);if(isNaN(r))throw new o("number",e,t);return r}t.exports=function(t){var e=this;return Array.isArray(t)?t.map(function(t){return i(e.path,t)}):n.isBuffer(t)?t:i(e.path,t)}},9471:t=>{"use strict";t.exports=Math.abs},9528:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=i(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],i(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"enum",u),Object.defineProperty(a.prototype,"match",u),Object.defineProperty(a.prototype,"lowercase",u),Object.defineProperty(a.prototype,"trim",u),Object.defineProperty(a.prototype,"uppercase",u),Object.defineProperty(a.prototype,"minLength",u),Object.defineProperty(a.prototype,"minlength",u),Object.defineProperty(a.prototype,"maxLength",u),Object.defineProperty(a.prototype,"maxlength",u),Object.defineProperty(a.prototype,"populate",u),t.exports=a},9538:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}var c=r(8213),l=function(t){function e(t,r){var o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=t.message;i||(i=c.messages.general.default);var u=f(i,t,r);return o=function(t,e,r){return e=a(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}(this,e,[u]),t=Object.assign({},t,{message:u}),o.properties=t,o.kind=t.type,o.path=t.path,o.value=t.value,o.reason=t.reason,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(e,t),r=e,(i=[{key:"toString",value:function(){return this.message}},{key:"toJSON",value:function(){return Object.assign({name:this.name,message:this.message},this)}}])&&o(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(c);function f(t,e,r){if("function"==typeof t)return t(e,r);for(var n=0,o=Object.keys(e);n<o.length;n++){var i=o[n];"message"!==i&&(t=t.replace("{"+i.toUpperCase()+"}",e[i]))}return t}Object.defineProperty(l.prototype,"name",{value:"ValidatorError"}),Object.defineProperty(l.prototype,"properties",{enumerable:!1,writable:!0,value:null}),l.prototype.formatMessage=f,t.exports=l},9539:t=>{"use strict";function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,s,a=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t,r,n){for(var o={},i=0,s=Object.keys(r.tree);i<s.length;i++){var a=s[i];n&&(t.paths[a]||t.nested[a]||t.singleNestedPaths[a])||(o[a]=r.tree[a])}t.options._isMerging=!0,t.add(o,null),delete t.options._isMerging,t.callQueue=t.callQueue.concat(r.callQueue),t.method(r.methods),t.static(r.statics);for(var u=0,c=Object.entries(r._userProvidedOptions);u<c.length;u++){var l=e(c[u],2),f=l[0],p=l[1];f in t._userProvidedOptions||t.set(f,p)}for(var h in r.query)t.query[h]=r.query[h];for(var y in r.virtuals)t.virtuals[y]=r.virtuals[y].clone();t._indexes=t._indexes.concat(r._indexes||[]),t.s.hooks.merge(r.s.hooks,!1)}},9553:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var i=r(9639),s=r(2402);t.exports=function(t){return null==t?t:"object"===o(t)&&"string"==typeof t.$numberDecimal?i.fromString(t.$numberDecimal):t instanceof i?t:"string"==typeof t?i.fromString(t):"function"==typeof n&&n.isBuffer(t)||"function"==typeof Uint8Array&&t instanceof Uint8Array?new i(t):"number"==typeof t?i.fromString(String(t)):"function"==typeof t.valueOf&&"string"==typeof t.valueOf()?i.fromString(t.valueOf()):void s.ok(!1)}},9600:(t,e,r)=>{"use strict";e.Array=r(7557),e.Buffer=r(6365),e.Document=e.Embedded=r(6547),e.DocumentArray=r(4878),e.Double=r(2822),e.Decimal128=r(9639),e.ObjectId=r(5549),e.Map=r(2081),e.Subdocument=r(9380),e.UUID=r(1344)},9604:(t,e,r)=>{"use strict";var n=r(5558).p,o=r(5558).G;function i(t,e){switch(t.$geometry.type){case"Polygon":case"LineString":case"Point":n(t.$geometry.coordinates,e)}return s(e,t),t}function s(t,e){e.$maxDistance&&(e.$maxDistance=o.call(t,e.$maxDistance)),e.$minDistance&&(e.$minDistance=o.call(t,e.$minDistance))}e.cast$geoIntersects=function(t){if(t.$geometry)return i(t,this),t},e.cast$near=function(t){var e=r(7760);if(Array.isArray(t))return n(t,this),t;if(s(this,t),t&&t.$geometry)return i(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)},e.cast$within=function(t){var e=this;if(s(this,t),t.$box||t.$polygon){var r=t.$box?"$box":"$polygon";t[r].forEach(function(t){if(!Array.isArray(t))throw new TypeError("Invalid $within $box argument. Expected an array, received "+t);t.forEach(function(r,n){t[n]=o.call(e,r)})})}else if(t.$center||t.$centerSphere){var n=t.$center?"$center":"$centerSphere";t[n].forEach(function(r,i){Array.isArray(r)?r.forEach(function(t,n){r[n]=o.call(e,t)}):t[n][i]=o.call(e,r)})}else t.$geometry&&i(t,this);return t}},9639:(t,e,r)=>{"use strict";t.exports=r(6353).Decimal128},9696:t=>{"use strict";var e=/^function\s*([^\s(]+)/;t.exports=function(t){return t.name||(t.toString().trim().match(e)||[])[1]}},9809:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r,n,o=Function.prototype.toString,i="object"===("undefined"==typeof Reflect?"undefined":e(Reflect))&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i(function(){throw 42},null,r)}catch(t){t!==n&&(i=null)}else i=null;var s=/^\s*class\b/,a=function(t){try{var e=o.call(t);return s.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(o.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),p=function(){return!1};if("object"===("undefined"==typeof document?"undefined":e(document))){var h=document.all;c.call(h)===c.call(document.all)&&(p=function(t){if((f||!t)&&(void 0===t||"object"===e(t)))try{var r=c.call(t);return("[object HTMLAllCollection]"===r||"[object HTML document.all class]"===r||"[object HTMLCollection]"===r||"[object Object]"===r)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!==e(t))return!1;try{i(t,null,r)}catch(t){if(t!==n)return!1}return!a(t)&&u(t)}:function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!==e(t))return!1;if(l)return u(t);if(a(t))return!1;var r=c.call(t);return!("[object Function]"!==r&&"[object GeneratorFunction]"!==r&&!/^\[object HTML/.test(r))&&u(t)}},9834:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=r(3777),i=r(3426),s=r(9122),a=r(3071),u=r(1464),c=r(209),l=a("Object.prototype.toString"),f=r(953)(),p="undefined"==typeof globalThis?r.g:globalThis,h=i(),y=a("String.prototype.slice"),d=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},b={__proto__:null};o(h,f&&u&&c?function(t){var e=new p[t];if(Symbol.toStringTag in e&&c){var r=c(e),n=u(r,Symbol.toStringTag);if(!n&&r){var o=c(r);n=u(o,Symbol.toStringTag)}b["$"+t]=s(n.get)}}:function(t){var e=new p[t],r=e.slice||e.set;r&&(b["$"+t]=s(r))}),t.exports=function(t){if(!t||"object"!==n(t))return!1;if(!f){var e=y(l(t),8,-1);return d(h,e)>-1?e:"Object"===e&&function(t){var e=!1;return o(b,function(r,n){if(!e)try{r(t),e=y(n,1)}catch(t){}}),e}(t)}return u?function(t){var e=!1;return o(b,function(r,n){if(!e)try{"$"+r(t)===n&&(e=y(n,1))}catch(t){}}),e}(t):null}},9848:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){t.pre("save",!1,function(t,r){var n=this,o=this;if(this.$isSubdocument)return t();if(r&&"object"===e(r)&&"validateBeforeSave"in r?r.validateBeforeSave:this.$__schema.options.validateBeforeSave){var i=r&&"object"===e(r)&&"validateModifiedOnly"in r?{validateModifiedOnly:r.validateModifiedOnly}:null;this.$validate(i).then(function(){n.$op="save",t()},function(e){o.$__schema.s.hooks.execPost("save:error",o,[o],{error:e},function(e){o.$op="save",t(e)})})}else t()},null,!0)}},9870:t=>{"use strict";t.exports=Error},9907:t=>{"use strict";t.exports=SyntaxError},9939:t=>{"use strict";t.exports=RangeError}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(4829)})()); |