PageSourceSearch

https://www.bike-magazin.de/_next/static/chunks/9051c82e.679353d9bc0e1298.js

js bike-magazin.de collected 2026-10-02 05:57:10 UTC 567,588 bytes, 3 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25112],{70796:function(t){"u">typeof self&&self,t.exports=(()=>{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})(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){if(!m(t))return t;try{return s(t)}catch(e){throw new o("Number",t)}}function b(t){return"string"==typeof t&&"$"===t[0]}function m(t){return!("string"==typeof t&&"$"===t[0]||"object"===n(t)&&null!==t&&Object.keys(t).find(function(t){return"$"===t[0]})&&null==t.$literal)}t.exports=function(t,e,r){if("boolean"==typeof t)return t;if("object"!==n(t)||null===t)throw Error("`$expr` must be an object or boolean literal");return function t(e,r,v){if(b(e)||null===e)return e;null!=e.$cond?Array.isArray(e.$cond)?e.$cond=e.$cond.map(function(e){return t(e,r,v)}):(e.$cond.if=t(e.$cond.if,r,v),e.$cond.then=t(e.$cond.then,r,v),e.$cond.else=t(e.$cond.else,r,v)):null!=e.$ifNull?e.$ifNull.map(function(e){return t(e,r,v)}):null!=e.$switch&&(Array.isArray(e.$switch.branches)&&(e.$switch.branches=e.$switch.branches.map(function(e){return t(e,r,v)})),"default"in e.$switch&&(e.$switch.default=t(e.$switch.default,r,v)));for(var g=0,_=Object.keys(e);g<_.length;g++){var O=_[g];u.has(O)?e[O]=e[O].map(function(e){return t(e,r,v)}):c.has(O)?e[O]=function(e,r,a){if(!Array.isArray(e)||2!==e.length)throw Error("Comparison operator must be an array of length 2");e[0]=t(e[0],r,a);var u=e[0];if(m(e[1])){var c=null,l=null,f=null;if(b(u))c=u.slice(1),l=r.path(c);else if("object"===n(u)&&null!=u)for(var y=0,d=Object.keys(u);y<d.length;y++){var v=d[y];h.has(v)&&b(u[v])?(c=u[v].slice(1)+"."+v,f=s):p.has(v)&&b(u[v])&&(c=u[v].slice(1)+"."+v,null!=(l=r.path(u[v].slice(1)))&&(l.$isMongooseDocumentArray?l=l.$embeddedSchemaType:l.$isMongooseArray&&(l=l.caster)))}var g="object"===n(e[1])&&null!=e[1]&&null!=e[1].$literal;if(null!=l)e[1]=g?{$literal:l.cast(e[1].$literal)}:l.cast(e[1]);else if(null!=f)if(g)try{e[1]={$literal:f(e[1].$literal)}}catch(t){throw new o(f.name.replace(/^cast/,""),e[1],c+".$literal")}else try{e[1]=f(e[1])}catch(t){throw new o(f.name.replace(/^cast/,""),e[1],c)}else{if(null!=c&&!0===a)return;if(null!=c&&"throw"===a)throw new i(c)}}else e[1]=t(e[1]);return e}(e[O],r,v):l.has(O)?e[O]=function(t){if(!Array.isArray(t)){if(!m(t))return t;try{return s(t)}catch(e){throw new o("Number",t)}}return t.map(function(t){if(!m(t))return t;try{return s(t)}catch(e){throw new o("Number",t)}})}(e[O]):f.has(O)?e[O]=d(e[O]):y.has(O)&&(e[O]=t(e[O],r,v))}if(e.$in&&(e.$in=function(t,e,r){var n=t[1];if(!b(n))return t;var o=t[0],s=e.path(n.slice(1));if(null!==s){if(!s.$isMongooseArray)throw Error("Path must be an array for $in");return[s.$isMongooseDocumentArray?s.$embeddedSchemaType.cast(o):s.caster.cast(o),n]}if(!1===r)return t;if("throw"===r)throw new i("$in")}(e.$in,r,v)),e.$size&&(e.$size=d(e.$size)),e.$round){var w=e.$round;if(!Array.isArray(w)||w.length<1||w.length>2)throw new o("Array",w,"$round");e.$round=w.map(function(t){return d(t)})}return a(e),e}(t,e,r)}},209:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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 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})(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}
1function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(t)}function r(t,e,r,n){return Math.round(t/r)+" "+n+(e>=1.5*r?"s":"")}t.exports=function(t,n){n=n||{};var o,i,s=e(t);if("string"===s&&t.length>0){var a=t;if(!((a=String(a)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(u){var c=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c}}}return}if("number"===s&&isFinite(t))return n.long?(i=Math.abs(t))>=864e5?r(t,i,864e5,"day"):i>=36e5?r(t,i,36e5,"hour"):i>=6e4?r(t,i,6e4,"minute"):i>=1e3?r(t,i,1e3,"second"):t+" ms":(o=Math.abs(t))>=864e5?Math.round(t/864e5)+"d":o>=36e5?Math.round(t/36e5)+"h":o>=6e4?Math.round(t/6e4)+"m":o>=1e3?Math.round(t/1e3)+"s":t+"ms";throw 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})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var s=r(3609),a=r(6426),u=r(5413),c=r(4327),l=r(9460);function f(t,e){a.call(this,t,e,"Int32")}function p(t,e){return this.castForQuery(null,t,e)}f.schemaName="Int32",f.defaultOptions={},f.prototype=Object.create(a.prototype),f.prototype.constructor=f,f._cast=u,f.set=a.set,f.setters=[],f.get=a.get,f._defaultCaster=function(t){if(null!=t&&("number"!=typeof t||t!==(0|t)||t<-0x80000000||t>0x7fffffff))throw Error();return t},f.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},f._checkRequired=function(t){return null!=t},f.checkRequired=a.checkRequired,f.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},f.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():f.cast();try{return e(t)}catch(e){throw new s("Int32",t,this.path,e,this)}},f.$conditionalHandlers=i(i({},a.prototype.$conditionalHandlers),{},{$gt:p,$gte:p,$lt:p,$lte:p,$bitsAllClear:l,$bitsAnyClear:l,$bitsAllSet:l,$bitsAnySet:l}),f.prototype.castForQuery=function(t,e,r){var n;if(null!=t)return(n=f.$conditionalHandlers[t])?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(t){throw t instanceof s&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},f.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return c("number","int",null==t?void 0:t.useBsonType,e)},f.prototype.autoEncryptionType=function(){return"int"}
1,t.exports=f},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})(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="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return o(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,void 0):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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(4009),s=r(8768),a=r(7930).modelSymbol;function u(t,e){this.path=e,this.getters=[],this.setters=[],this.options=Object.assign({},t)}u.prototype._applyDefaultGetters=function(){if(!(this.getters.length>0||this.setters.length>0)){var t="$"+this.path;this.getters.push(function(){return this.$locals[t]}),this.setters.push(function(e){this.$locals[t]=e})}},u.prototype.clone=function(){var t=new u(this.options,this.path);return t.getters=[].concat(this.getters),t.setters=[].concat(this.setters),t},u.prototype.get=function(t){return this.getters.push(t),this},u.prototype.set=function(t){return this.setters.push(t),this},u.prototype.applyGetters=function(t,e){s.hasUserDefinedProperty(this.options,["ref","refPath"])&&e.$$populatedVirtuals&&e.$$populatedVirtuals.hasOwnProperty(this.path)&&(t=e.$$populatedVirtuals[this.path]);var r,o=t,i=n(this.getters);try{for(i.s();!(r=i.n()).done;)o=r.value.call(e,o,this,e)}catch(t){i.e(t)}finally{i.f()}return o},u.prototype.applySetters=function(t,e){var r,o=t,i=n(this.setters);try{for(i.s();!(r=i.n()).done;)o=r.value.call(e,o,this,e)}catch(t){i.e(t)}finally{i.f()}return o},u.prototype._getModelNamesForPopulate=function(t){var e;return this.options.refPath?i(this.options.refPath,t,this.path):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(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return o(t)?a(n.call(t)):a(t)}):Object.keys=s,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}
1` is invalid ({VALUE}).",r.String.minlength="Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).",r.String.maxlength="Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH})."},783:t=>{"use strict";t.exports=ReferenceError},791:(t,e,r)=>{"use strict";function n(t,e){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return o(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,void 0):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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(3703);t.exports=function(t,e,r){var o,s=null!=r?Object.keys(i(t.tree,r,{})):Object.keys(t.tree),a=new Set(Object.keys(e));if(a.size>1){o=new Set;var u,c=n(s);try{for(c.s();!(u=c.n()).done;){var l=u.value;a.has(l)&&o.add(l)}}catch(t){c.e(t)}finally{c.f()}var f,p=n(a);try{for(p.s();!(f=p.n()).done;){var h=f.value;o.has(h)||o.add(h)}}catch(t){p.e(t)}finally{p.f()}o=Array.from(o)}else o=Array.from(a);return o}},863:(t,e,r)=>{"use strict";var n=r(3305),o=r(5549);t.exports=function(t){if(null==t||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 new o(t.toString instanceof Function?t.toString():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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8879)),u=r(5761);Object.defineProperty(a.prototype,"min",u),Object.defineProperty(a.prototype,"max",u),Object.defineProperty(a.prototype,"enum",u),Object.defineProperty(a.prototype,"populate",u),t.exports=a},1058:(t,e,r)=>{"use strict";var n=r(2696);t.exports=function(t,e){if(null==t)return null;for(var r=0,o=Object.keys(t);r<o.length;r++){var i=t[o[r]];if(i.schema&&i.schema.discriminatorMapping&&n(i.schema.discriminatorMapping.value,e))return i}return null}},1091:t=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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})(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}
1function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=r(8213),u=r(7352),c=function(t){function e(t,r,s,c){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");var l,f,p,h=a.messages;return(l=e,f=[null!=h.DocumentNotFoundError?"function"==typeof h.DocumentNotFoundError?h.DocumentNotFoundError(t,r):h.DocumentNotFoundError:'No document found for query "'+u.inspect(t)+'" on model "'+r+'"'],l=i(l),p=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(l,f||[],i(this).constructor):l.apply(this,f))).result=c,p.numAffected=s,p.filter=t,p.query=t,p}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(a);Object.defineProperty(c.prototype,"name",{value:"DocumentNotFoundError"}),t.exports=c},1199:t=>{"use strict";t.exports=function(t,e){var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o];if(i!==n[o]||t[i]!==e[i])return!1}return!0}},1226:t=>{"use strict";t.exports=function(t){return null==t?null:Object.keys(t)[0]}},1243:(t,e)=>{"use strict";e.isMongooseArray=function(t){return Array.isArray(t)&&t.isMongooseArray}},1244:(t,e,r)=>{"use strict";var n=r(3609);t.exports=function(t,e){if(null==t)return t;if(t._id&&"string"==typeof t._id)return t._id;if(t.toString&&t.toString!==Object.prototype.toString&&!Array.isArray(t))return t.toString();
1throw new n("string",t,e)}},1260:(t,e)=>{"use strict";e.Ut=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]).concat(["validate"])},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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t,r,s){var a,u;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),a=e,u=['Parameter "'+r+'" to '+s+'() must be an object, got "'+t.toString()+'" (type '+n(t)+")"],a=i(a),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(a,u||[],i(this).constructor):a.apply(this,u))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t){var r,s;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),r=e,s=["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."],r=i(r),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(r,s||[],i(this).constructor):r.apply(this,s))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(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(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,i){var a=Object.create((n&&n.prototype instanceof c?n:c).prototype);return s(a,"_invoke",function(r,n,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(r,n){for(s=r,a=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,s=0))}if(o||r>1)return u;throw f=!0,n}
1return 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),a}var u={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=f.prototype=c.prototype=Object.create([][n]?e(e([][n]())):(s(e={},n,function(){return this}),e));function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,s(p,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(p),s(p,o,"Generator"),s(p,n,function(){return this}),s(p,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:h}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}(s=function(t,e,r,n){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{var i=function(e,r){s(t,e,function(t){return this._invoke(e,r,t)})};i("next",0),i("throw",1),i("return",2)}})(t,e,r,n)}function a(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=c(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 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 c(t,e){if(t){if("string"==typeof t)return l(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)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var f=r(5022),p=r(8442),h=r(4450),y=r(2068).X,d=r(3703),b=r(8768),m=r(4301),v={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0};t.exports=function(t,e,r,s,c,l,g){if(!r||!r.instanceOfSchema)throw Error("You must pass a valid discriminator Schema");if(l=null==l||l,t.schema.discriminatorMapping&&!t.schema.discriminatorMapping.isRoot)throw Error('Discriminator "'+e+'" can only be a discriminator of the root model');if(c){var _=d(t.base,"options.applyPluginsToDiscriminators",!1)||!l;t.base._applyPlugins(r,{skipTopLevel:!_})}else l||p(r);var O=t.schema.options.discriminatorKey,w=t.schema.path(O);if(null!=w)b.hasUserDefinedProperty(w.options,"select")||(w.options.select=!0),w.options.$skipDiscriminatorCheck=!0;else{var S={};S[O]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},S[O][t.schema.options.typeKey]=String,t.schema.add(S),y({prop:O,prototype:t.prototype,options:t.schema.options})}if(r.path(O)&&!0!==r.path(O).options.$skipDiscriminatorCheck)throw Error('Discriminator "'+e+'" cannot have field with name "'+O+'"');var $=e;if(("string"==typeof s&&s.length||null!=s)&&($=s),function(t,e){var r=i().m(l);if(null!=t.encryptionType()||null!=e.encryptionType()){var n,o=u(l(c(t),c(e)));try{for(o.s();!(n=o.n()).done;){var s=n.value;if(t._hasEncryptedField(s)&&e._hasEncryptedField(s))throw Error("encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=".concat(s));if(t._hasEncryptedField(s)||e._hasEncryptedField(s))throw Error("encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=".concat(s))}}catch(t){o.e(t)}finally{o.f()}}function c(t){return[].concat(a(Object.keys(t.paths)),a(Object.keys(t.singleNestedPaths)))}function l(t,e){var n,o,s,a,c;return i().w(function(r){for(;;)switch(r.n){case 0:n=new Set(t),o=u(e),r.p=1,o.s();case 2:if((s=o.n()).done){r.n=4;break}if(a=s.value,!n.has(a)){r.n=3;break}return r.n=3,a;case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,c=r.v,o.e(c);case 6:return r.p=6,o.f(),r.f(6);case 7:return r.a(2)}},r,null,[[1,5,6,7]])}}(t.schema,r),function(e,r){e._baseSchema=r,r.paths._id&&r.paths._id.options&&!r.paths._id.options.auto&&e.remove("_id");for(var i=[],s=0,a=Object.keys(r.paths);s<a.length;s++){var p=a[s];if(e.nested[p])i.push(p);else if(-1!==p.indexOf(".")){var y,d="",g=u(p.split(".").slice(0,-1));try{for(g.s();!(y=g.n()).done;){var _=y.value;d+=(d.length?".":"")+_,(e.paths[d]instanceof f||e.singleNestedPaths[d]instanceof f)&&i.push(p)}}catch(t){g.e(t)}finally{g.f()}}}e.obj=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
1e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},e.obj),m(e,r),e._gatherChildSchemas();for(var S=0;S<i.length;S++){var j=i[S];delete e.paths[j]}e.childSchemas.forEach(function(t){t.model.prototype.$__setSchema(t.schema)});var P={};P[O]={default:$,select:!0,set:function(t){if(t===$||Array.isArray($)&&b.deepEqual(t,$))return $;throw Error("Can't set discriminator key \""+O+'"')},$skipDiscriminatorCheck:!0},P[O][e.options.typeKey]=w?w.options[e.options.typeKey]:String,e.add(P),e.discriminatorMapping={key:O,value:$,isRoot:!1},r.options.collection&&(e.options.collection=r.options.collection);var A=e.options.toJSON,E=e.options.toObject,x=e.options._id,T=e.options.id,k=Object.keys(e.options);e.options.discriminatorKey=r.options.discriminatorKey;for(var N=e._userProvidedOptions,I=0;I<k.length;I++){var B=k[I];if(!v[B]&&B in N&&!b.deepEqual(e.options[B],r.options[B]))throw Error("Can't customize discriminator option "+B+" (can only modify "+Object.keys(v).join(", ")+")")}e.options=h(r.options);for(var M=0,D=Object.keys(N);M<D.length;M++){var R=D[M];e.options[R]=N[R]}A&&(e.options.toJSON=A),E&&(e.options.toObject=E),void 0!==x&&(e.options._id=x),e.options.id=T,l&&(e.s.hooks=t.schema.s.hooks.merge(e.s.hooks)),c&&(e.plugins=Array.prototype.slice.call(r.plugins)),e.callQueue=r.callQueue.concat(e.callQueue),delete e._requiredpaths}(r,t.schema),t.discriminators||(t.discriminators={}),t.schema.discriminatorMapping||(t.schema.discriminatorMapping={key:O,value:null,isRoot:!0}),t.schema.discriminators||(t.schema.discriminators={}),t.schema.discriminators[e]=r,t.discriminators[e]&&!r.options.overwriteModels&&!g)throw Error('Discriminator with name "'+e+'" already exists');return r}},1505:t=>{"use strict";t.exports=function(t,e,r,n,o){var i=null!=e&&!1===e.updatedAt,s=null!=e&&!1===e.createdAt,a=null!=r?r():t.ownerDocument().constructor.base.now();if(!s&&(t.isNew||t.$isSubdocument)&&n&&!t.$__getValue(n)&&t.$__isSelected(n)&&t.$set(n,a,void 0,{overwriteImmutable:!0}),!i&&o&&(t.isNew||t.$isModified())){var u=a;t.isNew&&null!=n&&(u=t.$__getValue(n)),t.$set(o,u)}}},1635:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t){var r,s;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),r=e,s=["Can't validate() the same doc multiple times in parallel. Document: "+t._doc._id],r=i(r),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(r,s||[],i(this).constructor):r.apply(this,s))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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";
1t.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})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var s=r(3609),a=r(6426),u=r(3704),c=r(4327);function l(t,e){a.call(this,t,e,"Double")}function f(t){return this.cast(t)}l.schemaName="Double",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._defaultCaster=function(t){if(null!=t&&"Double"!==t._bsontype)throw Error();return t},l.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},l._checkRequired=function(t){return null!=t},l.checkRequired=a.checkRequired,l.prototype.checkRequired=function(t){return this.constructor._checkRequired(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("Double",t,this.path,e,this)}},l.prototype.$conditionalHandlers=i(i({},a.prototype.$conditionalHandlers),{},{$gt:f,$gte:f,$lt:f,$lte:f}),l.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return c("number","double",null==t?void 0:t.useBsonType,e)},l.prototype.autoEncryptionType=function(){return"double"}
1,t.exports=l},1793:(t,e,r)=>{"use strict";var n=r(7300),o=r(2789);t.exports=function t(e){if(null==e)return null;var r=Object.keys(e),i=null;if(1===r.length&&"_id"===r[0])i=!e._id;else for(var s=0;s<r.length;++s){var a,u=r[s];if("_id"!==u&&n(e[u])&&null!=(i=o(e[u])?null!=(a=t(e[u]))?a:i:!e[u]))break}return i}},1824:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(3703);t.exports=function(t,e,r,i,s,a){var u,c=i,l=c,f=o(s,"timestamps",!0);if(!f||null==c)return i;var p,h,y=null!=f&&!1===f.createdAt,d=null!=f&&!1===f.updatedAt;if(a)return i&&i.$set&&(i=i.$set,c.$set={},l=c.$set),d||!r||i[r]||(l[r]=t),y||!e||i[e]||(l[e]=t),c;if(i=i||{},Array.isArray(c))return null==r||c.push({$set:(p={},(u=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(h=r),(h="symbol"==n(u)?u:u+"")in p)?Object.defineProperty(p,h,{value:t,enumerable:!0,configurable:!0,writable:!0}):p[h]=t,p)}),c;if(c.$set=c.$set||{},!d&&r&&(!i.$currentDate||!i.$currentDate[r])){var b=!1;if(-1!==r.indexOf("."))for(var m=r.split("."),v=1;v<m.length;++v){var g=m.slice(-v).join("."),_=m.slice(0,-v).join(".");if(null!=i[_]){i[_][g]=t,b=!0;break}if(i.$set&&i.$set[_]){i.$set[_][g]=t,b=!0;break}}b||(c.$set[r]=t),c.hasOwnProperty(r)&&delete c[r]}if(!y&&e){i[e]&&delete i[e],i.$set&&i.$set[e]&&delete i.$set[e];var O=!1;if(-1!==e.indexOf("."))for(var w=e.split("."),S=1;S<w.length;++S){var $=w.slice(-S).join("."),j=w.slice(0,-S).join(".");if(null!=i[j]){i[j][$]=t,O=!0;break}if(i.$set&&i.$set[j]){i.$set[j][$]=t,O=!0;break}}O||(c.$setOnInsert=c.$setOnInsert||{},c.$setOnInsert[e]=t)}return 0===Object.keys(c.$set).length&&delete c.$set,c}},1849:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var o=r(8768);t.exports=function(t,e){if(null!=t._doc._id&&null!=e&&0!==e.length){var r,i=String(t._doc._id),s=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return n(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,void 0):void 0}}(t))){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw 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(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw i}}}}(e);try{for(s.s();!(r=s.n()).done;){var a=r.value;if(!a.isVirtual)for(var u=a.path.split("."),c=0;c<u.length-1;++c){var l=u.slice(0,c+1).join("."),f=u.slice(c+1).join("."),p=t.get(l);if(null!=p&&o.isMongooseDocumentArray(p)){for(var h=0;h<p.length;++h)p[h]&&p[h].populated(f,null==a._docs[i]?void 0:a._docs[i][h],a);break}}}}catch(t){s.e(t)}finally{s.f()}}}},1875:t=>{"use strict";t.exports=function(t){for(var e,r=Object.keys(t.errors||{}),n=r.length,o=[],i=0;i<n;++i)e=r[i],t!==t.errors[e]&&o.push(e+": "+t.errors[e].message);return o.join(", ")}},1898:(t,e,r)=>{"use strict";e.saveSubdocs=r(4432),e.sharding=r(2824),e.trackTransaction=r(5889),e.validateBeforeSave=r(9848)},1905:(t,e,r)=>{"use strict";var n,o=r(3071),i=r(2724)(/^\s*(?:function)?\*/),s=r(953)(),a=r(209),u=o("Object.prototype.toString"),c=o("Function.prototype.toString");t.exports=function(t){if("function"!=typeof t)return!1;if(i(c(t)))return!0;if(!s)return"[object GeneratorFunction]"===u(t);if(!a)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&a(e)}return a(t)===n}},2003:(t,e,r)=>{"use strict";var n=r(3703),o=r(608),i=r(2423);t.exports=function(t){var e=[],r=new WeakMap,s=t.constructor.indexTypes,a=new Map;return function t(u,c,l){if(!r.has(u)){r.set(u,!0),c=c||"";for(var f=0,p=Object.keys(u.paths);f<p.length;f++){var h=p[f],y=u.paths[h];if(null==l||!l.paths[h]){if(null!=y._duplicateKeyErrorMessage&&(u._duplicateKeyErrorMessagesByPath=u._duplicateKeyErrorMessagesByPath||{},u._duplicateKeyErrorMessagesByPath[h]=y._duplicateKeyErrorMessage),y.$isMongooseDocumentArray||y.$isSingleNested){if(!0!==n(y,"options.excludeIndexe
1s")&&!0!==n(y,"schemaOptions.excludeIndexes")&&!0!==n(y,"schema.options.excludeIndexes")&&t(y.schema,c+h+"."),null!=y.schema.discriminators)for(var d=y.schema.discriminators,b=0,m=Object.keys(d);b<m.length;b++)t(d[m[b]],c+h+".",y.schema);if(y.$isMongooseDocumentArray)continue}var v=y._index||y.caster&&y.caster._index;if(!1!==v&&null!=v){var g,_={},O=o(v),w=O?v:{},S="string"==typeof v?v:!!O&&v.type;S&&-1!==s.indexOf(S)?_[c+h]=S:w.text?(_[c+h]="text",delete w.text):(g="descending"===v||"desc"===v||"ascending"!==v&&"asc"!==v&&-1===Number(v),_[c+h]=g?-1:1),delete w.type,"background"in w||(w.background=!0),null!=u.options.autoIndex&&(w._autoIndex=u.options.autoIndex);var $=w&&w.name;"string"==typeof $&&a.has($)?Object.assign(a.get($),_):(e.push([_,w]),a.set($,_))}}}r.delete(u),c?function(t,r){for(var n=t._indexes,o=n.length,i=0;i<o;++i){for(var s=n[i][0],a=n[i][1],u=Object.keys(s),c=u.length,l={},f=0;f<c;++f){var p=u[f];l[r+p]=s[p]}var h=Object.assign({},a);if(null!=a&&null!=a.partialFilterExpression){h.partialFilterExpression={};for(var y=a.partialFilterExpression,d=0,b=Object.keys(y);d<b.length;d++){var m=b[d];h.partialFilterExpression[r+m]=y[m]}}e.push([l,h])}}(u,c):(u._indexes.forEach(function(t){var e=t[1];"background"in e||(e.background=!0),i(u,e)}),e=e.concat(u._indexes))}}(t),e}},2064:(t,e,r)=>{"use strict";var n=r(2273),o=r(9122),i=r(4756),s=r(2481),a=r(9247),u=o(s(),Object);n(u,{getPolyfill:s,implementation:i,shim:a}),t.exports=u},2068:(t,e,r)=>{"use strict";var n,o=r(4450),i=r(7930).documentSchemaSymbol,s=r(3303)._,a=r(8768),u=r(7930).getSymbol,c=r(7930).scopeSymbol,l=a.isPOJO;e.w=h,e.X=y;var f=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),p=Object.freeze({noDottedPath:!0});function h(t,e,o,i){n=n||r(2400);for(var s=i.typeKey,a=0,u=Object.keys(t);a<u.length;a++){var c=u[a],f=t[c];y({prop:c,subprops:l(f)&&Object.keys(f).length>0&&(!f[s]||"type"===s&&l(f.type)&&f.type.type)?f:null,prototype:e,prefix:o,options:i})}}function y(t){var e=t.prop,a=t.subprops,l=t.prototype,y=t.prefix,d=t.options;n=n||r(2400);var b=(y?y+".":"")+e,m=(y=y||"")?Object.freeze({}):p;a?Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){var t,e,r=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[b]){var s=Object.create(n.prototype,(t=this,e={},Object.getOwnPropertyNames(t).forEach(function(r){-1===["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(r)||(e[r]=Object.getOwnPropertyDescriptor(t,r),e[r].enumerable=!1)}),e));y||(s.$__[c]=this),s.$__.nestedPath=b,Object.defineProperty(s,"schema",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(s,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(s,i,{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(s,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o(r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(s,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null})}}),Object.defineProperty(s,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toJSON&&this.schema.options.toJSON.virtuals||null})}}),Object.defineProperty(s,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(s,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(b,null,f)||{}).length}}),Object.defineProperty(s,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),h(a,s,b,d),this.$__.getters[b]=s}return this.$__.getters[b]},set:function(t){null!=t&&t.$__isNested?t=t.$__get():t instanceof n&&!t.$__isNested&&(t=t.$toObject(s)),(this.$__[c]||this).$set(b,t)}}):Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){return this[u].call(this.$__[c]||this,b,null,m)},set:function(t){this.$set.call(this.$__[c]||this,b,t)}})}},2069:(t,e,r)=>{"use strict";var n,o=r(5761),i=(Object.defineProperty(n=function t(e){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t),Object.assign(this,e),null!=e&&null!=e.options&&(this.options=Object.assign({},e.options))},"prototype",{writable:!1}),n);Object.defineProperty(i.prototype,"ref",o),Object.defineProperty(i.prototype,"refPath",o),Object.defineProperty(i.prototype,"localField",o),Object.defineProperty(i.prototype,"foreignField",o),Object.defineProperty(i.prototype,"justOne",o),Object.defineProperty(i.prototype,"count",o),Object.defineProperty(i.prototype,"match",o),Ob
1ject.defineProperty(i.prototype,"options",o),Object.defineProperty(i.prototype,"skip",o),Object.defineProperty(i.prototype,"limit",o),Object.defineProperty(i.prototype,"perDocumentLimit",o),t.exports=i},2073:t=>{"use strict";t.exports=function t(e){if(!Array.isArray(e))return{min:0,max:0,containsNonArrayItem:!0};if(0===e.length||1===e.length&&!Array.isArray(e[0]))return{min:1,max:1,containsNonArrayItem:!1};for(var r=t(e[0]),n=1;n<e.length;++n){var o=t(e[n]);o.min<r.min&&(r.min=o.min),o.max>r.max&&(r.max=o.max),r.containsNonArrayItem=r.containsNonArrayItem||o.containsNonArrayItem}return r.min=r.min+1,r.max=r.max+1,r}},2081:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return i(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(t,void 0):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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e,r,n){var o=a(f(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof o?function(t){return o.apply(r,t)}:o}function a(){return(a="u">typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!({}).hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function u(t){var e="function"==typeof Map?new Map:void 0;return(u=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 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(c())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&l(o,r.prototype),o}(t,arguments,f(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)})(t)}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(c=function(){return!!t})()}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=r(5022),h=r(8213),y=r(4450),d=r(8768).deepEqual,b=r(8260),m=r(3216),v=r(7352),g=r(2793),_=r(3305),O=r(4473),w=r(7930).populateModelSymbol,S=function(t){var e;function r(t,e,o,i){var s,a,u;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,r),"Object"===b(t)&&(t=Object.keys(t).reduce(function(e,r){return e.concat([[r,t[r]]])},[])),(a=r,u=[t],a=f(a),s=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,c()?Reflect.construct(a,u||[],f(this).constructor):a.apply(this,u))).$__parent=null!=o&&null!=o.$__?o:null,s.$__path=e,s.$__schemaType=null==i?new p(e):i,s.$__runDeferred(),s}return function(t,e){if("function"!=typeof e&&null!==e)throw 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)}(r,t),e=[{key:"$init",value:function(t,e){$(t),s(r,"set",this,3)([t,e]),null!=e&&e.$isSingleNested&&(e.$basePath=this.$__path+"."+t)}},{key:"$__set",value:function(t,e){s(r,"set",this,3)([t,e])}},{key:"get",value:function(t,e){return _(t,"ObjectId")&&(t=t.toString()),!1===(e=e||{}).getters?s(r,"get",this,3)([t]):this.$__schemaType.applyGetters(s(r,"get",this,3)([t]),this.$__parent)}},{key:"set",value:function(t,e){if(_(t,"ObjectId")&&(t=t.toString()),$(t),e=m(e),null==this.$__schemaType)return this.$__deferred=this.$__deferred||[],void this.$__deferred.push({key:t,value:e});var n,o=this.$__parent,i=null!=o&&o.$__&&o.$__.populated?o.$populated(l.call(this),!0)||o.$populated(this.$__path,!0):null,a=this.get(t);if(null!=i){if(this.$__schemaType.$isSingleNested)throw new h("Cannot manually populate single nested subdoc underneath Map "+'at path "'.concat(this.$__path,'". Try using an array instead of a Map.'));Array.isArray(e)&&this.$__schemaType.$isMongooseArray?e=e.map(function(t){return null==t.$__&&(t=new i.options[w](t)),t.$__.wasPopulated={value:t._doc._id},t}):null!=e&&(null==e.$__&&(e=new i.options[w](e)),e.$__.wasPopulated={value:e._doc._id})}else try{var u=this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested||this.$__schemaType.$isMongooseArray||this.$__schemaType.$isSchemaMap?{path:l.call(this)}:null;e=this.$__schemaType.applySetters(e,this.$__parent,!1,this.get(t),u)}catch(t){if(null!=this.$__parent&&null!=this.$__parent.$__)return void this.$__parent.invali
1date(l.call(this),t);throw t}if(s(r,"set",this,3)([t,e]),null!=o&&null!=o.$__&&!d(e,a)){var c=l.call(this);o.markModified(c),(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested)&&O(o,c)}function l(){return n||(n=this.$__path+"."+t)}}},{key:"clear",value:function(){s(r,"clear",this,3)([]);var t=this.$__parent;null!=t&&t.markModified(this.$__path)}},{key:"delete",value:function(t){return _(t,"ObjectId")&&(t=t.toString()),this.set(t,void 0),s(r,"delete",this,3)([t])}},{key:"toBSON",value:function(){return new Map(this)}},{key:"toObject",value:function(t){if(t&&t.flattenMaps){var e,r={},n=o(this.keys());try{for(n.s();!(e=n.n()).done;){var i=e.value;r[i]=y(this.get(i),t)}}catch(t){n.e(t)}finally{n.f()}return r}return new Map(this)}},{key:"$toObject",value:function(){return this.constructor.prototype.toObject.apply(this,arguments)}},{key:"toJSON",value:function(t){if("boolean"!=typeof(t&&t.flattenMaps)||t.flattenMaps){var e,r={},n=o(this.keys());try{for(n.s();!(e=n.n()).done;){var i=e.value;r[i]=y(this.get(i),t)}}catch(t){n.e(t)}finally{n.f()}return r}return new Map(this)}},{key:"inspect",value:function(){return new Map(this)}},{key:"$__runDeferred",value:function(){if(this.$__deferred){var t,e=o(this.$__deferred);try{for(e.s();!(t=e.n()).done;){var r=t.value;this.set(r.key,r.value)}}catch(t){e.e(t)}finally{e.f()}this.$__deferred=null}}}],function(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(o.key),o)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}(u(Map));function $(t){var e=n(t);if("string"!==e)throw TypeError("Mongoose maps only support string keys, got ".concat(e));if(t.startsWith("$"))throw Error('Mongoose maps do not support keys that start with "$", got "'.concat(t,'"'));if(t.includes("."))throw Error('Mongoose maps do not support keys that contain ".", got "'.concat(t,'"'));if(g.has(t))throw Error('Mongoose maps do not support reserved key name "'.concat(t,'"'))}v.inspect.custom&&Object.defineProperty(S.prototype,v.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:S.prototype.inspect}),Object.defineProperty(S.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(S.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(S.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(S.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(S.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0}),Object.defineProperty(S.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0}),t.exports=S},2097:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e,r){var o;return(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(9166),a=r(1824),u=r(3703),c=r(3696),l=r(1505),f=r(7160),p=new Set(["replaceOne","findOneAndReplace"]);t.exports=function(t,e){var r=t.childSchemas.find(function(t){return!!t.schema.options.timestamps});if(e||r){var n=c(e,"createdAt"),h=c(e,"updatedAt"),y=null!=e&&e.hasOwnProperty("currentTime")?e.currentTime:null,d={};if(t.$timestamps={createdAt:n,updatedAt:h}
1,n&&!t.paths[n]){var b=null!=t.base?t.base.get("timestamps.createdAt.immutable"):null;d[n]=i(i({},t.options.typeKey||"type",Date),"immutable",null==b||b)}h&&!t.paths[h]&&(d[h]=Date),t.add(d),t.pre("save",function(t){var e=u(this,"$__.saveOptions.timestamps");if(!1===e)return t();l(this,e,y,n,h),t()}),t.methods.initializeTimestamps=function(){var t=null!=y?y():this.constructor.base.now();if(n&&!this.get(n)&&this.$set(n,t),h&&!this.get(h)&&this.$set(h,t),this.$isSubdocument)return this;var e,r=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return o(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,void 0):void 0}}(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw 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(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw i}}}}(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},v[f.builtInMiddleware]=!0;var m={query:!0,model:!1};t.pre("findOneAndReplace",m,v),t.pre("findOneAndUpdate",m,v),t.pre("replaceOne",m,v),t.pre("update",m,v),t.pre("updateOne",m,v),t.pre("updateMany",m,v)}function v(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})(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==o(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var a=r(6365),u=r(6426),c=u.CastError,l=r(8250),f=r(4327),p=r(8768),h=r(9460),y=l.UUID_FORMAT,d=a.Binary;function b(t){var e;return"string"!=typeof t&&null!=t?(e=t.toString("hex")).substring(0,8)+"-"+e.substring(8,12)+"-"+e.substring(12,16)+"-"+e.substring(16,20)+"-"+e.substring(20,32):t}function m(t,e){u.call(this,t,e,"UUID"),this.getters.push(function(t){return null!=t&&null!=t.$__?t:n.isBuffer(t)?b(t):t instanceof d?b(t.buffer):p.isPOJO(t)&&"Buffer"===t.type&&Array.isArray(t.data)?b(n.from(t.data)):t})}function v(t){return this.cast(t)}function g(t){var e=this;return t.map(function(t){return e.cast(t)})}m.schemaName="UUID",m.defaultOptions={},m.prototype=Object.create(u.prototype),m.prototype.constructor=m,m._cast=l,m.get=u.get,m.set=u.set,m.setters=[],m.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},m._checkRequired=function(t){return null!=t},m.checkRequired=u.checkRequired,m.prototype.checkRequired=function(t){return n.isBuffer(t)&&(t=b(t)),null!=t&&y.test(t)},m.prototype.cast=function(t,e,r,n,o){var i;if(p.isNonBuiltinObject(t)&&u._isRef(this,t,e,r))return this._castRef(t,e,r,o);i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():m.cast();try{return i(t)}catch(e){throw new c(m.schemaName,t,this.path,e,this)}},m.prototype.$conditionalHandlers=s(s({},u.prototype.$conditionalHandlers),{},{$bitsAllClear:h,$bitsAnyClear:h,$bitsAllSet:h,$bitsAnySet:h,$all:g,$gt:v,$gte:v,$in:g,$lt:v,$lte:v,$ne:v,$nin:g}),m.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw Error("Can't use "+t+" with UUID.");return n.call(this,e,r)}try{return this.applySetters(e,r)}catch(t){throw t instanceof c&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},m.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return f("string","binData",null==t?void 0:t.useBsonType,e)},m.prototype.autoEncryptionType=function(){return"binData"},t.exports=m},2151:t=>{"use strict";
1t.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})(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 n||"[object Function]"!==s.call(n)||!n())return}c?u(t,e,r,!0):u(t,e,r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},n=o(e);i&&(n=a.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s<n.length;s+=1)l(t,n[s],e[n[s]],r[n[s]])};f.supportsDescriptors=!!c,t.exports=f},2307:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==s(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t){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})(t)}var a=r(6365),u=r(2945),c=r(6426),l=r(4327),f=r(9460),p=r(8768),h=a.Binary,y=c.CastError;function d(t,e){c.call(this,t,e,"Buffer")}function b(t,e){return this.castForQuery(null,t,e)}d.schemaName="Buffer",d.defaultOptions={},d.prototype=Object.create(c.prototype),d.prototype.constructor=d,d.prototype.OptionsConstructor=u,d._checkRequired=function(t){return!(!t||!t.length)},d.set=c.set,d.setters=[],d.get=c.get,d.checkRequired=c.checkRequired,d.prototype.checkRequired=function(t,e){return c._isRef(this,t,e,!0)?!!t:this.constructor._checkRequired(t)},d.prototype.cast=function(t,e,r,o,i){if(c._isRef(this,t,e,r)){if(t&&t.isMongooseBuffer)return t;if(n.isBuffer(t))return t&&t.isMongooseBuffer||(t=new a(t,[this.path,e]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof h){if(u=new a(t.value(!0),[this.path,e]),"number"!=typeof t.sub_type)throw new y("Buffer",t,this.path,null,this);return u._subtype=t.sub_type,u}if(null==t||p.isNonBuiltinObject(t))return this._castRef(t,e,r,i)}if(t&&t._id&&(t=t._id),t&&t.isMongooseBuffer)return t;if(n.isBuffer(t))return t&&t.isMongooseBuffer||(t=new a(t,[this.path,e]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof h){if(u=new a(t.value(!0),[this.path,e]),"number"!=typeof t.sub_type)throw new y("Buffer",t,this.path,null,this);return u._subtype=t.sub_type,u}if(null===t)return t;var u,l=s(t);if("string"===l||"number"===l||Array.isArray(t)||"object"===l&&"Buffer"===t.type&&Array.isArray(t.data))return"number"===l&&(t=[t]),u=new a(t,[this.path,e]),null!=this.options.subtype&&(u._subtype=this.options.subtype),u;if(p.isPOJO(t)&&(t.$binary instanceof h||"string"==typeof t.$binary)){var f=this.cast(n.from(t.$binary,"base64"));if(null!=t.$type)return f._subtype=t.$type,f}throw new y("Buffer",t,this.path,null,this)},d.prototype.subtype=function(t){return this.options.subtype=t,this},d.prototype.$conditionalHandlers=i(i({},c.prototype.$conditionalHandlers),{},{$bitsAllClear:f,$bitsAnyClear:f,$bitsAllSet:f,$bitsAnySet:f,$gt:b,$gte:b,$lt:b,$lte:b}),d.prototype.castForQuery=function(t,e,r){var n,o;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw Error("Can't use "+t+" with Buffer.");return n.call(this,e)}try{o=this.applySetters(e,r)}catch(t){throw t instanceof y&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}return o?o.toObject({transform:!1,virtuals:!1}):o},d.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return l("string","binData",null==t?void 0:t.useBsonType,e)},d.prototype.autoEncryptionType=function(){return"binData"},t.exports=d},2345:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
1e%2?n(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==i(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t){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})(t)}var s=r(3672),a=r(3731),u=r(6426),c=r(2477),l=r(4327),f=r(8260),p=r(8768),h=u.CastError;function y(t,e){u.call(this,t,e,"Date")}function d(t){return this.cast(t)}y.schemaName="Date",y.defaultOptions={},y.prototype=Object.create(u.prototype),y.prototype.constructor=y,y.prototype.OptionsConstructor=a,y._cast=c,y.set=u.set,y.setters=[],y.get=u.get,y.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},y._defaultCaster=function(t){if(null!=t&&!(t instanceof Date))throw Error();return t},y.prototype.expires=function(t){return"Object"!==f(this._index)&&(this._index={}),this._index.expires=t,p.expires(this._index),this},y._checkRequired=function(t){return t instanceof Date},y.checkRequired=u.checkRequired,y.prototype.checkRequired=function(t,e){return"object"===i(t)&&u._isRef(this,t,e,!0)?null!=t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():y.checkRequired())(t)},y.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.minValidator},this)),t){var r=e||s.messages.Date.min;"string"==typeof r&&(r=r.replace(/{MIN}/,t===Date.now?"Date.now()":t.toString()));var n=this;this.validators.push({validator:this.minValidator=function(e){var r=t;"function"==typeof t&&t!==Date.now&&(r=r.call(this));var o=r===Date.now?r():n.cast(r);return null===e||e.valueOf()>=o.valueOf()},message:r,type:"min",min:t})}return this},y.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||s.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},y.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():y.cast();try{return e(t)}catch(e){throw new h("date",t,this.path,e,this)}},y.prototype.$conditionalHandlers=o(o({},u.prototype.$conditionalHandlers),{},{$gt:d,$gte:d,$lt:d,$lte:d}),y.prototype.castForQuery=function(t,e,r){if(null==t)try{return this.applySetters(e,r)}catch(t){throw t instanceof h&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}var n=this.$conditionalHandlers[t];if(!n)throw Error("Can't use "+t+" with Date.");return n.call(this,e)},y.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return l("string","date",null==t?void 0:t.useBsonType,e)},y.prototype.autoEncryptionType=function(){return"date"}
1,t.exports=y},2354:(t,e,r)=>{"use strict";var n=r(6730);t.exports=Function.prototype.bind||n},2400:(t,e,r)=>{"use strict";var n,o,i=r(5832).hp;function s(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||d(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=Object.create((n&&n.prototype instanceof c?n:c).prototype);return u(a,"_invoke",function(r,n,o){var i,a,u,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,a=0,u=t,p.n=r,s}};function h(r,n){for(a=r,u=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(a=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,a=0))}if(o||r>1)return s;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),a=l,u=y;(e=a<2?t:u)||!f;){i||(a?a<3?(a>1&&(p.n=-1),h(a,u)):p.n=u:p.v=u);try{if(c=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==s)break}catch(e){i=t,a=1,u=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),a}var s={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=f.prototype=c.prototype=Object.create([][n]?e(e([][n]())):(u(e={},n,function(){return this}),e));function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,u(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,u(p,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,o,"GeneratorFunction"),u(p),u(p,o,"Generator"),u(p,n,function(){return this}),u(p,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:h}})()}function u(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}(u=function(t,e,r,n){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{var i=function(e,r){u(t,e,function(t){return this._invoke(e,r,t)})};i("next",0),i("throw",1),i("return",2)}})(t,e,r,n)}function c(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function s(t){c(i,n,o,s,a,"next",t)}function a(t){c(i,n,o,s,a,"throw",t)}s(void 0)})}}function f(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 p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){h(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function h(t,e,r){var n;return(n=function(t){if("object"!=m(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==m(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=d(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 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}
1,f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function d(t,e){if(t){if("string"==typeof t)return b(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)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function m(t){return(m="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})(t)}var v,g,_,O=r(1417),w=r(3550).EventEmitter,S=r(4224),$=r(6365),j=r(3672),P=r(5022),A=r(6140),E=r(3441),x=r(1350),T=r(1635),k=r(7058),N=r(8995),I=r(6949),B=r(9538),M=r(6814),D=r(5335),R=r(4473),U=r(4450),C=r(2068).w,F=r(2068).X,L=r(1226),V=r(7430).B,q=r(5152),J=r(791),z=r(2692),K=r(3216),H=r(2746),W=r(3305),G=r(7300),Q=r(1793),Y=r(5188),Z=r(7352).inspect,X=r(3303)._,tt=r(1849),te=r(6451),tr=r(5678),tn=r(6223),to=r(3892),ti=r(8768),ts=r(542),ta=ti.deepEqual,tu=ti.isMongooseObject,tc=r(7930).arrayAtomicsBackupSymbol,tl=r(7930).arrayAtomicsSymbol,tf=r(7930).documentArrayParent,tp=r(7930).documentIsModified,th=r(7930).documentModifiedPaths,ty=r(7930).documentSchemaSymbol,td=r(7930).getSymbol,tb=r(7930).modelSymbol,tm=r(7930).populateModelSymbol,tv=r(7930).scopeSymbol,tg=r(7160).schemaMixedSymbol,t_=r(5346),tO=r(7930).sessionNewDocuments,tw=ti.specialProperties;function tS(t,e,r,n){if("object"===m(r)&&null!=r&&(r=(n=r).skipId),n=Object.assign({},n),null==this.$__schema){var o=ti.isObject(e)&&!e.instanceOfSchema?new k(e):e;this.$__setSchema(o),e=r,r=n,n=arguments[4]||{}}if(this.$__=new S,null!=n.isNew&&!0!==n.isNew&&(this.$isNew=n.isNew),null!=n.priorDoc&&(this.$__.priorDoc=n.priorDoc),r&&(this.$__.skipId=r),null!=t&&"object"!==m(t))throw new x(t,"obj","Document");var i=!0;void 0!==n.defaults&&(this.$__.defaults=n.defaults,i=n.defaults);var s=this.$__schema;"boolean"==typeof e||"throw"===e?(!0!==e&&(this.$__.strictMode=e),e=void 0):!0!==s.options.strict&&(this.$__.strictMode=s.options.strict);var a,u=y(s.requiredPaths(!0));try{for(u.s();!(a=u.n()).done;){var c=a.value;this.$__.activePaths.require(c)}}catch(t){u.e(t)}finally{u.f()}var l=null;ti.isPOJO(e)&&Object.keys(e).length>0&&(l=Q(e),this.$__.selected=e,this.$__.exclude=l);var f=!1===l&&e?M(e):null;if(null==this._doc&&(this.$__buildDoc(t,e,r,l,f,!1),i&&D(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 tS&&(this.$isNew=t.$isNew)),n.willInit&&i?n.skipDefaults&&(this.$__.skipDefaults=n.skipDefaults):i&&D(this,e,l,f,!1,n.skipDefaults),!this.$__.strictMode&&t){var p=this;
1Object.keys(this._doc).forEach(function(t){t in s.tree||t in s.methods||t in s.virtuals||t.startsWith("$")||F({prop:t,subprops:null,prototype:p})})}!function(t){var e=t.$__schema&&t.$__schema.callQueue;if(e.length){var r,n=y(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 t$ in tS.prototype.$isMongooseDocumentPrototype=!0,Object.defineProperty(tS.prototype,"isNew",{get:function(){return this.$isNew},set:function(t){this.$isNew=t}}),Object.defineProperty(tS.prototype,"errors",{get:function(){return this.$errors},set:function(t){this.$errors=t}}),tS.prototype.$isNew=!0,ti.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(t){tS.prototype[t]=function(){if(!this.$__.emitter){if("emit"===t)return;this.$__.emitter=new w,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[t].apply(this.$__.emitter,arguments)},tS.prototype["$".concat(t)]=tS.prototype[t]}),tS.prototype.constructor=tS,w.prototype)tS[t$]=w.prototype[t$];function tj(t,e,r,n){var o={};!function(t){var e=Object.keys(t.$__.activePaths.getStatePaths("require")),r=0,n=e.length;for(r=0;r<n;++r){var o=e[r],i=t.$__schema.path(o);if(null!=i&&"function"==typeof i.originalRequiredValue){t.$__.cachedRequired=t.$__.cachedRequired||{};try{t.$__.cachedRequired[o]=i.originalRequiredValue.call(t,t)}catch(e){t.invalidate(o,e)}}}}(t);var i=new Set(Object.keys(t.$__.activePaths.getStatePaths("require")).filter(function(e){return!(!t.$__isSelected(e)&&!t.$isModified(e))&&(null==t.$__.cachedRequired||!(e in t.$__.cachedRequired)||t.$__.cachedRequired[e])}));function s(t){t.endsWith(".$*")||i.add(t)}if(Object.keys(t.$__.activePaths.getStatePaths("init")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("modify")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("default")).forEach(s),!n){for(var a=[],u=0,c=Object.keys(t.$__schema.paths);u<c.length;u++){var l=c[u],f=t.$__schema.path(l);if(f.$isSingleNested){var p=t.$get(l);p&&a.push(p)}else if(f.$isMongooseDocumentArray){var h=t.$get(l);if(h&&h.length){var d,b=y(h);try{for(b.s();!(d=b.n()).done;){var m=d.value;m&&a.push(m)}}catch(t){b.e(t)}finally{b.f()}}}}for(var v=t.modifiedPaths(),g=0;g<a.length;g++){var _=a[g];if(_.$basePath){var O,w=_.$__pathRelativeToParent(),S=y(_.modifiedPaths());try{for(S.s();!(O=S.n()).done;){var $=O.value;i.delete(w+"."+$)}}catch(t){S.e(t)}finally{S.f()}var j=_.$parent();if(null==j)throw Error("Cannot validate subdocument that does not have a parent");!t.$isModified(w,null,v)||j.$__.activePaths.getStatePaths("modify").hasOwnProperty(w)||j.$isDefault(w)||(i.add(w),null==t.$__.pathsToScopes&&(t.$__.pathsToScopes={}),t.$__.pathsToScopes[w]=_.$isDocumentArrayElement?_.__parentArray:_.$parent(),o[w]={skipSchemaValidators:!0},_.$isDocumentArrayElement&&null!=_.__index&&(o[w].index=_.__index))}}}var P,A=y(i);try{for(A.s();!(P=A.n()).done;){var E=P.value,x=t.$__schema.path(E);if(x){if(x.$isMongooseDocumentArray){var T,k=y(i);try{for(k.s();!(T=k.n()).done;){var N=T.value;(null==N||N.startsWith(x.path+"."))&&i.delete(N)}}catch(t){k.e(t)}finally{k.f()}}(x.caster||0!==x.validators.length||x.$parentSchemaDocArray)&&(!x.$isMongooseArray||x.$isMongooseDocumentArray||x.$embeddedSchemaType.$isMongooseArray||0!==x.validators.length||0!==x.$embeddedSchemaType.validators.length)||i.delete(E)}}}catch(t){A.e(t)}finally{A.f()}Array.isArray(e)?i=function(t,e){var r,n=new Set(e),o=new Map([]),i=y(e);try{for(i.s();!(r=i.n()).done;){var s=r.value;if(-1!==s.indexOf("."))for(var a=s.split("."),u=a[0],c=1;c<a.length;++c)o.set(u,s),u=u+"."+a[c]}}catch(t){i.e(t)}finally{i.f()}var l,f=new Set,p=y(t);try{for(p.s();!(l=p.n()).done;){var h=l.value;n.has(h)?f.add(h):o.has(h)&&f.add(o.get(h))}}catch(t){p.e(t)}finally{p.f()}return f}(i,e):Array.isArray(r)&&(I=i,B=new Set(B=r),i=new Set(I=Array.from(I).filter(function(t){return!B.has(t)}))),function(t,e){var r,n=y(e);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=t.$__schema.path(o);i&&i.$isMongooseArray&&(Array.isArray(i)||!i.$isMongooseDocumentArray||i&&i.schemaOptions&&i.schemaOptions.required)&&(!i.$isMongooseArray||i.$isMongooseDocumentArray||i.$embeddedSchemaType.$isMongooseArray||0!==i.$embeddedSchemaType.validators.length)&&tP(t.$__getValue(o),e,o)}}catch(t){n.e(t)}finally{n.f()}}(t,i);var I,B,M,D={skipArrays:!0},R=y(i);try{for(R.s();!(M=R.n()).done;){var U=M.value;if(t.$__schema.nested[U]){var C=t.$__getValue(U);tu(C)&&(C=C.toObject({transform:!1}));var F=V(C,U,D,t.$__schema);Object.keys(F).filter(function(e){return!t.$__schema.singleNestedPaths.hasOwnProperty(e)}
1).forEach(s)}}}catch(t){R.e(t)}finally{R.f()}var L,q=y(i);try{for(q.s();!(L=q.n()).done;){var J=L.value,z=t.$__schema.path(J);if(z&&(z.$parentSchemaDocArray&&"string"==typeof z.$parentSchemaDocArray.path&&i.add(z.$parentSchemaDocArray.path),z.$isSchemaMap)){var K=t.$__getValue(J);if(null!=K){var H,W=y(K.keys());try{for(W.s();!(H=W.n()).done;){var G=H.value;i.add(J+"."+G)}}catch(t){W.e(t)}finally{W.f()}}}}}catch(t){q.e(t)}finally{q.f()}return[i=Array.from(i),o]}function tP(t,e,r){if(null!=t)for(var n=t.length,o=0;o<n;++o)Array.isArray(t[o])?tP(t[o],e,r+"."+o):e.add(r+"."+o)}function tA(t,e,r,n){var o,i,s,a=t.$__schema,u=a.virtuals,c=Object.keys(u),l=c.length,f=l,p=t._doc,h="boolean"!=typeof(n&&n.aliases)||n.aliases,y=null;if(Array.isArray((r=r||{}).virtuals))y=new Set(r.virtuals);else if(r.virtuals&&r.virtuals.pathsToSkip){y=new Set(c);for(var d=0;d<r.virtuals.pathsToSkip.length;d++)y.has(r.virtuals.pathsToSkip[d])&&y.delete(r.virtuals.pathsToSkip[d])}if(!p)return e;for(l=0;l<f;++l)if(o=c[l],(null==y||y.has(o))&&(h||!a.aliases.hasOwnProperty(o))){if(i=o,null!=r.path){if(!o.startsWith(r.path+"."))continue;i=o.substring(r.path.length+1)}if(-1!==i.indexOf(".")||i!==o){var b=i.split(".");if(void 0!==(s=U(t.get(o),r))){var m=b.length;p=e;for(var v=0;v<m-1;++v)p[b[v]]=p[b[v]]||{},p=p[b[v]];p[b[m-1]]=s}}else{if(void 0===(s=u[o].applyGetters(void 0,t)))continue;s=U(s,r),e[i]=s}}return e}function tE(t,e){if(ts(e))throw Error("`transform` function must be synchronous, but the transform on path `"+t+"` returned a promise.")}function tx(t,e,r,n,o,i){var s,a;if(i||(i="$set"),r[i]||(r[i]={}),r[i][n.path]=o,!1!==t.$__schema.options.versionKey&&(s=n.path,!(a=t.$__schema.options.skipVersioning)||!a[s=s.replace(/\.\d+\./,".")])&&3&~t.$__.version&&!t.$__schema.options.optimisticConcurrency){switch(i){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}"$push"===i||"$addToSet"===i||"$pullAll"===i||"$pull"===i?/\.\d+\.|\.\d+$/.test(n.path)?t.$__.version=3:t.$__.version=2:/^\$p/.test(i)||Array.isArray(o)?t.$__.version=3:/\.\d+\.|\.\d+$/.test(n.path)&&(t.$__.version=1)}}tS.prototype.$__schema,tS.prototype.schema,Object.defineProperty(tS.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){return null==this.$__.locals&&(this.$__.locals={}),this.$__.locals},set:function(t){this.$__.locals=t}}),tS.prototype.isNew,Object.defineProperty(tS.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0}),tS.prototype.id,tS.prototype.$errors,Object.defineProperty(tS.prototype,"$op",{get:function(){return this.$__.op||null},set:function(t){this.$__.op=t}}),tS.prototype.$__buildDoc=function(t,e,r,n,o){for(var i={},s=Object.keys(this.$__schema.paths).filter(function(t){return!t.includes("$*")}),a=s.length,u=0;u<a;++u){var c=s[u];if("_id"!==c||!r&&(!t||!("_id"in t)))for(var l=this.$__schema.paths[c].splitPath(),f=l.length,p=f-1,h="",y=i,d=!1,b=0;b<f;++b){var m=l[b];if(h.length?h+="."+m:h=m,!0===n){if(h in e)break}else if(!1===n&&e&&!d){if(h in e)d=!0;else if(!o[h])break}b<p&&(y=y[m]||(y[m]={}))}}this._doc=i},tS.prototype.toBSON=function(){return this.toObject(X)},tS.prototype.init=function(t,e,r){return"function"==typeof e&&(r=e,e=null),this.$__init(t,e),r&&r(null,this),this},tS.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)},tS.prototype.$__init=function(t,e){if(this.$isNew=!1,e=e||{},null!=t._id&&e.populated&&e.populated.length){var r,n=String(t._id),o=y(e.populated);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(i.isVirtual?this.$populated(i.path,ti.getValue(i.path,t),i):this.$populated(i.path,i._docs[n],i),null!=i._childDocs){var s,a=y(i._childDocs);try{for(a.s();!(s=a.n()).done;){var u=s.value;null!=u&&null!=u.$__&&(u.$__.parent=this)}}catch(t){a.e(t)}finally{a.f()}i._childDocs=[]}}}catch(t){o.e(t)}finally{o.f()}}(function t(e,r,n,o,i){i=i||"",null!=r.$__&&(r=r._doc);for(var s,a,u,c=Object.keys(r),l=c.length,f=e.$__.strictMode,p=e.$__schema,h=0;h<l;++h)if(u=c[h],!tw.has(u)&&(a=i?i+u:u,s=p.path(a),!p.$isRootDiscriminator||e.$__isSelected(a))){var y=r[u];if(!s&&ti.isPOJO(y))n[u]||(n[u]={},f||u in p.tree||u in p.methods||u in p.virtuals||(e[u]=n[u])),t(e,y,n[u],o,a+".");else if(s){if(n.hasOwnProperty(u)&&void 0!==y&&!o.hydratedPopulatedDocs&&delete n[u],null===y)n[u]=s._castNullish(null);else if(void 0!==y){var d,b=null==y.$__?null:y.$__.wasPopulated;if(!s||b||o.hydratedPopulatedDocs)s&&o.hydratedPopulatedDocs?(n[u]=s.cast(y,e,!0,void 0,{hydratedPopulatedDocs:!0}),n[u]&&n[u].$__&&n[u].$__.wasPopulated?e.$populated(a,n[u].$__.wasPopulated.value,
1n[u].$__.wasPopulated.options):Array.isArray(n[u])&&n[u].length&&null!=(d=n[u][0])&&null!=(d=d.$__)&&d.wasPopulated&&e.$populated(a,n[u].map(function(t){var e;return null==t||null==(e=t.$__)||null==(e=e.wasPopulated)?void 0:e.value}).filter(function(t){return null!=t}),n[u][0].$__.wasPopulated.options)):n[u]=y;else try{o&&o.setters?n[u]=s.applySetters(y,e,!1):n[u]=s.cast(y,e,!0)}catch(t){e.invalidate(t.path,new B({path:t.path,message:t.message,type:"cast",value:t.value,reason:t}))}}e.$isModified(a)||e.$__.activePaths.init(a)}else n[u]=y,f||i||(e[u]=y)}})(this,t,this._doc,e),tt(this,e.populated),this.$emit("init",this),this.constructor.emit("init",this);var c=!1===this.$__.exclude&&this.$__.selected?M(this.$__.selected):null;return D(this,this.$__.selected,this.$__.exclude,c,!1,this.$__.skipDefaults),this},tS.prototype.updateOne=function(t,e,r){var n=this.constructor.updateOne({_id:this._doc._id},t,e),o=this;return n.pre(function(t){o.constructor._middleware.execPre("updateOne",o,[o],t)}),n.post(function(t){o.constructor._middleware.execPost("updateOne",o,[o],{},t)}),null!=this.$session()&&("session"in n.options||(n.options.session=this.$session())),null!=r?n.exec(r):n},tS.prototype.replaceOne=function(){var t=Array.prototype.slice.call(arguments);return t.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,t)},tS.prototype.$session=function(t){if(0==arguments.length)return null!=this.$__.session&&this.$__.session.hasEnded?(this.$__.session=null,null):this.$__.session;if(null!=t&&t.hasEnded)throw new j("Cannot set a document's session to a session that has ended. Make sure you haven't called `endSession()` on the session you are passing to `$session()`.");if(null!=t||null!=this.$__.session){if(this.$__.session=t,!this.$isSubdocument){var e,r=y(this.$getAllSubdocs());try{for(r.s();!(e=r.n()).done;)e.value.$session(t)}catch(t){r.e(t)}finally{r.f()}}return t}},tS.prototype.$timestamps=function(t){return 0==arguments.length?null!=this.$__.timestamps?this.$__.timestamps:this.$__schema?this.$__schema.options.timestamps:void 0:(t!==this.$timestamps()&&(this.$__.timestamps=t),this)},tS.prototype.overwrite=function(t){for(var e=0,r=Array.from(new Set(Object.keys(this._doc).concat(Object.keys(t))));e<r.length;e++){var n=r[e];"_id"!==n&&(this.$__schema.options.versionKey&&n===this.$__schema.options.versionKey||this.$__schema.options.discriminatorKey&&n===this.$__schema.options.discriminatorKey||this.$set(n,t[n]))}return this},tS.prototype.$set=function(t,e,r,n){var o=this;ti.isPOJO(r)&&(n=r,r=void 0);var i,s,a,u,c=n&&n.merge,l=r&&!0!==r,f=!0===r,d=0,b=n&&"strict"in n,v=b?n.strict:this.$__.strictMode;if(l&&((this.$__.adhocPaths||(this.$__.adhocPaths={}))[t]=this.$__schema.interpretAsType(t,r,this.$__schema.options)),null==t){var g=[e,t];t=g[0],e=g[1]}else if("string"!=typeof t){if(t instanceof tS&&(t=t.$__isNested?t.toObject():t.$__schema===this.$__schema?tA(t,p({},t._doc)):t._doc),null==t){var _=[e,t];t=_[0],e=_[1]}u=e?e+".":"";var O=(i=J(this.$__schema,t)).length,w=n&&n._skipMinimizeTopLevel||!1;if(0===O&&w)return delete n._skipMinimizeTopLevel,e&&this.$set(e,{}),this;n=Object.assign({},n,{_skipMinimizeTopLevel:!1});for(var S=0;S<O;++S){a=i[S];var $=u?u+a:a;s=this.$__schema.pathType($);var A=t[a];if(!0!==r||u||null==A||"nested"!==s||null==this._doc[a]||delete this._doc[a],ti.isNonBuiltinObject(A)&&"nested"===s)this.$set($,A,f,Object.assign({},n,{_skipMarkModified:!0})),function(t,e,r){if(null!=t)for(var n=Object.keys(r.$__schema.paths),o=n.length,i=-1===e.indexOf(".")?[e]:e.split("."),s=0;s<o;++s){var a="",u=n[s];if(u.startsWith(e+".")){var c=r.$__schema.paths[u],l=c.splitPath().slice(i.length),f=l.length;if(void 0!==c.defaultValue)for(var p=t,h=0;h<f&&null!=p;++h){var y=l[h];if(h===f-1){if(void 0!==p[y])break;try{var d=c.getDefault(r,!1);void 0!==d&&(p[y]=d)}catch(t){r.invalidate(e+"."+a,t)}break}a+=(a.length?".":"")+y,p[y]=p[y]||{},p=p[y]}}}}(this.$get($),$,this);else if(v){if(f&&void 0===A&&void 0!==this.$get($))continue;if("adhocOrUndefined"===s&&(s=q(this,$,{typeOnly:!0}
1)),"real"===s||"virtual"===s)this.$set($,A,f,n);else if("nested"===s&&A instanceof tS)this.$set($,A.toObject({transform:!1}),f,n);else{if("throw"===v)throw"nested"===s?new E(a,A):new N(a);"nested"===s&&null==A&&this.$set($,A,f,n)}}else this.$set($,A,f,n)}for(var x={},T=Object.keys(this.$__schema.tree),k=0,I=T.length;k<I;++k)(a=T[k])&&this._doc.hasOwnProperty(a)&&(x[a]=void 0);return this._doc=Object.assign(x,this._doc),this}var B=this.$__schema.pathType(t),M=null;if("adhocOrUndefined"===B&&(B=q(this,M=-1===t.indexOf(".")?[t]:t.split("."),{typeOnly:!0})),"adhocOrUndefined"===B&&!b){null==M&&(M=-1===t.indexOf(".")?[t]:t.split("."));var D=z(this.$__schema,M);void 0!==D&&(v=D)}e=K(e,!0);var U,C=null!=o.$__.priorDoc?o.$__.priorDoc.$__getValue(t):f?void 0:o.$__getValue(t);if("nested"===B&&e){if("object"===m(e)&&null!=e){if(null!=e.$__&&(e=e.toObject(X)),null==e)return this.invalidate(t,new j.CastError("Object",e,t)),this;var F=this.$isModified(t),L=null!=this.$__.savedState&&this.$__.savedState.hasOwnProperty(t);if(null!=this.$__.savedState&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(t)){var V=this.$__getValue(t);this.$__.savedState[t]=V;for(var H=0,W=Object.keys(V||{});H<W.length;H++){var G=W[H];this.$__.savedState[t+"."+G]=V[G]}}if(c)return this.$set(e,t,f,n);this.$__setValue(t,null),R(this,t);var Q=J(this.$__schema,e,t);this.$__setValue(t,{});var Y,Z=y(Q);try{for(Z.s();!(Y=Z.n()).done;){var tt=Y.value;this.$set(t+"."+tt,e[tt],f,p(p({},n),{},{_skipMarkModified:!0}))}}catch(t){Z.e(t)}finally{Z.f()}return null!=C&&(!F||L)&&ti.deepEqual(L?this.$__.savedState[t]:C,e)?this.unmarkModified(t):this.markModified(t),this}return this.invalidate(t,new j.CastError("Object",e,t)),this}if(null==M&&(M=-1===t.indexOf(".")?[t]:t.split(".")),"string"==typeof this.$__schema.aliases[M[0]]&&(M[0]=this.$__schema.aliases[M[0]]),"adhocOrUndefined"===B&&v){for(d=0;d<M.length;++d){var te=M.slice(0,d+1).join(".");if(d+1<M.length&&"virtual"===this.$__schema.pathType(te))return tr.set(t,e,this),this;if(null!=(U=this.$__schema.path(te))){if(U instanceof P){tn=!0;break}if(U.$isSchemaMap&&U.$__schemaType instanceof P&&d<M.length-1){tn=!0,U=U.$__schemaType;break}}}if(null==U&&(U=q(this,t)),!tn&&!U){if("throw"===v)throw new N(t);return this}}else{if("virtual"===B)return(U=this.$__schema.virtualpath(t)).applySetters(e,this),this;U=this.$__path(t)}var tn,to,ts=this._doc,ta="";for(d=0;d<M.length-1;++d)ts=ts instanceof Map?ts.get(M[d]):ts[M[d]],ta+=(0!==ta.length?".":"")+M[d],ts||(this.$set(ta,{}),this.$__isSelected(ta)||this.unmarkModified(ta),ts=this.$__getValue(ta));if(M.length<=1)to=t;else{var tu=M.length;for(d=0;d<tu;++d){var tc=M.slice(0,d+1).join(".");if(null===this.$get(tc,null,{getters:!1})){to=tc;break}}to||(to=t)}if(!U)return this.$__set(to,t,n,f,M,U,e,C),"nested"===B&&null==e&&R(this,t),this;if((U.$isSingleNested||U.$isMongooseArray)&&function(t,e){if(t.$__.validationError){for(var r=0,n=Object.keys(t.$__.validationError.errors);r<n.length;r++){var o=n[r];o.startsWith(e+".")&&delete t.$__.validationError.errors[o]}0===Object.keys(t.$__.validationError.errors).length&&(t.$__.validationError=null)}}(this,t),null!=e&&c&&U.$isSingleNested){e instanceof tS&&(e=e.toObject({virtuals:!1,transform:!1}));for(var tl=0,tf=Object.keys(e);tl<tf.length;tl++){var tp=tf[tl];this.$set(t+"."+tp,e[tp],f,n)}return this}var th=!0;try{var ty,td=function(){if(null==U.options||!(e instanceof tS))return!1;var t=e.constructor,r="function"!=typeof U.options.ref||U.options.ref[tb]?U.options.ref:U.options.ref.call(o,o),n=(null==r?void 0:r.modelName)||r;if(null!=n&&(n===t.modelName||n===t.baseModelName))return!0;var i=U.options.refPath;if(null==i)return!1;var s=e.get(i);return s===t.modelName||s===t.baseModelName}(),tv=!1;if(td&&e instanceof tS&&(!e.$__.wasPopulated||ti.deepEqual(e.$__.wasPopulated.value,e._doc._id))){var tg=U&&U.$isSingleNested?U.cast(e,this):e._doc._id;this.$populated(t,tg,h({},tm,e.constructor)),e.$__.wasPopulated={value:tg},tv=!0}var tw=this.$__schema.options.typeKey;if(U.options&&Array.isArray(U.options[tw])&&U.options[tw].length&&U.options[tw][0]&&U.options[tw][0].ref&&function(t,e){if(!Array.isArray(t)||0===t.length)return!1;var r,n=y(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(!(o instanceof tS)||null==o.constructor.modelName||o.constructor.modelName!=e&&o.constructor.baseModelName!=e)return!1}}catch(t){n.e(t)}finally{n.f()}return!0}(e,U.options[tw][0].ref)){ty=h({},tm,e[0].constructor),this.$populated(t,e.map(function(t){return t._doc._id}),ty);var t$,tj=y(e);try{for(tj.s();!(t$=tj.n()).done;){var tP=t$.value;tP.$__.wasPopulated={value:tP._doc._id}}}catch(t){tj.e(t)}finally{tj.f()}tv=!0}if(!td||!U.$isSingleNested||!e.$__){var tE=this;null!=this.$__schema.singleNestedPaths[t]&&M.length>
11&&(tE=t_(this,M,this.schema)),e=null!=n&&n.overwriteImmutable?U.applySetters(e,tE,!1,C,{path:t,overwriteImmutable:!0}):U.applySetters(e,tE,!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 tx=Object.keys(e[0].$__.populated),tT=0;tT<tx.length;tT++)!function(){var r=tx[tT];o.$populated(t+"."+r,e.map(function(t){return t.$populated(r)}),e[0].$__.populated[r].options)}();tv=!0}if(!tv&&this.$__.populated){if(Array.isArray(e)&&this.$__.populated[t])for(var tk=0;tk<e.length;++tk)e[tk]instanceof tS&&e.set(tk,e[tk]._doc._id,!0);delete this.$__.populated[t]}null!=e&&U.$isSingleNested&&function(t,e,r){var n=e.schema;if(null!=n)for(var o=0,i=Object.keys(n.paths);o<i.length;o++){var s=i[o],a=n.paths[s];if(null!=a.$immutableSetter){var u=null==r?void 0:r.$__getValue(s);a.$immutableSetter.call(t,u)}}}(e,U,C),this.$markValid(t)}catch(r){r instanceof j.StrictModeError&&r.isImmutableError?this.invalidate(t,r):r instanceof j.CastError?(this.invalidate(r.path,r),r.$originalErrorPath&&this.invalidate(t,new j.CastError(U.instance,e,t,r.$originalErrorPath))):this.invalidate(t,new j.CastError(U.instance,e,t,r)),th=!1}if(th){var tN,tI=null,tB=null;if(!f){var tM=this.$isSubdocument?this.ownerDocument():this;tI=tM.$__.savedState,tB=this.$isSubdocument?this.$__.fullPath+"."+t:t,tM.$__saveInitialState(tB)}this.$__set(to,t,n,f,M,U,e,C);var tD=!(null==(tN=this.$__.session)||!tN.transaction),tR=this.$__.session&&this.$__.session[tO]&&this.$__.session[tO].has(this)&&this.$__.session[tO].get(this).modifiedPaths&&!this.$__.session[tO].get(this).modifiedPaths.has(tB);null!=tI&&tI.hasOwnProperty(tB)&&(!tD||tR)&&ti.deepEqual(e,tI[tB])&&this.unmarkModified(t)}return U.$isSingleNested&&(this.isDirectModified(t)||null==e)&&R(this,t),this},tS.prototype.set=tS.prototype.$set,tS.prototype.$__shouldModify=function(t,e,r,n,o,i,s,a){return!(r&&r._skipMarkModified||!this.$isNew&&!(e in this.$__.activePaths.getStatePaths("modify"))&&(void 0!==s||this.$__isSelected(e))&&(void 0===s&&e in this.$__.activePaths.getStatePaths("default")||this.$populated(e)&&s instanceof tS&&ta(s._doc._id,a)||ta(s,void 0!==a?a:ti.getValue(e,this))&&(n||null==s||!(e in this.$__.activePaths.getStatePaths("default"))||!ta(s,i.getDefault(this,n)))))},tS.prototype.$__set=function(t,e,n,o,i,s,a,u){_=_||r(6547);var c=this.$__shouldModify(t,e,n,o,i,s,a,u);c?(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[e]&&(delete this.$__.primitiveAtomics[e],0===Object.keys(this.$__.primitiveAtomics).length&&delete this.$__.primitiveAtomics),this.markModified(t),g||(g=r(7557)),a&&ti.isMongooseArray(a)&&(a._registerAtomic("$set",a),ti.isMongooseDocumentArray(a)&&a.forEach(function(t){t&&t.__parentArray&&(t.__parentArray=a)}))):Array.isArray(a)&&Array.isArray(u)&&ti.isMongooseArray(a)&&ti.isMongooseArray(u)&&(a[tl]=u[tl],a[tc]=u[tc],ti.isMongooseDocumentArray(a)&&a.forEach(function(t){null!=t&&(t.$isNew=!1)}));for(var l=this._doc,f=0,p=i.length,h="";f<p;f++){var y=f+1===p;if(h+=h?"."+i[f]:i[f],!tw.has(i[f]))if(y)l instanceof Map?l.set(i[f],a):l.$isSingleNested?(i[f]in l||(l[i[f]]=a),l._doc[i[f]]=a,c&&l.markModified(i[f])):l[i[f]]=a;else{var d=l instanceof Map,b=d?l.get(i[f]):l[i[f]];ti.isPOJO(b)||b&&b instanceof _||b&&!Array.isArray(b)&&b.$isSingleNested||b&&Array.isArray(b)||null==b&&(b={},d?l.set(i[f],b):l[i[f]]=b),l=b}}},tS.prototype.$__getValue=function(t){if("string"!=typeof t&&!Array.isArray(t))throw TypeError('Invalid `path`. Must be either string or array. Got "'.concat(t,'" (type ').concat(m(t),")"));return ti.getValue(t,this._doc)},tS.prototype.$inc=function(t,e){var r=this;if(null==e&&(e=1),Array.isArray(t))return t.forEach(function(t){return r.$inc(t,e)}),this;var n=this.$__path(t);if(null==n){if("throw"===this.$__.strictMode)throw new N(t);if(!0===this.$__.strictMode)return this}else if("Number"!==n.instance)return this.invalidate(t,new j.CastError(n.instance,e,t)),this;var o=this.$__getValue(t)||0,i=!1,s=null,a=e;try{e=n.cast(e),a=(s=n.applySetters(o+e,this))-o,i=!0}catch(r){this.invalidate(t,new j.CastError("number",e,t,r))}return i&&(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},null==this.$__.primitiveAtomics[t]?this.$__.primitiveAtomics[t]={$inc:a}:this.$__.primitiveAtomics[t].$inc+=a,this.markModified(t),this.$__setValue(t,s)),this},tS.prototype.$__setValue=function(t,e){return ti.setValue(t,e,this._doc),this},tS.prototype.get=function(t,e,r){null==r&&(r={}),e&&(n=this.$__schema.interpretAsType(t,e,this.$__schema.options));var n,o=r.noDottedPath,i=o?this.$__schema.paths[t]:this.$__path(t);if(null==i&&null!=(i=this.$__schema.virtualpath(t)))return i.applyGetters(void 0,this);if(o){var s=this._doc[t];return n&&(s=n.cast(s)),null!=i&&!1!==r.getters?i.applyGetters(s,this):s}if(null!=i&&"Mixed"===i.instance){var a=this.$__schema.virtualpath(t);null!=a&&(i=a)}var u=-1!==t.indexOf("."),c=this._doc,l=u?t.split("."):[t];"string"==typeof this.$__schema.aliases[l[0]]&&(l[0]=this.$__schema.aliases[l[0]]);for(var f=0,p=l.length;f<p;f++)c&&c._doc&&(c=c._doc),c=null==c?void 0:c instanceof Map?c.get(l[f],{getters:!1}):f===p-1?ti.getValue(l[f],c):c[l[f]];if(n&&(c=n.cast(c)),null!=i&&!1!==r.getters)c=i.applyGetters(c,this);else if(this.$__schema.nested[t]&&r.virtuals)return tA(this,U(c)||{},{path:t});return c},tS.prototype[td]=tS.prototype.get,tS.prototype.$get=tS.prototype.get,tS.prototype.$__path=function(t){var e=this.$__.adhocPaths;return(e&&e.hasOwnProperty(t)?e[t]:null)||this.$__schema.path(t)},tS.prototype.markModified=function(t,e){this.$__saveInitialState(t),this.$__.activePaths.modify(t),null==e||this.$isSubdocument||(this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[t]=e)},tS.prototype.$__saveInitialState=function(t){var e=this.$__.savedState;if(null!=e){var r=t.indexOf("."),n=-1===r?t:t.slice(0,r);e.hasOwnProperty(n)||(e[n]=U(this.$__getValue(n)))}},tS.prototype.unmarkModified=function(t){this.$__.activePaths.init(t),null!=this.$__.pathsToScopes&&delete this.$__.pathsToScopes[t]},tS.prototype.$ignore=function(t){this.$__.activePaths.ignore(t)}
1,tS.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))},tS.prototype.$isEmpty=function(t){var e={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(0!=arguments.length){var r=this.$get(t);return null==r||"object"===m(r)&&(ti.isPOJO(r)?function t(e){if(null==e)return!0;if("object"!==m(e)||Array.isArray(e))return!1;for(var r=0,n=Object.keys(e);r<n.length;r++)if(!t(e[n[r]]))return!1;return!0}(r):0===Object.keys(r.toObject(e)).length)}return 0===Object.keys(this.toObject(e)).length},tS.prototype.modifiedPaths=function(t){t=t||{};var e=Object.keys(this.$__.activePaths.getStatePaths("modify")),r=new Set,n=0,o=0,i=e.length;for(n=0;n<i;++n){var s=e[n],a=tn(s),u=a.length;for(o=0;o<u;++o)r.add(a[o]);if(t.includeChildren){var c=0,l=this.$get(s);if("object"===m(l)&&null!==l){l._doc&&(l=l._doc);var f=l.length;if(Array.isArray(l))for(c=0;c<f;++c){var p=s+"."+c;if(!r.has(p)&&(r.add(p),null!=l[c]&&l[c].$__)){var h=l[c].modifiedPaths(),y=0,d=h.length;for(y=0;y<d;++y)r.add(p+"."+h[y])}}else{var b=Object.keys(l),v=0,g=b.length;for(v=0;v<g;++v)r.add(s+"."+b[v])}}}}return Array.from(r)},tS.prototype[th]=tS.prototype.modifiedPaths,tS.prototype.isModified=function(t,e,r){var n=this;if(t){var o=e&&e.ignoreAtomics,i=this.$__.activePaths.states.modify;if(null==i)return!1;"string"==typeof t&&(t=-1===t.indexOf(" ")?[t]:t.split(" "));var s,a=y(t);try{for(a.s();!(s=a.n()).done;)if(null!=i[s.value])return!0}catch(t){a.e(t)}finally{a.f()}var u=r||this[th](),c=t.some(function(t){return!!~u.indexOf(t)}),l=Object.keys(i);return o&&(l=l.filter(function(t){var e=n.$__getValue(t);return null==e||null==e[tl]||void 0!==e[tl].$set})),c||t.some(function(t){return l.some(function(e){return e===t||t.startsWith(e+".")})})}return this.$__.activePaths.some("modify")},tS.prototype.$isModified=tS.prototype.isModified,tS.prototype[tp]=tS.prototype.isModified,tS.prototype.$isDefault=function(t){var e=this;if(null==t)return this.$__.activePaths.some("default");if("string"==typeof t&&-1===t.indexOf(" "))return this.$__.activePaths.getStatePaths("default").hasOwnProperty(t);var r=t;return Array.isArray(r)||(r=r.split(" ")),r.some(function(t){return e.$__.activePaths.getStatePaths("default").hasOwnProperty(t)})},tS.prototype.$isDeleted=function(t){return 0==arguments.length?!!this.$__.isDeleted:(this.$__.isDeleted=!!t,this)},tS.prototype.isDirectModified=function(t){var e=this;if(null==t)return this.$__.activePaths.some("modify");if("string"==typeof t&&-1===t.indexOf(" ")){var r=this.$__.activePaths.getStatePaths("modify").hasOwnProperty(t);if(r||-1===t.indexOf("."))return r;for(var n=t.split("."),o=0;o<n.length-1;++o){var i=n.slice(0,o+1).join("."),s=this.$get(i);if(null!=s&&null!=s.$__&&s.isDirectModified(n.slice(o+1).join(".")))return!0}return!1}var a=t;return"string"==typeof a&&(a=a.split(" ")),a.some(function(t){return e.isDirectModified(t)})},tS.prototype.isInit=function(t){var e=this;if(null==t)return this.$__.activePaths.some("init");if("string"==typeof t&&-1===t.indexOf(" "))return this.$__.activePaths.getStatePaths("init").hasOwnProperty(t);var r=t;return Array.isArray(r)||(r=r.split(" ")),r.some(function(t){return e.$__.activePaths.getStatePaths("init").hasOwnProperty(t)})},tS.prototype.isSelected=function(t){var e=this;if(null==this.$__.selected)return!0;if(!t)return!1;if("_id"===t)return 0!==this.$__.selected._id;if(-1!==t.indexOf(" ")&&(t=t.split(" ")),Array.isArray(t))return t.some(function(t){return e.$__isSelected(t)});var r=Object.keys(this.$__.selected),n=null;if(1===r.length&&"_id"===r[0])return 0===this.$__.selected._id;for(var o=0;o<r.length;o++){var i=r[o];if("_id"!==i&&G(this.$__.selected[i])){n=!!this.$__.selected[i];break}}if(null===n)return!0;if(t in this.$__.selected)return n;for(var s=t+".",a=0;a<r.length;a++){var u=r[a];if("_id"!==u){if(u.startsWith(s))return n||u!==s;if(s.startsWith(u+"."))return n}}return!n},tS.prototype.$__isSelected=tS.prototype.isSelected,tS.prototype.isDirectSelected=function(t){var e=this;if(null==this.$__.selected)return!0;if("_id"===t)return 0!==this.$__.selected._id;
1if(-1!==t.indexOf(" ")&&(t=t.split(" ")),Array.isArray(t))return t.some(function(t){return e.isDirectSelected(t)});var r=Object.keys(this.$__.selected),n=null;if(1===r.length&&"_id"===r[0])return 0===this.$__.selected._id;for(var o=0;o<r.length;o++){var i=r[o];if("_id"!==i&&G(this.$__.selected[i])){n=!!this.$__.selected[i];break}}return null===n||(this.$__.selected.hasOwnProperty(t)?n:!n)},tS.prototype.validate=(n=l(a().m(function t(e,r){var n,o,i=this,s=arguments;return a().w(function(t){for(;;)switch(t.n){case 0:if("function"!=typeof e&&"function"!=typeof r&&"function"!=typeof s[2]){t.n=1;break}throw new j("Document.prototype.validate() no longer accepts a callback");case 1:if(this.$op="validate",1===s.length&&("object"!==m(s[0])||Array.isArray(s[0])||(r=s[0],e=null)),r&&"string"==typeof r.pathsToSkip&&(n=-1===r.pathsToSkip.indexOf(" "),r.pathsToSkip=n?[r.pathsToSkip]:r.pathsToSkip.split(" ")),o=r&&r._skipParallelValidateCheck,null==this.$isSubdocument){t.n=2;break}t.n=4;break;case 2:if(!this.$__.validating||o){t.n=3;break}throw new T(this);case 3:o||(this.$__.validating=!0);case 4:return t.a(2,new Promise(function(t,n){i.$__validate(e,r,function(e){if(i.$op=null,i.$__.validating=null,null!=e)return n(e);t()})}))}},t,this)})),function(t,e){return n.apply(this,arguments)}),tS.prototype.$validate=tS.prototype.validate,tS.prototype.$__validate=function(t,e,r){var n,o=this;this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!t?t=s(this.$__.saveOptions.pathsToSave):"function"==typeof t?(r=t,e=null,t=null):"function"==typeof e&&(r=e,e=null);var i,a=e&&"object"===m(e)&&"validateModifiedOnly"in e,u=e&&e.pathsToSkip||null;i=a?!!e.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var c=e&&e.validateAllPaths;if(c){if(u)throw TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(a&&i)throw TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}var l,f,h=this,d=function(){var t=o.$__.validationError;if(o.$__.validationError=null,o.$__.validating=null,i&&null!=t){for(var e=0,r=Object.keys(t.errors);e<r.length;e++){var n=r[e];o.$isModified(n)||delete t.errors[n]}0===Object.keys(t.errors).length&&(t=void 0)}if(o.$__.cachedRequired={},o.$emit("validate",h),o.constructor.emit("validate",h),t){for(var s in t.errors)!o[tf]&&t.errors[s]instanceof j.CastError&&o.invalidate(s,t.errors[s]);return t}};if(c){var b,v=y(l=new Set(Object.keys(this.$__schema.paths)));try{for(v.s();!(b=v.n()).done;){var g=b.value,_=this.$__schema.path(g);if(_&&_.$isMongooseArray){var O=this.$__getValue(g);O&&tP(O,l,g)}}}catch(t){v.e(t)}finally{v.f()}l=s(l),f={}}else{var w=tj(this,t,u,e&&e._nestedValidate);l=i?w[0].filter(function(t){return o.$isModified(t)}):w[0],f=w[1]}if("string"==typeof t&&(t=t.split(" ")),0===l.length)return H(function(){var t=d();if(t)return h.$__schema.s.hooks.execPost("validate:error",h,[h],{error:t},function(t){r(t)});r(null,h)});var S={},$=0,P=null==(n=this.$__.saveOptions)?void 0:n.pathsToSave;if(Array.isArray(P)){P=new Set(P);var A,E=y(l);try{for(E.s();!(A=E.n()).done;){var x=A.value;P.has(x)&&N(x)}}catch(t){E.e(t)}finally{E.f()}}else{var T,k=y(l);try{for(k.s();!(T=k.n()).done;)N(T.value)}catch(t){k.e(t)}finally{k.f()}}function N(t){null==t||S[t]||(S[t]=!0,$++,H(function(){var e=h.$__schema.path(t);if(!e)return--$||B();if(h.$isValid(t)){if(null!=e[tg]&&t!==e.path)return--$||B();var r,n=h.$__getValue(t);(r=h.$populated(t))?n=r:null!=n&&null!=n.$__&&n.$__.wasPopulated&&(n=n._doc._id);var o=null!=h.$__.pathsToScopes&&t in h.$__.pathsToScopes?h.$__.pathsToScopes[t]:h,i=p(p({},f[t]),{},{path:t,validateAllPaths:c,_nestedValidate:!0});e.doValidate(n,function(r){if(r){if((e.$isSingleNested||e.$isArraySubdocument||e.$isMongooseDocumentArray)&&r instanceof I)return--$||B();h.invalidate(t,r,void 0,!0)}--$||B()},o,i)}else--$||B()}))}function B(){var t=d();if(t)return h.$__schema.s.hooks.execPost("validate:error",h,[h],{error:t},function(t){r(t)});r(null,h)}},tS.prototype.validateSync=function(t,e){var r,n=this;1!=arguments.length||"object"!==m(arguments[0])||Array.isArray(arguments[0])||
1(e=arguments[0],t=null),r=e&&"object"===m(e)&&"validateModifiedOnly"in e?!!e.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var o,i,a=e&&e.pathsToSkip,u=e&&e.validateAllPaths;if(u){if(a)throw TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`")}if("string"==typeof t?t=-1===t.indexOf(" ")?[t]:t.split(" "):"string"==typeof a&&-1!==a.indexOf(" ")&&(a=a.split(" ")),u){var c,l=y(o=new Set(Object.keys(this.$__schema.paths)));try{for(l.s();!(c=l.n()).done;){var f=c.value,p=this.$__schema.path(f);if(p&&p.$isMongooseArray){var h=this.$__getValue(f);h&&tP(h,o,f)}}}catch(t){l.e(t)}finally{l.f()}o=s(o),i={}}else{var d=tj(this,t,a);o=r?d[0].filter(function(t){return n.$isModified(t)}):d[0],i=d[1]}for(var b={},v=0,g=o.length;v<g;++v){var _=o[v];if(!b[_]){b[_]=!0;var O=this.$__schema.path(_);if(O&&this.$isValid(_)){var w=this.$__getValue(_),S=O.doValidateSync(w,this,{skipSchemaValidators:i[_],path:_,validateModifiedOnly:r,validateAllPaths:u});if(S){if((O.$isSingleNested||O.$isArraySubdocument||O.$isMongooseDocumentArray)&&S instanceof I)continue;this.invalidate(_,S,void 0,!0)}}}}var $=this.$__.validationError;if(this.$__.validationError=void 0,this.$emit("validate",this),this.constructor.emit("validate",this),$)for(var P in $.errors)$.errors[P]instanceof j.CastError&&this.invalidate(P,$.errors[P]);return $},tS.prototype.invalidate=function(t,e,r,n){if(this.$__.validationError||(this.$__.validationError=new I(this)),!this.$__.validationError.errors[t])return e&&"string"!=typeof e||(e=new B({path:t,message:e,type:n||"user defined",value:r})),this.$__.validationError===e||this.$__.validationError.addError(t,e),this.$__.validationError},tS.prototype.$markValid=function(t){this.$__.validationError&&this.$__.validationError.errors[t]&&(delete this.$__.validationError.errors[t],0===Object.keys(this.$__.validationError.errors).length&&(this.$__.validationError=null))},tS.prototype.$isValid=function(t){var e=this;return null==this.$__.validationError||0===Object.keys(this.$__.validationError.errors).length||null!=t&&(-1!==t.indexOf(" ")&&(t=t.split(" ")),Array.isArray(t)?t.some(function(t){return null==e.$__.validationError.errors[t]}):null==this.$__.validationError.errors[t])},tS.prototype.$__reset=function(){var t,e=this.$isSubdocument?null:this.$getAllSubdocs({useCache:!0});if(e&&e.length>0){var r,n=y(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[tl]&&(e[tc]=e[tl],e[tl]={})}),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},tS.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=y(this.$__dirty());try{for(e.s();!(t=e.n()).done;){var r=t.value.value;r&&r[tl]&&r[tc]&&(r[tl]=r[tc])}}catch(t){e.e(t)}finally{e.f()}if(!this.$isSubdocument){var n,o=y(this.$getAllSubdocs());try{for(o.s();!(n=o.n()).done;)n.value.$__undoReset()}catch(t){o.e(t)}finally{o.f()}}}},tS.prototype.$__dirty=function(){var t=this,e=this.$__.activePaths.map("modify",function(e){return{path:e,value:t.$__getValue(e),schema:t.$__path(e)}}),r=new Map((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)}}))).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=tn(t.path),i=0;i<o.length-1;i++)if(r.has(o[i])){e=r.get(o[i]);break}null==e?n.push(t):null!=e&&null!=e[tl]&&e.hasAtomics()&&(e[tl]={},e[tl].$set=e)}}),n},tS.prototype.$__setSchema=function(t){C(t.tree,this,void 0,t.options);for(var e=0,r=Object.keys(t.virtuals);e<r.length;e++){var n=r[e];t.virtuals[n]._applyDefaultGetters()}null==t.path("schema")&&(this.schema=t),this.$__schema=t,this[ty]=t},tS.prototype.$__getArrayPathsToValidate=function(){return v||(v=r(4878)),this.$__.activePaths.map("init","modify",(function(t){return this.$__getValue(t)}).bind(this)).filter(function(t){return t&&Array.isArray(t)&&ti.isMongooseDocumentArray(t)&&t.length}).reduce(function(t,e){return t.concat(e)},[]).filter(function(t){return t})},tS.prototype.$getAllSubdocs=function(t){if(null!=t&&t.useCache&&null!=(e=this.$__.saveOptions)&&e.__subdocs)return this.$__.saveOptions.__subdocs;v||(v=r(4878)),_=_||r(6547);var e,n=[];return function t(e){var r,o=[],i=y(e.$__schema.childSchemas);try{for(i.s();!(r=i.n()).done;){var s=r.value.model,a=e.$__getValue(s.path);
1if(null!=a){if(a.$__&&o.push(a),Array.isArray(a)){var u,c=y(a);try{for(c.s();!(u=c.n()).done;){var l=u.value;null!=l&&l.$__&&o.push(l)}}catch(t){c.e(t)}finally{c.f()}}if(a instanceof Map){var f,p=y(a.values());try{for(p.s();!(f=p.n()).done;){var h=f.value;null!=h&&h.$__&&o.push(h)}}catch(t){p.e(t)}finally{p.f()}}}}}catch(t){i.e(t)}finally{i.f()}for(var d=0;d<o.length;d++)t(o[d]);n.push.apply(n,o)}(this),this.$__.saveOptions&&(this.$__.saveOptions.__subdocs=n),n},tS.prototype.$__handleReject=function(t){this.$listeners("error").length?this.$emit("error",t):this.constructor.listeners&&this.constructor.listeners("error").length&&this.constructor.emit("error",t)},tS.prototype.$toObject=function(t,e){var r,n,o,i,s,a,u,c,l,f,h,y,d,b,v,g=this.$__schema._defaultToObjectOptions(e),_=this.$__hasOnlyPrimitiveValues();(t=ti.isPOJO(t)?p({},t):{})._calledWithOptions=t._calledWithOptions||p({},t),v=null!=t._calledWithOptions.minimize?t.minimize:null!=(null==(r=this.$__schemaTypeOptions)?void 0:r.minimize)?this.$__schemaTypeOptions.minimize:null!=g&&null!=g.minimize?g.minimize:this.$__schema.options.minimize,t.minimize=v,_||(t._seen=t._seen||new Map);var O=null!=(n=null!=(o=null!=(i=t._calledWithOptions.depopulate)?i:null==g?void 0:g.depopulate)?o:t.depopulate)&&n;if(O&&t._isNested&&this.$__.wasPopulated)return U(this.$__.wasPopulated.value||this._doc._id,t);if(O&&(t.depopulate=!0),null!=g)for(var w=0,S=Object.keys(g);w<S.length;w++){var $=S[w];null==t[$]&&(t[$]=g[$])}t._isNested=!0,t.json=e,t.minimize=v;var j=t._parentOptions;t._parentOptions=this.$isSubdocument?t:null;var P,A=null!=(s=null!=(a=null!=(u=t._calledWithOptions.schemaFieldsOnly)?u:t.schemaFieldsOnly)?a:g.schemaFieldsOnly)&&s;if(_&&!t.flattenObjectIds)P=this.$__toObjectShallow(A);else if(A){P={};for(var E=0,x=Object.keys(this.$__schema.paths);E<x.length;E++){var T=x[E],k=this.$__getValue(T);if(void 0!==k){var N=T,I=P;if(-1!==T.indexOf(".")){var B,M=T.split(".");N=M[M.length-1];for(var D=0;D<M.length-1;++D)I[M[D]]=null!=(B=I[M[D]])?B:{},I=I[M[D]]}I[N]=null!==k?U(k,t):null}}}else P=U(this._doc,t)||{};var R=null!=(c=null!=(l=null!=(f=t._calledWithOptions.getters)?f:t.getters)?l:g.getters)&&c;R&&(function(t,e){var r,n,o=t.$__schema,i=Object.keys(o.paths),s=i.length,a=t._doc;if(a)for(;s--;){var u=(r=i[s]).split("."),c=u.length,l=c-1,f=e,p=void 0;if(a=t._doc,t.$__isSelected(r))for(var h=0;h<c&&(n=a[p=u[h]],null==f||"object"===m(f));++h){if(h===l){if(f[p]=o.paths[r].applyGetters(f[p],t),Array.isArray(f[p])&&o.paths[r].$embeddedSchemaType)for(var y=0;y<f[p].length;++y)f[p][y]=o.paths[r].$embeddedSchemaType.applyGetters(f[p][y],t)}else{if(null==n){p in a&&(f[p]=n);break}f=f[p]||(f[p]={})}a=n}}}(this,P),t.minimize&&(P=te(P)||{}));var C=null!=(h=null!=(y=null!=(d=t._calledWithOptions.virtuals)?d:g.virtuals)?y:null==j?void 0:j.virtuals)?h:void 0;(C||R&&!1!==C)&&tA(this,P,t,t),!1===t.versionKey&&this.$__schema.options.versionKey&&delete P[this.$__schema.options.versionKey];var F=null==(b=t._calledWithOptions.transform)||b,L=void 0;if(!0===F?L=g.transform:"function"==typeof F&&(L=F),F&&function(t,e){var r=t.$__schema,n=Object.keys(r.paths||{});if(t._doc)for(var o=0;o<n.length;o++){var i,s,a,u,c,l=n[o],f=r.paths[l],p=null!=(i=f.options.transform)?i:null==(s=f.constructor)||null==(s=s.defaultOptions)?void 0:s.transform,h=null!=(a=null==(u=f.$embeddedSchemaType)||null==(u=u.options)?void 0:u.transform)?a:null==(c=f.$embeddedSchemaType)||null==(c=c.constructor)||null==(c=c.defaultOptions)?void 0:c.transform;if("function"==typeof p){var y=t.$get(l);if(void 0===y)continue;var d=p.call(t,y);tE(l,d),ti.setValue(l,d,e)}else if("function"==typeof h){var b=t.$get(l);if(void 0===b)continue;for(var m=[].concat(b),v=0;v<m.length;++v){var g=h.call(t,m[v]);m[v]=g,tE(l,g)}e[l]=m}}}(this,P),t.useProjection&&function(t,e){var r=t.$__schema,n=Object.keys(r.paths||{});if(t._doc){var o=t.$__.selected;if(void 0===o&&(o={},to.applyPaths(o,r)),null!=o&&0!==Object.keys(o).length)for(var i=0;i<n.length;i++){var s=n[i];null==o[s]||o[s]||delete e[s]}}}(this,P),"function"==typeof L){var V=L(this,P,t);void 0!==V&&(P=V)}return P}
1,tS.prototype.$__toObjectShallow=function(t){var e={};if(null!=this._doc){var r,n=y(t?Object.keys(this.$__schema.paths):Object.keys(this._doc));try{for(n.s();!(r=n.n()).done;){var o=r.value,i=this._doc[o];i instanceof Date?e[o]=new Date(i):void 0!==i&&(e[o]=i)}}catch(t){n.e(t)}finally{n.f()}}return e},tS.prototype.toObject=function(t){return this.$toObject(t)},tS.prototype.toJSON=function(t){return this.$toObject(t,!0)},tS.prototype.ownerDocument=function(){return this},tS.prototype.parent=function(){return this.$isSubdocument||this.$__.wasPopulated?this.$__.parent:this},tS.prototype.$parent=tS.prototype.parent,tS.prototype.inspect=function(t){ti.isPOJO(t)&&((e=t).minimize=!1);var e,r=arguments.length>0?this.toObject(e):this.toObject();return null==r?"MongooseDocument { "+r+" }":r},Z.custom&&(tS.prototype[Z.custom]=tS.prototype.inspect),tS.prototype.toString=function(){var t=this.inspect();return"string"==typeof t?t:Z(t)},tS.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:ta(this,t)},tS.prototype.populate=(o=l(a().m(function t(){var e,r,n,o,i,s,u,c,l,f=arguments;return a().w(function(t){for(;;)switch(t.n){case 0:if(e={},"function"!=typeof(r=Array.prototype.slice.call(f))[r.length-1]){t.n=1;break}throw new j("Document.prototype.populate() no longer accepts a callback");case 1:if(0!==r.length){n=y(ti.populate.apply(null,r));try{for(n.s();!(o=n.n()).done;)e[(i=o.value).path]=i}catch(t){n.e(t)}finally{n.f()}}return s=ti.object.vals(e),u=this.constructor,this.$__isNested&&(u=this.$__[tv].constructor,c=this.$__.nestedPath,s.forEach(function(t){t.path=c+"."+t.path})),null!=this.$session()&&(l=this.$session(),s.forEach(function(t){null!=t.options?"session"in t.options||(t.options.session=l):t.options={session:l}})),s.forEach(function(t){t._localModel=u}),t.a(2,u.populate(this,s))}},t,this)})),function(){return o.apply(this,arguments)}),tS.prototype.$getPopulatedDocs=function(){var t=[];null!=this.$__.populated&&(t=t.concat(Object.keys(this.$__.populated)));var e,r=[],n=y(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 tS&&r.push(i)}}catch(t){n.e(t)}finally{n.f()}return r},tS.prototype.populated=function(t,e,r){if(null==e||!0===e){if(!this.$__.populated||"string"!=typeof t)return;var n=t.endsWith(".$*")?t.replace(/\.\$\*$/,""):t,o=this.$__.populated[n];return o?!0===e?o:o.value:void 0}this.$__.populated||(this.$__.populated={}),this.$__.populated[t]={value:e,options:r};for(var i=t.split("."),s=0;s<i.length-1;++s){var a=i.slice(0,s+1).join("."),u=this.$get(a);if(null!=u&&null!=u.$__&&this.$populated(a)){var c=i.slice(s+1).join(".");u.$populated(c,e,r);break}}return e},tS.prototype.$populated=tS.prototype.populated,tS.prototype.$assertPopulated=function(t,e){var r=this;if(Array.isArray(t))return t.forEach(function(t){return r.$assertPopulated(t,e)}),this;if(arguments.length>1&&this.$set(e),!this.$populated(t))throw new j('Expected path "'.concat(t,'" to be populated'));return this},tS.prototype.depopulate=function(t){"string"==typeof t&&(t=-1===t.indexOf(" ")?[t]:t.split(" "));var e=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],r=this.$__&&this.$__.populated||{};if(0==arguments.length){var n,o,i=y(e);try{for(i.s();!(o=i.n()).done;){var s=o.value;delete this.$$populatedVirtuals[s],delete this._doc[s],delete r[s]}}catch(t){i.e(t)}finally{i.f()}for(var a=0,u=Object.keys(r);a<u.length;a++){var c=u[a];if(n=this.$populated(c))if(delete r[c],Array.isArray(n)){var l=ti.getValue(c,this._doc);if(l.isMongooseArray)for(var f=l.__array,p=0;p<f.length;++p){var h=f[p];null!=h&&(f[p]=h instanceof tS?h._doc._id:h._id)}else ti.setValue(c,n,this._doc)}else ti.setValue(c,n,this._doc)}return this}var d,b=y(t);try{for(b.s();!(d=b.n()).done;){var m=d.value;if(n=this.$populated(m),delete r[m],-1!==e.indexOf(m))delete this.$$populatedVirtuals[m],delete this._doc[m];else if(n)if(Array.isArray(n)){var v=ti.getValue(m,this._doc);if(v.isMongooseArray)for(var g=v.__array,_=0;_<g.length;++_){var O=g[_];null!=O&&(g[_]=O instanceof tS?O._doc._id:O._id)}else ti.setValue(m,n,this._doc)}else ti.setValue(m,n,this._doc)}}catch(t){b.e(t)}finally{b.f()}return this},tS.prototype.$__fullPath=function(t){return t||""},tS.prototype.getChanges=function(){var t=this.$__delta();return t?t[1]:{}},tS.prototype.$__delta=function(){var t=this,e=this.$__dirty(),r=this.$__schema.options.optimisticConcurrency;
1if(r)if(Array.isArray(r)){var n=new Set(r);this.modifiedPaths().find(function(t){return n.has(t)})&&(this.$__.version=e.length?3:1)}else this.$__.version=e.length?3:1;if(e.length||3===this.$__.version){var o={},s={},a=e.length,u=[],c=0;for(o._id=this._doc._id,null!=(o&&o._id&&o._id.$__||null)&&(o._id=o._id.toObject({transform:!1,depopulate:!0}));c<a;++c){var l=e[c],f=l.value,p=function(t,e,r){var n=t.$populated(e,!0);if(!n&&t.$__.selected){var o=e.split(".")[0];if(t.$__.selected[o+".$"])return o}if(n&&ti.isMongooseArray(r)&&(n.options.match||n.options.options&&ti.object.hasOwnProperty(n.options.options,"limit")||n.options.options&&n.options.options.skip||n.options.select&&(0===n.options.select._id||/\s?-_id\s?/.test(n.options.select)))){var i=r[tl];if(0===Object.keys(i).length||i.$set||i.$pop)return e}}(this,l.path,f);if(p)u.push(p);else{if(!this.$populated(l.path,!0)&&this.$__.selected){var h=l.path.split("."),y=h[0];if(this.$__.selected[y]&&this.$__.selected[y].$elemMatch){if(!(h.length>1&&0==h[1]&&void 0===o[y])){u.push(l.path);continue}o[y]=this.$__.selected[y],h[1]="$",l.path=h.join(".")}}if(this.$isDefault(l.path)&&this.$__.selected&&(-1===l.path.indexOf(".")&&Y(this.$__.selected,l.path)||tn(l.path).find(function(e){return Y(t.$__.isSelected,e)})))continue;if(!u.length)if(void 0===f)tx(this,0,s,l,1,"$unset");else if(null===f)tx(this,0,s,l,null);else if(ti.isMongooseArray(f)&&f.$path()&&f[tl])!function(t,e,r,n){if(!e.$set||!e.$set[r.path])if("function"!=typeof n.$__getAtomics){var o,i,s=n[tl],a=Object.keys(s),u=a.length;if(0===u)return ti.isMongooseObject(n)?n=n.toObject({depopulate:1,_isNested:!0}):n.valueOf&&(n=n.valueOf()),tx(t,0,e,r,n);for(;u--;)o=s[i=a[u]],ti.isMongooseObject(o)?o=o.toObject({depopulate:!0,transform:!1,_isNested:!0}):Array.isArray(o)?o=o.map(c):o.valueOf&&(o=o.valueOf()),"$addToSet"===i&&(o={$each:o}),tx(t,0,e,r,o,i)}else n.$__getAtomics().forEach(function(n){var o=n[0];tx(t,0,e,r,n[1],o)});function c(t){return ti.isMongooseObject(t)?t.toObject({depopulate:1,_isNested:!0}):t}}(this,s,l,f);else if(f[$.pathSymbol]&&i.isBuffer(f))tx(this,0,s,l,f=f.toObject());else if(this.$__.primitiveAtomics&&null!=this.$__.primitiveAtomics[l.path]){var d=this.$__.primitiveAtomics[l.path],b=L(d);tx(this,0,s,l,d[b],b)}else tx(this,0,s,l,f=U(f,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}))}}return u.length?new O(u):(this.$__.version&&this.$__version(o,s),0===Object.keys(s).length?[o,null]:[o,s])}},tS.prototype.$clone=function(){var t=new(0,this.constructor);if(t.$isNew=this.$isNew,this._doc&&(t._doc=U(this._doc,{retainDocuments:!0})),this.$__){var e,r=new(0,this.$__.constructor),n=y(Object.getOwnPropertyNames(this.$__));try{for(n.s();!(e=n.n()).done;){var o=e.value;"activePaths"!==o&&(r[o]=U(this.$__[o]))}}catch(t){n.e(t)}finally{n.f()}Object.assign(r.activePaths,U(p({},this.$__.activePaths))),t.$__=r}return t},tS.prototype.$createModifiedPathsSnapshot=function(){var t=new WeakMap;if(!this.$isSubdocument){var e,r=y(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 A(t,this.$__.activePaths.clone(),this.$__.version)},tS.prototype.$restoreModifiedPathsSnapshot=function(t){if(this.$__.activePaths=t.activePaths.clone(),this.$__.version=t.version,!this.$isSubdocument){var e,r=y(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},tS.prototype.$clearModifiedPaths=function(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){var t,e=y(this.$getAllSubdocs());try{for(e.s();!(t=e.n()).done;)t.value.$clearModifiedPaths()}catch(t){e.e(t)}finally{e.f()}}return this},tS.prototype.$__hasOnlyPrimitiveValues=function(){return!this.$__.populated&&!this.$__.wasPopulated&&(null==this._doc||Object.values(this._doc).every(function(t){return null==t||"object"!==m(t)||ti.isNativeObject(t)&&!Array.isArray(t)||W(t,"ObjectId")||W(t,"Decimal128")}))},tS.VERSION_WHERE=1,tS.VERSION_INC=2,tS.VERSION_ALL=3,tS.ValidationError=I,t.exports=tS},2401:t=>{"use strict";
1t.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})(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)})(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}var O=!1,w=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=Array(t),r=0;r<t;r++)e[r]=arguments[r];j.apply(void 0,[P,e.length].concat(e))}w.fail=function t(e,r,n,o,i){var s,a=arguments.length;if(0===a?s="Failed":1===a?(n=e,e=void 0):(!1===O&&(O=!0,(({env:{}}).emitWarning?({env:{}}).emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===a&&(o="!=")),n instanceof Error)throw n;var u={actual:e,expected:r,operator:void 0===o?"fail":o,stackStartFn:i||t};void 0!==n&&(u.message=n);var c=new h(u);throw s&&(c.message=s,c.generatedMessage=!0),c},w.AssertionError=h,w.ok=P,w.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&$({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},w.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&$({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},w.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),i(e,r)||$({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},w.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),i(e,r)&&$({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},w.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),s(e,r)||$({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},w.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===i&&_(),s(e,r)&&$({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},w.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");g(e,r)||$({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},w.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");g(e,r)&&$({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var A=function t(e,r,n){var o=this;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t),r.forEach(function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&m(e[t])&&e[t].test(n[t])?o[t]=n[t]:o[t]=e[t])})};function E(t,e,r,n){if("function"!=typeof e){if(m(e))return e.test(t);if(2==arguments.length)throw new c("expected",["Function","RegExp"],e);if("object"!==o(t)||null===t){var a=new h({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw a.operator=n.name,a}var u=Object.keys(e);if(e instanceof Error)u.push("name","message");else if(0===u.length)throw new l("error",e,"may not be an empty object");return void 0===i&&_(),u.forEach(function(o){"string"==typeof t[o]&&m(e[o])&&e[o].test(t[o])||function(t,e,r,n,o,i){if(!(r in t)||!s(t[r],e[r])){if(!n){var a=new h({actual:new A(t,o),expected:new A(e,o,t),operator:"deepStrictEqual",stackStartFn:i});throw a.actual=t,a.expected=e,a.operator=i.name,a}$({actual:t,expected:e,message:n,operator:i.name,stackStartFn:i})}}(t,e,o,r,u,n)}),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function x(t){if("function"!=typeof t)throw new c("fn","Function",t);try{t()}catch(t){return t}return S}function T(t){return b(t)||null!==t&&"object"===o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function k(t){return Promise.resolve().then(function(){var e;if("function"==typeof t){if(!T(e=t()))throw new f("instance of Promise","promiseFn",e)}else{if(!T(t))throw new c("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then(function(){return e}).then(function(){return S}).catch(function(t){return t})})}function N(t,e,r,n){if("string"==typeof r){if(4==arguments.length)throw new c("error",["Object","Error","Function","RegExp"],r);if("object"===o(e)&&null!==e){if(e.message===r)throw new u("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new u("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new c("error",["Object","Error","Function","RegExp"],r);if(e===S){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===t.name?"rejection":"exception";$({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:t})}if(r&&!E(e,r,n,t))throw e}function I(t,e,r,n){if(e!==S){if("string"==typeof r&&(n=r,r=void 0),!r||E(e,r)){var o=n?": ".concat(n):".",i="doesNotReject"===t.name?"rejection":"exception";$({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(i).c
1oncat(o,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function B(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];j.apply(void 0,[B,e.length].concat(e))}w.throws=function t(e){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];N.apply(void 0,[t,x(e)].concat(n))},w.rejects=function t(e){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return k(e).then(function(e){return N.apply(void 0,[t,e].concat(n))})},w.doesNotThrow=function t(e){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];I.apply(void 0,[t,x(e)].concat(n))},w.doesNotReject=function t(e){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return k(e).then(function(e){return I.apply(void 0,[t,e].concat(n))})},w.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===o(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=y(e);var n=new h({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),i=e.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),u=0;u<s.length;u++){var c=a.indexOf(s[u]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},w.strict=v(B,w,{equal:w.strictEqual,deepEqual:w.deepStrictEqual,notEqual:w.notStrictEqual,notDeepEqual:w.notDeepStrictEqual}),w.strict.strict=w.strict},2403:t=>{"use strict";t.exports="u">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){var e;return null==t||""===t?null:t instanceof Date?(n.ok(!isNaN(t.valueOf())),t):(n.ok("boolean"!=typeof t),isNaN((e=new Date(t instanceof Number||"number"==typeof t?t:"string"==typeof t&&!isNaN(Number(t))&&(Number(t)>=275761||-271820>Number(t))?Number(t):"function"==typeof t.valueOf?t.valueOf():t)).valueOf())?void n.ok(!1):e)}},2481:(t,e,r)=>{"use strict";var n=r(4756);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2486:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=256*i+t[e+f],f+=p,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=c}return(h?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=5960464477539062e-23*(23===o),h=n?0:i-1,y=n?1:-1,d=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[r+h]=255&a,h+=y,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+h]=255&s,h+=y,s/=256,c-=8);t[r+h-y]|=128*d}},2497:(t,e,r)=>{"use strict";var n=r(1243).isMongooseArray;t.exports=function(t){return null!=t&&(n(t)||null!=t.$__||t.isMongooseBuffer||t.$isMongooseMap)}},2555:t=>{"use strict";t.exports=function(t){if(Array.isArray(t)){if(!t.every(function(t){return"number"==typeof t||"string"==typeof t}))throw Error("$type array values must be strings or numbers");return t}if("number"!=typeof t&&"string"!=typeof t)throw 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";
1t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},2692:t=>{"use strict";t.exports=function(t,e){if(1!==e.length){for(var r=e[0],n=void 0,o=0;o<e.length-1;++o){var i=t.path(r);i&&i.schema?(n=i.schema.options.strict,t=i.schema,r=i.$isMongooseDocumentArray&&!isNaN(e[o+1])?"":e[o+1]):r+=r.length?"."+e[o+1]:e[o+1]}return n}}},2696:(t,e,r)=>{"use strict";var n=r(3305);t.exports=function(t,e){return"string"==typeof t&&"string"==typeof e||"number"==typeof t&&"number"==typeof e?t===e:!(!n(t,"ObjectId")||!n(e,"ObjectId"))&&t.toString()===e.toString()}},2724:(t,e,r)=>{"use strict";var n=r(3071),o=r(9344),i=n("RegExp.prototype.exec"),s=r(2268);t.exports=function(t){if(!o(t))throw new s("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},2746:t=>{"use strict";t.exports=function(t){return setTimeout(t,0)}},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})(t)}t.exports=function(t){if(null==t||"object"!==e(t))return!1;var r=Object.getPrototypeOf(t);return!r||"Object"===r.constructor.name}},2793:t=>{"use strict";t.exports=new Set(["__proto__","constructor","prototype"])},2822:(t,e,r)=>{"use strict";t.exports=r(6353).Double},2824:(t,e,r)=>{"use strict";var n=r(7930).objectIdSymbol,o=r(8768);function i(){var t,e;if(this.$__.shardval){e=(t=Object.keys(this.$__.shardval)).length,this.$where=this.$where||{};for(var r=0;r<e;++r)this.$where[t[r]]=this.$__.shardval[t[r]]}}function s(){var t=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(o.isPOJO(t))for(var e,r=this.$__.shardval={},i=Object.keys(t),s=i.length,a=0;a<s;++a)null==(e=this.$__getValue(i[a]))?r[i[a]]=e:o.isMongooseObject(e)?r[i[a]]=e.toObject({depopulate:!0,_isNested:!0}):e instanceof Date||e[n]?r[i[a]]=e:"function"==typeof e.valueOf?r[i[a]]=e.valueOf():r[i[a]]=e}t.exports=function(t){t.post("init",function(){return s.call(this),this}),t.pre("save",function(t){i.call(this),t()}),t.pre("remove",function(t){i.call(this),t()}),t.post("save",function(){s.call(this)})},t.exports.storeShard=s},2900:(t,e,r)=>{"use strict";var n=r(8260);t.exports=function(t){if("TopologyDescription"!==n(t))return!1;var e=Array.from(t.servers.values());return e.length>0&&e.every(function(t){return"Unknown"===t.type})}},2914:(t,e,r)=>{function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(7860),i=["__proto__","constructor","prototype"];function s(t){return t}e.get=function(t,r,i,a){"function"==typeof i&&(i.length<2?a=i:c=i,i=void 0),a||(a=s);var u="string"==typeof t?o(t):t;if(!Array.isArray(u))throw TypeError("Invalid `path`. Must be either string or array");for(var c,l,f=r,p=0;p<u.length;++p){if(l=u[p],"string"!=typeof u[p]&&"number"!=typeof u[p])throw TypeError("Each segment of path to `get()` must be a string or number, got "+n(u[p]));if(Array.isArray(f)&&!/^\d+$/.test(l)){var h=u.slice(p);return[].concat(f).map(function(t){return t?e.get(h,t,i||c,a):a(void 0)})}if(c)f=c(f,l);else{var y=i&&f[i]?f[i]:f;f=y instanceof Map?y.get(l):y[l]}if(!f)break}return a(f)},e.has=function(t,e){var r="string"==typeof t?o(t):t;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");for(var i=r.length,s=e,a=0;a<i;++a){if("string"!=typeof r[a]&&"number"!=typeof r[a])throw TypeError("Each segment of path to `has()` must be a string or number, got "+n(r[a]));if(null==s||"object"!==n(s)||!(r[a]in s))return!1;s=s[r[a]]}return!0},e.unset=function(t,e){var r="string"==typeof t?o(t):t;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");for(var s=r.length,a=e,u=0;u<s;++u){if(null==a||"object"!==n(a)||!(r[u]in a))return!1;if("string"!=typeof r[u]&&"number"!=typeof r[u])throw TypeError("Eac
1h segment of path to `unset()` must be a string or number, got "+n(r[u]));if(-1!==i.indexOf(r[u]))return!1;if(u===s-1)return delete a[r[u]],!0;a=a instanceof Map?a.get(r[u]):a[r[u]]}return!0},e.set=function(t,r,a,u,c,l){"function"==typeof u&&(u.length<2?c=u:h=u,u=void 0),c||(c=s);var f="string"==typeof t?o(t):t;if(!Array.isArray(f))throw TypeError("Invalid `path`. Must be either string or array");if(null!=a){for(var p=0;p<f.length;++p){if("string"!=typeof f[p]&&"number"!=typeof f[p])throw TypeError("Each segment of path to `set()` must be a string or number, got "+n(f[p]));if(-1!==i.indexOf(f[p]))return}for(var h,y,d=l||/\$/.test(t)&&!1!==l,b=a,m=(p=0,f.length-1);p<m;++p)if("$"!=(y=f[p])){if(Array.isArray(b)&&!/^\d+$/.test(y)){var v=f.slice(p);if(!d&&Array.isArray(r))for(var g=0;g<b.length&&g<r.length;++g)e.set(v,r[g],b[g],u||h,c,d);else for(g=0;g<b.length;++g)e.set(v,r,b[g],u||h,c,d);return}if(h)b=h(b,y);else{var _=u&&b[u]?b[u]:b;b=_ instanceof Map?_.get(y):_[y]}if(!b)return}else if(p==m-1)break;if(y=f[m],u&&b[u]&&(b=b[u]),Array.isArray(b)&&!/^\d+$/.test(y))if(!d&&Array.isArray(r))!function t(e,r,n,o,i,s){for(var a,u=0;u<e.length&&u<r.length;++u)Array.isArray(a=e[u])&&Array.isArray(r[u])?t(a,r[u],n,o,i,s):a&&(o?o(a,n,s(r[u])):(a[i]&&(a=a[i]),a[n]=s(r[u])))}(b,r,y,h,u,c);else for(g=0;g<b.length;++g){var O=b[g];O&&(h?h(O,y,c(r)):(O[u]&&(O=O[u]),O[y]=c(r)))}else h?h(b,y,c(r)):b instanceof Map?b.set(y,c(r)):b[y]=c(r)}},e.stringToParts=o},2945:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEac
1h(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var s,a=r(4625),u=r(6426),c=r(863),l=r(4327),f=r(8260),p=r(5549),h=r(3305),y=r(8768),d=u.CastError;function b(t,e){var r="string"==typeof t&&24===t.length&&/^[a-f0-9]+$/i.test(t),n=e&&e.suppressWarning;!r&&void 0!==t||n||y.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."),u.call(this,t,e,"ObjectId")}function m(t){return this.cast(t)}function v(){return new p}function g(t){return s||(s=r(2400)),this instanceof s&&void 0===t?new p:t}b.schemaName="ObjectId",b.defaultOptions={},b.prototype=Object.create(u.prototype),b.prototype.constructor=b,b.prototype.OptionsConstructor=a,b.get=u.get,b.set=u.set,b.setters=[],b.prototype.auto=function(t){return t&&(this.default(v),this.set(g)),this},b._checkRequired=function(t){return h(t,"ObjectId")},b._cast=c,b.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},b._defaultCaster=function(t){if(!h(t,"ObjectId"))throw Error(t+" is not an instance of ObjectId");return t},b.checkRequired=u.checkRequired,b.prototype.checkRequired=function(t,e){return u._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():b.checkRequired())(t)},b.prototype.cast=function(t,e,r,n,o){var i;if(!h(t,"ObjectId")&&u._isRef(this,t,e,r)){if("objectid"===(f(t)||"").toLowerCase())return new p(t.toHexString());if(null==t||y.isNonBuiltinObject(t))return this._castRef(t,e,r,o)}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("ObjectId",t,this.path,e,this)}},b.prototype.$conditionalHandlers=i(i({},u.prototype.$conditionalHandlers),{},{$gt:m,$gte:m,$lt:m,$lte:m}),v.$runBeforeSetters=!0,b.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required||"_id"===this.path;return l("string","objectId",null==t?void 0:t.useBsonType,e)},b.prototype.autoEncryptionType=function(){return"objectId"},t.exports=b},3123:t=>{"use strict";t.exports=Function.prototype.call},3191:(t,e,r)=>{"use strict";var n=r(988),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3216:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==i(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t){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})(t)}var s=r(8768),a=new Set(["__index","__parentArray","_doc"]);t.exports=function(t,e){if(s.isPOJO(t)&&null!=t.$__&&null!=t._doc){if(e){for(var r={},n=0,u=Object.keys(t);n<u.length;n++){var c=u[n];"symbol"!==i(c)&&"$"!==c[0]&&(a.has(c)||(r[c]=t[c]))}return o(o({},t._doc),r)}return t._doc}return t}},3279:t=>{"use strict";t.exports=Function.prototype.apply},3303:(t,e)=>{"use strict";e._={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1,versionKey:!0,flattenObjectIds:!1}},3305:t=>{"use strict";
1t.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})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var s=r(3609),a=r(6426),u=r(4058),c=r(4327);function l(t,e){a.call(this,t,e,"BigInt")}function f(t,e){return this.castForQuery(null,t,e)}l.schemaName="BigInt",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._checkRequired=function(t){return null!=t},l.checkRequired=a.checkRequired,l.prototype.checkRequired=function(t){return this.constructor._checkRequired(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("BigInt",t,this.path,e,this)}},l.$conditionalHandlers=i(i({},a.prototype.$conditionalHandlers),{},{$gt:f,$gte:f,$lt:f,$lte:f}),l.prototype.castForQuery=function(t,e,r){var n;if(null!=t)return(n=l.$conditionalHandlers[t])?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(t){throw t instanceof s&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},l.prototype._castNullish=function(t){return void 0===t||("function"==typeof this.constructor.cast?this.constructor.cast():l.cast()),t},l.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return c("string","long",null==t?void 0:t.useBsonType,e)},l.prototype.autoEncryptionType=function(){return"long"},t.exports=l},3381:t=>{"use strict";function e(){return null!=this._id?this._id.toString():null}t.exports=function(t){return!t.paths.id&&t.paths._id&&t.options.id&&(t.aliases&&t.aliases.id||t.virtual("id").get(e)),t}},3388:t=>{"use strict";t.exports="u">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="u"<typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof o[n[e]]&&(t[t.length]=n[e]);return t}},3441:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t,r){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");var s,a,u,c=Array.isArray(r)?"array":"primitive value";return(s=e,a=["Tried to set nested object field `"+t+"` to ".concat(c," `")+r+"`"],s=i(s),u=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(s,a||[],i(this).constructor):s.apply(this,a))).path=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(t)}var r,n="object"===("u"<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"==typeof t.on&&b(t,"error",o,{once:!0})})},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 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;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 a=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,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=Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):d(o,o.length)}function y(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(t,e){for(var r=Array(e),n=0;n<e;++n)r[n]=t[n];return r}function b(t,r,n,o){if("function"==typeof t.on)o.once?t.once(r,n):t.on(r,n);else{if("function"!=typeof t.addEventListener)throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+e(t));t.addEventListener(r,function e(i){o.once&&t.removeEventListener(r,e),n(i)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
1,set:function(t){if("number"!=typeof t||t<0||i(t))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var s,a=Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=d(u,c);for(r=0;r<c;++r)o(l[r],this,e)}return!0},s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return u(e),this.on(t,p(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,p(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,o,i,s;if(u(e),void 0===(n=this._events)||void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0==arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return h(this,t,!0)},s.prototype.rawListeners=function(t){return h(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},s.prototype.listenerCount=y,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},3609:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,r){return e=a(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return i(t)}(t,s()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}function i(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var c=r(8213),l=r(7352),f=function(t){var e;function r(t,e,n,s,a){var u;if(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,r),arguments.length>0){var c=h(e);(u=o(this,r,[d(null,t,e,n,y(a),c,s)])).init(t,e,n,s,a)}else u=o(this,r,[d()]);return i(u)}return function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(r,t),e=[{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=p(e),this.messageFormat=y(o),this.kind=t,this.value=e,this.path=r,this.reason=n,this.valueType=h(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=d(t,this.kind,this.value,this.path,this.messageFormat,this.valueType)}}],function(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(o.key),o)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}(c);function p(t){var e=l.inspect(t);return(e=e.replace(/^'|'$/g,'"')).startsWith('"')||(e='"'+e+'"'),e}function h(t){if(null==t)return""+t;var e=n(t);return"object"!==e||"function"!=typeof t.constructor?e:t.constructor.name}function y(t){var e=t&&t._castErrorMessage||null;if("string"==typeof e||"function"==typeof e)return e}function d(t,e,r,n,o,i,s){if("string"==typeof o){var a=p(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 "+p(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(f.prototype,"name",{value:"CastError"}),t.exports=f},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})(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)||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})(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}
1function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t){var r,s;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),r=e,s=["Cannot overwrite `"+t+"` model once compiled."],r=i(r),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(r,s||[],i(this).constructor):r.apply(this,s))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8213));Object.defineProperty(a.prototype,"name",{value:"OverwriteModelError"}),t.exports=a},3660:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==i(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t){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})(t)}var s=r(3672),a=r(1007),u=r(6426),c=r(7768),l=r(4327),f=r(9460),p=r(8768),h=u.CastError;function y(t,e){u.call(this,t,e,"Number")}function d(t){return this.cast(t)}y.get=u.get,y.set=u.set,y.setters=[],y._cast=c,y.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},y._defaultCaster=function(t){if("number"!=typeof t)throw Error();return t},y.schemaName="Number",y.defaultOptions={},y.prototype=Object.create(u.prototype),y.prototype.constructor=y,y.prototype.OptionsConstructor=a,y._checkRequired=function(t){return"number"==typeof t||t instanceof Number},y.checkRequired=u.checkRequired,y.prototype.checkRequired=function(t,e){return"object"===i(t)&&u._isRef(this,t,e,!0)?null!=t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():y.checkRequired())(t)},y.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.minValidator},this)),null!=t){var r=e||s.messages.Number.min;r=r.replace(/{MIN}/,t),this.validators.push({validator:this.minValidator=function(e){return null==e||e>=t},message:r,type:"min",min:t})}return this},y.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||s.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},y.prototype.enum=function(t,e){return this.enumValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.enumValidator},this)),Array.isArray(t)||(p.isPOJO(t)&&null!=t.values?(e=t.message,t=t.values):"number"==typeof t&&(t=Array.prototype.slice.call(arguments),e=null),p.isPOJO(t)&&(t=Object.values(t)),e=e||s.messages.Number.enum),e=null==e?s.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},y.prototype.cast=function(t,e,r,n,o){if("number"!=typeof t&&u._isRef(this,t,e,r)&&(null==t||p.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():y.cast();try{return i(s)}catch(t){throw new h("Number",s,this.path,t,this)}},y.prototype.$conditionalHandlers=o(o({},u.prototype.$conditionalHandlers),{},{$bitsAllClear:f,$bitsAnyClear:f,$bitsAllSet:f,$bitsAnySet:f,$gt:d,$gte:d,$lt:d,$lte:d,$mod:function(t){var e=this;return Array.isArray(t)?t.map(function(t){return e.cast(t)}):[this.cast(t)]}}),y.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw new h("number",e,this.path,null,this);return n.call(this,e,r)}try{e=this.applySetters(e,r)}catch(t){throw t instanceof h&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}return e},y.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required||"_id"===this.path;return l("number","number",null==t?void 0:t.useBsonType,e)},t.exports=y},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
1),n.MongooseServerSelectionError=r(7219),n.DivergentArrayError=r(1417),n.StrictModeError=r(8995),n.StrictPopulateError=r(6801)},3696:t=>{"use strict";t.exports=function(t,e){return null==t?null:"boolean"==typeof t?e:"boolean"==typeof t[e]?t[e]?e:null:e in t?t[e]:e}},3703:t=>{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function r(t,e){return null==t?t:t instanceof Map?t.get(e):t[e]}t.exports=function(t,n,o){var i,s=!1;if("string"==typeof n){if(-1===n.indexOf(".")){var a=r(t,n);return null==a?o:a}i=n.split(".")}else if(s=!0,1===(i=n).length){var u=r(t,i[0]);return null==u?o:u}var c,l=n,f=t,p=function(t){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return e(t,void 0);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)?e(t,void 0):void 0}}(t))){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 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}}}}(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})(t)}var o=r(2402),i=r(6353),s=r(3305);t.exports=function(t){if(null==t||""===t)return null;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 e,r,a=null!=(r=t.valueOf())?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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(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)})(t)}
1function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(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,c;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,n),(u=(c=i(n).call(this,"string"==typeof e?e:e(r,s,a)))&&("object"===o(c)||"function"==typeof c)?c:function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this)).code=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw 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){if(void 0===a&&(a=r(2402)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&"not "===e.substr(0,4)?(i="must not be",e=e.replace(/^not /,"")):i="must be",(void 0===c||c>t.length)&&(c=t.length)," argument"===t.substring(c-9,c))s="The ".concat(t," ").concat(i," ").concat(f(e,"type"));else{var i,s,u,c,l=("number"!=typeof u&&(u=0),u+1>t.length||-1===t.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(l," ").concat(i," ").concat(f(e,"type"))}return s+". 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=Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===a&&(a=r(2402)),a(e.length>0,"At least one arg needs to be specified");var o="The ",i=e.length;switch(e=e.map(function(t){return'"'.concat(t,'"')}),i){case 1:o+="".concat(e[0]," argument");break;case 2:o+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:o+=e.slice(0,i-1).join(", "),o+=", and ".concat(e[i-1]," arguments")}return"".concat(o," must be specified")}
1,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){var s;if(!n(e))throw TypeError("iterator must be a function");arguments.length>=3&&(s=r),"[object Array]"===o.call(t)?function(t,e,r){for(var n=0,o=t.length;n<o;n++)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s):"string"==typeof t?function(t,e,r){for(var n=0,o=t.length;n<o;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,s):function(t,e,r){for(var n in t)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s)}},3892:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return i(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(t,void 0):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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var u=r(6948),c=r(3916),l=r(3703),f=r(1058),p=r(7300),h=r(4450),y=r(6665);e.preparePopulationOptionsMQ=function(t,e){var r,n=t._mongooseOptions.populate,o=Object.keys(n).reduce(function(t,e){return t.concat([n[e]])},[]);null!=e.lean&&o.filter(function(t){return null==(t&&t.options&&t.options.lean)}).forEach((r=e.lean,function(t){t.options||(t.options={}),null!=r&&Array.isArray(r.virtuals)&&((r=Object.assign({},r)).virtuals=r.virtuals.filter(function(e){return"string"==typeof e&&e.startsWith(t.path+".")}).map(function(e){return e.slice(t.path.length+1)})),t.options.lean=r}));var i=t&&t.options&&t.options.session||null;null!=i&&o.forEach(function(t){null!=t.options?"session"in t.options||(t.options.session=i):t.options={session:i}});for(var s=t._fieldsForExec(),c=0;c<o.length;++c)o[c]instanceof u?o[c]=new u(a(a({},o[c]),{},{_queryProjection:s,_localModel:t.model})):(o[c]._queryProjection=s,o[c]._localModel=t.model);return o},e.createModel=function(t,r,n,o,i){t.hooks.execPreSync("createModel",r);var s=t.schema?t.schema.discriminatorMapping:null,a=s&&s.isRoot?s.key:null,u=r[a];if(a&&u&&t.discriminators){var c=t.discriminators[u]||f(t.discriminators,u);if(c){var l=h(o);return e.applyPaths(l,c.schema),new c(void 0,l,!0)}}var p={skipId:!0,isNew:!1,willInit:!0};return null!=i&&"defaults"in i&&(p.defaults=i.defaults),new t(void 0,n,p)},e.createModelAndInit=function(t,r,n,o,i,s,a){var u=e.createModel(t,r,n,o,i);try{u.$init(r,s?{populated:s}:void 0,a)}catch(t){a(t,u)}},e.applyPaths=function(t,e,r){var i,s,a=new Set;if(t){s=Object.keys(t);for(var u=[],f=0;f<s.length;++f){var h=s[f];"-"===s[f][0]&&(delete t[h],"-_id"===h?t._id=0:u.push(h.slice(1)))}s=Object.keys(t);for(var d=0;d<s.length;++d)if("+"!==s[d][0]){var b=t[s[d]];if(p(b)&&!("_id"===s[d]&&s.length>1)&&(!(s[d]===e.options.discriminatorKey&&s.length>1&&null!=b)||b)){i=!b;break}}for(var m=0;m<u.length;m++){var v=u[m],g=e.path(v);g&&g.selected&&!1===i?g&&g.selected&&!1===i&&a.add(v):(t[v]=0,i=!0)}}var _=[],O=[],w=[];switch(function e(r,n){if(n||(n=""),-1!==w.indexOf(r))return[];w.push(r);var o=[];return r.eachPath(function(r,s){if(n&&(r=n+"."+r),s.$isSchemaMap||r.endsWith(".$*")){var a=t&&"+"+r in t;
1s.options&&!1===s.options.select&&!a&&O.push(r)}else{var u=B(r,s);if(null!=u||Array.isArray(s)||!s.$isMongooseArray||s.$isMongooseDocumentArray||(u=B(r,s.caster)),null!=u&&o.push(u),s.schema){var l=e(s.schema,r);!1===i&&c(t,r,s.schema,_,l)}}}),w.pop(),o}(e),i){case!0:var S,$=o(O);try{for($.s();!(S=$.n()).done;)t[S.value]=0}catch(t){$.e(t)}finally{$.f()}break;case!1:e&&e.paths._id&&e.paths._id.options&&!1===e.paths._id.options.select&&(t._id=0);var j,P=o(_);try{for(P.s();!(j=P.n()).done;){var A=j.value;a.has(A)||y(t,A)||(t[A]=t[A]||1)}}catch(t){P.e(t)}finally{P.f()}break;case void 0:if(null==t)break;for(var E=0,x=Object.keys(t||{});E<x.length;E++){var T=x[E];T.startsWith("+")&&delete t[T]}var k,N=o(O);try{for(N.s();!(k=N.n()).done;){var I=k.value;null==t[I]&&(t[I]=0)}}catch(t){N.e(t)}finally{N.f()}}function B(o,a){if(null!=t&&"boolean"==typeof a.selected)if(!1===a.selected&&t[o])r&&(t[o]=0);else if(i||!a.selected||o!==e.options.discriminatorKey||null==t[o]||t[o]){if(!1!==i||!a.selected||null==t[o]||t[o]){var u="+"+o;if(t&&u in t)return delete t[u],void(!1===i&&s.length>1&&!~s.indexOf(o)&&!r?t[o]=1:null==i&&r&&!1===a.selected&&(t[o]=0));for(var c=o.split("."),f="",p=0;p<c.length;++p)if(f+=f.length?"."+c[p]:c[p],-1!==O.indexOf(f))return;if(!i&&a&&a.options&&a.options.$skipDiscriminatorCheck)for(var h="",y=0;y<c.length;++y){var d=l(t,h+=(0===h.length?"":".")+c[y],!1)||l(t,h+".$",!1);if(d&&"object"!==n(d))return}return(a.selected?_:O).push(o),o}delete t[o]}else delete t[o]}}},3900:(t,e,r)=>{"use strict";var n=r(6400),o=r(6750),i=r(3191)(),s=r(1464),a=r(2268),u=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>0xffffffff||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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t){var r,s;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),r=e,s=["Can't save() the same doc multiple times in parallel. Document: "+t._doc._id],r=i(r),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(r,s||[],i(this).constructor):r.apply(this,s))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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 Error("Can't populate individual element in an array");for(var h="",y=t,d=0;d<p.length;d+=2){var b=p[d];if(!y.startsWith(b+".")){if(d===p.length-1){h+=y,y="";break}throw Error("Could not normalize ref path, chunk "+b+" not in populated path")}h+=y.substring(0,b.length)+p[d+1],y=y.substring(b.length+1)}var m=s.get(h,e,i),v=Array.isArray(m)?m:[m];return u.array.flatten(v)}var g=s.get(t,e,i);return null!=l&&l.virtuals.hasOwnProperty(t)?[l.virtuals[t].applyGetters(void 0,e)]:Array.isArray(g)?g:[g]}},4026:(t,e)=>{"use strict";e.Collection=function(){throw Error("Cannot create a collection from browser library")},e.Connection=function(){throw Error("Cannot create a connection from browser library")},e.BulkWriteResult=function(){}},4058:(t,e,r)=>{"use strict";var n=r(6353).Long,o=-0x8000000000000000n,i="Mongoose only supports BigInts between ".concat(o," and ").concat(0x7fffffffffffffffn," 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>0x7fffffffffffffffn||t<o)throw Error(i);return t}if(t instanceof n)return t.toBigInt();if("string"==typeof t||"number"==typeof t){if((t=BigInt(t))>0x7fffffffffffffffn||t<o)throw Error(i);return t}throw Error('Cannot convert value to BigInt: "'.concat(t,'"'))}},4070:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var o=r(8260);t.exports=function(t){if("TopologyDescription"!==o(t)||0===t.servers.size)return!1;var e,r=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return n(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,void 0):void 0}}(t))){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw 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(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,i=t}
1,f:function(){try{s||null==e.return||e.return()}finally{if(a)throw i}}}}(t.servers.values());try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!1===i.host.endsWith(".mongodb.net")||27017!==i.port)return!1}}catch(t){r.e(t)}finally{r.f()}return!0}},4183:(t,e,r)=>{"use strict";var n=r(118);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},4224:(t,e,r)=>{"use strict";var n=r(6511).ctor("require","modify","init","default","ignore");function o(){this.activePaths=new n}t.exports=o,o.prototype.strictMode=!0,o.prototype.fullPath=void 0,o.prototype.selected=void 0,o.prototype.shardval=void 0,o.prototype.saveError=void 0,o.prototype.validationError=void 0,o.prototype.adhocPaths=void 0,o.prototype.removing=void 0,o.prototype.inserting=void 0,o.prototype.saving=void 0,o.prototype.version=void 0,o.prototype._id=void 0,o.prototype.ownerDocument=void 0,o.prototype.populate=void 0,o.prototype.populated=void 0,o.prototype.primitiveAtomics=void 0,o.prototype.wasPopulated=!1,o.prototype.scope=void 0,o.prototype.session=null,o.prototype.pathsToScopes=null,o.prototype.cachedRequired=null},4301:(t,e,r)=>{"use strict";var n=r(9539),o=r(2793),i=r(3305),s=r(5549),a=r(608);t.exports=function t(e,r,u,c){var l,f=Object.keys(r),p=0,h=f.length;if(u=u||"",!(c=c||new WeakSet).has(r)){for(c.add(r);p<h;)if(l=f[p++],(u||"discriminators"!==l&&"base"!==l&&"_applyDiscriminators"!==l&&"_userProvidedOptions"!==l&&"options"!==l&&"tree"!==l)&&!("tree"===u&&null!=r&&r.instanceOfSchema||o.has(l))){if(null==e[l])e[l]=r[l];else if(a(r[l])){if(a(e[l])||(e[l]={}),null!=r[l]){if(r[l].$isSingleNested&&e[l].$isMongooseDocumentArray||r[l].$isMongooseDocumentArray&&e[l].$isSingleNested||r[l].$isMongooseDocumentArrayElement&&e[l].$isMongooseDocumentArrayElement)continue;if(r[l].instanceOfSchema){e[l].instanceOfSchema?n(e[l],r[l].clone(),!0):e[l]=r[l].clone();continue}if(i(r[l],"ObjectId")){e[l]=new s(r[l]);continue}}t(e[l],r[l],u?u+"."+l:l,c)}}null!=r&&r.instanceOfSchema&&(e.tree=Object.assign({},r.tree,e.tree))}}},4327:t=>{"use strict";t.exports=function(t,e,r,n){return r?n?{bsonType:e}:{bsonType:[e,"null"]}:n?{type:t}:{type:[t,"null"]}}},4432:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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 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=Object.create((n&&n.prototype instanceof c?n:c).prototype);return s(a,"_invoke",function(r,n,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(r,n){for(s=r,a=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,s=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,y),s=l,a=y;(e=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),a}var u={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=f.prototype=c.prototype=Object.create([][n]?e(e([][n]())):(s(e={},n,function(){return this}),e));function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,s(p,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(p),s(p,o,"Generator"),s(p,n,function(){return this}),s(p,"toString",function(){return"[object Generator]"}),(i=function(){return{w:a,m:h}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}(s=function(t,e,r,n){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{var i=function(e,r){s(t,e,function(t){return this._invoke(e,r,t)})};i("next",0),i("throw",1),i("return",2)}})(t,e,r,n)}function a(t,e){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return u(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(t,void 0):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 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}
1,f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function s(t){c(i,n,o,s,a,"next",t)}function a(t){c(i,n,o,s,a,"throw",t)}s(void 0)})}}var f=r(5782);t.exports=function(t){var e,r;t.s.hooks.pre("save",!1,function(t){if(this.$isSubdocument)t();else{var e=this,r=this.$getAllSubdocs({useCache:!0});r.length?f(r,function(t,e){t.$__schema.s.hooks.execPre("save",t,function(t){e(t)})},function(r){if(e.$__.saveOptions&&(e.$__.saveOptions.__subdocs=null),r)return e.$__schema.s.hooks.execPost("save:error",e,[e],{error:r},function(e){t(e)});t()}):t()}},null,!0),t.s.hooks.post("save",(e=l(i().m(function t(){var e,r,n,s,u,c;return i().w(function(t){for(;;)switch(t.n){case 0:if((e=this.$__.removedSubdocs)&&e.length){t.n=1;break}return t.a(2);case 1:r=[],n=a(e),t.p=2,u=i().m(function t(){var e;return i().w(function(t){for(;;)switch(t.n){case 0:e=s.value,r.push(new Promise(function(t,r){e.$__schema.s.hooks.execPost("deleteOne",e,[e],function(e){if(e)return r(e);t()})}));case 1:return t.a(2)}},t)}),n.s();case 3:if((s=n.n()).done){t.n=5;break}return t.d(o(u()),4);case 4:t.n=3;break;case 5:t.n=7;break;case 6:t.p=6,c=t.v,n.e(c);case 7:return t.p=7,n.f(),t.f(7);case 8:return this.$__.removedSubdocs=null,t.n=9,Promise.all(r);case 9:return t.a(2)}},t,this,[[2,6,7,8]])})),function(){return e.apply(this,arguments)})),t.s.hooks.post("save",(r=l(i().m(function t(){var e,r,n,s,u,c,l,f,p=this;return i().w(function(t){for(;;)switch(t.n){case 0:if(!this.$isSubdocument){t.n=1;break}return t.a(2);case 1:if(e=this,(r=this.$getAllSubdocs({useCache:!0})).length){t.n=2;break}return t.a(2);case 2:n=[],s=a(r),t.p=3,c=i().m(function t(){var e;return i().w(function(t){for(;;)switch(t.n){case 0:e=u.value,n.push(new Promise(function(t,r){e.$__schema.s.hooks.execPost("save",e,[e],function(e){if(e)return r(e);t()})}));case 1:return t.a(2)}},t)}),s.s();case 4:if((u=s.n()).done){t.n=6;break}return t.d(o(c()),5);case 5:t.n=4;break;case 6:t.n=8;break;case 7:t.p=7,l=t.v,s.e(l);case 8:return t.p=8,s.f(),t.f(8);case 9:return t.p=9,t.n=10,Promise.all(n);case 10:t.n=12;break;case 11:return t.p=11,f=t.v,t.n=12,new Promise(function(t,r){p.$__schema.s.hooks.execPost("save:error",e,[e],{error:f},function(e){if(e)return r(e);t()})});case 12:return t.a(2)}},t,this,[[9,11],[3,7,8,9]])})),function(){return r.apply(this,arguments)}),null,!0)}},4450:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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=Array(n);for(r=0;r<n;++r)o[r]=b(t[r],e,!0);return o}(l(t)?t.__array:t,e);if(a(t)){if(e&&e.retainDocuments&&null!=t.$__){var s=t.$clone();return null!=t.__index&&(s.__index=t.__index),null!=t.__parentArray&&(s.__parentArray=t.__parentArray),s.$__parent=t.$__parent,s}return p(t)&&null!=t.$__&&null!=t._doc?t._doc:e&&e.json&&"function"==typeof t.toJSON?t.toJSON(e):t.toObject(e)}var y,v=t.constructor;if(v)switch(u(v)){case"Object":return m(t,e,r);case"Date":return new v(+t);case"RegExp":return(y=new RegExp(t.source,t.flags)).lastIndex!==t.lastIndex&&(y.lastIndex=t.lastIndex),y}return c(t,"ObjectId")?e&&e.flattenObjectIds?t.toJSON():new i(t.id):c(t,"Decimal128")?e&&e.flattenDecimals?t.toJSON():o.fromString(t.toString()):!v&&f(t)?m(t,e,r):"object"===n(t)&&t[h.schemaTypeSymbol]?t.clone():e&&e.bson&&"function"==typeof t.toBSON?t:"function"==typeof t.valueOf?t.valueOf():m(t,e,r)}function m(t,e,r){var n,o=e&&e.minimize,i=e&&e.omitUndefined,a=e&&e._seen,u={};if(a&&a.has(t))return a.get(t);a&&a.set(t,u),y in t&&!1!==(null==e?void 0:e.copyTrustedSymbol)&&(u[y]=t[y]);for(var c=Object.keys(t),l=c.length,f=0;f<l;++f){var p=c[f];if(!s.has(p)){var h=b(t[p],e,!1);(!1===o||i)&&void 0===h?delete u[p]:!0===o&&void 0===h||(n||(n=!0),u[p]=h)}}return o&&!r?n&&u:u}t.exports=b},4473:t=>{"use strict";
1t.exports=function(t,e,r){var n=(r=r||{}).skipDocArrays,o=0;if(!t)return o;for(var i=0,s=Object.keys(t.$__.activePaths.getStatePaths("modify"));i<s.length;i++){var a=s[i];if(n){var u=t.$__schema.path(a);if(u&&u.$isMongooseDocumentArray)continue}a.startsWith(e+".")&&(t.$__.activePaths.clearPath(a),++o,t.$isSubdocument&&function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(n.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");var o=e.$parent(),i=e.$__pathRelativeToParent(void 0,!1)+"."+r;o.$__.activePaths.clearPath(i),o.$isSubdocument&&t(o,i,n)}(t,a))}return o}},4561:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}
1function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return i(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(t,void 0):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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var s=r(8920),a=r(2400),u=r(863),c=r(1058),l=r(3303)._,f=r(8768),p=r(3305),h=r(7930).arrayParentSymbol,y=r(7930).arrayPathSymbol,d=r(7930).arraySchemaSymbol,b=r(7930).documentArrayParent,m=Array.prototype.toString,v={toBSON:function(){return this.toObject(l)},toString:function(){return m.call(this.__array.map(function(t){return null!=t&&null!=t.$__?t.toString():t}))},getArrayParent:function(){return this[h]},_cast:function(t,e,r){if(null==this[d])return t;var o=this[d].casterConstructor;if((o.$isMongooseDocumentArray?f.isMongooseDocumentArray(t):t instanceof o)||t&&t.constructor&&t.constructor.baseCasterConstructor===o)return t[b]&&t.__parentArray||(t[b]=this[h],t.__parentArray=this),t.$setIndex(e),t;if(null==t)return null;if((n.isBuffer(t)||p(t,"ObjectId")||!f.isObject(t))&&(t={_id:t}),t&&o.discriminators&&o.schema&&o.schema.options&&o.schema.options.discriminatorKey)if("string"==typeof t[o.schema.options.discriminatorKey]&&o.discriminators[t[o.schema.options.discriminatorKey]])o=o.discriminators[t[o.schema.options.discriminatorKey]];else{var i=c(o.discriminators,t[o.schema.options.discriminatorKey]);i&&(o=i)}if(o.$isMongooseDocumentArray)return o.cast(t,this,void 0,void 0,e);var s=new o(t,this,r,void 0,e);return s.isNew=!0,s},id:function(t){try{e=u(t).toString()}catch(t){e=null}var e,r,n,i,s=o(this);try{for(s.s();!(i=s.n()).done;){var c=i.value;if(c&&null!=(n=c.get("_id"))){if(n instanceof a){if(r||(r=String(t)),r==n._id)return c}else if(p(t,"ObjectId")||p(n,"ObjectId")){if(e==n)return c}else if(t==n||f.deepEqual(t,n))return c}}}catch(t){s.e(t)}finally{s.f()}return null},toObject:function(t){return[].concat(this.map(function(e){return null==e?null:"function"!=typeof e.toObject?e:e.toObject(t)}))},$toObject:function(){return this.constructor.prototype.toObject.apply(this,arguments)},push:function(){var t=s.push.apply(this,arguments);return g(this),t},pull:function(){var t=s.pull.apply(this,arguments);return g(this),t},shift:function(){var t=s.shift.apply(this,arguments);return g(this),t},splice:function(){var t=s.splice.apply(this,arguments);return g(this),t},inspect:function(){return this.toObject()},create:function(t){var e=this[d].casterConstructor;if(t&&e.discriminators&&e.schema&&e.schema.options&&e.schema.options.discriminatorKey)if("string"==typeof t[e.schema.options.discriminatorKey]&&e.discriminators[t[e.schema.options.discriminatorKey]])e=e.discriminators[t[e.schema.options.discriminatorKey]];else{var r=c(e.discriminators,t[e.schema.options.discriminatorKey]);r&&(e=r)}return new e(t,this)},notify:function(t){var e=this;return function r(n,o){for(var i=(o=o||e).length;i--;)null!=o[i]&&("save"===t&&(n=e[i]),f.isMongooseArray(o[i])?r(n,o[i]):o[i]&&o[i].emit(t,n))}},set:function(t,e,r){var n=this.__array;if(r)return n[t]=e,this;var o=v._cast.call(this,e,t);return v._markModified.call(this,t),n[t]=o,this},_markModified:function(t,e){var r,n=this[h];if(n){if(r=this[y],arguments.length&&(r=null!=e?r+"."+t.__index+"."+e:r+"."+t),null!=r&&r.endsWith(".$"))return this;n.markModified(r,0!=arguments.length?t:n)}return this}};function g(t){var e=t[h];if(e&&null!=e.$__.populated){var r,n=o(Object.keys(e.$__.populated).filter(function(e){return e.startsWith(t[y]+".")}));try{for(n.s();!(r=n.n()).done;)!function(){var n=r.value,o=n.slice((t[y]+".").length);Array.isArray(e.$__.populated[n].value)&&(e.$__.populated[n].value=t.map(function(t){return t.$populated(o)}))}()}catch(t){n.e(t)}finally{n.f()}}}t.exports=v},4878:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,r){var o;return(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")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);
1null!=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})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var s=r(7160),a=r(5268);t.exports=c,c.middlewareFunctions=["deleteOne","save","validate","remove","updateOne","init"];var u=new Set(c.middlewareFunctions.flatMap(function(t){return[t,"$__".concat(t)]}));function c(t,e,r){var n={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},o=(r=r||{}).decorateDoc?t:t.prototype;t.$appliedHooks=!0;for(var l=0,f=Object.keys(e.paths);l<f.length;l++){var p=f[l],h=e.paths[p],y=null;if(h.$isSingleNested)y=h.caster;else{if(!h.$isMongooseDocumentArray)continue;y=h.Constructor}if(!y.$appliedHooks&&(c(y,h.schema,i(i({},r),{},{isChildSchema:!0})),null!=y.discriminators))for(var d=0,b=Object.keys(y.discriminators);d<b.length;d++){var m=b[d];c(y.discriminators[m],y.discriminators[m].schema,r)}}var v=e.s.hooks.filter(function(t){return"updateOne"===t.name||"deleteOne"===t.name?!!t.document:"remove"===t.name||"init"===t.name?null==t.document||!!t.document:null==t.query&&null==t.document||!1!==t.document}).filter(function(t){return!e.methods[t.name]||!t.fn[s.builtInMiddleware]});t._middleware=v,o.$__originalValidate=o.$__originalValidate||o.$__validate;for(var g=0,_=r&&r.isChildSchema?["save","validate","deleteOne"]:["save","validate"];g<_.length;g++){var O=_[g],w="validate"===O?"$__originalValidate":"$__".concat(O),S=v.createWrapper(O,o[w],null,n);o["$__".concat(O)]=S}o.$__init=v.createWrapperSync("init",o.$__init,null,n);for(var $=Object.keys(e.methods),j=Object.assign({},n,{checkForPromise:!0}),P=0;P<$.length;P++)!function(){var e=$[P];if(!u.has(e)&&v.hasHooks(e)){var r=o[e];o[e]=function(){var r=this,n=Array.prototype.slice.call(arguments),o=n.slice(-1).pop(),i="function"==typeof o?n.slice(0,n.length-1):n;return a(o,function(t){return r["$__".concat(e)].apply(r,i.concat([t]))},t.events)},o["$__".concat(e)]=v.createWrapper(e,r,null,j)}}()}},5022:(t,e,r)=>{"use strict";var n=r(6426),o=r(7160),i=r(608),s=r(8768);function a(t,e){if(e&&e.default){var r=e.default;Array.isArray(r)&&0===r.length?e.default=Array:!e.shared&&i(r)&&0===Object.keys(r).length&&(e.default=function(){return{}})}n.call(this,t,e,"Mixed"),this[o.schemaMixedSymbol]=!0}a.schemaName="Mixed",a.defaultOptions={},a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.get=n.get,a.set=n.set,a.setters=[],a.prototype.cast=function(t){return t instanceof Error?s.errorToPOJO(t):t},a.prototype.castForQuery=function(t,e){return e},t.exports=a},5098:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
1e%2?n(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==i(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t){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})(t)}var s,a=r(3609),u=r(3550).EventEmitter,c=r(3441),l=r(7494),f=r(6426),p=r(5335),h=r(8499),y=r(5558).G,d=r(4327),b=r(1469),m=r(9604),v=r(7910),g=r(1313),_=r(3303)._,O=r(1793),w=r(8768),S=r(5537);function $(t,e,r){if(t.options.timeseries)throw new S(e,"timeseries");var n=$.defaultOptions&&$.defaultOptions._id;null!=n&&((r=r||{})._id=n),t=g(t,r),this.caster=j(t,null,r),this.caster.path=e,this.caster.prototype.$basePath=e,this.schema=t,this.$isSingleNested=!0,this.base=t.base,f.call(this,e,r,"Embedded")}function j(t,e,n){s||(s=r(9380));var o=function(t,e,r){this.$__parent=r,s.apply(this,arguments),null!=r&&this.$session(r.$session())};t._preCompile();var i=null!=e?e.prototype:s.prototype;for(var a in(o.prototype=Object.create(i)).$__setSchema(t),o.prototype.constructor=o,o.prototype.$__schemaTypeOptions=n,o.$__required=null==n?void 0:n.required,o.base=t.base,o.schema=t,o.$isSingleNested=!0,o.events=new u,o.prototype.toBSON=function(){return this.toObject(_)},t.methods)o.prototype[a]=t.methods[a];for(var c in t.statics)o[c]=t.statics[c];for(var l in u.prototype)o[l]=u.prototype[l];return o}t.exports=$,$.prototype=Object.create(f.prototype),$.prototype.constructor=$,$.prototype.OptionsConstructor=l,$.prototype.$conditionalHandlers.$geoWithin=function(t,e){return{$geometry:this.castForQuery(null,t.$geometry,e)}},$.prototype.$conditionalHandlers.$near=$.prototype.$conditionalHandlers.$nearSphere=m.cast$near,$.prototype.$conditionalHandlers.$within=$.prototype.$conditionalHandlers.$geoWithin=m.cast$within,$.prototype.$conditionalHandlers.$geoIntersects=m.cast$geoIntersects,$.prototype.$conditionalHandlers.$minDistance=y,$.prototype.$conditionalHandlers.$maxDistance=y,$.prototype.$conditionalHandlers.$exists=h,$.prototype.cast=function(t,e,r,n,o){if(t&&t.$isSingleNested&&t.parent===e)return t;if(null!=t&&("object"!==i(t)||Array.isArray(t)))throw new c(this.path,t);var s,a=this.schema.path(this.schema.options.discriminatorKey),u=null==a?null:a.getDefault(e),l=v(this.caster,t,u),f=e&&e.$__&&e.$__.selected,h=this.path,y=null==f?null:Object.keys(f).reduce(function(t,e){return e.startsWith(h+".")&&((t=t||{})[e.substring(h.length+1)]=f[e]),t},null);if(!r)return o=Object.assign({},o,{priorDoc:n}),0===Object.keys(t).length?new l({},y,e,void 0,o):new l(t,y,e,void 0,o);delete(s=new l(void 0,y,e,!1,{defaults:!1})).$__.defaults,s.$init(t);var d=O(y);return p(s,y,d),s},$.prototype.castForQuery=function(t,e,r,n){if(null!=t){if(!(o=this.$conditionalHandlers[t]))throw Error("Can't use "+t);return o.call(this,e)}if(null==e)return e;var o,i=v(this.caster,e);if(e instanceof i)return e;this.options.runSetters&&(e=this._applySetters(e,r));var s=null!=n&&null!=n.strict?n.strict:void 0;try{e=new i(e,s)}catch(t){if(!(t instanceof a))throw new a("Embedded",e,this.path,t,this);throw t}return e},$.prototype.doValidate=function(t,e,r,n){var o=v(this.caster,t);if(!t||t instanceof o||(t=new o(t,null,null!=r&&null!=r.$__?r:null)),n&&n.skipSchemaValidators)return t?t.validate().then(function(){return e(null)},function(t){return e(t)}):e(null);f.prototype.doValidate.call(this,t,function(r){return r?e(r):t?void t.validate().then(function(){return e(null)},function(t){return e(t)}):e(null)},r,n)},$.prototype.doValidateSync=function(t,e,r){if(!r||!r.skipSchemaValidators){var n=f.prototype.doValidateSync.call(this,t,e);if(n)return n}if(t)return t.validateSync()},$.prototype.discriminator=function(t,e,r){r=r||{};var n=w.isPOJO(r)?r.value:r,o="boolean"!=typeof r.clone||r.clone;return e.instanceOfSchema&&o&&(e=e.clone()),e=b(this.caster,t,e,n,null,null,r.overwriteExisting),this.caster.discriminators[t]=j(e,this.caster),this.caster.discriminators[t]},$.defaultOptions={},$.set=f.set,$.setters=[],$.get=f.get,$.prototype.toJSON=function(){return{path:this.path,options:this.options}},$.prototype.clone=function(){var t=new this.constructor(this.schema,this.path,o(o({},this.options),{},{_skipApplyDiscriminators:!0}));return t.validators=this.validators.slice(),void 0!==this.requiredValidator&&(t.requiredValidator=this.requiredValidator),t.caster.discriminators=Object.assign({},this.caster.discriminators),t._appliedDiscriminators=this._appliedDiscriminators,t},$.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return o(o({},this.schema.toJSONSchema(t)),d("object","object",null==t?void 0:t.useBsonType,e))}},5110:t=>{"use strict";var e=new Set(["$ref","$id","$db"]);t.exports=function(t){return"$"===t[0]&&!e.has(t)}},5152:(t,e,r)=>{"use strict";var n=r(3703),o=r(7425);t.exports=function t(e,r,i){for(var s=(i=i||{}).typeOnly,a=Array.isArray(r)?r:-1===r.indexOf(".")?[r]:r.split("."),u=null,c="adhocOrUndefined",l=o(e.schema,e.get(e.schema.options.discriminatorKey))||e.schema,f=0;f<a.length;++f){var p=a.slice(0,f+1).join(".");if(null!=(u=l.path(p))){if("Mixed"===u.instance)return s?"real":u;if(c=l.pathType(p),(u.$isSingleNested||u.$isMongooseDocumentArrayElement)&&null!=u.schema.discriminators){var h=u.schema.discriminators,y=e.get(p+"."+n(u,"schema.options.discriminatorKey"));if(null==y||null==h[y])continue;var d=a.slice(f+1).join(".");return t(e.get(p),d,i)}}else c="adhocOrUndefined"}return s?c:u}},5188:(t,e,r)=>{"use strict";var n=r(7300);t.exports=function(t,e){if(null==t)return!1;if("_id"===e)return 0===t._id;for(var r=null,o=0,i=Object.keys(t);o<i.length;o++)if(n(t[i[o]])){r=1===t[e]?"inclusive":"exclusive";break}return"inclusive"===r?1!==t[e]:"exclusive"===r&&0===t[e]}},5268:(t,e,r)=>{"use strict";var n=r(2746),o=Symbol("mongoose#emitted");
1t.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(t){return n(function(){throw t})}}})}catch(e){return null!=i&&null!=i.listeners&&i.listeners("error").length>0&&!e[o]&&(e[o]=!0,i.emit("error",e)),t(e)}return new(s=s||r.g.Promise)(function(t,r){e(function(e,n){return null!=e?(null!=i&&null!=i.listeners&&i.listeners("error").length>0&&!e[o]&&(e[o]=!0,i.emit("error",e)),r(e)):arguments.length>2?t(Array.prototype.slice.call(arguments,1)):void t(n)})})}},5289:t=>{"use strict";t.exports=function(t){switch(t){case"p":t="primary";break;case"pp":t="primaryPreferred";break;case"s":t="secondary";break;case"sp":t="secondaryPreferred";break;case"n":t="nearest"}return t}},5335:(t,e,r)=>{"use strict";var n=r(1091);function o(t,e,r){t.$__.activePaths.default(e),!r&&t.$isSubdocument&&t.$isSingleNested&&null!=t.$parent()&&t.$parent().$__.activePaths.default(t.$__pathRelativeToParent(e))}t.exports=function(t,e,r,i,s,a,u){for(var c=Object.keys(t.$__schema.paths),l=c.length,f=u&&u.skipParentChangeTracking,p=0;p<l;++p){var h=void 0,y="",d=c[p];if("_id"!==d||!t.$__.skipId){var b=t.$__schema.paths[d],m=b.splitPath(),v=m.length;if("$*"!==m[v-1])for(var g=!1,_=t._doc,O=0;O<v&&null!=_;++O){var w=m[O];if(y+=(y.length?".":"")+w,!0===r){if(y in e)break}else if(!1===r&&e&&!g){var S=b.$isSingleNested||b.$isMongooseDocumentArray;
1if(y in e&&!n(e[y])||O===v-1&&S&&null!=i&&i[y])g=!0;else if(null!=i&&!i[y])break}if(O===v-1){if(void 0!==_[w])break;if(null!=s){if("function"==typeof b.defaultValue){if(!b.defaultValue.$runBeforeSetters&&s||b.defaultValue.$runBeforeSetters&&!s)break}else if(!s)continue}if(a&&a[y])break;if(e&&null!==r){if(!0===r){if(d in e)continue;try{h=b.getDefault(t,!1)}catch(e){t.invalidate(d,e);break}void 0!==h&&(_[w]=h,o(t,d,f))}else if(g){try{h=b.getDefault(t,!1)}catch(e){t.invalidate(d,e);break}void 0!==h&&(_[w]=h,o(t,d,f))}}else{try{h=b.getDefault(t,!1)}catch(e){t.invalidate(d,e);break}void 0!==h&&(_[w]=h,o(t,d,f))}}else _=_[w]}}}}},5346:t=>{"use strict";t.exports=function(t,e,r){for(var n=e[0],o=r,i=t,s=0;s<e.length-1;++s){var a=o.path(n);if(a&&a.schema){var u=i.get(n);if(o=a.schema,n=e[s+1],Array.isArray(u)&&!isNaN(n)&&(u=u[n],n=""),null==u)break;i=u}else n+=n.length?"."+e[s+1]:e[s+1]}return i}},5413:(t,e,r)=>{"use strict";var n=r(3305),o=r(2402);t.exports=function(t){if(null==t)return t;if(""===t)return null;var e=n(t,"Long")?t.toNumber():Number(t);if(e===(0|e)&&e>=-0x80000000&&e<=0x7fffffff)return e;o.ok(!1)}},5477:(t,e,r)=>{"use strict";var n=r(2354),o=r(3279),i=r(3123);t.exports=r(3388)||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})(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||"[object Symbol]"!==Object.prototype.toString.call(r)||"[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||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==r||!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})(t)}var o="u">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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t,r){var s,a;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),s=e,a=['Cannot create use schema for property "'.concat(t,'" because the schema has the ').concat(r," option enabled.")],s=i(s),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(s,a||[],i(this).constructor):s.apply(this,a))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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;
1Object.defineProperty(n.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}),n.prototype.hasOwnProperty("valueOf")||(n.prototype.valueOf=function(){return this.toString()}),n.prototype[o]=!0,t.exports=n},5558:(t,e,r)=>{"use strict";var n=r(3660);function o(t){return n.cast()(t)}e.G=o,e.p=function t(e,r){e.forEach(function(n,i){Array.isArray(n)?t(n,r):e[i]=o.call(r,n)})}},5678:(t,e,r)=>{"use strict";t.exports=r(2914)},5761:t=>{"use strict";t.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})},5782:t=>{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t,r,n){if(0===t.length)return n();var o,i=t.length,s=null,a=function(t){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return e(t,void 0);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)?e(t,void 0):void 0}}(t))){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 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}}}}(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(t){a.e(t)}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";t.exports=r(8093).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})(t)}var o=r(6775),i=r(2486),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return f(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t){var o=e;if("string"==typeof o&&""!==o||(o="utf8"),!u.isEncoding(o))throw TypeError("Unknown encoding: "+o);var i=0|d(t,o),s=a(i),c=s.write(t,o);return c!==i&&(s=s.slice(0,c)),s}if(ArrayBuffer.isView(t)){if(k(t,Uint8Array)){var l=new Uint8Array(t);return h(l.buffer,l.byteOffset,l.byteLength)}return p(t)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t));if(k(t,ArrayBuffer)||t&&k(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(k(t,SharedArrayBuffer)||t&&k(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var f=t.valueOf&&t.valueOf();if(null!=f&&f!==t)return u.from(f,e,r);var b=function(t){if(u.isBuffer(t)){var e,r=0|y(t.length),n=a(r);return 0===n.length||t.copy(n,0,0,r),n}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?a(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(b)return b;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t))}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');
1if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),a(t<0?0:0|y(t))}function p(t){for(var e=t.length<0?0:0|y(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),u.prototype),n}function y(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||k(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw 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 E(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return x(t).length;default:if(i)return o?-1:E(t).length;e=(""+e).toLowerCase(),i=!0}}function b(t,e,r){var n,i,s,a=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=N[t[i]];return o}(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":return n=this,i=e,s=r,0===i&&s===n.length?o.fromByteArray(n):o.fromByteArray(n.slice(i,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,e,r);default:if(a)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,o){var i;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:g(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):g(t,[e],r,n,o);throw TypeError("val must be string, number or Buffer")}function g(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*s}else -1!==l&&(i-=i-l),l=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var f=!0,p=0;p<u;p++)if(c(t,i+p)!==c(e,p)){f=!1;break}if(f)return i}return -1}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,c=t[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}var p=n.length;if(p<=O)return String.fromCharCode.apply(String,n);for(var h="",y=0;y<p;)h+=String.fromCharCode.apply(String,n.slice(y,y+=O));return h}e.hp=u,e.IS=50,u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"u"<typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},u.allocUnsafe=function(t){return f(t)},u.allocUnsafeSlow=function(t){return f(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(k(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),k(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:+(n<r)},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var r,n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];
1if(k(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!u.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?_(this,0,t):b.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(t,e,r,o,i){if(k(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw 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 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),c=Math.min(s,a),l=this.slice(o,i),f=t.slice(e,r),p=0;p<c;++p)if(l[p]!==f[p]){s=l[p],a=f[p];break}return s<a?-1:+(a<s)},u.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o,i,s,a,u,c,l,f,p=this.length-e;if((void 0===r||r>p)&&(r=p),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a,u=parseInt(e.substr(2*s,2),16);if((a=u)!=a)break;t[r+s]=u}return s}(this,t,e,r);case"utf8":case"utf-8":return o=e,i=r,T(E(t,this.length-o),this,o,i);case"ascii":case"latin1":case"binary":return s=e,a=r,T(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,s,a);case"base64":return u=e,c=r,T(x(t),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,f=r,T(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,this.length-l),this,l,f);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function w(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function S(t,e,r,n,o,i){if(!u.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function $(t,e,r,n,o,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function j(t,e,r,n,o){return e*=1,r>>>=0,o||$(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e*=1,r>>>=0,o||$(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],o=1,i=0;
vendor: 5,500 bytes, line 1
1++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t*=1,e>>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t*=1,e>>>=0,r>>>=0,n||S(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);S(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);S(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},u.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||S(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o}
1,u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var o,i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:u.from(t,n),a=s.length;if(0===a)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var A=/[^+/0-9A-Za-z-_]/g;function E(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319||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 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 x(t){return o.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(A,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function k(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var N=function(){for(var t="0123456789abcdef",e=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="u">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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var r=({}).toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var s=r(7930).arrayAtomicsSymbol,a=r(7930).sessionNewDocuments,u=r(8768);function c(t,e){var r;return t=t||{},null!=e.$pullAll&&(t.$pullAll=(t.$pullAll||[]).concat(e.$pullAll)),null!=e.$push&&(t.$push=t.$push||{},t.$push.$each=(t.$push.$each||[]).concat(e.$push.$each)),null!=e.$addToSet&&(t.$addToSet=(t.$addToSet||[]).concat(e.$addToSet)),null!=e.$set&&(t.$set=Array.isArray(e.$set)?function(t){if(Array.isArray(t))return i(t)}(r=e.$set)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||o(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():Object.assign({},e.$set)),t}t.exports=function(t){t.pre("save",function(){var t=this.$session();if(null!=t&&null!=t.transaction&&null!=t[a]&&!t[a].has(this)){var e={};this.isNew&&(e.isNew=!0),this.$__schema.options.versionKey&&(e.versionKey=this.get(this.$__schema.options.versionKey)),e.modifiedPaths=new Set(Object.keys(this.$__.activePaths.getStatePaths("modify"))),e.atomics=function(t,e){var r=new Map;e=e||new Map;var o,i=n(Object.keys(t.$__.activePaths.init).concat(Object.keys(t.$__.activePaths.modify)));try{for(i.s();!(o=i.n()).done;){var a=o.value,l=t.$__getValue(a);if(null!=l&&Array.isArray(l)&&u.isMongooseDocumentArray(l)&&l.length&&null!=l[s]&&0!==Object.keys(l[s]).length){var f=e.get(a)||{};r.set(a,c(f,l[s]))}}}catch(t){i.e(t)}finally{i.f()}var p,h=n(t.$__dirty());try{for(h.s();!(p=h.n()).done;){var y=p.value,d=y.path,b=y.value;if(null!=b&&null!=b[s]&&0!==Object.keys(b[s]).length){var m=e.get(d)||{};r.set(d,c(m,b[s]))}}}catch(t){h.e(t)}finally{h.f()}return r}(this),t[a].set(this,e)}})}},5899:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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;t.exports=r(2354).call(n,o)},6062:(t,e,r)=>{"use strict";
1var 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";var e;Object.defineProperty(e=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t),this.subdocSnapshot=e,this.activePaths=r,this.version=n},"prototype",{writable:!1}),t.exports=e},6155:t=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){for(var r=Object.keys(t),n=!0,o=0,i=r.length;o<i;++o)if("object"===e(t[r[o]])&&null!==t[r[o]]){n=!1;break}return n}},6182:t=>{"use strict";function e(t,e){if(null==t)throw TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),s=0,a=i.length;s<a;s++){var u=i[s],c=Object.getOwnPropertyDescriptor(o,u);void 0!==c&&c.enumerable&&(r[u]=o[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},6193:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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 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)})(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,O=b.isRegExp,w=b.isSet,S=b.isNativeError,$=b.isBoxedPrimitive,j=b.isNumberObject,P=b.isStringObject,A=b.isBooleanObject,E=b.isBigIntObject,x=b.isSymbolObject,T=b.isFloat32Array,k=b.isFloat64Array;function N(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=0x100000000}function I(t){return Object.keys(t).filter(N).concat(l(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function B(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:+(n<r)}function M(t,e,r,n){if(t===e)return 0!==t||!r||c(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&f(t)&&f(e);if("object"!==i(e)||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var o=d(t);if(o!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var a=I(t),u=I(e);return a.length===u.length&&R(t,e,r,n,1,a)}if("[object Object]"===o&&(!_(t)&&_(e)||!w(t)&&w(e)))return!1;if(g(t)){if(!g(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(O(t)){if(!O(e)||!(s?t.source===e.source&&t.flags===e.flags:RegExp.prototype.toString.call(t)===RegExp.prototype.toString.call(e)))return!1}else if(S(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(v(t)){if(!r&&(T(t)||k(t))){if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1}else if(t.byteLength!==e.byteLength||0!==B(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))return!1;var l=I(t),p=I(e);return l.length===p.length&&R(t,e,r,n,0,l)}if(w(t))return!(!w(e)||t.size!==e.size)&&R(t,e,r,n,2);
1if(_(t))return!(!_(e)||t.size!==e.size)&&R(t,e,r,n,3);if(m(t)){if(t.byteLength!==e.byteLength||0!==B(new Uint8Array(t),new Uint8Array(e)))return!1}else if($(t)&&(j(t)?!(j(e)&&c(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e))):P(t)?!P(e)||String.prototype.valueOf.call(t)!==String.prototype.valueOf.call(e):A(t)?!A(e)||Boolean.prototype.valueOf.call(t)!==Boolean.prototype.valueOf.call(e):E(t)?!E(e)||BigInt.prototype.valueOf.call(t)!==BigInt.prototype.valueOf.call(e):!x(e)||Symbol.prototype.valueOf.call(t)!==Symbol.prototype.valueOf.call(e)))return!1}return R(t,e,r,n,0)}function D(t,e){return e.filter(function(e){return y(t,e)})}function R(t,e,r,n,s,c){if(5==arguments.length){c=Object.keys(t);var f=Object.keys(e);if(c.length!==f.length)return!1}for(var p=0;p<c.length;p++)if(!h(e,c[p]))return!1;if(r&&5==arguments.length){var d=l(t);if(0!==d.length){var b=0;for(p=0;p<d.length;p++){var m=d[p];if(y(t,m)){if(!y(e,m))return!1;c.push(m),b++}else if(y(e,m))return!1}var v=l(e);if(d.length!==v.length&&D(e,v).length!==b)return!1}else{var g=l(e);if(0!==g.length&&0!==D(e,g).length)return!1}}if(0===c.length&&(0===s||1===s&&0===t.length||0===t.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var _=n.val1.get(t);if(void 0!==_){var O=n.val2.get(e);if(void 0!==O)return _===O}n.position++}n.val1.set(t,n.position),n.val2.set(e,n.position);var w=function(t,e,r,n,s,c){var l=0;if(2===c){if(!function(t,e,r,n){for(var o=null,s=a(t),u=0;u<s.length;u++){var c=s[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!e.has(c)){if(r||!function(t,e,r){var n=C(r);return null!=n?n:e.has(n)&&!t.has(n)}(t,e,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=a(e),f=0;f<l.length;f++){var p=l[f];if("object"===i(p)&&null!==p){if(!U(o,p,r,n))return!1}else if(!r&&!t.has(p)&&!U(o,p,r,n))return!1}return 0===o.size}return!0}(t,e,r,s))return!1}else if(3===c){if(!function(t,e,r,n){for(var s=null,a=u(t),c=0;c<a.length;c++){var l=o(a[c],2),f=l[0],p=l[1];if("object"===i(f)&&null!==f)null===s&&(s=new Set),s.add(f);else{var h=e.get(f);if(void 0===h&&!e.has(f)||!M(p,h,r,n)){if(r||!function(t,e,r,n,o){var i=C(r);if(null!=i)return i;var s=e.get(i);return!(void 0===s&&!e.has(i)||!M(n,s,!1,o))&&!t.has(i)&&M(n,s,!1,o)}(t,e,f,p,n))return!1;null===s&&(s=new Set),s.add(f)}}}if(null!==s){for(var y=u(e),d=0;d<y.length;d++){var b=o(y[d],2),m=(f=b[0],b[1]);if("object"===i(f)&&null!==f){if(!F(s,t,f,m,r,n))return!1}else if(!(r||t.has(f)&&M(t.get(f),m,!1,n)||F(s,t,f,m,!1,n)))return!1}return 0===s.size}return!0}(t,e,r,s))return!1}else if(1===c)for(;l<t.length;l++){if(!h(t,l)){if(h(e,l))return!1;for(var f=Object.keys(t);l<f.length;l++){var p=f[l];if(!h(e,p)||!M(t[p],e[p],r,s))return!1}return f.length===Object.keys(e).length}if(!h(e,l)||!M(t[l],e[l],r,s))return!1}for(l=0;l<n.length;l++){var y=n[l];if(!M(t[y],e[y],r,s))return!1}return!0}(t,e,r,c,n,s);return n.val1.delete(t),n.val2.delete(e),w}function U(t,e,r,n){for(var o=a(t),i=0;i<o.length;i++){var s=o[i];if(M(e,s,r,n))return t.delete(s),!0}return!1}function C(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t*=1;case"number":if(f(t))return!1}return!0}function F(t,e,r,n,o,i){for(var s=a(t),u=0;u<s.length;u++){var c=s[u];if(M(r,c,o,i)&&M(n,e.get(c),o,i))return t.delete(c),!0}return!1}t.exports={isDeepEqual:function(t,e){return M(t,e,!1)},isDeepStrictEqual:function(t,e){return M(t,e,!0)}}},6223:t=>{"use strict";var e=/\./g;t.exports=function(t){if(-1===t.indexOf("."))return[t];for(var r=t.split(e),n=r.length,o=Array(n),i="",s=0;s<n;++s)i+=0!==i.length?"."+r[s]:r[s],o[s]=i;return o}},6312:t=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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";let n,o,i,s;r.r(e),r.d(e,{BSON:()=>t4,BSONError:()=>v,BSONOffsetError:()=>O,BSONRegExp:()=>th,BSONRuntimeError:()=>_,BSONSymbol:()=>ty,BSONType:()=>m,BSONValue:()=>T,BSONVersionError:()=>g,Binary:()=>M,Code:()=>F,DBRef:()=>V,Decimal128:()=>tn,Double:()=>to,EJSON:()=>tQ,Int32:()=>ti,Long:()=>H,MaxKey:()=>ts,MinKey:()=>ta,ObjectId:()=>tl,Timestamp:()=>tb,UUID:()=>C,calculateObjectSize:()=>t6,deserialize:()=>
1t8,deserializeStream:()=>t5,onDemand:()=>tX,serialize:()=>t2,serializeWithBufferAndIndex:()=>t3,setInternalBufferSize:()=>t1});var a=r(5832).hp;let u=(s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get,t=>s.call(t));function c(t){return"Uint8Array"===u(t)}function l(t){return"object"==typeof t&&null!=t&&Symbol.toStringTag in t&&("ArrayBuffer"===t[Symbol.toStringTag]||"SharedArrayBuffer"===t[Symbol.toStringTag])}function f(t){return t instanceof RegExp||"[object RegExp]"===Object.prototype.toString.call(t)}function p(t){return"object"==typeof t&&null!=t&&Symbol.toStringTag in t&&"Map"===t[Symbol.toStringTag]}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function y(t,e){return JSON.stringify(t,(t,e)=>"bigint"==typeof e?{$numberLong:`${e}`}:p(e)?Object.fromEntries(e):e)}let d=Symbol.for("@@mdb.bson.version"),b=0x8000000000000000-1,m=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 v 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 g extends v{get name(){return"BSONVersionError"}constructor(){super("Unsupported BSON version, bson types must be from bson 6.x.x")}}class _ extends v{get name(){return"BSONRuntimeError"}constructor(t){super(t)}}class O extends v{get name(){return"BSONOffsetError"}constructor(t,e,r){super(`${t}. offset: ${e}`,r),this.offset=e}}function w(t,e,r,i){if(i){n??=new TextDecoder("utf8",{fatal:!0});try{return n.decode(t.subarray(e,r))}catch(t){throw new v("Invalid UTF-8 string in BSON document",{cause:t})}}return(o??=new TextDecoder("utf8",{fatal:!1})).decode(t.subarray(e,r))}function S(t,e,r){if(0===t.length)return"";let 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]);let o=[];for(let n=e;n<r;n++){let e=t[n];if(e>127)return null;o.push(e)}return String.fromCharCode(...o)}let $={toLocalBufferType(t){if(a.isBuffer(t))return t;if(ArrayBuffer.isView(t))return a.from(t.buffer,t.byteOffset,t.byteLength);let e=t?.[Symbol.toStringTag]??Object.prototype.toString.call(t);if("ArrayBuffer"===e||"SharedArrayBuffer"===e||"[object ArrayBuffer]"===e||"[object SharedArrayBuffer]"===e)return a.from(t);throw new v("Cannot create Buffer from the passed potentialBuffer.")},allocate:t=>a.alloc(t),allocateUnsafe:t=>a.allocUnsafe(t),equals:(t,e)=>$.toLocalBufferType(t).equals(e),fromNumberArray:t=>a.from(t),fromBase64:t=>a.from(t,"base64"),toBase64:t=>$.toLocalBufferType(t).toString("base64"),fromISO88591:t=>a.from(t,"binary"),toISO88591:t=>$.toLocalBufferType(t).toString("binary"),fromHex:t=>a.from(t,"hex"),toHex:t=>$.toLocalBufferType(t).toString("hex"),toUTF8(t,e,r,n){let o=r-e<=20?S(t,e,r):null;if(null!=o)return o;let i=$.toLocalBufferType(t).toString("utf8",e,r);if(n){for(let n=0;n<i.length;n++)if(65533===i.charCodeAt(n)){w(t,e,r,!0);break}}return i},utf8ByteLength:t=>a.byteLength(t,"utf8"),encodeUTF8Into(t,e,r){let n=function(t,e,r){if(0===e.length)return 0;if(e.length>25||t.length-r<e.length)return null;for(let n=0,o=r;n<e.length;n++,o++){let r=e.charCodeAt(n);if(r>127)return null;t[o]=r}return e.length}(t,e,r);return null!=n?n:$.toLocalBufferType(t).write(e,r,void 0,"utf8")},randomBytes:function(t){return $.fromNumberArray(Array.from({length:t},()=>Math.floor(256*Math.random())))},swap32:t=>$.toLocalBufferType(t).swap32()};function j(t){if(t<0)throw RangeError(`The argument 'byteLength' is invalid. Received ${t}`);return E.fromNumberArray(Array.from({length:t},()=>Math.floor(256*Math.random())))}let P=(()=>{let{crypto:t}=globalThis;if(null!=t&&"function"==typeof t.getRandomValues)return e=>t.getRandomValues(E.allocate(e));if(function(){let{navigator:t}=globalThis;return"object"==typeof t&&"ReactNative"===t.product}()){let{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 j})(),A=/(\d|[a-f])/i,E={toLocalBufferType(t){let 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 v("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(t){if("number"!=typeof t)throw TypeError(`The "size" argument must be of type number. Received ${String(t)}`);return new Uint8Array(t)},allocateUnsafe:t=>E.allocate(t),equals(t,e){if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},fromNumberArray:t=>Uint8Array.from(t),fromBase64:t=>Uint8Array.from(atob(t),t=>t.charCodeAt(0)),toBase64:t=>btoa(E.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){let e=t.length%2==0?t:t.slice(0,t.length-1),r=[];for(let t=0;t<e.length;t+=2){let n=e[t],o=e[t+1];if(!A.test(n)||!A.test(o))break;let i=Number.parseInt(`${n}${o}`,16);r.push(i)}return Uint8Array.from(r)},toHex:t=>Array.from(t,t=>t.toString(16).padStart(2,"0")).join(""),toUTF8(t,e,r,n){let o=r-e<=20?S(t,e,r):null;return null!=o?o:w(t,e,r,n)},utf8ByteLength:t=>(new TextEncoder).encode(t).byteLength,encodeUTF8Into(t,e,r){let n=(new TextEncoder).encode(e);return t.set(n,r),n.byteLength},randomBytes:P,swap32(t){if(t.length%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t.length;e+=4){let r=t[e],n=t[e+1],o=t[e+2],i=t[e+3];t[e]=i,t[e+1]=o,t[e+2]=n,t[e+3]=r}return t}},x="function"==typeof a&&!0!==a.prototype?._isBuffer?$:E;class T{get[d](){return 6}[Symbol.for("nodejs.util.inspect.custom")](t,e,r){return this.inspect(t,e,r)}}let k=new Float64Array(1),N=new Uint8Array(k.buffer,0,8);k[0]=-1;let I=0===N[7],B={isBigEndian:I,getNonnegativeInt32LE(t,e){if(t[e+3]>
1127)throw 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]+0x1000000*t[e+3],getUint32BE:(t,e)=>t[e+3]+256*t[e+2]+65536*t[e+1]+0x1000000*t[e],getBigInt64LE(t,e){let 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]+0x1000000*t[e+3]);return(r<<BigInt(32))+n},getFloat64LE:I?(t,e)=>(N[7]=t[e],N[6]=t[e+1],N[5]=t[e+2],N[4]=t[e+3],N[3]=t[e+4],N[2]=t[e+5],N[1]=t[e+6],N[0]=t[e+7],k[0]):(t,e)=>(N[0]=t[e],N[1]=t[e+1],N[2]=t[e+2],N[3]=t[e+3],N[4]=t[e+4],N[5]=t[e+5],N[6]=t[e+6],N[7]=t[e+7],k[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){let n=BigInt(0xffffffff),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:I?(t,e,r)=>(k[0]=r,t[e]=N[7],t[e+1]=N[6],t[e+2]=N[5],t[e+3]=N[4],t[e+4]=N[3],t[e+5]=N[2],t[e+6]=N[1],t[e+7]=N[0],8):(t,e,r)=>(k[0]=r,t[e]=N[0],t[e+1]=N[1],t[e+2]=N[2],t[e+3]=N[3],t[e+4]=N[4],t[e+5]=N[5],t[e+6]=N[6],t[e+7]=N[7],8)};class M extends T{get _bsontype(){return"Binary"}constructor(t,e){if(super(),null!=t&&"string"==typeof t&&!ArrayBuffer.isView(t)&&!l(t)&&!Array.isArray(t))throw new v("Binary can only be constructed from Uint8Array or number[]");this.sub_type=e??M.BSON_BINARY_SUBTYPE_DEFAULT,null==t?(this.buffer=x.allocate(M.BUFFER_SIZE),this.position=0):(this.buffer=Array.isArray(t)?x.fromNumberArray(t):x.toLocalBufferType(t),this.position=this.buffer.byteLength)}put(t){let e;if("string"==typeof t&&1!==t.length)throw new v("only accepts single character String");if("number"!=typeof t&&1!==t.length)throw new v("only accepts single character Uint8Array or Array");if((e="string"==typeof t?t.charCodeAt(0):"number"==typeof t?t:t[0])<0||e>255)throw new v("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=e;else{let t=x.allocate(M.BUFFER_SIZE+this.buffer.length);t.set(this.buffer,0),this.buffer=t,this.buffer[this.position++]=e}}write(t,e){if(e="number"==typeof e?e:this.position,this.buffer.byteLength<e+t.length){let e=x.allocate(this.buffer.byteLength+t.length);e.set(this.buffer,0),this.buffer=e}if(ArrayBuffer.isView(t))this.buffer.set(x.toLocalBufferType(t),e),this.position=e+t.byteLength>this.position?e+t.length:this.position;else if("string"==typeof t)throw new v("input cannot be string")}read(t,e){let 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 x.toBase64(this.buffer.subarray(0,this.position))}toString(t){return"hex"===t?x.toHex(this.buffer.subarray(0,this.position)):"base64"===t?x.toBase64(this.buffer.subarray(0,this.position)):x.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(t){t=t||{},this.sub_type===M.SUBTYPE_VECTOR&&D(this);let e=x.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===M.SUBTYPE_UUID)return new C(this.buffer.subarray(0,this.position));throw new v(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${M.SUBTYPE_UUID}" is currently supported.`)}static createFromHexString(t,e){return new M(x.fromHex(t),e)}static createFromBase64(t,e){return new M(x.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=x.fromBase64(t.$binary)):"string"!=typeof t.$binary&&(n=t.$binary.subType?parseInt(t.$binary.subType,16):0,r=x.fromBase64(t.$binary.base64)):"$uuid"in t&&(n=4,r=C.bytesFromString(t.$uuid)),!r)throw new v(`Unexpected Binary Extended JSON format ${JSON.stringify(t)}`);return 4===n?new C(r):new M(r,n)}inspect(t,e,r){return r??=y,`Binary.createFromBase64(${r(x.toBase64(this.buffer.subarray(0,this.position)),e)}, ${r(this.sub_type,e)})`}toInt8Array(){if(this.sub_type!==M.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==M.VECTOR_TYPE.Int8)throw new v("Binary datatype field is not Int8");return D(this),new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==M.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==M.VECTOR_TYPE.Float32)throw new v("Binary datatype field is not Float32");D(this);let t=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));return B.isBigEndian&&x.swap32(t),new Float32Array(t.buffer)}toPackedBits(){if(this.sub_type!==M.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==M.VECTOR_TYPE.PackedBit)throw new v("Binary datatype field is not packed bit");return D(this),new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==M.SUBTYPE_VECTOR)throw new v("Binary sub_type is not Vector");if(this.buffer[0]!==M.VECTOR_TYPE.PackedBit)throw new v("Binary datatype field is not packed bit");D(this);let t=new Int8Array(8*(this.length()-2)-this.buffer[1]);for(let e=0;e<t.length;e++){let r=e/8|0,n=this.buffer[r+2]>>7-e%8&1;t[e]=n}return t}static fromInt8Array(t){let e=x.allocate(t.byteLength+2);e[0]=M.VECTOR_TYPE.Int8,e[1]=0;let r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);e.set(r,2);let n=new this(e,this.SUBTYPE_VECTOR);return D(n),n}static fromFloat32Array(t){let e=x.allocate(t.byteLength+2);e[0]=M.VECTOR_TYPE.Float32,e[1]=0;let r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);e.set(r,2),B.isBigEndian&&x.swap32(new Uint8Array(e.buffer,2));let n=new this(e,this.SUBTYPE_VECTOR);return D(n),n}static fromPackedBits(t,e=0){let r=x.allocate(t.byteLength+2);r[0]=M.VECTOR_TYPE.PackedBit,r[1]=e,r.set(t,2);let n=new this(r,this.SUBTYPE_VECTOR);return D(n),n}static fromBits(t){let e=new Uint8Array((t.length+7>>>3)+2);e[0]=M.VECTOR_TYPE.PackedBit;let r=t.length%8;e[1]=0===r?0:8-r;for(let r=0;r<t.length;r++){let n=r>>>3,o=t[r];if(0!==o&&1!==o)throw new v(`Invalid bit value at ${r}: must be 0 or 1, found ${t[r]}`);if(0===o)continue;let i=7-r%8;e[n+2]|=o<<i}return new this(e,M.SUBTYPE_VECTOR)}}function D(t){if(t.sub_type!==M.SUBTYPE_VECTOR)return;let e=t.position,r=t.buffer[0],n=t.buffer[1];if((r===M.VECTOR_TYPE.Float32||r===M.VECTOR_TYPE.Int8)&&0!==n)throw new v("Invalid Vector: padding must be zero for int8 and float32 vectors");if(r===M.VECTOR_TYPE.Float32&&0!==e&&e-2!=0&&(e-2)%4!=0)throw new v("Invalid Vector: Float32 vector must contain a multiple of 4 bytes");if(r===M.VECTOR_TYPE.PackedBit&&0!==n&&2===e)throw new v("Invalid Vector: padding must be zero for packed bit vectors that are empty");if(r===M.VECTOR_TYPE.PackedBit&&n>7)throw new v(`Invalid Vector: padding must be a value between 0 and 7. found: ${n}`)}M.BSON_BINARY_SUBTYPE_DEFAULT=0,M.BUFFER_SIZE=256,M.SUBTYPE_DEFAULT=0,M.SUBTYPE_FUNCTION=1,M.SUBTYPE_BYTE_ARRAY=2,M.SUBTYPE_UUID_OLD=3,M.SUBTYPE_UUID=4,M.SUBTYPE_MD5=5,M.SUBTYPE_ENCRYPTED=6,M.SUBTYPE_COLUMN=7,M.SUBTYPE_SENSITIVE=8,M.SUBTYPE_VECTOR=9,M.SUBTYPE_USER_DEFINED=128,M.VECTOR_TYPE=Object.freeze({Int8:3,Float32:39,PackedBit:16});let R=/^[0-9A-F]{32}$/i,U=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class C extends M{constructor(t){let e;if(null==t)e=C.generate();else if(t instanceof C)e=x.toLocalBufferType(new Uint8Array(t.buffer));else if(ArrayBuffer.isView(t)&&16===t.byteLength)e=x.toLocalBufferType(t);else{if("string"!=typeof t)throw new v("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=C.bytesFromString(t)}super(e,4)}get id(){return this.buffer}set id(t){this.buffer=t}toHexString(t=!0){return t?[x.toHex(this.buffer.subarray(0,4)),x.toHex(this.buffer.subarray(4,6)),x.toHex(this.buffer.subarray(6,8)),x.toHex(this.buffer.subarray(8,10)),x.toHex(this.buffer.subarray(10,16))].join("-"):x.toHex(this.buffer)}toString(t){return"hex"===t?x.toHex(this.id):"base64"===t?x.toBase64(this.id
1):this.toHexString()}toJSON(){return this.toHexString()}equals(t){if(!t)return!1;if(t instanceof C)return x.equals(t.id,this.id);try{return x.equals(new C(t).id,this.id)}catch{return!1}}toBinary(){return new M(this.id,M.SUBTYPE_UUID)}static generate(){let t=x.randomBytes(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,t}static isValid(t){return!!t&&("string"==typeof t?C.isValidUUIDString(t):c(t)?16===t.byteLength:"Binary"===t._bsontype&&t.sub_type===this.SUBTYPE_UUID&&16===t.buffer.byteLength)}static createFromHexString(t){let e=C.bytesFromString(t);return new C(e)}static createFromBase64(t){return new C(x.fromBase64(t))}static bytesFromString(t){if(!C.isValidUUIDString(t))throw new v("UUID string representation must be 32 hex digits or canonical hyphenated representation");return x.fromHex(t.replace(/-/g,""))}static isValidUUIDString(t){return R.test(t)||U.test(t)}inspect(t,e,r){return r??=y,`new UUID(${r(this.toHexString(),e)})`}}class F extends T{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 F(t.$code,t.$scope)}inspect(t,e,r){let n=(r??=y)(this.code,e),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 L(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 V extends T{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(){let 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){let e=Object.assign({},t);return delete e.$ref,delete e.$id,delete e.$db,new V(t.$ref,t.$id,t.$db,e)}inspect(t,e,r){let n=[(r??=y)(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===y?`new ObjectId(${n[1]})`:n[1],`new DBRef(${n.join(", ")})`}}
1function q(t){if(""===t)return t;let e=0,r="-"===t[0],n="+"===t[e];(n||r)&&(e+=1);let o=!1;for(;e<t.length&&"0"===t[e];++e)o=!0;return o?`${r?"-":""}${t.length===e?"0":t.slice(e)}`:n?t.slice(1):t}try{i=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}let J={},z={},K=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class H extends T{get _bsontype(){return"Long"}get __isLong__(){return!0}constructor(t=0,e,r){super();const n="boolean"==typeof e?e:!!r,o="string"==typeof t?H.fromString(t,n):"bigint"==typeof t?H.fromBigInt(t,n):{low:0|t,high:0|("number"==typeof e?e:0),unsigned:n};this.low=o.low,this.high=o.high,this.unsigned=o.unsigned}static fromBits(t,e,r){return new H(t,e,r)}static fromInt(t,e){let r,n,o;return e?(o=0<=(t>>>=0)&&t<256)&&(n=z[t])?n:(r=H.fromBits(t,(0|t)<0?-1:0,!0),o&&(z[t]=r),r):(o=-128<=(t|=0)&&t<128)&&(n=J[t])?n:(r=H.fromBits(t,t<0?-1:0,!1),o&&(J[t]=r),r)}static fromNumber(t,e){if(isNaN(t))return e?H.UZERO:H.ZERO;if(e){if(t<0)return H.UZERO;if(t>=0xffffffffffffffff)return H.MAX_UNSIGNED_VALUE}else{if(t<=-0x8000000000000000)return H.MIN_VALUE;if(t+1>=0x8000000000000000)return H.MAX_VALUE}return t<0?H.fromNumber(-t,e).neg():H.fromBits(t%0x100000000|0,t/0x100000000|0,e)}static fromBigInt(t,e){let r=BigInt(0xffffffff),n=BigInt(32);return new H(Number(t&r),Number(t>>n&r),e)}static _fromString(t,e,r){let n;if(0===t.length)throw new v("empty string");if(r<2||36<r)throw new v("radix");if((n=t.indexOf("-"))>0)throw new v("interior hyphen");if(0===n)return H._fromString(t.substring(1),e,r).neg();let o=H.fromNumber(Math.pow(r,8)),i=H.ZERO;for(let e=0;e<t.length;e+=8){let n=Math.min(8,t.length-e),s=parseInt(t.substring(e,e+n),r);if(n<8){let t=H.fromNumber(Math.pow(r,n));i=i.mul(t).add(H.fromNumber(s))}else i=(i=i.mul(o)).add(H.fromNumber(s))}return i.unsigned=e,i}static fromStringStrict(t,e,r){var n;let o,i=!1;if("number"==typeof e?(r=e,e=!1):i=!!e,r??=10,t.trim()!==t)throw new v(`Input: '${t}' contains leading and/or trailing whitespace`);if(n=r,o="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,n=n??10),RegExp(`[^-+${o}]`,"i").test(t)||!t)throw new v(`Input: '${t}' contains invalid characters for radix: ${r}`);let s=q(t),a=H._fromString(s,i,r);if(a.toString(r).toLowerCase()!==s.toLowerCase())throw new v(`Input: ${t} is not representable as ${a.unsigned?"an unsigned":"a signed"} 64-bit Long ${null!=r?`with radix: ${r}`:""}`);return a}static fromString(t,e,r){let n=!1;return"number"==typeof e?(r=e,e=!1):n=!!e,r??=10,"NaN"===t&&r<24||("Infinity"===t||"+Infinity"===t||"-Infinity"===t)&&r<35?H.ZERO:H._fromString(t,n,r)}static fromBytes(t,e,r){return r?H.fromBytesLE(t,e):H.fromBytesBE(t,e)}static fromBytesLE(t,e){return new H(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)}static fromBytesBE(t,e){return new H(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}static isLong(t){return null!=t&&"object"==typeof t&&"__isLong__"in t&&!0===t.__isLong__}static fromValue(t,e){return"number"==typeof t?H.fromNumber(t,e):"string"==typeof t?H.fromString(t,e):H.fromBits(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}add(t){H.isLong(t)||(t=H.fromValue(t));let 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=0,c=0,l,f;
1return l=0+((f=0+(o+(65535&t.low)))>>>16),f&=65535,l+=n+a,c+=l>>>16,l&=65535,c+=r+s,u+=c>>>16,c&=65535,u+=e+i,u&=65535,H.fromBits(l<<16|f,u<<16|c,this.unsigned)}and(t){return H.isLong(t)||(t=H.fromValue(t)),H.fromBits(this.low&t.low,this.high&t.high,this.unsigned)}compare(t){if(H.isLong(t)||(t=H.fromValue(t)),this.eq(t))return 0;let 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){let e,r,n;if(H.isLong(t)||(t=H.fromValue(t)),t.isZero())throw new v("division by zero");if(i){if(!this.unsigned&&-0x80000000===this.high&&-1===t.low&&-1===t.high)return this;let e=(this.unsigned?i.div_u:i.div_s)(this.low,this.high,t.low,t.high);return H.fromBits(e,i.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?H.UZERO:H.ZERO;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return H.UZERO;if(t.gt(this.shru(1)))return H.UONE;n=H.UZERO}else{if(this.eq(H.MIN_VALUE))return t.eq(H.ONE)||t.eq(H.NEG_ONE)?H.MIN_VALUE:t.eq(H.MIN_VALUE)?H.ONE:(e=this.shr(1).div(t).shl(1)).eq(H.ZERO)?t.isNegative()?H.ONE:H.NEG_ONE:(r=this.sub(t.mul(e)),n=e.add(r.div(t)));if(t.eq(H.MIN_VALUE))return this.unsigned?H.UZERO:H.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=H.ZERO}for(r=this;r.gte(t);){let o=Math.ceil(Math.log(e=Math.max(1,Math.floor(r.toNumber()/t.toNumber())))/Math.LN2),i=o<=48?1:Math.pow(2,o-48),s=H.fromNumber(e),a=s.mul(t);for(;a.isNegative()||a.gt(r);)e-=i,a=(s=H.fromNumber(e,this.unsigned)).mul(t);s.isZero()&&(s=H.ONE),n=n.add(s),r=r.sub(a)}return n}div(t){return this.divide(t)}equals(t){return H.isLong(t)||(t=H.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(){let t;if(this.isNegative())return this.eq(H.MIN_VALUE)?64:this.neg().getNumBitsAbs();let e=0!==this.high?this.high:this.low;for(t=31;t>0&&!(e&1<<t);t--);return 0!==this.high?t+33:t+1}greaterThan(t){return this.comp(t)>0}gt(t){return this.greaterThan(t)}greaterThanOrEqual(t){return this.comp(t)>=0}gte(t){return this.greaterThanOrEqual(t)}ge(t){return this.greaterThanOrEqual(t)}isEven(){return!(1&this.low)}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return!(1&~this.low)}isPositive(){return this.unsigned||this.high>=0}isZero(){return 0===this.high&&0===this.low}lessThan(t){return 0>this.comp(t)}lt(t){return this.lessThan(t)}lessThanOrEqual(t){return 0>=this.comp(t)}lte(t){return this.lessThanOrEqual(t)}modulo(t){if(H.isLong(t)||(t=H.fromValue(t)),i){let e=(this.unsigned?i.rem_u:i.rem_s)(this.low,this.high,t.low,t.high);return H.fromBits(e,i.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 H.ZERO;if(H.isLong(t)||(t=H.fromValue(t)),i){let e=i.mul(this.low,this.high,t.low,t.high);return H.fromBits(e,i.get_high(),this.unsigned)}if(t.isZero())return H.ZERO;if(this.eq(H.MIN_VALUE))return t.isOdd()?H.MIN_VALUE:H.ZERO;if(t.eq(H.MIN_VALUE))return this.isOdd()?H.MIN_VALUE:H.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(H.TWO_PWR_24)&&t.lt(H.TWO_PWR_24))return H.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);let e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,u=t.low>>>16,c=65535&t.low,l=0,f=0,p,h;return p=0+((h=0+o*c)>>>16),h&=65535,p+=n*c,f+=p>>>16,p&=65535,p+=o*u,f+=p>>>16,p&=65535,f+=r*c,l+=f>>>16,f&=65535,f+=n*u,l+=f>>>16,f&=65535,f+=o*a,l+=f>>>16,f&=65535,l+=e*c+r*u+n*a+o*s,l&=65535,H.fromBits(p<<16|h,l<<16|f,this.unsigned)}mul(t){return this.multiply(t)}negate(){return!this.unsigned&&this.eq(H.MIN_VALUE)?H.MIN_VALUE:this.not().add(H.ONE)}neg(){return this.negate()}not(){return H.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 H.isLong(t)||(t=H.fromValue(t)),H.fromBits(this.low|t.low,this.high|t.high,this.unsigned)}shiftLeft(t){return H.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?H.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):H.fromBits(0,this.low<<t-32,this.unsigned)}shl(t){return this.shiftLeft(t)}shiftRight(t){return H.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?H.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):H.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)}shr(t){return this.shiftRight(t)}shiftRightUnsigned(t){if(H.isLong(t)&&(t=t.toInt()),0==(t&=63))return this;{let e=this.high;if(t<32){let r=this.low;return H.fromBits(r>>>t|e<<32-t,e>>>t,this.unsigned)}return 32===t?H.fromBits(e,0,this.unsigned):H.fromBits(e>>>t-32,0,this.unsigned)}}shr_u(t){return this.shiftRightUnsigned(t)}shru(t){return this.shiftRightUnsigned(t)}subtract(t){return H.isLong(t)||(t=H.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)*0x100000000+(this.low>>>0):0x100000000*this.high+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(t){return t?this.toBytesLE():this.toBytesBE()}toBytesLE(){let 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(){let 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?H.fromBits(this.low,this.high,!1):this}toString(t){if((t=t||10)<2||36<t)throw new v("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(H.MIN_VALUE)){let e=H.fromNumber(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}let e=H.fromNumber(Math.pow(t,6),this.unsigned),r=this,n="";for(;;){let o=r.div(e),i=(r.sub(o.mul(e)).toInt()>>>0).toString(t);if((r=o).isZero())return i+n;for(;i.length<6;)i="0"+i;n=""+i+n}}toUnsigned(){return this.unsigned?this:H.fromBits(this.low,this.high,!0)}xor(t){return H.isLong(t)||(t=H.fromValue(t)),H.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){let{useBigInt64:r=!1,relaxed:n=!0}={...e};if(t.$numberLong.length>20)throw new v("$numberLong string is too long");if(!K.test(t.$numberLong))throw new v(`$numberLong string "${t.$numberLong}
1" is in an invalid format`);if(r)return BigInt.asIntN(64,BigInt(t.$numberLong));let o=H.fromString(t.$numberLong);return n?o.toNumber():o}inspect(t,e,r){return r??=y,`new Long(${r(this.toString(),e)}${this.unsigned?`, ${r(this.unsigned,e)}`:""})`}}H.TWO_PWR_24=H.fromInt(0x1000000),H.MAX_UNSIGNED_VALUE=H.fromBits(-1,-1,!0),H.ZERO=H.fromInt(0),H.UZERO=H.fromInt(0,!0),H.ONE=H.fromInt(1),H.UONE=H.fromInt(1,!0),H.NEG_ONE=H.fromInt(-1),H.MAX_VALUE=H.fromBits(-1,0x7fffffff,!1),H.MIN_VALUE=H.fromBits(0,-0x80000000,!1);let W=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,G=/^(\+|-)?(Infinity|inf)$/i,Q=/^(\+|-)?NaN$/i,Y=x.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),Z=x.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),X=x.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),tt=/^([-+])?(\d+)?$/;function te(t){return!isNaN(parseInt(t,10))}function tr(t,e){throw new v(`"${t}" is not a valid Decimal128 string - ${e}`)}class tn extends T{get _bsontype(){return"Decimal128"}constructor(t){if(super(),"string"==typeof t)this.bytes=tn.fromString(t).bytes;else{if(!(t instanceof Uint8Array||c(t)))throw new v("Decimal128 must take a Buffer or string");if(16!==t.byteLength)throw new v("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}}static fromString(t){return tn._fromString(t,{allowRounding:!1})}static fromStringWithRounding(t){return tn._fromString(t,{allowRounding:!0})}static _fromString(t,e){var r,n;let o,i,s=!1,a=!1,u=!1,c=!1,l=0,f=0,p=0,h=0,y=0,d=[0],b=0,m=0,g=0,_=0,O=new H(0,0),w=new H(0,0),S=0,$=0;if(t.length>=7e3)throw new v(t+" not a valid Decimal128 string");let j=t.match(W),P=t.match(G),A=t.match(Q);if(!j&&!P&&!A||0===t.length)throw new v(t+" not a valid Decimal128 string");if(j){let e=j[2],r=j[4],n=j[5],o=j[6];r&&void 0===o&&tr(t,"missing exponent power"),r&&void 0===e&&tr(t,"missing exponent base"),void 0===r&&(n||o)&&tr(t,"missing e before exponent")}if("+"!==t[$]&&"-"!==t[$]||(a=!0,s="-"===t[$++]),!te(t[$])&&"."!==t[$]){if("i"===t[$]||"I"===t[$])return new tn(s?Z:X);if("N"===t[$])return new tn(Y)}for(;te(t[$])||"."===t[$];)"."!==t[$]?(b<34&&("0"!==t[$]||c)&&(c||(y=f),c=!0,d[m++]=parseInt(t[$],10),b+=1),c&&(p+=1),u&&(h+=1),f+=1):(u&&tr(t,"contains multiple periods"),u=!0),$+=1;if(u&&!f)throw new v(t+" not a valid Decimal128 string");if("e"===t[$]||"E"===t[$]){let e=t.substr(++$).match(tt);if(!e||!e[2])return new tn(Y);_=parseInt(e[0],10),$+=e[0].length}if(t[$])return new tn(Y);if(b){if(g=b-1,1!==(l=p))for(;"0"===t[y+l-1+Number(a)+Number(u)];)l-=1}else d[0]=0,p=1,b=1,l=0;for(_<=h&&h>_+16384?_=-6176:_-=h;_>6111;){if((g+=1)>=34){if(0===l){_=6111;break}tr(t,"overflow")}_-=1}if(e.allowRounding){for(;_<-6176||b<p;){if(0===g&&l<b){_=-6176,l=0;break}if(b<p?p-=1:g-=1,_<6111)_+=1;else{if(d.join("").match(/^0+$/)){_=6111;break}tr(t,"overflow")}}if(g+1<l){let e=f;u&&(y+=1,e+=1),a&&(y+=1,e+=1);let r=parseInt(t[y+g+1],10),n=0;if(r>=5&&(n=1,5===r)){n=+(d[g]%2==1);for(let r=y+g+2;r<e;r++)if(parseInt(t[r],10)){n=1;break}}if(n){let t=g;for(;t>=0&&++d[t]>9;t--)if(d[t]=0,0===t){if(!(_<6111))return new tn(s?Z:X);_+=1,d[t]=1}}}}else{for(;_<-6176||b<p;){if(0===g){if(0===l){_=-6176;break}tr(t,"exponent underflow")}b<p?("0"!==t[p-1+Number(a)+Number(u)]&&0!==l&&tr(t,"inexact rounding"),p-=1):(0!==d[g]&&tr(t,"inexact rounding"),g-=1),_<6111?_+=1:tr(t,"overflow")}g+1<l&&(u&&(y+=1),a&&(y+=1),0!==parseInt(t[y+g+1],10)&&tr(t,"inexact rounding"))}if(O=H.fromNumber(0),w=H.fromNumber(0),0===l)O=H.fromNumber(0),w=H.fromNumber(0);else if(g<17){let t=0;for(w=H.fromNumber(d[t++]),O=new H(0,0);t<=g;t++)w=(w=w.multiply(H.fromNumber(10))).add(H.fromNumber(d[t]))}else{let t=0;for(O=H.fromNumber(d[t++]);t<=g-17;t++)O=(O=O.multiply(H.fromNumber(10))).add(H.fromNumber(d[t]));for(w=H.fromNumber(d[t++]);t<=g;t++)w=(w=w.multiply(H.fromNumber(10))).add(H.fromNumber(d[t]))}let E=function(t,e){if(!t&&!e)return{high:H.fromNumber(0),low:H.fromNumber(0)};let r=t.shiftRightUnsigned(32),n=new H(t.getLowBits(),0),o=e.shiftRightUnsigned(32),i=new H(e.getLowBits(),0),s=r.multiply(o),a=r.multiply(i),u=n.multiply(o),c=n.multiply(i);return s=s.add(a.shiftRightUnsigned(32)),a=new H(a.getLowBits(),0).add(u).add(c.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:c=a.shiftLeft(32).add(new H(c.getL
1owBits(),0))}}(O,H.fromString("100000000000000000"));E.low=E.low.add(w),r=E.low,n=w,((o=r.high>>>0)<(i=n.high>>>0)||o===i&&r.low>>>0<n.low>>>0)&&(E.high=E.high.add(H.fromNumber(1))),S=_+6176;let T={low:H.fromNumber(0),high:H.fromNumber(0)};E.high.shiftRightUnsigned(49).and(H.fromNumber(1)).equals(H.fromNumber(1))?(T.high=T.high.or(H.fromNumber(3).shiftLeft(61)),T.high=T.high.or(H.fromNumber(S).and(H.fromNumber(16383).shiftLeft(47))),T.high=T.high.or(E.high.and(H.fromNumber(0x7fffffffffff)))):(T.high=T.high.or(H.fromNumber(16383&S).shiftLeft(49)),T.high=T.high.or(E.high.and(H.fromNumber(0x1ffffffffffff)))),T.low=E.low,s&&(T.high=T.high.or(H.fromString("9223372036854775808")));let k=x.allocateUnsafe(16);return $=0,k[$++]=255&T.low.low,k[$++]=T.low.low>>8&255,k[$++]=T.low.low>>16&255,k[$++]=T.low.low>>24&255,k[$++]=255&T.low.high,k[$++]=T.low.high>>8&255,k[$++]=T.low.high>>16&255,k[$++]=T.low.high>>24&255,k[$++]=255&T.high.low,k[$++]=T.high.low>>8&255,k[$++]=T.high.low>>16&255,k[$++]=T.high.low>>24&255,k[$++]=255&T.high.high,k[$++]=T.high.high>>8&255,k[$++]=T.high.high>>16&255,k[$++]=T.high.high>>24&255,new tn(k)}toString(){let t,e=0,r=Array(36);for(let t=0;t<r.length;t++)r[t]=0;let n,o,i,s=0,a=!1,u={parts:[0,0,0,0]},c=[];s=0;let l=this.bytes,f=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,p=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,h=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24,y=l[s++]|l[s++]<<8|l[s++]<<16|l[s++]<<24;s=0,(new H(f,p),new H(h,y)).lessThan(H.ZERO)&&c.push("-");let d=y>>26&31;if(d>>3==3){if(30===d)return c.join("")+"Infinity";if(31===d)return"NaN";t=y>>
115&16383,n=8+(y>>14&1)}else n=y>>14&7,t=y>>17&16383;let 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,e=function(t){let e=H.fromNumber(1e9),r=H.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=r.shiftLeft(32)).add(new H(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}(u);if(u=e.quotient,t=e.rem.low)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;let 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)&&c.push(".");for(let t=0;t<e;t++)c.push(`${r[s++]}`);c.push("E"),m>0?c.push(`+${m}`):c.push(`${m}`)}else if(b>=0)for(let t=0;t<e;t++)c.push(`${r[s++]}`);else{let t=e+b;if(t>0)for(let e=0;e<t;e++)c.push(`${r[s++]}`);else c.push("0");for(c.push(".");t++<0;)c.push("0");for(let n=0;n<e-Math.max(t-1,0);n++)c.push(`${r[s++]}`)}return c.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(t){return tn.fromString(t.$numberDecimal)}inspect(t,e,r){return r??=y,`new Decimal128(${r(this.toString(),e)})`}}class to extends T{get _bsontype(){return"Double"}constructor(t){super(),t instanceof Number&&(t=t.valueOf()),this.value=+t}static fromString(t){let e=Number(t);if("NaN"===t)return new to(NaN);if("Infinity"===t)return new to(1/0);if("-Infinity"===t)return new to(-1/0);if(!Number.isFinite(e))throw new v(`Input: ${t} is not representable as a Double`);if(t.trim()!==t)throw new v(`Input: '${t}' contains whitespace`);if(""===t)throw new v("Input is an empty string");if(/[^-0-9.+eE]/.test(t))throw new v(`Input: '${t}' is not in decimal or exponential notation`);return new to(e)}valueOf(){return this.value}toJSON(){return this.value}toString(t){return this.value.toString(t)}toExtendedJSON(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-0.0"}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(t,e){let r=parseFloat(t.$numberDouble);return e&&e.relaxed?r:new to(r)}inspect(t,e,r){return r??=y,`new Double(${r(this.value,e)})`}}class ti extends T{get _bsontype(){return"Int32"}constructor(t){super(),t instanceof Number&&(t=t.valueOf()),this.value=0|t}static fromString(t){let e=q(t),r=Number(t);if(0x7fffffff<r)throw new v(`Input: '${t}' is larger than the maximum value for Int32`);if(-0x80000000>r)throw new v(`Input: '${t}' is smaller than the minimum value for Int32`);if(!Number.isSafeInteger(r))throw new v(`Input: '${t}' is not a safe integer`);if(r.toString()!==e)throw new v(`Input: '${t}' is not a valid Int32 string`);return new ti(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 ti(t.$numberInt)}inspect(t,e,r){return r??=y,`new Int32(${r(this.value,e)})`}}class ts extends T{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new ts}inspect(){return"new MaxKey()"}}class ta extends T{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new ta}inspect(){return"new MinKey()"}}let tu=null,tc=new WeakMap;class tl extends T{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 v("Argument passed in must have an id that is of type string or Buffer");e="toHexString"in t&&"function"==typeof t.toHexString?x.fromHex(t.toHexString()):t.id}else e=t;if(null==e||"number"==typeof e)this.buffer=tl.generate("number"==typeof e?e:void 0);else if(ArrayBuffer.isView(e)&&12===e.byteLength)this.buffer=x.toLocalBufferType(e);else{if("string"!=typeof e)throw new v("Argument passed in does not match the accepted types");if(!tl.validateHexString(e))throw new v("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");this.buffer=x.fromHex(e),tl.cacheHexString&&tc.set(this,e)}}get id(){return this.buffer}
1set id(t){this.buffer=t,tl.cacheHexString&&tc.set(this,x.toHex(t))}static validateHexString(t){if(24!==t?.length)return!1;for(let e=0;e<24;e++){let r=t.charCodeAt(e);if(!(r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70))return!1}return!0}toHexString(){if(tl.cacheHexString){let t=tc.get(this);if(t)return t}let t=x.toHex(this.id);return tl.cacheHexString&&tc.set(this,t),t}static getInc(){return tl.index=(tl.index+1)%0xffffff}static generate(t){"number"!=typeof t&&(t=Math.floor(Date.now()/1e3));let e=tl.getInc(),r=x.allocateUnsafe(12);return B.setInt32BE(r,0,t),null===tu&&(tu=x.randomBytes(5)),r[4]=tu[0],r[5]=tu[1],r[6]=tu[2],r[7]=tu[3],r[8]=tu[4],r[11]=255&e,r[10]=e>>8&255,r[9]=e>>16&255,r}toString(t){return"base64"===t?x.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(tl.is(t))return this.buffer[11]===t.buffer[11]&&x.equals(this.buffer,t.buffer);if("string"==typeof t)return t.toLowerCase()===this.toHexString();if("object"==typeof t&&"function"==typeof t.toHexString){let e=t.toHexString(),r=this.toHexString();return"string"==typeof e&&e.toLowerCase()===r}return!1}getTimestamp(){let t=new Date,e=B.getUint32BE(this.buffer,0);return t.setTime(1e3*Math.floor(e)),t}static createPk(){return new tl}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){let e=x.allocate(12);for(let t=11;t>=4;t--)e[t]=0;return B.setInt32BE(e,0,t),new tl(e)}static createFromHexString(t){if(24!==t?.length)throw new v("hex string must be 24 characters");return new tl(x.fromHex(t))}static createFromBase64(t){if(16!==t?.length)throw new v("base64 string must be 16 characters");return new tl(x.fromBase64(t))}static isValid(t){if(null==t)return!1;if("string"==typeof t)return tl.validateHexString(t);try{return new tl(t),!0}catch{return!1}}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(t){return new tl(t.$oid)}isCached(){return tl.cacheHexString&&tc.has(this)}inspect(t,e,r){return r??=y,`new ObjectId(${r(this.toHexString(),e)})`}}function tf(t,e,r){let n=5;if(Array.isArray(t))for(let o=0;o<t.length;o++)n+=tp(o.toString(),t[o],e,!0,r);else for(let o of("function"==typeof t?.toBSON&&(t=t.toBSON()),Object.keys(t)))n+=tp(o,t[o],e,!1,r);return n}function tp(t,e,r=!1,n=!1,o=!1){switch("function"==typeof e?.toBSON&&(e=e.toBSON()),typeof e){case"string":return 1+x.utf8ByteLength(t)+1+4+x.utf8ByteLength(e)+1;case"number":return Math.floor(e)===e&&e>=-0x20000000000000&&e<=0x20000000000000&&e>=-0x80000000&&e<=0x7fffffff?(null!=t?x.utf8ByteLength(t)+1:0)+5:(null!=t?x.utf8ByteLength(t)+1:0)+9;case"undefined":return n||!o?(null!=t?x.utf8ByteLength(t)+1:0)+1:0;case"boolean":return(null!=t?x.utf8ByteLength(t)+1:0)+2;case"object":if(null!=e&&"string"==typeof e._bsontype&&6!==e[d])throw new g;if(null==e||"MinKey"===e._bsontype||"MaxKey"===e._bsontype)return(null!=t?x.utf8ByteLength(t)+1:0)+1;if("ObjectId"===e._bsontype)return(null!=t?x.utf8ByteLength(t)+1:0)+13;if(e instanceof Date||h(e))return(null!=t?x.utf8ByteLength(t)+1:0)+9;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||l(e))return(null!=t?x.utf8ByteLength(t)+1:0)+6+e.byteLength;if("Long"===e._bsontype||"Double"===e._bsontype||"Timestamp"===e._bsontype)return(null!=t?x.utf8ByteLength(t)+1:0)+9;if("Decimal128"===e._bsontype)return(null!=t?x.utf8ByteLength(t)+1:0)+17;if("Code"===e._bsontype)return null!=e.scope&&Object.keys(e.scope).length>0?(null!=t?x.utf8ByteLength(t)+1:0)+1+4+4+x.utf8ByteLength(e.code.toString())+1+tf(e.scope,r,o):(null!=t?x.utf8ByteLength(t)+1:0)+1+4+x.utf8ByteLength(e.code.toString())+1;if("Binary"===e._bsontype){let r=e;return r.sub_type===M.SUBTYPE_BYTE_ARRAY?(null!=t?x.utf8ByteLength(t)+1:0)+(r.position+1+4+1+4):(null!=t?x.utf8ByteLength(t)+1:0)+(r.position+1+4+1)}if("Symbol"===e._bsontype)return(null!=t?x.utf8ByteLength(t)+1:0)+x.utf8ByteLength(e.value)+4+1+1;if("DBRef"===e._bsontype){let n=Object.assign({$ref:e.collection,$id:e.oid},e.fields);return null!=e.db&&(n.$db=e.db),(null!=t?x.utf8ByteLength(t)+1:0)+1+tf(n,r,o)}return e instanceof RegExp||f(e)?(null!=t?x.utf8ByteLength(t)+1:0)+1+x.utf8ByteLength(e.source)+1+ +!!e.global+ +!!e.ignoreCase+ +!!e.multiline+1:"BSONRegExp"===e._bsontype?(null!=t?x.utf8ByteLength(t)+1:0)+1+x.utf8ByteLength(e.pattern)+1+x.utf8ByteLength(e.options)+1:(null!=t?x.utf8ByteLength(t)+1:0)+tf(e,r,o)+1;case"function":return r?(null!=t?x.utf8ByteLength(t)+1:0)+1+4+x.utf8ByteLength(e.toString())+1:0;case"bigint":return(null!=t?x.utf8ByteLength(t)+1:0)+9;case"symbol":return 0;default:throw new v("Unrecognized JS type: "+typeof e)}}tl.index=Math.floor(0xffffff*Math.random());class th extends T{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 v(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(-1!==this.options.indexOf("\0"))throw new v(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let t=0;t<this.options.length;t++)if("i"!==this.options[t]&&"m"!==this.options[t]&&"x"!==this.options[t]&&"l"!==this.options[t]&&"s"!==this.options[t]&&"u"!==this.options[t])throw new v(`The regular expression o
1ption [${this.options[t]}] is not supported`)}static parseOptions(t){return t?t.split("").sort().join(""):""}toExtendedJSON(t){return(t=t||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(t){if("$regex"in t){if("string"==typeof t.$regex)return new th(t.$regex,th.parseOptions(t.$options));if("BSONRegExp"===t.$regex._bsontype)return t}if("$regularExpression"in t)return new th(t.$regularExpression.pattern,th.parseOptions(t.$regularExpression.options));throw new v(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(t)}`)}inspect(t,e,r){let n=function(t){if(null!=t&&"object"==typeof t&&"stylize"in t&&"function"==typeof t.stylize)return t.stylize}(e)??(t=>t);return r??=y,`new BSONRegExp(${n(r(this.pattern),"regexp")}, ${n(r(this.options),"regexp")})`}}class ty extends T{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 ty(t.$symbol)}inspect(t,e,r){return r??=y,`new BSONSymbol(${r(this.value,e)})`}}let td=H;class tb extends td{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(H.isLong(t))super(t.low,t.high,!0);else{if("object"!=typeof t||!("t"in t)||!("i"in t))throw new v("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 v("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 v("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 v("Timestamp constructed from { t, i } must provide a positive t");if(r<0||Number.isNaN(r))throw new v("Timestamp constructed from { t, i } must provide a positive i");if(e>0xffffffff)throw new v("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(r>0xffffffff)throw new v("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 tb(H.fromInt(t,!0))}static fromNumber(t){return new tb(H.fromNumber(t,!0))}static fromBits(t,e){return new tb({i:t,t:e})}static fromString(t,e){return new tb(H.fromString(t,!0,e))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(t){let e=H.isLong(t.$timestamp.i)?t.$timestamp.i.getLowBitsUnsigned():t.$timestamp.i;return new tb({t:H.isLong(t.$timestamp.t)?t.$timestamp.t.getLowBitsUnsigned():t.$timestamp.t,i:e})}inspect(t,e,r){return r??=y,`new Timestamp({ t: ${r(this.t,e)}, i: ${r(this.i,e)} })`}}tb.MAX_VALUE=H.MAX_UNSIGNED_VALUE;let tm=H.fromNumber(0x20000000000000),tv=H.fromNumber(-0x20000000000000);function tg(t,e,r){let n=(e=null==e?{}:e)&&e.index?e.index:0,o=B.getInt32LE(t,n);if(o<5)throw new v(`bson size must be >= 5, is ${o}`);if(e.allowObjectSmallerThanBufferSize&&t.length<o)throw new v(`buffer length ${t.length} must be >= bson size ${o}`);if(!e.allowObjectSmallerThanBufferSize&&t.length!==o)throw new v(`buffer length ${t.length} must === bson size ${o}`);if(o+n>t.byteLength)throw new v(`(bson size ${o} + options.index ${n} must be <= buffer length ${t.byteLength})`);if(0!==t[n+o-1])throw new v("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return function t(e,r,n,o=!1){let i=null==n.fieldsAsRaw?null:n.fieldsAsRaw,s=null!=n.raw&&n.raw,a="boolean"==typeof n.bsonRegExp&&n.bsonRegExp,u=n.promoteBuffers??!1,c=n.promoteLongs??!0,l=n.promoteValues??!0,f=n.useBigInt64??!1;if(f&&!l||f&&!c)throw new v("Must either request bigint or Long for int64 deserialization");let p,h,y=!0,d=(null==n.validation?{utf8:!0}:n.validation).utf8;if("boolean"==typeof d)p=d;else{y=!1;let t=Object.keys(d).map(function(t){return d[t]});if(0===t.length)throw new v("UTF-8 validation setting cannot be empty");if("boolean"!=typeof t[0])throw new v("Invalid UTF-8 validation option, must specify boolean values");if(p=t[0],!t.every(t=>t===p))throw new v("Invalid UTF-8 validation option - keys must be all true or all false")}if(!y)for(let t of(h=new Set,Object.keys(d)))h.add(t);let b=r;if(e.length<5)throw new v("corrupt bson message < 5 bytes long");let m=B.getInt32LE(e,r);if(r+=4,m<5||m>e.length)throw new v("corrupt bson message");let g=o?[]:{},_=0,O=!o&&null;for(;;){let d=e[r++];if(0===d)break;let b=r;for(;0!==e[b]&&b<e.length;)b++;if(b>=e.byteLength)throw new v("Bad BSON Document: illegal CString");let m=o?_++:x.toUTF8(e,r,b,!1),w,S=!0;if(S=y||h?.has(m)?p:!p,!1!==O&&"$"===m[0]&&(O=t_.test(m)),r=b+1,2===d){let t=B.getInt32LE(e,r);if(r+=4,t<=0||t>e.length-r||0!==e[r+t-1])throw new v("bad string length in bson");w=x.toUTF8(e,r,r+t-1,S),r+=t}else if(7===d){let t=x.allocateUnsafe(12);for(let n=0;n<12;n++)t[n]=e[r+n];w=new tl(t),r+=12}else if(16===d&&!1===l)w=new ti(B.getInt32LE(e,r)),r+=4;else if(16===d)w=B.getInt32LE(e,r),r+=4;else if(1===d)w=B.getFloat64LE(e,r),r+=8,!1===l&&(w=new to(w));else if(9===d){let t=B.getInt32LE(e,r),n=B.getInt32LE(e,r+4);r+=8,w=new Date(new H(t,n).toNumber())}else if(8===d){if(0!==e[r]&&1!==e[r])throw new v("illegal boolean type value");w=1===e[r++]}else if(3===d){let o=r,i=B.getInt32LE(e,r);if(i<=0||i>e.length-r)throw new v("bad embedded document length in bson");if(s)w=e.subarray(r,r+i);else{let r=n;y||(r={...n,validation:{utf8:S}}),w=t(e,o,r,!1)}r+=i}else if(4===d){let o=r,s=B.getInt32LE(e,r),a=n,u=r+s;if(i&&i[m]&&(a={...n,raw:!0}),y||(a={...a,validation:{utf8:S}}),w=t(e,o,a,!0),0!==e[(r+=s)-1])throw new v("invalid array terminator byte");if(r!==u)throw new v("corrupted array bson")}else if(6===d)w=void 0;else if(10===d)w=null;else if(18===d)if(f)w=B.getBigInt64LE(e,r),r+=8;else{let t=B.getInt32LE(e,r),n=B.getInt32LE(e,r+4);r+=8;let o=new H(t,n);w=c&&!0===l&&o.lessThanOrEqual(tm)&&o.greaterThanOrEqual(tv)?o.toNumber():o}else if(19===d){let t=x.allocateUnsafe(16);for(let n=0;n<16;n++)t[n]=e[r+n];r+=16,w=new tn(t)}else if(5===d){let t=B.getInt32LE(e,r);r+=4;let n=t,o=e[r++];if(t<0)throw new v("Negative binary type element size found");if(t>e.byteLength)throw new v("Binary type size larger than document size");if(o===M.SUBTYPE_BYTE_ARRAY){if(t=B.getInt32LE(e,r),r+=4,t<0)throw new v("Negative binary type element size found for subtype 0x02");if(t>n-4)throw new v("Binary type with subtype 0x02 contains too long binary size");if(t<n-4)throw new v("Binary type with subtype 0x02 contains too short binary size")}u&&l?w=x.toLocalBufferType(e.subarray(r,r+t)):(w=new M(e.subarray(r,r+t),o),4===o&&C.isValid(w)&&(w=w.toUUID())),r+=t}else if(11===d&&!1===a){for(b=r;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new v("Bad BSON Document: illegal CString");let t=x.toUTF8(e,r,b,!1);for(b=r=b+1;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new v("Bad BSON Document: illegal CString");let n=x.toUTF8(e,r,b,!1);r=b+1;let o=Array(n.length);for(b=0;b<n.length;b++)switch(n[b]){case"m":o[b]="m";break;case"s":o[b]="g";break;case"i":o[b]="i"}w=new RegExp(t,o.join(""))}else if(11===d&&!0===a){for(b=r;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new v("Bad BSON Document: illegal CString");let t=x.toUTF8(e,r,b,!1);for(b=r=b+1;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new v("Bad BSON Document: illegal CString");let n=x.toUTF8(e,r,b,!1);r=b+1,w=new th(t,n)}else if(14===d){let t=B.getInt32LE(e,r);if(r+=4,t<=0||t>e.length-r||0!==e[r+t-1])throw new v("bad string length in bson");let n=x.toUTF8(e,r,r+t-1,S);w=l?n:new ty(n),r+=t}else if(17===d)w=new tb({i:B.getUint32LE(e,r),t:B.getUint32LE(e,r+4)}),r+=8;else if(255===d)w=new ta;else if(127===d)w=new ts;else if(13===d){let t=B.getInt32LE(e,r);if(r+=4,t<=0||t>e.length-r||0!==e[r+t-1])throw new v("bad string length in bson");w=new F(x.toUTF8(e,r,r+t-1,S)),r+=t}else if(15===d){let o=B.getInt32LE(e,r);if(r+=4,o<13)throw new v("code_w_scope total size shorter minimum expected length");let i=B.getInt32LE(e,r);if(r+=4,i<=0||i>e.length-r||0!==e[r+i-1])throw new v("bad string length in bson");let s=x.toUTF8(e,r,r+i-1,S),a=r+=i,u=B.getInt32LE(e,r),c=t(e,a,n,!1);if(r+=u,o<8+u+i)throw new v("code_w_scope total size is too short, truncating scope");if(o>8+u+i)throw new v("code_w_scope total size is too long, clips outer document");w=new F(s,c)}else{if(12!==d)throw new v(`Detected unknown BSON type ${d.toString(16)} for fieldname "${m}"`);{let t=B.getInt32LE(e,r);if(r+=4,t<=0||t>e.length-r||0!==e[r+t-1])throw new v("bad string length in bson");let n=x.toUTF8(e,r,r+t-1,S);r+=t;let o=x.allocateUnsafe(12);for(let t=0;t<12;t++)o[t]=e[r+t];r+=12,w=new V(n,new tl(o))}}"__proto__"===m?Object.defineProperty(g,m,{value:w,writable:!0,enumerable:!0,configurable:!0}):g[m]=w}if(m!==r-b){if(o)throw new v("corrupt array bson");throw new v("corrupt object bson")}if(!O)return g;if(L(g)){let t=Object.assign({},g);return delete t.$ref,delete t.$id,delete t.$db,new V(g.$ref,g.$id,g.$db,t)}return g}(t,n,e,r)}let t_=/^\$ref$|^\$id$|^\$db$/,tO=/\x00/,tw=new Set(["$db","$ref","$id","$clusterTime"]);function tS(t,e,r,n){t[n++]=2,t[(n=n+x.encodeUTF8Into(t,e,n)+1)-1]=0;let o=x.encodeUTF8Into(t,r,n+4);return B.setInt32LE(t,n,o+1),n=n+4+o,t[n++]=0,n}function t$(t,e,r,n){let o=!Object.is(r,-0)&&Number.isSafeInteger(r)&&r<=0x7fffffff&&r>=-0x80000000?16:1;return t[n++]=o,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,n+(16===o?B.setInt32LE(t,n,r):B.setFloat64LE(t,n,r))}function tj(t,e,r,n){return t[n++]=18,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,n+B.setBigInt64LE(t,n,r)}function tP(t,e,r,n){return t[n++]=10,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,n}function tA(t,e,r,n){return t[n++]=8,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,t[n++]=+!!r,n}function tE(t,e,r,n){t[n++]=9,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let o=H.fromNumber(r.getTime()),i=o.getLowBits(),s=o.getHighBits();return(n+=B.setInt32LE(t,n,i))+B.setInt32LE(t,n,s)}function tx(t,e,r,n){if(t[n++]=11,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,r.source&&null!=r.source.match(tO))throw new v("value "+r.source+" must not contain null bytes");return n+=x.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 tT(t,e,r,n){if(t[n++]=11,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,null!=r.pattern.match(tO))throw new v("pattern "+r.pattern+" must not contain null bytes");n+=x.encodeUTF8Into(t,r.pattern,n),t[n++]=0;let o=r.options.split("").sort().join("");return n+=x.encodeUTF8Into(t,o,n),t[n++]=0,n}function tk(t,e,r,n){return null===r?t[n++]=10:"MinKey"===r._bsontype?t[n++]=255:t[n++]=127,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,n}function tN(t,e,r,n){return t[n++]=7,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,n+r.serializeInto(t,n)}function tI(t,e,r,n){t[n++]=5,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let o=r.length;if(n+=B.setInt32LE(t,n,o),t[n++]=0,o<=16)for(let e=0;e<o;e++)t[n+e]=r[e];else t.set(r,n);return n+o}function tB(t,e,r,n,o,i,s,a,u){if(u.has(r))throw new v("Cannot convert circular structure to BSON");u.add(r),t[n++]=Array.isArray(r)?4:3,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let c=tJ(t,r,o,n,i+1,s,a,u);return u.delete(r),c}function tM(t,e,r,n){t[n++]=19,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;for(let e=0;e<16;e++)t[n+e]=r.bytes[e];return n+16}function tD(t,e,r,n){t[n++]="Long"===r._bsontype?18:17,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let o=r.getLowBits(),i=r.getHighBits();return(n+=B.setInt32LE(t,n,o))+B.setInt32LE(t,n,i)}
1function tR(t,e,r,n){return r=r.valueOf(),t[n++]=16,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,n+B.setInt32LE(t,n,r)}function tU(t,e,r,n){return t[n++]=1,n+=x.encodeUTF8Into(t,e,n),t[n++]=0,n+B.setFloat64LE(t,n,r.value)}function tC(t,e,r,n){t[n++]=13,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let o=r.toString(),i=x.encodeUTF8Into(t,o,n+4)+1;return B.setInt32LE(t,n,i),n=n+4+i-1,t[n++]=0,n}function tF(t,e,r,n,o=!1,i=0,s=!1,a=!0,u){if(r.scope&&"object"==typeof r.scope){t[n++]=15,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let c=n,l=r.code;n+=4;let f=x.encodeUTF8Into(t,l,n+4)+1;B.setInt32LE(t,n,f),t[n+4+f-1]=0,n=n+f+4;let p=tJ(t,r.scope,o,n,i+1,s,a,u);n=p-1;let h=p-c;c+=B.setInt32LE(t,c,h),t[n++]=0}else{t[n++]=13,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let o=r.code.toString(),i=x.encodeUTF8Into(t,o,n+4)+1;B.setInt32LE(t,n,i),n=n+4+i-1,t[n++]=0}return n}function tL(t,e,r,n){t[n++]=5,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let o=r.buffer,i=r.position;if(r.sub_type===M.SUBTYPE_BYTE_ARRAY&&(i+=4),n+=B.setInt32LE(t,n,i),t[n++]=r.sub_type,r.sub_type===M.SUBTYPE_BYTE_ARRAY&&(i-=4,n+=B.setInt32LE(t,n,i)),r.sub_type===M.SUBTYPE_VECTOR&&D(r),i<=16)for(let e=0;e<i;e++)t[n+e]=o[e];else t.set(o,n);return n+r.position}function tV(t,e,r,n){t[n++]=14,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let o=x.encodeUTF8Into(t,r.value,n+4)+1;return B.setInt32LE(t,n,o),n=n+4+o-1,t[n++]=0,n}function tq(t,e,r,n,o,i,s){t[n++]=3,n+=x.encodeUTF8Into(t,e,n),t[n++]=0;let a=n,u={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(u.$db=r.db);let c=tJ(t,u=Object.assign(u,r.fields),!1,n,o+1,i,!0,s),l=c-a;return a+=B.setInt32LE(t,n,l),c}function tJ(t,e,r,n,o,i,s,a){if(null==a){if(null==e)return t[0]=5,t[1]=0,t[2]=0,t[3]=0,t[4]=0,5;if(Array.isArray(e))throw new v("serialize does not support an array as the root input");if("object"!=typeof e)throw new v("serialize does not support non-object as the root input");if("_bsontype"in e&&"string"==typeof e._bsontype)throw new v("BSON types cannot be serialized as a document");if(h(e)||f(e)||c(e)||l(e))throw new v("date, regexp, typedarray, and arraybuffer cannot be BSON documents");a=new Set}a.add(e);let u=n+4;if(Array.isArray(e))for(let n=0;n<e.length;n++){let l=`${n}`,p=e[n];"function"==typeof p?.toBSON&&(p=p.toBSON());let y=typeof p;if(void 0===p)u=tP(t,l,0,u);else if(null===p)u=tP(t,l,0,u);else if("string"===y)u=tS(t,l,p,u);else if("number"===y)u=t$(t,l,p,u);else if("bigint"===y)u=tj(t,l,p,u);else if("boolean"===y)u=tA(t,l,p,u);else if("object"===y&&null==p._bsontype)u=p instanceof Date||h(p)?tE(t,l,p,u):p instanceof Uint8Array||c(p)?tI(t,l,p,u):p instanceof RegExp||f(p)?tx(t,l,p,u):tB(t,l,p,u,r,o,i,s,a);else if("object"===y){if(6!==p[d])throw new g;if("ObjectId"===p._bsontype)u=tN(t,l,p,u);
1else if("Decimal128"===p._bsontype)u=tM(t,l,p,u);else if("Long"===p._bsontype||"Timestamp"===p._bsontype)u=tD(t,l,p,u);else if("Double"===p._bsontype)u=tU(t,l,p,u);else if("Code"===p._bsontype)u=tF(t,l,p,u,r,o,i,s,a);else if("Binary"===p._bsontype)u=tL(t,l,p,u);else if("BSONSymbol"===p._bsontype)u=tV(t,l,p,u);else if("DBRef"===p._bsontype)u=tq(t,l,p,u,o,i,a);else if("BSONRegExp"===p._bsontype)u=tT(t,l,p,u);else if("Int32"===p._bsontype)u=tR(t,l,p,u);else if("MinKey"===p._bsontype||"MaxKey"===p._bsontype)u=tk(t,l,p,u);else if(void 0!==p._bsontype)throw new v(`Unrecognized or invalid _bsontype: ${String(p._bsontype)}`)}else"function"===y&&i&&(u=tC(t,l,p,u))}else if(e instanceof Map||p(e)){let n=e.entries(),l=!1;for(;!l;){let e=n.next();if(l=!!e.done)continue;let p=e.value?e.value[0]:void 0,y=e.value?e.value[1]:void 0;"function"==typeof y?.toBSON&&(y=y.toBSON());let b=typeof y;if("string"==typeof p&&!tw.has(p)){if(null!=p.match(tO))throw new v("key "+p+" must not contain null bytes");if(r){if("$"===p[0])throw new v("key "+p+" must not start with '$'");if(p.includes("."))throw new v("key "+p+" must not contain '.'")}}if(void 0===y)!1===s&&(u=tP(t,p,0,u));else if(null===y)u=tP(t,p,0,u);else if("string"===b)u=tS(t,p,y,u);else if("number"===b)u=t$(t,p,y,u);else if("bigint"===b)u=tj(t,p,y,u);else if("boolean"===b)u=tA(t,p,y,u);else if("object"===b&&null==y._bsontype)u=y instanceof Date||h(y)?tE(t,p,y,u):y instanceof Uint8Array||c(y)?tI(t,p,y,u):y instanceof RegExp||f(y)?tx(t,p,y,u):tB(t,p,y,u,r,o,i,s,a);else if("object"===b){if(6!==y[d])throw new g;if("ObjectId"===y._bsontype)u=tN(t,p,y,u);else if("Decimal128"===y._bsontype)u=tM(t,p,y,u);else if("Long"===y._bsontype||"Timestamp"===y._bsontype)u=tD(t,p,y,u);else if("Double"===y._bsontype)u=tU(t,p,y,u);else if("Code"===y._bsontype)u=tF(t,p,y,u,r,o,i,s,a);else if("Binary"===y._bsontype)u=tL(t,p,y,u);else if("BSONSymbol"===y._bsontype)u=tV(t,p,y,u);else if("DBRef"===y._bsontype)u=tq(t,p,y,u,o,i,a);else if("BSONRegExp"===y._bsontype)u=tT(t,p,y,u);else if("Int32"===y._bsontype)u=tR(t,p,y,u);else if("MinKey"===y._bsontype||"MaxKey"===y._bsontype)u=tk(t,p,y,u);else if(void 0!==y._bsontype)throw new v(`Unrecognized or invalid _bsontype: ${String(y._bsontype)}`)}else"function"===b&&i&&(u=tC(t,p,y,u))}}else{if("function"==typeof e?.toBSON&&null!=(e=e.toBSON())&&"object"!=typeof e)throw new v("toBSON function did not return an object");for(let n of Object.keys(e)){let l=e[n];"function"==typeof l?.toBSON&&(l=l.toBSON());let p=typeof l;if("string"==typeof n&&!tw.has(n)){if(null!=n.match(tO))throw new v("key "+n+" must not contain null bytes");if(r){if("$"===n[0])throw new v("key "+n+" must not start with '$'");if(n.includes("."))throw new v("key "+n+" must not contain '.'")}}if(void 0===l)!1===s&&(u=tP(t,n,0,u));else if(null===l)u=tP(t,n,0,u);else if("string"===p)u=tS(t,n,l,u);else if("number"===p)u=t$(t,n,l,u);else if("bigint"===p)u=tj(t,n,l,u);else if("boolean"===p)u=tA(t,n,l,u);else if("object"===p&&null==l._bsontype)u=l instanceof Date||h(l)?tE(t,n,l,u):l instanceof Uint8Array||c(l)?tI(t,n,l,u):l instanceof RegExp||f(l)?tx(t,n,l,u):tB(t,n,l,u,r,o,i,s,a);else if("object"===p){if(6!==l[d])throw new g;if("ObjectId"===l._bsontype)u=tN(t,n,l,u);else if("Decimal128"===l._bsontype)u=tM(t,n,l,u);else if("Long"===l._bsontype||"Timestamp"===l._bsontype)u=tD(t,n,l,u);else if("Double"===l._bsontype)u=tU(t,n,l,u);else if("Code"===l._bsontype)u=tF(t,n,l,u,r,o,i,s,a);else if("Binary"===l._bsontype)u=tL(t,n,l,u);else if("BSONSymbol"===l._bsontype)u=tV(t,n,l,u);else if("DBRef"===l._bsontype)u=tq(t,n,l,u,o,i,a);else if("BSONRegExp"===l._bsontype)u=tT(t,n,l,u);else if("Int32"===l._bsontype)u=tR(t,n,l,u);else if("MinKey"===l._bsontype||"MaxKey"===l._bsontype)u=tk(t,n,l,u);else if(void 0!==l._bsontype)throw new v(`Unrecognized or invalid _bsontype: ${String(l._bsontype)}`)}else"function"===p&&i&&(u=tC(t,n,l,u))}}a.delete(e),t[u++]=0;let y=u-n;return n+=B.setInt32LE(t,n,y),u}let tz={$oid:tl,$binary:M,$uuid:M,$symbol:ty,$numberInt:ti,$numberDecimal:tn,$numberDouble:to,$numberLong:H,$minKey:ta,$maxKey:ts,$regex:th,$regularExpression:th,$timestamp:tb};function tK(t){let e=t.toISOString();return 0!==t.getUTCMilliseconds()?e:e.slice(0,-5)+"Z"}let tH={Binary:t=>new M(t.value(),t.sub_type),Code:t=>new F(t.code,t.scope),DBRef:t=>
1new V(t.collection||t.namespace,t.oid,t.db,t.fields),Decimal128:t=>new tn(t.bytes),Double:t=>new to(t.value),Int32:t=>new ti(t.value),Long:t=>H.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_),MaxKey:()=>new ts,MinKey:()=>new ta,ObjectId:t=>new tl(t),BSONRegExp:t=>new th(t.pattern,t.options),BSONSymbol:t=>new ty(t.value),Timestamp:t=>tb.fromBits(t.low,t.high)};function tW(t,e){let 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 v(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(t)}`);return function t(e,r={}){if("number"==typeof e){let t=e<=0x7fffffff&&e>=-0x80000000,n=e<=b&&e>=-0x8000000000000000;if(r.relaxed||r.legacy)return e;if(Number.isInteger(e)&&!Object.is(e,-0)){if(t)return new ti(e);if(n)return r.useBigInt64?BigInt(e):H.fromNumber(e)}return new to(e)}if(null==e||"object"!=typeof e)return e;if(e.$undefined)return null;let n=Object.keys(e).filter(t=>t.startsWith("$")&&null!=e[t]);for(let t=0;t<n.length;t++){let o=tz[n[t]];if(o)return o.fromExtendedJSON(e,r)}if(null!=e.$date){let t=e.$date,n=new Date;if(r.legacy)if("number"==typeof t)n.setTime(t);else if("string"==typeof t)n.setTime(Date.parse(t));else{if("bigint"!=typeof t)throw new _("Unrecognized type for EJSON date: "+typeof t);n.setTime(Number(t))}else if("string"==typeof t)n.setTime(Date.parse(t));else if(H.isLong(t))n.setTime(t.toNumber());else if("number"==typeof t&&r.relaxed)n.setTime(t);else{if("bigint"!=typeof t)throw new _("Unrecognized type for EJSON date: "+typeof t);n.setTime(Number(t))}return n}if(null!=e.$code){let r=Object.assign({},e);return e.$scope&&(r.$scope=t(e.$scope)),F.fromExtendedJSON(e)}if(L(e)||e.$dbPointer){let t=e.$ref?e:e.$dbPointer;if(t instanceof V)return t;let r=Object.keys(t).filter(t=>t.startsWith("$")),n=!0;if(r.forEach(t=>{-1===["$ref","$id","$db"].indexOf(t)&&(n=!1)}),n)return V.fromExtendedJSON(t)}return e}(e,r)})}function tG(t,e,r,n){return null!=r&&"object"==typeof r&&(n=r,r=0),null==e||"object"!=typeof e||Array.isArray(e)||(n=e,e=void 0,r=0),JSON.stringify(function t(e,r){if(e instanceof Map||p(e)){let n=Object.create(null);for(let[t,r]of e){if("string"!=typeof t)throw new v("Can only serialize maps with string keys");n[t]=r}return t(n,r)}if(("object"==typeof e||"function"==typeof e)&&null!==e){let t=r.seenObjects.findIndex(t=>t.obj===e);if(-1!==t){let e=r.seenObjects.map(t=>t.propertyName),n=e.slice(0,t).map(t=>`${t} -> `).join(""),o=e[t],i=" -> "+e.slice(t+1,e.length-1).map(t=>`${t} -> `).join(""),s=e[e.length-1],a=" ".repeat(n.length+o.length/2),u="-".repeat(i.length+(o.length+s.length)/2-1);throw new v(`Converting circular structure to EJSON:
2    ${n}${o}${i}${s}
3    ${a}\\${u}/`)}r.seenObjects[r.seenObjects.length-1].obj=e}if(Array.isArray(e))return e.map((e,n)=>{r.seenObjects.push({propertyName:`index ${n}`,obj:null});try{return t(e,r)}finally{r.seenObjects.pop()}});if(void 0===e)return null;if(e instanceof Date||h(e)){let t=e.getTime(),n=t>-1&&t<2534023188e5;return r.legacy?r.relaxed&&n?{$date:e.getTime()}:{$date:tK(e)}:r.relaxed&&n?{$date:tK(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(!("number"!=typeof e||r.relaxed&&isFinite(e))){if(Number.isInteger(e)&&!Object.is(e,-0)){if(e>=-0x80000000&&e<=0x7fffffff)return{$numberInt:e.toString()};if(e>=-0x8000000000000000&&e<=b)return{$numberLong:e.toString()}}return{$numberDouble:Object.is(e,-0)?"-0.0":e.toString()}}if("bigint"==typeof e)return r.relaxed?Number(BigInt.asIntN(64,e)):{$numberLong:BigInt.asIntN(64,e).toString()};if(e instanceof RegExp||f(e)){let t=e.flags;if(void 0===t){let r=e.toString().match(/[gimuy]*$/);r&&(t=r[0])}return new th(e.source,t).toExtendedJSON(r)}return null!=e&&"object"==typeof e?function(e,r){if(null==e||"object"!=typeof e)throw new v("not an object instance");let n=e._bsontype;if(void 0===n){let n={};for(let o of Object.keys(e)){r.seenObjects.push({propertyName:o,obj:null});try{let i=t(e[o],r);"__proto__"===o?Object.defineProperty(n,o,{value:i,writable:!0,enumerable:!0,configurable:!0}):n[o]=i}finally{r.seenObjects.pop()}}return n}if(null!=e&&"object"==typeof e&&"string"==typeof e._bsontype&&6!==e[d])throw new g;if(null!=e&&"object"==typeof e&&"_bsontype"in e&&"string"==typeof e._bsontype){let o=e;if("function"!=typeof o.toExtendedJSON){let t=tH[e._bsontype];
3if(!t)throw new v("Unrecognized or invalid _bsontype: "+e._bsontype);o=t(o)}return"Code"===n&&o.scope?o=new F(o.code,t(o.scope,r)):"DBRef"===n&&o.oid&&(o=new V(t(o.collection,r),t(o.oid,r),t(o.db,r),t(o.fields,r))),o.toExtendedJSON(r)}throw new v("_bsontype must be a string, but was: "+typeof n)}(e,r):e}(t,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]})),e,r)}let tQ=Object.create(null);function tY(t,e){try{return B.getNonnegativeInt32LE(t,e)}catch(t){throw new O("BSON size cannot be negative",e,{cause:t})}}function tZ(t,e){let r=e;for(;0!==t[r];r++);if(r===t.length-1)throw new O("Null terminator not found",e);return r}tQ.parse=tW,tQ.stringify=tG,tQ.serialize=function(t,e){return JSON.parse(tG(t,e=e||{}))},tQ.deserialize=function(t,e){return e=e||{},tW(JSON.stringify(t),e)},Object.freeze(tQ);let tX=Object.create(null);tX.parseToElements=function(t,e=0){if(e??=0,t.length<5)throw new O(`Input must be at least 5 bytes, got ${t.length} bytes`,e);let r=tY(t,e);if(r>t.length-e)throw new O(`Parsed documentSize (${r} bytes) does not match input length (${t.length} bytes)`,e);if(0!==t[e+r-1])throw new O("BSON documents must end in 0x00",e+r);let n=[],o=e+4;for(;o<=r+e;){let i,s=t[o];if(o+=1,0===s){if(o-e!==r)throw new O("Invalid 0x00 type byte",o);break}let a=o,u=tZ(t,o)-a;if(o+=u+1,1===s||18===s||9===s||17===s)i=8;else if(16===s)i=4;else if(7===s)i=12;else if(19===s)i=16;else if(8===s)i=1;else if(10===s||6===s||127===s||255===s)i=0;else if(11===s)i=tZ(t,tZ(t,o)+1)+1-o;else if(3===s||4===s||15===s)i=tY(t,o);else{if(2!==s&&5!==s&&12!==s&&13!==s&&14!==s)throw new O(`Invalid 0x${s.toString(16).padStart(2,"0")} type byte`,o);i=tY(t,o)+4,5===s&&(i+=1),12===s&&(i+=12)}if(i>r)throw new O("value reports length larger than document",o);n.push([s,a,u,o,i]),o+=i}return n},tX.ByteUtils=x,tX.NumberUtils=B,Object.freeze(tX);let t0=x.allocate(0x1100000);function t1(t){t0.length<t&&(t0=x.allocate(t))}function t2(t,e={}){let r="boolean"==typeof e.checkKeys&&e.checkKeys,n="boolean"==typeof e.serializeFunctions&&e.serializeFunctions,o="boolean"!=typeof e.ignoreUndefined||e.ignoreUndefined,i="number"==typeof e.minInternalBufferSize?e.minInternalBufferSize:0x1100000;t0.length<i&&(t0=x.allocate(i));let s=tJ(t0,t,r,0,0,n,o,null),a=x.allocateUnsafe(s);return a.set(t0.subarray(0,s),0),a}function t3(t,e,r={}){let n="boolean"==typeof r.checkKeys&&r.checkKeys,o="boolean"==typeof r.serializeFunctions&&r.serializeFunctions,i="boolean"!=typeof r.ignoreUndefined||r.ignoreUndefined,s="number"==typeof r.index?r.index:0,a=tJ(t0,t,n,0,0,o,i,null);return e.set(t0.subarray(0,a),s),s+a-1}function t8(t,e={}){return tg(x.toLocalBufferType(t),e)}function t6(t,e={}){return tf(t,"boolean"==typeof(e=e||{}).serializeFunctions&&e.serializeFunctions,"boolean"!=typeof e.ignoreUndefined||e.ignoreUndefined)}function t5(t,e,r,n,o,i){let s=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},i),a=x.toLocalBufferType(t),u=e;for(let t=0;t<r;t++){let e=B.getInt32LE(a,u);s.index=u,n[o+t]=tg(a,s),u+=e}return u}var t4=Object.freeze({__proto__:null,BSONError:v,BSONOffsetError:O,BSONRegExp:th,BSONRuntimeError:_,BSONSymbol:ty,BSONType:m,BSONValue:T,BSONVersionError:g,Binary:M,Code:F,DBRef:V,Decimal128:tn,Double:to,EJSON:tQ,Int32:ti,Long:H,MaxKey:ts,MinKey:ta,ObjectId:tl,Timestamp:tb,UUID:C,calculateObjectSize:t6,deserialize:t8,deserializeStream:t5,onDemand:tX,serialize:t2,serializeWithBufferAndIndex:t3,setInternalBufferSize:t1})},6365:(t,e,r)=>{"use strict";var n=r(5832).hp,o=r(6353).Binary,i=r(6353).UUID,s=r(8768);function a(t,e,r){var o,i,u,l,f=t;return null==t&&(f=0),Array.isArray(e)?(i=e[0],u=e[1]):o=e,l="number"==typeof f||f instanceof Number?n.alloc(f):n.from(f,o,r),s.decorate(l,a.mixin),l.isMongooseBuffer=!0,l[a.pathSymbol]=i,l[c]=u,l._subtype=0,l}var u=Symbol.for("mongoose#Buffer#_path"),c=Symbol.for("mongoose#Buffer#_parent");a.pathSymbol=u,a.mixin={_subtype:void 0,_markModified:function(){var t=this[c];return t&&t.markModified(this[a.pathSymbol]),this},write:function(){var t=n.prototype.write.apply(this,arguments);return t>0&&this._markModified(),t},copy:function(t){var e=n.prototype.copy.apply(this,arguments);return t&&t.isMongooseBuffer&&t._markModified(),e}}
3,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 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)||this.length!==t.length)return!1;for(var e=0;e<this.length;++e)if(this[e]!==t[e])return!1;return!0},a.mixin.subtype=function(t){if("number"!=typeof t)throw TypeError("Invalid subtype. Expected a number");this._subtype!==t&&this._markModified(),this._subtype=t},a.Binary=o,t.exports=a},6400:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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,O=function(t){try{return _('"use strict"; return ('+t+").constructor;")()}catch(t){}},w=r(1464),S=r(988),$=function(){throw new f},j=w?function(){try{return $}catch(t){try{return w(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="u">typeof Uint8Array&&A?A(Uint8Array):o,B={__proto__:null,"%AggregateError%":"u"<typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"u"<typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":P&&A?A([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":"u"<typeof Atomics?o:Atomics,"%BigInt%":"u"<typeof BigInt?o:BigInt,"%BigInt64Array%":"u"<typeof BigInt64Array?o:BigInt64Array,"%BigUint64Array%":"u"<typeof BigUint64Array?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"u"<typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"u"<typeof Float16Array?o:Float16Array,"%Float32Array%":"u"<typeof Float32Array?o:Float32Array,"%Float64Array%":"u"<typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"u"<typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":N,"%Int8Array%":"u"<typeof Int8Array?o:Int8Array,"%Int16Array%":"u"<typeof Int16Array?o:Int16Array,"%Int32Array%":"u"<typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
3IteratorPrototype%":P&&A?A(A([][Symbol.iterator]())):o,"%JSON%":"object"===("u"<typeof JSON?"undefined":n(JSON))?JSON:o,"%Map%":"u"<typeof Map?o:Map,"%MapIteratorPrototype%":"u">typeof Map&&P&&A?A((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"u"<typeof Promise?o:Promise,"%Proxy%":"u"<typeof Proxy?o:Proxy,"%RangeError%":u,"%ReferenceError%":c,"%Reflect%":"u"<typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"u"<typeof Set?o:Set,"%SetIteratorPrototype%":"u">typeof Set&&P&&A?A((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"u"<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%":"u"<typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"u"<typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"u"<typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"u"<typeof Uint32Array?o:Uint32Array,"%URIError%":p,"%WeakMap%":"u"<typeof WeakMap?o:WeakMap,"%WeakRef%":"u"<typeof WeakRef?o:WeakRef,"%WeakSet%":"u"<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 M=A(A(t));B["%Error.prototype%"]=M}var D=function t(e){var r;if("%AsyncFunction%"===e)r=O("async function () {}");else if("%GeneratorFunction%"===e)r=O("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=O("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=D(n)),void 0===o&&!e)throw new f("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new f('"allowMissing" argument must be a boolean');if(null===J(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=q(t,0,1),r=q(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return V(t,z,function(t,e,r,o){n[n.length]=r?V(o,K,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",o=H("%"+n+"%",e),i=o.name,s=o.value,a=!1,u=o.alias;u&&(n=u[0],L(r,F([0,1],u)));for(var c=1,p=!0;c<r.length;c+=1){var h=r[c],y=q(h,0,1),d=q(h,-1);if(('"'===y||"'"===y||"`"===y||'"'===d||"'"===d||"`"===d)&&y!==d)throw new l("property names with quotes must have matching quotes");if("constructor"!==h&&p||(a=!0),C(B,i="%"+(n+="."+h)+"%"))s=B[i];else if(null!=s){if(!(h in s)){if(!e)throw new f("base intrinsic for "+t+" exists, but the property is not available.");return}if(w&&c+1>=r.length){var b=w(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})(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}var i=r(3609),s=r(6426),a=r(8953),u=r(4327);function c(t,e){s.call(this,t,e,"Boolean")}c.schemaName="Boolean",c.defaultOptions={},c.prototype=Object.create(s.prototype),c.prototype.constructor=c,c._c
3ast=a,c.set=s.set,c.setters=[],c.get=s.get,c.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},c._defaultCaster=function(t){if(null!=t&&"boolean"!=typeof t)throw Error();return t},c._checkRequired=function(t){return!0===t||!1===t},c.checkRequired=s.checkRequired,c.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},Object.defineProperty(c,"convertToTrue",{get:function(){return a.convertToTrue},set:function(t){a.convertToTrue=t}}),Object.defineProperty(c,"convertToFalse",{get:function(){return a.convertToFalse},set:function(t){a.convertToFalse=t}}),c.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():c.cast();try{return e(t)}catch(e){throw new i("Boolean",t,this.path,e,this)}},c.$conditionalHandlers=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},s.prototype.$conditionalHandlers),c.prototype.castForQuery=function(t,e,r){var n;if(null!=t)return(n=c.$conditionalHandlers[t])?n.call(this,e):this.applySetters(e,r);try{return this.applySetters(e,r)}catch(t){throw t instanceof i&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},c.prototype._castNullish=function(t){if(void 0===t)return t;var e="function"==typeof this.constructor.cast?this.constructor.cast():c.cast();return null==e?t:!(e.convertToFalse instanceof Set&&e.convertToFalse.has(t))&&(!!(e.convertToTrue instanceof Set&&e.convertToTrue.has(t))||t)},c.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return u("boolean","bool",null==t?void 0:t.useBsonType,e)},c.prototype.autoEncryptionType=function(){return"bool"},t.exports=c},6426:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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,O={_skipMarkModified:!0};function w(t,e,r){this[y]=!0,this.path=t,this.instance=r,this.validators=[],this.getters=this.constructor.hasOwnProperty("getters")?this.constructor.getters.slice():[],this.setters=this.constructor.hasOwnProperty("setters")?this.constructor.setters.slice():[],this.splitPath(),e=e||{};for(var n=this.constructor.defaultOptions||{},i=0,a=Object.keys(n);i<a.length;i++){var u=a[i];"validate"===u?this.validate(n.validate):n.hasOwnProperty(u)&&!Object.prototype.hasOwnProperty.call(e,u)&&(e[u]=n[u])}null==e.select&&delete e.select;var c=this.OptionsConstructor||s;this.options=new c(e),this._index=null,d.hasUserDefinedProperty(this.options,"immutable")&&(this.$immutable=this.options.immutable,l(this));for(var f=0,p=Object.keys(this.options);f<p.length;f++){var h=p[f];if("cast"!==h){if(d.hasUserDefinedProperty(this.options,h)&&"function"==typeof this[h]){if("index"===h&&this._index){if(!1===e.index){var b=this._index;if("object"===o(b)&&null!=b){if(b.unique)throw Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(b.sparse)throw Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}
3continue}var m=e[h];if("default"===h){this.default(m);continue}var v=Array.isArray(m)?m:[m];this[h].apply(this,v)}}else Array.isArray(this.options[h])?this.castFunction.apply(this,this.options[h]):this.castFunction(this.options[h])}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}function S(t,e){if(void 0!==t&&!t){var r=new(e.ErrorConstructor||_)(e);return r[b]=!0,r}}function $(t,e){return this.castForQuery(null,t,e)}function j(t,e){var r=this;return Array.isArray(t)?t.map(function(t){return Array.isArray(t)&&0===t.length?t:r.castForQuery(null,t,e)}):[this.castForQuery(null,t,e)]}w.prototype.OptionsConstructor=s,w.prototype.path,w.prototype.validators,w.prototype.isRequired,w.prototype.splitPath=function(){return null!=this._presplitPath?this._presplitPath:null!=this.path?(this._presplitPath=-1===this.path.indexOf(".")?[this.path]:this.path.split("."),this._presplitPath):void 0},w.cast=function(t){return 0==arguments.length||(!1===t&&(t=function(t){return t}),this._cast=t),this._cast},w.prototype.castFunction=function(t,e){return 0==arguments.length||(!1===t&&(t=this.constructor._defaultCaster||function(t){return t}),"string"==typeof t?this._castErrorMessage=t:(null!=t&&(this._castFunction=t),null!=e&&(this._castErrorMessage=e))),this._castFunction},w.prototype.cast=function(){throw Error("Base SchemaType class does not implement a `cast()` function")},w.set=function(t,e){this.hasOwnProperty("defaultOptions")||(this.defaultOptions=Object.assign({},this.defaultOptions)),this.defaultOptions[t]=e},w.get=function(t){this.getters=this.hasOwnProperty("getters")?this.getters:[],this.getters.push(t)},w.prototype.default=function(t){if(1==arguments.length){if(void 0===t)return void(this.defaultValue=void 0);if(null!=t&&t.instanceOfSchema)throw new i("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=t,this.defaultValue}return arguments.length>1&&(this.defaultValue=Array.prototype.slice.call(arguments)),this.defaultValue},w.prototype.index=function(t){return this._index=t,d.expires(this._index),this},w.prototype.unique=function(t,e){if(!1===this._index){if(!t)return;throw 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},w.prototype.text=function(t){if(!1===this._index){if(!t)return this;throw 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},w.prototype.sparse=function(t){if(!1===this._index){if(!t)return this;throw 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},w.prototype.immutable=function(t){return this.$immutable=t,l(this),this},w.prototype.transform=function(t){return this.options.transform=t,this},w.prototype.set=function(t){if("function"!=typeof t)throw TypeError("A setter must be a function.");return this.setters.push(t),this},w.prototype.get=function(t){if("function"!=typeof t)throw TypeError("A getter must be a function.");return this.getters.push(t),this},w.prototype.validateAll=function(t){for(var e=0;e<t.length;e++)this.validate(t[e]);return this},w.prototype.validate=function(t,e,r){var n,s,a,u;if("function"==typeof t||t&&"RegExp"===d.getFunctionName(t.constructor))return"function"==typeof e?(n={validator:t,message:e}).type=r||"user defined":e instanceof Object&&!r?((n=p(e)?Object.assign({},e):c(e)).message||(n.message=n.msg),n.validator=t,n.type=n.type||"user defined"):(null==e&&(e=i.messages.general.default),r||(r="user defined"),n={message:e,type:r,validator:t}),this.validators.push(n),this;for(s=0,a=arguments.length;s<a;s++){if(u=arguments[s],!d.isPOJO(u))throw Error("Invalid validator. Received ("+o(u)+") "+u+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()");this.validate(u.validator,u)}return this},w.prototype.required=function(t,e){var r={};if(arguments.length>0&&null==t||("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;
3if(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},w.prototype.ref=function(t){return this.options.ref=t,this},w.prototype.getDefault=function(t,e,r){var n;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,O);return i&&!Array.isArray(i)&&i.$isSingleNested&&(i.$__parent=t),i}return n},w.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},w.prototype._castNullish=function(t){return t},w.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)},w.prototype.applyGetters=function(t,e){var r=t,n=this.getters,o=n.length;if(0===o)return r;for(var i=0;i<o;++i)r=n[i].call(e,r,this);return r},w.prototype.select=function(t){return this.selected=!!t,this},w.prototype.doValidate=function(t,e,r,n){var i=this,s=!1,a=this.path;if("function"!=typeof e)throw TypeError("Must pass callback function to doValidate(), got ".concat(o(e)));var u=this.validators.filter(function(t){return"object"===o(t)&&null!==t}),l=u.length;if(!l)return e(null);for(var f=0,y=u.length;f<y&&0!==function(){if(s)return 0;var e,o=u[f],l=o.validator,h=p(o)?Object.assign({},o):c(o);if(h.path=n&&n.path?n.path:a,h.fullPath=i.$fullPath,h.value=t,l instanceof RegExp)return d(l.test(t),h,r),1;if("function"!=typeof l)return 1;if(void 0===t&&l!==i.requiredValidator)return d(!0,h,r),1;try{e=h.propsParameter?l.call(r,t,h):l.call(r,t)}catch(t){e=!1,h.reason=t,t.message&&(h.message=t.message)}null!=e&&"function"==typeof e.then?e.then(function(t){d(t,h,r)},function(t){h.reason=t,h.message=t.message,d(e=!1,h,r)}):d(e,h,r)}();++f);function d(t,r,n){!s&&(void 0===t||t?--l<=0&&h(function(){e(null)}):((s=new(r.ErrorConstructor||_)(r,n))[b]=!0,h(function(){e(s)})))}},w.prototype.doValidateSync=function(t,e,r){var n=this.path;if(!this.validators.length)return null;var i=this.validators;if(void 0===t){if(0===this.validators.length||"required"!==this.validators[0].type)return null;i=[this.validators[0]]}var s=null,a=0,u=i.length;for(a=0;a<u;++a){var l=i[a];if(null!==l&&"object"===o(l)){var h=l.validator,y=p(l)?Object.assign({},l):c(l);y.path=r&&r.path?r.path:n,y.fullPath=this.$fullPath,y.value=t;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},w._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)},w.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=e.$__fullPath(this.path,!0),c=e.ownerDocument().$populated(u,!0),l=t;if(!(e.$__.populated&&e.$__.populated[u]&&e.$__.populated[u].options&&e.$__.populated[u].options.options&&e.$__.populated[u].options.options.lean)){var f,p=c?c.options[v]:e.constructor.db.model(this.options.ref);(l=p.hydrate(t,null,i)).$__.wasPopulated={value:l._doc._id,options:(s={},(f=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(a=v),(a="symbol"==o(f)?f:f+"")in s)?Object.defineProperty(s,a,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[a]=p,s)}}return l},w.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},w.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw 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}},w.checkRequired=function(t){return 0!=arguments.length&&(this._checkRequired=t),this._checkRequired},w.prototype.checkRequired=function(t){return null!=t},w.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},w.prototype.getEmbeddedSchemaType=function(){return this.$embeddedSchemaType},w.prototype._duplicateKeyErrorMessage=null,w.prototype.toJSONSchema=function(){throw Error("Converting unsupported SchemaType to JSON Schema: "+this.instance)},w.prototype.autoEncryptionType=function(){return null},t.exports=e=w,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--;)n(i=e[o=s[a]])&&(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})(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
3e%2?i(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}r(8768);var a=t.exports=function(){};a.ctor=function(){var t=Array.prototype.slice.call(arguments),e=function(){a.apply(this,arguments),this.paths={},this.states={}};return(e.prototype=new a).constructor=e,e.prototype.stateNames=t,t.forEach(function(t){e.prototype[t]=function(e){this._changeState(e,t)}}),e},a.prototype._changeState=function(t,e){var r=this.paths[t];if(r!==e){var n=this.states[r];n&&delete n[t],this.paths[t]=e,this.states[e]=this.states[e]||{},this.states[e][t]=!0}},a.prototype.clear=function(t){if(null!=this.states[t])for(var e,r=Object.keys(this.states[t]),n=r.length;n--;)e=r[n],delete this.states[t][e],delete this.paths[e]},a.prototype.clearPath=function(t){var e=this.paths[t];e&&(delete this.paths[t],delete this.states[e][t])},a.prototype.getStatePaths=function(t){return null!=this.states[t]?this.states[t]:{}},a.prototype.some=function(){var t=this,e=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(e,function(e){return null!=t.states[e]&&Object.keys(t.states[e]).length})},a.prototype._iter=function(t){return function(){var e=Array.prototype.slice.call(arguments),r=e.pop();e.length||(e=this.stateNames);var n=this;return e.reduce(function(t,e){return null==n.states[e]?t:t.concat(Object.keys(n.states[e]))},[])[t](function(t,e,n){return r(t,e,n)})}},a.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)},a.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)},a.prototype.clone=function(){var t=new this.constructor;t.paths=s({},this.paths);var e,r=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return o(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,void 0):void 0}}(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw 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(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw i}}}}(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})(t)}if(!Object.keys){var o,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("u"<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 TypeError("Object.keys called on a non-object");var d=l&&r;if(u&&t.length>
30&&!i.call(t,0))for(var b=0;b<t.length;++b)h.push(String(b));if(o&&t.length>0)for(var m=0;m<t.length;++m)h.push(String(m));else for(var v in t)d&&"prototype"===v||!i.call(t,v)||h.push(String(v));if(c)for(var g=function(t){if("u"<typeof window||!y)return p(t);try{return p(t)}catch(t){return!1}}(t),_=0;_<f.length;++_)g&&"constructor"===f[_]||!i.call(t,f[_])||h.push(f[_]);return h}}t.exports=o},6547:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){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})(t)}var i=r(3550).EventEmitter,s=r(9380),a=r(8768),u=r(7930).documentArrayParent;function c(t,e,r,i,c){var l;a.isMongooseDocumentArray(e)?(this.__parentArray=e,this[u]=e.$parent()):(this.__parentArray=void 0,this[u]=void 0),this.$setIndex(c),this.$__parent=this[u],"object"===o(r)&&null!=r?(l=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==o(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({isNew:!0},r),r=void 0):l={isNew:!0},s.call(this,t,i,this[u],r,l)}for(var l in c.prototype=Object.create(s.prototype),c.prototype.constructor=c,Object.defineProperty(c.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1}),Object.defineProperty(c.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0}),i.prototype)c[l]=i.prototype[l];c.prototype.$setIndex=function(t){if(this.__index=t,null!=this.$__&&null!=this.$__.validationError)for(var e=0,r=Object.keys(this.$__.validationError.errors);e<r.length;e++){var n=r[e];this.invalidate(n,this.$__.validationError.errors[n])}},c.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`')},c.prototype.$__removeFromParent=function(){var t=this._doc._id;if(!t)throw Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:t})},c.prototype.$__fullPath=function(t,e){return null==this.__index?null:(this.$__.fullPath||this.ownerDocument(),e?t?this.$__.fullPath+"."+t:this.$__.fullPath:t?this.$__.fullPath+"."+this.__index+"."+t:this.$__.fullPath+"."+this.__index)},c.prototype.$__pathRelativeToParent=function(t,e){return null!=this.__index&&this.__parentArray&&this.__parentArray.$path?e?null==t?this.__parentArray.$path():this.__parentArray.$path()+"."+t:null==t?this.__parentArray.$path()+"."+this.__index:this.__parentArray.$path()+"."+this.__index+"."+t:null},c.prototype.$parent=function(){return this[u]},c.prototype.parentArray=function(){return this.__parentArray},t.exports=c},6583:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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";
3t.exports=function(t,e){for(var r,n,o,i=e.split("."),s="",a=0;a<i.length;++a)if(t[s+=s.length?".":""+i[a]]){for(o=(n=Object.keys(t)).length,r=0;r<o;++r)0!==n[a].indexOf(s+".")||n[a].indexOf(e);return!0}return!1}},6730:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r};t.exports=function(t){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw TypeError("Function.prototype.bind called on incompatible "+o);for(var i,s=function(t){for(var e=[],r=1,n=0;r<t.length;r+=1,n+=1)e[n]=t[r];return e}(arguments),a=r(0,o.length-s.length),u=[],c=0;c<a;c++)u[c]="$"+c;if(i=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(u)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var e=o.apply(this,n(s,arguments));return Object(e)===e?e:this}return o.apply(t,n(s,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},6750:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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(3*(s+u)/4-u),l=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=0,a=n-o;s<a;s+=16383)i.push(function(t,e,n){for(var o,i=[],s=e;s<n;s+=3)i.push(r[(o=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]))>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}(t,s,s+16383>a?a:s+16383));return 1===o?i.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===o&&i.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),i.join("")};for(var r=[],n=[],o="u">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 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]}n[45]=62,n[95]=63},6801:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}
3function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t,r){var s,a,u;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),(a=e,u=[r=r||"Cannot populate path `"+t+"` because it is not in your schema. Set the `strictPopulate` option to false to override."],a=i(a),s=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(a,u||[],i(this).constructor):a.apply(this,u))).path=t,s}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8213));Object.defineProperty(a.prototype,"name",{value:"StrictPopulateError"}),t.exports=a},6814:t=>{"use strict";t.exports=function(t){for(var e={},r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];if(-1!==o.indexOf("."))for(var i=o.split("."),s=i[0],a=0;a<i.length;++a)e[s]=1,a+1<i.length&&(s=s+"."+i[a+1]);else e[o]=1}return e}},6867:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(i=function(){return!!t})()}function s(){return(s="u">typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!({}).hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var c=r(2081),l=r(241),f=r(6426),p=r(4327),h=function(t){var e;function l(t,e){var r,o,s;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,l),(o=l,s=[t,e,"Map"],o=a(o),r=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,i()?Reflect.construct(o,s||[],a(this).constructor):o.apply(this,s))).$isSchemaMap=!0,r}return function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(l,t),e=[{key:"set",value:function(t,e){return f.set(t,e)}},{key:"cast",value:function(t,e,n,i,s){if(t instanceof c)return t;var a=null!=(l=null==s?void 0:s.path)?l:this.path;if(n){var u=new c({},a,e,this.$__schemaType);if(t instanceof r.g.Map){var l,f,p=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return o(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,void 0):void 0}}(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw 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(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,i=t}
3,f:function(){try{s||null==e.return||e.return()}finally{if(a)throw i}}}}(t.keys());try{for(p.s();!(f=p.n()).done;){var h=f.value,y=t.get(h);y=null==y?u.$__schemaType._castNullish(y):u.$__schemaType.cast(y,e,!0,null,{path:a+"."+h}),u.$init(h,y)}}catch(t){p.e(t)}finally{p.f()}}else for(var d=0,b=Object.keys(t);d<b.length;d++){var m=b[d],v=t[m];v=null==v?u.$__schemaType._castNullish(v):u.$__schemaType.cast(v,e,!0,null,{path:a+"."+m}),u.$init(m,v)}return u}return new c(t,a,e,this.$__schemaType)}},{key:"clone",value:function(){var t,e,r=(t=this,"function"==typeof(e=s(a(l.prototype),"clone",t))?function(r){return e.apply(t,r)}:e)([]);return null!=this.$__schemaType&&(r.$__schemaType=this.$__schemaType.clone()),r}},{key:"getEmbeddedSchemaType",value:function(){return this.$__schemaType}},{key:"toJSONSchema",value:function(t){var e=null==t?void 0:t.useBsonType,r=this.getEmbeddedSchemaType(),n=p("object","object",e,this.options.required&&"function"!=typeof this.options.required);return n.additionalProperties=r.toJSONSchema(t),n}},{key:"autoEncryptionType",value:function(){return"object"}}],function(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(o.key),o)}}(l.prototype,e),Object.defineProperty(l,"prototype",{writable:!1}),l}(f);h.schemaName="Map",h.prototype.OptionsConstructor=l,h.defaultOptions={},t.exports=h},6948:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o,i=r(4450);Object.defineProperty(o=function t(e){if(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t),this._docs={},this._childDocs=[],null!=e&&(Object.assign(this,e=i(e)),"object"===n(e.subPopulate)&&(this.populate=e.subPopulate),null!=e.perDocumentLimit&&null!=e.limit))throw Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+e.path+"`.")},"prototype",{writable:!1}),t.exports=o},6949:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=r(8213),u=r(8260),c=r(7352),l=r(1875),f=function(t){var e;function r(t){var e,s,a,c;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,r),(a=r,c=[s="model"===u(t)?t.constructor.modelName+" validation failed":"Validation failed"],a=i(a),e=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(a,c||[],i(this).constructor):a.apply(this,c))).errors={},e._message=s,t&&(t.$errors=e.errors),e}return function(t,e){if("function"!=typeof e&&null!==e)throw 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)}(r,t),e=[{key:"toString",value:function(){return this.name+": "+l(this)}},{key:"inspect",value:function(){return Object.assign(Error(this.message),this)}},{key:"addError",value:function(t,e){if(e instanceof r)for(var n=e.errors,o=0,i=Object.keys(n);o<i.length;o++){var s=i[o];this.addError("".concat(t,".").concat(s),n[s])}else this.errors[t]=e,this.message=this._message+": "+l(this)}}],function(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(o.key),o)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}(a);c.inspect.custom&&(f.prototype[c.inspect.custom]=f.prototype.inspect),Object.defineProperty(f.prototype,"toJSON",{enumerable:!1,writable:!1,
3configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}}),Object.defineProperty(f.prototype,"name",{value:"ValidationError"}),t.exports=f},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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t,r,s){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");var a,u,c,l=s.join(", ");return(a=e,u=['No matching document found for id "'+t._doc._id+'" version '+r+' modifiedPaths "'+l+'"'],a=i(a),c=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(a,u||[],i(this).constructor):a.apply(this,u))).version=r,c.modifiedPaths=s,c}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var s=r(6426),a=s.CastError,u=r(9553),c=r(4327),l=r(3305);function f(t,e){s.call(this,t,e,"Decimal128")}function p(t){return this.cast(t)}f.schemaName="Decimal128",f.defaultOptions={},f.prototype=Object.create(s.prototype),f.prototype.constructor=f,f._cast=u,f.set=s.set,f.setters=[],f.get=s.get,f.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},f._defaultCaster=function(t){if(null!=t&&!l(t,"Decimal128"))throw Error();return t},f._checkRequired=function(t){return l(t,"Decimal128")},f.checkRequired=s.checkRequired,f.prototype.checkRequired=function(t,e){return s._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():f.checkRequired())(t)},f.prototype.cast=function(t,e,r,n,o){var i;if(s._isRef(this,t,e,r))return l(t,"Decimal128")?t:this._castRef(t,e,r,o);i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():f.cast();try{return i(t)}catch(e){throw new a("Decimal128",t,this.path,e,this)}},f.prototype.$conditionalHandlers=i(i({},s.prototype.$conditionalHandlers),{},{$gt:p,$gte:p,$lt:p,$lte:p}),f.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return c("string","decimal",null==t?void 0:t.useBsonType,e)},f.prototype.autoEncryptionType=function(){return"decimal"}
3,t.exports=f},7058:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){var n;return(n=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==a(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"u">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)||l(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){var r="u">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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function l(t,e){if(t){if("string"==typeof t)return f(t,e);var r=({}).toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var p,h=r(3550).EventEmitter,y=r(8297),d=r(8213),b=r(6426),m=r(8879),v=r(2069),g=r(622),_=r(486),O=r(4450),w=r(3703),S=r(8260),$=r(2003),j=r(5289),P=r(3381),A=r(1199),E=r(9539),x=r(5678),T=r(7834),k=r(2097),N=r(8768),I=r(533),B=/\.\d+(\.|$)/,M=r(1260).Ut,D=r(4957).middlewareFunctions,R=M.concat(D).reduce(function(t,e){return t.add(e)},new Set),U=N.isPOJO,C=0,F=/^\d+$/;function L(t,e){if(!(this instanceof L))return new L(t,e);if(this.obj=t,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this._searchIndexes=[],this.methods=e&&e.methods||{},this.methodOptions={},this.statics=e&&e.statics||{},this.tree={},this.query=e&&e.query||{},this.childSchemas=[],this.plugins=[],this.$id=++C,this.mapPaths=[],this.encryptedFields={},this.s={hooks:new y},this.options=this.defaultOptions(e),Array.isArray(t)){var r,n=c(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.add(o)}}catch(t){n.e(t)}finally{n.f()}}else t&&this.add(t);if(e&&e.virtuals)for(var i=e.virtuals,s=0,a=Object.keys(i);s<a.length;s++){var u=a[s],l=i[u].options?i[u].options:void 0,f=this.virtual(u,l);i[u].get&&f.get(i[u].get),i[u].set&&f.set(i[u].set)}var p=t&&t._id&&N.isObject(t._id);this.paths._id||!this.options._id||p||_(this),this.setupTimestamp(this.options.timestamps)}function V(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r],i=null;if(null!=e[o])i=e[o];else{var s=w(t.paths[o],"options");
3if(null==s)continue;i=s.alias}if(i){var a=t.paths[o].path;if(Array.isArray(i)){var u,l=c(i);try{for(l.s();!(u=l.n()).done;){var f=u.value;if("string"!=typeof f)throw Error("Invalid value for alias option on "+a+", got "+f);t.aliases[f]=a,t.virtual(f).get(function(t){return function(){return"function"==typeof this.get?this.get(t):this[t]}}(a)).set(function(t){return function(e){return this.$set(t,e)}}(a))}}catch(t){l.e(t)}finally{l.f()}}else{if("string"!=typeof i)throw Error("Invalid value for alias option on "+a+", got "+i);t.aliases[i]=a,t.virtual(i).get(function(t){return function(){return"function"==typeof this.get?this.get(t):this[t]}}(a)).set(function(t){return function(e){return this.$set(t,e)}}(a))}}}}L.prototype=Object.create(h.prototype),L.prototype.constructor=L,L.prototype.instanceOfSchema=!0,Object.defineProperty(L.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0}),Object.defineProperty(L.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0}),Object.defineProperty(L.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0}),L.prototype.obj,L.prototype.paths,L.prototype.tree,L.prototype.clone=function(){var t=this,e=this._clone();return e.on("init",function(e){return t.emit("init",e)}),e},L.prototype._clone=function(t){var e=new(t=t||(null==this.base?L:this.base.Schema))({},this._userProvidedOptions);e.base=this.base,e.obj=this.obj,e.options=O(this.options),e.callQueue=this.callQueue.map(function(t){return t}),e.methods=O(this.methods),e.methodOptions=O(this.methodOptions),e.statics=O(this.statics),e.query=O(this.query),e.plugins=Array.prototype.slice.call(this.plugins),e._indexes=O(this._indexes),e._searchIndexes=O(this._searchIndexes),e.s.hooks=this.s.hooks.clone(),e.tree=O(this.tree),e.paths=Object.fromEntries(Object.entries(this.paths).map(function(t){var e=u(t,2);return[e[0],e[1].clone()]})),e.nested=O(this.nested),e.subpaths=O(this.subpaths);for(var r=0,n=Object.values(e.paths);r<n.length;r++){var o=n[r];if(o.$isSingleNested){for(var i=o.path,s=0,a=Object.keys(o.schema.paths);s<a.length;s++){var c=a[s];e.singleNestedPaths[i+"."+c]=o.schema.paths[c]}for(var l=0,f=Object.keys(o.schema.singleNestedPaths);l<f.length;l++){var p=f[l];e.singleNestedPaths[i+"."+p]=o.schema.singleNestedPaths[p]}for(var h=0,y=Object.keys(o.schema.subpaths);h<y.length;h++){var d=y[h];e.singleNestedPaths[i+"."+d]=o.schema.subpaths[d]}for(var b=0,m=Object.keys(o.schema.nested);b<m.length;b++){var v=m[b];e.singleNestedPaths[i+"."+v]="nested"}}}return e._gatherChildSchemas(),e.virtuals=O(this.virtuals),e.$globalPluginsApplied=this.$globalPluginsApplied,e.$isRootDiscriminator=this.$isRootDiscriminator,e.$implicitlyCreated=this.$implicitlyCreated,e.$id=++C,e.$originalSchemaId=this.$id,e.mapPaths=[].concat(this.mapPaths),null!=this.discriminatorMapping&&(e.discriminatorMapping=Object.assign({},this.discriminatorMapping)),null!=this.discriminators&&(e.discriminators=Object.assign({},this.discriminators)),null!=this._applyDiscriminators&&(e._applyDiscriminators=new Map(this._applyDiscriminators)),e.aliases=Object.assign({},this.aliases),e.encryptedFields=O(this.encryptedFields),e},L.prototype.pick=function(t,e){var r=new L({},e||this.options);if(!Array.isArray(t))throw new d('Schema#pick() only accepts an array argument, got "'+a(t)+'"');var n,o=c(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(this._hasEncryptedField(i)){var u=this.encryptedFields[i],l=this.path(i);r.add(s({},i,s({encrypt:u},this.options.typeKey,l)))}else if(this.nested[i])r.add(s({},i,w(this.tree,i)));else{var f=this.path(i);if(null==f)throw new d("Path `"+i+"` is not in the schema");r.add(s({},i,f))}}}catch(t){o.e(t)}finally{o.f()}return this._hasEncryptedFields()||(r.options.encryptionType=null),r},L.prototype.omit=function(t,e){var r=new L(this,e||this.options);if(!Array.isArray(t))throw new d('Schema#omit() only accepts an array argument, got "'+a(t)+'"');for(var n in r.remove(t),r.singleNestedPaths)t.includes(n)&&delete r.singleNestedPaths[n];return r},L.prototype.defaultOptions=function(t){this._userProvidedOptions=null==t?{}:O(t);var e=this.base&&this.base.options||{};if((t=i({strict:!("strict"in e)||e.strict,strictQuery:"strictQuery"in e&&e.strictQuery,bufferCommands:!0,capped:!1,versionKey:"__v",optimisticConcurrency:!1,minimize:!0,autoIndex:null,discriminatorKey:"__t",shardKey:null,read:null,validateBeforeSave:!0,validateModifiedOnly:!1,_id:!0,id:!("id"in e)||e.id,typeKey:"type"},t)).versionKey&&"string"!=typeof t.versionKey)throw new d("`versionKey` must be falsy or string, got `"+a(t.versionKey)+"`");if("string"==typeof t.read?t.read=j(t.read):Array.isArray(t.read)&&"string"==typeof t.read[0]&&(t.read={mode:j(t.read[0]),tags:t.read[1]}),t.optimisticConcurrency&&!t.versionKey)throw new d("Must set `versionKey` if using `optimisticConcurrency`");return t},L.prototype.discriminator=function(t,e,r){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(t,{schema:e,options:r}),this},L.prototype._defaultToObjectOptions=function(t){var e=t?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&this._defaultToObjectOptionsMap[e])return this._defaultToObjectOptionsMap[e];var r=Object.assign({},this.base&&this.base.options&&this.base.options[e]||{},this.options[e]||{});return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[e]=r,r},L.prototype.encryptionType=function(t){if(0==arguments.length)return this.options.encryptionType;if("string"!=typeof t&&null!==t)throw Error("invalid `encryptionType`: ${encryptionType}");this.options.encryptionType=t},L.prototype.add=function(t,e){if(t instanceof L||null!=t&&t.instanceOfSchema)return E(this,t),this;
3if(!1===t._id&&null==e&&(this.options._id=!1),"__proto__."===(e=e||"")||"constructor."===e||"prototype."===e)return this;for(var r=Object.keys(t),n=this.options.typeKey,o=0;o<r.length;o++){var i=r[o];if(!N.specialProperties.has(i)){var c=e+i,l=t[i];if(null==l)throw TypeError("Invalid value for schema path `"+c+'`, got value "'+l+'"');if("_id"!==i||!1!==l){var f=!1;if("string"==typeof l&&(f=null!=(null!=this.base?this.base.Schema.Types:L.Types)[l.charAt(0).toUpperCase()+l.substring(1)]),"_id"!==i&&("object"!==a(l)&&"function"!=typeof l&&!f||null==l))throw TypeError("Invalid schema configuration: `".concat(l,"` is not ")+"a valid type at path `".concat(i,"`. See ")+"https://bit.ly/mongoose-schematypes for a list of valid schema types.");if(l instanceof g||"VirtualType"===(l.constructor&&l.constructor.name||null))this.virtual(l);else{if(Array.isArray(l)&&1===l.length&&null==l[0])throw TypeError("Invalid value for schema Array path `"+c+'`, got value "'+l[0]+'"');if(U(l)||l instanceof m)if(Object.keys(l).length<1)e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(c,l);else if(!l[n]||"type"===n&&U(l.type)&&l.type.type)this.nested[c]=!0,this.add(l,c+".");else{var p=l[n];if(U(p)&&Object.keys(p).length>0){e&&(this.nested[e.substring(0,e.length-1)]=!0);var h={};this._userProvidedOptions.typeKey&&(h.typeKey=this._userProvidedOptions.typeKey),null!=this._userProvidedOptions.strict&&(h.strict=this._userProvidedOptions.strict),null!=this._userProvidedOptions.toObject&&(h.toObject=N.omit(this._userProvidedOptions.toObject,["transform"])),null!=this._userProvidedOptions.toJSON&&(h.toJSON=N.omit(this._userProvidedOptions.toJSON,["transform"]));var y=new L(p,h);y.$implicitlyCreated=!0;var d=Object.assign({},l,s({},n,y));this.path(e+i,d)}else if(e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+i,l),null!=l&&!l.instanceOfSchema&&N.isPOJO(l.discriminators)){var b=this.path(e+i);for(var v in l.discriminators)b.discriminator(v,l.discriminators[v])}}else if(e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+i,l),null!=l[0]&&!l[0].instanceOfSchema&&N.isPOJO(l[0].discriminators)){var _=this.path(e+i);for(var O in l[0].discriminators)_.discriminator(O,l[0].discriminators[O])}if(l.instanceOfSchema&&null!=l.encryptionType()){if(this.encryptionType()!=l.encryptionType())throw Error("encryptionType of a nested schema must match the encryption type of the parent schema.");for(var w=0,S=Object.entries(l.encryptedFields);w<S.length;w++){var $=u(S[w],2),j=$[0],P=$[1],A=c+"."+j;this._addEncryptedField(A,P)}}else if("object"===a(l)&&"encrypt"in l){var x=l.encrypt;if(null==this.encryptionType())throw Error("encryptionType must be provided");this._addEncryptedField(c,x)}else this._removeEncryptedField(c)}}}}return V(this,Object.fromEntries(Object.entries(t).map(function(t){var r=u(t,1)[0];return[e+r,null]}))),this},L.prototype._addEncryptedField=function(t,e){if(null==this.path(t).autoEncryptionType())throw Error("Invalid BSON type for FLE field: '".concat(t,"'"));this.encryptedFields[t]=O(e)},L.prototype._removeEncryptedField=function(t){delete this.encryptedFields[t]},L.prototype._hasEncryptedFields=function(){return Object.keys(this.encryptedFields).length>0},L.prototype._hasEncryptedField=function(t){return t in this.encryptedFields},L.prototype._buildEncryptedFields=function(){var t=this;return{fields:Object.entries(this.encryptedFields).map(function(e){var r=u(e,2),n=r[0],o=r[1];return i({path:n,bsonType:t.path(n).autoEncryptionType()},o)})}},L.prototype._buildSchemaMap=function(){var t=this;return{bsonType:"object",properties:Object.entries(this.encryptedFields).reduce(function(e,r){var n=u(r,2),o=n[0],s=n[1],a=t.path(o).autoEncryptionType();return function(t,e,r){for(var n=0,o=t[n];n<t.length-1;o=t[++n])e[o]=null==e[o]?{bsonType:"object",properties:{}}:e[o],e=e[o].properties;e[o]=r}(o.split("."),e,{encrypt:i(i({},s),{},{bsonType:a})}),e},{})}},L.prototype.alias=function(t,e){return V(this,s({},t,e)),this},L.prototype.removeIndex=function(t){if(arguments.length>1)throw Error("removeIndex() takes only 1 argument");if("object"!==a(t)&&"string"!=typeof t)throw Error("removeIndex() may only take either an object or a string as an argument");
3if("object"===a(t))for(var e=this._indexes.length-1;e>=0;--e)A(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},L.prototype.clearIndexes=function(){return this._indexes.length=0,this},L.prototype.searchIndex=function(t){return this._searchIndexes.push(t),this},L.reserved=Object.create(null),L.prototype.reserved=L.reserved;var q=L.reserved;function J(t){return/\.\d+/.test(t)?t.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$"):t}function z(t,e){if(0===t.mapPaths.length)return null;var r,n=c(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 K(t,e,r){var n=e.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(n.length<2)return t.paths.hasOwnProperty(n[0])?t.paths[n[0]]:"adhocOrUndefined";var o=t.path(n[0]),i=!1;if(!o)return"adhocOrUndefined";for(var s=n.length-1,a=1;a<n.length;++a){i=!1;var u=n[a];if(a===s&&o&&!/\D/.test(u)){o=o.$isMongooseDocumentArray?o.$embeddedSchemaType:o instanceof p.Array?o.caster:void 0;break}if(/\D/.test(u)){if(!o||!o.schema){o=void 0;break}i="nested"===o.schema.pathType(u),o=o.schema.path(u)}else o instanceof p.Array&&a!==s&&(o=o.caster)}return t.subpaths[r]=o,o?"real":i?"nested":"adhocOrUndefined"}function H(t,e){var r,n=c(t.childSchemas);try{for(n.s();!(r=n.n()).done;){var o=r.value.schema;o.$implicitlyCreated&&(Object.assign(o.options,e),H(o,e))}}catch(t){n.e(t)}finally{n.f()}}q.prototype=q.emit=q.listeners=q.removeListener=q.collection=q.errors=q.get=q.init=q.isModified=q.isNew=q.populated=q.remove=q.save=q.toObject=q.validate=1,q.collection=1,L.prototype.path=function(t,e){if(void 0===e){if(null!=this.paths[t])return this.paths[t];var r=J(t),n=function(t,e,r){if(t.paths.hasOwnProperty(e))return t.paths[e];if(t.subpaths.hasOwnProperty(r)){var n=t.subpaths[r];if("nested"===n)return;return n}if(t.singleNestedPaths.hasOwnProperty(r)&&"object"===a(t.singleNestedPaths[r])){var o=t.singleNestedPaths[r];if("nested"===o)return;return o}return null}(this,t,r);if(null!=n)return n;var o=z(this,t);return null!=o?o:null!=(n=this.hasMixedParent(r))?n:B.test(t)?(K(this,t,r),this.subpaths[r]):void 0}var i=t.split(".")[0];q[i]&&!this.options.suppressReservedKeysWarning&&N.warn("`".concat(i,"` is a reserved schema pathname and may break some functionality. ")+"You are allowed to use it, but use at your own risk. To disable this warning pass `suppressReservedKeysWarning` as a schema option."),"object"===a(e)&&N.hasUserDefinedProperty(e,"ref")&&I(e.ref,t);var s,u=t.split(/\./),l=u.pop(),f=this.tree,p="",h=c(u);try{for(h.s();!(s=h.n()).done;){var y=s.value;if(N.specialProperties.has(y))throw Error("Cannot set special property `"+y+"` on a schema");if(p=p+=(p.length>0?".":"")+y,f[y]||(this.nested[p]=!0,f[y]={}),"object"!==a(f[y])){var d="Cannot set nested path `"+t+"`. Parent path `"+p+"` already set to type "+f[y].name+".";throw Error(d)}f=f[y]}}catch(t){h.e(t)}finally{h.f()}f[l]=O(e),this.paths[t]=this.interpretAsType(t,e,this.options);var m=this.paths[t];if(this.childSchemas=this.childSchemas.filter(function(e){return e.path!==t}),m.$isSchemaMap){var v=t+".$*";this.paths[v]=m.$__schemaType,this.mapPaths.push(this.paths[v]),m.$__schemaType.$isSingleNested&&this.childSchemas.push({schema:m.$__schemaType.schema,model:m.$__schemaType.caster,path:t})}if(m.$isSingleNested){for(var g=0,_=Object.keys(m.schema.paths);g<_.length;g++){var w=_[g];this.singleNestedPaths[t+"."+w]=m.schema.paths[w]}for(var S=0,$=Object.keys(m.schema.singleNestedPaths);S<$.length;S++){var j=$[S];this.singleNestedPaths[t+"."+j]=m.schema.singleNestedPaths[j]}for(var P=0,A=Object.keys(m.schema.subpaths);P<A.length;P++){var E=A[P];this.singleNestedPaths[t+"."+E]=m.schema.subpaths[E]}for(var x=0,T=Object.keys(m.schema.nested);x<T.length;x++){var k=T[x];this.singleNestedPaths[t+"."+k]="nested"}
3Object.defineProperty(m.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),m.caster.base=this.base,this.childSchemas.push({schema:m.schema,model:m.caster,path:t})}else m.$isMongooseDocumentArray&&(Object.defineProperty(m.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),m.casterConstructor.base=this.base,this.childSchemas.push({schema:m.schema,model:m.casterConstructor,path:t}));if(m.$isMongooseArray&&m.caster instanceof b){for(var M=t,D=m;D.$isMongooseArray;)M+=".$",D.$isMongooseDocumentArray?(D.$embeddedSchemaType._arrayPath=M,D.$embeddedSchemaType._arrayParentPath=t,D=D.$embeddedSchemaType):(D.caster._arrayPath=M,D.caster._arrayParentPath=t,D=D.caster),this.subpaths[M]=D;for(var R=0,U=[];R<U.length;R++){var C=U[R];this.subpaths[C.path]=C}}if(m.$isMongooseDocumentArray){for(var F=0,L=Object.keys(m.schema.paths);F<L.length;F++){var V=L[F],H=m.schema.paths[V];this.subpaths[t+"."+V]=H,"object"===a(H)&&null!=H&&null==H.$parentSchemaDocArray&&(H.$parentSchemaDocArray=m)}for(var W=0,G=Object.keys(m.schema.subpaths);W<G.length;W++){var Q=G[W],Y=m.schema.subpaths[Q];this.subpaths[t+"."+Q]=Y,"object"===a(Y)&&null!=Y&&null==Y.$parentSchemaDocArray&&(Y.$parentSchemaDocArray=m)}for(var Z=0,X=Object.keys(m.schema.singleNestedPaths);Z<X.length;Z++){var tt=X[Z],te=m.schema.singleNestedPaths[tt];this.subpaths[t+"."+tt]=te,"object"===a(te)&&null!=te&&null==te.$parentSchemaDocArray&&(te.$parentSchemaDocArray=m)}}return this},L.prototype._gatherChildSchemas=function(){for(var t=[],e=0,r=Object.keys(this.paths);e<r.length;e++){var n=r[e];if("string"==typeof n){var o=this.paths[n];o.$isMongooseDocumentArray||o.$isSingleNested?t.push({schema:o.schema,model:o.caster,path:n}):o.$isSchemaMap&&o.$__schemaType.$isSingleNested&&t.push({schema:o.$__schemaType.schema,model:o.$__schemaType.caster,path:n})}}return this.childSchemas=t,t},Object.defineProperty(L.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null}),L.prototype.interpretAsType=function(t,e,o){if(e instanceof b){if(e.path===t)return e;var i,u,c=e.clone();return c.path=t,c}var l=null!=this.base?this.base.Schema.Types:L.Types,f=null!=this.base?this.base.Types:r(9600);if(!(N.isPOJO(e)||e instanceof m)&&"Object"!==N.getFunctionName(e.constructor)){var p=e;(e={})[o.typeKey]=p}var h,y=e[o.typeKey]&&(e[o.typeKey]instanceof Function||"type"!==o.typeKey||!e.type.type)?e[o.typeKey]:{};if(y instanceof b){if(y.path===t)return y;var v=y.clone();return v.path=t,v}if(N.isPOJO(y)||"mixed"===y)return new l.Mixed(t,e);if(Array.isArray(y)||y===Array||"array"===y||y===l.Array){var g=y===Array||"array"===y?e.cast||e.of:y[0];if(g&&g.instanceOfSchema){if(!(g instanceof L)){if(!this.options._isMerging)throw TypeError("Schema for array path `"+t+"` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with `npm list mongoose`. If you are still getting this error, please add `new Schema()` around the path: "+"".concat(t,": new Schema(...)"));g=new L(g)}return new l.DocumentArray(t,g,e)}if(g&&g[o.typeKey]&&g[o.typeKey].instanceOfSchema){if(!(g[o.typeKey]instanceof L)){if(!this.options._isMerging)throw TypeError("Schema for array path `"+t+"` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with `npm list mongoose`. If you are still getting this error, please add `new Schema()` around the path: "+"".concat(t,": new Schema(...)"));g[o.typeKey]=new L(g[o.typeKey])}return new l.DocumentArray(t,g[o.typeKey],e,g)}if(void 0!==g&&(Array.isArray(g)||g.type===Array||"Array"==g.type))return g&&"Array"==g.type&&(g.type=Array),new l.Array(t,this.interpretAsType(t,g,o),e);var _=null==g||!g[o.typeKey]||"type"===o.typeKey&&g.type.type?g:g[o.typeKey];if("string"==typeof g)g=l[g.charAt(0).toUpperCase()+g.substring(1)];else if(N.isPOJO(_)){if(Object.keys(_).length){var O={minimize:o.minimize};o.typeKey&&(O.typeKey=o.typeKey),o.hasOwnProperty("strict")&&(O.strict=o.strict),o.hasOwnProperty("strictQuery")&&(O.strictQuery=o.strictQuery),o.hasOwnProperty("toObject")&&(O.toObject=N.omit(o.toObject,["transform"])),o.hasOwnProperty("toJSON")&&(O.toJSON=N.omit(o.toJSON,["transform"])),this._userProvidedOptions.hasOwnProperty("_id")?O._id=this._userProvidedOptions._id:null!=L.Types.DocumentArray.defaultOptions._id&&(O._id=L.Types.DocumentArray.defaultOptions._id);var w=new L(_,O);return w.$implicitlyCreated=!0,new l.DocumentArray(t,w,e)}return new l.Array(t,l.Mixed,e)}if(g){if(Array.isArray(y=!g[o.typeKey]||"type"===o.typeKey&&g.type.type?g:g[o.typeKey]))return new l.Array(t,this.interpretAsType(t,y,o),e);if("ClockDate"===(h="string"==typeof y?y:y.schemaName||N.getFunctionName(y))&&(h="Date"),void 0===h)throw TypeError("Invalid schema configuration: "+"Could not determine the embedded type for array `".concat(t,"`. ")+"See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(!l.hasOwnProperty(h))throw TypeError("Invalid schema configuration: "+"`".concat(h,"` is not a valid type within the array `").concat(t,"`.")+"See https://bit.ly/mongoose-schematypes for a list of valid schema types.")}return new l.Array(t,g||l.Mixed,e,o)}if(y&&y.instanceOfSchema)return new l.Subdocument(y,t,e);if((h=n.isBuffer(y)?"Buffer":"function"==typeof y||"object"===a(y)?y.schemaName||N.getFunctionName(y):y===f.ObjectId?"ObjectId":y===f.Decimal128?"Decimal128":null==y?""+y:y.toString())&&
3(h=h.charAt(0).toUpperCase()+h.substring(1)),"ObjectID"===h&&(h="ObjectId"),"ClockDate"===h&&(h="Date"),void 0===h)throw TypeError("Invalid schema configuration: `".concat(t,"` schematype definition is ")+"invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(null==l[h])throw TypeError("Invalid schema configuration: `".concat(h,"` is not ")+"a valid type at path `".concat(t,"`. See ")+"https://bit.ly/mongoose-schematypes for a list of valid schema types.");var S=new l[h](t,e);return S.$isSchemaMap&&(i=e,u={type:{}},N.hasUserDefinedProperty(i,"of")&&((u=N.isPOJO(i.of)&&Object.keys(i.of).length>0&&!N.hasUserDefinedProperty(i.of,this.options.typeKey)?s({},this.options.typeKey,new L(i.of)):N.isPOJO(i.of)?Object.assign({},i.of):s({},this.options.typeKey,i.of))[this.options.typeKey]&&u[this.options.typeKey].instanceOfSchema&&u[this.options.typeKey].eachPath(function(e,r){if(!0===r.options.select||!1===r.options.select)throw new d('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+t+"."+e+'"')}),N.hasUserDefinedProperty(i,"ref")&&(u.ref=i.ref)),S.$__schemaType=this.interpretAsType(t+".$*",u,o)),S},L.prototype.eachPath=function(t){for(var e=Object.keys(this.paths),r=e.length,n=0;n<r;++n)t(e[n],this.paths[e[n]]);return this},L.prototype.requiredPaths=function(t){if(this._requiredpaths&&!t)return this._requiredpaths;for(var e=Object.keys(this.paths),r=e.length,n=[];r--;){var o=e[r];this.paths[o].isRequired&&n.push(o)}return this._requiredpaths=n,this._requiredpaths},L.prototype.indexedPaths=function(){return this._indexedpaths||(this._indexedpaths=this.indexes()),this._indexedpaths},L.prototype.pathType=function(t){if(this.paths.hasOwnProperty(t))return"real";if(this.virtuals.hasOwnProperty(t))return"virtual";if(this.nested.hasOwnProperty(t))return"nested";var e=J(t);if(this.subpaths.hasOwnProperty(e)||this.subpaths.hasOwnProperty(t))return"real";var r=this.singleNestedPaths.hasOwnProperty(e)||this.singleNestedPaths.hasOwnProperty(t);return r?"nested"===r?"nested":"real":null!=z(this,t)?"real":/\.\d+\.|\.\d+$/.test(t)?K(this,t,e):"adhocOrUndefined"},L.prototype.hasMixedParent=function(t){var e=t.split(/\./g);t="";for(var r=0;r<e.length;++r)if(t=r>0?t+"."+e[r]:e[r],this.paths.hasOwnProperty(t)&&this.paths[t]instanceof p.Mixed)return this.paths[t];return null},L.prototype.setupTimestamp=function(t){return k(this,t)},L.prototype.queue=function(t,e){return this.callQueue.push([t,e]),this},L.prototype.pre=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=c(R);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=c(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},L.prototype.post=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=c(R);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=c(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},L.prototype.plugin=function(t,e){if("function"!=typeof t)throw Error('First param to `schema.plugin()` must be a function, got "'+a(t)+'"');if(e&&e.deduplicate){var r,n=c(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},L.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},L.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},L.prototype.index=function(t,e){for(var r in t||(t={}),e||(e={}),e.expires&&N.expires(e),t)this.aliases[r]&&(t=N.renameObjKey(t,r,this.aliases[r]));for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];"ascending"===t[i]||"asc"===t[i]?t[i]=1:"descending"!==t[i]&&"desc"!==t[i]||(t[i]=-1)}var s,a=c(this.indexes());try{for(a.s();!(s=a.n()).done;){var u=s.value;null==e.name&&null==u[1].name&&A(u[0],t)&&N.warn("Duplicate schema index on ".concat(JSON.stringify(t),' found. This is often due to declaring an index using both "index: true" and "schema.index()". Please remove the duplicate index definition.'))}}catch(t){a.e(t)}finally{a.f()}return this._indexes.push([t,e]),this},L.prototype.set=function(t,e,r){if(1==arguments.length)return this.options[t];switch(t){case"read":"string"==typeof e?this.options[t]={mode:j(e),tags:r}:Array.isArray(e)&&"string"==typeof e[0]?this.options[t]={mode:j(e[0]),tags:e[1]}:this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break;case"timestamps":this.setupTimestamp(e),this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break;case"_id":this.options[t]=e,this._userProvidedOptions[t]=this.options[t],e&&!this.paths._id?_(this):!e&&null!=this.paths._id&&this.paths._id.auto&&this.remove("_id");break;default:this.options[t]=e,this._userProvidedOptions[t]=this.options[t]}return"strict"===t&&H(this,{strict:e}),"strictQuery"===t&&H(this,{strictQuery:e}),"toObject"===t&&(delete(e=i({},e)).transform,H(this,{toObject:e})),"toJSON"===t&&(delete(e=i({},e)).transform,H(this,{toJSON:e})),this},L.prototype.get=function(t){return this.options[t]};var W="2d 2dsphere hashed text".split(" ");function G(t,e){var r,n=e.split("."),o=n.pop(),i=t.tree,s=c(n);try{for(s.s();!(r=s.n()).done;)i=i[r.value]}catch(t){s.e(t)}finally{s.f()}delete i[o]}function Q(t){return t.startsWith("$[")&&t.endsWith("]")}Object.defineProperty(L,"indexTypes",{get:function(){return W}
3,set:function(){throw Error("Cannot overwrite Schema.indexTypes")}}),L.prototype.indexes=function(){return $(this)},L.prototype.virtual=function(t,e){if(t instanceof g||"VirtualType"===S(t))return this.virtual(t.path,t.options);if(e=new v(e),N.hasUserDefinedProperty(e,["ref","refPath"])){if(null==e.localField)throw Error("Reference virtuals require `localField` option");if(null==e.foreignField)throw Error("Reference virtuals require `foreignField` option");var r=this.virtual(t);r.options=e,this.pre("init",function(n,o){if(x.has(t,n)){var i=x.get(t,n);if(this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?this.$$populatedVirtuals[t]=Array.isArray(i)?i[0]:i:this.$$populatedVirtuals[t]=Array.isArray(i)?i:null==i?[]:[i],null!=o&&o.hydratedPopulatedDocs&&!e.count){var s=r._getModelNamesForPopulate(this),a=this.$$populatedVirtuals[t];if(Array.isArray(a)||a.$__||1!==(null==s?void 0:s.length)){if(Array.isArray(a)&&1===(null==s?void 0:s.length)){for(var u=this.db.model(s[0]),c=0;c<a.length;++c)a[c].$__||(a[c]=u.hydrate(a[c],null,{hydratedPopulatedDocs:!0}));var l=e.foreignField;this.$populated(t,a.map(function(t){return null==t?t:t.get("function"==typeof l?l.call(t,t):l)}),{populateModelSymbol:u})}}else{var f=this.db.model(s[0]);this.$$populatedVirtuals[t]=f.hydrate(a)}}x.unset(t,n)}}),r.set(function(r){return this.$$populatedVirtuals||(this.$$populatedVirtuals={}),T(this.$$populatedVirtuals,t,r,e)}),"function"==typeof e.get&&r.get(e.get);for(var n=t.split("."),o=n[0],i=0;i<n.length-1;++i)if(null!=this.paths[o]){if(this.paths[o].$isMongooseDocumentArray||this.paths[o].$isSingleNested){var s=n.slice(i+1).join(".");this.paths[o].schema.virtual(s,e);break}if(this.paths[o].$isSchemaMap){var a=n.slice(i+2).join(".");this.paths[o].$__schemaType.schema.virtual(a,e);break}o+="."+n[i+1]}return r}var u=this.virtuals,c=t.split(".");if("real"===this.pathType(t))throw Error('Virtual path "'+t+'" conflicts with a real path in the schema');if(u[t]=c.reduce(function(r,n,o){return r[n]||(r[n]=o===c.length-1?new g(e,t):{}),r[n]},this.tree),e&&e.applyToArray&&c.length>1){var l=this.path(c.slice(0,-1).join("."));if(l&&l.$isMongooseArray)return l.virtual(c[c.length-1],e);throw new d('Path "'.concat(l,'" is not an array'))}return u[t]},L.prototype.virtualpath=function(t){return this.virtuals.hasOwnProperty(t)?this.virtuals[t]:null},L.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=c(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],G(this,n))}}catch(t){r.e(t)}finally{r.f()}return delete this.nested[t],void G(this,t)}delete this.paths[t],G(this,t),this._removeEncryptedField(t)}},this),this},L.prototype.removeVirtual=function(t){if("string"==typeof t&&(t=[t]),Array.isArray(t)){var e,r=c(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(null==this.virtuals[n])throw new d('Attempting to remove virtual "'.concat(n,'" that does not exist.'))}}catch(t){r.e(t)}finally{r.f()}var o,i=c(t);try{for(i.s();!(o=i.n()).done;){var s=o.value;delete this.paths[s],delete this.virtuals[s],-1!==s.indexOf(".")?x.unset(s,this.tree):delete this.tree[s]}}catch(t){i.e(t)}finally{i.f()}}return this},L.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},L.prototype._getSchema=function(t){var e=this.path(t),r=[];if(e)return e.$fullPath=t,e;for(var n=t.split("."),o=0;o<n.length;
3++o)("$"===n[o]||Q(n[o]))&&(n[o]="0"),F.test(n[o])&&(n[o]="$");return function t(e,n){for(var o,i,s=e.length+1;s--;)if(i=e.slice(0,s).join("."),o=n.path(i)){if(r.push(i),o.caster){if(o.caster instanceof p.Mixed)return o.caster.$fullPath=r.join("."),o.caster;if(s!==e.length){if(s+1===e.length&&o.$embeddedSchemaType&&("$"===e[s]||Q(e[s])))return o.$embeddedSchemaType;if(o.schema){var a=void 0;return"$"===e[s]||Q(e[s])?s+1===e.length?o.$embeddedSchemaType:((a=t(e.slice(s+1),o.schema))&&(a.$parentSchemaDocArray=a.$parentSchemaDocArray||(o.schema.$isSingleNested?null:o)),a):((a=t(e.slice(s),o.schema))&&(a.$parentSchemaDocArray=a.$parentSchemaDocArray||(o.schema.$isSingleNested?null:o)),a)}}}else if(o.$isSchemaMap){if(s>=e.length)return o;if(s+1>=e.length||o.$__schemaType instanceof p.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)},L.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 p.Mixed?{schema:n,pathType:"mixed"}:i!==e.length&&n.schema?"$"===e[i]||Q(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)},L.prototype._transformDuplicateKeyError=function(t){if(!this._duplicateKeyErrorMessagesByPath||11e3!==t.code&&11001!==t.code)return t;if(null!=t.keyPattern){var e=Object.keys(t.keyPattern);if(1!==e.length)return t;var r=e[0];return this._duplicateKeyErrorMessagesByPath.hasOwnProperty(r)?new d(this._duplicateKeyErrorMessagesByPath[r],{cause:t}):t}return t},L.prototype._preCompile=function(){this.plugin(P,{deduplicate:!0})},L.prototype.toJSONSchema=function(t){for(var e,r,n=null!=(r=null==t?void 0:t.useBsonType)&&r,o=n?{required:[],properties:{}}:{type:"object",required:[],properties:{}},i=0,s=Object.keys(this.paths);i<s.length;i++){var a=s[i],u=this.paths[a];if(-1===u._presplitPath.indexOf("$*")){var c=o;if(u._presplitPath.length>1)for(var p=0;p<u._presplitPath.length-1;++p){var h=u._presplitPath[p];null==c.properties[h]&&(c.properties[h]=n?{bsonType:["object","null"],properties:{}}:{type:["object","null"],properties:{}}),c=c.properties[h]}var y=u._presplitPath[u._presplitPath.length-1],d=!1;"_id"===a?(c.required||(c.required=[]),c.required.push("_id"),d=!0):u.options.required&&"function"!=typeof u.options.required&&(c.required||(c.required=[]),c.required.push(y),d=!0),c.properties[y]=u.toJSONSchema(t),u.options.enum&&(c.properties[y].enum=d?u.options.enum:[].concat(function(t){if(Array.isArray(t))return f(t)}(e=u.options.enum)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||l(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[null]))}}return 0===o.required.length&&delete o.required,o},t.exports=e=L,L.Types=p=r(7953),e.ObjectId=p.ObjectId},7160:(t,e)=>{"use strict";e.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed"),e.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")},7219:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=r(8213),u=r(2900),c=r(4070),l=r(5497),f=function(t){var e;function r(){var t,e;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,r),t=r,e=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,e||[],i(this).constructor):t.apply(this,e))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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)}(r,t),e=[{key:"assimilateError",value:function(t){var e=t.reason,r=c(e)&&u(e)&&-1===t.message.indexOf("bad auth")&&-1===t.message.indexOf("Authentication failed");for(var n in r?this.message="Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/":l(e)?this.message="Mongoose is connecting with SSL enabled, but the server is not accepting SSL connections. Please ensure that the MongoDB server you are connecting to is configured to accept SSL connections. Learn more: https://mongoosejs.com/docs/tutorials/ssl.html":this.message=t.message,t)"name"!==n&&(this[n]=t[n]);return this.cause=e,this}}],function(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(o.key),o)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}(a);Object.defineProperty(f.prototype,"name",{value:"MongooseServerSelectionError"}),t.exports=f},7236:t=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){if(null==t||"object"!==e(t))return t;if(Array.isArray(t))for(var r=t.length-1;r>=0;--r)void 0===t[r]&&t.splice(r,1);for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];void 0===t[i]&&delete t[i]}return t}},7291:(t,e)=>{"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n=Symbol("mongoose#trustedSymbol");
3e.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})(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})(t)}var o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),a=n[r];r<o;a=n[++r])b(a)||!O(a)?s+=" "+a:s+=" "+u(a);return s},e.deprecate=function(t,e){var r=!1;return function(){return r||(console.error(e),r=!0),t.apply(this,arguments)}};var s={},a=/^$/;function u(t,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),f(n,t,n.depth)}function c(t,e){var r=u.styles[e];return r?"\x1b["+u.colors[r][0]+"m"+t+"\x1b["+u.colors[r][1]+"m":t}function l(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&$(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o,i,s=r.inspect(n,t);return v(s)||(s=f(t,s,n)),s}var a=function(t,e){if(g(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(a)return a;var u=Object.keys(r),c=(O={},u.forEach(function(t,e){O[t]=!0}),O);if(t.showHidden&&(u=Object.getOwnPropertyNames(r)),S(r)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return p(r);if(0===u.length){if($(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return p(r)}var O,j,P="",A=!1,x=["{","}"];return y(r)&&(A=!0,x=["[","]"]),$(r)&&(P=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(P=" "+RegExp.prototype.toString.call(r)),w(r)&&(P=" "+Date.prototype.toUTCString.call(r)),S(r)&&(P=" "+p(r)),0!==u.length||A&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),j=A?function(t,e,r,n,o){for(var i=[],s=0,a=e.length;s<a;++s)E(e,String(s))?i.push(h(t,e,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(h(t,e,r,n,o,!0))}),i}(t,r,n,c,u):u.map(function(e){return h(t,r,n,c,e,A)}),t.seen.pop(),o=P,i=x,j.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(""===o?"":o+"\n ")+" "+j.join(",\n  ")+" "+i[1]:i[0]+o+" "+j.join(", ")+" "+i[1]):x[0]+P+x[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function h(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")),E(n,o)||(s="["+o+"]"),a||(0>t.seen.indexOf(u.value)?(a=b(r)?f(t,u.value,null):f(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")),g(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 y(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function g(t){return void 0===t}function _(t){return O(t)&&"[object RegExp]"===j(t)}function O(t){return"object"===n(t)&&null!==t}function w(t){return O(t)&&"[object Date]"===j(t)}function S(t){return O(t)&&("[object Error]"===j(t)||t instanceof Error)}function $(t){return"function"==typeof t}function j(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(!s[t=t.toUpperCase()])if(a.test(t)){var r=void 0;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=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(7595),e.isArray=y,e.isBoolean=d,e.isNull=b,e.isNullOrUndefined=function(t){return null==t}
3,e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=g,e.isRegExp=_,e.types.isRegExp=_,e.isObject=O,e.isDate=w,e.types.isDate=w,e.isError=S,e.types.isNativeError=S,e.isFunction=$,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 A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[P((t=new Date).getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":"),[t.getDate(),A[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 x="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(t,e){if(!t){var r=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 TypeError('The "original" argument must be of type Function');if(x&&t[x]){var e;if("function"!=typeof(e=t[x]))throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,x,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(t,n){t?r(t):e(n)});try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),x&&Object.defineProperty(e,x,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=x,e.callbackify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!=typeof n)throw TypeError("The last argument must be of type Function");var o=this,i=function(){return n.apply(o,arguments)};t.apply(this,e).then(function(t){({env:{}}).nextTick(i.bind(null,null,t))},function(t){({env:{}}).nextTick(T.bind(null,t,i))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,o(t)),e}},7425:(t,e,r)=>{"use strict";var n=r(2696);t.exports=function(t,e){if(null==t||null==t.discriminators)return null;for(var r=0,o=Object.keys(t.discriminators);r<o.length;r++){var i=o[r],s=t.discriminators[i];if(null!=s.discriminatorMapping&&n(s.discriminatorMapping.value,e))return s}return null}},7430:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(6353).Binary,s=r(3305),a=r(2497);r(3672),r(7352),e.B=function t(e,r,u,c){var l,f=(l=e&&a(e)&&!n.isBuffer(e)?Object.keys(e.toObject({transform:!1,virtuals:!1})||{}):Object.keys(e||{})).length,p={};r=r?r+".":"";for(var h=0;h<f;++h){var y=l[h],d=e[y];p[r+y]=d;var b=c&&c.path&&c.path(r+y),m=c&&c.nested&&c.nested[r+y];if(!b||"Mixed"!==b.instance){if(d&&"object"===o(d)&&!(d instanceof Date)&&!s(d,"ObjectId")&&(!Array.isArray(d)||0!==d.length)&&!(d instanceof n)&&!s(d,"Decimal128")&&!(d instanceof i)){if(u&&u.skipArrays&&Array.isArray(d))continue;var v=t(d,r+y,u,c);for(var g in v)p[g]=v[g];Array.isArray(d)&&(p[r+y]=d)}if(m)for(var _=0,O=Object.keys(c.paths);_<O.length;_++){var w=O[_];w.startsWith(r+y+".")&&!p.hasOwnProperty(w)&&(p[w]=void 0)}}}return p}},7494:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}
3function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(t)}function o(t,e,r){var o;return(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")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){if(Array.isArray(t)){var h,y=t.length;if(0===y)h=[];else if(1===y)(h=[,])[0]=t[0];else if(y<1e4)h=[],f.apply(h,t);else{h=[];for(var d=0;d<y;++d)f.call(h,t[d])}}else h=[];var b=o(o(o(o(o(o(o(o({},s,{}),a,void 0),c,e),l,n),u,void 0),"isMongooseArray",!0),"isMongooseArrayProxy",!0),"__array",h);t&&null!=t[s]&&(b[s]=t[s]),null!=r&&r.$__&&(b[u]=r,b[l]=n||r.schema.path(e));var m=new Proxy(h,{get:function(t,e){return b.hasOwnProperty(e)?b[e]:i.hasOwnProperty(e)?i[e]:n&&n.virtuals&&n.virtuals.hasOwnProperty(e)?n.virtuals[e].applyGetters(void 0,t):"string"==typeof e&&p.test(e)&&null!=(null==n?void 0:n.$embeddedSchemaType)?n.$embeddedSchemaType.applyGetters(h[e],r):h[e]},set:function(t,e,r){return"string"==typeof e&&p.test(e)?i.set.call(m,e,r,!1):b.hasOwnProperty(e)?b[e]=r:n&&n.virtuals&&n.virtuals.hasOwnProperty(e)?n.virtuals[e].applySetters(r,t):h[e]=r,!0}});return m}},7591:t=>{"use strict";var e=null;t.exports.get=function(){return e},t.exports.set=function(t){e=t}},7595:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(5899),i=r(1905),s=r(9834),a=r(7911);function u(t){return t.call.bind(t)}var c="u">typeof BigInt,l="u">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 O(t){return"[object WeakSet]"===f(t)}function w(t){return"[object ArrayBuffer]"===f(t)}function S(t){return"u">typeof ArrayBuffer&&(w.working?w(t):t instanceof ArrayBuffer)}function $(t){return"[object DataView]"===f(t)}function j(t){return"u">typeof DataView&&($.working?$(t):t instanceof DataView)}e.isArgumentsObject=o,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"u">typeof Promise&&t instanceof Promise||null!==t&&"object"===n(t)&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"u">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="u">
3typeof Map&&v(new Map),e.isMap=function(t){return"u">typeof Map&&(v.working?v(t):t instanceof Map)},g.working="u">typeof Set&&g(new Set),e.isSet=function(t){return"u">typeof Set&&(g.working?g(t):t instanceof Set)},_.working="u">typeof WeakMap&&_(new WeakMap),e.isWeakMap=function(t){return"u">typeof WeakMap&&(_.working?_(t):t instanceof WeakMap)},O.working="u">typeof WeakSet&&O(new WeakSet),e.isWeakSet=function(t){return O(t)},w.working="u">typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=S,$.working="u">typeof ArrayBuffer&&"u">typeof DataView&&$(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=j;var P="u">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)}
3,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"u">typeof Uint8Array&&(S(t)||E(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})},7760:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==s(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t){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})(t)}var a,u,c=r(8499),l=r(2555),f=r(8213),p=r(4592),h=r(6426),y=h.CastError,d=r(5022),b=r(2069),m=r(622),v=r(2073),g=r(7982),_=r(4450),O=r(8260),w=r(5110),S=r(7352),$=r(8768),j=r(5558).G,P=r(4327),A=r(9604),E=r(1058),x=Symbol("mongoose#isNestedArray"),T=Object.freeze({});function k(t,e,n,o){u||(u=r(9600).Embedded);var i,s,a="type";if(o&&o.typeKey&&(a=o.typeKey),this.schemaOptions=o,e){var c={};$.isPOJO(e)&&(e[a]?(delete(c=_(e))[a],e=e[a]):e=d),null!=n&&null!=n.ref&&null==c.ref&&(c.ref=n.ref),e===Object&&(e=d);var l="string"==typeof e?e:$.getFunctionName(e),f=r(7953),p=f.hasOwnProperty(l)?f[l]:e;if(this.casterConstructor=p,this.casterConstructor instanceof k&&(this.casterConstructor[x]=!0),"function"!=typeof p||p.$isArraySubdocument||p.$isSchemaMap)this.caster=p,this.caster instanceof u||(this.caster.path=t);else{var y=this.caster instanceof u?null:t;this.caster=new p(y,c)}this.$embeddedSchemaType=this.caster}if(this.$isMongooseArray=!0,h.call(this,t,n,"Array"),null!=this.defaultValue&&(s="function"==typeof(i=this.defaultValue)),!("defaultValue"in this)||null!=this.defaultValue){var b=function(){return s?i.call(this):null!=i?[].concat(i):[]};b.$runBeforeSetters=!s,this.default(b)}}k.schemaName="Array",k.options={castNonArrays:!0},k.defaultOptions={},k.set=h.set,k.setters=[],k.get=h.get,k.prototype=Object.create(h.prototype),k.prototype.constructor=k,k.prototype.OptionsConstructor=p,k._checkRequired=h.prototype.checkRequired,k.checkRequired=h.checkRequired,k.prototype.virtuals=null,k.prototype.checkRequired=function(t,e){return"object"===s(t)&&h._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():k.checkRequired())(t)},k.prototype.enum=function(){for(var t=this;;){var e=t&&t.caster&&t.caster.instance;if("Array"!==e){if("String"!==e&&"Number"!==e)throw Error("`enum` can only be set on an array of strings or numbers , not "+e);break}t=t.caster}var r=arguments;return!Array.isArray(arguments)&&$.isObject(arguments)&&(r=$.object.vals(r)),t.caster.enum.apply(t.caster,r),this},k.prototype.applyGetters=function(t,e){return null!=e&&null!=e.$__&&e.$populated(this.path)?t:h.prototype.applyGetters.call(this,t,e)},k.prototype._applySetters=function(t,e,r,n){if(this.casterConstructor.$isMongooseArray&&k.options.castNonArrays&&!this[x]){for(var o=0,i=this;null!=i&&i.$isMongooseArray&&!i.$isMongooseDocumentArray;)++o,i=i.casterConstructor;if(null!=t&&0!==t.length){var s=v(t);if(s.min===s.max&&s.max<o&&s.containsNonArrayItem)for(var a=s.max;a<o;++a)t=[t]}}return h.prototype._applySetters.call(this,t,e,r,n)},k.prototype.cast=function(t,e,n,o,i){if(a||(a=r(9600).Array),Array.isArray(t)){if(!t.length&&e){var s,u,c=e.schema.indexedPaths(),l=this.path;for(s=0,u=c.length;s<u;++s){var f=c[s][0][l];if("2dsphere"===f||"2d"===f)return}var p=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(null!=p){for(s=0,u=c.length;s<u;++s)if("2dsphere"===c[s][0][p])return}}i=i||T;var h=$.isMongooseArray(t)?t.__array:t,b=i.path||this.path;if(null!=i.arrayPathIndex&&(b+="."+i.arrayPathIndex),h=(t=a(h,b,e,this)).__array,n&&null!=e&&null!=e.$__&&e.$populated(this.path))return t;var m=this.caster,v=m.$isMongooseArray;
3if(m&&this.casterConstructor!==d)try{var g=h.length;for(s=0;s<g;s++){var _={};v&&(null!=i.arrayPath||null!=m._arrayParentPath)&&(_.arrayPathIndex=s),i.hydratedPopulatedDocs&&(_.hydratedPopulatedDocs=i.hydratedPopulatedDocs),h[s]=m.applySetters(h[s],e,n,void 0,_)}}catch(e){throw new y("["+e.kind+"]",S.inspect(t),this.path+"."+s,e,this)}return t}var O=null!=this.options.castNonArrays?this.options.castNonArrays:k.options.castNonArrays;if(n||O)return e&&n&&e.markModified(this.path),this.cast([t],e,n);throw new y("Array",S.inspect(t),this.path,null,this)},k.prototype._castForPopulate=function(t,e){if(a||(a=r(9600).Array),Array.isArray(t)){var n,o=t.__array?t.__array:t,i=o.length,s=this.caster;if(s&&this.casterConstructor!==d)try{for(n=0;n<i;n++){var u={};s.$isMongooseArray&&null!=s._arrayParentPath&&(u.arrayPathIndex=n),o[n]=s.cast(o[n],e,!1,void 0,u)}}catch(e){throw new y("["+e.kind+"]",S.inspect(t),this.path+"."+n,e,this)}return t}throw new y("Array",S.inspect(t),this.path,null,this)},k.prototype.$toObject=k.prototype.toObject,k.prototype.discriminator=function(){for(var t,e=this;e.$isMongooseArray&&!e.$isMongooseDocumentArray;)if(null==(e=e.casterConstructor)||"function"==typeof e)throw new f("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return(t=e).discriminator.apply(t,arguments)},k.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.constructor(this.path,this.caster,t,this.schemaOptions);return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),e},k.prototype._castForQuery=function(t,e){var r=this,n=this.casterConstructor;if(t&&n.discriminators&&n.schema&&n.schema.options&&n.schema.options.discriminatorKey)if("string"==typeof t[n.schema.options.discriminatorKey]&&n.discriminators[t[n.schema.options.discriminatorKey]])n=n.discriminators[t[n.schema.options.discriminatorKey]];else{var o=E(n.discriminators,t[n.schema.options.discriminatorKey]);o&&(n=o)}var i=this.casterConstructor.prototype,s=i&&i.castForQuery,a=i&&i.cast,u=n.castForQuery,c=this.caster;return Array.isArray(t)?(this.setters.reverse().forEach(function(e){t=e.call(r,t,r)}),t=t.map(function(t){return $.isObject(t)&&t.$elemMatch?t:s?t=s.call(c,null,t,e):a?t=a.call(c,t):u?t=u.call(c,null,t,e):null!=t?t=new n(t):t})):s?t=s.call(c,null,t,e):a?t=a.call(c,t):u?t=u.call(c,null,t,e):null!=t&&(t=new n(t)),t},k.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw Error("Can't use "+t+" with Array.");return n.call(this,e,r)}return this._castForQuery(e,r)},k.prototype.virtual=function(t,e){if(t instanceof m||"VirtualType"===O(t))return this.virtual(t.path,t.options);if(e=new b(e),$.hasUserDefinedProperty(e,["ref","refPath"]))throw new f("Cannot set populate virtual as a property of an array");var r=new m(e,t);return null===this.virtuals&&(this.virtuals={}),this.virtuals[t]=r,r};var N=k.prototype.$conditionalHandlers={};function I(t){return function(e,r){if(!Array.isArray(e))throw TypeError("conditional "+t+" requires an array");var n,o=[],s=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return i(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(t,void 0):void 0}}(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw o}}}}(e);try{for(s.s();!(n=s.n()).done;){var a,u=n.value;o.push(g(null!=(a=this.casterConstructor.schema)?a:r.schema,u,null,this&&this.$$context))}}catch(t){s.e(t)}finally{s.f()}return o}}N.$all=function(t,e){var r=this;return Array.isArray(t)||(t=[t]),t=t.map(function(t){if(!$.isObject(t))return t;if(null!=t.$elemMatch)return{$elemMatch:g(r.casterConstructor.schema,t.$elemMatch,null,r&&r.$$context)};var e={};
3return e[r.path]=t,g(r.casterConstructor.schema,e,null,r&&r.$$context)[r.path]},this),this.castForQuery(null,t,e)},N.$options=String,N.$elemMatch=function(t,e){for(var r=Object.keys(t),n=r.length,o=0;o<n;++o){var i=r[o],s=t[i];w(i)&&null!=s&&(t[i]=this.castForQuery(i,s,e))}return t},N.$geoIntersects=A.cast$geoIntersects,N.$or=I("$or"),N.$and=I("$and"),N.$nor=I("$nor"),N.$near=N.$nearSphere=A.cast$near,N.$within=N.$geoWithin=A.cast$within,N.$size=N.$minDistance=N.$maxDistance=j,N.$exists=c,N.$type=l,N.$eq=N.$gt=N.$gte=N.$lt=N.$lte=N.$not=N.$regex=N.$ne=k.prototype._castForQuery,N.$nin=h.prototype.$conditionalHandlers.$nin,N.$in=h.prototype.$conditionalHandlers.$in,k.prototype.toJSONSchema=function(t){var e=this.getEmbeddedSchemaType(),r=this.options.required&&"function"!=typeof this.options.required;return o(o({},P("array","array",null==t?void 0:t.useBsonType,r)),{},{items:e.toJSONSchema(t)})},k.prototype.autoEncryptionType=function(){return"array"},t.exports=k},7768:(t,e,r)=>{"use strict";var n=r(2402);t.exports=function(t){return null==t?t:""===t?null:("string"!=typeof t&&"boolean"!=typeof t||(t=Number(t)),n.ok(!isNaN(t)),t instanceof Number?t.valueOf():"number"==typeof t?t:Array.isArray(t)||"function"!=typeof t.valueOf?t.toString&&!Array.isArray(t)&&t.toString()==Number(t)?Number(t):void n.ok(!1):Number(t.valueOf()))}},7834:t=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t,r,n,o){return o.justOne||o.count?(t[r]=Array.isArray(n)?n[0]:n,"object"!==e(t[r])&&(t[r]=o.count?n:null)):(t[r]=Array.isArray(n)?n:null==n?[]:[n],t[r]=t[r].filter(function(t){return t&&"object"===e(t)})),t[r]}},7860:t=>{"use strict";t.exports=function(t){for(var e=[],r="",n="DEFAULT",o=0;o<t.length;++o)"IN_SQUARE_BRACKETS"!==n||/\d/.test(t[o])||"]"===t[o]||(n="DEFAULT",r=e[e.length-1]+"["+r,e.splice(e.length-1,1)),"["===t[o]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(e.push(r),r=""),n="IN_SQUARE_BRACKETS"):"]"===t[o]?"IN_SQUARE_BRACKETS"===n?(n="IMMEDIATELY_AFTER_SQUARE_BRACKETS",e.push(r),r=""):(n="DEFAULT",r+=t[o]):"."===t[o]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(e.push(r),r=""),n="DEFAULT"):r+=t[o];return"IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&e.push(r),e}},7878:(t,e,r)=>{"use strict";var n=r(2273),o=r(4183);t.exports=function(){var t=o();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},7910:(t,e,r)=>{"use strict";var n=r(1058);t.exports=function(t,e,r){var o=t.schema.options.discriminatorKey,i=null!=e&&e[o];if(null==i&&(i=r),t.discriminators&&null!=i)if(t.discriminators[i])t=t.discriminators[i];else{var s=n(t.discriminators,i);s&&(t=s)}return t}},7911:(t,e,r)=>{"use strict";var n=r(9834);t.exports=function(t){return!!n(t)}},7930:(t,e)=>{"use strict";e.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup"),e.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics"),e.arrayParentSymbol=Symbol("mongoose#Array#_parent"),e.arrayPathSymbol=Symbol("mongoose#Array#_path"),e.arraySchemaSymbol=Symbol("mongoose#Array#_schema"),e.documentArrayParent=Symbol("mongoose#documentArrayParent"),e.documentIsSelected=Symbol("mongoose#Document#isSelected"),e.documentIsModified=Symbol("mongoose#Document#isModified"),e.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths"),e.documentSchemaSymbol=Symbol("mongoose#Document#schema"),e.getSymbol=Symbol("mongoose#Document#get"),e.modelSymbol=Symbol("mongoose#Model"),e.objectIdSymbol=Symbol("mongoose#ObjectId"),e.populateModelSymbol=Symbol("mongoose#PopulateOptions#Model"),e.schemaTypeSymbol=Symbol("mongoose#schemaType"),e.sessionNewDocuments=Symbol("mongoose#ClientSession#newDocuments"),e.scopeSymbol=Symbol("mongoose#Document#scope"),e.validatorErrorSymbol=Symbol("mongoose#validatorError")},7944:t=>{function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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.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.Double=r(1732),e.Int32=r(433),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){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function 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})(t)}var i=r(3609),s=r(8995),a=r(7953),u=r(170),c=r(1244),l=r(9064),f=r(3703),p=r(7425),h=r(5110),y=r(7352),d=r(608),b=r(2497),m=r(8768),v=["Polygon","MultiPolygon"];t.exports=function t(e,r,g,_){if(Array.isArray(r))throw Error("Query filter must be an object, got an array ",y.inspect(r));if(null==r)return r;null!=e&&null!=e.discriminators&&null!=r[e.options.discriminatorKey]&&(e=p(e,r[e.options.discriminatorKey])||e);var O,w,S,$,j,P,A=Object.keys(r),E=A.length;for(g=g||{};E--;)if(P=r[$=A[E]],"$or"===$||"$nor"===$||"$and"===$){if(!Array.isArray(P))throw new i("Array",P,$);for(var x=P.length-1;x>=0;x--){if(null==P[x]||"object"!==o(P[x]))throw new i("Object",P[x],$+"."+x);var T=Object.keys(P[x]).length,k=P[x][e.options.discriminatorKey];
3if(null==k)P[x]=t(e,P[x],g,_);else{var N=p(_.schema,k);P[x]=t(N||e,P[x],g,_)}0===Object.keys(P[x]).length&&0!==T&&P.splice(x,1)}0===P.length&&delete r[$]}else{if("$where"===$){if("string"!==(j=o(P))&&"function"!==j)throw Error("Must have a string or function for $where");"function"===j&&(r[$]=P.toString());continue}if("$expr"===$){P=u(P,e);continue}if("$elemMatch"===$)P=t(e,P,g,_);else if("$text"===$)P=l(P,$);else if("$comment"!==$||e.paths.hasOwnProperty("$comment")){if(!e)continue;if(!(w=e.path($)))for(var I=$.split("."),B=I.length;B--;){var M=I.slice(0,B).join("."),D=I.slice(B).join("."),R=e.path(M),U=R&&R.schema&&R.schema.options&&R.schema.options.discriminatorKey;if(null!=R&&null!=(R.schema&&R.schema.discriminators)&&null!=U&&D!==U){var C=f(r,M+"."+U),F=R.schema.discriminators;"string"==typeof C&&null!=F[C]?w=F[C].path(D):null!=C&&1===Object.keys(C).length&&Array.isArray(C.$in)&&1===C.$in.length&&"string"==typeof C.$in[0]&&null!=F[C.$in[0]]&&(w=F[C.$in[0]].path(D))}}if(w){if(null==P)continue;if(m.isPOJO(P))if(Object.keys(P).some(h))for(var L=Object.keys(P),V=void 0,q=L.length;q--;)if(S=P[V=L[q]],"$elemMatch"===V)S&&null!=w&&null!=w.schema?t(w.schema,S,g,_):S&&null!=w&&w.$isMongooseArray&&(m.isPOJO(S)&&null!=S.$not?t(e,S,g,_):P[V]=w.castForQuery(V,S,_));else if("$not"===V){if(S&&w){if((O=Object.keys(S)).length&&h(O[0]))for(var J in S)S[J]=w.castForQuery(J,S[J],_);
3else P[V]=w.castForQuery(V,S,_);continue}}else P[V]=w.castForQuery(V,S,_);else r[$]=w.castForQuery(null,P,_);else if(Array.isArray(P)&&-1===["Buffer","Array"].indexOf(w.instance)&&!g.sanitizeFilter){var z,K=[],H=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return n(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,void 0):void 0}}(t))){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw 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(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw i}}}}(P);try{for(H.s();!(z=H.n()).done;){var W=z.value;K.push(w.castForQuery(null,W,_))}}catch(t){H.e(t)}finally{H.f()}r[$]={$in:K}}else r[$]=w.castForQuery(null,P,_)}else{for(var G=$.split("."),Q=G.length,Y=void 0,Z=void 0,X=void 0;Q--&&(Y=G.slice(0,Q).join("."),!(w=e.path(Y))););if(w){if(w.caster&&w.caster.schema){(X={})[Z=G.slice(Q).join(".")]=P;var tt=t(w.caster.schema,X,g,_)[Z];void 0===tt?delete r[$]:r[$]=tt}else r[$]=P;continue}if(d(P)){var te="";if(P.$near?te="$near":P.$nearSphere?te="$nearSphere":P.$within?te="$within":P.$geoIntersects?te="$geoIntersects":P.$geoWithin&&(te="$geoWithin"),te){var tr=new a.Number("__QueryCasting__"),tn=P[te];if(null!=P.$maxDistance&&(P.$maxDistance=tr.castForQuery(null,P.$maxDistance,_)),null!=P.$minDistance&&(P.$minDistance=tr.castForQuery(null,P.$minDistance,_)),"$within"===te){var to=tn.$center||tn.$centerSphere||tn.$box||tn.$polygon;if(!to)throw Error("Bad $within parameter: "+JSON.stringify(P));tn=to}else if("$near"===te&&"string"==typeof tn.type&&Array.isArray(tn.coordinates))tn=tn.coordinates;else if(("$near"===te||"$nearSphere"===te||"$geoIntersects"===te)&&tn.$geometry&&"string"==typeof tn.$geometry.type&&Array.isArray(tn.$geometry.coordinates))null!=tn.$maxDistance&&(tn.$maxDistance=tr.castForQuery(null,tn.$maxDistance,_)),null!=tn.$minDistance&&(tn.$minDistance=tr.castForQuery(null,tn.$minDistance,_)),b(tn.$geometry)&&(tn.$geometry=tn.$geometry.toObject({transform:!1,virtuals:!1})),tn=tn.$geometry.coordinates;else if("$geoWithin"===te)if(tn.$geometry){b(tn.$geometry)&&(tn.$geometry=tn.$geometry.toObject({virtuals:!1}));var ti=tn.$geometry.type;if(-1===v.indexOf(ti))throw Error('Invalid geoJSON type for $geoWithin "'+ti+'", must be "Polygon" or "MultiPolygon"');tn=tn.$geometry.coordinates}else b(tn=tn.$box||tn.$polygon||tn.$center||tn.$centerSphere)&&(tn=tn.toObject({virtuals:!1}));!function t(e,r,n){if(Array.isArray(e))e.forEach(function(o,i){if(Array.isArray(o)||d(o))return t(o,r,n);e[i]=r.castForQuery(null,o,n)});else for(var o=Object.keys(e),i=o.length;i--;){var s=o[i],a=e[s];Array.isArray(a)||d(a)?(t(a,r,n),e[s]=a):e[s]=r.castForQuery({val:a,context:n})}}(tn,tr,_);continue}}if(e.nested[$])continue;var ts="strict"in g?g.strict:e.options.strict,ta=function(t,e,r,n){if("strictQuery"in t)return t.strictQuery;if("strictQuery"in e)return e.strictQuery;var o=n&&n.mongooseCollection&&n.mongooseCollection.conn&&n.mongooseCollection.conn.base&&n.mongooseCollection.conn.base.options;return o&&"strictQuery"in o?o.strictQuery:r.strictQuery}(g,e._userProvidedOptions,e.options,_);if(g.upsert&&ts){if("throw"===ts)throw new s($);throw new s($,'Path "'+$+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if("throw"===ta)throw new s($,'Path "'+$+"\" is not in schema and strictQuery is 'throw'.");ta&&delete r[$]}}else P=c(P,$),r[$]=P}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})(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}
3function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t){var r,s;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),r=e,s=["Schema hasn't been registered for model \""+t+'".\nUse mongoose.model(name, schema)'],r=i(r),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(r,s||[],i(this).constructor):r.apply(this,s))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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?(e=t.path,r=t.options.immutable,t.$immutableSetter=function(t,o,i,s){if(null==this||null==this.$__||this.isNew||s&&s.overwriteImmutable||!("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})(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 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)})(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})(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var s=function(t){function r(){var t,o;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,r),t=r,o=arguments,t=i(t),function(t,r){if(r&&("object"==e(r)||"function"==typeof r))return r;if(void 0!==r)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,n()?Reflect.construct(t,o||[],i(this).constructor):t.apply(this,o))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(r,"prototype",{writable:!1}),r}(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}
3,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=new o(null!=(e=t.replace(/[{}-]/g,""))&&n.from(e,"hex"));return r._subtype=4,r}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 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 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="u">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 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})(t)}function n(t,e){if(t){if("string"==typeof t)return o(t,e);var r=({}).toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e,r){if(a())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&s(o,r.prototype),o}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(a=function(){return!!t})()}function u(){this._pres=new Map,this._posts=new Map}function c(t,e,r,n,o,i,s){return i.useErrorHandlers?t.execPost(r,n,o,{error:e},function(t){return"function"==typeof s&&s(t)}):"function"==typeof s&&s(e)}function l(t,e,r,n){var o;try{o=t.apply(e,r)}catch(t){return n(t)}
3f(o)&&o.then(function(){return n()},function(t){return n(t)})}function f(t){return"object"===r(t)&&null!==t&&"function"==typeof t.then}function p(t){var e=!1,r=this;return function(){var n=arguments;if(!e)return e=!0,h(function(){return t.apply(r,n)})}}u.skipWrappedFunction=function(){if(!(this instanceof u.skipWrappedFunction))return i(u.skipWrappedFunction,Array.prototype.slice.call(arguments));this.args=Array.prototype.slice.call(arguments)},u.overwriteResult=function(){if(!(this instanceof u.overwriteResult))return i(u.overwriteResult,Array.prototype.slice.call(arguments));this.args=Array.prototype.slice.call(arguments)},u.prototype.execPre=function(t,e,r,n){3==arguments.length&&(n=r,r=[]);var o=this._pres.get(t)||[],i=o.length,s=o.numAsync||0,a=0,c=s,y=!1,d=r,b=null;if(!i)return h(function(){n(null)});function m(){if(!(a>=i)){var t=o[a];if(t.isAsync){var r=[p(v),p(function(t){if(t){if(y)return;if(!(t instanceof u.skipWrappedFunction))return y=!0,n(t);b=t}if(0==--c&&a>=i)return n(b)})];l(t.fn,e,r,r[0])}else if(t.fn.length>0){for(var s=[p(v)],g=arguments.length>=2?arguments:[null].concat(d),_=1;_<g.length;++_)_===g.length-1&&"function"==typeof g[_]||s.push(g[_]);l(t.fn,e,s,s[0])}else{var O=null;try{O=t.fn.call(e)}catch(t){if(null!=t)return n(t)}if(f(O))O.then(function(){return v()},function(t){return v(t)});else{if(++a>=i)return c>0?void 0:h(function(){n(b)});m()}}}}function v(t){if(t){if(y)return;if(!(t instanceof u.skipWrappedFunction))return y=!0,n(t);b=t}if(++a>=i)return c>0?void 0:n(b);m.apply(e,arguments)}m.apply(null,[null].concat(r))},u.prototype.execPreSync=function(t,e,r){for(var n=this._pres.get(t)||[],o=n.length,i=0;i<o;++i)n[i].fn.apply(e,r||[])},u.prototype.execPost=function(t,e,r,n,o){arguments.length<5&&(o=n,n=null);var i=this._posts.get(t)||[],s=i.length,a=0,c=null;if(n&&n.error&&(c=n.error),!s)return h(function(){o.apply(null,[c].concat(r))});!function t(){for(var n=i[a].fn,h=0,d=r.length,b=[],m=0;m<d;++m)h+=r[m]&&r[m]._kareemIgnore?0:1,r[m]&&r[m]._kareemIgnore||b.push(r[m]);if(c)if(y(i[a],h)){var v=p(function(e){if(e){if(e instanceof u.overwriteResult)return r=e.args,++a>=s?o.call(null,c):t();c=e}if(++a>=s)return o.call(null,c);t()});l(n,e,[c].concat(b).concat([v]),v)}else{if(++a>=s)return o.call(null,c);t()}else{var g,_,O=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([O]),O);else{try{_=n.apply(e,b)}catch(t){g=t,c=t}if(f(_))return _.then(function(t){O(t instanceof u.overwriteResult?t:null)},function(t){return O(t)});if(_ instanceof u.overwriteResult&&(r=_.args),++a>=s)return o.apply(null,[g].concat(r));t()}}}()},u.prototype.execPostSync=function(t,e,r){for(var n=this._posts.get(t)||[],o=n.length,i=0;i<o;++i){var s=n[i].fn.apply(e,r||[]);s instanceof u.overwriteResult&&(r=s.args)}return r},u.prototype.createWrapperSync=function(t,e){var r=this;return function(){r.execPreSync(t,this,arguments);var n=e.apply(this,arguments);return r.execPostSync(t,this,[n])[0]}},u.prototype.wrap=function(t,e,r,i,s){var a=i.length>0?i[i.length-1]:null,l=Array.from(i);"function"==typeof a&&l.pop();var p=this,h=(s=s||{}).checkForPromise;this.execPre(t,r,i,function(i){if(i&&!(i instanceof u.skipWrappedFunction)){for(var y=s.numCallbackParams||0,d=s.contextParameter?[r]:[],b=d.length;b<y;++b)d.push(null);return c(p,i,t,r,d,s,a)}var m,v,g=e.length;if(i instanceof u.skipWrappedFunction)return m=i.args[0],_.apply(void 0,[null].concat(function(t){if(Array.isArray(t))return o(t)}
3(v=i.args)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(v)||n(v)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));try{m=e.apply(r,l.concat(_))}catch(t){return _(t)}if(h){if(f(m))return m.then(function(t){return _(null,t)},function(t){return _(t)});if(g<l.length+1)return _(null,m)}function _(){var e=Array.from(arguments);if(e.shift(),s.nullResultByDefault&&0===e.length&&e.push(null),arguments[0])return c(p,arguments[0],t,r,e,s,a);p.execPost(t,r,e,function(){null!==a&&(arguments[0]?a(arguments[0]):a.apply(r,arguments))})}})},u.prototype.filter=function(t){for(var e=this,r=this.clone(),n=Array.from(r._pres.keys()),o=0;o<n.length;o++)!function(){var i=n[o],s=e._pres.get(i).map(function(t){return Object.assign({},t,{name:i})}).filter(t);if(0===s.length)return r._pres.delete(i);s.numAsync=s.filter(function(t){return t.isAsync}).length,r._pres.set(i,s)}();for(var i=Array.from(r._posts.keys()),s=0;s<i.length;s++)!function(){var n=i[s],o=e._posts.get(n).map(function(t){return Object.assign({},t,{name:n})}).filter(t);if(0===o.length)return r._posts.delete(n);r._posts.set(n,o)}();return r},u.prototype.hasHooks=function(t){return this._pres.has(t)||this._posts.has(t)},u.prototype.createWrapper=function(t,e,r,n){var o=this;return this.hasHooks(t)?function(){o.wrap(t,e,r||this,Array.from(arguments),n)}:function(){var t=arguments,r=this;h(function(){return e.apply(r,t)})}},u.prototype.pre=function(t,e,n,o,i){var s={};"object"===r(e)&&null!==e?e=(s=e).isAsync:"boolean"!=typeof arguments[1]&&(n=e,e=!1);var a=this._pres.get(t)||[];if(this._pres.set(t,a),e&&(a.numAsync=a.numAsync||0,++a.numAsync),"function"!=typeof n)throw Error('pre() requires a function, got "'+r(n)+'"');return i?a.unshift(Object.assign({},s,{fn:n,isAsync:e})):a.push(Object.assign({},s,{fn:n,isAsync:e})),this},u.prototype.post=function(t,e,n,o){var i=this._posts.get(t)||[];if("function"==typeof e&&(o=!!n,n=e,e={}),"function"!=typeof n)throw Error('post() requires a function, got "'+r(n)+'"');return o?i.unshift(Object.assign({},e,{fn:n})):i.push(Object.assign({},e,{fn:n})),this._posts.set(t,i),this},u.prototype.clone=function(){var t,r=new u,n=e(this._pres.keys());try{for(n.s();!(t=n.n()).done;){var o=t.value,i=this._pres.get(o).slice();i.numAsync=this._pres.get(o).numAsync,r._pres.set(o,i)}}catch(t){n.e(t)}finally{n.f()}var s,a=e(this._posts.keys());try{for(a.s();!(s=a.n()).done;){var c=s.value;r._posts.set(c,this._posts.get(c).slice())}}catch(t){a.e(t)}finally{a.f()}return r},u.prototype.merge=function(t,r){var n,o=(r=1==arguments.length||r)?this.clone():this,i=e(t._pres.keys());try{for(i.s();!(n=i.n()).done;)!function(){var e=n.value,r=o._pres.get(e)||[],i=t._pres.get(e).filter(function(t){return -1===r.map(function(t){return t.fn}).indexOf(t.fn)}),s=r.concat(i);s.numAsync=r.numAsync||0,s.numAsync+=i.filter(function(t){return t.isAsync}).length,o._pres.set(e,s)}()}catch(t){i.e(t)}finally{i.f()}var s,a=e(t._posts.keys());try{for(a.s();!(s=a.n()).done;)!function(){var e=s.value,r=o._posts.get(e)||[],n=t._posts.get(e).filter(function(t){return -1===r.indexOf(t)});o._posts.set(e,r.concat(n))}()}catch(t){a.e(t)}finally{a.f()}return o};var h=(r({env:{}}),function(t){setTimeout(t,0)});function y(t,e){return!!t.errorHandler||t.fn.length===e+2}t.exports=u},8435:t=>{"use strict";t.exports=Math.min},8442:(t,e,r)=>{"use strict";var n=r(1898);t.exports=function(t){for(var e=0,r=Object.values(n);e<r.length;e++)(0,r[e])(t,{deduplicate:!0});t.plugins=Object.values(n).map(function(t){return{fn:t,opts:{deduplicate:!0}}}).concat(t.plugins)}},8499:(t,e,r)=>{"use strict";var n=r(8953);t.exports=function(t){return n(t,null!=this?this.path:null)}},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})(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}
3function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t,r,s){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");var a,u,c,l,f,p=null!=(c=null==s?void 0:s.matchedCount)?c:0,h=null!=(l=null==s?void 0:s.insertedCount)?l:0,y=r.map(function(t){return t._id}).join(", ");y.length>100&&(y=y.slice(0,100)+"...");var d=r.length-p-h;return(a=e,u=["".concat(t,".bulkSave() was not able to update ").concat(d," of the given documents due to incorrect version or optimistic concurrency, document ids: ").concat(y)],a=i(a),f=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(a,u||[],i(this).constructor):a.apply(this,u))).modelName=t,f.documents=r,f.bulkWriteResult=s,f.numDocumentsNotUpdated=d,f}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(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)})(t)}function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(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){var a,u;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),a=e,u=[t,r,n],a=s(a),function(t,e){if(e&&("object"==o(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,i()?Reflect.construct(a,u||[],s(this).constructor):a.apply(this,u))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(e.Document);return n.modelName=t,n},"u">typeof window&&(window.mongoose=t.exports,window.Buffer=n)},8633:t=>{"use strict";t.exports=Math.pow},8728:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==i(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEac
3h(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return 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})(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var a=r(6426),u=r(3672),c=r(9528),l=r(1244),f=r(4327),p=r(8768),h=r(3305),y=a.CastError;function d(t,e){this.enumValues=[],this.regExp=null,a.call(this,t,e,"String")}function b(t,e){return this.castForQuery(null,t,e)}function m(t){return null==t?this._castNullish(t):this.cast(t,this)}d.schemaName="String",d.defaultOptions={},d.prototype=Object.create(a.prototype),d.prototype.constructor=d,Object.defineProperty(d.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:c}),d._cast=l,d.cast=function(t){return 0==arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},d._defaultCaster=function(t){if(null!=t&&"string"!=typeof t)throw Error();return t},d.get=a.get,d.set=a.set,d.setters=[],d._checkRequired=function(t){return(t instanceof String||"string"==typeof t)&&t.length},d.checkRequired=a.checkRequired,d.prototype.enum=function(){if(this.enumValidator&&(this.validators=this.validators.filter(function(t){return t.validator!==this.enumValidator},this),this.enumValidator=!1),void 0===arguments[0]||!1===arguments[0])return this;p.isObject(arguments[0])?Array.isArray(arguments[0].values)?(t=arguments[0].values,e=arguments[0].message):(t=p.object.vals(arguments[0]),e=u.messages.String.enum):(t=arguments,e=u.messages.String.enum);var t,e,r,n=function(t){var e="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t){if(t){if("string"==typeof t)return s(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(t,void 0):void 0}}(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(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},d.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})},d.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})},d.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})},d.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||u.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},d.prototype.minLength=d.prototype.minlength,d.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||u.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},d.prototype.maxLength=d.prototype.maxlength,d.prototype.match=function(t,e){var r=e||u.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},d.prototype.checkRequired=function(t,e){return"object"===i(t)&&a._isRef(this,t,e,!0)?null!=t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():d.checkRequired())(t)},d.prototype.cast=function(t,e,r,n,o){var i;if("string"!=typeof t&&a._isRef(this,t,e,r))return this._castRef(t,e,r,o);i="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():d.cast();try{return i(t)}catch(e){throw new y("string",t,this.path,null,this)}};var v=o(o({},a.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)]}
3,$gt:b,$gte:b,$lt:b,$lte:b,$options:m,$regex:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)?t:m.call(this,t)},$not:b});Object.defineProperty(d.prototype,"$conditionalHandlers",{configurable:!1,enumerable:!1,writable:!1,value:Object.freeze(v)}),d.prototype.castForQuery=function(t,e,r){var n;if(null!=t){if(!(n=this.$conditionalHandlers[t]))throw Error("Can't use "+t+" with String.");return n.call(this,e,r)}if("[object RegExp]"===Object.prototype.toString.call(e)||h(e,"BSONRegExp"))return e;try{return this.applySetters(e,r)}catch(t){throw t instanceof y&&t.path===this.path&&null!=this.$fullPath&&(t.path=this.$fullPath),t}},d.prototype.toJSONSchema=function(t){var e=this.options.required&&"function"!=typeof this.options.required;return f("string","string",null==t?void 0:t.useBsonType,e)},d.prototype.autoEncryptionType=function(){return"string"},t.exports=d},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){var r="u">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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(t,e){if(t){if("string"==typeof t)return a(t,e);var r=({}).toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c,l=r(6353).UUID,f=r(354),p=r(5678),h=r(5549),y=r(6948),d=r(4450),b=r(2746),m=r(608),v=r(1243),g=r(1347),_=r(3305),O=r(2789),w=r(9696),S=r(2497),$=r(5268),j=r(9539),P=r(2793),A=r(7291).trustedSymbol;e.specialProperties=P,e.isMongooseArray=v.isMongooseArray,e.isMongooseDocumentArray=g.isMongooseDocumentArray,e.registerMongooseArray=v.registerMongooseArray,e.registerMongooseDocumentArray=g.registerMongooseDocumentArray;var E=/\s/,x=/\s+/;e.toCollectionName=function(t,e){if("system.profile"===t||"system.indexes"===t)return t;if("function"==typeof e){if("string"!=typeof t)throw TypeError("Collection name must be a string");if(0===t.length)throw TypeError("Collection name cannot be empty");return e(t)}return t},e.deepEqual=function t(r,o){if(r===o)return!0;if("object"!==u(r)||"object"!==u(o))return r===o;if(r instanceof Date&&o instanceof Date)return r.getTime()===o.getTime();if(_(r,"ObjectId")&&_(o,"ObjectId")||_(r,"Decimal128")&&_(o,"Decimal128"))return r.toString()===o.toString();if(r instanceof RegExp&&o instanceof RegExp)return r.source===o.source&&r.ignoreCase===o.ignoreCase&&r.multiline===o.multiline&&r.global===o.global&&r.dotAll===o.dotAll&&r.unicode===o.unicode&&r.sticky===o.sticky&&r.hasIndices===o.hasIndices;if(null==r||null==o||r.prototype!==o.prototype)return!1;if(r instanceof Map||o instanceof Map)return r instanceof Map&&o instanceof Map&&t(Array.from(r.keys()),Array.from(o.keys()))&&t(Array.from(r.values()),Array.from(o.values()));if(r instanceof Number&&o instanceof Number)return r.valueOf()===o.valueOf();if(n.isBuffer(r))return e.buffer.areEqual(r,o);if(Array.isArray(r)||Array.isArray(o)){if(!Array.isArray(r)||!Array.isArray(o))return!1;var i=r.length;if(i!==o.length)return!1;for(var s=0;s<i;++s)if(!t(r[s],o[s]))return!1;return!0}null!=r.$__?r=r._doc:S(r)&&(r=r.toObject()),null!=o.$__?o=o._doc:S(o)&&(o=o.toObject());var a=Object.keys(r),c=Object.keys(o),l=a.length;if(l!==c.length)return!1;for(var f=l-1;f>=0;f--)if(a[f]!==c[f])return!1;for(var p=0;p<a.length;p++){var h=a[p];if(!t(r[h],o[h]))return!1}return!0},e.last=function(t){if(t.length>0)return t[t.length-1]},e.promiseOrCallback=$,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=i(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||null!=t.$__)return t;if(O(t)){t=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
3e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=u(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==u(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t);for(var r,n=0,i=Object.keys(t);n<i.length;n++){var c=i[n];t[c]=e.clonePOJOsAndArrays(t[c])}return t}if(Array.isArray(t)){t=function(t){if(Array.isArray(t))return a(t)}(r=t)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||s(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();for(var l=0;l<t.length;++l)t[l]=e.clonePOJOsAndArrays(t[l])}return t},e.merge=function t(r,n,o,i){o=o||{};var s,a=Object.keys(n),u=0,c=a.length;n[A]&&(r[A]=n[A]),i=i||"";for(var l=o.omitNested||{};u<c;)if(s=a[u++],!(o.omit&&o.omit[s]||l[i]||P.has(s)))if(null==r[s])r[s]=e.clonePOJOsAndArrays(n[s]);else if(e.isObject(n[s])){if(e.isObject(r[s])||(r[s]={}),null!=n[s]){if(o.isDiscriminatorSchemaMerge&&n[s].$isSingleNested&&r[s].$isMongooseDocumentArray||n[s].$isMongooseDocumentArray&&r[s].$isSingleNested)continue;if(n[s].instanceOfSchema){r[s].instanceOfSchema?j(r[s],n[s].clone(),o.isDiscriminatorSchemaMerge):r[s]=n[s].clone();continue}if(_(n[s],"ObjectId")){r[s]=new h(n[s]);continue}}t(r[s],n[s],o,i?i+"."+s:s)}else o.overwrite&&(r[s]=n[s]);return r},e.toObject=function t(n){var o;if(c||(c=r(2400)),null==n)return n;if(n instanceof c)return n.toObject();if(Array.isArray(n)){o=[];var s,a=i(n);try{for(a.s();!(s=a.n()).done;){var u=s.value;o.push(t(u))}}catch(t){a.e(t)}finally{a.f()}return o}if(e.isPOJO(n)){o={},n[A]&&(o[A]=n[A]);for(var l=0,f=Object.keys(n);l<f.length;l++){var p=f[l];P.has(p)||(o[p]=t(n[p]))}return o}return n},e.isObject=m,e.isPOJO=r(2789),e.isNonBuiltinObject=function(t){return!("object"!==u(t)||e.isNativeObject(t)||e.isMongooseType(t)||t instanceof l||null==t)},e.isNativeObject=function(t){return Array.isArray(t)||t instanceof Date||t instanceof Boolean||t instanceof Number||t instanceof String},e.isEmptyObject=function(t){return null!=t&&"object"===u(t)&&0===Object.keys(t).length},e.hasKey=function(t,r){for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];if(i===r||e.isPOJO(t[i])&&e.hasKey(t[i],r))return!0}return!1},e.tick=function(t){if("function"==typeof t)return function(){try{t.apply(this,arguments)}catch(t){b(function(){throw t})}}},e.isMongooseType=function(t){return _(t,"ObjectId")||_(t,"Decimal128")||t instanceof n},e.isMongooseObject=S,e.expires=function(t){t&&"Object"===t.constructor.name&&"expires"in t&&(t.expireAfterSeconds="string"!=typeof t.expires?t.expires:Math.round(f(t.expires)/1e3),delete t.expires)},e.populate=function(t,r,n,o,s,a,c,l){var f,p=null;if(1==arguments.length){if(t instanceof y)return t._docs={},t._childDocs=[],[t];if(Array.isArray(t))return(f=[],t.forEach(function(t){E.test(t.path)?t.path.split(x).forEach(function(e){var r=Object.assign({},t);r.path=e,f.push(r)}):f.push(t)}),f).map(function(t){return e.populate(t)[0]});p=e.isObject(t)?Object.assign({},t):{path:t}}else p="object"===u(n)?{path:t,select:r,match:n,options:o}:{path:t,select:r,model:n,match:o,options:s,populate:a,justOne:c,count:l};if(!("string"==typeof p.path||Array.isArray(p.path)&&p.path.every(function(t){return"string"==typeof t})))throw TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `"+u(t)+"`");return function(t){if(Array.isArray(t.populate)){var r=[];t.populate.forEach(function(t){if(E.test(t.path)){var n=Object.assign({},t);n.path.split(x).forEach(function(t){n.path=t,r.push(e.populate(n)[0])})}else r.push(e.populate(t)[0])}),t.populate=e.populate(r)}else null!=t.populate&&"object"===u(t.populate)&&(t.populate=e.populate(t.populate));var n=[],o=E.test(t.path)?t.path.split(x):Array.isArray(t.path)?t.path:[t.path];null!=t.options&&(t.options=d(t.options));var s,a=i(o);try{for(a.s();!(s=a.n()).done;){var c=s.value;n.push(new y(Object.assign({},t,{path:c})))}}catch(t){a.e(t)}finally{a.f()}return n}(p)},e.getValue=function(t,e,r){return p.get(t,e,k,r)};var T=Object.freeze({getters:!1});function k(t,e){if("$*"===e&&t instanceof Map)return t;var r=(null==t?void 0:t._doc)||t;return null!=r&&r.isMongooseArrayProxy&&(r=r.__array),r instanceof Map?r.get(e,T):r[e]}e.setValue=function(t,e,r,n,o){p.set(t,e,r,"_doc",n,o)},e.object={},e.object.vals=function(t){for(var e=Object.keys(t),r=e.length,n=[];r--;)n.push(t[e[r]]);return n};var N=Object.prototype.hasOwnProperty;e.object.hasOwnProperty=function(t,e){return N.call(t,e)},e.isNullOrUndefined=function(t){return null==t},e.array={},e.array.flatten=function t(e,r,n){return n||(n=[]),e.forEach(function(e){Array.isArray(e)?t(e,r,n):r&&!r(e)||n.push(e)}),n};var I=Object.prototype.hasOwnProperty;e.hasUserDefinedProperty=function(t,r){if(null==t)return!1;if(Array.isArray(r)){var n,o=i(r);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(e.hasUserDefinedProperty(t,s))return!0}}catch(t){o.e(t)}finally{o.f()}return!1}if(I.call(t,r))return!0;
3if("object"===u(t)&&r in t){var a=t[r];return a!==Object.prototype[r]&&a!==Array.prototype[r]}return!1},e.isArrayIndex=function(t){return"number"==typeof t?t>=0&&t<=0xffffffff:"string"==typeof t&&!!/^\d+$/.test(t)&&(t*=1)>=0&&t<=0xffffffff},e.array.unique=function(t){var e,r=new Set,n=new Set,o=[],s=i(t);try{for(s.s();!(e=s.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(_(a,"ObjectId")){if(n.has(a.toString()))continue;o.push(a),n.add(a.toString())}else o.push(a)}}catch(t){s.e(t)}finally{s.f()}return o},e.buffer={},e.buffer.areEqual=function(t,e){if(!n.isBuffer(t)||!n.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,o=t.length;r<o;++r)if(t[r]!==e[r])return!1;return!0},e.getFunctionName=w,e.decorate=function(t,e){for(var r in e)P.has(r)||(t[r]=e[r])},e.mergeClone=function(t,r){S(r)&&(r=r.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1}));for(var o,i=Object.keys(r),s=i.length,a=0;a<s;)if(o=i[a++],!P.has(o))if(void 0===t[o])t[o]=d(r[o],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{var u=r[o];if(null==u||!u.valueOf||u instanceof Date||(u=u.valueOf()),e.isObject(u)){var c=u;S(u)&&!u.isMongooseBuffer&&(c=c.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1})),u.isMongooseBuffer&&(c=n.from(c)),e.mergeClone(t[o],c)}else t[o]=d(u,{flattenDecimals:!1})}},e.each=function(t,e){var r,n=i(t);try{for(n.s();!(r=n.n()).done;)e(r.value)}catch(t){n.e(t)}finally{n.f()}},e.renameObjKey=function(t,e,r){return Object.keys(t).reduce(function(n,o){return o===e?n[r]=t[e]:n[o]=t[o],n},{})},e.getOption=function(t){var e,r=i(Array.prototype.slice.call(arguments,1));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(null!=n&&null!=n[t])return n[t]}}catch(t){r.e(t)}finally{r.f()}return null},e.noop=function(){},e.errorToPOJO=function(t){if(!(t instanceof Error))throw Error("`error` must be `instanceof Error`.");var e,r={},n=i(Object.getOwnPropertyNames(t));try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=t[o]}}catch(t){n.e(t)}finally{n.f()}return r},e.warn=function(t){return({env:{}}).emitWarning(t,{code:"MONGOOSE"})},e.injectTimestampsOption=function(t,e){null!=e&&(t.timestamps=e)}},8863:(t,e,r)=>{"use strict";var n=r(2354),o=r(2268),i=r(3123),s=r(5477);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return s(n,i,t)}},8879:(t,e,r)=>{"use strict";var n,o=r(4450),i=(Object.defineProperty(n=function t(e){if(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t),null==e)return this;Object.assign(this,o(e))},"prototype",{writable:!1}),n),s=r(5761);Object.defineProperty(i.prototype,"type",s),Object.defineProperty(i.prototype,"validate",s),Object.defineProperty(i.prototype,"cast",s),Object.defineProperty(i.prototype,"required",s),Object.defineProperty(i.prototype,"default",s),Object.defineProperty(i.prototype,"ref",s),Object.defineProperty(i.prototype,"refPath",s),Object.defineProperty(i.prototype,"select",s),Object.defineProperty(i.prototype,"index",s),Object.defineProperty(i.prototype,"unique",s),Object.defineProperty(i.prototype,"immutable",s),Object.defineProperty(i.prototype,"sparse",s),Object.defineProperty(i.prototype,"text",s),Object.defineProperty(i.prototype,"transform",s),t.exports=i},8920:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var r="u">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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(t,e){if(t){if("string"==typeof t)return a(t,e);var r=({}).toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var u=r(2400),c=r(6547),l=r(8213),f=r(4473),p=r(4450),h=r(3303)._,y=r(5678),d=r(8768),b=r(3305),m=r(7930).arrayAtomicsSymbol,v=r(7930).arrayParentSymbol,g=r(7930).arrayPathSymbol,_=r(7930).arraySchemaSymbol,O=r(7930).populateModelSymbol,w=Symbol("mongoose#Array#sliced"),S=Array.prototype.push,$={$__getAtomics:function(){var t=[],e=Object.keys(this[m]||{}),r=e.length,n=Object.assign({},h,{_isNested:!0});if(0===r)return t[0]=["$set",this.toObject(n)],t;for(;r--;){var o=e[r],i=this[m][o];d.isMongooseObject(i)?i=i.toObject(n):Array.isArray(i)?i=this.toObject.call(i,n):null!=i&&Array.isArray(i.$each)?i.$each=this.toObject.call(i.$each,n):null!=i&&"function"==typeof i.valueOf&&(i=i.valueOf()),"$addToSet"===o&&(i={$each:i}),t.push([o,i])}return t},$atomics:function(){return this[m]},$parent:function(){return this[v]},$path:function(){return this[g]},$shift:function(){this._registerAtomic("$pop",-1),this._markModified();var t=this.__array;if(!t._shifted)return t._shifted=!0,[].shift.call(t)},$pop:function(){if(this._registerAtomic("$pop",1),this._markModified(),!this._popped)return this._popped=!0,[].pop.call(this)},$schema:function(){return this[_]},_cast:function(t){var e,r=!1,o=this[v];if(o&&(r=o.$populated(this[g],!0)),r&&null!=t){if(null==(e=r.options[O]))throw new l("No populated model found for path `"+this[g]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");return(n.isBuffer(t)||b(t,"ObjectId")||!d.isObject(t))&&(t={_id:t}),t.schema&&t.schema.discriminatorMapping&&void 0!==t.schema.discriminatorMapping.key||(t=new e(t)),this[_].caster.applySetters(t,o,!0)}return this[_].caster.applySetters(t,o,!1)},_mapCast:function(t,e){return this._cast(t,this.length+e)},_markModified:function(t){var e,r=this[v];if(r){if(e=this[g],arguments.length&&(e=e+"."+t),null!=e&&e.endsWith(".$"))return this;r.markModified(e,0!=arguments.length?t:r)}return this},_registerAtomic:function(t,e){if(!this[w]){if("$set"===t)return this[m]={$set:e},f(this[v],this[g]),this._markModified(),this;var r,n=this[m];if("$pop"===t&&!("$pop"in n)){var u=this;this[v].once("save",function(){u._popped=u._shifted=null})}if(n.$set||Object.keys(n).length&&!(t in n))return this[m]={$set:this},this;if("$pullAll"===t||"$addToSet"===t)n[t]||(n[t]=[]),n[t]=n[t].concat(e);else if("$pullDocs"===t){var l=n.$pull||(n.$pull={});e[0]instanceof c?(r=l.$or||(l.$or=[]),Array.prototype.push.apply(r,e.map(function(t){return t.toObject({transform:function(e,r){return null==t||null==t.$__||Object.keys(t.$__.activePaths.getStatePaths("default")).forEac
3h(function(t){y.unset(t,r),function t(e,r,n){if("string"==typeof r){if(-1===r.indexOf("."))return;r=y.stringToParts(r)}(n=n||0)>=r.length||null!=e&&"object"===o(e)&&(t(e[r[0]],r,n+1),null!=e[r[0]]&&"object"===o(e[r[0]])&&0===Object.keys(e[r[0]]).length&&delete e[r[0]])}(r,t)}),r},virtuals:!1})}))):(r=l._id||(l._id={$in:[]})).$in=r.$in.concat(e)}else if("$push"===t)if(n.$push=n.$push||{$each:[]},null!=e&&d.hasUserDefinedProperty(e,"$each"))n.$push=e;else if(1===e.length)n.$push.$each.push(e[0]);else if(e.length<1e4)(p=n.$push.$each).push.apply(p,function(t){if(Array.isArray(t))return a(t)}(e)||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||s(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());else{var p,h,b=i(e);try{for(b.s();!(h=b.n()).done;){var _=h.value;n.$push.$each.push(_)}}catch(t){b.e(t)}finally{b.f()}}else n[t]=e;return this}},addToSet:function(){j(this,arguments),P(this,arguments);var t=[].map.call(arguments,this._mapCast,this),e=[],r="";t[0]instanceof c?r="doc":t[0]instanceof Date?r="date":b(t[0],"ObjectId")&&(r="ObjectId");var n=d.isMongooseArray(t)?t.__array:t,o=d.isMongooseArray(this)?this.__array:this;return n.forEach(function(t){var n,i=+t;switch(r){case"doc":n=this.some(function(e){return e.equals(t)});break;case"date":n=this.some(function(t){return+t===i});break;case"ObjectId":n=this.find(function(e){return e.toString()===t.toString()});break;default:n=~this.indexOf(t)}n||(this._markModified(),o.push(t),this._registerAtomic("$addToSet",t),[].push.call(e,t))},this),e},hasAtomics:function(){return d.isPOJO(this[m])?Object.keys(this[m]).length:0},includes:function(t,e){return -1!==this.indexOf(t,e)},indexOf:function(t,e){b(t,"ObjectId")&&(t=t.toString()),e=null==e?0:e;for(var r=this.length,n=e;n<r;++n)if(t==this[n])return n;return -1},inspect:function(){return JSON.stringify(this)},nonAtomicPush:function(){var t=[].map.call(arguments,this._mapCast,this);this._markModified();var e=[].push.apply(this,t);return this._registerAtomic("$set",this),e},pop:function(){this._markModified();var t=[].pop.call(this);return this._registerAtomic("$set",this),t},pull:function(){var t=this,e=[].map.call(arguments,function(e,r){return t._cast(e,r,{defaults:!1})},this),r=this[v].get(this[g]);d.isMongooseArray(r)&&(r=r.__array);var n,o=r.length;for(this._markModified();o--;)(n=r[o])instanceof u?e.some(function(t){return n.equals(t)})&&r.splice(o,1):~this.indexOf.call(e,n)&&r.splice(o,1);return e[0]instanceof c?this._registerAtomic("$pullDocs",e.map(function(t){var e=t.$__getValue("_id");return void 0===e||t.$isDefault("_id")?t:e})):this._registerAtomic("$pullAll",e),f(this[v],this[g])>0&&this._registerAtomic("$set",this),this},push:function(){var t,e=arguments,r=e,n=null!=e[0]&&d.hasUserDefinedProperty(e[0],"$each"),o=d.isMongooseArray(this)?this.__array:this;if(n&&(r=e[0],e=e[0].$each),null==this[_])return S.apply(this,e);j(this,e),P(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,r=d.isMongooseArray(this)?this.__array:this;if(this._markModified(),j(this,Array.prototype.slice.call(arguments,2)),arguments.length){if(null==this[_])t=arguments;else{t=[];for(var n=0;n<arguments.length;++n)t[n]=n<2?arguments[n]:this._cast(arguments[n],arguments[0]+(n-2))}e=[].splice.apply(r,t),this._registerAtomic("$set",this)}return e},toBSON:function(){return this.toObject(h)},toObject:function(t){var e=d.isMongooseArray(this)?this.__array:this;return t&&t.depopulate?((t=p(t))._isNested=!0,[].concat(e).map(function(e){return e instanceof u?e.toObject(t):e})):[].concat(e)},$toObject:function(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift:function(){j(this,arguments),t=null==this[_]?arguments:[].map.call(arguments,this._cast,this);var t,e=d.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(e,t),this._registerAtomic("$set",this),this.length}};function j(t,e){var r,n,s,a,c=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,c)&&t[v].$populated(t[g],[],(n={},s=O,a=e[0].constructor,(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(s),(s="symbol"==o(r)?r:r+"")in n)?Object.defineProperty(n,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[s]=a,n))}function P(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)}
3finally{c.f()}}}for(var A=0,E=["filter","flat","flatMap","map","slice"];A<E.length;A++)!function(){var t=E[A];null==Array.prototype[t]||($[t]=function(){var e=[].concat(d.isMongooseArray(this)?this.__array:this);return e[t].apply(e,arguments)})}();t.exports=$},8953:(t,e,r)=>{"use strict";var n=r(3609);t.exports=function(e,r){if(t.exports.convertToTrue.has(e))return!0;if(t.exports.convertToFalse.has(e))return!1;if(null==e)return e;throw new n("boolean",e,r)},t.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]),t.exports.convertToFalse=new Set([!1,"false",0,"0","no"])},8995:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(t,r,s){var a,u,c;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),(u=e,c=[r=r||"Field `"+t+"` is not in schema and strict mode is set to throw."],u=i(u),a=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(u,c||[],i(this).constructor):u.apply(this,c))).isImmutableError=!!s,a.path=t,a}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(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})(t)}function o(t,e){return e&&("object"===l(e)||"function"==typeof e)?e:i(t)}function i(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t){var e="function"==typeof Map?new Map:void 0;return(s=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw 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 a(t,arguments,c(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,t)})(t)}function a(t,e,r){return(a=!function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&u(o,r.prototype),o}:Reflect.construct).apply(null,arguments)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}
3function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t){return(l="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)})(t)}var f=r(7352).inspect,p=r(3743).codes.ERR_INVALID_ARG_TYPE;function h(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var y={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 d(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 b(t){return f(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}t.exports=function(t){var e;function r(t){if(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,r),"object"!==l(t)||null===t)throw new p("options","Object",t);var e,n=t.message,s=t.operator,a=t.stackStartFn,u=t.actual,f=t.expected,m=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)e=o(this,c(r).call(this,String(n)));else if("object"===l(u)&&null!==u&&"object"===l(f)&&null!==f&&"stack"in u&&u instanceof Error&&"stack"in f&&f instanceof Error&&(u=d(u),f=d(f)),"deepStrictEqual"===s||"strictEqual"===s)e=o(this,c(r).call(this,function(t,e,r){var n="",o="",i=0,s="",a=!1,u=b(t),c=u.split("\n"),f=b(e).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===l(t)&&"object"===l(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===c.length&&1===f.length&&c[0]!==f[0]){var m=c[0].length+f[0].length;if(m<=10){if(("object"!==l(t)||null===t)&&("object"!==l(e)||null===e)&&(0!==t||0!==e))return"".concat(y[r],"\n\n")+"".concat(c[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&m<80){for(;c[0][p]===f[0][p];)p++;p>2&&(d="\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)}(" ",p),"^"),p=0)}}for(var v=c[c.length-1],g=f[f.length-1];v===g&&(p++<2?s="\n  ".concat(v).concat(s):n=v,c.pop(),f.pop(),0!==c.length&&0!==f.length);)v=c[c.length-1],g=f[f.length-1];var _=Math.max(c.length,f.length);if(0===_){var O=u.split("\n");if(O.length>30)for(O[26]="".concat("","...").concat("");O.length>27;)O.pop();return"".concat(y.notIdentical,"\n\n").concat(O.join("\n"),"\n")}p>3&&(s="\n".concat("","...").concat("").concat(s),a=!0),""!==n&&(s="\n  ".concat(n).concat(s),n="");var w=0,S=y[r]+"\n".concat("","+ actual").concat(""," ").concat("","- expected").concat(""),$=" ".concat("","...").concat(""," Lines skipped");for(p=0;p<_;p++){var j=p-i;if(c.length<p+1)j>1&&p>2&&(j>4?(o+="\n".concat("","...").concat(""),a=!0):j>3&&(o+="\n  ".concat(f[p-2]),w++),o+="\n  ".concat(f[p-1]),w++),i=p,n+="\n".concat("","-").concat(""," ").concat(f[p]),w++;else if(f.length<p+1)j>1&&p>2&&(j>4?(o+="\n".concat("","...").concat(""),a=!0):j>3&&(o+="\n  ".concat(c[p-2]),w++),o+="\n  ".concat(c[p-1]),w++),i=p,o+="\n".concat("","+").concat(""," ").concat(c[p]),w++;else{var P=f[p],A=c[p],E=A!==P&&(!h(A,",")||A.slice(0,-1)!==P);E&&h(P,",")&&P.slice(0,-1)===A&&(E=!1,A+=","),E?(j>1&&p>2&&(j>4?(o+="\n".concat("","...").concat(""),a=!0):j>3&&(o+="\n  ".concat(c[p-2]),w++),o+="\n  ".concat(c[p-1]),w++),i=p,o+="\n".concat("","+").concat(""," ").concat(A),n+="\n".concat("","-").concat(""," ").concat(P),w+=2):(o+=n,n="",1!==j&&0!==p||(o+="\n  ".concat(A),w++))}if(w>20&&p<_-2)return"".concat(S).concat($,"\n").concat(o,"\n").concat("","...").concat("").concat(n,"\n")+"".concat("","...").concat("")}return"".concat(S).concat(a?$:"","\n").concat(o).concat(n).concat(s).concat(d)}(u,f,s)));else if("notDeepStrictEqual"===s||"notStrictEqual"===s){var v=y[s],g=b(u).split("\n");
3if("notStrictEqual"===s&&"object"===l(u)&&null!==u&&(v=y.notStrictEqualObject),g.length>30)for(g[26]="".concat("","...").concat("");g.length>27;)g.pop();e=1===g.length?o(this,c(r).call(this,"".concat(v," ").concat(g[0]))):o(this,c(r).call(this,"".concat(v,"\n\n").concat(g.join("\n"),"\n")))}else{var _=b(u),O="",w=y[s];"notDeepEqual"===s||"notEqual"===s?(_="".concat(y[s],"\n\n").concat(_)).length>1024&&(_="".concat(_.slice(0,1021),"...")):(O="".concat(b(f)),_.length>512&&(_="".concat(_.slice(0,509),"...")),O.length>512&&(O="".concat(O.slice(0,509),"...")),"deepEqual"===s||"equal"===s?_="".concat(w,"\n\n").concat(_,"\n\nshould equal\n\n"):O=" ".concat(s," ").concat(O)),e=o(this,c(r).call(this,"".concat(_).concat(O)))}return Error.stackTraceLimit=m,e.generatedMessage=!n,Object.defineProperty(i(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=u,e.expected=f,e.operator=s,Error.captureStackTrace&&Error.captureStackTrace(i(e),a),e.stack,e.name="AssertionError",o(e)}return function(t,e){if("function"!=typeof e&&null!==e)throw 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&&u(t,e)}(r,t),e=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(t,e){return f(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){var n;n=r[e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n})}return t}({},e,{customInspect:!1,depth:0}))}}],function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(r.prototype,e),r}(s(Error))},9122:(t,e,r)=>{"use strict";var n=r(3900),o=r(988),i=r(8863),s=r(5804);t.exports=function(t){var e=i(arguments),r=t.length-(arguments.length-1);return n(e,1+(r>0?r:0),!0)},o?o(t.exports,"apply",{value:s}):t.exports.apply=s},9123:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){!function(t,e,r){var o;(o=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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==n(o)?o:o+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var s,a,u=r(3609),c=r(8235),l=r(3550).EventEmitter,f=r(7760),p=r(4561),h=r(6426),y=r(7982),d=r(4327),b=r(1469),m=r(1313),v=r(3216),g=r(5110),_=r(8768),O=r(7910),w=r(5537),S=r(7930).arrayAtomicsSymbol,$=r(7930).arrayPathSymbol,j=r(7930).documentArrayParent;function P(t,e,r,n){if(e.options&&e.options.timeseries)throw new w(t,"timeseries");var o=P.defaultOptions&&P.defaultOptions._id;null!=o&&((n=n||{})._id=o),null!=n&&null!=n._id?e=m(e,n):null!=r&&null!=r._id&&(e=m(e,r));var i=A(e,r);i.prototype.$basePath=t,f.call(this,t,i,r),this.schema=e,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=i,i.base=e.base;var s=this.defaultValue;"defaultValue"in this&&null==s||this.default(function(){var t=s.call(this);return null==t||Array.isArray(t)||(t=[t]),t}),this.$embeddedSchemaType=new c(t+".$",{required:this&&this.schemaOptions&&this.schemaOptions.required||!1,$parentSchemaType:this}),this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}function A(t,e,n){function o(){a.apply(this,arguments),null!=this.__parentArray&&null!=this.__parentArray.getArrayParent()&&this.$session(this.__parentArray.getArrayParent().$session())}a||(a=r(6547)),t._preCompile();var i=null!=n?n.prototype:a.prototype;for(var s in o.prototype=Object.create(i),o.prototype.$__setSchema(t),o.schema=t,o.prototype.constructor=o,o.$isArraySubdocument=!0,o.events=new l,o.base=t.base,t.methods)o.prototype[s]=t.methods[s];for(var u in t.statics)o[u]=t.statics[u];for(var c in l.prototype)o[c]=l.prototype[c];return o.options=e,o}P.schemaName="DocumentArray",P.options={castNonArrays:!0},P.prototype=Object.create(f.prototype),P.prototype.constructor=P,P.prototype.OptionsConstructor=p,P.prototype.$conditionalHandlers=i({},f.prototype.$conditionalHandlers),P.prototype.discriminator=function(t,e,r){"function"==typeof t&&(t=_.getFunctionName(t)),r=r||{};var n,o=_.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;e.instanceOfSchema&&i&&(e=e.clone());var s=A(e=b(this.casterConstructor,t,e,o,null,null,null==(n=r)?void 0:n.overwriteExisting),null,this.casterConstructor);s.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(s,"name",{value:t})}catch(t){}return this.casterConstructor.discriminators[t]=s,this.casterConstructor.discriminators[t]},P.prototype.doValidate=function(t,e,n,o){s||(s=r(4878));var i=this;try{h.prototype.doValidate.call(this,t,function(r){if(r)return e(r);var u,c=t&&t.length;
3if(!c||o&&o.updateValidator)return e();function l(t){null!=t&&(u=t),--c||e(u)}_.isMongooseDocumentArray(t)||(t=new s(t,i.path,n));for(var f=0,p=c;f<p;++f){var h=t[f];if(null!=h){if(!(h instanceof a)){var y=O(i.casterConstructor,t[f]);h=t[f]=new y(h,t,void 0,void 0,f)}null==o||!o.validateModifiedOnly||h.$isModified()?h.$__validate(null,o,l):--c||e(u)}else--c||e(u)}},n)}catch(t){return e(t)}},P.prototype.doValidateSync=function(t,e,r){var n=h.prototype.doValidateSync.call(this,t,e);if(null!=n)return n;var o=t&&t.length,i=null;if(o){for(var s=0;s<o;++s){var u=t[s];if(u){if(!(u instanceof a)){var c=O(this.casterConstructor,t[s]);u=t[s]=new c(u,t,void 0,void 0,s)}if(null==r||!r.validateModifiedOnly||u.$isModified()){var l=u.validateSync(r);l&&null==i&&(i=l)}}}return i}},P.prototype.getDefault=function(t,e,n){var o="function"==typeof this.defaultValue?this.defaultValue.call(t):this.defaultValue;if(null==o||n&&n.skipCast)return o;s||(s=r(4878)),Array.isArray(o)||(o=[o]),o=new s(o,this.path,t);for(var i=0;i<o.length;++i){var a=new(O(this.casterConstructor,o[i]))({},o,void 0,void 0,i);a.$init(o[i]),a.isNew=!0,Object.assign(a.$__.activePaths.default,a.$__.activePaths.init),a.$__.activePaths.init={},o[i]=a}return o};var E=Object.freeze({transform:!1,virtuals:!1}),x=Object.freeze({skipId:!1,willInit:!0});P.prototype.cast=function(t,e,n,o,i){if(s||(s=r(4878)),null!=t&&null!=t[$]&&t===o)return t;var c,l,f=(i=i||{}).path||this.path;if(!Array.isArray(t)){if(!n&&!P.options.castNonArrays)throw new u("DocumentArray",t,this.path,null,this);return e&&n&&e.markModified(f),this.cast([t],e,n,o,i)}i.skipDocumentArrayCast&&!_.isMongooseDocumentArray(t)||(t=new s(t,f,e,this)),null!=o&&(t[S]=o[S]||{}),null!=i.arrayPathIndex&&(t[$]=f+"."+i.arrayPathIndex);for(var p=_.isMongooseDocumentArray(t)?t.__array:t,h=p.length,y=0;y<h;++y)if(p[y]){var d=O(this.casterConstructor,p[y]),b=v(p[y],!0);if(p[y]!==b&&(p[y]=b),p[y]instanceof a){if(p[y][j]!==e)if(n){var m=new d(null,t,x,c,y);p[y]=m.$init(p[y])}else{var g=new d(p[y],t,void 0,void 0,y);p[y]=g}null==p[y].__index&&p[y].$setIndex(y)}else if(null!=p[y])if(n)e?c||(c=function(t,e,r){if(r&&e){for(var n,o,i,s=t.path+".",a=Object.keys(e),u=a.length,c={};u--;)if((o=a[u]).startsWith(s)){if("$"===(i=o.substring(s.length)))continue;i.startsWith("$.")&&(i=i.substring(2)),n||(n=!0),c[i]=e[o]}return n&&c||void 0}}(this,e.$__.selected,n)):c=!0,l=new d(null,t,x,c,y),p[y]=l.$init(p[y]);else if(o&&"function"==typeof o.id&&(l=o.id(p[y]._id)),o&&l&&_.deepEqual(l.toObject(E),p[y]))l.set(p[y]),p[y]=l;else try{l=new d(p[y],t,void 0,void 0,y),p[y]=l}catch(e){throw new u("embedded",p[y],t[$],e,this)}}return t},P.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.constructor(this.path,this.schema,t,this.schemaOptions);return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),e.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),e._appliedDiscriminators=this._appliedDiscriminators,e},P.prototype.applyGetters=function(t,e){return h.prototype.applyGetters.call(this,t,e)},P.defaultOptions={},P.set=h.set,P.setters=[],P.get=h.get,P.prototype.$conditionalHandlers.$elemMatch=function(t,e){for(var r,n=Object.keys(t),o=n.length,i=0;i<o;++i){var s=n[i],a=t[s];g(s)&&null!=a&&(t[s]=this.castForQuery(s,a,e))}var u=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.options&&this.casterConstructor.schema.options.discriminatorKey,c=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.discriminators||{};return null!=u&&null!=t[u]&&null!=c[t[u]]?y(c[t[u]],t,null,this&&this.$$context):y(null!=(r=this.casterConstructor.schema)?r:e.schema,t,null,this&&this.$$context)},P.prototype.toJSONSchema=function(t){var e=d("object","object",null==t?void 0:t.useBsonType,!1),r=this.options.required&&"function"!=typeof this.options.required;return i(i({},d("array","array",null==t?void 0:t.useBsonType,r)),{},{items:i(i({},e),this.schema.toJSONSchema(t))})},t.exports=P},9166:(t,e,r)=>{"use strict";function n(t,e){var r="u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t){if(t){if("string"==typeof t)return o(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,void 0):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 TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(8759),s=r(3696);function a(t,e,r){if(null!=e){if(Object.keys(e).some(function(t){return"$"===t[0]})){if(e.$push&&y(e.$push),e.$addToSet&&y(e.$addToSet),null!=e.$set)for(var o=0,i=Object.keys(e.$set);o<i.length;o++)u(r,i[o],e.$set,t);if(null!=e.$setOnInsert)for(var c=0,l=Object.keys(e.$setOnInsert);c<l.length;c++)u(r,l[c],e.$setOnInsert,t)}var f,p=n(Object.keys(e).filter(function(t){return"$"!==t[0]}));try{for(p.s();!(f=p.n()).done;){var h=f.value;u(r,h,e,t)}}catch(t){p.e(t)}finally{p.f()}}function y(e){for(var n=0,o=Object.keys(e);n<o.length;n++)!function(){var i=o[n],u=r.path(i.replace(/\.\$\./i,".").replace(/.\$$/,""));if(e[i]&&u&&u.$isMongooseDocumentArray&&u.schema.options.timestamps){var c=u.schema.options.timestamps,l=s(c,"createdAt"),f=s(c,"updatedAt");
3e[i].$each?e[i].$each.forEach(function(e){null!=f&&(e[f]=t),null!=l&&(e[l]=t),a(t,e,u.schema)}):(null!=f&&(e[i][f]=t),null!=l&&(e[i][l]=t),a(t,e[i],u.schema))}}()}}function u(t,e,r,o){var u=i(e),c=t.path(u);if(c){for(var l=[],f=u.split("."),p=f.length-1;p>0;--p){var h=t.path(f.slice(0,p).join("."));null!=h&&(h.$isMongooseDocumentArray||h.$isSingleNested)&&l.push({parentPath:e.split(".").slice(0,p).join("."),parentSchemaType:h})}if(Array.isArray(r[e])&&c.$isMongooseDocumentArray)!function(t,e,r){var n=e.schema.options.timestamps,o=t.length;if(n)for(var i=s(n,"createdAt"),u=s(n,"updatedAt"),c=0;c<o;++c)null!=u&&(t[c][u]=r),null!=i&&(t[c][i]=r),a(r,t[c],e.schema);else for(var l=0;l<o;++l)a(r,t[l],e.schema)}(r[e],c,o);else if(r[e]&&c.$isSingleNested)!function(t,e,r){var n=e.schema.options.timestamps;if(n){var o=s(n,"createdAt"),i=s(n,"updatedAt");null!=i&&(t[i]=r),null!=o&&(t[o]=r),a(r,t,e.schema)}else a(r,t,e.schema)}(r[e],c,o);else if(l.length>0){var y,d=n(l);try{for(d.s();!(y=d.n()).done;){var b=y.value,m=b.parentPath,v=b.parentSchemaType,g=v.schema.options.timestamps,_=s(g,"updatedAt");if(g&&null!=_){if(v.$isSingleNested)r[m+"."+_]=o;else if(v.$isMongooseDocumentArray){var O=e.substring(m.length+1);if(/^\d+$/.test(O)){r[m+"."+O][_]=o;continue}var w=O.indexOf(".");r[m+"."+(O=-1!==w?O.substring(0,w):O)+"."+_]=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})(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=Object.create((n&&n.prototype instanceof c?n:c).prototype);return o(a,"_invoke",function(r,n,o){var i,s,a,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,a=t,p.n=r,u}};function h(r,n){for(s=r,a=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,s=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,y),s=l,a=y;(e=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:e,done:f}}}(r,i,s),!0),a}var u={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=f.prototype=c.prototype=Object.create([][i]?e(e([][i]())):(o(e={},i,function(){return this}),e));function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,o(t,s,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,o(p,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,s,"GeneratorFunction"),o(p),o(p,s,"Generator"),o(p,i,function(){return this}),o(p,"toString",function(){return"[object Generator]"}),(n=function(){return{w:a,m:h}})()}function o(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(o=function(t,e,r,n){if(e)i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{var s=function(e,r){o(t,e,function(t){return this._invoke(e,r,t)})};s("next",0),s("throw",1),s("return",2)}})(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})(t)}var a,u,c=r(2400),l=r(2746),f=r(3303)._,p=r(7352),h=r(8768);function y(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),c.call(this,t,e,n,o),delete this.$__.priorDoc}t.exports=y,y.prototype=Object.create(c.prototype),Object.defineProperty(y.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0}),Object.defineProperty(y.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0}),y.prototype.toBSON=function(){return this.toObject(f)},y.prototype.save=(a=n().m(function t(e){var r=this;return n().w(function(t){for(;;)if(0===t.n)return(e=e||{}).suppressWarning||h.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)}),u=function(){var t=this,e=arguments;return new Promise(function(r,n){var o=a.apply(t,e);function s(t){i(o,r,n,s,u,"next",t)}function u(t){i(o,r,n,s,u,"throw",t)}s(void 0)})},function(t){return u.apply(this,arguments)}),y.prototype.$__fullPath=function(t){return this.$__.fullPath||this.ownerDocument(),t?this.$__.fullPath+"."+t:this.$__.fullPath},y.prototype.$__pathRelativeToParent=function(t){return null==t?this.$basePath:[this.$basePath,t].join(".")},y.prototype.$__save=function(t){var e=this;return l(function(){return t(null,e)})},y.prototype.$isValid=function(t){var e=this.$parent(),r=this.$__pathRelativeToParent(t);return null!=e&&null!=r?e.$isValid(r):c.prototype.$isValid.call(this,t)},y.prototype.markModified=function(t){c.prototype.markModified.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);if(null!=e&&null!=r){var n=this.$__pathRelativeToParent().replace(/\.$/,"");e.isDirectModified(n)||this.isNew||this.$__parent.markModified(r,this)}},y.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)):c.prototype.isModified.call(this,t,e,r)},y.prototype.$markValid=function(t){c.prototype.$markValid.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$markValid(r)},y.prototype.invalidate=function(t,e,r){c.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},y.prototype.$ignore=function(t){c.prototype.$ignore.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$ignore(r)},y.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 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},y.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 Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");r.add(t)}return e.join(".")},y.prototype.parent=function(){return this.$__parent},y.prototype.$parent=y.prototype.parent,y.prototype.$__deleteOne=function(t){if(null!=t)return t(null,this)},y.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)},y.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)},y.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')},y.prototype.inspect=function(){return this.toObject()},p.inspect.custom&&(y.prototype[p.inspect.custom]=y.prototype.inspect),y.prototype.$toObject=function(t,e){var r,n,o,i,s=c.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.minimize)?n:null==this||null==(i=this.$__schemaTypeOptions)?void 0:i.minimize)?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";
3t.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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=function(t){function e(){var t,r;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,e),t=e,r=arguments,t=i(t),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(t,r||[],i(this).constructor):t.apply(this,r))}return function(t,e){if("function"!=typeof e&&null!==e)throw 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),Object.defineProperty(e,"prototype",{writable:!1}),e}(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})(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)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var a=r(8213),u=function(t){var e;function r(t,e){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");var s,u,l,f=t.message;f||(f=a.messages.general.default);var p=c(f,t,e);return s=r,u=[p],s=i(s),(l=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,o()?Reflect.construct(s,u||[],i(this).constructor):s.apply(this,u))).properties=t=Object.assign({},t,{message:p}),l.kind=t.type,l.path=t.path,l.value=t.value,l.reason=t.reason,l}return function(t,e){if("function"!=typeof e&&null!==e)throw 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)}(r,t),e=[{key:"toString",value:function(){return this.message}},{key:"toJSON",value:function(){return Object.assign({name:this.name,message:this.message},this)}}],function(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,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 TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(o.key),o)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}(a);function c(t,e,r){if("function"==typeof t)return t(e,r);for(var n=0,o=Object.keys(e);n<o.length;n++){var i=o[n];"message"!==i&&(t=t.replace("{"+i.toUpperCase()+"}",e[i]))}return t}Object.defineProperty(u.prototype,"name",{value:"ValidatorError"}),Object.defineProperty(u.prototype,"properties",{enumerable:!1,writable:!0,value:null}),u.prototype.formatMessage=c,t.exports=u},9539:t=>{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t,r,n){for(var o,i={},s=0,a=Object.keys(r.tree);s<a.length;s++){var u=a[s];n&&(t.paths[u]||t.nested[u]||t.singleNestedPaths[u])||(i[u]=r.tree[u])}t.options._isMerging=!0,t.add(i,null),delete t.options._isMerging,t.callQueue=t.callQueue.concat(r.callQueue),t.method(r.methods),t.static(r.statics);for(var c=0,l=Object.entries(r._userProvidedOptions);c<l.length;c++){var f=function(t){if(Array.isArray(t))return t}(o=l[c])||function(t){var e=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,n,o,i,s=[],a=!0,u=!1;try{for(o=(e=e.call(t)).next;!(a=(r=o.call(e)).done)&&(s.push(r.value),2!==s.length);a=!0);}catch(t){u=!0,n=t}
3finally{try{if(!a&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(u)throw n}}return s}}(o)||function(t){if(t){if("string"==typeof t)return e(t,2);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)?e(t,2):void 0}}(o)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=f[0],h=f[1];p in t._userProvidedOptions||t.set(p,h)}for(var y in r.query)t.query[y]=r.query[y];for(var d in r.virtuals)t.virtuals[d]=r.virtuals[d].clone();t._indexes=t._indexes.concat(r._indexes||[]),t.s.hooks.merge(r.s.hooks,!1)}},9553:(t,e,r)=>{"use strict";var n=r(5832).hp;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(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 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 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})(t)}var r,n,o=Function.prototype.toString,i="object"===("u"<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"===("u"<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;
3if(!t||"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||"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})(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="u"<typeof globalThis?r.g:globalThis,h=i(),y=a("String.prototype.slice"),d=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return -1},b={__proto__:null};o(h,f&&u&&c?function(t){var e=new p[t];if(Symbol.toStringTag in e&&c){var r=c(e),n=u(r,Symbol.toStringTag);!n&&r&&(n=u(c(r),Symbol.toStringTag)),b["$"+t]=s(n.get)}}:function(t){var e=new p[t],r=e.slice||e.set;r&&(b["$"+t]=s(r))}),t.exports=function(t){if(!t||"object"!==n(t))return!1;if(!f){var e,r,i=y(l(t),8,-1);return d(h,i)>-1?i:"Object"===i&&(r=!1,o(b,function(e,n){if(!r)try{e(t),r=y(n,1)}catch(t){}}),r)}return u?(e=!1,o(b,function(r,n){if(!e)try{"$"+r(t)===n&&(e=y(n,1))}catch(t){}}),e):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})(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||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(4829)})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.