mongoose
Version:
Mongoose MongoDB ODM
2 lines • 581 kB
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}`) is shorter than the minimum allowed length ({MINLENGTH}).",r.String.maxlength="Path `{PATH}` (`{VALUE}`) 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){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{var i=function(e,r){a(t,e,function(t){return this._invoke(e,r,t)})};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};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.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,M=N;B<M.length;B++){var D=M[B];if(!g[D]&&D in I&&!m.deepEqual(e.options[D],r.options[D]))throw new Error("Can't customize discriminator option "+D+" (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,o=r(3071),i=r(2724)(/^\s*(?:function)?\*/),s=r(953)(),a=r(209),u=o("Object.prototype.toString"),c=o("Function.prototype.toString");t.exports=function(t){if("function"!=typeof t)return!1;if(i(c(t)))return!0;if(!s)return"[object GeneratorFunction]"===u(t);if(!a)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&a(e)}return a(t)===n}},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"==typ