/*! 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);n2)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{"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;e2147483647))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);r0||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);r1){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{"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{"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&&e3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&hn||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{"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{"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{"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{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=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{"use strict";t.exports=function(t){for(var e,r=Object.keys(t.errors||{}),n=r.length,o=[],i=0;i{"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{"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);a0&&(!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{"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;nr.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{"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=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{"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{"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{"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=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&&e3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&hn||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=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);r0&&(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;s1&&(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;Nt0){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;i0?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;s1&&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);a1&&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;r1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;o{"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<>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<>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<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{"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{"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{"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{"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{"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{"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{"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;r0&&(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=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=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;r0){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=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=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;n0,"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{"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);r1)&&(!(s[y]===e.options.discriminatorKey&&s.length>1&&null!=b)||b)){i=!b;break}}for(var m=0,v=u;m1&&!~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{"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{"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||to||t{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=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{"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&&e3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&hn||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{"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{"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{"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{"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{"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{"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{"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{"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{"use strict";t.exports=function(t,e,r){for(var n=e[0],o=r,i=t,s=0;s{"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=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=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;ia&&(r=a-u),i=r;i>=0;i--){for(var f=!0,p=0;po&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;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;o239?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;nn.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;er&&(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>>=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;on)&&(r=n);for(var o="",i=e;ir)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||et.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>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i>>=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=(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>>=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>>=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=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>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&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=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{"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{"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{"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{"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;e57)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{"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{"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;n127)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;nn.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-r127)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;rUint8Array.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;tArray.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;e127)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<(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.byteLengththis.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>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>>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<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>>=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||360)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>>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<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<>>32-t,this.unsigned):$t.fromBits(0,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>>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=5&&(s=1,5===i)){s=f[y]%2==1?1:0;for(let r=l+y+2;r=0&&++f[t]>9;t--)if(f[t]=0,0===t){if(!(d>>0,n=e.high>>>0;return r>>0>>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>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;t0?c.push(`+${m}`):c.push(`${m}`)}else if(b>=0)for(let t=0;t0)for(let e=0;er)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=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;tt);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= 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.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=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)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=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)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=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;nt.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{"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{"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){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{"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);i1&&(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;e0&&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;i30&&(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;y30&&(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=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;b0)for(var m=0;m{"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{"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{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"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>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;au?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{"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{"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;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=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{"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{"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{"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{"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=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);r0){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];n1)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;a0?".":"")+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);_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;n0?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);n1){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=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);i1)for(var l=0;l{"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{"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{"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=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=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;s60?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{"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{"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{"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{"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;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=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{"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{"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=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=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;_=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=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;i0?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{"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{"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&&n3?(o=y===r)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=e<2&&hr||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;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=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=0;f--)if(a[f]!==u[f])return!1;for(var p=0,h=a;p0)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=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{"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;r2&&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{"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{"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);r0&&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=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{"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;rt.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="",m="",g="",v=""):(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.length1&&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.length1&&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{"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{"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);r0;--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;c0){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&&e3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&hn||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{"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{"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-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)})());