browser.umd.js 1.0 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674
  1. !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mongoose=e():t.mongoose=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=175)}([function(t,e){"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}}},function(t,e,r){"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")},function(t,e,r){var n=r(3),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";(function(t){
  2. /*!
  3. * The buffer module from node.js, for the browser.
  4. *
  5. * @author Feross Aboukhadijeh <http://feross.org>
  6. * @license MIT
  7. */
  8. var n=r(177),i=r(178),o=r(93);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return h(this,t,e,r)}function h(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(f(e),t=a(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,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 h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;l<u;l++)if(h(t,o+l)!==h(e,l)){c=!1;break}if(c)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function w(t,e,r,n){return F(q(e,t.length-r),t,r,n)}function _(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function M(t,e,r,n){return _(t,e,r,n)}function S(t,e,r,n){return F(U(e),t,r,n)}function O(t,e,r,n){return F(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,h=t[i],f=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=r)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return h(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return c(null,t)},u.allocUnsafeSlow=function(t){return c(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},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(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)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 new 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=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):y.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),h=this.slice(n,i),f=t.slice(e,r),c=0;c<a;++c)if(h[c]!==f[c]){o=h[c],s=f[c];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(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 new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return M(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=L(t[o]);return i}function $(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function P(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function T(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function I(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return o||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return o||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*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||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||P(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 e||P(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 e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):T(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):T(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},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),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;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:q(new u(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var C=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(7))},function(t,e,r){"use strict";(function(t,n){
  9. /*!
  10. * Module dependencies.
  11. */
  12. function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new 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=r(143),h=r(81),f=r(32),c=r(18),l=r(279),d=r(41),p=r(42),y=r(33),m=r(144),b=r(280),v=r(146),g=r(145),w=r(52),_=r(53),M=r(150),S=r(82),O=r(147).trustedSymbol;function A(t){if(Array.isArray(t.populate)){var r=[];t.populate.forEach((function(t){if(/[\s]/.test(t.path)){var n=Object.assign({},t);n.path.split(" ").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"===s(t.populate)&&(t.populate=e.populate(t.populate));var n=[],o=t.path.split(" ");null!=t.options&&(t.options=e.clone(t.options));var a,u=i(o);try{for(u.s();!(a=u.n()).done;){var h=a.value;n.push(new l(Object.assign({},t,{path:h})))}}catch(t){u.e(t)}finally{u.f()}return n}
  13. /*!
  14. * Return the value of `obj` at the given `path`.
  15. *
  16. * @param {String} path
  17. * @param {Object} obj
  18. */e.specialProperties=S,e.isMongooseArray=m.isMongooseArray,e.isMongooseDocumentArray=b.isMongooseDocumentArray,e.registerMongooseArray=m.registerMongooseArray,e.registerMongooseDocumentArray=b.registerMongooseDocumentArray,
  19. /*!
  20. * Produces a collection name from model `name`. By default, just returns
  21. * the model name
  22. *
  23. * @param {String} name a model name
  24. * @param {Function} pluralize function that pluralizes the collection name
  25. * @return {String} a collection name
  26. * @api private
  27. */
  28. e.toCollectionName=function(t,e){return"system.profile"===t||"system.indexes"===t?t:"function"==typeof e?e(t):t},
  29. /*!
  30. * Determines if `a` and `b` are deep equal.
  31. *
  32. * Modified from node/lib/assert.js
  33. *
  34. * @param {any} a a value to compare to `b`
  35. * @param {any} b a value to compare to `a`
  36. * @return {Boolean}
  37. * @api private
  38. */
  39. e.deepEqual=function r(n,i){if(n===i)return!0;if("object"!==s(n)&&"object"!==s(i))return n===i;if(n instanceof Date&&i instanceof Date)return n.getTime()===i.getTime();if(v(n,"ObjectID")&&v(i,"ObjectID")||v(n,"Decimal128")&&v(i,"Decimal128"))return n.toString()===i.toString();if(n instanceof RegExp&&i instanceof RegExp)return n.source===i.source&&n.ignoreCase===i.ignoreCase&&n.multiline===i.multiline&&n.global===i.global&&n.dotAll===i.dotAll&&n.unicode===i.unicode&&n.sticky===i.sticky&&n.hasIndices===i.hasIndices;if(null==n||null==i)return!1;if(n.prototype!==i.prototype)return!1;if(n instanceof Map&&i instanceof Map)return r(Array.from(n.keys()),Array.from(i.keys()))&&r(Array.from(n.values()),Array.from(i.values()));if(n instanceof Number&&i instanceof Number)return n.valueOf()===i.valueOf();if(t.isBuffer(n))return e.buffer.areEqual(n,i);if(Array.isArray(n)&&Array.isArray(i)){var o=n.length;if(o!==i.length)return!1;for(var a=0;a<o;++a)if(!r(n[a],i[a]))return!1;return!0}null!=n.$__?n=n._doc:w(n)&&(n=n.toObject()),null!=i.$__?i=i._doc:w(i)&&(i=i.toObject());var u=Object.keys(n),h=Object.keys(i),f=u.length;if(f!==h.length)return!1;for(var c=f-1;c>=0;c--)if(u[c]!==h[c])return!1;for(var l=0,d=u;l<d.length;l++){var p=d[l];if(!r(n[p],i[p]))return!1}return!0},
  40. /*!
  41. * Get the last element of an array
  42. */
  43. e.last=function(t){if(t.length>0)return t[t.length-1]},e.clone=d,
  44. /*!
  45. * ignore
  46. */
  47. e.promiseOrCallback=_,
  48. /*!
  49. * ignore
  50. */
  51. e.cloneArrays=function(t){return Array.isArray(t)?t.map((function(t){return e.cloneArrays(t)})):t},
  52. /*!
  53. * ignore
  54. */
  55. 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},
  56. /*!
  57. * Shallow copies defaults into options.
  58. *
  59. * @param {Object} defaults
  60. * @param {Object} options
  61. * @return {Object} the merged object
  62. * @api private
  63. */
  64. e.options=function(t,e){var r,n=Object.keys(t),i=n.length;for(e=e||{};i--;)(r=n[i])in e||(e[r]=t[r]);return e},
  65. /*!
  66. * Merges `from` into `to` without overwriting existing properties.
  67. *
  68. * @param {Object} to
  69. * @param {Object} from
  70. * @api private
  71. */
  72. e.merge=function t(r,n,i,o){i=i||{};var s,a=Object.keys(n),u=0,h=a.length;n[O]&&(r[O]=n[O]),o=o||"";for(var f=i.omitNested||{};u<h;)if(s=a[u++],!(i.omit&&i.omit[s]||f[o]||S.has(s)))if(null==r[s])r[s]=n[s];else if(e.isObject(n[s])){if(e.isObject(r[s])||(r[s]={}),null!=n[s]){if(i.isDiscriminatorSchemaMerge&&n[s].$isSingleNested&&r[s].$isMongooseDocumentArray||n[s].$isMongooseDocumentArray&&r[s].$isSingleNested)continue;if(n[s].instanceOfSchema){r[s].instanceOfSchema?M(r[s],n[s].clone(),i.isDiscriminatorSchemaMerge):r[s]=n[s].clone();continue}if(n[s]instanceof c){r[s]=new c(n[s]);continue}}t(r[s],n[s],i,o?o+"."+s:s)}else i.overwrite&&(r[s]=n[s])},
  73. /*!
  74. * Applies toObject recursively.
  75. *
  76. * @param {Document|Array|Object} obj
  77. * @return {Object}
  78. * @api private
  79. */
  80. e.toObject=function t(n){var o;if(a||(a=r(14)),null==n)return n;if(n instanceof a)return n.toObject();if(Array.isArray(n)){o=[];var s,u=i(n);try{for(u.s();!(s=u.n()).done;){var h=s.value;o.push(t(h))}}catch(t){u.e(t)}finally{u.f()}return o}if(e.isPOJO(n)){o={},n[O]&&(o[O]=n[O]);for(var f=0,c=Object.keys(n);f<c.length;f++){var l=c[f];S.has(l)||(o[l]=t(n[l]))}return o}return n},e.isObject=y,
  81. /*!
  82. * Determines if `arg` is a plain old JavaScript object (POJO). Specifically,
  83. * `arg` must be an object but not an instance of any special class, like String,
  84. * ObjectId, etc.
  85. *
  86. * `Object.getPrototypeOf()` is part of ES5: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf
  87. *
  88. * @param {Object|Array|String|Function|RegExp|any} arg
  89. * @api private
  90. * @return {Boolean}
  91. */
  92. e.isPOJO=function(t){if(null==t||"object"!==s(t))return!1;var e=Object.getPrototypeOf(t);return!e||"Object"===e.constructor.name},
  93. /*!
  94. * Determines if `arg` is an object that isn't an instance of a built-in value
  95. * class, like Array, Buffer, ObjectId, etc.
  96. */
  97. e.isNonBuiltinObject=function(t){return"object"===s(t)&&!e.isNativeObject(t)&&!e.isMongooseType(t)&&null!=t},
  98. /*!
  99. * Determines if `obj` is a built-in object like an array, date, boolean,
  100. * etc.
  101. */
  102. e.isNativeObject=function(t){return Array.isArray(t)||t instanceof Date||t instanceof Boolean||t instanceof Number||t instanceof String},
  103. /*!
  104. * Determines if `val` is an object that has no own keys
  105. */
  106. e.isEmptyObject=function(t){return null!=t&&"object"===s(t)&&0===Object.keys(t).length},
  107. /*!
  108. * Search if `obj` or any POJOs nested underneath `obj` has a property named
  109. * `key`
  110. */
  111. e.hasKey=function(t,r){for(var n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];if(o===r)return!0;if(e.isPOJO(t[o])&&e.hasKey(t[o],r))return!0}return!1},
  112. /*!
  113. * process.nextTick helper.
  114. *
  115. * Wraps `callback` in a try/catch + nextTick.
  116. *
  117. * node-mongodb-native has a habit of state corruption when an error is immediately thrown from within a collection callback.
  118. *
  119. * @param {Function} callback
  120. * @api private
  121. */
  122. e.tick=function(t){if("function"==typeof t)return function(){try{t.apply(this,arguments)}catch(t){p((function(){throw t}))}}},
  123. /*!
  124. * Returns true if `v` is an object that can be serialized as a primitive in
  125. * MongoDB
  126. */
  127. e.isMongooseType=function(e){return e instanceof c||e instanceof f||e instanceof t},e.isMongooseObject=w,
  128. /*!
  129. * Converts `expires` options of index objects to `expiresAfterSeconds` options for MongoDB.
  130. *
  131. * @param {Object} object
  132. * @api private
  133. */
  134. e.expires=function(t){t&&"Object"===t.constructor.name&&"expires"in t&&(t.expireAfterSeconds="string"!=typeof t.expires?t.expires:Math.round(u(t.expires)/1e3),delete t.expires)},
  135. /*!
  136. * populate helper
  137. */
  138. e.populate=function(t,r,n,i,o,a,u,h){var f=null;if(1===arguments.length){if(t instanceof l)return[t];if(Array.isArray(t)){var c=d(t);return c.map((function(t){return e.populate(t)[0]}))}f=e.isObject(t)?Object.assign({},t):{path:t}}else f="object"===s(n)?{path:t,select:r,match:n,options:i}:{path:t,select:r,model:n,match:i,options:o,populate:a,justOne:u,count:h};if("string"!=typeof f.path)throw new TypeError("utils.populate: invalid path. Expected string. Got typeof `"+s(t)+"`");return A(f);function d(t){var e=[];return t.forEach((function(t){/[\s]/.test(t.path)?t.path.split(" ").forEach((function(r){var n=Object.assign({},t);n.path=r,e.push(n)})):e.push(t)})),e}},e.getValue=function(t,e,r){return h.get(t,e,"_doc",r)},
  139. /*!
  140. * Sets the value of `obj` at the given `path`.
  141. *
  142. * @param {String} path
  143. * @param {Anything} val
  144. * @param {Object} obj
  145. */
  146. e.setValue=function(t,e,r,n,i){h.set(t,e,r,"_doc",n,i)},
  147. /*!
  148. * Returns an array of values from object `o`.
  149. *
  150. * @param {Object} o
  151. * @return {Array}
  152. * @private
  153. */
  154. 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},
  155. /*!
  156. * @see exports.options
  157. */
  158. e.object.shallowCopy=e.options;
  159. /*!
  160. * Safer helper for hasOwnProperty checks
  161. *
  162. * @param {Object} obj
  163. * @param {String} prop
  164. */
  165. var E=Object.prototype.hasOwnProperty;e.object.hasOwnProperty=function(t,e){return E.call(t,e)},
  166. /*!
  167. * Determine if `val` is null or undefined
  168. *
  169. * @return {Boolean}
  170. */
  171. e.isNullOrUndefined=function(t){return null==t},
  172. /*!
  173. * ignore
  174. */
  175. e.array={},
  176. /*!
  177. * Flattens an array.
  178. *
  179. * [ 1, [ 2, 3, [4] ]] -> [1,2,3,4]
  180. *
  181. * @param {Array} arr
  182. * @param {Function} [filter] If passed, will be invoked with each item in the array. If `filter` returns a falsy value, the item will not be included in the results.
  183. * @return {Array}
  184. * @private
  185. */
  186. 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};
  187. /*!
  188. * ignore
  189. */
  190. var x=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 a=n.value;if(e.hasUserDefinedProperty(t,a))return!0}}catch(t){o.e(t)}finally{o.f()}return!1}if(x.call(t,r))return!0;if("object"===s(t)&&r in t){var u=t[r];return u!==Object.prototype[r]&&u!==Array.prototype[r]}return!1};
  191. /*!
  192. * ignore
  193. */
  194. var k=Math.pow(2,32)-1;e.isArrayIndex=function(t){return"number"==typeof t?t>=0&&t<=k:"string"==typeof t&&(!!/^\d+$/.test(t)&&((t=+t)>=0&&t<=k))},
  195. /*!
  196. * Removes duplicate values from an array
  197. *
  198. * [1, 2, 3, 3, 5] => [1, 2, 3, 5]
  199. * [ ObjectId("550988ba0c19d57f697dc45e"), ObjectId("550988ba0c19d57f697dc45e") ]
  200. * => [ObjectId("550988ba0c19d57f697dc45e")]
  201. *
  202. * @param {Array} arr
  203. * @return {Array}
  204. * @private
  205. */
  206. 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 instanceof c){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},
  207. /*!
  208. * Determines if two buffers are equal.
  209. *
  210. * @param {Buffer} a
  211. * @param {Object} b
  212. */
  213. e.buffer={},e.buffer.areEqual=function(e,r){if(!t.isBuffer(e))return!1;if(!t.isBuffer(r))return!1;if(e.length!==r.length)return!1;for(var n=0,i=e.length;n<i;++n)if(e[n]!==r[n])return!1;return!0},e.getFunctionName=g,
  214. /*!
  215. * Decorate buffers
  216. */
  217. e.decorate=function(t,e){for(var r in e)S.has(r)||(t[r]=e[r])},e.mergeClone=function(r,n){w(n)&&(n=n.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1}));for(var i,o=Object.keys(n),s=o.length,a=0;a<s;)if(i=o[a++],!S.has(i))if(void 0===r[i])r[i]=e.clone(n[i],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{var u=n[i];if(null==u||!u.valueOf||u instanceof Date||(u=u.valueOf()),e.isObject(u)){var h=u;w(u)&&!u.isMongooseBuffer&&(h=h.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1})),u.isMongooseBuffer&&(h=t.from(h)),e.mergeClone(r[i],h)}else r[i]=e.clone(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()}},
  218. /*!
  219. * ignore
  220. */
  221. e.getOption=function(t){var e,r=Array.prototype.slice.call(arguments,1),n=i(r);try{for(n.s();!(e=n.n()).done;){var o=e.value;if(null!=o[t])return o[t]}}catch(t){n.e(t)}finally{n.f()}return null},
  222. /*!
  223. * ignore
  224. */
  225. e.noop=function(){},e.errorToPOJO=function(t){if(!(t instanceof Error))throw new 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},
  226. /*!
  227. * ignore
  228. */
  229. e.warn=function(t){return n.emitWarning(t,{code:"MONGOOSE"})}}).call(this,r(3).Buffer,r(5))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,h=[],f=!1,c=-1;function l(){f&&u&&(f=!1,u.length?h=u.concat(h):c=-1,h.length&&d())}function d(){if(!f){var t=a(l);f=!0;for(var e=h.length;e;){for(u=h,h=[];++c<e;)u&&u[c].run();c=-1,e=h.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new p(t,e)),1!==h.length||f||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";
  230. /*!
  231. * Simplified lodash.get to work around the annoying null quirk. See:
  232. * https://github.com/lodash/lodash/issues/3659
  233. */function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){return null==t?t:t instanceof Map?t.get(e):t[e]}t.exports=function(t,e,r){var i,s=!1;if("string"==typeof e){if(-1===e.indexOf(".")){var a=o(t,e);return null==a?r:a}i=e.split(".")}else if(s=!0,1===(i=e).length){var u=o(t,i[0]);return null==u?r:u}var h,f=e,c=t,l=n(i);try{for(l.s();!(h=l.n()).done;){var d=h.value;if(null==c)return r;if(!s&&null!=c[f])return c[f];c=o(c,d),s||(f=f.substr(d.length+1))}}catch(t){l.e(t)}finally{l.f()}return null==c?r:c}},function(t,e){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;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e,r){"use strict";var n=r(19);
  234. /*!
  235. * Module exports.
  236. */t.exports=n,n.messages=r(291),n.Messages=n.messages,n.DocumentNotFoundError=r(292),n.CastError=r(20),n.ValidationError=r(151),n.ValidatorError=r(152),n.VersionError=r(293),n.ParallelSaveError=r(294),n.OverwriteModelError=r(295),n.MissingSchemaError=r(296),n.MongooseServerSelectionError=r(297),n.DivergentArrayError=r(301),n.StrictModeError=r(44)},function(t,e,r){(function(t){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 i=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},o=/%[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,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)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<i;a=n[++r])m(a)||!_(a)?s+=" "+a:s+=" "+u(a);return s},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var s,a={};function u(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(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=h),c(n,t,n.depth)}function h(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function f(t,e){return t}function c(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=c(t,i,n)),i}var o=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")}if(b(e))return t.stylize(""+e,"number");if(y(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(O(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return l(r)}var h,f="",_=!1,A=["{","}"];(p(r)&&(_=!0,A=["[","]"]),O(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(f=" "+RegExp.prototype.toString.call(r)),M(r)&&(f=" "+Date.prototype.toUTCString.call(r)),S(r)&&(f=" "+l(r)),0!==s.length||_&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=_?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)j(e,String(s))?o.push(d(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(t,e,r,n,i,!0))})),o}(t,r,n,a,s):s.map((function(e){return d(t,r,n,a,e,_)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(h,f,A)):A[0]+f+A[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),j(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=m(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),g(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function g(t){return void 0===t}function w(t){return _(t)&&"[object RegExp]"===A(t)}function _(t){return"object"===n(t)&&null!==t}function M(t){return _(t)&&"[object Date]"===A(t)}function S(t){return _(t)&&("[object Error]"===A(t)||t instanceof Error)}function O(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(g(s)&&(s=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(s)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},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.isArray=p,e.isBoolean=y,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=g,e.isRegExp=w,e.isObject=_,e.isDate=M,e.isError=S,e.isFunction=O,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(282);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),x[t.getMonth()],e].join(" ")}function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",k(),e.format.apply(e,arguments))},e.inherits=r(283),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var $="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if($&&t[$]){var e;if("function"!=typeof(e=t[$]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,$,{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})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),$&&Object.defineProperty(e,$,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=$,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,r).then((function(e){t.nextTick(s,null,e)}),(function(e){t.nextTick(P,e,s)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,i(e)),r}}).call(this,r(5))},function(t,e,r){"use strict";(function(n){
  237. /*!
  238. * Module dependencies.
  239. */
  240. 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 o=r(8),s=r(15),a=r(83),u=r(153),h=r(6),f=r(302),c=r(303),l=r(42),d=r(1).schemaTypeSymbol,p=r(4),y=r(1).validatorErrorSymbol,m=r(1).documentIsModified,b=r(1).populateModelSymbol,v=o.CastError,g=o.ValidatorError;function w(t,e,r){this[d]=!0,this.path=t,this.instance=r,this.validators=[],this.getters=this.constructor.hasOwnProperty("getters")?this.constructor.getters.slice():[],this.setters=[],this.splitPath(),e=e||{};for(var n=this.constructor.defaultOptions||{},o=0,a=Object.keys(n);o<a.length;o++){var u=a[o];n.hasOwnProperty(u)&&!e.hasOwnProperty(u)&&(e[u]=n[u])}null==e.select&&delete e.select;var h=this.OptionsConstructor||s;this.options=new h(e),this._index=null,p.hasUserDefinedProperty(this.options,"immutable")&&(this.$immutable=this.options.immutable,f(this));for(var c=0,l=Object.keys(this.options);c<l.length;c++){var y=l[c];if("cast"!==y){if(p.hasUserDefinedProperty(this.options,y)&&"function"==typeof this[y]){if("index"===y&&this._index){if(!1===e.index){var m=this._index;if("object"===i(m)&&null!=m){if(m.unique)throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(m.sparse)throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}var b=e[y];if("default"===y){this.default(b);continue}var v=Array.isArray(b)?b:[b];this[y].apply(this,v)}}else this.castFunction(this.options[y])}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}
  241. /*!
  242. * The class that Mongoose uses internally to instantiate this SchemaType's `options` property.
  243. */function _(t,e){if(void 0!==t&&!t){var r=new(e.ErrorConstructor||g)(e);return r[y]=!0,r}}
  244. /*!
  245. * ignore
  246. */
  247. function M(t){return this.castForQuery(t)}
  248. /*!
  249. * ignore
  250. */
  251. /*!
  252. * Just like handleArray, except also allows `[]` because surprisingly
  253. * `$in: [1, []]` works fine
  254. */
  255. function S(t){var e=this;return Array.isArray(t)?t.map((function(t){return Array.isArray(t)&&0===t.length?t:e.castForQuery(t)})):[this.castForQuery(t)]}
  256. /*!
  257. * ignore
  258. */w.prototype.OptionsConstructor=s,w.prototype.path,w.prototype.validators,w.prototype.validators,
  259. /*!
  260. * ignore
  261. */
  262. 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){return 0===arguments.length||(!1===t&&(t=this.constructor._defaultCaster||function(t){return t}),this._castFunction=t),this._castFunction},w.prototype.cast=function(){throw new 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 o("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,p.expires(this._index),this},w.prototype.unique=function(t){if(!1===this._index){if(!t)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null==this._index||!0===this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.unique=t,this):this},w.prototype.text=function(t){if(!1===this._index){if(!t)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null===this._index||void 0===this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.text=t,this):this},w.prototype.sparse=function(t){if(!1===this._index){if(!t)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null==this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.sparse=t,this):this},w.prototype.immutable=function(t){return this.$immutable=t,f(this),this},w.prototype.transform=function(t){return this.options.transform=t,this},w.prototype.set=function(t){if("function"!=typeof t)throw new TypeError("A setter must be a function.");return this.setters.push(t),this},w.prototype.get=function(t){if("function"!=typeof t)throw new TypeError("A getter must be a function.");return this.getters.push(t),this},w.prototype.validate=function(t,e,r){var n,s,a,u;if("function"==typeof t||t&&"RegExp"===p.getFunctionName(t.constructor))return"function"==typeof e?(n={validator:t,message:e}).type=r||"user defined":e instanceof Object&&!r?((n=p.clone(e)).message||(n.message=n.msg),n.validator=t,n.type=n.type||"user defined"):(null==e&&(e=o.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],!p.isPOJO(u)){var h="Invalid validator. Received ("+i(u)+") "+u+". See http://mongoosejs.com/docs/api.html#schematype_SchemaType-validate";throw new Error(h)}this.validate(u.validator,u)}return this},w.prototype.required=function(t,e){var r={};if(arguments.length>0&&null==t)return this.validators=this.validators.filter((function(t){return t.validator!==this.requiredValidator}),this),this.isRequired=!1,delete this.originalRequiredValue,this;if("object"===i(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=h(this,"$__.cachedRequired");if(null!=r&&!this.$__isSelected(n.path)&&!this[m](n.path))return!0;if(null!=r&&n.path in r){var i=!r[n.path]||n.checkRequired(e,this);return delete r[n.path],i}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||o.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){var r;if(null!=(r="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)){"object"!==i(r)||this.options&&this.options.shared||(r=p.clone(r));var n=this.applySetters(r,t,e);return n&&!Array.isArray(n)&&n.$isSingleNested&&(n.$__parent=t),n}return r},
  263. /*!
  264. * Applies setters without casting
  265. *
  266. * @api private
  267. */
  268. w.prototype._applySetters=function(t,e,r,n){var i=t;if(r)return i;for(var o=this.setters,s=o.length-1;s>=0;s--)i=o[s].call(e,i,n,this);return i},
  269. /*!
  270. * ignore
  271. */
  272. w.prototype._castNullish=function(t){return t},w.prototype.applySetters=function(t,e,r,n,i){var o=this._applySetters(t,e,r,n,i);return null==o?this._castNullish(o):o=this.cast(o,e,r,n,i)},w.prototype.applyGetters=function(t,e){var r=t,n=this.getters,i=n.length;if(0===i)return r;for(var o=0;o<i;++o)r=n[o].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 o=!1,s=this.path,a=this.validators.filter((function(t){return null!=t&&"object"===i(t)})),u=a.length;if(!u)return e(null);var h=this;function f(t,r){if(!o)if(void 0===t||t)--u<=0&&l((function(){e(null)}));else{var n=r.ErrorConstructor||g;(o=new n(r))[y]=!0,l((function(){e(o)}))}}a.forEach((function(e){if(!o){var i,a=e.validator,u=p.clone(e);if(u.path=n&&n.path?n.path:s,u.value=t,a instanceof RegExp)f(a.test(t),u);else if("function"==typeof a)if(void 0!==t||a===h.requiredValidator){try{i=u.propsParameter?a.call(r,t,u):a.call(r,t)}catch(t){i=!1,u.reason=t,t.message&&(u.message=t.message)}null!=i&&"function"==typeof i.then?i.then((function(t){f(t,u)}),(function(t){u.reason=t,u.message=t.message,f(i=!1,u)})):f(i,u)}else f(!0,u)}}))},w.prototype.doValidateSync=function(t,e,r){var n=this.path;if(!this.validators.length)return null;var o=this.validators;if(void 0===t){if(0===this.validators.length||"required"!==this.validators[0].type)return null;o=[this.validators[0]]}var s=null,a=0,u=o.length;for(a=0;a<u;++a){var h=o[a];if(null!=h&&"object"===i(h)){var f=h.validator,l=p.clone(h);l.path=r&&r.path?r.path:n,l.value=t;var d=!1;if(!c(f))if(f instanceof RegExp)s=_(f.test(t),l);else if("function"==typeof f){try{d=l.propsParameter?f.call(e,t,l):f.call(e,t)}catch(t){d=!1,l.reason=t}if((null==d||"function"!=typeof d.then)&&(s=_(d,l)))break}}}return s},w._isRef=function(t,e,r,i){var o=i&&t.options&&(t.options.ref||t.options.refPath);if(!o&&r&&null!=r.$__){var s=r.$__fullPath(t.path,!0),a=r.ownerDocument();o=null!=s&&a.$populated(s)||r.$populated(t.path)}return!!o&&(null==e||(!(n.isBuffer(e)||"Binary"===e._bsontype||!p.isObject(e))||i))},
  273. /*!
  274. * ignore
  275. */
  276. w.prototype._castRef=function(t,e,r){if(null==t)return t;if(null!=t.$__)return t.$__.wasPopulated=!0,t;if(n.isBuffer(t)||!p.isObject(t)){if(r)return t;throw new v(this.instance,t,this.path,null,this)}var i=e.$__fullPath(this.path,!0),o=e.ownerDocument().$populated(i,!0),s=t;return e.$__.populated&&e.$__.populated[i]&&e.$__.populated[i].options&&e.$__.populated[i].options.options&&e.$__.populated[i].options.options.lean||((s=new o.options[b](t)).$__.wasPopulated=!0),s},w.prototype.$conditionalHandlers={$all:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.castForQuery(t)})):[this.castForQuery(t)]},$eq:M,$in:S,$ne:M,$nin:S,$exists:a,$type:u},
  277. /*!
  278. * Wraps `castForQuery` to handle context
  279. */
  280. w.prototype.castForQueryWrapper=function(t){if(this.$$context=t.context,"$conditional"in t){var e=this.castForQuery(t.$conditional,t.val);return this.$$context=null,e}if(t.$skipQueryCastForUpdate||t.$applySetters){var r=this._castForQuery(t.val);return this.$$context=null,r}var n=this.castForQuery(t.val);return this.$$context=null,n},w.prototype.castForQuery=function(t,e){var r;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new Error("Can't use "+t);return r.call(this,e)}return e=t,this._castForQuery(e)},
  281. /*!
  282. * Internal switch for runSetters
  283. *
  284. * @api private
  285. */
  286. w.prototype._castForQuery=function(t){return this.applySetters(t,this.$$context)},w.checkRequired=function(t){return 0!==arguments.length&&(this._checkRequired=t),this._checkRequired},w.prototype.checkRequired=function(t){return null!=t},
  287. /*!
  288. * ignore
  289. */
  290. 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,f(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},
  291. /*!
  292. * Module exports.
  293. */
  294. t.exports=e=w,e.CastError=v,e.ValidatorError=g}).call(this,r(3).Buffer)},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=e,i=r(21),o=r(11),s=r(128);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),s=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?u:-u,r[0].push(s),a=0==(1&h)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?h:-h,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(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 i,o="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,r)}(t,i,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var h=10;function f(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(t))}function c(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,a;if(f(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function d(){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},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function y(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):b(i,i.length)}function m(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 b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function v(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+n(t));t.addEventListener(e,(function n(o){i.once&&t.removeEventListener(e,n),r(o)}))}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),u.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},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return c(this)},u.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)s(u,this,e);else{var h=u.length,f=b(u,h);for(r=0;r<h;++r)s(f[r],this,e)}return!0},u.prototype.addListener=function(t,e){return l(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return l(this,t,e,!0)},u.prototype.once=function(t,e){return f(e),this.on(t,p(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return f(e),this.prependListener(t,p(this,t,e)),this},u.prototype.removeListener=function(t,e){var r,n,i,o,s;if(f(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.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 i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);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},u.prototype.listeners=function(t){return y(this,t,!0)},u.prototype.rawListeners=function(t){return y(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},u.prototype.listenerCount=m,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){"use strict";
  295. /*!
  296. * Module dependencies.
  297. */function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new 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,h,f=r(13).EventEmitter,c=r(275),l=r(8),d=r(45),p=r(154),y=r(304),m=r(305),b=r(85),v=r(44),g=r(151),w=r(152),_=r(86),M=r(53),S=r(167),O=r(91).compile,A=r(91).defineKey,E=r(342).flatten,x=r(343),k=r(6),j=r(345),$=r(346),P=r(171),R=r(42),B=r(92),T=r(347),I=r(9).inspect,N=r(34).internalToObjectOptions,D=r(348),C=r(81),L=r(349),q=r(4),U=r(351),F=q.clone,z=q.deepEqual,V=q.isMongooseObject,K=r(1).arrayAtomicsBackupSymbol,H=r(1).arrayAtomicsSymbol,Z=r(1).documentArrayParent,W=r(1).documentIsModified,J=r(1).documentModifiedPaths,Y=r(1).documentSchemaSymbol,Q=r(1).getSymbol,G=r(1).populateModelSymbol,X=r(1).scopeSymbol,tt=r(55).schemaMixedSymbol,et=r(352),rt=q.specialProperties;function nt(t,e,r,n){if("object"===s(r)&&null!=r&&(r=(n=r).skipId),n=Object.assign({},n),null==this.$__schema){var o=q.isObject(e)&&!e.instanceOfSchema?new b(e):e;this.$__setSchema(o),e=r,r=n,n=arguments[4]||{}}if(this.$__=new c,this.$isNew=!("isNew"in n)||n.isNew,"priorDoc"in n&&(this.$__.priorDoc=n.priorDoc),r&&(this.$__.skipId=r),null!=t&&"object"!==s(t))throw new y(t,"obj","Document");var a=!0;void 0!==n.defaults&&(this.$__.defaults=n.defaults,a=n.defaults);var u=this.$__schema;"boolean"==typeof e||"throw"===e?(this.$__.strictMode=e,e=void 0):(this.$__.strictMode=u.options.strict,void 0!==e&&(this.$__.selected=e));var h,f=u.requiredPaths(!0),l=i(f);try{for(l.s();!(h=l.n()).done;){var d=h.value;this.$__.activePaths.require(d)}}catch(t){l.e(t)}finally{l.f()}var p=null;q.isPOJO(e)&&(p=T(e),this.$__.fields=e,this.$__.exclude=p);var m=!1===p&&e?ot(e):{};if(null==this._doc&&(this.$__buildDoc(t,e,r,p,m,!1),a&&st(this,e,p,m,!0,{isNew:this.$isNew})),t&&(this.$__original_set?this.$__original_set(t,void 0,!0):this.$set(t,void 0,!0),t instanceof nt&&(this.$isNew=t.$isNew)),n.willInit&&a?n.skipDefaults&&(this.$__.skipDefaults=n.skipDefaults):a&&st(this,e,p,m,!1,n.skipDefaults,this.$isNew),this.$__._id=this._id,!this.$__.strictMode&&t){var v=this,g=Object.keys(this._doc);g.forEach((function(t){t in u.tree||t in u.methods||t in u.virtuals||t.startsWith("$")||A({prop:t,subprops:null,prototype:v})}))}lt(this)}for(var it in Object.defineProperty(nt.prototype,"isNew",{get:function(){return this.$isNew},set:function(t){this.$isNew=t}}),Object.defineProperty(nt.prototype,"errors",{get:function(){return this.$errors},set:function(t){this.$errors=t}}),
  298. /*!
  299. * Document exposes the NodeJS event emitter API, so you can use
  300. * `on`, `once`, etc.
  301. */
  302. q.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],(function(t){nt.prototype[t]=function(){if(!this.$__.emitter){if("emit"===t)return;this.$__.emitter=new f,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[t].apply(this.$__.emitter,arguments)},nt.prototype["$".concat(t)]=nt.prototype[t]})),nt.prototype.constructor=nt,f.prototype)nt[it]=f.prototype[it];
  303. /*!
  304. * ignore
  305. */
  306. function ot(t){for(var e={},r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(-1!==i.indexOf("."))for(var o=i.split("."),s=o[0],a=0;a<o.length;++a)e[s]=1,a+1<o.length&&(s=s+"."+o[a+1]);else e[i]=1}return e}
  307. /*!
  308. * ignore
  309. */function st(t,e,r,n,i,o){for(var s=Object.keys(t.$__schema.paths),a=s.length,u=0;u<a;++u){var h=void 0,f="",c=s[u];if("_id"!==c||!t.$__.skipId)for(var l=t.$__schema.paths[c],d=l.splitPath(),p=d.length,y=!1,m=t._doc,b=0;b<p&&null!=m;++b){var v=d[b];if(f+=(f.length?".":"")+v,!0===r){if(f in e)break}else if(!1===r&&e&&!y)if(f in e||l.$isSingleNested&&n[f])y=!0;else if(!n[f])break;if(b===p-1){if(void 0!==m[v])break;if("function"==typeof l.defaultValue){if(!l.defaultValue.$runBeforeSetters&&i)break;if(l.defaultValue.$runBeforeSetters&&!i)break}else if(!i)continue;if(o&&o[f])break;if(e&&null!==r){if(!0===r){if(c in e)continue;try{h=l.getDefault(t,!1)}catch(e){t.invalidate(c,e);break}void 0!==h&&(m[v]=h,t.$__.activePaths.default(c))}else if(y){try{h=l.getDefault(t,!1)}catch(e){t.invalidate(c,e);break}void 0!==h&&(m[v]=h,t.$__.activePaths.default(c))}}else{try{h=l.getDefault(t,!1)}catch(e){t.invalidate(c,e);break}void 0!==h&&(m[v]=h,t.$__.activePaths.default(c))}}else m=m[v]}}}
  310. /*!
  311. * ignore
  312. */function at(t,e,r){if(null!=t){x(t);for(var n=Object.keys(r.$__schema.paths),i=n.length,o=-1===e.indexOf(".")?[e]:e.split("."),s=0;s<i;++s){var a="",u=n[s];if(u.startsWith(e+".")){var h=r.$__schema.paths[u],f=h.splitPath().slice(o.length),c=f.length;if(void 0!==h.defaultValue)for(var l=t,d=0;d<c&&null!=l;++d){var p=f[d];if(d===c-1){if(void 0!==l[p])break;try{var y=h.getDefault(r,!1);void 0!==y&&(l[p]=y)}catch(t){r.invalidate(e+"."+a,t);break}break}a+=(a.length?".":"")+p,l[p]=l[p]||{},l=l[p]}}}}}function ut(t){if(null==t)return!0;if("object"!==s(t)||Array.isArray(t))return!1;for(var e=0,r=Object.keys(t);e<r.length;e++){if(!ut(t[r[e]]))return!1}return!0}
  313. /*!
  314. * ignore
  315. */
  316. function ht(t){var e={};!
  317. /*!
  318. * ignore
  319. */
  320. function(t){var e=Object.keys(t.$__.activePaths.states.require),r=0,n=e.length;for(r=0;r<n;++r){var i=e[r],o=t.$__schema.path(i);if(null!=o&&"function"==typeof o.originalRequiredValue){t.$__.cachedRequired=t.$__.cachedRequired||{};try{t.$__.cachedRequired[i]=o.originalRequiredValue.call(t,t)}catch(e){t.invalidate(i,e)}}}}(t);var r=new Set(Object.keys(t.$__.activePaths.states.require).filter((function(e){return!(!t.$__isSelected(e)&&!t.$isModified(e))&&(null==t.$__.cachedRequired||!(e in t.$__.cachedRequired)||t.$__.cachedRequired[e])})));function n(t){r.add(t)}Object.keys(t.$__.activePaths.states.init).forEach(n),Object.keys(t.$__.activePaths.states.modify).forEach(n),Object.keys(t.$__.activePaths.states.default).forEach(n);var o,s=t.$getAllSubdocs(),a=t.modifiedPaths(),u=i(s);try{for(u.s();!(o=u.n()).done;){var h=o.value;if(h.$basePath){var f,c=i(r);try{for(c.s();!(f=c.n()).done;){var l=f.value;(null===l||l.startsWith(h.$basePath+"."))&&r.delete(l)}}catch(t){c.e(t)}finally{c.f()}!t.$isModified(h.$basePath,a)||t.isDirectModified(h.$basePath)||t.$isDefault(h.$basePath)||(r.add(h.$basePath),e[h.$basePath]=!0)}}}catch(t){u.e(t)}finally{u.f()}var d,p=i(r);try{for(p.s();!(d=p.n()).done;){var y=d.value,m=t.$__schema.path(y);if(m&&m.$isMongooseArray&&(Array.isArray(m)||!m.$isMongooseDocumentArray||k(m,"schemaOptions.required")))b(t.$__getValue(y),r,y)}}catch(t){p.e(t)}finally{p.f()}function b(t,e,r){if(null!=t)for(var n=t.length,i=0;i<n;++i)Array.isArray(t[i])?b(t[i],e,r+"."+i):e.add(r+"."+i)}var v,g={skipArrays:!0},w=i(r);try{for(w.s();!(v=w.n()).done;){var _=v.value;if(t.$__schema.nested[_]){var M=t.$__getValue(_);V(M)&&(M=M.toObject({transform:!1}));var S=E(M,_,g,t.$__schema);Object.keys(S).forEach(n)}}}catch(t){w.e(t)}finally{w.f()}var O,A=i(r);try{for(A.s();!(O=A.n()).done;){var x=O.value;if(t.$__schema.singleNestedPaths.hasOwnProperty(x))r.delete(x);else{var j=t.$__schema.path(x);if(j&&j.$isSchemaMap){var $=t.$__getValue(x);if(null!=$){var P,R=i($.keys());try{for(R.s();!(P=R.n()).done;){var B=P.value;r.add(x+"."+B)}}catch(t){R.e(t)}finally{R.f()}}}}}}catch(t){A.e(t)}finally{A.f()}return[r=Array.from(r),e]}
  321. /*!
  322. * ignore
  323. */
  324. /*!
  325. * ignore
  326. */
  327. function ft(t,e){var r,n=new Set(e),o=new Map([]),s=i(e);try{for(s.s();!(r=s.n()).done;){var a=r.value;if(-1!==a.indexOf("."))for(var u=a.split("."),h=u[0],f=1;f<u.length;++f)o.set(h,a),h=h+"."+u[f]}}catch(t){s.e(t)}finally{s.f()}var c,l=[],d=i(t);try{for(d.s();!(c=d.n()).done;){var p=c.value;n.has(p)?l.push(p):o.has(p)&&l.push(o.get(p))}}catch(t){d.e(t)}finally{d.f()}return l}
  328. /*!
  329. * ignore
  330. */function ct(t,e){return e=new Set(e),t=t.filter((function(t){return!e.has(t)}))}
  331. /*!
  332. * Runs queued functions
  333. */
  334. function lt(t){var e=t.$__schema&&t.$__schema.callQueue;if(e.length){var r,n=i(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()}}}
  335. /*!
  336. * ignore
  337. */
  338. /*!
  339. * Applies virtuals properties to `json`.
  340. */
  341. function dt(t,e,r,n){var i,o,s,a=t.$__schema,u=Object.keys(a.virtuals),h=u.length,f=h,c=t._doc,l=k(n,"aliases",!0),d=null;if(Array.isArray(r.virtuals))d=new Set(r.virtuals);else if(r.virtuals&&r.virtuals.pathsToSkip){d=new Set(u);for(var p=0;p<r.virtuals.pathsToSkip.length;p++)d.has(r.virtuals.pathsToSkip[p])&&d.delete(r.virtuals.pathsToSkip[p])}if(!c)return e;for(r=r||{},h=0;h<f;++h)if(i=u[h],(null==d||d.has(i))&&(l||!a.aliases.hasOwnProperty(i))){if(o=i,null!=r.path){if(!i.startsWith(r.path+"."))continue;o=i.substring(r.path.length+1)}var y=o.split(".");if(void 0!==(s=F(t.get(i),r))){var m=y.length;c=e;for(var b=0;b<m-1;++b)c[y[b]]=c[y[b]]||{},c=c[y[b]];c[y[m-1]]=s}}return e}
  342. /*!
  343. * Applies virtuals properties to `json`.
  344. *
  345. * @param {Document} self
  346. * @param {Object} json
  347. * @return {Object} `json`
  348. */function pt(t,e){if(U(e))throw new Error("`transform` function must be synchronous, but the transform on path `"+t+"` returned a promise.")}
  349. /*!
  350. * ignore
  351. */nt.prototype.$__schema,nt.prototype.schema,Object.defineProperty(nt.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){return null==this.$__.locals&&(this.$__.locals={}),this.$__.locals},set:function(t){this.$__.locals=t}}),nt.prototype.$isNew,nt.prototype.isNew,Object.defineProperty(nt.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0}),nt.prototype.id,nt.prototype.$errors,nt.prototype.errors,Object.defineProperty(nt.prototype,"$op",{get:function(){return this.$__.op||null},set:function(t){this.$__.op=t}}),nt.prototype.$__buildDoc=function(t,e,r,n,i){for(var o={},s=Object.keys(this.$__schema.paths).filter((function(t){return!t.includes("$*")})),a=s.length,u=0;u<a;++u){var h=s[u];if("_id"===h){if(r)continue;if(t&&"_id"in t)continue}for(var f=this.$__schema.paths[h].splitPath(),c=f.length,l=c-1,d="",p=o,y=!1,m=0;m<c;++m){var b=f[m];if(d+=(d.length?".":"")+b,!0===n){if(d in e)break}else if(!1===n&&e&&!y)if(d in e)y=!0;else if(!i[d])break;m<l&&(p=p[b]||(p[b]={}))}}this._doc=o},
  352. /*!
  353. * Converts to POJO when you use the document for querying
  354. */
  355. nt.prototype.toBSON=function(){return this.toObject(N)},nt.prototype.init=function(t,e,r){return"function"==typeof e&&(r=e,e=null),this.$__init(t,e),r&&r(null,this),this},nt.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)},nt.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=i(e.populated);try{for(o.s();!(r=o.n()).done;){var s=r.value;if(s.isVirtual?this.$populated(s.path,q.getValue(s.path,t),s):this.$populated(s.path,s._docs[n],s),null!=s._childDocs){var a,u=i(s._childDocs);try{for(u.s();!(a=u.n()).done;){var h=a.value;null!=h&&null!=h.$__&&(h.$__.parent=this)}}catch(t){u.e(t)}finally{u.f()}s._childDocs=[]}}}catch(t){o.e(t)}finally{o.f()}}!
  356. /*!
  357. * Init helper.
  358. *
  359. * @param {Object} self document instance
  360. * @param {Object} obj raw mongodb doc
  361. * @param {Object} doc object we are initializing
  362. * @api private
  363. */
  364. function t(e,r,n,i,o){o=o||"";var s,a,u,h=Object.keys(r),f=h.length,c=0,l=e.$__.strictMode,d=e.$__schema;for(;c<f;)p(c++);function p(f){if(u=h[f],a=o+u,s=d.path(a),!d.$isRootDiscriminator||e.$__isSelected(a))if(!s&&q.isPOJO(r[u]))n[u]||(n[u]={},l||u in d.tree||u in d.methods||u in d.virtuals||(e[u]=n[u])),t(e,r[u],n[u],i,a+".");else if(s){if(n.hasOwnProperty(u)&&void 0!==r[u]&&delete n[u],null===r[u])n[u]=s._castNullish(null);else if(void 0!==r[u]){var c=null==r[u].$__?null:r[u].$__.wasPopulated;if(s&&!c)try{n[u]=s.cast(r[u],e,!0)}catch(t){e.invalidate(t.path,new w({path:t.path,message:t.message,type:"cast",value:t.value,reason:t}))}else n[u]=r[u]}e.$isModified(a)||e.$__.activePaths.init(a)}else n[u]=r[u],l||(e[u]=r[u])}}(this,t,this._doc,e),D(this,e.populated),this.$emit("init",this),this.constructor.emit("init",this),this.$__._id=this._id;var f=!1===this.$__.exclude&&this.$__.fields?ot(this.$__.fields):{};return st(this,this.$__.fields,this.$__.exclude,f,!1,this.$__.skipDefaults),this},nt.prototype.update=function(){var t=Array.prototype.slice.call(arguments);t.unshift({_id:this._id});var e=this.constructor.update.apply(this.constructor,t);return null!=this.$session()&&("session"in e.options||(e.options.session=this.$session())),e},nt.prototype.updateOne=function(t,e,r){var n=this,i=this.constructor.updateOne({_id:this._id},t,e);return i.pre((function(t){n.constructor._middleware.execPre("updateOne",n,[n],t)})),i.post((function(t){n.constructor._middleware.execPost("updateOne",n,[n],{},t)})),null!=this.$session()&&("session"in i.options||(i.options.session=this.$session())),null!=r?i.exec(r):i},nt.prototype.replaceOne=function(){var t=Array.prototype.slice.call(arguments);return t.unshift({_id:this._id}),this.constructor.replaceOne.apply(this.constructor,t)},nt.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 l("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=this.$getAllSubdocs(),n=i(r);try{for(n.s();!(e=n.n()).done;){var o=e.value;o.$session(t)}}catch(t){n.e(t)}finally{n.f()}}return t}},nt.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},nt.prototype.$set=function(t,e,r,o){var a=this;q.isPOJO(r)&&(o=r,r=void 0);var u,h,f,c,y=(o=o||{}).merge,m=r&&!0!==r,b=!0===r,g=this.$__schema.options.typeKey,w=0,_="strict"in o?o.strict:this.$__.strictMode;if(m&&((this.$__.adhocPaths||(this.$__.adhocPaths={}))[t]=this.$__schema.interpretAsType(t,r,this.$__schema.options)),null==t){var M=[e,t];t=M[0],e=M[1]}else if("string"!=typeof t){if(t instanceof nt&&(t=t.$__isNested?t.toObject():t._doc),null==t){var O=[e,t];t=O[0],e=O[1]}c=e?e+".":"";var A=(u=$(this.$__schema,t)).length,E=k(o,"_skipMinimizeTopLevel",!1);if(0===A&&E)return delete o._skipMinimizeTopLevel,e&&this.$set(e,{}),this;for(var x=0;x<A;++x){var R=c+(f=u[x]);h=this.$__schema.pathType(R);var B=t[f];if(!0!==r||c||null==B||"nested"!==h||null==this._doc[f]?o=Object.assign({},o,{_skipMinimizeTopLevel:!1}):(delete this._doc[f],o=Object.assign({},o,{_skipMinimizeTopLevel:!0})),q.isNonBuiltinObject(B)&&"nested"===h)at(t[f],c+f,this),this.$set(c+f,t[f],b,Object.assign({},o,{_skipMarkModified:!0}));else if(_){if(b&&void 0===t[f]&&void 0!==this.$get(R))continue;if("adhocOrUndefined"===h&&(h=j(this,R,{typeOnly:!0})),"real"===h||"virtual"===h){var T=t[f];this.$set(c+f,T,b,o)}else if("nested"===h&&t[f]instanceof nt)this.$set(c+f,t[f].toObject({transform:!1}),b,o);else if("throw"===_)throw"nested"===h?new p(f,t[f]):new v(f)}else void 0!==t[f]&&this.$set(c+f,t[f],b,o)}for(var I=0,D=Object.keys(this.$__schema.tree);I<D.length;I++){var L=D[I];if(this._doc.hasOwnProperty(L)){var U=this._doc[L];delete this._doc[L],this._doc[L]=U}}return this}var F=this.$__schema.pathType(t);"adhocOrUndefined"===F&&(F=j(this,t,{typeOnly:!0})),e=P(e);var z,V=null!=a.$__.priorDoc?a.$__.priorDoc.$__getValue(t):b?void 0:a.$__getValue(t);if("nested"===F&&e){if("object"===s(e)&&null!=e){if(null!=e.$__&&(e=e.toObject(N)),null==e)return this.invalidate(t,new l.CastError("Object",e,t)),this;var K=null!=this.$__.savedState&&this.$__.savedState.hasOwnProperty(t);if(null!=this.$__.savedState&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(t)){var H=this.$__getValue(t);this.$__.savedState[t]=H;for(var Z=0,W=Object.keys(H||{});Z<W.length;Z++){var J=W[Z];this.$__.savedState[t+"."+J]=H[J]}}if(y)return this.$set(e,t,b);this.$__setValue(t,null),S(this,t);var Y=$(this.$__schema,e,t);this.$__setValue(t,{});var Q,X=i(Y);try{for(X.s();!(Q=X.n()).done;){var tt=Q.value;this.$set(t+"."+tt,e[tt],b,o)}}catch(t){X.e(t)}finally{X.f()}return null!=V&&q.deepEqual(K?this.$__.savedState[t]:V,e)?this.unmarkModified(t):this.markModified(t),S(this,t,{skipDocArrays:!0}),this}return this.invalidate(t,new l.CastError("Object",e,t)),this}var et=-1===t.indexOf(".")?[t]:t.split(".");if("string"==typeof this.$__schema.aliases[et[0]]&&(et[0]=this.$__schema.aliases[et[0]]),"adhocOrUndefined"===F&&_){var rt;for(w=0;w<et.length;++w){var it=et.slice(0,w+1).join(".");if(w+1<et.length&&"virtual"===this.$__schema.pathType(it))return C.set(t,e,this),this;if(null!=(z=this.$__schema.path(it))&&z instanceof d){rt=!0;break}}if(null==z&&(z=j(this,t)),!rt&&!z){if("throw"===_)throw new v(t);return this}}else{if("virtual"===F)return(z=this.$__schema.virtualpath(t)).applySetters(e,this),this;z=this.$__path(t)}var ot,st=this._doc,ut="";for(w=0;w<et.length-1;++w)st=st[et[w]],ut+=(0!==ut.length?".":"")+et[w],st||(this.$set(ut,{}),this.$__isSelected(ut)||this.unmarkModified(ut),st=this.$__getValue(ut));if(et.length<=1)ot=t;else{var ht=et.length;for(w=0;w<ht;++w){var ft=et.slice(0,w+1).join(".");if(null===this.$get(ft,null,{getters:!1})){ot=ft;break}}ot||(ot=t)}if(!z)return this.$__set(ot,t,o,b,et,z,e,V),this;if((z.$isSingleNested||z.$isMongooseArray)&&
  365. /*!
  366. * ignore
  367. */
  368. function(t,e){if(!t.$__.validationError)return;for(var r=Object.keys(t.$__.validationError.errors),n=0,i=r;n<i.length;n++){var o=i[n];o.startsWith(e+".")&&delete t.$__.validationError.errors[o]}0===Object.keys(t.$__.validationError.errors).length&&(t.$__.validationError=null)}
  369. /*!
  370. * ignore
  371. */(this,t),null!=e&&y&&z.$isSingleNested){e instanceof nt&&(e=e.toObject({virtuals:!1,transform:!1}));for(var ct=0,lt=Object.keys(e);ct<lt.length;ct++){var dt=lt[ct];this.$set(t+"."+dt,e[dt],b,o)}return this}var pt=!0;try{var yt,mt=function(){if(null==z.options)return!1;if(!(e instanceof nt))return!1;var t=e.constructor,r=z.options.ref;if(null!=r&&(r===t.modelName||r===t.baseModelName))return!0;var n=z.options.refPath;if(null==n)return!1;var i=e.get(n);return i===t.modelName||i===t.baseModelName}(),bt=!1;if(mt&&e instanceof nt&&(this.$populated(t,e._id,n({},G,e.constructor)),e.$__.wasPopulated=!0,bt=!0),z.options&&Array.isArray(z.options[g])&&z.options[g].length&&z.options[g][0].ref&&
  372. /*!
  373. * ignore
  374. */
  375. function(t,e){if(!Array.isArray(t))return!1;if(0===t.length)return!1;var r,n=i(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(!(o instanceof nt))return!1;if(null==o.constructor.modelName)return!1;if(o.constructor.modelName!=e&&o.constructor.baseModelName!=e)return!1}}catch(t){n.e(t)}finally{n.f()}return!0}(e,z.options[g][0].ref)){yt=n({},G,e[0].constructor),this.$populated(t,e.map((function(t){return t._id})),yt);var vt,gt=i(e);try{for(gt.s();!(vt=gt.n()).done;){vt.value.$__.wasPopulated=!0}}catch(t){gt.e(t)}finally{gt.f()}bt=!0}if(null!=this.$__schema.singleNestedPaths[t]||mt&&z.$isSingleNested&&e.$__||(e=z.applySetters(e,this,!1,V)),Array.isArray(e)&&!Array.isArray(z)&&z.$isMongooseDocumentArray&&0!==e.length&&null!=e[0]&&null!=e[0].$__&&null!=e[0].$__.populated){for(var wt=Object.keys(e[0].$__.populated),_t=function(){var r=St[Mt];a.$populated(t+"."+r,e.map((function(t){return t.$populated(r)})),e[0].$__.populated[r].options)},Mt=0,St=wt;Mt<St.length;Mt++)_t();bt=!0}if(!bt&&this.$__.populated){if(Array.isArray(e)&&this.$__.populated[t])for(var Ot=0;Ot<e.length;++Ot)e[Ot]instanceof nt&&e.set(Ot,e[Ot]._id,!0);delete this.$__.populated[t]}null!=e&&z.$isSingleNested&&function(t,e,r){var n=e.schema;if(null==n)return;for(var i=0,o=Object.keys(n.paths);i<o.length;i++){var s=o[i],a=n.paths[s];if(null!=a.$immutableSetter){var u=null==r?void 0:r.$__getValue(s);a.$immutableSetter.call(t,u)}}}(e,z,V),this.$markValid(t)}catch(r){r instanceof l.StrictModeError&&r.isImmutableError?this.invalidate(t,r):r instanceof l.CastError?(this.invalidate(r.path,r),r.$originalErrorPath&&this.invalidate(t,new l.CastError(z.instance,e,t,r.$originalErrorPath))):this.invalidate(t,new l.CastError(z.instance,e,t,r)),pt=!1}if(pt){var At=this.$isSubdocument?this.ownerDocument():this,Et=At.$__.savedState,xt=this.$isSubdocument?this.$__.fullPath+"."+t:t;if(null!=Et){var kt=xt.indexOf("."),jt=-1===kt?xt:xt.slice(0,kt);Et.hasOwnProperty(jt)||(Et[jt]=q.clone(At.$__getValue(jt)))}this.$__set(ot,t,o,b,et,z,e,V),null!=Et&&Et.hasOwnProperty(xt)&&q.deepEqual(e,Et[xt])&&this.unmarkModified(t)}return z.$isSingleNested&&(this.isDirectModified(t)||null==e)&&S(this,t),this},nt.prototype.set=nt.prototype.$set,nt.prototype.$__shouldModify=function(t,e,r,n,i,o,s,a){return!r._skipMarkModified&&(!!this.$isNew||null==this.$__schema.singleNestedPaths[e]&&(void 0===s&&!this.$__isSelected(e)||(void 0!==s||!(e in this.$__.activePaths.states.default))&&(!(this.$populated(e)&&s instanceof nt&&z(s._id,a))&&(!z(s,a||q.getValue(e,this))||!(n||null==s||!(e in this.$__.activePaths.states.default)||!z(s,o.getDefault(this,n)))))))},nt.prototype.$__set=function(t,e,n,i,o,s,a,f){h=h||r(46);var c=this.$__shouldModify(t,e,n,i,o,s,a,f),l=this;c?(this.markModified(t),u||(u=r(166)),a&&q.isMongooseArray(a)&&(a._registerAtomic("$set",a),q.isMongooseDocumentArray(a)&&a.forEach((function(t){t&&t.__parentArray&&(t.__parentArray=a)})),this.$__.activePaths.forEach((function(t){t.startsWith(e+".")&&l.$__.activePaths.ignore(t)})))):Array.isArray(a)&&Array.isArray(f)&&q.isMongooseArray(a)&&q.isMongooseArray(f)&&(a[H]=f[H],a[K]=f[K],q.isMongooseDocumentArray(a)&&a.forEach((function(t){t.isNew=!1})));for(var d=this._doc,p=0,y=o.length,m="";p<y;p++){var b=p+1===y;if(m+=m?"."+o[p]:o[p],rt.has(o[p]))return;b?d instanceof Map?d.set(o[p],a):d[o[p]]=a:(q.isPOJO(d[o[p]])||d[o[p]]&&d[o[p]]instanceof h||d[o[p]]&&!Array.isArray(d[o[p]])&&d[o[p]].$isSingleNested||d[o[p]]&&Array.isArray(d[o[p]])||(d[o[p]]=d[o[p]]||{}),d=d[o[p]])}},nt.prototype.$__getValue=function(t){return q.getValue(t,this._doc)},nt.prototype.$__setValue=function(t,e){return q.setValue(t,e,this._doc),this},nt.prototype.get=function(t,e,r){var n;r=r||{},e&&(n=this.$__schema.interpretAsType(t,e,this.$__schema.options));var i=this.$__path(t);if(null==i&&(i=this.$__schema.virtualpath(t)),i instanceof d){var o=this.$__schema.virtualpath(t);null!=o&&(i=o)}var s=-1===t.indexOf(".")?[t]:t.split("."),a=this._doc;if(i instanceof _)return i.applyGetters(void 0,this);"string"==typeof this.$__schema.aliases[s[0]]&&(s[0]=this.$__schema.aliases[s[0]]);for(var u=0,h=s.length;u<h;u++)a&&a._doc&&(a=a._doc),a=null==a?void 0:a instanceof Map?a.get(s[u],{getters:!1}):u===h-1?q.getValue(s[u],a):a[s[u]];if(n&&(a=n.cast(a)),null!=i&&!1!==r.getters)a=i.applyGetters(a,this);else if(this.$__schema.nested[t]&&r.virtuals)return dt(this,q.clone(a)||{},{path:t});return a},
  376. /*!
  377. * ignore
  378. */
  379. nt.prototype[Q]=nt.prototype.get,nt.prototype.$get=nt.prototype.get,nt.prototype.$__path=function(t){var e=this.$__.adhocPaths,r=e&&e.hasOwnProperty(t)?e[t]:null;return r||this.$__schema.path(t)},nt.prototype.markModified=function(t,e){this.$__.activePaths.modify(t),null==e||this.$isSubdocument||(this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[t]=e)},nt.prototype.unmarkModified=function(t){this.$__.activePaths.init(t),null!=this.$__.pathsToScopes&&delete this.$__.pathsToScopes[t]},nt.prototype.$ignore=function(t){this.$__.activePaths.ignore(t)},nt.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.states.modify)},nt.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"===s(r)&&(q.isPOJO(r)?ut(r):0===Object.keys(r.toObject(e)).length)}return 0===Object.keys(this.toObject(e)).length},nt.prototype.modifiedPaths=function(t){t=t||{};var e=Object.keys(this.$__.activePaths.states.modify),r=new Set,n=0,i=0,o=e.length;for(n=0;n<o;++n){var a=e[n],u=et(a),h=u.length;for(i=0;i<h;++i)r.add(u[i]);if(t.includeChildren){var f=0,c=this.$get(a);if("object"===s(c)&&null!==c){c._doc&&(c=c._doc);var l=c.length;if(Array.isArray(c))for(f=0;f<l;++f){var d=a+"."+f;if(!r.has(d)&&(r.add(d),null!=c[f]&&c[f].$__)){var p=c[f].modifiedPaths(),y=0,m=p.length;for(y=0;y<m;++y)r.add(d+"."+p[y])}}else{var b=Object.keys(c),v=0,g=b.length;for(v=0;v<g;++v)r.add(a+"."+b[v])}}}}return Array.from(r)},nt.prototype[J]=nt.prototype.modifiedPaths,nt.prototype.isModified=function(t,e){if(t){var r=Object.keys(this.$__.activePaths.states.modify);if(0===r.length)return!1;Array.isArray(t)||(t=-1===t.indexOf(" ")?[t]:t.split(" "));var n=e||this[J]();return t.some((function(t){return!!~n.indexOf(t)}))||t.some((function(t){return r.some((function(e){return e===t||t.startsWith(e+".")}))}))}return this.$__.activePaths.some("modify")},nt.prototype.$isModified=nt.prototype.isModified,nt.prototype[W]=nt.prototype.isModified,nt.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.states.default.hasOwnProperty(t);var r=t;return Array.isArray(r)||(r=r.split(" ")),r.some((function(t){return e.$__.activePaths.states.default.hasOwnProperty(t)}))},nt.prototype.$isDeleted=function(t){return 0===arguments.length?!!this.$__.isDeleted:(this.$__.isDeleted=!!t,this)},nt.prototype.isDirectModified=function(t){var e=this;if(null==t)return this.$__.activePaths.some("modify");if("string"==typeof t&&-1===t.indexOf(" "))return this.$__.activePaths.states.modify.hasOwnProperty(t);var r=t;return Array.isArray(r)||(r=r.split(" ")),r.some((function(t){return e.$__.activePaths.states.modify.hasOwnProperty(t)}))},nt.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.states.init.hasOwnProperty(t);var r=t;return Array.isArray(r)||(r=r.split(" ")),r.some((function(t){return e.$__.activePaths.states.init.hasOwnProperty(t)}))},nt.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 i=0,o=r;i<o.length;i++){var s=o[i];if("_id"!==s&&B(this.$__.selected[s])){n=!!this.$__.selected[s];break}}if(null===n)return!0;if(t in this.$__.selected)return n;for(var a=t+".",u=0,h=r;u<h.length;u++){var f=h[u];if("_id"!==f){if(f.startsWith(a))return n||f!==a;if(a.startsWith(f+"."))return n}}return!n},nt.prototype.$__isSelected=nt.prototype.isSelected,nt.prototype.isDirectSelected=function(t){var e=this;if(null==this.$__.selected)return!0;if("_id"===t)return 0!==this.$__.selected._id;if(-1!==t.indexOf(" ")&&(t=t.split(" ")),Array.isArray(t))return t.some((function(t){return e.isDirectSelected(t)}));var r=Object.keys(this.$__.selected),n=null;if(1===r.length&&"_id"===r[0])return 0===this.$__.selected._id;for(var i=0,o=r;i<o.length;i++){var s=o[i];if("_id"!==s&&B(this.$__.selected[s])){n=!!this.$__.selected[s];break}}return null===n||(this.$__.selected.hasOwnProperty(t)?n:!n)},nt.prototype.validate=function(t,e,r){var n,i=this;if(this.$op="validate",null!=this.$isSubdocument||(this.$__.validating?n=new m(this,{parentStack:e&&e.parentStack,conflictStack:this.$__.validating.stack}):this.$__.validating=new m(this,{parentStack:e&&e.parentStack})),1===arguments.length?"object"!==s(arguments[0])||Array.isArray(arguments[0])?"function"==typeof arguments[0]&&(r=arguments[0],e=null,t=null):(e=arguments[0],r=null,t=null):"function"==typeof t?(r=t,e=null,t=null):"function"==typeof e&&(r=e,e=t,t=null),e&&"string"==typeof e.pathsToSkip){var o=-1===e.pathsToSkip.indexOf(" ");e.pathsToSkip=o?[e.pathsToSkip]:e.pathsToSkip.split(" ")}return M(r,(function(r){if(null!=n)return r(n);i.$__validate(t,e,(function(t){i.$op=null,r(t)}))}),this.constructor.events)},nt.prototype.$validate=nt.prototype.validate,nt.prototype.$__validate=function(t,e,r){var n=this;"function"==typeof t?(r=t,e=null,t=null):"function"==typeof e&&(r=e,e=null);var o,a=e&&"object"===s(e)&&"validateModifiedOnly"in e,u=k(e,"pathsToSkip",null);o=a?!!e.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var h=this,f=function(){var t=n.$__.validationError;if(n.$__.validationError=void 0,o&&null!=t){for(var e=0,r=Object.keys(t.errors);e<r.length;e++){var i=r[e];n.$isModified(i)||delete t.errors[i]}0===Object.keys(t.errors).length&&(t=void 0)}if(n.$__.cachedRequired={},n.$emit("validate",h),n.constructor.emit("validate",h),t){for(var s in t.errors)!n[Z]&&t.errors[s]instanceof l.CastError&&n.invalidate(s,t.errors[s]);return t}},c=ht(this),d=o?c[0].filter((function(t){return n.$isModified(t)})):c[0],p=c[1];if("string"==typeof t&&(t=t.split(" ")),Array.isArray(t)?d=ft(d,t):u&&(d=ct(d,u)),0===d.length)return R((function(){var t=f();if(t)return h.$__schema.s.hooks.execPost("validate:error",h,[h],{error:t},(function(t){r(t)}));r(null,h)}));var y,m={},b=0,v=i(d);try{for(v.s();!(y=v.n()).done;){w(y.value)}}catch(t){v.e(t)}finally{v.f()}function w(t){null==t||m[t]||(m[t]=!0,b++,R((function(){var e=h.$__schema.path(t);if(!e)return--b||_();if(h.$isValid(t)){if(null!=e[tt]&&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._id);var i=null!=h.$__.pathsToScopes&&t in h.$__.pathsToScopes?h.$__.pathsToScopes[t]:h,s={skipSchemaValidators:p[t],path:t,validateModifiedOnly:o};e.doValidate(n,(function(r){if(r){if((e.$isSingleNested||e.$isArraySubdocument||e.$isMongooseDocumentArray)&&r instanceof g)return--b||_();h.invalidate(t,r,void 0,!0)}--b||_()}),i,s)}else--b||_()})))}function _(){var t=f();if(t)return h.$__schema.s.hooks.execPost("validate:error",h,[h],{error:t},(function(t){r(t)}));r(null,h)}},nt.prototype.validateSync=function(t,e){var r=this,n=this;1!==arguments.length||"object"!==s(arguments[0])||Array.isArray(arguments[0])||(e=arguments[0],t=null);var i,o=e&&"object"===s(e)&&"validateModifiedOnly"in e;i=o?!!e.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var a=e&&e.pathsToSkip;if("string"==typeof t){var u=-1===t.indexOf(" ");t=u?[t]:t.split(" ")}else"string"==typeof a&&-1!==a.indexOf(" ")&&(a=a.split(" "));var h=ht(this),f=i?h[0].filter((function(t){return r.$isModified(t)})):h[0],c=h[1];Array.isArray(t)?f=ft(f,t):Array.isArray(a)&&(f=ct(f,a));var d={};f.forEach((function(t){if(!d[t]){d[t]=!0;var e=n.$__schema.path(t);if(e&&n.$isValid(t)){var r=n.$__getValue(t),o=e.doValidateSync(r,n,{skipSchemaValidators:c[t],path:t,validateModifiedOnly:i});if(o){if((e.$isSingleNested||e.$isArraySubdocument||e.$isMongooseDocumentArray)&&o instanceof g)return;n.invalidate(t,o,void 0,!0)}}}}));var p=n.$__.validationError;if(n.$__.validationError=void 0,n.$emit("validate",n),n.constructor.emit("validate",n),p)for(var y in p.errors)p.errors[y]instanceof l.CastError&&n.invalidate(y,p.errors[y]);return p},nt.prototype.invalidate=function(t,e,r,n){if(this.$__.validationError||(this.$__.validationError=new g(this)),!this.$__.validationError.errors[t])return e&&"string"!=typeof e||(e=new w({path:t,message:e,type:n||"user defined",value:r})),this.$__.validationError===e||this.$__.validationError.addError(t,e),this.$__.validationError},nt.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))},nt.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])},nt.prototype.$__reset=function(){var t=this;return a||(a=r(27)),this.$__.activePaths.map("init","modify",(function(e){return t.$__getValue(e)})).filter((function(t){return t&&t instanceof Array&&q.isMongooseDocumentArray(t)&&t.length})).forEach((function(e){for(var r=e.length;r--;){var n=e[r];n&&n.$__reset()}t.$__.activePaths.init(e.$path()),e[K]=e[H],e[H]={}})),this.$__.activePaths.map("init","modify",(function(e){return t.$__getValue(e)})).filter((function(t){return t&&!Array.isArray(t)&&t.$isSingleNested})).forEach((function(e){e.$__reset(),e.$parent()===t?t.$__.activePaths.init(e.$basePath):null!=e.$parent()&&e.$parent().$isSubdocument&&e.$parent().$__reset()})),this.$__dirty().forEach((function(t){var e=t.value;e&&e[H]&&(e[K]=e[H],e[H]={})})),this.$__.backup={},this.$__.backup.activePaths={modify:Object.assign({},this.$__.activePaths.states.modify),default:Object.assign({},this.$__.activePaths.states.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},
  380. /*!
  381. * ignore
  382. */
  383. nt.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=i(this.$__dirty());try{for(e.s();!(t=e.n()).done;){var r=t.value.value;r&&r[H]&&r[K]&&(r[H]=r[K])}}catch(t){e.e(t)}finally{e.f()}var n,o=i(this.$getAllSubdocs());try{for(o.s();!(n=o.n()).done;){n.value.$__undoReset()}}catch(t){o.e(t)}finally{o.f()}}},nt.prototype.$__dirty=function(){var t=this,e=this.$__.activePaths.map("modify",(function(e){return{path:e,value:t.$__getValue(e),schema:t.$__path(e)}}));e=e.concat(this.$__.activePaths.map("default",(function(e){if("_id"!==e&&null!=t.$__getValue(e))return{path:e,value:t.$__getValue(e),schema:t.$__path(e)}})));var r=new Map(e.filter((function(t){return null!=t})).map((function(t){return[t.path,t.value]}))),n=[];return e.forEach((function(t){if(t){for(var e=null,i=et(t.path),o=0;o<i.length-1;o++)if(r.has(i[o])){e=r.get(i[o]);break}null==e?n.push(t):null!=e&&null!=e[H]&&e.hasAtomics()&&(e[H]={},e[H].$set=e)}})),n},nt.prototype.$__setSchema=function(t){O(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[Y]=t},nt.prototype.$__getArrayPathsToValidate=function(){return a||(a=r(27)),this.$__.activePaths.map("init","modify",function(t){return this.$__getValue(t)}.bind(this)).filter((function(t){return t&&t instanceof Array&&q.isMongooseDocumentArray(t)&&t.length})).reduce((function(t,e){return t.concat(e)}),[]).filter((function(t){return t}))},nt.prototype.$getAllSubdocs=function(){function t(e,r,n){var i=e,o=!1;if(n&&(e instanceof nt&&e[Y].paths[n]?i=e._doc[n]:e instanceof nt&&e[Y].nested[n]?(i=e._doc[n],o=!0):i=e[n]),i instanceof h)r.push(i);else if(i instanceof Map)r=Array.from(i.keys()).reduce((function(e,r){return t(i.get(r),e,null)}),r);else if(i&&!Array.isArray(i)&&i.$isSingleNested)(r=Object.keys(i._doc).reduce((function(e,r){return t(i._doc,e,r)}),r)).push(i);else if(i&&q.isMongooseDocumentArray(i))i.forEach((function(e){e&&e._doc&&(r=Object.keys(e._doc).reduce((function(r,n){return t(e._doc,r,n)}),r),e instanceof h&&r.push(e))}));else if(o&&null!=i)for(var s=0,a=Object.keys(i);s<a.length;s++){var u=a[s];t(i,r,u)}return r}a||(a=r(27)),h=h||r(46);for(var e=[],n=0,i=Object.keys(this._doc);n<i.length;n++){t(this,e,i[n])}return e},nt.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)},nt.prototype.$toObject=function(t,e){var r,n,i={transform:!0,flattenDecimals:!0},o=e?"toJSON":"toObject",s=k(this,"constructor.base.options."+o,{}),a=k(this,"$__schema.options",{});i=q.options(i,F(s)),i=q.options(i,F(a[o]||{})),(t=q.isPOJO(t)?F(t):{})._calledWithOptions=t._calledWithOptions||F(t),r=null!=t._calledWithOptions.minimize?t.minimize:null!=i.minimize?i.minimize:a.minimize,n=null!=t._calledWithOptions.flattenMaps?t.flattenMaps:null!=i.flattenMaps?i.flattenMaps:a.flattenMaps;var u=Object.assign(q.clone(t),{_isNested:!0,json:e,minimize:r,flattenMaps:n});if(q.hasUserDefinedProperty(t,"getters")&&(u.getters=t.getters),q.hasUserDefinedProperty(t,"virtuals")&&(u.virtuals=t.virtuals),(t.depopulate||k(t,"_parentOptions.depopulate",!1))&&t._isNested&&this.$__.wasPopulated)return F(this._id,u);(t=q.options(i,t))._isNested=!0,t.json=e,t.minimize=r,u._parentOptions=t,u._skipSingleNestedGetters=!0;var h=Object.assign({},u);h._skipSingleNestedGetters=!1;var f=t.transform,c=F(this._doc,u)||{};t.getters&&(!function(t,e,r){var n,i,o=t.$__schema,s=Object.keys(o.paths),a=s.length,u=t._doc;if(!u)return e;for(;a--;){var h=(n=s[a]).split("."),f=h.length,c=f-1,l=e,d=void 0;if(u=t._doc,t.$__isSelected(n))for(var p=0;p<f;++p){if(d=h[p],i=u[d],p===c){var y=t.$get(n);l[d]=F(y,r)}else{if(null==i){d in u&&(l[d]=i);break}l=l[d]||(l[d]={})}u=i}}}
  384. /*!
  385. * Applies schema type transforms to `json`.
  386. *
  387. * @param {Document} self
  388. * @param {Object} json
  389. * @return {Object} `json`
  390. */(this,c,h),t.minimize&&(c=
  391. /*!
  392. * Minimizes an object, removing undefined values and empty objects
  393. *
  394. * @param {Object} object to minimize
  395. * @return {Object}
  396. */
  397. function t(e){var r,n,i,o=Object.keys(e),s=o.length;for(;s--;)n=o[s],i=e[n],q.isPOJO(i)&&(e[n]=t(i)),void 0!==e[n]?r=!0:delete e[n];return r?e:void 0}(c)||{})),(t.virtuals||t.getters&&!1!==t.virtuals)&&dt(this,c,h,t),!1===t.versionKey&&this.$__schema.options.versionKey&&delete c[this.$__schema.options.versionKey];var l=t.transform;if(l&&function(t,e){var r=t.$__schema,n=Object.keys(r.paths||{});if(!t._doc)return e;for(var i=0,o=n;i<o.length;i++){var s=o[i],a=r.paths[s];if("function"==typeof a.options.transform){var u=t.$get(s),h=a.options.transform.call(t,u);pt(s,h),q.setValue(s,h,e)}else if(null!=a.$embeddedSchemaType&&"function"==typeof a.$embeddedSchemaType.options.transform){for(var f=[].concat(t.$get(s)),c=a.$embeddedSchemaType.options.transform,l=0;l<f.length;++l){var d=c.call(t,f[l]);f[l]=d,pt(s,d)}e[s]=f}}}(this,c),t.useProjection&&function(t,e){var r=t.$__schema,n=Object.keys(r.paths||{});if(!t._doc)return e;var i=t.$__.selected;void 0===i&&(i={},L.applyPaths(i,r));if(null==i||0===Object.keys(i).length)return e;for(var o=0,s=n;o<s.length;o++){var a=s[o];null==i[a]||i[a]||delete e[a]}}(this,c),!0===l||a.toObject&&l){var d=t.json?a.toJSON:a.toObject;d&&(l="function"==typeof t.transform?t.transform:d.transform)}else t.transform=f;if("function"==typeof l){var p=l(this,c,t);void 0!==p&&(c=p)}return c},nt.prototype.toObject=function(t){return this.$toObject(t)},nt.prototype.toJSON=function(t){return this.$toObject(t,!0)},nt.prototype.ownerDocument=function(){return this},nt.prototype.parent=function(){return this.$isSubdocument||this.$__.wasPopulated?this.$__.parent:this},nt.prototype.$parent=nt.prototype.parent,nt.prototype.inspect=function(t){var e;q.isPOJO(t)&&((e=t).minimize=!1);var r=this.toObject(e);return null==r?"MongooseDocument { "+r+" }":r},I.custom&&(
  398. /*!
  399. * Avoid Node deprecation warning DEP0079
  400. */
  401. nt.prototype[I.custom]=nt.prototype.inspect),nt.prototype.toString=function(){var t=this.inspect();return"string"==typeof t?t:I(t)},nt.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:z(this,t)},nt.prototype.populate=function(){var t,e={},r=Array.prototype.slice.call(arguments);if(0!==r.length){"function"==typeof r[r.length-1]&&(t=r.pop());var n,o=q.populate.apply(null,r),s=i(o);try{for(s.s();!(n=s.n()).done;){var a=n.value;e[a.path]=a}}catch(t){s.e(t)}finally{s.f()}}var u=q.object.vals(e),h=this.constructor;if(this.$__isNested){h=this.$__[X].constructor;var f=this.$__.nestedPath;u.forEach((function(t){t.path=f+"."+t.path}))}if(null!=this.$session()){var c=this.$session();u.forEach((function(t){null!=t.options?"session"in t.options||(t.options.session=c):t.options={session:c}}))}return u.forEach((function(t){t._localModel=h})),h.populate(this,u,t)},nt.prototype.$getPopulatedDocs=function(){var t=[];null!=this.$__.populated&&(t=t.concat(Object.keys(this.$__.populated)));var e,r=[],n=i(t);try{for(n.s();!(e=n.n()).done;){var o=e.value,s=this.$get(o);Array.isArray(s)?r=r.concat(s):s instanceof nt&&r.push(s)}}catch(t){n.e(t)}finally{n.f()}return r},nt.prototype.populated=function(t,e,r){if(null==e||!0===e){if(!this.$__.populated)return;if("string"!=typeof t)return;var n=t.endsWith(".$*")?t.replace(/\.\$\*$/,""):t,i=this.$__.populated[n];return i?!0===e?i:i.value:void 0}this.$__.populated||(this.$__.populated={}),this.$__.populated[t]={value:e,options:r};for(var o=t.split("."),s=0;s<o.length-1;++s){var a=o.slice(0,s+1).join("."),u=this.$get(a);if(null!=u&&null!=u.$__&&this.$populated(a)){var h=o.slice(s+1).join(".");u.$populated(h,e,r);break}}return e},nt.prototype.$populated=nt.prototype.populated,nt.prototype.depopulate=function(t){var e;"string"==typeof t&&(t=-1===t.indexOf(" ")?[t]:t.split(" "));var r=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],n=k(this,"$__.populated",{});if(0===arguments.length){var o,s=i(r);try{for(s.s();!(o=s.n()).done;){var a=o.value;delete this.$$populatedVirtuals[a],delete this._doc[a],delete n[a]}}catch(t){s.e(t)}finally{s.f()}for(var u=Object.keys(n),h=0,f=u;h<f.length;h++){var c=f[h];(e=this.$populated(c))&&(delete n[c],q.setValue(c,e,this._doc))}return this}var l,d=i(t);try{for(d.s();!(l=d.n()).done;){var p=l.value;e=this.$populated(p),delete n[p],-1!==r.indexOf(p)?(delete this.$$populatedVirtuals[p],delete this._doc[p]):e&&q.setValue(p,e,this._doc)}}catch(t){d.e(t)}finally{d.f()}return this},nt.prototype.$__fullPath=function(t){return t||""},nt.prototype.getChanges=function(){var t=this.$__delta();return t?t[1]:{}},
  402. /*!
  403. * Module exports.
  404. */
  405. nt.ValidationError=g,t.exports=nt},function(t,e,r){"use strict";function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var o=r(41),s=i((function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e)return this;Object.assign(this,o(e))})),a=r(16);Object.defineProperty(s.prototype,"type",a),Object.defineProperty(s.prototype,"validate",a),Object.defineProperty(s.prototype,"cast",a),Object.defineProperty(s.prototype,"required",a),Object.defineProperty(s.prototype,"default",a),Object.defineProperty(s.prototype,"ref",a),Object.defineProperty(s.prototype,"select",a),Object.defineProperty(s.prototype,"index",a),Object.defineProperty(s.prototype,"unique",a),Object.defineProperty(s.prototype,"immutable",a),Object.defineProperty(s.prototype,"sparse",a),Object.defineProperty(s.prototype,"text",a),Object.defineProperty(s.prototype,"transform",a),t.exports=s},function(t,e,r){"use strict";t.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})},function(t,e,r){"use strict";var n=r(11),i=r(0);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var h;h="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=h>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,h=e;return u+=(h=h+n>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+i+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,h){var f=0,c=e;return f+=(c=c+n>>>0)<e?1:0,f+=(c=c+o>>>0)<o?1:0,f+=(c=c+a>>>0)<a?1:0,t+r+i+s+u+(f+=(c=c+h>>>0)<h?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,h){return e+n+o+a+h>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){"use strict";var n=r(25).get().ObjectId,i=r(1).objectIdSymbol;
  406. /*!
  407. * Getter for convenience with populate, see gh-6115
  408. */
  409. Object.defineProperty(n.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}),
  410. /*!
  411. * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299
  412. */
  413. n.prototype.hasOwnProperty("valueOf")||(n.prototype.valueOf=function(){return this.toString()}),n.prototype[i]=!0,t.exports=n},function(t,e,r){"use strict";
  414. /*!
  415. * ignore
  416. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,c(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,t)})(t)}function u(t,e,r){return(u=h()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&f(i,r.prototype),i}).apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(d,t);var e,r,n,a,u,l=(e=d,r=h(),function(){var t,n=c(e);if(r){var i=c(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return s(this,t)});function d(){return o(this,d),l.apply(this,arguments)}return n=d,a&&i(n.prototype,a),u&&i(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n}(a(Error));Object.defineProperty(l.prototype,"name",{value:"MongooseError"}),t.exports=l},function(t,e,r){"use strict";
  417. /*!
  418. * Module dependencies.
  419. */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 i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=r(19),c=r(6),l=r(9),d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(f,t);var e,r,n,h=a(f);function f(t,e,r,n,o){var s;if(i(this,f),arguments.length>0){var a=p(e),c=y(e),l=m(o),d=b(null,t,a,r,l,c);(s=h.call(this,d)).init(t,e,r,n,o)}else s=h.call(this,b());return u(s)}return e=f,(r=[{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}}
  420. /*!
  421. * ignore
  422. */},{key:"init",value:function(t,e,r,n,i){this.stringValue=p(e),this.messageFormat=m(i),this.kind=t,this.value=e,this.path=r,this.reason=n,this.valueType=y(e)}
  423. /*!
  424. * ignore
  425. * @param {Readonly<CastError>} other
  426. */},{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}
  427. /*!
  428. * ignore
  429. */},{key:"setModel",value:function(t){this.model=t,this.message=b(t,this.kind,this.stringValue,this.path,this.messageFormat,this.valueType)}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),f}(f);function p(t){var e=l.inspect(t);return(e=e.replace(/^'|'$/g,'"')).startsWith('"')||(e='"'+e+'"'),e}function y(t){if(null==t)return""+t;var e=n(t);return"object"!==e||"function"!=typeof t.constructor?e:t.constructor.name}function m(t){var e=c(t,"options.cast",null);if("string"==typeof e)return e}
  430. /*!
  431. * ignore
  432. */function b(t,e,r,n,i,o){if(null!=i){var s=i.replace("{KIND}",e).replace("{VALUE}",r).replace("{PATH}",n);return null!=t&&(s=s.replace("{MODEL}",t.modelName)),s}var a="Cast to "+e+" failed for value "+r+(o?" (type "+o+")":"")+' at path "'+n+'"';return null!=t&&(a+=' for model "'+t.modelName+'"'),a}
  433. /*!
  434. * exports
  435. */Object.defineProperty(d.prototype,"name",{value:"CastError"}),t.exports=d},function(t,e,r){(function(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(t,n){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(234).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,n):(this._parseBase(t,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var f=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!==(o=a>>>24-n&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?y+r:c[h-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,d=0|s[1],p=8191&d,y=d>>>13,m=0|s[2],b=8191&m,v=m>>>13,g=0|s[3],w=8191&g,_=g>>>13,M=0|s[4],S=8191&M,O=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,k=0|s[6],j=8191&k,$=k>>>13,P=0|s[7],R=8191&P,B=P>>>13,T=0|s[8],I=8191&T,N=T>>>13,D=0|s[9],C=8191&D,L=D>>>13,q=0|a[0],U=8191&q,F=q>>>13,z=0|a[1],V=8191&z,K=z>>>13,H=0|a[2],Z=8191&H,W=H>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,G=0|a[4],X=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ft=0|a[8],ct=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(y,U)|0,o=Math.imul(y,F);var bt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var vt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0;var gt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,F))+Math.imul(O,U)|0,o=Math.imul(O,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,F))+Math.imul($,U)|0,o=Math.imul($,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,F))+Math.imul(B,U)|0,o=Math.imul(B,F),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul($,Z)|0,o=o+Math.imul($,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0;var Ot=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,yt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,X)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,W))+Math.imul(L,Z)|0,o=Math.imul(L,W),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(L,Y)|0,o=Math.imul(L,Q),n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,X),i=(i=Math.imul(C,tt))+Math.imul(L,X)|0,o=Math.imul(L,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,ut)|0,o=o+Math.imul($,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var jt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul($,ct)|0,o=o+Math.imul($,lt)|0;var $t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var Pt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,pt)|0))<<13)|0;h=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,ut),i=(i=Math.imul(C,ht))+Math.imul(L,ut)|0,o=Math.imul(L,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,lt))+Math.imul(L,ct)|0,o=Math.imul(L,lt);var Bt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Tt=(h+(n=Math.imul(C,pt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(L,pt)|0))<<13)|0;return h=((o=Math.imul(L,yt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=mt,u[1]=bt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Ot,u[9]=At,u[10]=Et,u[11]=xt,u[12]=kt,u[13]=jt,u[14]=$t,u[15]=Pt,u[16]=Rt,u[17]=Bt,u[18]=Tt,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(y=p),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,l=h,d=0;d<s;d++){var p=r[f+d],y=n[f+d],m=r[f+d+s],b=n[f+d+s],v=c*m-l*b;b=c*b+l*m,m=v,r[f+d]=p+m,n[f+d]=y+b,r[f+d+s]=p-m,n[f+d+s]=y-b,d!==a&&(v=u*c-h*l,l=u*l+h*c,c=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(u)):(r.isub(e),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new O(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){O.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},o(w,g),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(_,g),o(M,g),o(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},O.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},O.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},O.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},O.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},O.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},O.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},O.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},O.prototype.isqr=function(t){return this.imul(t,t.clone())},O.prototype.sqr=function(t){return this.mul(t,t)},O.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var y=d,m=0;0!==y.cmp(a);m++)y=y.redSqr();i(m<p);var b=this.pow(c,new s(1).iushln(p-m-1));l=l.redMul(b),c=b.redSqr(),d=d.redMul(c),p=m}return l},O.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},O.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var c=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}u=26}return i},O.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},O.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},o(A,O),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e,r){"use strict";
  436. /*!
  437. * If `val` is an object, returns constructor name, if possible. Otherwise returns undefined.
  438. */t.exports=function(t){if(null!=t&&"function"==typeof t.constructor)return t.constructor.name}},function(t,e,r){var n=r(2).Buffer,i=r(195).Transform,o=r(36).StringDecoder;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(0)(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";
  439. /*!
  440. * ignore
  441. */var n=null;t.exports.get=function(){return n},t.exports.set=function(t){n=t}},function(t,e,r){"use strict";var n=r(47),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=c;var o=Object.create(r(37));o.inherits=r(0);var s=r(105),a=r(65);o.inherits(c,s);for(var u=i(a.prototype),h=0;h<u.length;h++){var f=u[h];c.prototype[f]||(c.prototype[f]=a.prototype[f])}function c(t){if(!(this instanceof c))return new c(t);s.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),c.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},function(t,e,r){"use strict";
  442. /*!
  443. * Module dependencies.
  444. */function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(89),o=r(327),s=r(14),a=r(1).arrayAtomicsSymbol,u=r(1).arrayAtomicsBackupSymbol,h=r(1).arrayParentSymbol,f=r(1).arrayPathSymbol,c=r(1).arraySchemaSymbol,l=Array.prototype.push,d=/^\d+$/;
  445. /*!
  446. * Module exports.
  447. */
  448. t.exports=function(t,e,r){var p,y=[],m=(n(p={},a,{}),n(p,u,void 0),n(p,f,e),n(p,c,void 0),n(p,h,void 0),p);if(Array.isArray(t)&&(t[f]===e&&t[h]===r&&(m[a]=Object.assign({},t[a])),t.forEach((function(t){l.call(y,t)}))),m[f]=e,m.__array=y,r&&r instanceof s)for(m[h]=r,m[c]=r.schema.path(e);null!=m[c]&&m[c].$isMongooseArray&&!m[c].$isMongooseDocumentArray;)m[c]=m[c].casterConstructor;var b=new Proxy(y,{get:function(t,e){return"isMongooseArray"===e||"isMongooseArrayProxy"===e||"isMongooseDocumentArray"===e||"isMongooseDocumentArrayProxy"===e||(m.hasOwnProperty(e)?m[e]:o.hasOwnProperty(e)?o[e]:i.hasOwnProperty(e)?i[e]:y[e])},set:function(t,e,r){return"string"==typeof e&&d.test(e)?o.set.call(b,e,r,!1):m.hasOwnProperty(e)?m[e]=r:y[e]=r,!0}});return b}},function(t,e,r){"use strict";(function(e,n){var i=r(2).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s<t;s+=65536)o.getRandomValues(r.slice(s,s+65536));else o.getRandomValues(r);if("function"==typeof e)return n.nextTick((function(){e(null,r)}));return r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(7),r(5))},function(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 i={};function o(t,e,r){r||(r=Error);var n=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);n.prototype.name=r.name,n.prototype.code=t,i[t]=n}function s(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))}o("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,a,u;if("string"==typeof e&&(o="not ",e.substr(!a||a<0?0:+a,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))u="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var h=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";u='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(s(e,"type"))}return u+=". Received type ".concat(n(r))}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},function(t,e,r){"use strict";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var i=r(96),o=r(100);r(0)(h,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];h.prototype[u]||(h.prototype[u]=o.prototype[u])}function h(t){if(!(this instanceof h))return new h(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||e.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this,r(5))},function(t,e,r){var n=r(2).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var u=s%i,h=Math.min(o-a,i-u),f=0;f<h;f++)r[u+f]=t[a+f];a+=h,(s+=h)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";t.exports=r(25).get().Decimal128},function(t,e,r){"use strict";(function(e){
  449. /*!
  450. * Determines if `arg` is an object.
  451. *
  452. * @param {Object|Array|String|Function|RegExp|any} arg
  453. * @api private
  454. * @return {Boolean}
  455. */
  456. t.exports=function(t){return e.isBuffer(t)||"[object Object]"===Object.prototype.toString.call(t)}}).call(this,r(3).Buffer)},function(t,e,r){"use strict";
  457. /*!
  458. * ignore
  459. */e.internalToObjectOptions={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1}},function(t,e,r){"use strict";var n=r(0),i=r(60),o=r(62),s=r(63),a=r(23);function u(t){a.call(this,"digest"),this._hash=t}n(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},function(t,e,r){"use strict";var n=r(186).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=h,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=c,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(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)}function i(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===i(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===i(t)},e.isObject=function(t){return"object"===n(t)&&null!==t},e.isDate=function(t){return"[object Date]"===i(t)},e.isError=function(t){return"[object Error]"===i(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},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(3).Buffer.isBuffer},function(t,e,r){(function(e){t.exports=function(t,r){for(var n=Math.min(t.length,r.length),i=new e(n),o=0;o<n;++o)i[o]=t[o]^r[o];return i}}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(17),i=r(11);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},function(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 i=r(0),o=r(78).Reporter,s=r(76).Buffer;function a(t,e){o.call(this,e),s.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function u(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return u.isEncoderBuffer(t)||(t=new u(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=s.byteLength(t);else{if(!s.isBuffer(t))return e.error("Unsupported type: "+n(t));this.value=t,this.length=t.length}}i(a,o),e.DecoderBuffer=a,a.isDecoderBuffer=function(t){return t instanceof a||"object"===n(t)&&s.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},a.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},a.prototype.restore=function(t){var e=new a(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,o.prototype.restore.call(this,t.reporter),e},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},a.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},a.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.EncoderBuffer=u,u.isEncoderBuffer=function(t){return t instanceof u||"object"===n(t)&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},u.prototype.join=function(t,e){return t||(t=s.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):s.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},function(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 i=r(32),o=r(18),s=r(82),a=r(52),u=r(145),h=r(146),f=r(33),c=r(1),l=r(147).trustedSymbol,d=r(4);
  460. /*!
  461. * Object clone with Mongoose natives support.
  462. *
  463. * If options.minimize is true, creates a minimal data object. Empty objects and undefined values will not be cloned. This makes the data payload sent to MongoDB as small as possible.
  464. *
  465. * Functions are never cloned.
  466. *
  467. * @param {Object} obj the object to clone
  468. * @param {Object} options
  469. * @param {Boolean} isArrayChild true if cloning immediately underneath an array. Special case for minimize.
  470. * @return {Object} the cloned object
  471. * @api private
  472. */
  473. function p(t,e,r){if(null==t)return t;if(Array.isArray(t))return function(t,e){var r=0,n=t.length,i=new Array(n);for(r=0;r<n;++r)i[r]=p(t[r],e,!0);return i}(d.isMongooseArray(t)?t.__array:t,e);if(a(t))return e&&e._skipSingleNestedGetters&&t.$isSingleNested&&(e=Object.assign({},e,{getters:!1})),d.isPOJO(t)&&null!=t.$__&&null!=t._doc?t._doc:e&&e.json&&"function"==typeof t.toJSON?t.toJSON(e):t.toObject(e);var s=t.constructor;if(s)switch(u(s)){case"Object":return y(t,e,r);case"Date":return new s(+t);case"RegExp":return function(t){var e=new RegExp(t.source,t.flags);e.lastIndex!==t.lastIndex&&(e.lastIndex=t.lastIndex);return e}(t)}return t instanceof o?new o(t.id):h(t,"Decimal128")?e&&e.flattenDecimals?t.toJSON():i.fromString(t.toString()):!s&&f(t)?y(t,e,r):"object"===n(t)&&t[c.schemaTypeSymbol]?t.clone():e&&e.bson&&"function"==typeof t.toBSON?t:"function"==typeof t.valueOf?t.valueOf():y(t,e,r)}
  474. /*!
  475. * ignore
  476. */
  477. function y(t,e,r){var n,i=e&&e.minimize,o={};l in t&&(o[l]=t[l]);var a=0,u="",h=Object.keys(t),f=h.length;for(a=0;a<f;++a)if(!s.has(u=h[a])){var c=p(t[u],e,!1);!1===i&&void 0===c?delete o[u]:!0===i&&void 0===c||(n||(n=!0),o[u]=c)}return i&&!r?n&&o:o}t.exports=p},function(t,e,r){"use strict";(function(e){
  478. /*!
  479. * Centralize this so we can more easily work around issues with people
  480. * stubbing out `process.nextTick()` in tests using sinon:
  481. * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time
  482. * See gh-6074
  483. */
  484. var r=e.nextTick.bind(e);t.exports=function(t){return r(t)}}).call(this,r(5))},function(t,e,r){"use strict";(function(e){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 i=r(281);
  485. /*!
  486. * The buffer module from node.js, for the browser.
  487. *
  488. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  489. * @license MIT
  490. */function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function s(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=r(9),u=Object.prototype.hasOwnProperty,h=Array.prototype.slice,f="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function l(t){return!s(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var d=t.exports=g,p=/\s*function\s+([^\(\s]*)\s*/;function y(t){if(a.isFunction(t)){if(f)return t.name;var e=t.toString().match(p);return e&&e[1]}}function m(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function b(t){if(f||!a.isFunction(t))return a.inspect(t);var e=y(t);return"[Function"+(e?": "+e:"")+"]"}function v(t,e,r,n,i){throw new d.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function g(t,e){t||v(t,!0,e,"==",d.ok)}function w(t,e,r,i){if(t===e)return!0;if(s(t)&&s(e))return 0===o(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"===n(t)||null!==e&&"object"===n(e)){if(l(t)&&l(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(s(t)!==s(e))return!1;var u=(i=i||{actual:[],expected:[]}).actual.indexOf(t);return-1!==u&&u===i.expected.indexOf(e)||(i.actual.push(t),i.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=_(t),o=_(e);if(i&&!o||!i&&o)return!1;if(i)return t=h.call(t),e=h.call(e),w(t,e,r);var s,u,f=O(t),c=O(e);if(f.length!==c.length)return!1;for(f.sort(),c.sort(),u=f.length-1;u>=0;u--)if(f[u]!==c[u])return!1;for(u=f.length-1;u>=0;u--)if(s=f[u],!w(t[s],e[s],r,n))return!1;return!0}(t,e,r,i))}return r?t===e:t==e}function _(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function M(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function S(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&i&&!r;if((!t&&a.isError(i)&&o&&M(i,r)||s)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!M(i,r)||!t&&i)throw i}d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return m(b(t.actual),128)+" "+t.operator+" "+m(b(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=y(e),o=n.indexOf("\n"+i);if(o>=0){var s=n.indexOf("\n",o+1);n=n.substring(s+1)}this.stack=n}}},a.inherits(d.AssertionError,Error),d.fail=v,d.ok=g,d.equal=function(t,e,r){t!=e&&v(t,e,r,"==",d.equal)},d.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",d.notEqual)},d.deepEqual=function(t,e,r){w(t,e,!1)||v(t,e,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(t,e,r){w(t,e,!0)||v(t,e,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(t,e,r){w(t,e,!1)&&v(t,e,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function t(e,r,n){w(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},d.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",d.strictEqual)},d.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",d.notStrictEqual)},d.throws=function(t,e,r){S(!0,t,e,r)},d.doesNotThrow=function(t,e,r){S(!1,t,e,r)},d.ifError=function(t){if(t)throw t},d.strict=i((function t(e,r){e||v(e,!0,r,"==",t)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var O=Object.keys||function(t){var e=[];for(var r in t)u.call(t,r)&&e.push(r);return e}}).call(this,r(7))},function(t,e,r){"use strict";
  491. /*!
  492. * Module dependencies.
  493. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t,e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=e||"Field `"+t+"` is not in schema and strict mode is set to throw.",(n=a.call(this,e)).isImmutableError=!!r,n.path=t,n}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"StrictModeError"}),t.exports=h},function(t,e,r){"use strict";
  494. /*!
  495. * Module dependencies.
  496. */var n=r(10),i=r(55),o=r(33),s=r(4);function a(t,e){if(e&&e.default){var r=e.default;Array.isArray(r)&&0===r.length?e.default=Array:!e.shared&&o(r)&&0===Object.keys(r).length&&(e.default=function(){return{}})}n.call(this,t,e,"Mixed"),this[i.schemaMixedSymbol]=!0}a.schemaName="Mixed",a.defaultOptions={},
  497. /*!
  498. * Inherits from SchemaType.
  499. */
  500. a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.get=n.get,a.set=n.set,a.prototype.cast=function(t){return t instanceof Error?s.errorToPOJO(t):t},a.prototype.castForQuery=function(t,e){return 2===arguments.length?e:t},
  501. /*!
  502. * Module exports.
  503. */
  504. t.exports=a},function(t,e,r){"use strict";
  505. /*!
  506. * Module dependencies.
  507. */var n=r(13).EventEmitter,i=r(90),o=r(4),s=r(1).documentArrayParent;
  508. /*!
  509. * A constructor.
  510. *
  511. * @param {Object} obj js object returned from the db
  512. * @param {MongooseDocumentArray} parentArr the parent array of this document
  513. * @param {Boolean} skipId
  514. * @inherits Document
  515. * @api private
  516. */
  517. function a(t,e,r,n,a){o.isMongooseDocumentArray(e)?(this.__parentArray=e,this[s]=e.$parent()):(this.__parentArray=void 0,this[s]=void 0),this.$setIndex(a),this.$__parent=this[s],i.call(this,t,n,this[s],void 0,{isNew:!0})}
  518. /*!
  519. * Inherit from Subdocument
  520. */for(var u in a.prototype=Object.create(i.prototype),a.prototype.constructor=a,Object.defineProperty(a.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1}),Object.defineProperty(a.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0}),n.prototype)a[u]=n.prototype[u];
  521. /*!
  522. * ignore
  523. */a.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])}},
  524. /*!
  525. * ignore
  526. */
  527. a.prototype.populate=function(){throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`')},
  528. /*!
  529. * ignore
  530. */
  531. a.prototype.$__removeFromParent=function(){var t=this._doc._id;if(!t)throw new Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:t})},a.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)},
  532. /*!
  533. * Given a path relative to this document, return the path relative
  534. * to the top-level document.
  535. */
  536. a.prototype.$__pathRelativeToParent=function(t,e){return null==this.__index?null:e?null==t?this.__parentArray.$path():this.__parentArray.$path()+"."+t:null==t?this.__parentArray.$path()+"."+this.__index:this.__parentArray.$path()+"."+this.__index+"."+t},
  537. /*!
  538. * Returns this sub-documents parent document.
  539. */
  540. a.prototype.$parent=function(){return this[s]},a.prototype.parentArray=function(){return this.__parentArray},
  541. /*!
  542. * Module exports.
  543. */
  544. t.exports=a},function(t,e,r){"use strict";(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick((function(){t.apply(null,o)}))}}}:t.exports=e}).call(this,r(5))},function(t,e,r){var n=r(2).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,u,h=r[0],f=r[1],c=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],y=t[2]^e[2],m=t[3]^e[3],b=4,v=1;v<i;v++)o=h[d>>>24]^f[p>>>16&255]^c[y>>>8&255]^l[255&m]^e[b++],s=h[p>>>24]^f[y>>>16&255]^c[m>>>8&255]^l[255&d]^e[b++],a=h[y>>>24]^f[m>>>16&255]^c[d>>>8&255]^l[255&p]^e[b++],u=h[m>>>24]^f[d>>>16&255]^c[p>>>8&255]^l[255&y]^e[b++],d=o,p=s,y=a,m=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&m])^e[b++],s=(n[p>>>24]<<24|n[y>>>16&255]<<16|n[m>>>8&255]<<8|n[255&d])^e[b++],a=(n[y>>>24]<<24|n[m>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[b++],u=(n[m>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^e[b++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var h=a^a<<1^a<<2^a<<3^a<<4;h=h>>>8^255&h^99,r[s]=h,n[h]=s;var f=t[s],c=t[f],l=t[c],d=257*t[h]^16843008*h;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*c^257*f^16843008*s,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===s?s=a=1:(s=f^t[t[t[l^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function h(t){this._key=i(t),this._reset()}h.blockSize=16,h.keySize=32,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-e]^s}for(var h=[],f=0;f<n;f++){var c=n-f,l=i[c-(f%4?0:4)];h[f]=f<4||c<=4?l:u.INV_SUB_MIX[0][u.SBOX[l>>>24]]^u.INV_SUB_MIX[1][u.SBOX[l>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[l>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=h},h.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},h.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},h.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},h.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=h},function(t,e,r){var n=r(2).Buffer,i=r(60);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),u=n.alloc(o||0),h=n.alloc(0);s>0||o>0;){var f=new i;f.update(h),f.update(t),e&&f.update(e),h=f.digest();var c=0;if(s>0){var l=a.length-s;c=Math.min(s,h.length),h.copy(a,l,0,c),s-=c}if(c<h.length&&o>0){var d=u.length-o,p=Math.min(o,h.length-c);h.copy(u,d,c,c+p),o-=p}}return h.fill(0),{key:a,iv:u}}},function(t,e,r){"use strict";var n=r(21),i=r(12),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function h(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,h=[];for(s=0;s<n.length;s+=r.step){u=0;for(var f=s+r.step-1;f>=s;f--)u=(u<<1)+n[f];h.push(u)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<h.length;s++)(u=h[s])===d?l=l.mixedAdd(r.points[s]):u===-d&&(l=l.mixedAdd(r.points[s].neg()));c=c.add(l)}return c.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),h=s.length-1;h>=0;h--){for(var f=0;h>=0&&0===s[h];h--)f++;if(h>=0&&f++,u=u.dblp(f),h<0)break;var c=s[h];a(0!==c),u="affine"===t.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,h,f=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(h=e[a])._getNAFPoints(t);f[a]=p.wnd,c[a]=p.points}for(a=n-1;a>=1;a-=2){var y=a-1,m=a;if(1===f[y]&&1===f[m]){var b=[e[y],null,null,e[m]];0===e[y].y.cmp(e[m].y)?(b[1]=e[y].add(e[m]),b[2]=e[y].toJ().mixedAdd(e[m].neg())):0===e[y].y.cmp(e[m].y.redNeg())?(b[1]=e[y].toJ().mixedAdd(e[m]),b[2]=e[y].add(e[m].neg())):(b[1]=e[y].toJ().mixedAdd(e[m]),b[2]=e[y].toJ().mixedAdd(e[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[y],r[m]);for(d=Math.max(g[0].length,d),l[y]=new Array(d),l[m]=new Array(d),u=0;u<d;u++){var w=0|g[0][u],_=0|g[1][u];l[y][u]=v[3*(w+1)+(_+1)],l[m][u]=0,c[y]=b}}else l[y]=o(r[y],f[y],this._bitLength),l[m]=o(r[m],f[m],this._bitLength),d=Math.max(l[y].length,d),d=Math.max(l[m].length,d)}var M=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var O=0;a>=0;){var A=!0;for(u=0;u<n;u++)S[u]=0|l[u][a],0!==S[u]&&(A=!1);if(!A)break;O++,a--}if(a>=0&&O++,M=M.dblp(O),a<0)break;for(u=0;u<n;u++){var E=S[u];0!==E&&(E>0?h=c[u][E-1>>1]:E<0&&(h=c[u][-E-1>>1].neg()),M="affine"===h.type?M.mixedAdd(h):M.add(h))}}for(a=0;a<n;a++)c[a]=null;return i?M:M.toP()},u.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(t){return this.encode(t,!0)},h.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},h.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},h.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},h.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},h.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},function(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 i=r(252),o=r(260),s=r(261),a=r(67),u=r(113),h=r(2).Buffer;function f(t){var e;"object"!==n(t)||h.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=h.from(t));var r,f,c=s(t,e),l=c.tag,d=c.data;switch(l){case"CERTIFICATE":f=i.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=i.PublicKey.decode(d,"der")),r=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=i.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=o[t.algorithm.decrypt.cipher.algo.join(".")],s=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,c=parseInt(i.split("-")[1],10)/8,l=u.pbkdf2Sync(e,r,n,c,"sha1"),d=a.createDecipheriv(i,l,s),p=[];return p.push(d.update(f)),p.push(d.final()),h.concat(p)}(d=i.EncryptedPrivateKey.decode(d,"der"),e);case"PRIVATE KEY":switch(r=(f=i.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:i.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=i.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=i.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=f,f.signature=i.signature},function(t,e,r){"use strict";var n=r(144).isMongooseArray;
  545. /*!
  546. * Returns if `v` is a mongoose object that has a `toObject()` method we can use.
  547. *
  548. * This is for compatibility with libs like Date.js which do foolish things to Natives.
  549. *
  550. * @param {any} v
  551. * @api private
  552. */t.exports=function(t){return null!=t&&(n(t)||null!=t.$__||t.isMongooseBuffer||t.$isMongooseMap)}},function(t,e,r){"use strict";var n=r(148),i=r(42),o=Symbol("mongoose:emitted");t.exports=function(t,e,r,s){return"function"==typeof t?e((function(e){if(null==e)t.apply(this,arguments);else{null!=r&&null!=r.listeners&&r.listeners("error").length>0&&!e[o]&&(e[o]=!0,r.emit("error",e));try{t(e)}catch(e){return i((function(){throw e}))}}})):new(s=s||n.get())((function(t,n){e((function(e,i){return null!=e?(null!=r&&null!=r.listeners&&r.listeners("error").length>0&&!e[o]&&(e[o]=!0,r.emit("error",e)),n(e)):arguments.length>2?t(Array.prototype.slice.call(arguments,1)):void t(i)}))}))}},function(t,e,r){"use strict";var n=["find","findOne","update","updateMany","updateOne","replaceOne","remove","count","distinct","findOneAndDelete","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function i(){}for(var o=0,s=n.length;o<s;++o){var a=n[o];i.prototype[a]=u(a)}function u(t){return function(){throw new Error("collection."+t+" not implemented")}}t.exports=i,i.methods=n},function(t,e,r){"use strict";e.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed"),e.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")},function(t,e,r){"use strict";
  553. /*!
  554. * Module requirements.
  555. */var n=r(159);
  556. /*!
  557. * @ignore
  558. */
  559. /*!
  560. * @ignore
  561. */
  562. function i(t){return n.cast()(t)}e.castToNumber=i,e.castArraysOfNumbers=function t(e,r){e.forEach((function(n,o){Array.isArray(n)?t(n,r):e[o]=i.call(r,n)}))}},function(t,e,r){"use strict";var n=r(163);
  563. /*!
  564. * returns discriminator by discriminatorMapping.value
  565. *
  566. * @param {Model} model
  567. * @param {string} value
  568. */t.exports=function(t,e){if(null==t)return null;for(var r=0,i=Object.keys(t);r<i.length;r++){var o=t[i[r]];if(o.schema&&o.schema.discriminatorMapping&&n(o.schema.discriminatorMapping.value,e))return o}return null}},function(t,e,r){"use strict";
  569. /*!
  570. * Module exports.
  571. */e.Array=r(166),e.Buffer=r(168),e.Document=e.Embedded=r(46),e.DocumentArray=r(27),e.Decimal128=r(32),e.ObjectId=r(18),e.Map=r(170),e.Subdocument=r(90)},function(t,e,r){"use strict";r.r(e),function(t){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)}r.d(e,"BSONError",(function(){return S})),r.d(e,"BSONRegExp",(function(){return vt})),r.d(e,"BSONSymbol",(function(){return gt})),r.d(e,"BSONTypeError",(function(){return O})),r.d(e,"BSON_BINARY_SUBTYPE_BYTE_ARRAY",(function(){return oe})),r.d(e,"BSON_BINARY_SUBTYPE_COLUMN",(function(){return fe})),r.d(e,"BSON_BINARY_SUBTYPE_DEFAULT",(function(){return ne})),r.d(e,"BSON_BINARY_SUBTYPE_ENCRYPTED",(function(){return he})),r.d(e,"BSON_BINARY_SUBTYPE_FUNCTION",(function(){return ie})),r.d(e,"BSON_BINARY_SUBTYPE_MD5",(function(){return ue})),r.d(e,"BSON_BINARY_SUBTYPE_USER_DEFINED",(function(){return ce})),r.d(e,"BSON_BINARY_SUBTYPE_UUID",(function(){return se})),r.d(e,"BSON_BINARY_SUBTYPE_UUID_NEW",(function(){return ae})),r.d(e,"BSON_DATA_ARRAY",(function(){return Lt})),r.d(e,"BSON_DATA_BINARY",(function(){return qt})),r.d(e,"BSON_DATA_BOOLEAN",(function(){return zt})),r.d(e,"BSON_DATA_CODE",(function(){return Wt})),r.d(e,"BSON_DATA_CODE_W_SCOPE",(function(){return Yt})),r.d(e,"BSON_DATA_DATE",(function(){return Vt})),r.d(e,"BSON_DATA_DBPOINTER",(function(){return Zt})),r.d(e,"BSON_DATA_DECIMAL128",(function(){return te})),r.d(e,"BSON_DATA_INT",(function(){return Qt})),r.d(e,"BSON_DATA_LONG",(function(){return Xt})),r.d(e,"BSON_DATA_MAX_KEY",(function(){return re})),r.d(e,"BSON_DATA_MIN_KEY",(function(){return ee})),r.d(e,"BSON_DATA_NULL",(function(){return Kt})),r.d(e,"BSON_DATA_NUMBER",(function(){return Nt})),r.d(e,"BSON_DATA_OBJECT",(function(){return Ct})),r.d(e,"BSON_DATA_OID",(function(){return Ft})),r.d(e,"BSON_DATA_REGEXP",(function(){return Ht})),r.d(e,"BSON_DATA_STRING",(function(){return Dt})),r.d(e,"BSON_DATA_SYMBOL",(function(){return Jt})),r.d(e,"BSON_DATA_TIMESTAMP",(function(){return Gt})),r.d(e,"BSON_DATA_UNDEFINED",(function(){return Ut})),r.d(e,"BSON_INT32_MAX",(function(){return $t})),r.d(e,"BSON_INT32_MIN",(function(){return Pt})),r.d(e,"BSON_INT64_MAX",(function(){return Rt})),r.d(e,"BSON_INT64_MIN",(function(){return Bt})),r.d(e,"Binary",(function(){return K})),r.d(e,"Code",(function(){return H})),r.d(e,"DBRef",(function(){return W})),r.d(e,"Decimal128",(function(){return ht})),r.d(e,"Double",(function(){return ft})),r.d(e,"EJSON",(function(){return Et})),r.d(e,"Int32",(function(){return ct})),r.d(e,"Long",(function(){return G})),r.d(e,"LongWithoutOverridesClass",(function(){return wt})),r.d(e,"Map",(function(){return xt})),r.d(e,"MaxKey",(function(){return lt})),r.d(e,"MinKey",(function(){return dt})),r.d(e,"ObjectID",(function(){return bt})),r.d(e,"ObjectId",(function(){return bt})),r.d(e,"Timestamp",(function(){return _t})),r.d(e,"UUID",(function(){return V})),r.d(e,"calculateObjectSize",(function(){return Qe})),r.d(e,"deserialize",(function(){return Ye})),r.d(e,"deserializeStream",(function(){return Ge})),r.d(e,"serialize",(function(){return We})),r.d(e,"serializeWithBufferAndIndex",(function(){return Je})),r.d(e,"setInternalBufferSize",(function(){return Ze}));for(var i=function(t){var e=d(t),r=e[0],n=e[1];return 3*(r+n)/4-n},o=function(t){var e,r,n=d(t),i=n[0],o=n[1],s=new h(function(t,e,r){return 3*(e+r)/4-r}(0,i,o)),a=0,f=o>0?i-4:i;for(r=0;r<f;r+=4)e=u[t.charCodeAt(r)]<<18|u[t.charCodeAt(r+1)]<<12|u[t.charCodeAt(r+2)]<<6|u[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===o&&(e=u[t.charCodeAt(r)]<<2|u[t.charCodeAt(r+1)]>>4,s[a++]=255&e);1===o&&(e=u[t.charCodeAt(r)]<<10|u[t.charCodeAt(r+1)]<<4|u[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},s=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(p(t,o,o+16383>s?s:o+16383));1===n?(e=t[r-1],i.push(a[e>>2]+a[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return i.join("")},a=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,l=f.length;c<l;++c)a[c]=f[c],u[f.charCodeAt(c)]=c;function d(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function p(t,e,r){for(var n,i,o=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(a[(i=n)>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63;var y={byteLength:i,toByteArray:o,fromByteArray:s},m=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,h=u>>1,f=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=h}return(d?-1:1)*s*Math.pow(2,o-n)},b=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,f=(1<<h)-1,c=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*y},v=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},e.INSPECT_MAX_BYTES=50;function n(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|c(t,e),o=n(r),s=o.write(t,e);s!==r&&(o=o.slice(0,s));return o}(t,e);if(ArrayBuffer.isView(t))return function(t){if(L(t,Uint8Array)){var e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t));if(L(t,ArrayBuffer)||t&&L(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(L(t,SharedArrayBuffer)||t&&L(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return i.from(o,e,r);var s=function(t){if(i.isBuffer(t)){var e=0|f(t.length),r=n(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||q(t.length)?n(0):u(t);if("Buffer"===t.type&&Array.isArray(t.data))return u(t.data)}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t))}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return s(t),n(t<0?0:0|f(t))}function u(t){for(var e=t.length<0?0:0|f(t.length),r=n(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,i.prototype),n}function f(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function c(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(o)return n?-1:N(t).length;e=(""+e).toLowerCase(),o=!0}}function l(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,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 h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;l<u;l++)if(h(t,o+l)!==h(e,l)){c=!1;break}if(c)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(q(a))return s;t[r+s]=a}return s}function w(t,e,r,n){return C(N(e,t.length-r),t,r,n)}function _(t,e,r,n){return C(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function M(t,e,r,n){return C(D(e),t,r,n)}function S(t,e,r,n){return C(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?y.fromByteArray(t):y.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,h=t[i],f=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=r)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.kMaxLength=2147483647,i.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}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(t,e,r){return o(t,e,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(t,e,r){return function(t,e,r){return s(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return a(t)},i.allocUnsafeSlow=function(t){return a(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(L(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),L(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,s=Math.min(r,n);o<s;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},i.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}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(L(s,Uint8Array))o+s.length>n.length?i.from(s).copy(n,o):Uint8Array.prototype.set.call(n,s,o);else{if(!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o)}o+=s.length}return n},i.byteLength=c,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):l.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(t,e,r,n,o){if(L(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(s,a),h=this.slice(n,o),f=t.slice(e,r),c=0;c<u;++c)if(h[c]!==f[c]){s=h[c],a=f[c];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return M(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=U[t[o]];return i}function j(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function $(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,i){return e=+e,r>>>=0,i||R(t,0,r,4),b(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||R(t,0,r,8),b(t,e,r,n,52,8),r+8}i.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,i.prototype),n},i.prototype.readUintLE=i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t>>>=0,e||$(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||$(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||$(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||$(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||$(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},i.prototype.readInt8=function(t,e){return t>>>=0,e||$(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||$(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||$(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||$(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||$(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||$(t,4,this.length),m(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||$(t,4,this.length),m(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||$(t,8,this.length),m(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||$(t,8,this.length),m(this,t,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var a=i.isBuffer(t)?t:i.from(t,n),u=a.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=a[s%u]}return this};var I=/[^+/0-9A-Za-z-_]/g;function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return y.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function C(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function L(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var U=function(){for(var t=new Array(256),e=0;e<16;++e)for(var r=16*e,n=0;n<16;++n)t[r+n]="0123456789abcdef"[e]+"0123456789abcdef"[n];return t}()})),g=v.Buffer;
  572. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */v.SlowBuffer,v.INSPECT_MAX_BYTES,v.kMaxLength;
  573. /*! *****************************************************************************
  574. Copyright (c) Microsoft Corporation.
  575. Permission to use, copy, modify, and/or distribute this software for any
  576. purpose with or without fee is hereby granted.
  577. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  578. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  579. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  580. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  581. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  582. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  583. PERFORMANCE OF THIS SOFTWARE.
  584. ***************************************************************************** */
  585. var w=function(t,e){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function _(t,e){function r(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var M=function(){return(M=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},S=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return _(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),O=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return _(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function A(t){return t&&t.Math==Math&&t}function E(){return A("object"===("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||A("object"===("undefined"==typeof window?"undefined":n(window))&&window)||A("object"===("undefined"==typeof self?"undefined":n(self))&&self)||A("object"===(void 0===t?"undefined":n(t))&&t)||Function("return this")()}function x(t){return t.toString().replace("function(","function (")}var k=function(t){var e,r="object"===n((e=E()).navigator)&&"ReactNative"===e.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var i=g.alloc(t),o=0;o<t;++o)i[o]=Math.floor(256*Math.random());return i},j=function(){if("undefined"!=typeof window){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(g.alloc(t))}}if(void 0!==t&&t.crypto&&t.crypto.getRandomValues)return function(e){return t.crypto.getRandomValues(g.alloc(e))};var n;try{n=r(181).randomBytes}catch(t){}return n||k}();function $(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function P(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function R(t){return"[object BigInt64Array]"===Object.prototype.toString.call(t)}function B(t){return"[object BigUint64Array]"===Object.prototype.toString.call(t)}function T(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function I(t){return N(t)&&"[object Date]"===Object.prototype.toString.call(t)}function N(t){return"object"===n(t)&&null!==t}function D(t,e){var r=!1;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return r||(console.warn(e),r=!0),t.apply(this,n)}}function C(t){if(ArrayBuffer.isView(t))return g.from(t.buffer,t.byteOffset,t.byteLength);if($(t))return g.from(t);throw new O("Must use either Buffer or TypedArray")}var L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,q=function(t){return"string"==typeof t&&L.test(t)},U=function(t){if(!q(t))throw new O('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return g.from(e,"hex")},F=function(t,e){return void 0===e&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")},z=Symbol("id"),V=function(){function t(e){if(void 0===e)this.id=t.generate();else if(e instanceof t)this[z]=g.from(e.id),this.__id=e.__id;else if(ArrayBuffer.isView(e)&&16===e.byteLength)this.id=C(e);else{if("string"!=typeof e)throw new O("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).");this.id=U(e)}}return Object.defineProperty(t.prototype,"id",{get:function(){return this[z]},set:function(e){this[z]=e,t.cacheHexString&&(this.__id=F(e))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(e){if(void 0===e&&(e=!0),t.cacheHexString&&this.__id)return this.__id;var r=F(this.id,e);return t.cacheHexString&&(this.__id=r),r},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(!e)return!1;if(e instanceof t)return e.id.equals(this.id);try{return new t(e).id.equals(this.id)}catch(t){return!1}},t.prototype.toBinary=function(){return new K(this.id,K.SUBTYPE_UUID)},t.generate=function(){var t=j(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,g.from(t)},t.isValid=function(e){if(!e)return!1;if(e instanceof t)return!0;if("string"==typeof e)return q(e);if(P(e)){if(16!==e.length)return!1;try{return parseInt(e[6].toString(16)[0],10)===K.SUBTYPE_UUID}catch(t){return!1}}return!1},t.createFromHexString=function(e){return new t(U(e))},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'+this.toHexString()+'")'},t}();Object.defineProperty(V.prototype,"_bsontype",{value:"UUID"});var K=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(!(null==e||"string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Array.isArray(e)))throw new O("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=r?r:t.BSON_BINARY_SUBTYPE_DEFAULT,null==e?(this.buffer=g.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof e?this.buffer=g.from(e,"binary"):Array.isArray(e)?this.buffer=g.from(e):this.buffer=C(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if("string"==typeof e&&1!==e.length)throw new O("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new O("only accepts single character Uint8Array or Array");var r;if((r="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0])<0||r>255)throw new O("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=g.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(t,e){if(e="number"==typeof e?e:this.position,this.buffer.length<e+t.length){var r=g.alloc(this.buffer.length+t.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(t)?(this.buffer.set(C(t),e),this.position=e+t.byteLength>this.position?e+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,e,t.length,"binary"),this.position=e+t.length>this.position?e+t.length:this.position)},t.prototype.read=function(t,e){return e=e&&e>0?e:this.position,this.buffer.slice(t,t+e)},t.prototype.value=function(t){return(t=!!t)&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(t){return this.buffer.toString(t)},t.prototype.toExtendedJSON=function(t){t=t||{};var e=this.buffer.toString("base64"),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}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new V(this.buffer.slice(0,this.position));throw new S('Binary sub_type "'+this.sub_type+'" is not supported for converting to UUID. Only "'+t.SUBTYPE_UUID+'" is currently supported.')},t.fromExtendedJSON=function(e,r){var n,i;if(r=r||{},"$binary"in e?r.legacy&&"string"==typeof e.$binary&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=g.from(e.$binary,"base64")):"string"!=typeof e.$binary&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=g.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=U(e.$uuid)),!n)throw new O("Unexpected Binary Extended JSON format "+JSON.stringify(e));return new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Binary(Buffer.from("'+this.value(!0).toString("hex")+'", "hex"), '+this.sub_type+")"},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(K.prototype,"_bsontype",{value:"Binary"});var H=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.toJSON();return'new Code("'+t.code+'"'+(t.scope?", "+JSON.stringify(t.scope):"")+")"},t}();function Z(t){return N(t)&&null!=t.$id&&"string"==typeof t.$ref&&(null==t.$db||"string"==typeof t.$db)}Object.defineProperty(H.prototype,"_bsontype",{value:"Code"});var W=function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var o=e.split(".");2===o.length&&(n=o.shift(),e=o.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(t.$db=this.db),t},t.prototype.toExtendedJSON=function(t){t=t||{};var e={$ref:this.collection,$id:this.oid};return t.legacy?e:(this.db&&(e.$db=this.db),e=Object.assign(e,this.fields))},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'+this.namespace+'", new ObjectId("'+t+'")'+(this.db?', "'+this.db+'"':"")+")"},t}();Object.defineProperty(W.prototype,"_bsontype",{value:"DBRef"});var J=void 0;try{J=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(t){}var Y={},Q={},G=function(){function t(e,r,n){if(void 0===e&&(e=0),!(this instanceof t))return new t(e,r,n);"bigint"==typeof e?Object.assign(this,t.fromBigInt(e,!!r)):"string"==typeof e?Object.assign(this,t.fromString(e,!!r)):(this.low=0|e,this.high=0|r,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,i,o;return r?(o=0<=(e>>>=0)&&e<256)&&(i=Q[e])?i:(n=t.fromBits(e,(0|e)<0?-1:0,!0),o&&(Q[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(i=Y[e])?i:(n=t.fromBits(e,e<0?-1:0,!1),o&&(Y[e]=n),n)},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=0x10000000000000000)return t.MAX_UNSIGNED_VALUE}else{if(e<=-0x8000000000000000)return t.MIN_VALUE;if(e+1>=0x8000000000000000)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%4294967296|0,e/4294967296|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t.ZERO;if("number"==typeof r?(n=r,r=!1):r=!!r,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return t.fromString(e.substring(1),r,n).neg();for(var o=t.fromNumber(Math.pow(n,8)),s=t.ZERO,a=0;a<e.length;a+=8){var u=Math.min(8,e.length-a),h=parseInt(e.substring(a,a+u),n);if(u<8){var f=t.fromNumber(Math.pow(n,u));s=s.mul(f).add(t.fromNumber(h))}else s=(s=s.mul(o)).add(t.fromNumber(h))}return s.unsigned=r,s},t.fromBytes=function(e,r,n){return n?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},t.isLong=function(t){return N(t)&&!0===t.__isLong__},t.fromValue=function(e,r){return"number"==typeof e?t.fromNumber(e,r):"string"==typeof e?t.fromString(e,r):t.fromBits(e.low,e.high,"boolean"==typeof r?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,h=0,f=0,c=0,l=0;return c+=(l+=o+(65535&e.low))>>>16,l&=65535,f+=(c+=i+u)>>>16,c&=65535,h+=(f+=n+a)>>>16,f&=65535,h+=r+s,h&=65535,t.fromBits(c<<16|l,h<<16|f,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(t){return this.compare(t)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(J){if(!this.unsigned&&-2147483648===this.high&&-1===e.low&&-1===e.high)return this;var r=(this.unsigned?J.div_u:J.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,J.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;o=t.UZERO}else{if(this.eq(t.MIN_VALUE))return e.eq(t.ONE)||e.eq(t.NEG_ONE)?t.MIN_VALUE:e.eq(t.MIN_VALUE)?t.ONE:(n=this.shr(1).div(e).shl(1)).eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),a=s<=48?1:Math.pow(2,s-48),u=t.fromNumber(n),h=u.mul(e);h.isNegative()||h.gt(i);)n-=a,h=(u=t.fromNumber(n,this.unsigned)).mul(e);u.isZero()&&(u=t.ONE),o=o.add(u),i=i.sub(h)}return o},t.prototype.div=function(t){return this.divide(t)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},t.prototype.eq=function(t){return this.equals(t)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e,r=0!==this.high?this.high:this.low;for(e=31;e>0&&0==(r&1<<e);e--);return 0!==this.high?e+33:e+1},t.prototype.greaterThan=function(t){return this.comp(t)>0},t.prototype.gt=function(t){return this.greaterThan(t)},t.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},t.prototype.gte=function(t){return this.greaterThanOrEqual(t)},t.prototype.ge=function(t){return this.greaterThanOrEqual(t)},t.prototype.isEven=function(){return 0==(1&this.low)},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return 1==(1&this.low)},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return 0===this.high&&0===this.low},t.prototype.lessThan=function(t){return this.comp(t)<0},t.prototype.lt=function(t){return this.lessThan(t)},t.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},t.prototype.lte=function(t){return this.lessThanOrEqual(t)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),J){var r=(this.unsigned?J.rem_u:J.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,J.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(t){return this.modulo(t)},t.prototype.rem=function(t){return this.modulo(t)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),J){var r=J.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,J.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,a=e.high>>>16,u=65535&e.high,h=e.low>>>16,f=65535&e.low,c=0,l=0,d=0,p=0;return d+=(p+=s*f)>>>16,p&=65535,l+=(d+=o*f)>>>16,d&=65535,l+=(d+=s*h)>>>16,d&=65535,c+=(l+=i*f)>>>16,l&=65535,c+=(l+=o*h)>>>16,l&=65535,c+=(l+=s*u)>>>16,l&=65535,c+=n*f+i*h+o*u+s*a,c&=65535,t.fromBits(d<<16|p,c<<16|l,this.unsigned)},t.prototype.mul=function(t){return this.multiply(t)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(t){return!this.equals(t)},t.prototype.neq=function(t){return this.notEquals(t)},t.prototype.ne=function(t){return this.notEquals(t)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(t){return this.shiftLeft(t)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(t){return this.shiftRight(t)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}return 32===e?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},t.prototype.shru=function(t){return this.shiftRightUnsigned(t)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(t){return this.subtract(t)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?4294967296*(this.high>>>0)+(this.low>>>0):4294967296*this.high+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var 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]},t.prototype.toBytesBE=function(){var 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]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(t.MIN_VALUE)){var r=t.fromNumber(e),n=this.div(r),i=n.mul(r).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,a="";;){var u=s.div(o),h=(s.sub(u.mul(o)).toInt()>>>0).toString(e);if((s=u).isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(t){return this.lessThanOrEqual(t)},t.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'+this.toString()+'"'+(this.unsigned?", true":"")+")"},t.TWO_PWR_24=t.fromInt(1<<24),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t}();Object.defineProperty(G.prototype,"__isLong__",{value:!0}),Object.defineProperty(G.prototype,"_bsontype",{value:"Long"});var X=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,tt=/^(\+|-)?(Infinity|inf)$/i,et=/^(\+|-)?NaN$/i,rt=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),nt=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),it=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),ot=/^([-+])?(\d+)?$/;function st(t){return!isNaN(parseInt(t,10))}function at(t){var e=G.fromNumber(1e9),r=G.fromNumber(0);if(!(t.parts[0]||t.parts[1]||t.parts[2]||t.parts[3]))return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=(r=r.shiftLeft(32)).add(new G(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function ut(t,e){throw new O('"'+t+'" is not a valid Decimal128 string - '+e)}var ht=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!P(e))throw new O("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new O("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(e){var r,n=!1,i=!1,o=!1,s=0,a=0,u=0,h=0,f=0,c=[0],l=0,d=0,p=0,y=0,m=0,b=0,v=new G(0,0),w=new G(0,0),_=0;if(e.length>=7e3)throw new O(e+" not a valid Decimal128 string");var M=e.match(X),S=e.match(tt),A=e.match(et);if(!M&&!S&&!A||0===e.length)throw new O(e+" not a valid Decimal128 string");if(M){var E=M[2],x=M[4],k=M[5],j=M[6];x&&void 0===j&&ut(e,"missing exponent power"),x&&void 0===E&&ut(e,"missing exponent base"),void 0===x&&(k||j)&&ut(e,"missing e before exponent")}if("+"!==e[_]&&"-"!==e[_]||(n="-"===e[_++]),!st(e[_])&&"."!==e[_]){if("i"===e[_]||"I"===e[_])return new t(g.from(n?nt:it));if("N"===e[_])return new t(g.from(rt))}for(;st(e[_])||"."===e[_];)"."!==e[_]?(l<34&&("0"!==e[_]||o)&&(o||(f=a),o=!0,c[d++]=parseInt(e[_],10),l+=1),o&&(u+=1),i&&(h+=1),a+=1,_+=1):(i&&ut(e,"contains multiple periods"),i=!0,_+=1);if(i&&!a)throw new O(e+" not a valid Decimal128 string");if("e"===e[_]||"E"===e[_]){var $=e.substr(++_).match(ot);if(!$||!$[2])return new t(g.from(rt));m=parseInt($[0],10),_+=$[0].length}if(e[_])return new t(g.from(rt));if(p=0,l){if(y=l-1,1!==(s=u))for(;0===c[f+s-1];)s-=1}else p=0,y=0,c[0]=0,u=1,l=1,s=0;for(m<=h&&h-m>16384?m=-6176:m-=h;m>6111;){if((y+=1)-p>34){if(c.join("").match(/^0+$/)){m=6111;break}ut(e,"overflow")}m-=1}for(;m<-6176||l<u;){if(0===y&&s<l){m=-6176,s=0;break}if(l<u?u-=1:y-=1,m<6111)m+=1;else{if(c.join("").match(/^0+$/)){m=6111;break}ut(e,"overflow")}}if(y-p+1<s){var P=a;i&&(f+=1,P+=1),n&&(f+=1,P+=1);var R=parseInt(e[f+y+1],10),B=0;if(R>=5&&(B=1,5===R))for(B=c[y]%2==1?1:0,b=f+y+2;b<P;b++)if(parseInt(e[b],10)){B=1;break}if(B)for(var T=y;T>=0;T--)if(++c[T]>9&&(c[T]=0,0===T)){if(!(m<6111))return new t(g.from(n?nt:it));m+=1,c[T]=1}}if(v=G.fromNumber(0),w=G.fromNumber(0),0===s)v=G.fromNumber(0),w=G.fromNumber(0);else if(y-p<17){T=p;for(w=G.fromNumber(c[T++]),v=new G(0,0);T<=y;T++)w=(w=w.multiply(G.fromNumber(10))).add(G.fromNumber(c[T]))}else{T=p;for(v=G.fromNumber(c[T++]);T<=y-17;T++)v=(v=v.multiply(G.fromNumber(10))).add(G.fromNumber(c[T]));for(w=G.fromNumber(c[T++]);T<=y;T++)w=(w=w.multiply(G.fromNumber(10))).add(G.fromNumber(c[T]))}var I,N,D,C,L=function(t,e){if(!t&&!e)return{high:G.fromNumber(0),low:G.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new G(t.getLowBits(),0),i=e.shiftRightUnsigned(32),o=new G(e.getLowBits(),0),s=r.multiply(i),a=r.multiply(o),u=n.multiply(i),h=n.multiply(o);return s=s.add(a.shiftRightUnsigned(32)),a=new G(a.getLowBits(),0).add(u).add(h.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:h=a.shiftLeft(32).add(new G(h.getLowBits(),0))}}(v,G.fromString("100000000000000000"));L.low=L.low.add(w),I=L.low,N=w,D=I.high>>>0,C=N.high>>>0,(D<C||D===C&&I.low>>>0<N.low>>>0)&&(L.high=L.high.add(G.fromNumber(1))),r=m+6176;var q={low:G.fromNumber(0),high:G.fromNumber(0)};L.high.shiftRightUnsigned(49).and(G.fromNumber(1)).equals(G.fromNumber(1))?(q.high=q.high.or(G.fromNumber(3).shiftLeft(61)),q.high=q.high.or(G.fromNumber(r).and(G.fromNumber(16383).shiftLeft(47))),q.high=q.high.or(L.high.and(G.fromNumber(0x7fffffffffff)))):(q.high=q.high.or(G.fromNumber(16383&r).shiftLeft(49)),q.high=q.high.or(L.high.and(G.fromNumber(562949953421311)))),q.low=L.low,n&&(q.high=q.high.or(G.fromString("9223372036854775808")));var U=g.alloc(16);return _=0,U[_++]=255&q.low.low,U[_++]=q.low.low>>8&255,U[_++]=q.low.low>>16&255,U[_++]=q.low.low>>24&255,U[_++]=255&q.low.high,U[_++]=q.low.high>>8&255,U[_++]=q.low.high>>16&255,U[_++]=q.low.high>>24&255,U[_++]=255&q.high.low,U[_++]=q.high.low>>8&255,U[_++]=q.high.low>>16&255,U[_++]=q.high.low>>24&255,U[_++]=255&q.high.high,U[_++]=q.high.high>>8&255,U[_++]=q.high.high>>16&255,U[_++]=q.high.high>>24&255,new t(U)},t.prototype.toString=function(){for(var t,e=0,r=new Array(36),n=0;n<r.length;n++)r[n]=0;var i,o,s,a=0,u=!1,h={parts:[0,0,0,0]},f=[];a=0;var c=this.bytes,l=c[a++]|c[a++]<<8|c[a++]<<16|c[a++]<<24,d=c[a++]|c[a++]<<8|c[a++]<<16|c[a++]<<24,p=c[a++]|c[a++]<<8|c[a++]<<16|c[a++]<<24,y=c[a++]|c[a++]<<8|c[a++]<<16|c[a++]<<24;a=0,{low:new G(l,d),high:new G(p,y)}.high.lessThan(G.ZERO)&&f.push("-");var m=y>>26&31;if(m>>3==3){if(30===m)return f.join("")+"Infinity";if(31===m)return"NaN";t=y>>15&16383,i=8+(y>>14&1)}else i=y>>14&7,t=y>>17&16383;var b=t-6176;if(h.parts[0]=(16383&y)+((15&i)<<14),h.parts[1]=p,h.parts[2]=d,h.parts[3]=l,0===h.parts[0]&&0===h.parts[1]&&0===h.parts[2]&&0===h.parts[3])u=!0;else for(s=3;s>=0;s--){var v=0,g=at(h);if(h=g.quotient,v=g.rem.low)for(o=8;o>=0;o--)r[9*s+o]=v%10,v=Math.floor(v/10)}if(u)e=1,r[a]=0;else for(e=36;!r[a];)e-=1,a+=1;var w=e-1+b;if(w>=34||w<=-7||b>0){if(e>34)return f.push("0"),b>0?f.push("E+"+b):b<0&&f.push("E"+b),f.join("");f.push(""+r[a++]),(e-=1)&&f.push(".");for(n=0;n<e;n++)f.push(""+r[a++]);f.push("E"),w>0?f.push("+"+w):f.push(""+w)}else if(b>=0)for(n=0;n<e;n++)f.push(""+r[a++]);else{var _=e+b;if(_>0)for(n=0;n<_;n++)f.push(""+r[a++]);else f.push("0");for(f.push(".");_++<0;)f.push("0");for(n=0;n<e-Math.max(_-1,0);n++)f.push(""+r[a++])}return f.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'+this.toString()+'")'},t}();Object.defineProperty(ht.prototype,"_bsontype",{value:"Decimal128"});var ft=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-"+this.value.toFixed(1)}:(Number.isInteger(this.value)?(e=this.value.toFixed(1)).length>=13&&(e=this.value.toExponential(13).toUpperCase()):e=this.value.toString(),{$numberDouble:e});var e},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Double("+this.toExtendedJSON().$numberDouble+")"},t}();Object.defineProperty(ft.prototype,"_bsontype",{value:"Double"});var ct=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=0|+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32("+this.valueOf()+")"},t}();Object.defineProperty(ct.prototype,"_bsontype",{value:"Int32"});var lt=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t}();Object.defineProperty(lt.prototype,"_bsontype",{value:"MaxKey"});var dt=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t}();Object.defineProperty(dt.prototype,"_bsontype",{value:"MinKey"});var pt=new RegExp("^[0-9a-fA-F]{24}$"),yt=null,mt=Symbol("id"),bt=function(){function t(e){if(!(this instanceof t))return new t(e);var r;if("object"===n(e)&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new O("Argument passed in must have an id that is of type string or Buffer");r="toHexString"in e&&"function"==typeof e.toHexString?g.from(e.toHexString(),"hex"):e.id}else r=e;if(null==r||"number"==typeof r)this[mt]=t.generate("number"==typeof r?r:void 0);else if(ArrayBuffer.isView(r)&&12===r.byteLength)this[mt]=C(r);else{if("string"!=typeof r)throw new O("Argument passed in does not match the accepted types");if(12===r.length){var i=g.from(r);if(12!==i.byteLength)throw new O("Argument passed in must be a string of 12 bytes");this[mt]=i}else{if(24!==r.length||!pt.test(r))throw new O("Argument passed in must be a string of 12 bytes or a string of 24 hex characters");this[mt]=g.from(r,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[mt]},set:function(e){this[mt]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=g.alloc(12);return n.writeUInt32BE(e,0),null===yt&&(yt=j(5)),n[4]=yt[0],n[5]=yt[1],n[6]=yt[2],n[7]=yt[3],n[8]=yt[4],n[11]=255&r,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){return null!=e&&(e instanceof t?this.toString()===e.toString():"string"==typeof e&&t.isValid(e)&&12===e.length&&P(this.id)?e===g.prototype.toString.call(this.id,"latin1"):"string"==typeof e&&t.isValid(e)&&24===e.length?e.toLowerCase()===this.toHexString():"string"==typeof e&&t.isValid(e)&&12===e.length?g.from(e).equals(this.id):"object"===n(e)&&"toHexString"in e&&"function"==typeof e.toHexString&&e.toHexString()===this.toHexString())},t.prototype.getTimestamp=function(){var t=new Date,e=this.id.readUInt32BE(0);return t.setTime(1e3*Math.floor(e)),t},t.createPk=function(){return new t},t.createFromTime=function(e){var r=g.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new O("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(g.from(e,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(t){return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'+this.toHexString()+'")'},t.index=Math.floor(16777215*Math.random()),t}();Object.defineProperty(bt.prototype,"generate",{value:D((function(t){return bt.generate(t)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(bt.prototype,"getInc",{value:D((function(){return bt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(bt.prototype,"get_inc",{value:D((function(){return bt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(bt,"get_inc",{value:D((function(){return bt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(bt.prototype,"_bsontype",{value:"ObjectID"});var vt=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=(null!=r?r:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new S("BSON Regex patterns cannot contain null bytes, found: "+JSON.stringify(this.pattern));if(-1!==this.options.indexOf("\0"))throw new S("BSON Regex options cannot contain null bytes, found: "+JSON.stringify(this.options));for(var n=0;n<this.options.length;n++)if("i"!==this.options[n]&&"m"!==this.options[n]&&"x"!==this.options[n]&&"l"!==this.options[n]&&"s"!==this.options[n]&&"u"!==this.options[n])throw new S("The regular expression option ["+this.options[n]+"] is not supported")}return t.parseOptions=function(t){return t?t.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(t){return(t=t||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e){if("string"==typeof e.$regex)return new t(e.$regex,t.parseOptions(e.$options));if("BSONRegExp"===e.$regex._bsontype)return e}if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new O("Unexpected BSONRegExp EJSON object form: "+JSON.stringify(e))},t}();Object.defineProperty(vt.prototype,"_bsontype",{value:"BSONRegExp"});var gt=function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'+this.value+'")'},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t}();Object.defineProperty(gt.prototype,"_bsontype",{value:"Symbol"});var wt=G,_t=function(t){function e(r,n){var i=this;return i instanceof e?(i=G.isLong(r)?t.call(this,r.low,r.high,!0)||this:N(r)&&void 0!==r.t&&void 0!==r.i?t.call(this,r.i,r.t,!0)||this:t.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new e(r,n)}return _(e,t),e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(t){return new e(G.fromInt(t,!0))},e.fromNumber=function(t){return new e(G.fromNumber(t,!0))},e.fromBits=function(t,r){return new e(t,r)},e.fromString=function(t,r){return new e(G.fromString(t,!0,r))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(t){return new e(t.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: "+this.getHighBits()+", i: "+this.getLowBits()+" })"},e.MAX_VALUE=G.MAX_UNSIGNED_VALUE,e}(wt);function Mt(t){return N(t)&&Reflect.has(t,"_bsontype")&&"string"==typeof t._bsontype}var St={$oid:bt,$binary:K,$uuid:K,$symbol:gt,$numberInt:ct,$numberDecimal:ht,$numberDouble:ft,$numberLong:G,$minKey:dt,$maxKey:lt,$regex:vt,$regularExpression:vt,$timestamp:_t};function Ot(t){var e=t.toISOString();return 0!==t.getUTCMilliseconds()?e:e.slice(0,-5)+"Z"}function At(t,e){if(("object"===n(t)||"function"==typeof t)&&null!==t){var r=e.seenObjects.findIndex((function(e){return e.obj===t}));if(-1!==r){var i=e.seenObjects.map((function(t){return t.propertyName})),o=i.slice(0,r).map((function(t){return t+" -> "})).join(""),s=i[r],a=" -> "+i.slice(r+1,i.length-1).map((function(t){return t+" -> "})).join(""),u=i[i.length-1],h=" ".repeat(o.length+s.length/2),f="-".repeat(a.length+(s.length+u.length)/2-1);throw new O("Converting circular structure to EJSON:\n "+o+s+a+u+"\n "+h+"\\"+f+"/")}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return function(t,e){return t.map((function(t,r){e.seenObjects.push({propertyName:"index "+r,obj:null});try{return At(t,e)}finally{e.seenObjects.pop()}}))}(t,e);if(void 0===t)return null;if(t instanceof Date||I(t)){var c=t.getTime(),l=c>-1&&c<2534023188e5;return e.legacy?e.relaxed&&l?{$date:t.getTime()}:{$date:Ot(t)}:e.relaxed&&l?{$date:Ot(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(!("number"!=typeof t||e.relaxed&&isFinite(t))){if(Math.floor(t)===t){var d=t>=-0x8000000000000000&&t<=0x8000000000000000;if(t>=-2147483648&&t<=2147483647)return{$numberInt:t.toString()};if(d)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||T(t)){var p=t.flags;if(void 0===p){var y=t.toString().match(/[gimuy]*$/);y&&(p=y[0])}return new vt(t.source,p).toExtendedJSON(e)}return null!=t&&"object"===n(t)?function(t,e){if(null==t||"object"!==n(t))throw new S("not an object instance");var r=t._bsontype;if(void 0===r){var i={};for(var o in t){e.seenObjects.push({propertyName:o,obj:null});try{i[o]=At(t[o],e)}finally{e.seenObjects.pop()}}return i}if(Mt(t)){var s=t;if("function"!=typeof s.toExtendedJSON){var a=kt[t._bsontype];if(!a)throw new O("Unrecognized or invalid _bsontype: "+t._bsontype);s=a(s)}return"Code"===r&&s.scope?s=new H(s.code,At(s.scope,e)):"DBRef"===r&&s.oid&&(s=new W(At(s.collection,e),At(s.oid,e),At(s.db,e),At(s.fields,e))),s.toExtendedJSON(e)}throw new S("_bsontype must be a string, but was: "+n(r))}(t,e):t}var Et,xt,kt={Binary:function(t){return new K(t.value(),t.sub_type)},Code:function(t){return new H(t.code,t.scope)},DBRef:function(t){return new W(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new ht(t.bytes)},Double:function(t){return new ft(t.value)},Int32:function(t){return new ct(t.value)},Long:function(t){return G.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_)},MaxKey:function(){return new lt},MinKey:function(){return new dt},ObjectID:function(t){return new bt(t)},ObjectId:function(t){return new bt(t)},BSONRegExp:function(t){return new vt(t.pattern,t.options)},Symbol:function(t){return new gt(t.value)},Timestamp:function(t){return _t.fromBits(t.low,t.high)}};!function(t){function e(t,e){var r=Object.assign({},{relaxed:!0,legacy:!1},e);return"boolean"==typeof r.relaxed&&(r.strict=!r.relaxed),"boolean"==typeof r.strict&&(r.relaxed=!r.strict),JSON.parse(t,(function(t,e){if(-1!==t.indexOf("\0"))throw new S("BSON Document field names cannot contain null bytes, found: "+JSON.stringify(t));return function t(e,r){if(void 0===r&&(r={}),"number"==typeof e){if(r.relaxed||r.legacy)return e;if(Math.floor(e)===e){if(e>=-2147483648&&e<=2147483647)return new ct(e);if(e>=-0x8000000000000000&&e<=0x8000000000000000)return G.fromNumber(e)}return new ft(e)}if(null==e||"object"!==n(e))return e;if(e.$undefined)return null;for(var i=Object.keys(e).filter((function(t){return t.startsWith("$")&&null!=e[t]})),o=0;o<i.length;o++){var s=St[i[o]];if(s)return s.fromExtendedJSON(e,r)}if(null!=e.$date){var a=e.$date,u=new Date;return r.legacy?"number"==typeof a?u.setTime(a):"string"==typeof a&&u.setTime(Date.parse(a)):"string"==typeof a?u.setTime(Date.parse(a)):G.isLong(a)?u.setTime(a.toNumber()):"number"==typeof a&&r.relaxed&&u.setTime(a),u}if(null!=e.$code){var h=Object.assign({},e);return e.$scope&&(h.$scope=t(e.$scope)),H.fromExtendedJSON(e)}if(Z(e)||e.$dbPointer){var f=e.$ref?e:e.$dbPointer;if(f instanceof W)return f;var c=Object.keys(f).filter((function(t){return t.startsWith("$")})),l=!0;if(c.forEach((function(t){-1===["$ref","$id","$db"].indexOf(t)&&(l=!1)})),l)return W.fromExtendedJSON(f)}return e}(e,r)}))}function r(t,e,r,i){null!=r&&"object"===n(r)&&(i=r,r=0),null==e||"object"!==n(e)||Array.isArray(e)||(i=e,e=void 0,r=0);var o=At(t,Object.assign({relaxed:!0,legacy:!1},i,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(o,e,r)}t.parse=e,t.stringify=r,t.serialize=function(t,e){return e=e||{},JSON.parse(r(t,e))},t.deserialize=function(t,r){return r=r||{},e(JSON.stringify(t),r)}}(Et||(Et={}));var jt=E();xt=jt.Map?jt.Map:function(){function t(t){void 0===t&&(t=[]),this._keys=[],this._values={};for(var e=0;e<t.length;e++)if(null!=t[e]){var r=t[e],n=r[0],i=r[1];this._keys.push(n),this._values[n]={v:i,i:this._keys.length-1}}}return t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(t){var e=this._values[t];return null!=e&&(delete this._values[t],this._keys.splice(e.i,1),!0)},t.prototype.entries=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?[r,t._values[r].v]:void 0,done:void 0===r}}}},t.prototype.forEach=function(t,e){e=e||this;for(var r=0;r<this._keys.length;r++){var n=this._keys[r];t.call(e,this._values[n].v,n,e)}},t.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},t.prototype.has=function(t){return null!=this._values[t]},t.prototype.keys=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?r:void 0,done:void 0===r}}}},t.prototype.set=function(t,e){return this._values[t]?(this._values[t].v=e,this):(this._keys.push(t),this._values[t]={v:e,i:this._keys.length-1},this)},t.prototype.values=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?t._values[r].v:void 0,done:void 0===r}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),t}();var $t=2147483647,Pt=-2147483648,Rt=Math.pow(2,63)-1,Bt=-Math.pow(2,63),Tt=Math.pow(2,53),It=-Math.pow(2,53),Nt=1,Dt=2,Ct=3,Lt=4,qt=5,Ut=6,Ft=7,zt=8,Vt=9,Kt=10,Ht=11,Zt=12,Wt=13,Jt=14,Yt=15,Qt=16,Gt=17,Xt=18,te=19,ee=255,re=127,ne=0,ie=1,oe=2,se=3,ae=4,ue=5,he=6,fe=7,ce=128;function le(t,e,r){var n=5;if(Array.isArray(t))for(var i=0;i<t.length;i++)n+=de(i.toString(),t[i],e,!0,r);else for(var o in"function"==typeof(null==t?void 0:t.toBSON)&&(t=t.toBSON()),t)n+=de(o,t[o],e,!1,r);return n}function de(t,e,r,i,o){switch(void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===o&&(o=!1),"function"==typeof(null==e?void 0:e.toBSON)&&(e=e.toBSON()),n(e)){case"string":return 1+g.byteLength(t,"utf8")+1+4+g.byteLength(e,"utf8")+1;case"number":return Math.floor(e)===e&&e>=It&&e<=Tt&&e>=Pt&&e<=$t?(null!=t?g.byteLength(t,"utf8")+1:0)+5:(null!=t?g.byteLength(t,"utf8")+1:0)+9;case"undefined":return i||!o?(null!=t?g.byteLength(t,"utf8")+1:0)+1:0;case"boolean":return(null!=t?g.byteLength(t,"utf8")+1:0)+2;case"object":if(null==e||"MinKey"===e._bsontype||"MaxKey"===e._bsontype)return(null!=t?g.byteLength(t,"utf8")+1:0)+1;if("ObjectId"===e._bsontype||"ObjectID"===e._bsontype)return(null!=t?g.byteLength(t,"utf8")+1:0)+13;if(e instanceof Date||I(e))return(null!=t?g.byteLength(t,"utf8")+1:0)+9;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||$(e))return(null!=t?g.byteLength(t,"utf8")+1:0)+6+e.byteLength;if("Long"===e._bsontype||"Double"===e._bsontype||"Timestamp"===e._bsontype)return(null!=t?g.byteLength(t,"utf8")+1:0)+9;if("Decimal128"===e._bsontype)return(null!=t?g.byteLength(t,"utf8")+1:0)+17;if("Code"===e._bsontype)return null!=e.scope&&Object.keys(e.scope).length>0?(null!=t?g.byteLength(t,"utf8")+1:0)+1+4+4+g.byteLength(e.code.toString(),"utf8")+1+le(e.scope,r,o):(null!=t?g.byteLength(t,"utf8")+1:0)+1+4+g.byteLength(e.code.toString(),"utf8")+1;if("Binary"===e._bsontype)return e.sub_type===K.SUBTYPE_BYTE_ARRAY?(null!=t?g.byteLength(t,"utf8")+1:0)+(e.position+1+4+1+4):(null!=t?g.byteLength(t,"utf8")+1:0)+(e.position+1+4+1);if("Symbol"===e._bsontype)return(null!=t?g.byteLength(t,"utf8")+1:0)+g.byteLength(e.value,"utf8")+4+1+1;if("DBRef"===e._bsontype){var s=Object.assign({$ref:e.collection,$id:e.oid},e.fields);return null!=e.db&&(s.$db=e.db),(null!=t?g.byteLength(t,"utf8")+1:0)+1+le(s,r,o)}return e instanceof RegExp||T(e)?(null!=t?g.byteLength(t,"utf8")+1:0)+1+g.byteLength(e.source,"utf8")+1+(e.global?1:0)+(e.ignoreCase?1:0)+(e.multiline?1:0)+1:"BSONRegExp"===e._bsontype?(null!=t?g.byteLength(t,"utf8")+1:0)+1+g.byteLength(e.pattern,"utf8")+1+g.byteLength(e.options,"utf8")+1:(null!=t?g.byteLength(t,"utf8")+1:0)+le(e,r,o)+1;case"function":if(e instanceof RegExp||T(e)||"[object RegExp]"===String.call(e))return(null!=t?g.byteLength(t,"utf8")+1:0)+1+g.byteLength(e.source,"utf8")+1+(e.global?1:0)+(e.ignoreCase?1:0)+(e.multiline?1:0)+1;if(r&&null!=e.scope&&Object.keys(e.scope).length>0)return(null!=t?g.byteLength(t,"utf8")+1:0)+1+4+4+g.byteLength(x(e),"utf8")+1+le(e.scope,r,o);if(r)return(null!=t?g.byteLength(t,"utf8")+1:0)+1+4+g.byteLength(x(e),"utf8")+1}return 0}function pe(t,e,r){for(var n=0,i=e;i<r;i+=1){var o=t[i];if(n){if(128!=(192&o))return!1;n-=1}else if(128&o)if(192==(224&o))n=1;else if(224==(240&o))n=2;else{if(240!=(248&o))return!1;n=3}}return!n}var ye=G.fromNumber(Tt),me=G.fromNumber(It),be={};function ve(t,e,r){var n=(e=null==e?{}:e)&&e.index?e.index:0,i=t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24;if(i<5)throw new S("bson size must be >= 5, is "+i);if(e.allowObjectSmallerThanBufferSize&&t.length<i)throw new S("buffer length "+t.length+" must be >= bson size "+i);if(!e.allowObjectSmallerThanBufferSize&&t.length!==i)throw new S("buffer length "+t.length+" must === bson size "+i);if(i+n>t.byteLength)throw new S("(bson size "+i+" + options.index "+n+" must be <= buffer length "+t.byteLength+")");if(0!==t[n+i-1])throw new S("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return function t(e,r,n,i){void 0===i&&(i=!1);var o,s=null!=n.evalFunctions&&n.evalFunctions,a=null!=n.cacheFunctions&&n.cacheFunctions,u=null==n.fieldsAsRaw?null:n.fieldsAsRaw,h=null!=n.raw&&n.raw,f="boolean"==typeof n.bsonRegExp&&n.bsonRegExp,c=null!=n.promoteBuffers&&n.promoteBuffers,l=null==n.promoteLongs||n.promoteLongs,d=null==n.promoteValues||n.promoteValues,p=null==n.validation?{utf8:!0}:n.validation,y=!0,m=new Set,b=p.utf8;if("boolean"==typeof b)o=b;else{y=!1;var v=Object.keys(b).map((function(t){return b[t]}));if(0===v.length)throw new S("UTF-8 validation setting cannot be empty");if("boolean"!=typeof v[0])throw new S("Invalid UTF-8 validation option, must specify boolean values");if(o=v[0],!v.every((function(t){return t===o})))throw new S("Invalid UTF-8 validation option - keys must be all true or all false")}if(!y)for(var w=0,_=Object.keys(b);w<_.length;w++){var O=_[w];m.add(O)}var A=r;if(e.length<5)throw new S("corrupt bson message < 5 bytes long");var E=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;if(E<5||E>e.length)throw new S("corrupt bson message");var x=i?[]:{},k=0,j=!i&&null;for(;;){var $=e[r++];if(0===$)break;for(var P=r;0!==e[P]&&P<e.length;)P++;if(P>=e.byteLength)throw new S("Bad BSON Document: illegal CString");var R=i?k++:e.toString("utf8",r,P),B=!0;B=y||m.has(R)?o:!o,!1!==j&&"$"===R[0]&&(j=ge.test(R));var T=void 0;if(r=P+1,$===Dt){if((pt=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24)<=0||pt>e.length-r||0!==e[r+pt-1])throw new S("bad string length in bson");T=_e(e,r,r+pt-1,B),r+=pt}else if($===Ft){var I=g.alloc(12);e.copy(I,0,r,r+12),T=new bt(I),r+=12}else if($===Qt&&!1===d)T=new ct(e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24);else if($===Qt)T=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;else if($===Nt&&!1===d)T=new ft(e.readDoubleLE(r)),r+=8;else if($===Nt)T=e.readDoubleLE(r),r+=8;else if($===Vt){var N=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24,D=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;T=new Date(new G(N,D).toNumber())}else if($===zt){if(0!==e[r]&&1!==e[r])throw new S("illegal boolean type value");T=1===e[r++]}else if($===Ct){var C=r;if((q=e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24)<=0||q>e.length-r)throw new S("bad embedded document length in bson");if(h)T=e.slice(r,r+q);else{var L=n;y||(L=M(M({},n),{validation:{utf8:B}})),T=t(e,C,L,!1)}r+=q}else if($===Lt){C=r;var q=e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24,U=n,F=r+q;if(u&&u[R]){for(var z in U={},n)U[z]=n[z];U.raw=!0}if(y||(U=M(M({},U),{validation:{utf8:B}})),T=t(e,C,U,!0),0!==e[(r+=q)-1])throw new S("invalid array terminator byte");if(r!==F)throw new S("corrupted array bson")}else if($===Ut)T=void 0;else if($===Kt)T=null;else if($===Xt){N=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24,D=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;var V=new G(N,D);T=l&&!0===d&&V.lessThanOrEqual(ye)&&V.greaterThanOrEqual(me)?V.toNumber():V}else if($===te){var J=g.alloc(16);e.copy(J,0,r,r+16),r+=16;var Y=new ht(J);T="toObject"in Y&&"function"==typeof Y.toObject?Y.toObject():Y}else if($===qt){var Q=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24,X=Q,tt=e[r++];if(Q<0)throw new S("Negative binary type element size found");if(Q>e.byteLength)throw new S("Binary type size larger than document size");if(null!=e.slice){if(tt===K.SUBTYPE_BYTE_ARRAY){if((Q=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24)<0)throw new S("Negative binary type element size found for subtype 0x02");if(Q>X-4)throw new S("Binary type with subtype 0x02 contains too long binary size");if(Q<X-4)throw new S("Binary type with subtype 0x02 contains too short binary size")}T=c&&d?e.slice(r,r+Q):new K(e.slice(r,r+Q),tt)}else{var et=g.alloc(Q);if(tt===K.SUBTYPE_BYTE_ARRAY){if((Q=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24)<0)throw new S("Negative binary type element size found for subtype 0x02");if(Q>X-4)throw new S("Binary type with subtype 0x02 contains too long binary size");if(Q<X-4)throw new S("Binary type with subtype 0x02 contains too short binary size")}for(P=0;P<Q;P++)et[P]=e[r+P];T=c&&d?et:new K(et,tt)}r+=Q}else if($===Ht&&!1===f){for(P=r;0!==e[P]&&P<e.length;)P++;if(P>=e.length)throw new S("Bad BSON Document: illegal CString");var rt=e.toString("utf8",r,P);for(P=r=P+1;0!==e[P]&&P<e.length;)P++;if(P>=e.length)throw new S("Bad BSON Document: illegal CString");var nt=e.toString("utf8",r,P);r=P+1;var it=new Array(nt.length);for(P=0;P<nt.length;P++)switch(nt[P]){case"m":it[P]="m";break;case"s":it[P]="g";break;case"i":it[P]="i"}T=new RegExp(rt,it.join(""))}else if($===Ht&&!0===f){for(P=r;0!==e[P]&&P<e.length;)P++;if(P>=e.length)throw new S("Bad BSON Document: illegal CString");rt=e.toString("utf8",r,P);for(P=r=P+1;0!==e[P]&&P<e.length;)P++;if(P>=e.length)throw new S("Bad BSON Document: illegal CString");nt=e.toString("utf8",r,P);r=P+1,T=new vt(rt,nt)}else if($===Jt){if((pt=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24)<=0||pt>e.length-r||0!==e[r+pt-1])throw new S("bad string length in bson");var ot=_e(e,r,r+pt-1,B);T=d?ot:new gt(ot),r+=pt}else if($===Gt){N=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24,D=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;T=new _t(N,D)}else if($===ee)T=new dt;else if($===re)T=new lt;else if($===Wt){if((pt=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24)<=0||pt>e.length-r||0!==e[r+pt-1])throw new S("bad string length in bson");var st=_e(e,r,r+pt-1,B);T=s?a?we(st,be,x):we(st):new H(st),r+=pt}else if($===Yt){var at=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;if(at<13)throw new S("code_w_scope total size shorter minimum expected length");if((pt=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24)<=0||pt>e.length-r||0!==e[r+pt-1])throw new S("bad string length in bson");st=_e(e,r,r+pt-1,B),C=r+=pt,q=e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24;var ut=t(e,C,n,!1);if(r+=q,at<8+q+pt)throw new S("code_w_scope total size is too short, truncating scope");if(at>8+q+pt)throw new S("code_w_scope total size is too long, clips outer document");s?(T=a?we(st,be,x):we(st)).scope=ut:T=new H(st,ut)}else{if($!==Zt)throw new S("Detected unknown BSON type "+$.toString(16)+' for fieldname "'+R+'"');var pt;if((pt=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24)<=0||pt>e.length-r||0!==e[r+pt-1])throw new S("bad string length in bson");if(null!=p&&p.utf8&&!pe(e,r,r+pt-1))throw new S("Invalid UTF-8 string in BSON document");var yt=e.toString("utf8",r,r+pt-1);r+=pt;var mt=g.alloc(12);e.copy(mt,0,r,r+12);I=new bt(mt);r+=12,T=new W(yt,I)}"__proto__"===R?Object.defineProperty(x,R,{value:T,writable:!0,enumerable:!0,configurable:!0}):x[R]=T}if(E!==r-A){if(i)throw new S("corrupt array bson");throw new S("corrupt object bson")}if(!j)return x;if(Z(x)){var wt=Object.assign({},x);return delete wt.$ref,delete wt.$id,delete wt.$db,new W(x.$ref,x.$id,x.$db,wt)}return x}(t,n,e,r)}var ge=/^\$ref$|^\$id$|^\$db$/;function we(t,e,r){return e?(null==e[t]&&(e[t]=new Function(t)),e[t].bind(r)):new Function(t)}function _e(t,e,r,n){var i=t.toString("utf8",e,r);if(n)for(var o=0;o<i.length;o++)if(65533===i.charCodeAt(o)){if(!pe(t,e,r))throw new S("Invalid UTF-8 string in BSON document");break}return i}function Me(t,e,r,n,i,o){var s,a,u,h="big"===n,f=8*o-i-1,c=(1<<f)-1,l=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=h?o-1:0,y=h?-1:1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=c?(a=0,s=c):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0)),isNaN(e)&&(a=0);i>=8;)t[r+p]=255&a,p+=y,a/=256,i-=8;for(s=s<<i|a,isNaN(e)&&(s+=8),f+=i;f>0;)t[r+p]=255&s,p+=y,s/=256,f-=8;t[r+p-y]|=128*m}var Se=/\x00/,Oe=new Set(["$db","$ref","$id","$clusterTime"]);function Ae(t,e,r,n,i){t[n++]=Dt;var o=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8");t[(n=n+o+1)-1]=0;var s=t.write(r,n+4,void 0,"utf8");return t[n+3]=s+1>>24&255,t[n+2]=s+1>>16&255,t[n+1]=s+1>>8&255,t[n]=s+1&255,n=n+4+s,t[n++]=0,n}function Ee(t,e,r,n,i){Number.isInteger(r)&&r>=Pt&&r<=$t?(t[n++]=Qt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,t[n++]=255&r,t[n++]=r>>8&255,t[n++]=r>>16&255,t[n++]=r>>24&255):(t[n++]=Nt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,Me(t,r,n,"little",52,8),n+=8);return n}function xe(t,e,r,n,i){return t[n++]=Kt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,n}function ke(t,e,r,n,i){return t[n++]=zt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,t[n++]=r?1:0,n}function je(t,e,r,n,i){t[n++]=Vt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var o=G.fromNumber(r.getTime()),s=o.getLowBits(),a=o.getHighBits();return t[n++]=255&s,t[n++]=s>>8&255,t[n++]=s>>16&255,t[n++]=s>>24&255,t[n++]=255&a,t[n++]=a>>8&255,t[n++]=a>>16&255,t[n++]=a>>24&255,n}function $e(t,e,r,n,i){if(t[n++]=Ht,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,r.source&&null!=r.source.match(Se))throw Error("value "+r.source+" must not contain null bytes");return n+=t.write(r.source,n,void 0,"utf8"),t[n++]=0,r.ignoreCase&&(t[n++]=105),r.global&&(t[n++]=115),r.multiline&&(t[n++]=109),t[n++]=0,n}function Pe(t,e,r,n,i){if(t[n++]=Ht,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,null!=r.pattern.match(Se))throw Error("pattern "+r.pattern+" must not contain null bytes");return n+=t.write(r.pattern,n,void 0,"utf8"),t[n++]=0,n+=t.write(r.options.split("").sort().join(""),n,void 0,"utf8"),t[n++]=0,n}function Re(t,e,r,n,i){return null===r?t[n++]=Kt:"MinKey"===r._bsontype?t[n++]=ee:t[n++]=re,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,n}function Be(t,e,r,n,i){if(t[n++]=Ft,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,"string"==typeof r.id)t.write(r.id,n,void 0,"binary");else{if(!P(r.id))throw new O("object ["+JSON.stringify(r)+"] is not a valid ObjectId");t.set(r.id.subarray(0,12),n)}return n+12}function Te(t,e,r,n,i){t[n++]=qt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var o=r.length;return t[n++]=255&o,t[n++]=o>>8&255,t[n++]=o>>16&255,t[n++]=o>>24&255,t[n++]=ne,t.set(C(r),n),n+=o}function Ie(t,e,r,n,i,o,s,a,u,h){void 0===i&&(i=!1),void 0===o&&(o=0),void 0===s&&(s=!1),void 0===a&&(a=!0),void 0===u&&(u=!1),void 0===h&&(h=[]);for(var f=0;f<h.length;f++)if(h[f]===r)throw new S("cyclic dependency detected");h.push(r),t[n++]=Array.isArray(r)?Lt:Ct,n+=u?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var c=Ke(t,r,i,n,o+1,s,a,h);return h.pop(),c}function Ne(t,e,r,n,i){return t[n++]=te,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,t.set(r.bytes.subarray(0,16),n),n+16}function De(t,e,r,n,i){t[n++]="Long"===r._bsontype?Xt:Gt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var o=r.getLowBits(),s=r.getHighBits();return t[n++]=255&o,t[n++]=o>>8&255,t[n++]=o>>16&255,t[n++]=o>>24&255,t[n++]=255&s,t[n++]=s>>8&255,t[n++]=s>>16&255,t[n++]=s>>24&255,n}function Ce(t,e,r,n,i){return r=r.valueOf(),t[n++]=Qt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,t[n++]=255&r,t[n++]=r>>8&255,t[n++]=r>>16&255,t[n++]=r>>24&255,n}function Le(t,e,r,n,i){return t[n++]=Nt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0,Me(t,r.value,n,"little",52,8),n+=8}function qe(t,e,r,n,i,o,s){t[n++]=Wt,n+=s?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var a=x(r),u=t.write(a,n+4,void 0,"utf8")+1;return t[n]=255&u,t[n+1]=u>>8&255,t[n+2]=u>>16&255,t[n+3]=u>>24&255,n=n+4+u-1,t[n++]=0,n}function Ue(t,e,r,i,o,s,a,u,h){if(void 0===o&&(o=!1),void 0===s&&(s=0),void 0===a&&(a=!1),void 0===u&&(u=!0),void 0===h&&(h=!1),r.scope&&"object"===n(r.scope)){t[i++]=Yt,i+=h?t.write(e,i,void 0,"ascii"):t.write(e,i,void 0,"utf8"),t[i++]=0;var f=i,c="string"==typeof r.code?r.code:r.code.toString();i+=4;var l=t.write(c,i+4,void 0,"utf8")+1;t[i]=255&l,t[i+1]=l>>8&255,t[i+2]=l>>16&255,t[i+3]=l>>24&255,t[i+4+l-1]=0,i=i+l+4;var d=Ke(t,r.scope,o,i,s+1,a,u);i=d-1;var p=d-f;t[f++]=255&p,t[f++]=p>>8&255,t[f++]=p>>16&255,t[f++]=p>>24&255,t[i++]=0}else{t[i++]=Wt,i+=h?t.write(e,i,void 0,"ascii"):t.write(e,i,void 0,"utf8"),t[i++]=0;c=r.code.toString();var y=t.write(c,i+4,void 0,"utf8")+1;t[i]=255&y,t[i+1]=y>>8&255,t[i+2]=y>>16&255,t[i+3]=y>>24&255,i=i+4+y-1,t[i++]=0}return i}function Fe(t,e,r,n,i){t[n++]=qt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var o=r.value(!0),s=r.position;return r.sub_type===K.SUBTYPE_BYTE_ARRAY&&(s+=4),t[n++]=255&s,t[n++]=s>>8&255,t[n++]=s>>16&255,t[n++]=s>>24&255,t[n++]=r.sub_type,r.sub_type===K.SUBTYPE_BYTE_ARRAY&&(s-=4,t[n++]=255&s,t[n++]=s>>8&255,t[n++]=s>>16&255,t[n++]=s>>24&255),t.set(o,n),n+=r.position}function ze(t,e,r,n,i){t[n++]=Jt,n+=i?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var o=t.write(r.value,n+4,void 0,"utf8")+1;return t[n]=255&o,t[n+1]=o>>8&255,t[n+2]=o>>16&255,t[n+3]=o>>24&255,n=n+4+o-1,t[n++]=0,n}function Ve(t,e,r,n,i,o,s){t[n++]=Ct,n+=s?t.write(e,n,void 0,"ascii"):t.write(e,n,void 0,"utf8"),t[n++]=0;var a=n,u={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(u.$db=r.db);var h=Ke(t,u=Object.assign(u,r.fields),!1,n,i+1,o),f=h-a;return t[a++]=255&f,t[a++]=f>>8&255,t[a++]=f>>16&255,t[a++]=f>>24&255,h}function Ke(t,e,r,i,o,s,a,u){void 0===r&&(r=!1),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=!1),void 0===a&&(a=!0),void 0===u&&(u=[]),i=i||0,(u=u||[]).push(e);var h,f=i+4;if(Array.isArray(e))for(var c=0;c<e.length;c++){var l=""+c;if("function"==typeof(null==(b=e[c])?void 0:b.toBSON)&&(b=b.toBSON()),"string"==typeof b)f=Ae(t,l,b,f,!0);else if("number"==typeof b)f=Ee(t,l,b,f,!0);else{if("bigint"==typeof b)throw new O("Unsupported type BigInt, please use Decimal128");if("boolean"==typeof b)f=ke(t,l,b,f,!0);else if(b instanceof Date||I(b))f=je(t,l,b,f,!0);else if(void 0===b)f=xe(t,l,0,f,!0);else if(null===b)f=xe(t,l,0,f,!0);else if("ObjectId"===b._bsontype||"ObjectID"===b._bsontype)f=Be(t,l,b,f,!0);else if(P(b))f=Te(t,l,b,f,!0);else if(b instanceof RegExp||T(b))f=$e(t,l,b,f,!0);else if("object"===n(b)&&null==b._bsontype)f=Ie(t,l,b,f,r,o,s,a,!0,u);else if("object"===n(b)&&Mt(b)&&"Decimal128"===b._bsontype)f=Ne(t,l,b,f,!0);else if("Long"===b._bsontype||"Timestamp"===b._bsontype)f=De(t,l,b,f,!0);else if("Double"===b._bsontype)f=Le(t,l,b,f,!0);else if("function"==typeof b&&s)f=qe(t,l,b,f,0,0,!0);else if("Code"===b._bsontype)f=Ue(t,l,b,f,r,o,s,a,!0);else if("Binary"===b._bsontype)f=Fe(t,l,b,f,!0);else if("Symbol"===b._bsontype)f=ze(t,l,b,f,!0);else if("DBRef"===b._bsontype)f=Ve(t,l,b,f,o,s,!0);else if("BSONRegExp"===b._bsontype)f=Pe(t,l,b,f,!0);else if("Int32"===b._bsontype)f=Ce(t,l,b,f,!0);else if("MinKey"===b._bsontype||"MaxKey"===b._bsontype)f=Re(t,l,b,f,!0);else if(void 0!==b._bsontype)throw new O("Unrecognized or invalid _bsontype: "+b._bsontype)}}else if(e instanceof xt||(h=e,"[object Map]"===Object.prototype.toString.call(h)))for(var d=e.entries(),p=!1;!p;){var y=d.next();if(!(p=!!y.done)){l=y.value[0];var m=n(b=y.value[1]);if("string"==typeof l&&!Oe.has(l)){if(null!=l.match(Se))throw Error("key "+l+" must not contain null bytes");if(r){if("$"===l[0])throw Error("key "+l+" must not start with '$'");if(~l.indexOf("."))throw Error("key "+l+" must not contain '.'")}}if("string"===m)f=Ae(t,l,b,f);else if("number"===m)f=Ee(t,l,b,f);else{if("bigint"===m||R(b)||B(b))throw new O("Unsupported type BigInt, please use Decimal128");if("boolean"===m)f=ke(t,l,b,f);else if(b instanceof Date||I(b))f=je(t,l,b,f);else if(null===b||void 0===b&&!1===a)f=xe(t,l,0,f);else if("ObjectId"===b._bsontype||"ObjectID"===b._bsontype)f=Be(t,l,b,f);else if(P(b))f=Te(t,l,b,f);else if(b instanceof RegExp||T(b))f=$e(t,l,b,f);else if("object"===m&&null==b._bsontype)f=Ie(t,l,b,f,r,o,s,a,!1,u);else if("object"===m&&"Decimal128"===b._bsontype)f=Ne(t,l,b,f);else if("Long"===b._bsontype||"Timestamp"===b._bsontype)f=De(t,l,b,f);else if("Double"===b._bsontype)f=Le(t,l,b,f);else if("Code"===b._bsontype)f=Ue(t,l,b,f,r,o,s,a);else if("function"==typeof b&&s)f=qe(t,l,b,f,0,0,s);else if("Binary"===b._bsontype)f=Fe(t,l,b,f);else if("Symbol"===b._bsontype)f=ze(t,l,b,f);else if("DBRef"===b._bsontype)f=Ve(t,l,b,f,o,s);else if("BSONRegExp"===b._bsontype)f=Pe(t,l,b,f);else if("Int32"===b._bsontype)f=Ce(t,l,b,f);else if("MinKey"===b._bsontype||"MaxKey"===b._bsontype)f=Re(t,l,b,f);else if(void 0!==b._bsontype)throw new O("Unrecognized or invalid _bsontype: "+b._bsontype)}}}else{if("function"==typeof(null==e?void 0:e.toBSON)&&null!=(e=e.toBSON())&&"object"!==n(e))throw new O("toBSON function did not return an object");for(var l in e){var b;"function"==typeof(null==(b=e[l])?void 0:b.toBSON)&&(b=b.toBSON());m=n(b);if("string"==typeof l&&!Oe.has(l)){if(null!=l.match(Se))throw Error("key "+l+" must not contain null bytes");if(r){if("$"===l[0])throw Error("key "+l+" must not start with '$'");if(~l.indexOf("."))throw Error("key "+l+" must not contain '.'")}}if("string"===m)f=Ae(t,l,b,f);else if("number"===m)f=Ee(t,l,b,f);else{if("bigint"===m)throw new O("Unsupported type BigInt, please use Decimal128");if("boolean"===m)f=ke(t,l,b,f);else if(b instanceof Date||I(b))f=je(t,l,b,f);else if(void 0===b)!1===a&&(f=xe(t,l,0,f));else if(null===b)f=xe(t,l,0,f);else if("ObjectId"===b._bsontype||"ObjectID"===b._bsontype)f=Be(t,l,b,f);else if(P(b))f=Te(t,l,b,f);else if(b instanceof RegExp||T(b))f=$e(t,l,b,f);else if("object"===m&&null==b._bsontype)f=Ie(t,l,b,f,r,o,s,a,!1,u);else if("object"===m&&"Decimal128"===b._bsontype)f=Ne(t,l,b,f);else if("Long"===b._bsontype||"Timestamp"===b._bsontype)f=De(t,l,b,f);else if("Double"===b._bsontype)f=Le(t,l,b,f);else if("Code"===b._bsontype)f=Ue(t,l,b,f,r,o,s,a);else if("function"==typeof b&&s)f=qe(t,l,b,f,0,0,s);else if("Binary"===b._bsontype)f=Fe(t,l,b,f);else if("Symbol"===b._bsontype)f=ze(t,l,b,f);else if("DBRef"===b._bsontype)f=Ve(t,l,b,f,o,s);else if("BSONRegExp"===b._bsontype)f=Pe(t,l,b,f);else if("Int32"===b._bsontype)f=Ce(t,l,b,f);else if("MinKey"===b._bsontype||"MaxKey"===b._bsontype)f=Re(t,l,b,f);else if(void 0!==b._bsontype)throw new O("Unrecognized or invalid _bsontype: "+b._bsontype)}}}u.pop(),t[f++]=0;var v=f-i;return t[i++]=255&v,t[i++]=v>>8&255,t[i++]=v>>16&255,t[i++]=v>>24&255,f}var He=g.alloc(17825792);function Ze(t){He.length<t&&(He=g.alloc(t))}function We(t,e){void 0===e&&(e={});var r="boolean"==typeof e.checkKeys&&e.checkKeys,n="boolean"==typeof e.serializeFunctions&&e.serializeFunctions,i="boolean"!=typeof e.ignoreUndefined||e.ignoreUndefined,o="number"==typeof e.minInternalBufferSize?e.minInternalBufferSize:17825792;He.length<o&&(He=g.alloc(o));var s=Ke(He,t,r,0,0,n,i,[]),a=g.alloc(s);return He.copy(a,0,0,a.length),a}function Je(t,e,r){void 0===r&&(r={});var n="boolean"==typeof r.checkKeys&&r.checkKeys,i="boolean"==typeof r.serializeFunctions&&r.serializeFunctions,o="boolean"!=typeof r.ignoreUndefined||r.ignoreUndefined,s="number"==typeof r.index?r.index:0,a=Ke(He,t,n,0,0,i,o);return He.copy(e,s,0,a),s+a-1}function Ye(t,e){return void 0===e&&(e={}),ve(t instanceof g?t:C(t),e)}function Qe(t,e){return void 0===e&&(e={}),le(t,"boolean"==typeof(e=e||{}).serializeFunctions&&e.serializeFunctions,"boolean"!=typeof e.ignoreUndefined||e.ignoreUndefined)}function Ge(t,e,r,n,i,o){for(var s=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},o),a=C(t),u=e,h=0;h<r;h++){var f=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24;s.index=u,n[i+h]=ve(a,s),u+=f}return u}var Xe={Binary:K,Code:H,DBRef:W,Decimal128:ht,Double:ft,Int32:ct,Long:G,UUID:V,Map:xt,MaxKey:lt,MinKey:dt,ObjectId:bt,ObjectID:bt,BSONRegExp:vt,BSONSymbol:gt,Timestamp:_t,EJSON:Et,setInternalBufferSize:Ze,serialize:We,serializeWithBufferAndIndex:Je,deserialize:Ye,calculateObjectSize:Qe,deserializeStream:Ge,BSONError:S,BSONTypeError:O};e.default=Xe}.call(this,r(7))},function(t,e,r){"use strict";var n=r(0),i=r(94),o=r(2).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<<e|t>>>32-e}function h(t,e,r,n,i,o,s){return u(t+(e&r|~e&n)+i+o|0,s)+e|0}function f(t,e,r,n,i,o,s){return u(t+(e&n|r&~n)+i+o|0,s)+e|0}function c(t,e,r,n,i,o,s){return u(t+(e^r^n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return u(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=h(r,n,i,o,t[0],3614090360,7),o=h(o,r,n,i,t[1],3905402710,12),i=h(i,o,r,n,t[2],606105819,17),n=h(n,i,o,r,t[3],3250441966,22),r=h(r,n,i,o,t[4],4118548399,7),o=h(o,r,n,i,t[5],1200080426,12),i=h(i,o,r,n,t[6],2821735955,17),n=h(n,i,o,r,t[7],4249261313,22),r=h(r,n,i,o,t[8],1770035416,7),o=h(o,r,n,i,t[9],2336552879,12),i=h(i,o,r,n,t[10],4294925233,17),n=h(n,i,o,r,t[11],2304563134,22),r=h(r,n,i,o,t[12],1804603682,7),o=h(o,r,n,i,t[13],4254626195,12),i=h(i,o,r,n,t[14],2792965006,17),r=f(r,n=h(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=c(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=c(o,r,n,i,t[8],2272392833,11),i=c(i,o,r,n,t[11],1839030562,16),n=c(n,i,o,r,t[14],4259657740,23),r=c(r,n,i,o,t[1],2763975236,4),o=c(o,r,n,i,t[4],1272893353,11),i=c(i,o,r,n,t[7],4139469664,16),n=c(n,i,o,r,t[10],3200236656,23),r=c(r,n,i,o,t[13],681279174,4),o=c(o,r,n,i,t[0],3936430074,11),i=c(i,o,r,n,t[3],3572445317,16),n=c(n,i,o,r,t[6],76029189,23),r=c(r,n,i,o,t[9],3654602809,4),o=c(o,r,n,i,t[12],3873151461,11),i=c(i,o,r,n,t[15],530742520,16),r=l(r,n=c(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=l(o,r,n,i,t[7],1126891415,10),i=l(i,o,r,n,t[14],2878612391,15),n=l(n,i,o,r,t[5],4237533241,21),r=l(r,n,i,o,t[12],1700485571,6),o=l(o,r,n,i,t[3],2399980690,10),i=l(i,o,r,n,t[10],4293915773,15),n=l(n,i,o,r,t[1],2240044497,21),r=l(r,n,i,o,t[8],1873313359,6),o=l(o,r,n,i,t[15],4264355552,10),i=l(i,o,r,n,t[6],2734768916,15),n=l(n,i,o,r,t[13],1309151649,21),r=l(r,n,i,o,t[4],4149444226,6),o=l(o,r,n,i,t[11],3174756917,10),i=l(i,o,r,n,t[2],718787259,15),n=l(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e,r){"use strict";var n=r(29).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||f()},h=e._writableState&&e._writableState.finished,f=function(){a=!1,h=!0,s||o.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,c=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!c?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!h?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},y=function(){e.req.on("finish",f)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?a&&!e._writableState&&(e.on("end",u),e.on("close",u)):(e.on("complete",f),e.on("abort",p),e.req?y():e.on("request",y)),e.on("end",l),e.on("finish",f),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",f),e.removeListener("abort",p),e.removeListener("request",y),e.req&&e.req.removeListener("finish",f),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},function(t,e,r){"use strict";var n=r(3).Buffer,i=r(0),o=r(94),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],c=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function y(t,e,r,n,i,o,s,a){return p(t+(e^r^n)+o+s|0,a)+i|0}function m(t,e,r,n,i,o,s,a){return p(t+(e&r|~e&n)+o+s|0,a)+i|0}function b(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function v(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function g(t,e,r,n,i,o,s,a){return p(t+(e^(r|~n))+o+s|0,a)+i|0}i(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,S=0|this._d,O=0|this._e,A=0;A<80;A+=1){var E,x;A<16?(E=y(r,n,i,o,d,t[a[A]],c[0],h[A]),x=g(w,_,M,S,O,t[u[A]],l[0],f[A])):A<32?(E=m(r,n,i,o,d,t[a[A]],c[1],h[A]),x=v(w,_,M,S,O,t[u[A]],l[1],f[A])):A<48?(E=b(r,n,i,o,d,t[a[A]],c[2],h[A]),x=b(w,_,M,S,O,t[u[A]],l[2],f[A])):A<64?(E=v(r,n,i,o,d,t[a[A]],c[3],h[A]),x=m(w,_,M,S,O,t[u[A]],l[3],f[A])):(E=g(r,n,i,o,d,t[a[A]],c[4],h[A]),x=y(w,_,M,S,O,t[u[A]],l[4],f[A])),r=d,d=o,o=p(i,10),i=n,n=E,w=O,O=S,S=p(M,10),M=_,_=x}var k=this._b+i+S|0;this._b=this._c+o+O|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+M|0,this._a=k},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(191),e.sha1=r(192),e.sha224=r(193),e.sha256=r(103),e.sha384=r(194),e.sha512=r(104)},function(t,e,r){(e=t.exports=r(105)).Stream=e,e.Readable=e,e.Writable=r(65),e.Duplex=r(26),e.Transform=r(109),e.PassThrough=r(200)},function(t,e,r){"use strict";(function(e,n,i){var o=r(47);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var a,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;v.WritableState=b;var h=Object.create(r(37));h.inherits=r(0);var f={deprecate:r(101)},c=r(106),l=r(2).Buffer,d=i.Uint8Array||function(){};var p,y=r(107);function m(){}function b(t,e){a=a||r(26),t=t||{};var n=e instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,h=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(h||0===h)?h:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(O,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),O(t,e))}(t,r,n,e,i);else{var s=M(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),n?u(w,t,r,s,i):w(t,r,s,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function v(t){if(a=a||r(26),!(p.call(v,this)||this instanceof a))return new v(t);this._writableState=new b(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function g(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),O(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,g(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,f=r.encoding,c=r.callback;if(g(t,e,!1,e.objectMode?1:h.length,h,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),O(t,e)}))}function O(t,e){var r=M(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}h.inherits(v,c),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(b.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof b)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof d);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(n,s),i=!1),i}(this,i,t,r))&&(i.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else g(t,e,!1,a,n,i,o);return u}(this,i,a,t,e,r)),s},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_(this,t))},v.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,O(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=y.destroy,v.prototype._undestroy=y.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(5),r(108).setImmediate,r(7))},function(t,e,r){"use strict";var n=r(11);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},function(t,e,r){var n=r(213),i=r(221),o=r(122);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},function(t,e,r){var n={ECB:r(214),CBC:r(215),CFB:r(216),CFB8:r(217),CFB1:r(218),OFB:r(219),CTR:r(120),GCM:r(120)},i=r(122);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},function(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 i;function o(t){this.rand=t}if(t.exports=function(t){return i||(i=new o(null)),i.generate(t)},t.exports.Rand=o,o.prototype.generate=function(t){return this._rand(t)},o.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"===("undefined"==typeof self?"undefined":n(self)))self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"===("undefined"==typeof window?"undefined":n(window))&&(o.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=r(227);if("function"!=typeof s.randomBytes)throw new Error("Not supported");o.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){}},function(t,e,r){
  586. /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  587. var n=r(3),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){(function(e){var n=r(72),i=r(28);function o(t){var e,r=t.modulus.byteLength();do{e=new n(i(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function s(t,r){var i=function(t){var e=o(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(r),s=r.modulus.byteLength(),a=new n(t).mul(i.blinder).umod(r.modulus),u=a.toRed(n.mont(r.prime1)),h=a.toRed(n.mont(r.prime2)),f=r.coefficient,c=r.prime1,l=r.prime2,d=u.redPow(r.exponent1).fromRed(),p=h.redPow(r.exponent2).fromRed(),y=d.isub(p).imul(f).umod(c).imul(l);return p.iadd(y).imul(i.unblinder).umod(r.modulus).toArrayLike(e,"be",s)}s.getr=o,t.exports=s}).call(this,r(3).Buffer)},function(t,e,r){(function(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(t,n){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(232).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+t)}function h(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var h=t.charCodeAt(u)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,i(h>=0&&s<n,"Invalid character"),o+=s}return o}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,n):(this._parseBase(t,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype._move=function(t){c(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){s.prototype.inspect=l}else s.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!==(o=a>>>24-n&16777215)||s!==this.length-1?d[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=p[t],f=y[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var l=c.modrn(f).toString(t);r=(c=c.idivn(f)).isZero()?l+r:d[h-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var f=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}s.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},s.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},s.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,d=0|s[1],p=8191&d,y=d>>>13,m=0|s[2],b=8191&m,v=m>>>13,g=0|s[3],w=8191&g,_=g>>>13,M=0|s[4],S=8191&M,O=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,k=0|s[6],j=8191&k,$=k>>>13,P=0|s[7],R=8191&P,B=P>>>13,T=0|s[8],I=8191&T,N=T>>>13,D=0|s[9],C=8191&D,L=D>>>13,q=0|a[0],U=8191&q,F=q>>>13,z=0|a[1],V=8191&z,K=z>>>13,H=0|a[2],Z=8191&H,W=H>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,G=0|a[4],X=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ft=0|a[8],ct=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(y,U)|0,o=Math.imul(y,F);var bt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var vt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0;var gt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,F))+Math.imul(O,U)|0,o=Math.imul(O,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,F))+Math.imul($,U)|0,o=Math.imul($,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,F))+Math.imul(B,U)|0,o=Math.imul(B,F),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul($,Z)|0,o=o+Math.imul($,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0;var Ot=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,yt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,X)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,W))+Math.imul(L,Z)|0,o=Math.imul(L,W),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(L,Y)|0,o=Math.imul(L,Q),n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,X),i=(i=Math.imul(C,tt))+Math.imul(L,X)|0,o=Math.imul(L,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,ut)|0,o=o+Math.imul($,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var jt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul($,ct)|0,o=o+Math.imul($,lt)|0;var $t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var Pt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,pt)|0))<<13)|0;h=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,ut),i=(i=Math.imul(C,ht))+Math.imul(L,ut)|0,o=Math.imul(L,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,lt))+Math.imul(L,ct)|0,o=Math.imul(L,lt);var Bt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Tt=(h+(n=Math.imul(C,pt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(L,pt)|0))<<13)|0;return h=((o=Math.imul(L,yt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=mt,u[1]=bt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Ot,u[9]=At,u[10]=Et,u[11]=xt,u[12]=kt,u[13]=jt,u[14]=$t,u[15]=Pt,u[16]=Rt,u[17]=Bt,u[18]=Tt,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(t,e,r){return v(t,e,r)}function w(t,e){this.x=t,this.y=e}Math.imul||(b=m),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?m(this,t,e):r<1024?v(this,t,e):g(this,t,e)},w.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},w.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},w.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},w.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,l=h,d=0;d<s;d++){var p=r[f+d],y=n[f+d],m=r[f+d+s],b=n[f+d+s],v=c*m-l*b;b=c*b+l*m,m=v,r[f+d]=p+m,n[f+d]=y+b,r[f+d+s]=p-m,n[f+d+s]=y-b,d!==a&&(v=u*c-h*l,l=u*l+h*c,c=v)}},w.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},w.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},w.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},w.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},w.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},w.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),g(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(u)):(r.isub(e),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new x(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var _={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},o(S,M),S.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},S.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(O,M),o(A,M),o(E,M),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(_[t])return _[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new O;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return _[t]=e,e},x.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var y=d,m=0;0!==y.cmp(a);m++)y=y.redSqr();i(m<p);var b=this.pow(c,new s(1).iushln(p-m-1));l=l.redMul(b),c=b.redSqr(),d=d.redMul(c),p=m}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var c=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new k(t)},o(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e,r){"use strict";var n=e;n.version=r(233).version,n.utils=r(12),n.rand=r(69),n.curve=r(129),n.curves=r(74),n.ec=r(245),n.eddsa=r(249)},function(t,e,r){"use strict";var n,i=e,o=r(75),s=r(129),a=r(12).assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(244)}catch(t){n=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(t,e,r){var n=e;n.utils=r(17),n.common=r(39),n.sha=r(238),n.ripemd=r(242),n.hmac=r(243),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e,r){"use strict";(function(e){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 i,o=r(3),s=o.Buffer,a={};for(i in o)o.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(a[i]=o[i]);var u=a.Buffer={};for(i in s)s.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(u[i]=s[i]);if(a.Buffer.prototype=s.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+n(t));if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t));return s(t,e,r)}),u.alloc||(u.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+n(t));if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var i=s(t);return e&&0!==e.length?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!a.kStringMaxLength)try{a.kStringMaxLength=e.binding("buffer").kStringMaxLength}catch(t){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this,r(5))},function(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 i=r(78).Reporter,o=r(40).EncoderBuffer,s=r(40).DecoderBuffer,a=r(11),u=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(u);function f(t,e,r){var n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=f;var c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){var t=this._baseState,e={};c.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},f.prototype._wrap=function(){var t=this._baseState;h.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},f.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),a.equal(e.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(a(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==n(t)||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){f.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),u.forEach((function(t){f.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(r),this}})),f.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},f.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},f.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},f.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},f.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},f.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},f.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var n,i=r.default,o=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){var u=null;if(null!==r.explicit?u=r.explicit:null!==r.implicit?u=r.implicit:null!==r.tag&&(u=r.tag),null!==u||r.any){if(o=this._peekTag(t,u,r.any),t.isError(o))return o}else{var h=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(h)}}if(r.obj&&o&&(n=t.enterObject()),o){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var c=t.offset;if(null===r.use&&null===r.choice){var l;r.any&&(l=t.save());var d=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(d))return d;r.any?i=t.raw(l):t=d}if(e&&e.track&&null!==r.tag&&e.track(t.path(),c,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var p=new s(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(p,e)}}return r.obj&&o&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},f.prototype._decodeGeneric=function(t,e,r){var n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},f.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(t,e){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some((function(o){var s=t.save(),a=r.choice[o];try{var u=a._decode(t,e);if(t.isError(u))return!1;n={type:o,value:u},i=!0}catch(e){return t.restore(s),!1}return!0}),this),i?n:t.error("Choice not matched")},f.prototype._createEncoderBuffer=function(t){return new o(t,this.reporter)},f.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n.default||n.default!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},f.prototype._encodeValue=function(t,e,r){var o=this._baseState;if(null===o.parent)return o.children[0]._encode(t,e||new i);var s=null;if(this.reporter=e,o.optional&&void 0===t){if(null===o.default)return;t=o.default}var a=null,u=!1;if(o.any)s=this._createEncoderBuffer(t);else if(o.choice)s=this._encodeChoice(t,e);else if(o.contains)a=this._getUse(o.contains,r)._encode(t,e),u=!0;else if(o.children)a=o.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var i=e.enterKey(r._baseState.key);if("object"!==n(t))return e.error("Child expected, but input is not object");var o=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),o}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return e.error("Too many args for : "+o.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var h=this.clone();h._baseState.implicit=null,a=this._createEncoderBuffer(t.map((function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),h))}else null!==o.use?s=this._getUse(o.use,r)._encode(t,e):(a=this._encodePrimitive(o.tag,t),u=!0);if(!o.any&&null===o.choice){var f=null!==o.implicit?o.implicit:o.tag,c=null===o.implicit?"universal":"context";null===f?null===o.use&&e.error("Tag could be omitted only for .use()"):null===o.use&&(s=this._encodeComposite(f,u,c,a))}return null!==o.explicit&&(s=this._encodeComposite(o.explicit,!1,"context",s)),s},f.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},f.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},f.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},f.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},function(t,e,r){"use strict";var n=r(0);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(t,e,r){"use strict";function n(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=n(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=n(e.tag)},function(t,e,r){(function(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(t,n){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(268).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,n):(this._parseBase(t,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var f=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!==(o=a>>>24-n&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?y+r:c[h-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,d=0|s[1],p=8191&d,y=d>>>13,m=0|s[2],b=8191&m,v=m>>>13,g=0|s[3],w=8191&g,_=g>>>13,M=0|s[4],S=8191&M,O=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,k=0|s[6],j=8191&k,$=k>>>13,P=0|s[7],R=8191&P,B=P>>>13,T=0|s[8],I=8191&T,N=T>>>13,D=0|s[9],C=8191&D,L=D>>>13,q=0|a[0],U=8191&q,F=q>>>13,z=0|a[1],V=8191&z,K=z>>>13,H=0|a[2],Z=8191&H,W=H>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,G=0|a[4],X=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ft=0|a[8],ct=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(y,U)|0,o=Math.imul(y,F);var bt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var vt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0;var gt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,F))+Math.imul(O,U)|0,o=Math.imul(O,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,F))+Math.imul($,U)|0,o=Math.imul($,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,F))+Math.imul(B,U)|0,o=Math.imul(B,F),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul($,Z)|0,o=o+Math.imul($,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0;var Ot=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,yt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,X)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,W))+Math.imul(L,Z)|0,o=Math.imul(L,W),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(L,Y)|0,o=Math.imul(L,Q),n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,X),i=(i=Math.imul(C,tt))+Math.imul(L,X)|0,o=Math.imul(L,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,ut)|0,o=o+Math.imul($,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var jt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul($,ct)|0,o=o+Math.imul($,lt)|0;var $t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var Pt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,pt)|0))<<13)|0;h=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,ut),i=(i=Math.imul(C,ht))+Math.imul(L,ut)|0,o=Math.imul(L,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,lt))+Math.imul(L,ct)|0,o=Math.imul(L,lt);var Bt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Tt=(h+(n=Math.imul(C,pt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(L,pt)|0))<<13)|0;return h=((o=Math.imul(L,yt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=mt,u[1]=bt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Ot,u[9]=At,u[10]=Et,u[11]=xt,u[12]=kt,u[13]=jt,u[14]=$t,u[15]=Pt,u[16]=Rt,u[17]=Bt,u[18]=Tt,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(y=p),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,l=h,d=0;d<s;d++){var p=r[f+d],y=n[f+d],m=r[f+d+s],b=n[f+d+s],v=c*m-l*b;b=c*b+l*m,m=v,r[f+d]=p+m,n[f+d]=y+b,r[f+d+s]=p-m,n[f+d+s]=y-b,d!==a&&(v=u*c-h*l,l=u*l+h*c,c=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(u)):(r.isub(e),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new O(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){O.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},o(w,g),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(_,g),o(M,g),o(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},O.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},O.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},O.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},O.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},O.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},O.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},O.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},O.prototype.isqr=function(t){return this.imul(t,t.clone())},O.prototype.sqr=function(t){return this.mul(t,t)},O.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var y=d,m=0;0!==y.cmp(a);m++)y=y.redSqr();i(m<p);var b=this.pow(c,new s(1).iushln(p-m-1));l=l.redMul(b),c=b.redSqr(),d=d.redMul(c),p=m}return l},O.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},O.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var c=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}u=26}return i},O.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},O.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},o(A,O),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e,r){"use strict";t.exports=r(277)},function(t,e,r){"use strict";t.exports=new Set(["__proto__","constructor","prototype"])},function(t,e,r){"use strict";var n=r(84);
  588. /*!
  589. * ignore
  590. */t.exports=function(t){var e=null!=this?this.path:null;return n(t,e)}},function(t,e,r){"use strict";var n=r(20);
  591. /*!
  592. * Given a value, cast it to a boolean, or throw a `CastError` if the value
  593. * cannot be casted. `null` and `undefined` are considered valid.
  594. *
  595. * @param {Any} value
  596. * @param {String} [path] optional the path to set on the CastError
  597. * @return {Boolean|null|undefined}
  598. * @throws {CastError} if `value` is not one of the allowed values
  599. * @api private
  600. */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"])},function(t,e,r){"use strict";(function(n){
  601. /*!
  602. * Module dependencies.
  603. */
  604. function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}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 s(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var u,h=r(13).EventEmitter,f=r(306),c=r(19),l=r(10),d=r(15),p=r(307),y=r(86),m=r(155),b=r(6),v=r(22),g=r(308),w=r(309),_=r(150),M=r(81),S=r(25).get().ReadPreference,O=r(310),A=r(4),E=r(314),x=r(315).middlewareFunctions,k=r(157).middlewareFunctions,j=x.concat(k).reduce((function(t,e){return t.add(e)}),new Set),$=A.isPOJO,P=0;function R(t,e){if(!(this instanceof R))return new R(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.methods={},this.methodOptions={},this.statics={},this.tree={},this.query={},this.childSchemas=[],this.plugins=[],this.$id=++P,this.mapPaths=[],this.s={hooks:new f},this.options=this.defaultOptions(e),Array.isArray(t)){var r,n=s(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.add(i)}}catch(t){n.e(t)}finally{n.f()}}else t&&this.add(t);var o=t&&t._id&&A.isObject(t._id);!this.paths._id&&this.options._id&&!o&&m(this),this.setupTimestamp(this.options.timestamps)}
  605. /*!
  606. * Create virtual properties with alias field
  607. */
  608. /*!
  609. * Inherit from EventEmitter.
  610. */
  611. R.prototype=Object.create(h.prototype),R.prototype.constructor=R,R.prototype.instanceOfSchema=!0,
  612. /*!
  613. * ignore
  614. */
  615. Object.defineProperty(R.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0}),Object.defineProperty(R.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0}),Object.defineProperty(R.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0}),R.prototype.obj,R.prototype.paths,R.prototype.tree,R.prototype.clone=function(){var t=this,e=this._clone();return e.on("init",(function(e){return t.emit("init",e)})),e},R.prototype._clone=function(t){var e=new(t=t||(null==this.base?R:this.base.Schema))({},this._userProvidedOptions);return e.base=this.base,e.obj=this.obj,e.options=A.clone(this.options),e.callQueue=this.callQueue.map((function(t){return t})),e.methods=A.clone(this.methods),e.methodOptions=A.clone(this.methodOptions),e.statics=A.clone(this.statics),e.query=A.clone(this.query),e.plugins=Array.prototype.slice.call(this.plugins),e._indexes=A.clone(this._indexes),e.s.hooks=this.s.hooks.clone(),e.tree=A.clone(this.tree),e.paths=A.clone(this.paths),e.nested=A.clone(this.nested),e.subpaths=A.clone(this.subpaths),e.singleNestedPaths=A.clone(this.singleNestedPaths),e.childSchemas=
  616. /*!
  617. * ignore
  618. */
  619. function(t){for(var e=[],r=0,n=Object.keys(t.paths);r<n.length;r++){var i=n[r],o=t.paths[i];(o.$isMongooseDocumentArray||o.$isSingleNested)&&e.push({schema:o.schema,model:o.caster})}return e}
  620. /*!
  621. * ignore
  622. */(e),e.virtuals=A.clone(this.virtuals),e.$globalPluginsApplied=this.$globalPluginsApplied,e.$isRootDiscriminator=this.$isRootDiscriminator,e.$implicitlyCreated=this.$implicitlyCreated,e.$id=++P,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)),e.aliases=Object.assign({},this.aliases),e},R.prototype.pick=function(t,e){var r=new R({},e||this.options);if(!Array.isArray(t))throw new c('Schema#pick() only accepts an array argument, got "'+o(t)+'"');var n,a=s(t);try{for(a.s();!(n=a.n()).done;){var u=n.value;if(this.nested[u])r.add(i({},u,b(this.tree,u)));else{var h=this.path(u);if(null==h)throw new c("Path `"+u+"` is not in the schema");r.add(i({},u,h))}}}catch(t){a.e(t)}finally{a.f()}return r},R.prototype.defaultOptions=function(t){this._userProvidedOptions=null==t?{}:A.clone(t);var e=b(this,"base.options",{}),r=!("strict"in e)||e.strict;if((t=A.options({strict:r,strictQuery:"strict"in this._userProvidedOptions?this._userProvidedOptions.strict:"strictQuery"in e?e.strictQuery:r,bufferCommands:!0,capped:!1,versionKey:"__v",optimisticConcurrency:!1,minimize:!0,autoIndex:null,discriminatorKey:"__t",shardKey:null,read:null,validateBeforeSave:!0,_id:!0,id:!0,typeKey:"type"},A.clone(t))).read&&(t.read=S(t.read)),t.versionKey&&"string"!=typeof t.versionKey)throw new c("`versionKey` must be falsy or string, got `"+o(t.versionKey)+"`");if(t.optimisticConcurrency&&!t.versionKey)throw new c("Must set `versionKey` if using `optimisticConcurrency`");return t},R.prototype.add=function(t,e){if(t instanceof R||null!=t&&t.instanceOfSchema)return _(this,t),this;if(!1===t._id&&null==e&&(this.options._id=!1),"__proto__."===(e=e||"")||"constructor."===e||"prototype."===e)return this;for(var r=Object.keys(t),n=this.options.typeKey,i=0,o=r;i<o.length;i++){var a=o[i],u=e+a,h=t[a];if(null==h)throw new TypeError("Invalid value for schema path `"+u+'`, got value "'+h+'"');if("_id"!==a||!1!==h)if(h instanceof y||"VirtualType"===b(h,"constructor.name",null))this.virtual(h);else{if(Array.isArray(h)&&1===h.length&&null==h[0])throw new TypeError("Invalid value for schema Array path `"+u+'`, got value "'+h[0]+'"');if($(h)||h instanceof d)if(Object.keys(h).length<1)e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(u,h);else if(!h[n]||"type"===n&&$(h.type)&&h.type.type)this.nested[u]=!0,this.add(h,u+".");else{var f=h[n];if($(f)&&Object.keys(f).length>0){e&&(this.nested[e.substring(0,e.length-1)]=!0);var c=new R(f),l=Object.assign({},h,{type:c});this.path(e+a,l)}else e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+a,h)}else e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+a,h)}}return function(t,e){var r,n=s(e=e||Object.keys(t.paths));try{for(n.s();!(r=n.n()).done;){var i=r.value,o=b(t.paths[i],"options");if(null!=o){var a=t.paths[i].path,u=o.alias;if(u){if("string"!=typeof u)throw new Error("Invalid value for alias option on "+a+", got "+u);t.aliases[u]=a,t.virtual(u).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){n.e(t)}finally{n.f()}}(this,Object.keys(t).map((function(t){return e?e+t:t}))),this},R.reserved=Object.create(null),R.prototype.reserved=R.reserved;var B=R.reserved;
  623. /*!
  624. * ignore
  625. */
  626. function T(t){return/\.\d+/.test(t)?t.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$"):t}
  627. /*!
  628. * ignore
  629. */function I(t,e){if(0===t.mapPaths.length)return null;var r,n=s(t.mapPaths);try{for(n.s();!(r=n.n()).done;){var i=r.value.path;if(new RegExp("^"+i.replace(/\.\$\*/g,"\\.[^.]+")+"$").test(e))return t.paths[i]}}catch(t){n.e(t)}finally{n.f()}return null}
  630. /*!
  631. * ignore. Deprecated re: #6405
  632. */
  633. function N(t,e){var r=e.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(r.length<2)return t.paths.hasOwnProperty(r[0])?t.paths[r[0]]:"adhocOrUndefined";var n=t.path(r[0]),i=!1;if(!n)return"adhocOrUndefined";for(var o=r.length-1,s=1;s<r.length;++s){i=!1;var a=r[s];if(s===o&&n&&!/\D/.test(a)){n=n.$isMongooseDocumentArray?n.$embeddedSchemaType:n instanceof u.Array?n.caster:void 0;break}if(/\D/.test(a)){if(!n||!n.schema){n=void 0;break}i="nested"===n.schema.pathType(a),n=n.schema.path(a)}else n instanceof u.Array&&s!==o&&(n=n.caster)}return t.subpaths[e]=n,n?"real":i?"nested":"adhocOrUndefined"}
  634. /*!
  635. * ignore
  636. */B.prototype=B.emit=B.listeners=B.on=B.removeListener=B.collection=B.errors=B.get=B.init=B.isModified=B.isNew=B.populated=B.remove=B.save=B.toObject=B.validate=1,B.collection=1,R.prototype.path=function(t,e){var r=T(t);if(void 0===e){var n=function(t,e,r){if(t.paths.hasOwnProperty(e))return t.paths[e];if(t.subpaths.hasOwnProperty(r))return t.subpaths[r];if(t.singleNestedPaths.hasOwnProperty(r)&&"object"===o(t.singleNestedPaths[r]))return t.singleNestedPaths[r];return null}(this,t,r);if(null!=n)return n;var i=I(this,t);return null!=i?i:null!=(n=this.hasMixedParent(r))?n:/\.\d+\.?.*$/.test(t)?function(t,e){return N(t,e),t.subpaths[e]}(this,t):void 0}var a=t.split(".")[0];if(B[a]&&!this.options.supressReservedKeysWarning){var u="`".concat(a,"` 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 `supressReservedKeysWarning` as a schema option.";A.warn(u)}"object"===o(e)&&A.hasUserDefinedProperty(e,"ref")&&E(e.ref,t);var h,f=t.split(/\./),c=f.pop(),d=this.tree,p="",y=s(f);try{for(y.s();!(h=y.n()).done;){var m=h.value;if(p=p+=(p.length>0?".":"")+m,d[m]||(this.nested[p]=!0,d[m]={}),"object"!==o(d[m])){var b="Cannot set nested path `"+t+"`. Parent path `"+p+"` already set to type "+d[m].name+".";throw new Error(b)}d=d[m]}}catch(t){y.e(t)}finally{y.f()}d[c]=A.clone(e),this.paths[t]=this.interpretAsType(t,e,this.options);var v=this.paths[t];if(v.$isSchemaMap){var g=t+".$*";this.paths[g]=v.$__schemaType,this.mapPaths.push(this.paths[g])}if(v.$isSingleNested){for(var w=0,_=Object.keys(v.schema.paths);w<_.length;w++){var M=_[w];this.singleNestedPaths[t+"."+M]=v.schema.paths[M]}for(var S=0,O=Object.keys(v.schema.singleNestedPaths);S<O.length;S++){var x=O[S];this.singleNestedPaths[t+"."+x]=v.schema.singleNestedPaths[x]}for(var k=0,j=Object.keys(v.schema.subpaths);k<j.length;k++){var $=j[k];this.singleNestedPaths[t+"."+$]=v.schema.subpaths[$]}for(var P=0,R=Object.keys(v.schema.nested);P<R.length;P++){var D=R[P];this.singleNestedPaths[t+"."+D]="nested"}Object.defineProperty(v.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),v.caster.base=this.base,this.childSchemas.push({schema:v.schema,model:v.caster})}else v.$isMongooseDocumentArray&&(Object.defineProperty(v.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),v.casterConstructor.base=this.base,this.childSchemas.push({schema:v.schema,model:v.casterConstructor}));if(v.$isMongooseArray&&v.caster instanceof l){for(var C=t,L=v,q=[];L.$isMongooseArray;)C+=".$",L.$isMongooseDocumentArray?(L.$embeddedSchemaType._arrayPath=C,L.$embeddedSchemaType._arrayParentPath=t,L=L.$embeddedSchemaType.clone()):(L.caster._arrayPath=C,L.caster._arrayParentPath=t,L=L.caster.clone()),L.path=C,q.push(L);for(var U=0,F=q;U<F.length;U++){var z=F[U];this.subpaths[z.path]=z}}if(v.$isMongooseDocumentArray){for(var V=0,K=Object.keys(v.schema.paths);V<K.length;V++){var H=K[V],Z=v.schema.paths[H];this.subpaths[t+"."+H]=Z,"object"===o(Z)&&null!=Z&&(Z.$isUnderneathDocArray=!0)}for(var W=0,J=Object.keys(v.schema.subpaths);W<J.length;W++){var Y=J[W],Q=v.schema.subpaths[Y];this.subpaths[t+"."+Y]=Q,"object"===o(Q)&&null!=Q&&(Q.$isUnderneathDocArray=!0)}for(var G=0,X=Object.keys(v.schema.singleNestedPaths);G<X.length;G++){var tt=X[G],et=v.schema.singleNestedPaths[tt];this.subpaths[t+"."+tt]=et,"object"===o(et)&&null!=et&&(et.$isUnderneathDocArray=!0)}}return this},Object.defineProperty(R.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null}),R.prototype.interpretAsType=function(t,e,r){if(e instanceof l){if(e.path===t)return e;var s=e.clone();return s.path=t,s}var a=null!=this.base?this.base.Schema.Types:R.Types;if(!(A.isPOJO(e)||e instanceof d)&&"Object"!==A.getFunctionName(e.constructor)){var u=e;(e={})[r.typeKey]=u}var h,f=e[r.typeKey]&&(e[r.typeKey]instanceof Function||"type"!==r.typeKey||!e.type.type)?e[r.typeKey]:{};if(A.isPOJO(f)||"mixed"===f)return new a.Mixed(t,e);if(Array.isArray(f)||f===Array||"array"===f||f===a.Array){var c=f===Array||"array"===f?e.cast||e.of:f[0];if(c&&c.instanceOfSchema){if(!(c instanceof R))throw new TypeError("Schema for array path `"+t+"` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with `npm list mongoose`.");return new a.DocumentArray(t,c,e)}if(c&&c[r.typeKey]&&c[r.typeKey].instanceOfSchema){if(!(c[r.typeKey]instanceof R))throw new TypeError("Schema for array path `"+t+"` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with `npm list mongoose`.");return new a.DocumentArray(t,c[r.typeKey],e,c)}if(Array.isArray(c))return new a.Array(t,this.interpretAsType(t,c,r),e);var p=null==c||!c[r.typeKey]||"type"===r.typeKey&&c.type.type?c:c[r.typeKey];if("string"==typeof c)c=a[c.charAt(0).toUpperCase()+c.substring(1)];else if(A.isPOJO(p)){if(Object.keys(p).length){var y={minimize:r.minimize};r.typeKey&&(y.typeKey=r.typeKey),r.hasOwnProperty("strict")&&(y.strict=r.strict),this._userProvidedOptions.hasOwnProperty("_id")?y._id=this._userProvidedOptions._id:null!=R.Types.DocumentArray.defaultOptions._id&&(y._id=R.Types.DocumentArray.defaultOptions._id);var m=new R(p,y);return m.$implicitlyCreated=!0,new a.DocumentArray(t,m,e)}return new a.Array(t,a.Mixed,e)}if(c){if("ClockDate"===(h="string"==typeof(f=!c[r.typeKey]||"type"===r.typeKey&&c.type.type?c:c[r.typeKey])?f:f.schemaName||A.getFunctionName(f))&&(h="Date"),void 0===h)throw new TypeError("Invalid schema configuration: "+"Could not determine the embedded type for array `".concat(t,"`. ")+"See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(!a.hasOwnProperty(h))throw new TypeError("Invalid schema configuration: "+"`".concat(h,"` is not a valid type within the array `").concat(t,"`.")+"See http://bit.ly/mongoose-schematypes for a list of valid schema types.")}return new a.Array(t,c||a.Mixed,e,r)}if(f&&f.instanceOfSchema)return new a.Subdocument(f,t,e);if((h=n.isBuffer(f)?"Buffer":"function"==typeof f||"object"===o(f)?f.schemaName||A.getFunctionName(f):null==f?""+f:f.toString())&&(h=h.charAt(0).toUpperCase()+h.substring(1)),"ObjectID"===h&&(h="ObjectId"),"ClockDate"===h&&(h="Date"),void 0===h)throw new TypeError("Invalid schema configuration: `".concat(t,"` schematype definition is ")+"invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(null==a[h])throw new TypeError("Invalid schema configuration: `".concat(h,"` is not ")+"a valid type at path `".concat(t,"`. See ")+"http://bit.ly/mongoose-schematypes for a list of valid schema types.");var b=new a[h](t,e);return b.$isSchemaMap&&
  637. /*!
  638. * ignore
  639. */
  640. function(t,e,r,n,o){var s=r+".$*",a={type:{}};if(A.hasUserDefinedProperty(n,"of")){var u=A.isPOJO(n.of)&&Object.keys(n.of).length>0&&!A.hasUserDefinedProperty(n.of,t.options.typeKey);a=u?i({},t.options.typeKey,new R(n.of)):A.isPOJO(n.of)?Object.assign({},n.of):i({},t.options.typeKey,n.of),A.hasUserDefinedProperty(n,"ref")&&(a.ref=n.ref)}e.$__schemaType=t.interpretAsType(s,a,o)}(this,b,t,e,r),b},R.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},R.prototype.requiredPaths=function(t){if(this._requiredpaths&&!t)return this._requiredpaths;for(var e=Object.keys(this.paths),r=e.length,n=[];r--;){var i=e[r];this.paths[i].isRequired&&n.push(i)}return this._requiredpaths=n,this._requiredpaths},R.prototype.indexedPaths=function(){return this._indexedpaths||(this._indexedpaths=this.indexes()),this._indexedpaths},R.prototype.pathType=function(t){var e=T(t);if(this.paths.hasOwnProperty(t))return"real";if(this.virtuals.hasOwnProperty(t))return"virtual";if(this.nested.hasOwnProperty(t))return"nested";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!=I(this,t)?"real":/\.\d+\.|\.\d+$/.test(t)?N(this,t):"adhocOrUndefined"},R.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 u.Mixed)return this.paths[t];return null},R.prototype.setupTimestamp=function(t){return O(this,t)},R.prototype.queue=function(t,e){return this.callQueue.push([t,e]),this},R.prototype.pre=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=s(j);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.test(i)&&this.pre.apply(this,[i].concat(r))}}catch(t){n.e(t)}finally{n.f()}return this}if(Array.isArray(t)){var o,a=Array.prototype.slice.call(arguments,1),u=s(t);try{for(u.s();!(o=u.n()).done;){var h=o.value;this.pre.apply(this,[h].concat(a))}}catch(t){u.e(t)}finally{u.f()}return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this},R.prototype.post=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=s(j);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.test(i)&&this.post.apply(this,[i].concat(r))}}catch(t){n.e(t)}finally{n.f()}return this}if(Array.isArray(t)){var o,a=Array.prototype.slice.call(arguments,1),u=s(t);try{for(u.s();!(o=u.n()).done;){var h=o.value;this.post.apply(this,[h].concat(a))}}catch(t){u.e(t)}finally{u.f()}return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this},R.prototype.plugin=function(t,e){if("function"!=typeof t)throw new Error('First param to `schema.plugin()` must be a function, got "'+o(t)+'"');if(e&&e.deduplicate){var r,n=s(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},R.prototype.method=function(t,e,r){if("string"!=typeof t)for(var n in t)this.methods[n]=t[n],this.methodOptions[n]=A.clone(r);else this.methods[t]=e,this.methodOptions[t]=A.clone(r);return this},R.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},R.prototype.index=function(t,e){return t||(t={}),e||(e={}),e.expires&&A.expires(e),this._indexes.push([t,e]),this},R.prototype.set=function(t,e,r){if(1===arguments.length)return this.options[t];switch(t){case"read":this.options[t]=S(e,r),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?m(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 this},R.prototype.get=function(t){return this.options[t]};var D="2d 2dsphere hashed text".split(" ");
  641. /*!
  642. * ignore
  643. */
  644. function C(t,e){var r,n=e.split("."),i=n.pop(),o=t.tree,a=s(n);try{for(a.s();!(r=a.n()).done;){o=o[r.value]}}catch(t){a.e(t)}finally{a.f()}delete o[i]}
  645. /*!
  646. * ignore
  647. */
  648. function L(t){return t.startsWith("$[")&&t.endsWith("]")}
  649. /*!
  650. * Called by `compile()` _right before_ compiling. Good for making any changes to
  651. * the schema that should respect options set by plugins, like `id`
  652. */Object.defineProperty(R,"indexTypes",{get:function(){return D},set:function(){throw new Error("Cannot overwrite Schema.indexTypes")}}),R.prototype.indexes=function(){return g(this)},R.prototype.virtual=function(t,e){if(t instanceof y||"VirtualType"===v(t))return this.virtual(t.path,t.options);if(e=new p(e),A.hasUserDefinedProperty(e,["ref","refPath"])){if(null==e.localField)throw new Error("Reference virtuals require `localField` option");if(null==e.foreignField)throw new Error("Reference virtuals require `foreignField` option");this.pre("init",(function(r){if(M.has(t,r)){var n=M.get(t,r);this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?this.$$populatedVirtuals[t]=Array.isArray(n)?n[0]:n:this.$$populatedVirtuals[t]=Array.isArray(n)?n:null==n?[]:[n],M.unset(t,r)}}));var r=this.virtual(t);r.options=e,r.set((function(r){this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?(this.$$populatedVirtuals[t]=Array.isArray(r)?r[0]:r,"object"!==o(this.$$populatedVirtuals[t])&&(this.$$populatedVirtuals[t]=e.count?r:null)):(this.$$populatedVirtuals[t]=Array.isArray(r)?r:null==r?[]:[r],this.$$populatedVirtuals[t]=this.$$populatedVirtuals[t].filter((function(t){return t&&"object"===o(t)})))})),"function"==typeof e.get&&r.get(e.get);for(var n=t.split("."),i=n[0],s=0;s<n.length-1;++s){if(null!=this.paths[i]&&this.paths[i].$isMongooseDocumentArray){var a=n.slice(s+1).join(".");this.paths[i].schema.virtual(a,e);break}i+="."+n[s+1]}return r}var u=this.virtuals,h=t.split(".");if("real"===this.pathType(t))throw new Error('Virtual path "'+t+'" conflicts with a real path in the schema');return u[t]=h.reduce((function(r,n,i){return r[n]||(r[n]=i===h.length-1?new y(e,t):{}),r[n]}),this.tree),u[t]},R.prototype.virtualpath=function(t){return this.virtuals.hasOwnProperty(t)?this.virtuals[t]:null},R.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=s(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],C(this,n))}}catch(t){r.e(t)}finally{r.f()}return delete this.nested[t],void C(this,t)}delete this.paths[t],C(this,t)}}),this),this},R.prototype.loadClass=function(t,e){return t===Object.prototype||t===Function.prototype||t.prototype.hasOwnProperty("$isMongooseModelPrototype")||(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},
  653. /*!
  654. * ignore
  655. */
  656. R.prototype._getSchema=function(t){var e=this.path(t),r=[];if(e)return e.$fullPath=t,e;for(var n=t.split("."),i=0;i<n.length;++i)("$"===n[i]||L(n[i]))&&(n[i]="0");return function t(e,n){for(var i,o,s=e.length+1;s--;)if(o=e.slice(0,s).join("."),i=n.path(o)){if(r.push(o),i.caster){if(i.caster instanceof u.Mixed)return i.caster.$fullPath=r.join("."),i.caster;if(s!==e.length&&i.schema){var a=void 0;return"$"===e[s]||L(e[s])?s+1===e.length?i:((a=t(e.slice(s+1),i.schema))&&(a.$isUnderneathDocArray=a.$isUnderneathDocArray||!i.schema.$isSingleNested),a):((a=t(e.slice(s),i.schema))&&(a.$isUnderneathDocArray=a.$isUnderneathDocArray||!i.schema.$isSingleNested),a)}}else if(i.$isSchemaMap){return s>=e.length?i:s+1>=e.length?i.$__schemaType:t(e.slice(s+1),i.$__schemaType.schema)}return i.$fullPath=r.join("."),i}}(n,this)},
  657. /*!
  658. * ignore
  659. */
  660. R.prototype._getPathType=function(t){if(this.path(t))return"real";return function t(e,r){for(var n,i,o=e.length+1;o--;){if(i=e.slice(0,o).join("."),n=r.path(i))return n.caster?n.caster instanceof u.Mixed?{schema:n,pathType:"mixed"}:o!==e.length&&n.schema?"$"===e[o]||L(e[o])?o===e.length-1?{schema:n,pathType:"nested"}:t(e.slice(o+1),n.schema):t(e.slice(o),n.schema):{schema:n,pathType:n.$isSingleNested?"nested":"array"}:{schema:n,pathType:"real"};if(o===e.length&&r.nested[i])return{schema:r,pathType:"nested"}}return{schema:n||r,pathType:"undefined"}}(t.split("."),this)},R.prototype._preCompile=function(){w(this)},
  661. /*!
  662. * Module exports.
  663. */
  664. t.exports=e=R,R.Types=u=r(87),
  665. /*!
  666. * ignore
  667. */
  668. e.ObjectId=u.ObjectId}).call(this,r(3).Buffer)},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(4);function s(t,e){this.path=e,this.getters=[],this.setters=[],this.options=Object.assign({},t)}s.prototype._applyDefaultGetters=function(){if(!(this.getters.length>0||this.setters.length>0)){var t="$"+this.path;this.getters.push((function(){return this[t]})),this.setters.push((function(e){this[t]=e}))}},
  669. /*!
  670. * ignore
  671. */
  672. s.prototype.clone=function(){var t=new s(this.options,this.path);return t.getters=[].concat(this.getters),t.setters=[].concat(this.setters),t},s.prototype.get=function(t){return this.getters.push(t),this},s.prototype.set=function(t){return this.setters.push(t),this},s.prototype.applyGetters=function(t,e){o.hasUserDefinedProperty(this.options,["ref","refPath"])&&e.$$populatedVirtuals&&e.$$populatedVirtuals.hasOwnProperty(this.path)&&(t=e.$$populatedVirtuals[this.path]);var r,i=t,s=n(this.getters);try{for(s.s();!(r=s.n()).done;){i=r.value.call(e,i,this,e)}}catch(t){s.e(t)}finally{s.f()}return i},s.prototype.applySetters=function(t,e){var r,i=t,o=n(this.setters);try{for(o.s();!(r=o.n()).done;){i=r.value.call(e,i,this,e)}}catch(t){o.e(t)}finally{o.f()}return i},
  673. /*!
  674. * exports
  675. */
  676. t.exports=s},function(t,e,r){"use strict";
  677. /*!
  678. * Module exports.
  679. */e.String=r(317),e.Number=r(159),e.Boolean=r(320),e.DocumentArray=r(321),e.Subdocument=r(329),e.Array=r(88),e.Buffer=r(331),e.Date=r(333),e.ObjectId=r(336),e.Mixed=r(45),e.Decimal128=e.Decimal=r(338),e.Map=r(340),e.Oid=e.ObjectId,e.Object=e.Mixed,e.Bool=e.Boolean,e.ObjectID=e.ObjectId},function(t,e,r){"use strict";
  680. /*!
  681. * Module dependencies.
  682. */function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o,s,a=r(83),u=r(153),h=r(19),f=r(322),c=r(10),l=c.CastError,d=r(45),p=r(323),y=r(324),m=r(6),b=r(164),v=r(9),g=r(4),w=r(56).castToNumber,_=r(165),M=r(57),S=Symbol("mongoose#isNestedArray"),O=Object.freeze({});function A(t,e,n,i){s||(s=r(58).Embedded);var o,a,u="type";if(i&&i.typeKey&&(u=i.typeKey),this.schemaOptions=i,e){var h={};g.isPOJO(e)&&(e[u]?(delete(h=g.clone(e))[u],e=e[u]):e=d),null!=n&&null!=n.ref&&null==h.ref&&(h.ref=n.ref),e===Object&&(e=d);var f="string"==typeof e?e:g.getFunctionName(e),l=r(87),p=l.hasOwnProperty(f)?l[f]:e;if(this.casterConstructor=p,this.casterConstructor instanceof A&&(this.casterConstructor[S]=!0),"function"!=typeof p||p.$isArraySubdocument||p.$isSchemaMap)this.caster=p,this.caster instanceof s||(this.caster.path=t);else{var y=this.caster instanceof s?null:t;this.caster=new p(y,h)}this.$embeddedSchemaType=this.caster}if(this.$isMongooseArray=!0,c.call(this,t,n,"Array"),null!=this.defaultValue&&(o=this.defaultValue,a="function"==typeof o),!("defaultValue"in this)||void 0!==this.defaultValue){var m=function(){return a?o.call(this):null!=o?[].concat(o):[]};m.$runBeforeSetters=!a,this.default(m)}}A.schemaName="Array",A.options={castNonArrays:!0},
  683. /*!
  684. * ignore
  685. */
  686. A.defaultOptions={},A.set=c.set,
  687. /*!
  688. * Inherits from SchemaType.
  689. */
  690. A.prototype=Object.create(c.prototype),A.prototype.constructor=A,A.prototype.OptionsConstructor=f,
  691. /*!
  692. * ignore
  693. */
  694. A._checkRequired=c.prototype.checkRequired,A.checkRequired=c.checkRequired,A.prototype.checkRequired=function(t,e){return c._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():A.checkRequired())(t)},A.prototype.enum=function(){for(var t=this;;){var e=m(t,"caster.instance");if("Array"!==e){if("String"!==e&&"Number"!==e)throw new Error("`enum` can only be set on an array of strings or numbers , not "+e);break}t=t.caster}var r=arguments;return!Array.isArray(arguments)&&g.isObject(arguments)&&(r=g.object.vals(r)),t.caster.enum.apply(t.caster,r),this},A.prototype.applyGetters=function(t,e){if(null!=e&&null!=e.$__&&e.$populated(this.path))return t;var r=c.prototype.applyGetters.call(this,t,e);if(Array.isArray(r))for(var n=g.isMongooseArray(r)?r.__array:r,i=n.length,o=0;o<i;++o)n[o]=this.caster.applyGetters(n[o],e);return r},A.prototype._applySetters=function(t,e,r,n){if(this.casterConstructor.$isMongooseArray&&A.options.castNonArrays&&!this[S]){for(var i=0,o=this;null!=o&&o.$isMongooseArray&&!o.$isMongooseDocumentArray;)++i,o=o.casterConstructor;if(null!=t&&0!==t.length){var s=p(t);if(s.min===s.max&&s.max<i&&s.containsNonArrayItem)for(var a=s.max;a<i;++a)t=[t]}}return c.prototype._applySetters.call(this,t,e,r,n)},A.prototype.cast=function(t,e,n,i,s){var a,u;if(o||(o=r(58).Array),Array.isArray(t)){if(!t.length&&e){var h=e.schema.indexedPaths(),f=this.path;for(a=0,u=h.length;a<u;++a){var c=h[a][0][f];if("2dsphere"===c||"2d"===c)return}var p=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(null!=p)for(a=0,u=h.length;a<u;++a){if("2dsphere"===h[a][0][p])return}}s=s||O;var y=g.isMongooseArray(t)?t.__array:t;if(y=(t=o(y,s.path||this._arrayPath||this.path,e,this)).__array,n&&null!=e&&null!=e.$__&&e.$populated(this.path))return t;var m=this.caster,b=m.$isMongooseArray;if(m&&this.casterConstructor!==d)try{var w=y.length;for(a=0;a<w;a++){var _={};b&&(null!=s.arrayPath||null!=m._arrayParentPath)&&(_.arrayPathIndex=a),y[a]=m.applySetters(y[a],e,n,void 0,_)}}catch(e){throw new l("["+e.kind+"]",v.inspect(t),this.path+"."+a,e,this)}return t}if(n||A.options.castNonArrays)return e&&n&&e.markModified(this.path),this.cast([t],e,n);throw new l("Array",v.inspect(t),this.path,null,this)},
  695. /*!
  696. * ignore
  697. */
  698. A.prototype._castForPopulate=function(t,e){if(o||(o=r(58).Array),Array.isArray(t)){var n,i=t.__array?t.__array:t,s=i.length,a=this.caster;if(a&&this.casterConstructor!==d)try{for(n=0;n<s;n++){var u={};a.$isMongooseArray&&null!=a._arrayParentPath&&(u.arrayPathIndex=n),i[n]=a.cast(i[n],e,!1,void 0,u)}}catch(e){throw new l("["+e.kind+"]",v.inspect(t),this.path+"."+n,e,this)}return t}throw new l("Array",v.inspect(t),this.path,null,this)},A.prototype.$toObject=A.prototype.toObject,
  699. /*!
  700. * Ignore
  701. */
  702. A.prototype.discriminator=function(t,e){for(var r=this;r.$isMongooseArray&&!r.$isMongooseDocumentArray;)if(null==(r=r.casterConstructor)||"function"==typeof r)throw new h("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return r.discriminator(t,e)},
  703. /*!
  704. * ignore
  705. */
  706. A.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},A.prototype.castForQuery=function(t,e){var r,n,i=this;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with Array.");n=r.call(this,e)}else{n=t;var o=this.casterConstructor;if(n&&o.discriminators&&o.schema&&o.schema.options&&o.schema.options.discriminatorKey)if("string"==typeof n[o.schema.options.discriminatorKey]&&o.discriminators[n[o.schema.options.discriminatorKey]])o=o.discriminators[n[o.schema.options.discriminatorKey]];else{var s=M(o.discriminators,n[o.schema.options.discriminatorKey]);s&&(o=s)}var a=this.casterConstructor.prototype,u=a&&(a.castForQuery||a.cast);!u&&o.castForQuery&&(u=o.castForQuery);var h=this.caster;Array.isArray(n)?(this.setters.reverse().forEach((function(t){n=t.call(i,n,i)})),n=n.map((function(t){return g.isObject(t)&&t.$elemMatch?t:u?t=u.call(h,t):null!=t?t=new o(t):t}))):u?n=u.call(h,n):null!=n&&(n=new o(n))}return n};var E=A.prototype.$conditionalHandlers={};function x(t){return function(e){if(!Array.isArray(e))throw new TypeError("conditional "+t+" requires an array");var r,i=[],o=n(e);try{for(o.s();!(r=o.n()).done;){var s=r.value;i.push(y(this.casterConstructor.schema,s))}}catch(t){o.e(t)}finally{o.f()}return i}}E.$all=function(t){return Array.isArray(t)||(t=[t]),t=t.map((function(t){if(!g.isObject(t))return t;if(null!=t.$elemMatch)return{$elemMatch:y(this.casterConstructor.schema,t.$elemMatch)};var e={};return e[this.path]=t,y(this.casterConstructor.schema,e)[this.path]}),this),this.castForQuery(t)},E.$options=String,E.$elemMatch=function(t){for(var e=Object.keys(t),r=e.length,n=0;n<r;++n){var i=e[n],o=t[i];b(i)&&null!=o&&(t[i]=this.castForQuery(i,o))}var s=m(this,"casterConstructor.schema.options.discriminatorKey"),a=m(this,"casterConstructor.schema.discriminators",{});return null!=s&&null!=t[s]&&null!=a[t[s]]?y(a[t[s]],t):y(this.casterConstructor.schema,t)},E.$geoIntersects=_.cast$geoIntersects,E.$or=x("$or"),E.$and=x("$and"),E.$nor=x("$nor"),E.$near=E.$nearSphere=_.cast$near,E.$within=E.$geoWithin=_.cast$within,E.$size=E.$minDistance=E.$maxDistance=w,E.$exists=a,E.$type=u,E.$eq=E.$gt=E.$gte=E.$lt=E.$lte=E.$ne=E.$regex=A.prototype.castForQuery,E.$nin=c.prototype.$conditionalHandlers.$nin,E.$in=c.prototype.$conditionalHandlers.$in,
  707. /*!
  708. * Module exports.
  709. */
  710. t.exports=A},function(t,e,r){"use strict";(function(e){function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(14),s=r(46),a=r(19),u=r(18),h=r(167),f=r(6),c=r(34).internalToObjectOptions,l=r(4),d=r(1).arrayAtomicsSymbol,p=r(1).arrayParentSymbol,y=r(1).arrayPathSymbol,m=r(1).arraySchemaSymbol,b=r(1).populateModelSymbol,v=Symbol("mongoose#Array#sliced"),g=Array.prototype.push,w={$__getAtomics:function(){var t=[],e=Object.keys(this[d]||{}),r=e.length,n=Object.assign({},c,{_isNested:!0});if(0===r)return t[0]=["$set",this.toObject(n)],t;for(;r--;){var i=e[r],o=this[d][i];l.isMongooseObject(o)?o=o.toObject(n):Array.isArray(o)?o=this.toObject.call(o,n):null!=o&&Array.isArray(o.$each)?o.$each=this.toObject.call(o.$each,n):null!=o&&"function"==typeof o.valueOf&&(o=o.valueOf()),"$addToSet"===i&&(o={$each:o}),t.push([i,o])}return t},
  711. /*!
  712. * ignore
  713. */
  714. $atomics:function(){return this[d]},
  715. /*!
  716. * ignore
  717. */
  718. $parent:function(){return this[p]},
  719. /*!
  720. * ignore
  721. */
  722. $path:function(){return this[y]},$shift:function(){if(this._registerAtomic("$pop",-1),this._markModified(),!this._shifted)return this._shifted=!0,[].shift.call(this)},$pop:function(){if(this._registerAtomic("$pop",1),this._markModified(),!this._popped)return this._popped=!0,[].pop.call(this)},
  723. /*!
  724. * ignore
  725. */
  726. $schema:function(){return this[m]},_cast:function(t){var r,n=!1,i=this[p];return i&&(n=i.$populated(this[y],!0)),n&&null!=t?(r=n.options[b],(e.isBuffer(t)||t instanceof u||!l.isObject(t))&&(t={_id:t}),t.schema&&t.schema.discriminatorMapping&&void 0!==t.schema.discriminatorMapping.key||(t=new r(t)),this[m].caster.applySetters(t,i,!0)):this[m].caster.applySetters(t,i,!1)},_mapCast:function(t,e){return this._cast(t,this.length+e)},_markModified:function(t){var e,r=this[p];if(r){if(e=this[y],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[v]){if("$set"===t)return this[d]={$set:e},h(this[p],this[y]),this._markModified(),this;var r,n=this[d];if("$pop"===t&&!("$pop"in n)){var i=this;this[p].once("save",(function(){i._popped=i._shifted=null}))}if(n.$set||Object.keys(n).length&&!(t in n))return this[d]={$set:this},this;if("$pullAll"===t||"$addToSet"===t)n[t]||(n[t]=[]),n[t]=n[t].concat(e);else if("$pullDocs"===t){var o=n.$pull||(n.$pull={});e[0]instanceof s?(r=o.$or||(o.$or=[]),Array.prototype.push.apply(r,e.map((function(t){return t.toObject({transform:!1,virtuals:!1})})))):(r=o._id||(o._id={$in:[]})).$in=r.$in.concat(e)}else"$push"===t?(n.$push=n.$push||{$each:[]},null!=e&&l.hasUserDefinedProperty(e,"$each")?n.$push=e:n.$push.$each=n.$push.$each.concat(e)):n[t]=e;return this}},addToSet:function(){_(this,arguments);var t=[].map.call(arguments,this._mapCast,this);t=this[m].applySetters(t,this[p]);var e=[],r="";t[0]instanceof s?r="doc":t[0]instanceof Date&&(r="date");var n=l.isMongooseArray(t)?t.__array:this,i=l.isMongooseArray(this)?this.__array:this;return n.forEach((function(t){var n,o=+t;switch(r){case"doc":n=this.some((function(e){return e.equals(t)}));break;case"date":n=this.some((function(t){return+t===o}));break;default:n=~this.indexOf(t)}n||(i.push(t),this._registerAtomic("$addToSet",t),this._markModified(),[].push.call(e,t))}),this),e},hasAtomics:function(){return l.isPOJO(this[d])?Object.keys(this[d]).length:0},includes:function(t,e){return-1!==this.indexOf(t,e)},indexOf:function(t,e){t instanceof u&&(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),e=[].push.apply(this,t);return this._registerAtomic("$set",this),this._markModified(),e},pop:function(){var t=[].pop.call(this);return this._registerAtomic("$set",this),this._markModified(),t},pull:function(){for(var t,e=[].map.call(arguments,this._cast,this),r=this[p].get(this[y]),n=r.length;n--;)if((t=r[n])instanceof o){var i=e.some((function(e){return t.equals(e)}));i&&[].splice.call(r,n,1)}else~r.indexOf.call(e,t)&&[].splice.call(r,n,1);return e[0]instanceof s?this._registerAtomic("$pullDocs",e.map((function(t){return t.$__getValue("_id")||t}))):this._registerAtomic("$pullAll",e),this._markModified(),h(this[p],this[y])>0&&this._registerAtomic("$set",this),this},push:function(){var t=arguments,e=t,r=null!=t[0]&&l.hasUserDefinedProperty(t[0],"$each"),n=l.isMongooseArray(this)?this.__array:this;if(r&&(e=t[0],t=t[0].$each),null==this[m])return g.apply(this,t);_(this,t);var i,o=this[p];t=[].map.call(t,this._mapCast,this),t=this[m].applySetters(t,o,void 0,void 0,{skipDocumentArrayCast:!0});var s=this[d];if(r){if(e.$each=t,f(s,"$push.$each.length",0)>0&&s.$push.$position!=e.$position)throw new a("Cannot call `Array#push()` multiple times with different `$position`");null!=e.$position?([].splice.apply(n,[e.$position,0].concat(t)),i=this.length):i=[].push.apply(n,t)}else{if(f(s,"$push.$each.length",0)>0&&null!=s.$push.$position)throw new a("Cannot call `Array#push()` multiple times with different `$position`");e=t,i=[].push.apply(n,t)}return this._registerAtomic("$push",e),this._markModified(),i},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 i=w._cast.call(this,e,t);return n[t]=i,w._markModified.call(this,t),this},shift:function(){var t=l.isMongooseArray(this)?this.__array:this,e=[].shift.call(t);return this._registerAtomic("$set",this),this._markModified(),e},sort:function(){var t=l.isMongooseArray(this)?this.__array:this,e=[].sort.apply(t,arguments);return this._registerAtomic("$set",this),e},splice:function(){var t,e=l.isMongooseArray(this)?this.__array:this;if(_(this,Array.prototype.slice.call(arguments,2)),arguments.length){var r;if(null==this[m])r=arguments;else{r=[];for(var n=0;n<arguments.length;++n)r[n]=n<2?arguments[n]:this._cast(arguments[n],arguments[0]+(n-2))}t=[].splice.apply(e,r),this._registerAtomic("$set",this)}return t},
  727. /*!
  728. * ignore
  729. */
  730. toBSON:function(){return this.toObject(c)},toObject:function(t){var e=l.isMongooseArray(this)?this.__array:this;return t&&t.depopulate?((t=l.clone(t))._isNested=!0,[].concat(e).map((function(e){return e instanceof o?e.toObject(t):e}))):[].concat(e)},$toObject:function(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift:function(){var t;_(this,arguments),null==this[m]?t=arguments:(t=[].map.call(arguments,this._cast,this),t=this[m].applySetters(t,this[p]));var e=l.isMongooseArray(this)?this.__array:this;return[].unshift.apply(e,t),this._registerAtomic("$set",this),this._markModified(),this.length}};
  731. /*!
  732. * ignore
  733. */
  734. function _(t,e){var r,i,s,a=null==t?null:f(t[m],"caster.options.ref",null);0===t.length&&0!==e.length&&
  735. /*!
  736. * ignore
  737. */
  738. function(t,e){if(!e)return!1;var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var s=r.value;if(null==s)return!1;var a=s.constructor;if(!(s instanceof o)||a.modelName!==e&&a.baseModelName!==e)return!1}}catch(t){i.e(t)}finally{i.f()}return!0}(e,a)&&t[p].$populated(t[y],[],(r={},i=b,s=e[0].constructor,i in r?Object.defineProperty(r,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[i]=s,r))}for(var M=function(){var t=O[S];if(null==Array.prototype[t])return"continue";w[t]=function(){var e=l.isMongooseArray(this)?this.__array:this,r=[].concat(e);return r[t].apply(r,arguments)}},S=0,O=["filter","flat","flatMap","map","slice"];S<O.length;S++)M();t.exports=w}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(14),i=r(42),o=r(34).internalToObjectOptions,s=r(53),a=r(9),u=r(4);function h(t,e,r,i,o){if(null!=r){var s={isNew:r.isNew};"defaults"in r.$__&&(s.defaults=r.$__.defaults),o=Object.assign(s,o)}null!=o&&null!=o.path&&(this.$basePath=o.path),n.call(this,t,e,i,o),delete this.$__.priorDoc}t.exports=h,h.prototype=Object.create(n.prototype),Object.defineProperty(h.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0}),Object.defineProperty(h.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0}),
  739. /*!
  740. * ignore
  741. */
  742. h.prototype.toBSON=function(){return this.toObject(o)},h.prototype.save=function(t,e){var r=this;return"function"==typeof t&&(e=t,t={}),(t=t||{}).suppressWarning||u.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."),s(e,(function(t){r.$__save(t)}))},
  743. /*!
  744. * Given a path relative to this document, return the path relative
  745. * to the top-level document.
  746. */
  747. h.prototype.$__fullPath=function(t){return this.$__.fullPath||this.ownerDocument(),t?this.$__.fullPath+"."+t:this.$__.fullPath},
  748. /*!
  749. * Given a path relative to this document, return the path relative
  750. * to the top-level document.
  751. */
  752. h.prototype.$__pathRelativeToParent=function(t){return null==t?this.$basePath:[this.$basePath,t].join(".")},h.prototype.$__save=function(t){var e=this;return i((function(){return t(null,e)}))},
  753. /*!
  754. * ignore
  755. */
  756. h.prototype.$isValid=function(t){var e=this.$parent(),r=this.$__pathRelativeToParent(t);return null!=e&&null!=r?e.$isValid(r):n.prototype.$isValid.call(this,t)},
  757. /*!
  758. * ignore
  759. */
  760. h.prototype.markModified=function(t){n.prototype.markModified.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);if(null!=e&&null!=r){var i=this.$__pathRelativeToParent().replace(/\.$/,"");e.isDirectModified(i)||this.isNew||this.$__parent.markModified(r,this)}},
  761. /*!
  762. * ignore
  763. */
  764. h.prototype.isModified=function(t,e){var r=this,i=this.$parent();return null!=i?(Array.isArray(t)||"string"==typeof t?t=(t=Array.isArray(t)?t:t.split(" ")).map((function(t){return r.$__pathRelativeToParent(t)})).filter((function(t){return null!=t})):t||(t=this.$__pathRelativeToParent()),i.$isModified(t,e)):n.prototype.isModified.call(this,t,e)},h.prototype.$markValid=function(t){n.prototype.$markValid.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$markValid(r)},
  765. /*!
  766. * ignore
  767. */
  768. h.prototype.invalidate=function(t,e,r){n.prototype.invalidate.call(this,t,e,r);var i=this.$parent(),o=this.$__pathRelativeToParent(t);if(null!=i&&null!=o)i.invalidate(o,e,r);else if("cast"===e.kind||"CastError"===e.name||null==o)throw e;return this.ownerDocument().$__.validationError},
  769. /*!
  770. * ignore
  771. */
  772. h.prototype.$ignore=function(t){n.prototype.$ignore.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$ignore(r)},h.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;for(var t=this,e=[],r=new Set([t]);"function"==typeof t.$__pathRelativeToParent;){e.unshift(t.$__pathRelativeToParent(void 0,!0));var n=t.$parent();if(null==n)break;if(t=n,r.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");r.add(t)}return this.$__.fullPath=e.join("."),this.$__.ownerDocument=t,this.$__.ownerDocument},h.prototype.parent=function(){return this.$__parent},h.prototype.$parent=h.prototype.parent,
  773. /*!
  774. * no-op for hooks
  775. */
  776. h.prototype.$__remove=function(t){if(null!=t)return t(null,this)},h.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)},h.prototype.remove=function(t,e){return"function"==typeof t&&(e=t,t=null),
  777. /*!
  778. * Registers remove event listeners for triggering
  779. * on subdocuments.
  780. *
  781. * @param {Subdocument} sub
  782. * @api private
  783. */
  784. function(t){var e=t.ownerDocument();function r(){e.$removeListener("save",r),e.$removeListener("remove",r),t.emit("remove",t),t.constructor.emit("remove",t),e=t=null}e.$on("save",r),e.$on("remove",r)}(this),t&&t.noop||this.$__removeFromParent(),this.$__remove(e)},
  785. /*!
  786. * ignore
  787. */
  788. h.prototype.populate=function(){throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')},h.prototype.inspect=function(){return this.toObject({transform:!1,virtuals:!1,flattenDecimals:!1})},a.inspect.custom&&(
  789. /*!
  790. * Avoid Node deprecation warning DEP0079
  791. */
  792. h.prototype[a.inspect.custom]=h.prototype.inspect)},function(t,e,r){"use strict";var n,i=r(1).documentSchemaSymbol,o=r(6),s=r(34).internalToObjectOptions,a=r(4),u=r(1).getSymbol,h=r(1).scopeSymbol,f=a.isPOJO;
  793. /*!
  794. * Compiles schemas.
  795. */
  796. function c(t,e,i,o){n=n||r(14);for(var s=o.typeKey,a=0,u=Object.keys(t);a<u.length;a++){var h=u[a],c=t[h];l({prop:h,subprops:f(c)&&Object.keys(c).length>0&&(!c[s]||"type"===s&&f(c.type)&&c.type.type)?c:null,prototype:e,prefix:i,options:o})}}
  797. /*!
  798. * Defines the accessor named prop on the incoming prototype.
  799. */function l(t){var e=t.prop,f=t.subprops,l=t.prototype,d=t.prefix,p=t.options;n=n||r(14);var y=(d?d+".":"")+e;d=d||"",f?Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){var t,e,r=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[y]){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));d||(s.$__[h]=this),s.$__.nestedPath=y,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 a.clone(r.get(y,null,{virtuals:o(this,"schema.options.toObject.virtuals",null)}))}}),Object.defineProperty(s,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(y,null,{virtuals:o(this,"schema.options.toObject.virtuals",null)})}}),Object.defineProperty(s,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(y,null,{virtuals:o(r,"schema.options.toJSON.virtuals",null)})}}),Object.defineProperty(s,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0});var u=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1});Object.defineProperty(s,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(y,null,u)||{}).length}}),Object.defineProperty(s,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),c(f,s,y,p),this.$__.getters[y]=s}return this.$__.getters[y]},set:function(t){null!=t&&t.$__isNested?t=t.$__get():t instanceof n&&!t.$__isNested&&(t=t.$toObject(s)),(this.$__[h]||this).$set(y,t)}}):Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){return this[u].call(this.$__[h]||this,y)},set:function(t){this.$set.call(this.$__[h]||this,y,t)}})}
  800. /*!
  801. * exports
  802. */
  803. e.compile=c,e.defineKey=l},function(t,e,r){"use strict";
  804. /*!
  805. * ignore
  806. */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)}t.exports=function(t){return null==t||("object"!==n(t)||!("$meta"in t)&&!("$slice"in t))}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";var n=r(182).Buffer,i=r(95).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(0)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){(e=t.exports=r(96)).Stream=e,e.Readable=e,e.Writable=r(100),e.Duplex=r(30),e.Transform=r(102),e.PassThrough=r(189),e.finished=r(61),e.pipeline=r(190)},function(t,e,r){"use strict";(function(e,n){var i;t.exports=A,A.ReadableState=O;r(13).EventEmitter;var o=function(t,e){return t.listeners(e).length},s=r(97),a=r(3).Buffer,u=e.Uint8Array||function(){};var h,f=r(183);h=f&&f.debuglog?f.debuglog("stream"):function(){};var c,l,d,p=r(184),y=r(98),m=r(99).getHighWaterMark,b=r(29).codes,v=b.ERR_INVALID_ARG_TYPE,g=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(0)(A,s);var M=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function O(t,e,n){i=i||r(30),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(36).StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||r(30),!(this instanceof A))return new A(t);var e=this instanceof i;this._readableState=new O(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function E(t,e,r,n,i){h("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(h("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?j(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,$(t)))}(t,s);else if(i||(o=function(t,e){var r;n=e,a.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(s,e)),o)M(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)s.endEmitted?M(t,new _):x(t,s,e,!0);else if(s.ended)M(t,new g);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?x(t,s,e,!1):P(t,s)):x(t,s,e,!1)}else n||(s.reading=!1,P(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function x(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&j(t)),P(t,e)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),E(this,t,e,!1,r)},A.prototype.unshift=function(t){return E(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){c||(c=r(36).StringDecoder);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function k(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function j(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick($,t))}function $(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(h("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function T(t){h("readable nexttick read 0"),t.read(0)}function I(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function C(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(L,e,t))}function L(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function q(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}A.prototype.read=function(t){h("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):j(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&C(this),null;var n,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&h("length less than watermark",i=!0),e.ended||e.reading?h("reading or ended",i=!1):i&&(h("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=k(r,e))),null===(n=t>0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&C(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){M(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:m;function a(e,n){h("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),t.removeListener("close",p),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",l),c=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){h("onend"),t.end()}i.endEmitted?n.nextTick(s):r.once("end",s),t.on("unpipe",a);var f=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",f);var c=!1;function l(e){h("ondata");var n=t.write(e);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==q(i.pipes,t))&&!c&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){h("onerror",e),m(),t.removeListener("error",d),0===o(t,"error")&&M(t,e)}function p(){t.removeListener("finish",y),m()}function y(){h("onfinish"),t.removeListener("close",p),m()}function m(){h("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",y),t.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=q(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},A.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?j(this):i.reading||n.nextTick(T,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(B,this),r},A.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(B,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(I,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){h("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=r(187)),l(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=D,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===d&&(d=r(188)),d(A,t,e)})}).call(this,r(7),r(5))},function(t,e,r){t.exports=r(13).EventEmitter},function(t,e,r){"use strict";(function(e){function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,o){var s=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?s._writableState?s._writableState.errorEmitted?e.nextTick(n,s):(s._writableState.errorEmitted=!0,e.nextTick(r,s,t)):e.nextTick(r,s,t):o?(e.nextTick(n,s),o(t)):e.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,r(5))},function(t,e,r){"use strict";var n=r(29).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},function(t,e,r){"use strict";(function(e,n){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var o;t.exports=A,A.WritableState=O;var s={deprecate:r(101)},a=r(97),u=r(3).Buffer,h=e.Uint8Array||function(){};var f,c=r(98),l=r(99).getHighWaterMark,d=r(29).codes,p=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,v=d.ERR_STREAM_DESTROYED,g=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;function S(){}function O(t,e,s){o=o||r(30),t=t||{},"boolean"!=typeof s&&(s=e instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,o){--e.pendingcb,r?(n.nextTick(o,i),n.nextTick(P,t,e),t._writableState.errorEmitted=!0,M(t,i)):(o(i),t._writableState.errorEmitted=!0,M(t,i),P(t,e))}(t,r,i,e,o);else{var s=j(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),i?n.nextTick(x,t,r,s,o):x(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(t){var e=this instanceof(o=o||r(30));if(!e&&!f.call(A,this))return new A(t);this._writableState=new O(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function E(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),P(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,E(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,f=r.encoding,c=r.callback;if(E(t,e,!1,e.objectMode?1:h.length,h,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function j(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function $(t,e){t._final((function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),P(t,e)}))}function P(t,e){var r=j(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,n.nextTick($,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(0)(A,a),O.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(O.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===A&&(t&&t._writableState instanceof O)}})):f=function(t){return t instanceof this},A.prototype.pipe=function(){M(this,new b)},A.prototype.write=function(t,e,r){var i,o=this._writableState,s=!1,a=!o.objectMode&&(i=t,u.isBuffer(i)||i instanceof h);return a&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;M(t,r),n.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var o;return null===r?o=new g:"string"==typeof r||e.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(M(t,o),n.nextTick(i,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var h=e.length<e.highWaterMark;h||(e.needDrain=!0);if(e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else E(t,e,!1,a,n,i,o);return h}(this,o,a,t,e,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||k(this,t))},A.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this,r(7),r(5))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,r(7))},function(t,e,r){"use strict";t.exports=f;var n=r(29).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(30);function h(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);u.call(this,t),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(0)(f,u),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new i("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e,r){var n=r(0),i=r(31),o=r(2).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}function h(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function c(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,y=0|this._g,m=0|this._h,b=0;b<16;++b)r[b]=t.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((e=r[b-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[b-7]+d(r[b-15])+r[b-16];for(var v=0;v<64;++v){var g=m+l(u)+h(u,p,y)+s[v]+r[v]|0,w=c(n)+f(n,i,o)|0;m=y,y=p,p=u,u=a+g|0,a=o,o=i,i=n,n=g+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var n=r(0),i=r(31),o=r(2).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function b(t,e){return t>>>0<e>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,v=0|this._gh,g=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,S=0|this._dl,O=0|this._el,A=0|this._fl,E=0|this._gl,x=0|this._hl,k=0;k<32;k+=2)e[k]=t.readInt32BE(4*k),e[k+1]=t.readInt32BE(4*k+4);for(;k<160;k+=2){var j=e[k-30],$=e[k-30+1],P=d(j,$),R=p($,j),B=y(j=e[k-4],$=e[k-4+1]),T=m($,j),I=e[k-14],N=e[k-14+1],D=e[k-32],C=e[k-32+1],L=R+N|0,q=P+I+b(L,R)|0;q=(q=q+B+b(L=L+T|0,T)|0)+D+b(L=L+C|0,C)|0,e[k]=q,e[k+1]=L}for(var U=0;U<160;U+=2){q=e[U],L=e[U+1];var F=f(r,n,i),z=f(w,_,M),V=c(r,w),K=c(w,r),H=l(a,O),Z=l(O,a),W=s[U],J=s[U+1],Y=h(a,u,v),Q=h(O,A,E),G=x+Z|0,X=g+H+b(G,x)|0;X=(X=(X=X+Y+b(G=G+Q|0,Q)|0)+W+b(G=G+J|0,J)|0)+q+b(G=G+L|0,L)|0;var tt=K+z|0,et=V+F+b(tt,K)|0;g=v,x=E,v=u,E=A,u=a,A=O,a=o+X+b(O=S+G|0,S)|0,o=i,S=M,i=n,M=_,n=r,_=w,r=X+et+b(w=G+tt|0,G)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+S|0,this._el=this._el+O|0,this._fl=this._fl+A|0,this._gl=this._gl+E|0,this._hl=this._hl+x|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+n+b(this._bl,_)|0,this._ch=this._ch+i+b(this._cl,M)|0,this._dh=this._dh+o+b(this._dl,S)|0,this._eh=this._eh+a+b(this._el,O)|0,this._fh=this._fh+u+b(this._fl,A)|0,this._gh=this._gh+v+b(this._gl,E)|0,this._hh=this._hh+g+b(this._hl,x)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){"use strict";(function(e,n){var i=r(47);t.exports=g;var o,s=r(93);g.ReadableState=v;r(13).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=r(106),h=r(2).Buffer,f=e.Uint8Array||function(){};var c=Object.create(r(37));c.inherits=r(0);var l=r(196),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,y=r(197),m=r(107);c.inherits(g,u);var b=["error","close","destroy","pause","resume"];function v(t,e){t=t||{};var n=e instanceof(o=o||r(26));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(36).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function g(t){if(o=o||r(26),!(this instanceof g))return new g(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,n,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}(t,s)):(i||(o=function(t,e){var r;n=e,h.isBuffer(n)||n instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===h.prototype||(e=function(t){return h.from(t)}(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):A(t,s)):_(t,s,e,!1))):n||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function _(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),A(t,e)}Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),g.prototype.destroy=m.destroy,g.prototype._undestroy=m.undestroy,g.prototype._destroy=function(t,e){this.push(null),e(t)},g.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=h.from(t,e),e=""),r=!0),w(this,t,e,!1,r)},g.prototype.unshift=function(t){return w(this,t,null,!0,!1)},g.prototype.isPaused=function(){return!1===this._readableState.flowing},g.prototype.setEncoding=function(t){return p||(p=r(36).StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};function M(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(O,t):O(t))}function O(t){d("emit readable"),t.emit("readable"),j(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(E,t,e))}function E(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(d("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function x(t){d("readable nexttick read 0"),t.read(0)}function k(t,e){e.reading||(d("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(d("flow",e.flowing);e.flowing&&null!==t.read(););}function $(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=h.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function P(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function B(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}g.prototype.read=function(t){d("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?P(this):S(this),null;if(0===(t=M(t,e))&&e.ended)return 0===e.length&&P(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&d("length less than watermark",i=!0),e.ended||e.reading?d("reading or ended",i=!1):i&&(d("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=M(r,e))),null===(n=t>0?$(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&P(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?f:g;function h(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",b),t.removeListener("finish",v),t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",h),r.removeListener("end",f),r.removeListener("end",g),r.removeListener("data",y),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function f(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",h);var c=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,j(t))}}(r);t.on("drain",c);var l=!1;var p=!1;function y(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==B(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(e){d("onerror",e),g(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function b(){t.removeListener("finish",v),g()}function v(){d("onfinish"),t.removeListener("close",b),g()}function g(){d("unpipe"),r.unpipe(t)}return r.on("data",y),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",b),t.once("finish",v),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},g.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var s=B(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},g.prototype.on=function(t,e){var r=u.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(x,this))}return r},g.prototype.addListener=g.prototype.on,g.prototype.resume=function(){var t=this._readableState;return t.flowing||(d("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(k,t,e))}(this,t)),this},g.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},g.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<b.length;o++)t.on(b[o],this.emit.bind(this,b[o]));return this._read=function(e){d("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),g._fromList=$}).call(this,r(7),r(5))},function(t,e,r){t.exports=r(13).EventEmitter},function(t,e,r){"use strict";var n=r(47);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(199),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(t,e,r){"use strict";t.exports=s;var n=r(26),i=Object.create(r(37));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(t){if(!(this instanceof s))return new s(t);n.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",a)}function a(){var t=this;"function"==typeof this._flush?this._flush((function(e,r){u(t,e,r)})):u(this,null,null)}function u(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=r(0),i.inherits(s,n),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},s.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},s.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,(function(t){e(t),r.emit("close")}))}},function(t,e,r){"use strict";var n=r(0),i=r(205),o=r(23),s=r(2).Buffer,a=r(111),u=r(62),h=r(63),f=s.alloc(128);function c(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:h(t)).update(e).digest():e.length<r&&(e=s.concat([e,f],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new u:h(t),this._hash.update(n)}n(c,o),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new u:h(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new c("rmd160",e):"md5"===t?new i(a,e):new c(t,e)}},function(t,e,r){var n=r(60);t.exports=function(t){return(new n).update(t).digest()}},function(t){t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},function(t,e,r){e.pbkdf2=r(207),e.pbkdf2Sync=r(116)},function(t,e){var r=Math.pow(2,30)-1;t.exports=function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>r||e!=e)throw new TypeError("Bad key length")}},function(t,e,r){(function(e,r){var n;if(e.process&&e.process.browser)n="utf-8";else if(e.process&&e.process.version){n=parseInt(r.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n}).call(this,r(7),r(5))},function(t,e,r){var n=r(111),i=r(62),o=r(63),s=r(2).Buffer,a=r(114),u=r(115),h=r(117),f=s.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var a=function(t){function e(e){return o(t).update(e).digest()}return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:e}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,f],u));for(var h=s.allocUnsafe(u+c[t]),l=s.allocUnsafe(u+c[t]),d=0;d<u;d++)h[d]=54^e[d],l[d]=92^e[d];var p=s.allocUnsafe(u+r+4);h.copy(p,0,0,u),this.ipad1=p,this.ipad2=h,this.opad=l,this.alg=t,this.blocksize=u,this.hash=a,this.size=c[t]}l.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,r,n,i){a(r,n);var o=new l(i=i||"sha1",t=h(t,u,"Password"),(e=h(e,u,"Salt")).length),f=s.allocUnsafe(n),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,y=c[i],m=Math.ceil(n/y),b=1;b<=m;b++){d.writeUInt32BE(b,e.length);for(var v=o.run(d,o.ipad1),g=v,w=1;w<r;w++){g=o.run(g,o.ipad2);for(var _=0;_<y;_++)v[_]^=g[_]}v.copy(f,p),p+=y}return f}},function(t,e,r){var n=r(2).Buffer;t.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},function(t,e,r){"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,i){for(var o=0,s=0,a=n.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>n[u]&1;for(u=a;u<n.length;u++)s<<=1,s|=e>>>n[u]&1;r[i+0]=o>>>0,r[i+1]=s>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<o.length;r++)e<<=1,e|=t>>>o[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},function(t,e,r){"use strict";var n=r(11),i=r(0),o=r(118),s=r(66);function a(){this.tmp=new Array(2),this.keys=null}function u(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(u,s),t.exports=u,u.create=function(t){return new u(t)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=h[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},u.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},u.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},u.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,u=0;u<t.keys.length;u+=2){var h=t.keys[u],f=t.keys[u+1];o.expand(a,t.tmp,0),h^=t.tmp[0],f^=t.tmp[1];var c=o.substitute(h,f),l=a;a=(s^o.permute(c))>>>0,s=l}o.rip(a,s,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,u=t.keys.length-2;u>=0;u-=2){var h=t.keys[u],f=t.keys[u+1];o.expand(s,t.tmp,0),h^=t.tmp[0],f^=t.tmp[1];var c=o.substitute(h,f),l=s;s=(a^o.permute(c))>>>0,a=l}o.rip(s,a,n,i)}},function(t,e,r){var n=r(38),i=r(2).Buffer,o=r(121);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(t),h=o+16*a;t._cache.writeUInt32BE(u[0],h+0),t._cache.writeUInt32BE(u[1],h+4),t._cache.writeUInt32BE(u[2],h+8),t._cache.writeUInt32BE(u[3],h+12)}var f=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,f)}},function(t,e){t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},function(t){t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},function(t,e,r){var n=r(48),i=r(2).Buffer,o=r(23),s=r(0),a=r(220),u=r(38),h=r(121);function f(t,e,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var f=this._cipher.encryptBlock(u);this._ghash=new a(f),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,f=i.alloc(8);f.writeUIntBE(u,0,8),n.update(f),t._finID=n.state;var c=i.from(t._finID);return h(c),c}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},f.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=f},function(t,e,r){var n=r(48),i=r(2).Buffer,o=r(23);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(0)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},function(t,e,r){var n=r(28);t.exports=v,v.simpleSieve=m,v.fermatTest=b;var i=r(126),o=new i(24),s=new(r(127)),a=new i(1),u=new i(2),h=new i(5),f=(new i(16),new i(8),new i(10)),c=new i(3),l=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function y(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}function m(t){for(var e=y(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function b(t){var e=i.mont(t);return 0===u.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function v(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(h))for(;r.mod(f).cmp(c);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(m(p=r.shrn(1))&&m(r)&&b(p)&&b(r)&&s.test(p)&&s.test(r))return r}}},function(t,e,r){(function(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(t,n){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(224).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,n):(this._parseBase(t,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var f=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!==(o=a>>>24-n&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?y+r:c[h-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,d=0|s[1],p=8191&d,y=d>>>13,m=0|s[2],b=8191&m,v=m>>>13,g=0|s[3],w=8191&g,_=g>>>13,M=0|s[4],S=8191&M,O=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,k=0|s[6],j=8191&k,$=k>>>13,P=0|s[7],R=8191&P,B=P>>>13,T=0|s[8],I=8191&T,N=T>>>13,D=0|s[9],C=8191&D,L=D>>>13,q=0|a[0],U=8191&q,F=q>>>13,z=0|a[1],V=8191&z,K=z>>>13,H=0|a[2],Z=8191&H,W=H>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,G=0|a[4],X=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ft=0|a[8],ct=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(y,U)|0,o=Math.imul(y,F);var bt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var vt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0;var gt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,F))+Math.imul(O,U)|0,o=Math.imul(O,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,F))+Math.imul($,U)|0,o=Math.imul($,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,F))+Math.imul(B,U)|0,o=Math.imul(B,F),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul($,Z)|0,o=o+Math.imul($,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0;var Ot=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,yt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,X)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,W))+Math.imul(L,Z)|0,o=Math.imul(L,W),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(L,Y)|0,o=Math.imul(L,Q),n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,X),i=(i=Math.imul(C,tt))+Math.imul(L,X)|0,o=Math.imul(L,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,ut)|0,o=o+Math.imul($,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var jt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul($,ct)|0,o=o+Math.imul($,lt)|0;var $t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var Pt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,pt)|0))<<13)|0;h=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,ut),i=(i=Math.imul(C,ht))+Math.imul(L,ut)|0,o=Math.imul(L,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,lt))+Math.imul(L,ct)|0,o=Math.imul(L,lt);var Bt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Tt=(h+(n=Math.imul(C,pt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(L,pt)|0))<<13)|0;return h=((o=Math.imul(L,yt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=mt,u[1]=bt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Ot,u[9]=At,u[10]=Et,u[11]=xt,u[12]=kt,u[13]=jt,u[14]=$t,u[15]=Pt,u[16]=Rt,u[17]=Bt,u[18]=Tt,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(y=p),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,l=h,d=0;d<s;d++){var p=r[f+d],y=n[f+d],m=r[f+d+s],b=n[f+d+s],v=c*m-l*b;b=c*b+l*m,m=v,r[f+d]=p+m,n[f+d]=y+b,r[f+d+s]=p-m,n[f+d+s]=y-b,d!==a&&(v=u*c-h*l,l=u*l+h*c,c=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(u)):(r.isub(e),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new O(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){O.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},o(w,g),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(_,g),o(M,g),o(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},O.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},O.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},O.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},O.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},O.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},O.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},O.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},O.prototype.isqr=function(t){return this.imul(t,t.clone())},O.prototype.sqr=function(t){return this.mul(t,t)},O.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var y=d,m=0;0!==y.cmp(a);m++)y=y.redSqr();i(m<p);var b=this.pow(c,new s(1).iushln(p-m-1));l=l.redMul(b),c=b.redSqr(),d=d.redMul(c),p=m}return l},O.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},O.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var c=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}u=26}return i},O.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},O.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},o(A,O),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e,r){var n=r(225),i=r(69);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var h=t.shrn(u),f=a.toRed(o);e>0;e--){var c=this._randrange(new n(2),a);r&&r(c);var l=c.toRed(o).redPow(h);if(0!==l.cmp(s)&&0!==l.cmp(f)){for(var d=1;d<u;d++){if(0===(l=l.redSqr()).cmp(s))return!1;if(0===l.cmp(f))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),h=s.toRed(i);e>0;e--){var f=this._randrange(new n(2),s),c=t.gcd(f);if(0!==c.cmpn(1))return c;var l=f.toRed(i).redPow(u);if(0!==l.cmp(o)&&0!==l.cmp(h)){for(var d=1;d<a;d++){if(0===(l=l.redSqr()).cmp(o))return l.fromRed().subn(1).gcd(t);if(0===l.cmp(h))break}if(d===a)return(l=l.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},function(t,e,r){"use strict";var n=e;function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){"use strict";var n=e;n.base=r(50),n.short=r(235),n.mont=r(236),n.edwards=r(237)},function(t,e,r){"use strict";var n=r(17).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(17),i=r(39),o=r(130),s=r(11),a=n.sum32,u=n.sum32_4,h=n.sum32_5,f=o.ch32,c=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,y=o.g1_256,m=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(v,m),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],b=this.h[3],v=this.h[4],g=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var M=h(_,d(v),f(v,g,w),this.k[n],r[n]),S=a(l(i),c(i,o,m));_=w,w=g,g=v,v=a(b,M),b=m,m=o,o=i,i=a(M,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],g),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(17),i=r(39),o=r(11),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,h=n.shr64_lo,f=n.sum64,c=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,m=n.sum64_5_lo,b=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function g(){if(!(this instanceof g))return new g;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function M(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function O(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function j(t,e){var r=a(t,e,1)^a(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function $(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,19)^a(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(g,b),t.exports=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=$(r[n-4],r[n-3]),o=P(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=k(r[n-30],r[n-29]),h=j(r[n-30],r[n-29]),f=r[n-32],c=r[n-31];r[n]=d(i,o,s,a,u,h,f,c),r[n+1]=p(i,o,s,a,u,h,f,c)}},g.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],h=this.h[5],d=this.h[6],p=this.h[7],b=this.h[8],v=this.h[9],g=this.h[10],k=this.h[11],j=this.h[12],$=this.h[13],P=this.h[14],R=this.h[15];o(this.k.length===r.length);for(var B=0;B<r.length;B+=2){var T=P,I=R,N=E(b,v),D=x(b,v),C=w(b,v,g,k,j),L=_(b,v,g,k,j,$),q=this.k[B],U=this.k[B+1],F=r[B],z=r[B+1],V=y(T,I,N,D,C,L,q,U,F,z),K=m(T,I,N,D,C,L,q,U,F,z);T=O(n,i),I=A(n,i),N=M(n,i,s,a,u),D=S(n,i,s,a,u,h);var H=c(T,I,N,D),Z=l(T,I,N,D);P=j,R=$,j=g,$=k,g=b,k=v,b=c(d,p,V,K),v=l(p,p,V,K),d=u,p=h,u=s,h=a,s=n,a=i,n=c(V,K,H,Z),i=l(V,K,H,Z)}f(this.h,0,n,i),f(this.h,2,s,a),f(this.h,4,u,h),f(this.h,6,d,p),f(this.h,8,b,v),f(this.h,10,g,k),f(this.h,12,j,$),f(this.h,14,P,R)},g.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=e;n.bignum=r(134),n.define=r(254).define,n.base=r(257),n.constants=r(258),n.decoders=r(137),n.encoders=r(135)},function(t,e,r){(function(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(t,n){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(253).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,n):(this._parseBase(t,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var f=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!==(o=a>>>24-n&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?y+r:c[h-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,d=0|s[1],p=8191&d,y=d>>>13,m=0|s[2],b=8191&m,v=m>>>13,g=0|s[3],w=8191&g,_=g>>>13,M=0|s[4],S=8191&M,O=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,k=0|s[6],j=8191&k,$=k>>>13,P=0|s[7],R=8191&P,B=P>>>13,T=0|s[8],I=8191&T,N=T>>>13,D=0|s[9],C=8191&D,L=D>>>13,q=0|a[0],U=8191&q,F=q>>>13,z=0|a[1],V=8191&z,K=z>>>13,H=0|a[2],Z=8191&H,W=H>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,G=0|a[4],X=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ft=0|a[8],ct=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(y,U)|0,o=Math.imul(y,F);var bt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var vt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0;var gt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,F))+Math.imul(O,U)|0,o=Math.imul(O,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,F))+Math.imul($,U)|0,o=Math.imul($,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,F))+Math.imul(B,U)|0,o=Math.imul(B,F),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul($,Z)|0,o=o+Math.imul($,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0;var Ot=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,yt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,X)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,W))+Math.imul(L,Z)|0,o=Math.imul(L,W),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(L,Y)|0,o=Math.imul(L,Q),n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,X),i=(i=Math.imul(C,tt))+Math.imul(L,X)|0,o=Math.imul(L,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,ut)|0,o=o+Math.imul($,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var jt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul($,ct)|0,o=o+Math.imul($,lt)|0;var $t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var Pt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,pt)|0))<<13)|0;h=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,ut),i=(i=Math.imul(C,ht))+Math.imul(L,ut)|0,o=Math.imul(L,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,lt))+Math.imul(L,ct)|0,o=Math.imul(L,lt);var Bt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Tt=(h+(n=Math.imul(C,pt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(L,pt)|0))<<13)|0;return h=((o=Math.imul(L,yt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=mt,u[1]=bt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Ot,u[9]=At,u[10]=Et,u[11]=xt,u[12]=kt,u[13]=jt,u[14]=$t,u[15]=Pt,u[16]=Rt,u[17]=Bt,u[18]=Tt,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(y=p),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,l=h,d=0;d<s;d++){var p=r[f+d],y=n[f+d],m=r[f+d+s],b=n[f+d+s],v=c*m-l*b;b=c*b+l*m,m=v,r[f+d]=p+m,n[f+d]=y+b,r[f+d+s]=p-m,n[f+d+s]=y-b,d!==a&&(v=u*c-h*l,l=u*l+h*c,c=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(u)):(r.isub(e),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new O(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){O.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},o(w,g),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(_,g),o(M,g),o(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},O.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},O.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},O.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},O.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},O.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},O.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},O.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},O.prototype.isqr=function(t){return this.imul(t,t.clone())},O.prototype.sqr=function(t){return this.mul(t,t)},O.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var y=d,m=0;0!==y.cmp(a);m++)y=y.redSqr();i(m<p);var b=this.pow(c,new s(1).iushln(p-m-1));l=l.redMul(b),c=b.redSqr(),d=d.redMul(c),p=m}return l},O.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},O.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var c=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}u=26}return i},O.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},O.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},o(A,O),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e,r){"use strict";var n=e;n.der=r(136),n.pem=r(255)},function(t,e,r){"use strict";var n=r(0),i=r(76).Buffer,o=r(77),s=r(79);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function h(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,o),u.prototype._encodeComposite=function(t,e,r,n){var o=function(t,e,r,n){var i;"seqof"===t?t="seq":"setof"===t&&(t="set");if(s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}if(i>=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(n.length<128){var a=i.alloc(2);return a[0]=o,a[1]=n.length,this._createEncoderBuffer([a,n])}for(var u=1,h=n.length;h>=256;h>>=8)u++;var f=i.alloc(2+u);f[0]=o,f[1]=128|u;for(var c=1+u,l=n.length;l>0;c--,l>>=8)f[c]=255&l;return this._createEncoderBuffer([f,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=i.alloc(2*t.length),n=0;n<t.length;n++)r.writeUInt16BE(t.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(var o=0;o<t.length;o++)t[o]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var s=0,a=0;a<t.length;a++){var u=t[a];for(s++;u>=128;u>>=7)s++}for(var h=i.alloc(s),f=h.length-1,c=t.length-1;c>=0;c--){var l=t[c];for(h[f--]=127&l;(l>>=7)>0;)h[f--]=128|127&l}return this._createEncoderBuffer(h)},u.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[h(n.getUTCFullYear()),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[h(n.getUTCFullYear()%100),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=i.from(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=i.alloc(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var s=1,a=t;a>=256;a>>=8)s++;for(var u=new Array(s),h=u.length-1;h>=0;h--)u[h]=255&t,t>>=8;return 128&u[0]&&u.unshift(0),this._createEncoderBuffer(i.from(u))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},function(t,e,r){"use strict";var n=e;n.der=r(138),n.pem=r(256)},function(t,e,r){"use strict";var n=r(0),i=r(134),o=r(40).DecoderBuffer,s=r(77),a=r(79);function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){s.call(this,"der",t)}function f(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function c(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o<i;o++){n<<=8;var s=t.readUInt8(r);if(t.isError(s))return s;n|=s}return n}t.exports=u,u.prototype.decode=function(t,e){return o.isDecoderBuffer(t)||(t=new o(t,e)),this.tree._decode(t,e)},n(h,s),h.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;var n=t.save(),i=f(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},h.prototype._decodeTag=function(t,e,r){var n=f(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;var i=c(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');var o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},h.prototype._skipUntilEnd=function(t,e){for(;;){var r=f(t,e);if(t.isError(r))return r;var n=c(t,r.primitive,e);if(t.isError(n))return n;var i=void 0;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},h.prototype._decodeList=function(t,e,r,n){for(var i=[];!t.isEmpty();){var o=this._peekTag(t,"end");if(t.isError(o))return o;var s=r.decode(t,"der",n);if(t.isError(s)&&o)break;i.push(s)}return i},h.prototype._decodeStr=function(t,e){if("bitstr"===e){var r=t.readUInt8();return t.isError(r)?r:{unused:r,data:t.raw()}}if("bmpstr"===e){var n=t.raw();if(n.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if("numstr"===e){var s=t.raw().toString("ascii");return this._isNumstr(s)?s:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){var a=t.raw().toString("ascii");return this._isPrintstr(a)?a:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},h.prototype._decodeObjid=function(t,e,r){for(var n,i=[],o=0,s=0;!t.isEmpty();)o<<=7,o|=127&(s=t.readUInt8()),0==(128&s)&&(i.push(o),o=0);128&s&&i.push(o);var a=i[0]/40|0,u=i[0]%40;if(n=r?i:[a,u].concat(i.slice(1)),e){var h=e[n.join(" ")];void 0===h&&(h=e[n.join(".")]),void 0!==h&&(n=h)}return n},h.prototype._decodeTime=function(t,e){var r,n,i,o,s,a,u=t.raw().toString();if("gentime"===e)r=0|u.slice(0,4),n=0|u.slice(4,6),i=0|u.slice(6,8),o=0|u.slice(8,10),s=0|u.slice(10,12),a=0|u.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");r=0|u.slice(0,2),n=0|u.slice(2,4),i=0|u.slice(4,6),o=0|u.slice(6,8),s=0|u.slice(8,10),a=0|u.slice(10,12),r=r<70?2e3+r:1900+r}return Date.UTC(r,n-1,i,o,s,a,0)},h.prototype._decodeNull=function(){return null},h.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},h.prototype._decodeInt=function(t,e){var r=t.raw(),n=new i(r);return e&&(n=e[n.toString(10)]||n),n},h.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},function(t){t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},function(t,e,r){var n=r(35),i=r(2).Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},function(t,e){t.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},function(t,e,r){var n=r(80),i=r(2).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},function(t,e){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=1e3,i=6e4,o=60*i,s=24*o;function a(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,e){e=e||{};var u=r(t);if("string"===u&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*o;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===u&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=s)return a(t,e,s,"day");if(e>=o)return a(t,e,o,"hour");if(e>=i)return a(t,e,i,"minute");if(e>=n)return a(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=s)return Math.round(t/s)+"d";if(e>=o)return Math.round(t/o)+"h";if(e>=i)return Math.round(t/i)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,r){"use strict";e.isMongooseArray=function(t){return Array.isArray(t)&&t.isMongooseArray}},function(t,e,r){"use strict";var n=/^function\s*([^\s(]+)/;t.exports=function(t){return t.name||(t.toString().trim().match(n)||[])[1]}},function(t,e,r){"use strict";var n=r(6);
  807. /*!
  808. * Get the bson type, if it exists
  809. */t.exports=function(t,e){return n(t,"_bsontype",void 0)===e}},function(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 i=Symbol("mongoose#trustedSymbol");e.trustedSymbol=i,e.trusted=function(t){return null==t||"object"!==n(t)||(t[i]=!0),t}},function(t,e,r){"use strict";(function(e){
  810. /*!
  811. * ignore
  812. */
  813. var n=r(43),i=r(284),o={_promise:null,get:function(){return o._promise},set:function(t){n.ok("function"==typeof t,"mongoose.Promise must be a function, got ".concat(t)),o._promise=t,i.Promise=t}};
  814. /*!
  815. * Use native promises by default
  816. */
  817. o.set(e.Promise),t.exports=o}).call(this,r(7))},function(t,e,r){"use strict";(function(t,r,n,i){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)}e.isNode=void 0!==t&&"object"==o(r)&&"object"==(void 0===n?"undefined":o(n))&&"function"==typeof i&&t.argv,e.isMongo=!e.isNode&&"function"==typeof printjson&&"function"==typeof ObjectId&&"function"==typeof rs&&"function"==typeof sh,e.isBrowser=!e.isNode&&!e.isMongo&&"undefined"!=typeof window,e.type=e.isNode?"node":e.isMongo?"mongo":e.isBrowser?"browser":"unknown"}).call(this,r(5),r(24)(t),r(7),r(3).Buffer)},function(t,e,r){"use strict";t.exports=function(t,e,r){for(var n={},i=0,o=Object.keys(e.tree);i<o.length;i++){var s=o[i];r&&(t.paths[s]||t.nested[s]||t.singleNestedPaths[s])||(n[s]=e.tree[s])}for(var a in t.add(n),t.callQueue=t.callQueue.concat(e.callQueue),t.method(e.methods),t.static(e.statics),e.query)t.query[a]=e.query[a];for(var u in e.virtuals)t.virtuals[u]=e.virtuals[u].clone();t.s.hooks.merge(e.s.hooks,!1)}},function(t,e,r){"use strict";
  818. /*!
  819. * Module requirements
  820. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=r(19),f=r(22),c=r(9),l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t){var e,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),r="model"===f(t)?t.constructor.modelName+" validation failed":"Validation failed",(e=a.call(this,r)).errors={},e._message=r,t&&(t.$errors=e.errors),e}return e=u,(r=[{key:"toString",value:function(){return this.name+": "+d(this)}
  821. /*!
  822. * inspect helper
  823. */},{key:"inspect",value:function(){return Object.assign(new Error(this.message),this)}
  824. /*!
  825. * add message
  826. */},{key:"addError",value:function(t,e){this.errors[t]=e,this.message=this._message+": "+d(this)}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(h);
  827. /*!
  828. * ignore
  829. */
  830. function d(t){for(var e,r=Object.keys(t.errors||{}),n=r.length,i=[],o=0;o<n;++o)e=r[o],t!==t.errors[e]&&i.push(e+": "+t.errors[e].message);return i.join(", ")}
  831. /*!
  832. * Module exports
  833. */c.inspect.custom&&(
  834. /*!
  835. * Avoid Node deprecation warning DEP0079
  836. */
  837. l.prototype[c.inspect.custom]=l.prototype.inspect)
  838. /*!
  839. * Helper for JSON.stringify
  840. * Ensure `name` and `message` show up in toJSON output re: gh-9847
  841. */,Object.defineProperty(l.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}}),Object.defineProperty(l.prototype,"name",{value:"ValidationError"}),t.exports=l},function(t,e,r){"use strict";
  842. /*!
  843. * Module dependencies.
  844. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=r(8),f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var r=t.message;r||(r=h.messages.general.default);var n=c(r,t);return e=a.call(this,n),t=Object.assign({},t,{message:n}),e.properties=t,e.kind=t.type,e.path=t.path,e.value=t.value,e.reason=t.reason,e}
  845. /*!
  846. * toString helper
  847. * TODO remove? This defaults to `${this.name}: ${this.message}`
  848. */return e=u,(r=[{key:"toString",value:function(){return this.message}
  849. /*!
  850. * Ensure `name` and `message` show up in toJSON output re: gh-9296
  851. */},{key:"toJSON",value:function(){return Object.assign({name:this.name,message:this.message},this)}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(h);
  852. /*!
  853. * Formats error messages
  854. */
  855. function c(t,e){if("function"==typeof t)return t(e);for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];"message"!==i&&(t=t.replace("{"+i.toUpperCase()+"}",e[i]))}return t}
  856. /*!
  857. * exports
  858. */Object.defineProperty(f.prototype,"name",{value:"ValidatorError"}),
  859. /*!
  860. * The object used to define this validator. Not enumerable to hide
  861. * it from `require('util').inspect()` output re: gh-3925
  862. */
  863. Object.defineProperty(f.prototype,"properties",{enumerable:!1,writable:!0,value:null}),f.prototype.formatMessage=c,t.exports=f},function(t,e,r){"use strict";
  864. /*!
  865. * ignore
  866. */t.exports=function(t){if(Array.isArray(t)){if(!t.every((function(t){return"number"==typeof t||"string"==typeof t})))throw new Error("$type array values must be strings or numbers");return t}if("number"!=typeof t&&"string"!=typeof t)throw new Error("$type parameter must be number, string, or array of numbers and strings");return t}},function(t,e,r){"use strict";
  867. /*!
  868. * Module dependencies.
  869. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var n=Array.isArray(e)?"array":"primitive value";return(r=a.call(this,"Tried to set nested object field `"+t+"` to ".concat(n," `")+e+"`")).path=t,r}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"ObjectExpectedError"}),t.exports=h},function(t,e,r){"use strict";t.exports=function(t){var e={_id:{auto:!0}};e._id[t.options.typeKey]="ObjectId",t.add(e)}},function(t,e,r){"use strict";t.exports=
  870. /*!
  871. * ignore
  872. */
  873. function(t,e){if(null==t)return null;if("boolean"==typeof t)return e;if("boolean"==typeof t[e])return t[e]?e:null;if(!(e in t))return e;return t[e]}},function(t,e,r){"use strict";var n=r(55),i=r(53);
  874. /*!
  875. * Register hooks for this model
  876. *
  877. * @param {Model} model
  878. * @param {Schema} schema
  879. */
  880. function o(t,e,r){var s={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},a=(r=r||{}).decorateDoc?t:t.prototype;t.$appliedHooks=!0;for(var u=0,h=Object.keys(e.paths);u<h.length;u++){var f=h[u],c=e.paths[f],l=null;if(c.$isSingleNested)l=c.caster;else{if(!c.$isMongooseDocumentArray)continue;l=c.Constructor}if(!l.$appliedHooks&&(o(l,c.schema,r),null!=l.discriminators))for(var d=0,p=Object.keys(l.discriminators);d<p.length;d++){var y=p[d];o(l.discriminators[y],l.discriminators[y].schema,r)}}var m=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[n.builtInMiddleware]}));t._middleware=m,a.$__originalValidate=a.$__originalValidate||a.$__validate;for(var b=0,v=["save","validate","remove","deleteOne"];b<v.length;b++){var g=v[b],w="validate"===g?"$__originalValidate":"$__".concat(g),_=m.createWrapper(g,a[w],null,s);a["$__".concat(g)]=_}a.$__init=m.createWrapperSync("init",a.$__init,null,s);for(var M=Object.keys(e.methods),S=Object.assign({},s,{checkForPromise:!0}),O=function(){var e=E[A];if(!m.hasHooks(e))return"continue";var r=a[e];a[e]=function(){var r=this,n=Array.prototype.slice.call(arguments),o=n.slice(-1).pop(),s="function"==typeof o?n.slice(0,n.length-1):n;return i(o,(function(t){return r["$__".concat(e)].apply(r,s.concat([t]))}),t.events)},a["$__".concat(e)]=m.createWrapper(e,r,null,S)},A=0,E=M;A<E.length;A++)O()}
  881. /*!
  882. * ignore
  883. */
  884. t.exports=o,
  885. /*!
  886. * ignore
  887. */
  888. o.middlewareFunctions=["deleteOne","save","validate","remove","updateOne","init"]},function(t,e,r){"use strict";var n=r(20);
  889. /*!
  890. * Given a value, cast it to a string, or throw a `CastError` if the value
  891. * cannot be casted. `null` and `undefined` are considered valid.
  892. *
  893. * @param {Any} value
  894. * @param {String} [path] optional the path to set on the CastError
  895. * @return {string|null|undefined}
  896. * @throws {CastError}
  897. * @api private
  898. */t.exports=function(t,e){if(null==t)return t;if(t._id&&"string"==typeof t._id)return t._id;if(t.toString&&t.toString!==Object.prototype.toString&&!Array.isArray(t))return t.toString();throw new n("string",t,e)}},function(t,e,r){"use strict";
  899. /*!
  900. * Module requirements.
  901. */var n=r(8),i=r(319),o=r(10),s=r(160),a=r(161),u=r(4),h=o.CastError;function f(t,e){o.call(this,t,e,"Number")}
  902. /*!
  903. * ignore
  904. */
  905. function c(t){return this.cast(t)}f.get=o.get,f.set=o.set,
  906. /*!
  907. * ignore
  908. */
  909. f._cast=s,f.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},
  910. /*!
  911. * ignore
  912. */
  913. f._defaultCaster=function(t){if("number"!=typeof t)throw new Error;return t},f.schemaName="Number",f.defaultOptions={},
  914. /*!
  915. * Inherits from SchemaType.
  916. */
  917. f.prototype=Object.create(o.prototype),f.prototype.constructor=f,f.prototype.OptionsConstructor=i,
  918. /*!
  919. * ignore
  920. */
  921. f._checkRequired=function(t){return"number"==typeof t||t instanceof Number},f.checkRequired=o.checkRequired,f.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():f.checkRequired())(t)},f.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||n.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},f.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||n.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},f.prototype.enum=function(t,e){if(this.enumValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.enumValidator}),this)),!Array.isArray(t)){var r=u.isPOJO(t)&&null!=t.values;r?(e=t.message,t=t.values):"number"==typeof t&&(t=Array.prototype.slice.call(arguments),e=null),u.isPOJO(t)&&(t=Object.values(t)),e=e||n.messages.Number.enum}return e=null==e?n.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},f.prototype.cast=function(t,e,r){if(o._isRef(this,t,e,r)){if("number"==typeof t)return t;if(null==t||u.isNonBuiltinObject(t))return this._castRef(t,e,r)}var n,i=t&&void 0!==t._id?t._id:t;n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():f.cast();try{return n(i)}catch(t){throw new h("Number",i,this.path,t,this)}},f.prototype.$conditionalHandlers=u.options(o.prototype.$conditionalHandlers,{$bitsAllClear:a,$bitsAnyClear:a,$bitsAllSet:a,$bitsAnySet:a,$gt:c,$gte:c,$lt:c,$lte:c,$mod:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.cast(t)})):[this.cast(t)]}}),f.prototype.castForQuery=function(t,e){var r;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new h("number",e,this.path,null,this);return r.call(this,e)}return e=this._castForQuery(t)},
  922. /*!
  923. * Module exports.
  924. */
  925. t.exports=f},function(t,e,r){"use strict";var n=r(43);
  926. /*!
  927. * Given a value, cast it to a number, or throw a `CastError` if the value
  928. * cannot be casted. `null` and `undefined` are considered valid.
  929. *
  930. * @param {Any} value
  931. * @param {String} [path] optional the path to set on the CastError
  932. * @return {Boolean|null|undefined}
  933. * @throws {Error} if `value` is not one of the allowed values
  934. * @api private
  935. */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()))}},function(t,e,r){"use strict";(function(e){
  936. /*!
  937. * Module requirements.
  938. */
  939. var n=r(20);
  940. /*!
  941. * ignore
  942. */
  943. /*!
  944. * ignore
  945. */
  946. function i(t,e){var r=Number(e);if(isNaN(r))throw new n("number",e,t);return r}t.exports=function(t){var r=this;return Array.isArray(t)?t.map((function(t){return i(r.path,t)})):e.isBuffer(t)?t:i(r.path,t)}}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(163);
  947. /*!
  948. * returns discriminator by discriminatorMapping.value
  949. *
  950. * @param {Schema} schema
  951. * @param {string} value
  952. */t.exports=function(t,e){if(null==t||null==t.discriminators)return null;for(var r=0,i=Object.keys(t.discriminators);r<i.length;r++){var o=i[r],s=t.discriminators[o];if(null!=s.discriminatorMapping&&n(s.discriminatorMapping.value,e))return s}return null}},function(t,e,r){"use strict";var n=r(18);t.exports=function(t,e){return"string"==typeof t&&"string"==typeof e||"number"==typeof t&&"number"==typeof e?t===e:t instanceof n&&e instanceof n&&t.toString()===e.toString()}},function(t,e,r){"use strict";var n=new Set(["$ref","$id","$db"]);t.exports=function(t){return t.startsWith("$")&&!n.has(t)}},function(t,e,r){"use strict";
  953. /*!
  954. * Module requirements.
  955. */var n=r(56).castArraysOfNumbers,i=r(56).castToNumber;function o(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=i.call(t,e.$maxDistance)),e.$minDistance&&(e.$minDistance=i.call(t,e.$minDistance))}
  956. /*!
  957. * ignore
  958. */
  959. e.cast$geoIntersects=function(t){if(!t.$geometry)return;return o(t,this),t},e.cast$near=function(t){var e=r(88);if(Array.isArray(t))return n(t,this),t;if(s(this,t),t&&t.$geometry)return o(t,this);if(!Array.isArray(t))throw new TypeError("$near must be either an array or an object with a $geometry property");return e.prototype.castForQuery.call(this,t)},e.cast$within=function(t){var e=this;if(s(this,t),t.$box||t.$polygon){var r=t.$box?"$box":"$polygon";t[r].forEach((function(t){if(!Array.isArray(t))throw new TypeError("Invalid $within $box argument. Expected an array, received "+t);t.forEach((function(r,n){t[n]=i.call(e,r)}))}))}else if(t.$center||t.$centerSphere){var n=t.$center?"$center":"$centerSphere";t[n].forEach((function(r,o){Array.isArray(r)?r.forEach((function(t,n){r[n]=i.call(e,t)})):t[n][o]=i.call(e,r)}))}else t.$geometry&&o(t,this);return t}},function(t,e,r){"use strict";
  960. /*!
  961. * Module dependencies.
  962. */function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(14),o=r(89),s=r(1).arrayAtomicsSymbol,a=r(1).arrayAtomicsBackupSymbol,u=r(1).arrayParentSymbol,h=r(1).arrayPathSymbol,f=r(1).arraySchemaSymbol,c=Array.prototype.push,l=/^\d+$/;
  963. /*!
  964. * Module exports.
  965. */
  966. t.exports=function(t,e,r,d){var p,y;if(Array.isArray(t)){var m=t.length;if(0===m)y=new Array;else if(1===m)(y=new Array(1))[0]=t[0];else if(m<1e4)y=new Array,c.apply(y,t);else{y=new Array;for(var b=0;b<m;++b)c.apply(y,t[b])}}else y=[];var v=(n(p={},s,{}),n(p,a,void 0),n(p,h,e),n(p,f,d),n(p,u,void 0),n(p,"isMongooseArray",!0),n(p,"isMongooseArrayProxy",!0),n(p,"__array",y),p);t&&null!=t[s]&&(v[s]=t[s]),null!=r&&r instanceof i&&(v[u]=r,v[f]=d||r.schema.path(e));var g=new Proxy(y,{get:function(t,e){return v.hasOwnProperty(e)?v[e]:o.hasOwnProperty(e)?o[e]:y[e]},set:function(t,e,r){return"string"==typeof e&&l.test(e)?o.set.call(g,e,r,!1):v.hasOwnProperty(e)?v[e]=r:y[e]=r,!0}});return g}},function(t,e,r){"use strict";
  967. /*!
  968. * ignore
  969. */t.exports=function(t,e,r){var n=(r=r||{}).skipDocArrays,i=0;if(!t)return i;for(var o=0,s=Object.keys(t.$__.activePaths.states.modify);o<s.length;o++){var a=s[o];if(n){var u=t.$__schema.path(a);if(u&&u.$isMongooseDocumentArray)continue}if(a.startsWith(e+".")&&(delete t.$__.activePaths.states.modify[a],++i,t.$isSubdocument)){var h=t.ownerDocument(),f=t.$__fullPath(a);delete h.$__.activePaths.states.modify[f]}}return i}},function(t,e,r){"use strict";(function(e){
  970. /*!
  971. * Module dependencies.
  972. */
  973. var n=r(25).get().Binary,i=r(4);function o(t,r,n){var s,u,h,f,c=t;return null==t&&(c=0),Array.isArray(r)?(u=r[0],h=r[1]):s=r,f="number"==typeof c||c instanceof Number?e.alloc(c):e.from(c,s,n),i.decorate(f,o.mixin),f.isMongooseBuffer=!0,f[o.pathSymbol]=u,f[a]=h,f._subtype=0,f}var s=Symbol.for("mongoose#Buffer#_path"),a=Symbol.for("mongoose#Buffer#_parent");o.pathSymbol=s,
  974. /*!
  975. * Inherit from Buffer.
  976. */
  977. o.mixin={_subtype:void 0,_markModified:function(){var t=this[a];return t&&t.markModified(this[o.pathSymbol]),this},write:function(){var t=e.prototype.write.apply(this,arguments);return t>0&&this._markModified(),t},copy:function(t){var r=e.prototype.copy.apply(this,arguments);return t&&t.isMongooseBuffer&&t._markModified(),r}},
  978. /*!
  979. * Compile other Buffer methods marking this buffer as modified.
  980. */
  981. "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".split(" ").forEach((function(t){e.prototype[t]&&(o.mixin[t]=function(){var r=e.prototype[t].apply(this,arguments);return this._markModified(),r})})),o.mixin.toObject=function(t){var r="number"==typeof t?t:this._subtype||0;return new n(e.from(this),r)},o.mixin.$toObject=o.mixin.toObject,o.mixin.toBSON=function(){return new n(this,this._subtype||0)},o.mixin.equals=function(t){if(!e.isBuffer(t))return!1;if(this.length!==t.length)return!1;for(var r=0;r<this.length;++r)if(this[r]!==t[r])return!1;return!0},o.mixin.subtype=function(t){if("number"!=typeof t)throw new TypeError("Invalid subtype. Expected a number");this._subtype!==t&&this._markModified(),this._subtype=t},
  982. /*!
  983. * Module exports.
  984. */
  985. o.Binary=n,t.exports=o}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(25).get().ObjectId;t.exports=function(t){if(null==t)return t;if(t instanceof n)return t;if(t._id){if(t._id instanceof n)return t._id;if(t._id.toString instanceof Function)return new n(t._id.toString())}return t.toString instanceof Function?new n(t.toString()):new n(t)}},function(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 i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=u(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function u(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}function h(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,p(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function c(t,e,r){return(c=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&d(i,r.prototype),i}).apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=r(45),m=r(18),b=r(41),v=r(4).deepEqual,g=r(6),w=r(22),_=r(171),M=r(9),S=r(82),O=r(1).populateModelSymbol,A=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(c,t);var e,r,n,o,u,f=(e=c,r=l(),function(){var t,n=p(e);if(r){var i=p(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return h(this,t)});function c(t,e,r,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),"Object"===w(t)&&(t=Object.keys(t).reduce((function(e,r){return e.concat([[r,t[r]]])}),[])),(i=f.call(this,t)).$__parent=null!=r&&null!=r.$__?r:null,i.$__path=e,i.$__schemaType=null==n?new y(e):n,i.$__runDeferred(),i}return n=c,(o=[{key:"$init",value:function(t,e){E(t),a(p(c.prototype),"set",this).call(this,t,e),null!=e&&e.$isSingleNested&&(e.$basePath=this.$__path+"."+t)}},{key:"$__set",value:function(t,e){a(p(c.prototype),"set",this).call(this,t,e)}},{key:"get",value:function(t,e){return t instanceof m&&(t=t.toString()),!1===(e=e||{}).getters?a(p(c.prototype),"get",this).call(this,t):this.$__schemaType.applyGetters(a(p(c.prototype),"get",this).call(this,t),this.$__parent)}},{key:"set",value:function(t,e){if(t instanceof m&&(t=t.toString()),E(t),e=_(e),null==this.$__schemaType)return this.$__deferred=this.$__deferred||[],void this.$__deferred.push({key:t,value:e});var r=this.$__path+"."+t,n=null!=this.$__parent&&this.$__parent.$__?this.$__parent.$populated(r)||this.$__parent.$populated(this.$__path):null,i=this.get(t);if(null!=n)null==e.$__&&(e=new n.options[O](e)),e.$__.wasPopulated=!0;else try{e=this.$__schemaType.applySetters(e,this.$__parent,!1,this.get(t),{path:r})}catch(t){if(null!=this.$__parent&&null!=this.$__parent.$__)return void this.$__parent.invalidate(r,t);throw t}a(p(c.prototype),"set",this).call(this,t,e),null!=e&&e.$isSingleNested&&(e.$basePath=this.$__path+"."+t);var o=this.$__parent;null==o||null==o.$__||v(e,i)||o.markModified(this.$__path+"."+t)}},{key:"clear",value:function(){a(p(c.prototype),"clear",this).call(this);var t=this.$__parent;null!=t&&t.markModified(this.$__path)}},{key:"delete",value:function(t){t instanceof m&&(t=t.toString()),this.set(t,void 0),a(p(c.prototype),"delete",this).call(this,t)}},{key:"toBSON",value:function(){return new Map(this)}},{key:"toObject",value:function(t){if(g(t,"flattenMaps")){var e,r={},n=i(this.keys());try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=b(this.get(o),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(g(t,"flattenMaps",!0)){var e,r={},n=i(this.keys());try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=b(this.get(o),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=i(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}}}])&&s(n.prototype,o),u&&s(n,u),Object.defineProperty(n,"prototype",{writable:!1}),c}(f(Map));
  986. /*!
  987. * Since maps are stored as objects under the hood, keys must be strings
  988. * and can't contain any invalid characters
  989. */
  990. function E(t){var e=n(t);if("string"!==e)throw new TypeError("Mongoose maps only support string keys, got ".concat(e));if(t.startsWith("$"))throw new Error('Mongoose maps do not support keys that start with "$", got "'.concat(t,'"'));if(t.includes("."))throw new Error('Mongoose maps do not support keys that contain ".", got "'.concat(t,'"'));if(S.has(t))throw new Error('Mongoose maps do not support reserved key name "'.concat(t,'"'))}M.inspect.custom&&Object.defineProperty(A.prototype,M.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:A.prototype.inspect}),Object.defineProperty(A.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(A.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(A.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(A.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(A.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0}),Object.defineProperty(A.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0}),t.exports=A},function(t,e,r){"use strict";var n=r(4);t.exports=function(t){return n.isPOJO(t)&&null!=t.$__&&null!=t._doc?t._doc:t}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(45),s=r(91).defineKey,a=r(6),u=r(4),h={toJSON:!0,toObject:!0,_id:!0,id:!0};
  991. /*!
  992. * ignore
  993. */
  994. t.exports=function(t,e,r,i,f){if(!r||!r.instanceOfSchema)throw new Error("You must pass a valid discriminator Schema");if(t.schema.discriminatorMapping&&!t.schema.discriminatorMapping.isRoot)throw new Error('Discriminator "'+e+'" can only be a discriminator of the root model');if(f){var c=a(t.base,"options.applyPluginsToDiscriminators",!1);t.base._applyPlugins(r,{skipTopLevel:!c})}var l=t.schema.options.discriminatorKey,d=t.schema.path(l);if(null!=d)u.hasUserDefinedProperty(d.options,"select")||(d.options.select=!0),d.options.$skipDiscriminatorCheck=!0;else{var p={};p[l]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},p[l][t.schema.options.typeKey]=String,t.schema.add(p),s({prop:l,prototype:t.prototype,options:t.schema.options})}if(r.path(l)&&!0!==r.path(l).options.$skipDiscriminatorCheck)throw new Error('Discriminator "'+e+'" cannot have field with name "'+l+'"');var y=e;if(("string"==typeof i&&i.length||null!=i)&&(y=i),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 f=a[s];if(e.nested[f])i.push(f);else if(-1!==f.indexOf(".")){var c,p="",m=n(f.split(".").slice(0,-1));try{for(m.s();!(c=m.n()).done;){var b=c.value;p+=(p.length?".":"")+b,(e.paths[p]instanceof o||e.singleNestedPaths[p]instanceof o)&&i.push(f)}}catch(t){m.e(t)}finally{m.f()}}}u.merge(e,r,{isDiscriminatorSchemaMerge:!0,omit:{discriminators:!0,base:!0},omitNested:i.reduce((function(t,e){return t["tree."+e]=!0,t}),{})});for(var v=0,g=i;v<g.length;v++){var w=g[v];delete e.paths[w]}e.childSchemas.forEach((function(t){t.model.prototype.$__setSchema(t.schema)}));var _={};_[l]={default:y,select:!0,set:function(t){if(t===y||Array.isArray(y)&&u.deepEqual(t,y))return y;throw new Error("Can't set discriminator key \""+l+'"')},$skipDiscriminatorCheck:!0},_[l][e.options.typeKey]=d?d.options[e.options.typeKey]:String,e.add(_),e.discriminatorMapping={key:l,value:y,isRoot:!1},r.options.collection&&(e.options.collection=r.options.collection);var M=e.options.toJSON,S=e.options.toObject,O=e.options._id,A=e.options.id,E=Object.keys(e.options);e.options.discriminatorKey=r.options.discriminatorKey;for(var x=0,k=E;x<k.length;x++){var j=k[x];if(!h[j]){if("pluralization"===j&&1==e.options[j]&&null==r.options[j])continue;if(!u.deepEqual(e.options[j],r.options[j]))throw new Error("Can't customize discriminator option "+j+" (can only modify "+Object.keys(h).join(", ")+")")}}e.options=u.clone(r.options),M&&(e.options.toJSON=M),S&&(e.options.toObject=S),void 0!==O&&(e.options._id=O),e.options.id=A,e.s.hooks=t.schema.s.hooks.merge(e.s.hooks),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:l,value:null,isRoot:!0}),t.schema.discriminators||(t.schema.discriminators={}),t.schema.discriminators[e]=r,t.discriminators[e]&&!r.options.overwriteModels)throw new Error('Discriminator with name "'+e+'" already exists');return r}},function(t,e,r){"use strict";var n=r(155);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}},function(t,e,r){"use strict";var n=r(57);
  995. /*!
  996. * Find the correct constructor, taking into account discriminators
  997. */t.exports=function(t,e){var r=t.schema.options.discriminatorKey;if(null!=e&&t.discriminators&&null!=e[r])if(t.discriminators[e[r]])t=t.discriminators[e[r]];else{var i=n(t.discriminators,e[r]);i&&(t=i)}return t}},function(t,e,r){"use strict";t.exports=r(176)},function(t,e,r){"use strict";(function(n){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}r(25).set(r(179));var f=r(274),c=r(148);f.setBrowser(!0),Object.defineProperty(e,"Promise",{get:function(){return c.get()},set:function(t){c.set(t)}}),e.PromiseProvider=c,e.Error=r(8),e.Schema=r(85),e.Types=r(58),e.VirtualType=r(86),e.SchemaType=r(10),e.utils=r(4),e.Document=f(),e.model=function(t,r){var n=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,n,i,u=a(h);function h(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),u.call(this,t,r,e)}return e=h,n&&o(e.prototype,n),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(e.Document);return n.modelName=t,n},
  998. /*!
  999. * Module exports.
  1000. */
  1001. "undefined"!=typeof window&&(window.mongoose=t.exports,window.Buffer=n)}).call(this,r(3).Buffer)},function(t,e,r){"use strict";e.byteLength=function(t){var e=h(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=h(t),s=n[0],a=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[f++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(f(t,s,s+16383>a?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function h(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
  1002. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  1003. e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,h=u>>1,f=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=h}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,f=(1<<h)-1,c=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*y}},function(t,e,r){"use strict";
  1004. /*!
  1005. * Module exports.
  1006. */e.Binary=r(180),e.Collection=function(){throw new Error("Cannot create a collection from browser library")},e.getConnection=function(){return function(){throw new Error("Cannot create a connection from browser library")}},e.Decimal128=r(271),e.ObjectId=r(272),e.ReadPreference=r(273)},function(t,e,r){"use strict";
  1007. /*!
  1008. * Module dependencies.
  1009. */var n=r(59).Binary;
  1010. /*!
  1011. * Module exports.
  1012. */t.exports=n},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(28),e.createHash=e.Hash=r(35),e.createHmac=e.Hmac=r(110);var n=r(206),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var s=r(113);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var a=r(208);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var u=r(223);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var h=r(230);e.createSign=h.createSign,e.Sign=h.Sign,e.createVerify=h.createVerify,e.Verify=h.Verify,e.createECDH=r(263);var f=r(266);e.publicEncrypt=f.publicEncrypt,e.privateEncrypt=f.privateEncrypt,e.publicDecrypt=f.publicDecrypt,e.privateDecrypt=f.privateDecrypt;var c=r(270);e.randomFill=c.randomFill,e.randomFillSync=c.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e,r){
  1013. /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  1014. var n=r(3),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e){},function(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 i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=r(3).Buffer,a=r(185).inspect,u=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,h;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,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){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),h&&o(e,h),t}()},function(t,e){},function(t,e,r){
  1015. /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  1016. var n=r(3),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";(function(e){var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(61),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),h=Symbol("ended"),f=Symbol("lastPromise"),c=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[f]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function y(t){e.nextTick(p,t)}var m=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((i(n={get stream(){return this[l]},next:function(){var t=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[h])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(r,n){e.nextTick((function(){t[u]?n(t[u]):r(d(void 0,!0))}))}));var n,i=this[f];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[h]?r(d(void 0,!0)):e[c](r,n)}),n)}}(i,this));else{var o=this[l].read();if(null!==o)return Promise.resolve(d(o,!1));n=new Promise(this[c])}return this[f]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),m);t.exports=function(t){var e,r=Object.create(b,(i(e={},l,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,h,{value:t._readableState.endEmitted,writable:!0}),i(e,c,{value:function(t,e){var n=r[l].read();n?(r[f]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[f]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[f]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[h]=!0})),t.on("readable",y.bind(null,r)),r}}).call(this,r(5))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,r){"use strict";t.exports=i;var n=r(102);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(0)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var n;var i=r(29).codes,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(61)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function h(t){t()}function f(t,e){return t.pipe(e)}function c(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=c(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){n||(n=t),t&&s.forEach(h),o||(s.forEach(h),i(n))}))}));return e.reduce(f)}},function(t,e,r){var n=r(0),i=r(31),o=r(2).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function h(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=n)<<5|e>>>27)+f(d,i,o,a)+u+r[l]+s[d];u=a,a=o,o=h(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(0),i=r(31),o=r(2).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function h(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),y=h(n)+c(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=f(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(0),i=r(103),o=r(31),s=r(2).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},function(t,e,r){var n=r(0),i=r(104),o=r(31),s=r(2).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},function(t,e,r){t.exports=i;var n=r(13).EventEmitter;function i(){n.call(this)}r(0)(i,n),i.Readable=r(64),i.Writable=r(201),i.Duplex=r(202),i.Transform=r(203),i.PassThrough=r(204),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function h(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",h),t.removeListener("error",h),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",h),t.on("error",h),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e){},function(t,e,r){"use strict";var n=r(2).Buffer,i=r(198);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=o,i=a,e.copy(r,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,s,a,u=1,h={},f=!1,c=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,n=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return h[u]=i,n(u),u++},l.clearImmediate=d}function d(t){delete h[t]}function p(t){if(f)setTimeout(p,0,t);else{var e=h[t];if(e){f=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{d(t),f=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(7),r(5))},function(t,e,r){"use strict";t.exports=o;var n=r(109),i=Object.create(r(37));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(0),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(65)},function(t,e,r){t.exports=r(26)},function(t,e,r){t.exports=r(64).Transform},function(t,e,r){t.exports=r(64).PassThrough},function(t,e,r){"use strict";var n=r(0),i=r(2).Buffer,o=r(23),s=i.alloc(128);function a(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=i.concat([e,s],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),a=0;a<64;a++)r[a]=54^e[a],n[a]=92^e[a];this._hash=[r]}n(a,o),a.prototype._update=function(t){this._hash.push(t)},a.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=a},function(t,e,r){t.exports=r(112)},function(t,e,r){(function(e){var n,i,o=r(2).Buffer,s=r(114),a=r(115),u=r(116),h=r(117),f=e.crypto&&e.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function d(){return i||(i=e.process&&e.process.nextTick?e.process.nextTick:e.queueMicrotask?e.queueMicrotask:e.setImmediate?e.setImmediate:e.setTimeout)}function p(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,i,y,m,b){"function"==typeof m&&(b=m,m=void 0);var v=c[(m=m||"sha1").toLowerCase()];if(v&&"function"==typeof e.Promise){if(s(i,y),t=h(t,a,"Password"),r=h(r,a,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){d()((function(){e(null,t)}))}),(function(t){d()((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==l[t])return l[t];var r=p(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return l[t]=r,r}(v).then((function(e){return e?p(t,r,i,y,v):u(t,r,i,y,m)})),b)}else d()((function(){var e;try{e=u(t,r,i,y,m)}catch(t){return b(t)}b(null,e)}))}}).call(this,r(7))},function(t,e,r){var n=r(209),i=r(67),o=r(68),s=r(222),a=r(49);function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function h(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},e.createCipheriv=e.Cipheriv=u,e.createDecipher=e.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return h(t,i.key,i.iv)},e.createDecipheriv=e.Decipheriv=h,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},function(t,e,r){var n=r(23),i=r(210),o=r(0),s=r(2).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=u,o(u,n),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},function(t,e,r){"use strict";e.utils=r(118),e.Cipher=r(66),e.DES=r(119),e.CBC=r(211),e.EDE=r(212)},function(t,e,r){"use strict";var n=r(11),i=r(0),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];o._update.call(this,s,0,r,n);for(a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{o._update.call(this,t,e,r,n);for(a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},function(t,e,r){"use strict";var n=r(11),i=r(0),o=r(66),s=r(119);function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},function(t,e,r){var n=r(68),i=r(123),o=r(2).Buffer,s=r(124),a=r(23),u=r(48),h=r(49);function f(t,e,r){a.call(this),this._cache=new l,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(0)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var c=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new f(a.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=h(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},function(t,e){e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},function(t,e,r){var n=r(38);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},function(t,e,r){var n=r(2).Buffer,i=r(38);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},function(t,e,r){var n=r(2).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},function(t,e,r){var n=r(2).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},function(t,e,r){(function(t){var n=r(38);function i(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,i(e)]);var o=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),n(r,o)}}).call(this,r(3).Buffer)},function(t,e,r){var n=r(2).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},function(t,e,r){var n=r(123),i=r(2).Buffer,o=r(68),s=r(124),a=r(23),u=r(48),h=r(49);function f(t,e,r){a.call(this),this._cache=new c,this._last=void 0,this._cipher=new u.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function c(){this.cache=i.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new f(a.module,e,r)}r(0)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},c.prototype.add=function(t){this.cache=i.concat([this.cache,t])},c.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=h(e,!1,r.key,r.iv);return l(t,n.key,n.iv)},e.createDecipheriv=l},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e,r){(function(t){var n=r(125),i=r(228),o=r(229);var s={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(e){var r=new t(i[e].prime,"hex"),n=new t(i[e].gen,"hex");return new o(r,n)},e.createDiffieHellman=e.DiffieHellman=function e(r,i,a,u){return t.isBuffer(i)||void 0===s[i]?e(r,"binary",i,a):(i=i||"binary",u=u||"binary",a=a||new t([2]),t.isBuffer(a)||(a=new t(a,u)),"number"==typeof r?new o(n(r,a),a,!0):(t.isBuffer(r)||(r=new t(r,i)),new o(r,a,!0)))}}).call(this,r(3).Buffer)},function(t,e){},function(t,e,r){(function(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(t,n){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(226).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,n):(this._parseBase(t,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var f=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!==(o=a>>>24-n&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?y+r:c[h-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,d=0|s[1],p=8191&d,y=d>>>13,m=0|s[2],b=8191&m,v=m>>>13,g=0|s[3],w=8191&g,_=g>>>13,M=0|s[4],S=8191&M,O=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,k=0|s[6],j=8191&k,$=k>>>13,P=0|s[7],R=8191&P,B=P>>>13,T=0|s[8],I=8191&T,N=T>>>13,D=0|s[9],C=8191&D,L=D>>>13,q=0|a[0],U=8191&q,F=q>>>13,z=0|a[1],V=8191&z,K=z>>>13,H=0|a[2],Z=8191&H,W=H>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,G=0|a[4],X=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ft=0|a[8],ct=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(y,U)|0,o=Math.imul(y,F);var bt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var vt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0;var gt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,F))+Math.imul(O,U)|0,o=Math.imul(O,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,F))+Math.imul($,U)|0,o=Math.imul($,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,F))+Math.imul(B,U)|0,o=Math.imul(B,F),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul($,Z)|0,o=o+Math.imul($,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0;var Ot=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,yt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,X)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,W))+Math.imul(L,Z)|0,o=Math.imul(L,W),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(L,Y)|0,o=Math.imul(L,Q),n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,X),i=(i=Math.imul(C,tt))+Math.imul(L,X)|0,o=Math.imul(L,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,ut)|0,o=o+Math.imul($,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var jt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul($,ct)|0,o=o+Math.imul($,lt)|0;var $t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var Pt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,pt)|0))<<13)|0;h=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,ut),i=(i=Math.imul(C,ht))+Math.imul(L,ut)|0,o=Math.imul(L,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,lt))+Math.imul(L,ct)|0,o=Math.imul(L,lt);var Bt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Tt=(h+(n=Math.imul(C,pt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(L,pt)|0))<<13)|0;return h=((o=Math.imul(L,yt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=mt,u[1]=bt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Ot,u[9]=At,u[10]=Et,u[11]=xt,u[12]=kt,u[13]=jt,u[14]=$t,u[15]=Pt,u[16]=Rt,u[17]=Bt,u[18]=Tt,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(y=p),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,l=h,d=0;d<s;d++){var p=r[f+d],y=n[f+d],m=r[f+d+s],b=n[f+d+s],v=c*m-l*b;b=c*b+l*m,m=v,r[f+d]=p+m,n[f+d]=y+b,r[f+d+s]=p-m,n[f+d+s]=y-b,d!==a&&(v=u*c-h*l,l=u*l+h*c,c=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(u)):(r.isub(e),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new O(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){O.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},o(w,g),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(_,g),o(M,g),o(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},O.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},O.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},O.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},O.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},O.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},O.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},O.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},O.prototype.isqr=function(t){return this.imul(t,t.clone())},O.prototype.sqr=function(t){return this.mul(t,t)},O.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var y=d,m=0;0!==y.cmp(a);m++)y=y.redSqr();i(m<p);var b=this.pow(c,new s(1).iushln(p-m-1));l=l.redMul(b),c=b.redSqr(),d=d.redMul(c),p=m}return l},O.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},O.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var c=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}u=26}return i},O.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},O.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},o(A,O),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e){},function(t,e){},function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(t,e,r){(function(e){var n=r(126),i=new(r(127)),o=new n(24),s=new n(11),a=new n(10),u=new n(3),h=new n(7),f=r(125),c=r(28);function l(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new n(t),this}function d(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new n(t),this}t.exports=y;var p={};function y(t,e,r){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=l,this.setPrivateKey=d):this._primeCode=8}function m(t,r){var n=new e(t.toArray());return r?n.toString(r):n}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in p)return p[n];var c,l=0;if(t.isEven()||!f.simpleSieve||!f.fermatTest(t)||!i.test(t))return l+=1,l+="02"===r||"05"===r?8:4,p[n]=l,l;switch(i.test(t.shrn(1))||(l+=2),r){case"02":t.mod(o).cmp(s)&&(l+=8);break;case"05":(c=t.mod(a)).cmp(u)&&c.cmp(h)&&(l+=8);break;default:l+=4}return p[n]=l,l}(this.__prime,this.__gen)),this._primeCode}}),y.prototype.generateKeys=function(){return this._priv||(this._priv=new n(c(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},y.prototype.computeSecret=function(t){var r=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new e(r.toArray()),o=this.getPrime();if(i.length<o.length){var s=new e(o.length-i.length);s.fill(0),i=e.concat([s,i])}return i},y.prototype.getPublicKey=function(t){return m(this._pub,t)},y.prototype.getPrivateKey=function(t){return m(this._priv,t)},y.prototype.getPrime=function(t){return m(this.__prime,t)},y.prototype.getGenerator=function(t){return m(this._gen,t)},y.prototype.setGenerator=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.__gen=t,this._gen=new n(t),this}}).call(this,r(3).Buffer)},function(t,e,r){var n=r(70).Buffer,i=r(35),o=r(95),s=r(0),a=r(231),u=r(262),h=r(112);function f(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){return new f(t)}function d(t){return new c(t)}Object.keys(h).forEach((function(t){h[t].id=n.from(h[t].id,"hex"),h[t.toLowerCase()]=h[t]})),s(f,o.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},s(c,o.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},c.prototype.verify=function(t,e,r){"string"==typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return u(e,i,t,this._signType,this._tag)},t.exports={Sign:l,Verify:d,createSign:l,createVerify:d}},function(t,e,r){var n=r(70).Buffer,i=r(110),o=r(71),s=r(73).ec,a=r(72),u=r(51),h=r(139);function f(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var s=n.alloc(e.byteLength()-t.length);t=n.concat([s,t])}var a=r.length,u=function(t,e){t=(t=c(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),h=n.alloc(a);h.fill(1);var f=n.alloc(a);return f=i(o,f).update(h).update(n.from([0])).update(t).update(u).digest(),h=i(o,f).update(h).digest(),{k:f=i(o,f).update(h).update(n.from([1])).update(t).update(u).digest(),v:h=i(o,f).update(h).digest()}}function c(t,e){var r=new a(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function l(t,e,r){var o,s;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);s=c(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,n){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(n)}t.exports=function(t,e,r,i,p){var y=u(e);if(y.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=h[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new s(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,y)}if("dsa"===y.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){var i,o=e.params.priv_key,s=e.params.p,u=e.params.q,h=e.params.g,p=new a(0),y=c(t,u).mod(u),m=!1,b=f(o,u,t,r);for(;!1===m;)i=l(u,b,r),p=d(h,i,s,u),0===(m=i.invm(u).imul(y.add(o.mul(p))).mod(u)).cmpn(0)&&(m=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t));128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(p,m)}(t,y,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([p,t]);for(var m=y.modulus.byteLength(),b=[0,1];t.length+b.length+1<m;)b.push(255);b.push(0);for(var v=-1;++v<t.length;)b.push(t[v]);return o(b,y)},t.exports.getKey=f,t.exports.makeKey=l},function(t,e){},function(t){t.exports=JSON.parse('{"_from":"elliptic@^6.5.3","_id":"elliptic@6.5.4","_inBundle":false,"_integrity":"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"elliptic@^6.5.3","name":"elliptic","escapedName":"elliptic","rawSpec":"^6.5.3","saveSpec":null,"fetchSpec":"^6.5.3"},"_requiredBy":["/browserify-sign","/create-ecdh"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz","_shasum":"da37cebd31e79a1367e941b592ed1fbebd58abbb","_spec":"elliptic@^6.5.3","_where":"/home/val/Workspace/MongoDB/mongoose/node_modules/browserify-sign","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},"deprecated":false,"description":"EC cryptography","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.5.4"}')},function(t,e){},function(t,e,r){"use strict";var n=r(12),i=r(21),o=r(0),s=r(50),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function h(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,h,f,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new i(1),y=new i(0),m=new i(0),b=new i(1),v=0;0!==l.cmpn(0);){var g=d.div(l);h=d.sub(g.mul(l)),f=m.sub(g.mul(p));var w=b.sub(g.mul(y));if(!n&&h.cmp(c)<0)e=u.neg(),r=p,n=h.neg(),o=f;else if(n&&2==++v)break;u=h,d=l,l=h,m=p,p=f,b=y,y=w}s=h.neg(),a=f;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(h).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return h},o(h,s.BasePoint),u.prototype.point=function(t,e,r){return new h(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return h.fromJSON(this,t,e)},h.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},h.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},h.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},h.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),f=h.redMul(a),c=n.redMul(h),l=u.redSqr().redIAdd(f).redISub(c).redISub(c),d=u.redMul(c.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),f=r.redMul(u),c=a.redSqr().redIAdd(h).redISub(f).redISub(f),l=a.redMul(f.redISub(c)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(c,l,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(e=0;e<t;e++){var f=o.redSqr(),c=h.redSqr(),l=c.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(c),y=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(y),b=d.redMul(m);b=b.redIAdd(b).redISub(l);var v=h.redMul(a);e+1<t&&(u=u.redMul(l)),o=y,a=v,h=b}return this.curve.jpoint(o,h.redMul(i),a)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),d=this.x.redAdd(c).redSqr().redISub(f).redISub(l);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),y=p.redSqr(),m=l.redIAdd(l);m=(m=m.redIAdd(m)).redIAdd(m),t=y.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},f.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),c=this.y.redSqr(),l=this.x.redMul(c),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),y=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(f);var m=c.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),e=d.redMul(p.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,r)},f.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(s),f=a.redSqr().redISub(h.redAdd(h)),c=h.redISub(f),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(c).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,d,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),f=e.redMul(h);f=(f=f.redIAdd(f)).redIAdd(f);var c=this.x.redMul(a).redISub(f);c=(c=c.redIAdd(c)).redIAdd(c);var l=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(c,l,d)},f.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},f.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(21),i=r(0),o=r(50),s=r(12);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var n=r(12),i=r(21),o=r(0),s=r(50),a=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function h(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(h,s.BasePoint),u.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new h(this,t,e,r,n)},h.fromJSON=function(t,e){return new h(t,e[0],e[1],e[2])},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},h.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),u=i.redMul(s),h=o.redMul(a),f=i.redMul(a),c=s.redMul(o);return this.curve.point(u,h,c,f)},h.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var h=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(h.redSub(this.curve.two)),e=h.redMul(n.redSub(u)),r=h.redSqr().redSub(h).redSub(h)):(i=this.z.redSqr(),o=h.redSub(i).redISub(i),t=s.redSub(a).redISub(u).redMul(o),e=h.redMul(n.redSub(u)),r=h.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(e),h=o.redMul(s),f=a.redMul(u),c=o.redMul(u),l=s.redMul(a);return this.curve.point(h,f,l,c)},h.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),h=i.redAdd(a),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),c=n.redMul(u).redMul(f);return this.curve.twisted?(e=n.redMul(h).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(h)):(e=n.redMul(h).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(h)),this.curve.point(c,e,r)},h.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},h.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},h.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},h.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},h.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add},function(t,e,r){"use strict";e.sha1=r(239),e.sha224=r(240),e.sha256=r(131),e.sha384=r(241),e.sha512=r(132)},function(t,e,r){"use strict";var n=r(17),i=r(39),o=r(130),s=n.rotl32,a=n.sum32,u=n.sum32_5,h=o.ft_1,f=i.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,f),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(s(i,5),h(p,o,f,l),d,r[n],c[p]);d=l,l=f,f=s(o,30),o=i,i=y}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],f),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(17),i=r(131);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(17),i=r(132);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(17),i=r(39),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,h=i.BlockHash;function f(){if(!(this instanceof f))return new f;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,h),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],h=this.h[3],f=this.h[4],v=r,g=n,w=i,_=h,M=f,S=0;S<80;S++){var O=s(o(u(r,c(S,n,i,h),t[p[S]+e],l(S)),m[S]),f);r=f,f=h,h=o(i,10),i=n,n=O,O=s(o(u(v,c(79-S,g,w,_),t[y[S]+e],d(S)),b[S]),M),v=M,M=_,_=o(w,10),w=g,g=O}O=a(this.h[1],i,_),this.h[1]=a(this.h[2],h,M),this.h[2]=a(this.h[3],f,v),this.h[3]=a(this.h[4],r,g),this.h[4]=a(this.h[0],n,w),this.h[0]=O},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(17),i=r(11);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(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 i=r(21),o=r(246),s=r(12),a=r(74),u=r(69),h=s.assert,f=r(247),c=r(248);function l(t){if(!(this instanceof l))return new l(t);"string"==typeof t&&(h(Object.prototype.hasOwnProperty.call(a,t),"Unknown curve "+t),t=a[t]),t instanceof a.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=l,l.prototype.keyPair=function(t){return new f(this,t)},l.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t||(t={});for(var e=new o({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||u(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var s=new i(e.generate(r));if(!(s.cmp(n)>0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,r,s){"object"===n(r)&&(s=r,r=null),s||(s={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var a=this.n.byteLength(),u=e.getPrivate().toArray("be",a),h=t.toArray("be",a),f=new o({hash:this.hash,entropy:u,nonce:h,pers:s.pers,persEnc:s.persEnc||"utf8"}),l=this.n.sub(new i(1)),d=0;;d++){var p=s.k?s.k(d):new i(f.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(l)>=0)){var y=this.g.mul(p);if(!y.isInfinity()){var m=y.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=p.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(y.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new c({r:b,s:v,recoveryParam:g})}}}}}},l.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new c(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),h=u.mul(t).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(h,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,n){h((3&r)===r,"The recovery param is more than two bits"),e=new c(e,n);var o=this.n,s=new i(t),a=e.r,u=e.s,f=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),y=u.mul(d).umod(o);return this.g.mulAdd(p,a,y)},l.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(75),i=r(128),o=r(11);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},function(t,e,r){"use strict";var n=r(21),i=r(12).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";var n=r(21),i=r(12),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function h(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;var h=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var f=u(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var c=t.slice(r.place,f+r.place);if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new n(h),this.s=new n(c),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),s=[48];return f(s,o.length),s=s.concat(o),i.encode(s,t)}},function(t,e,r){"use strict";var n=r(75),i=r(74),o=r(12),s=o.assert,a=o.parseBytes,u=r(250),h=r(251);function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=f,f.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},f.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},f.prototype.makeSignature=function(t){return t instanceof h?t:new h(this,t)},f.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},f.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(t){return o.intFromLE(t)},f.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";var n=r(12),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},function(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 i=r(21),o=r(12),s=o.assert,a=o.cachedProperty,u=o.parseBytes;function h(t,e){this.eddsa=t,"object"!==n(e)&&(e=u(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}a(h,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(h,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(h,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(h,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h},function(t,e,r){"use strict";var n=r(133);e.certificate=r(259);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var h=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=h;var f=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=f,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var c=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=c;var l=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(t,e){},function(t,e,r){"use strict";var n=r(135),i=r(137),o=r(0);function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new s(t,e)},s.prototype._createNamed=function(t){var e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},s.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},s.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},s.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},s.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},function(t,e,r){"use strict";var n=r(0),i=r(136);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){for(var r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},function(t,e,r){"use strict";var n=r(0),i=r(76).Buffer,o=r(138);function s(t){o.call(this,t),this.enc="pem"}n(s,o),t.exports=s,s.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,u=-1,h=0;h<r.length;h++){var f=r[h].match(s);if(null!==f&&f[2]===n){if(-1!==a){if("END"!==f[1])break;u=h;break}if("BEGIN"!==f[1])break;a=h}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+n);var c=r.slice(a+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");var l=i.from(c,"base64");return o.prototype.decode.call(this,l,e)}},function(t,e,r){"use strict";var n=e;n.Reporter=r(78).Reporter,n.DecoderBuffer=r(40).DecoderBuffer,n.EncoderBuffer=r(40).EncoderBuffer,n.Node=r(77)},function(t,e,r){"use strict";var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e},n.der=r(79)},function(t,e,r){"use strict";var n=r(133),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),h=n.define("RDNSequence",(function(){this.seqof(u)})),f=n.define("Name",(function(){this.choice({rdnSequence:this.use(h)})})),c=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),l=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(f),this.key("validity").use(c),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},function(t){t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(t,e,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(49),a=r(67),u=r(2).Buffer;t.exports=function(t,e){var r,h=t.toString(),f=h.match(n);if(f){var c="aes"+f[1],l=u.from(f[2],"hex"),d=u.from(f[3].replace(/[\r\n]/g,""),"base64"),p=s(e,l.slice(0,8),parseInt(f[1],10)).key,y=[],m=a.createDecipheriv(c,p,l);y.push(m.update(d)),y.push(m.final()),r=u.concat(y)}else{var b=h.match(o);r=u.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:h.match(i)[1],data:r}}},function(t,e,r){var n=r(70).Buffer,i=r(72),o=r(73).ec,s=r(51),a=r(139);function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,h,f){var c=s(r);if("ec"===c.type){if("ecdsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}(t,e,c)}if("dsa"===c.type){if("dsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,a=r.data.g,h=r.data.pub_key,f=s.signature.decode(t,"der"),c=f.s,l=f.r;u(c,o),u(l,o);var d=i.mont(n),p=c.invm(o);return 0===a.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(h.toRed(d).redPow(l.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(l)}(t,e,c)}if("rsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");e=n.concat([f,e]);for(var l=c.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<l;)d.push(255),p++;d.push(0);for(var y=-1;++y<e.length;)d.push(e[y]);d=n.from(d);var m=i.mont(c.modulus);t=(t=new i(t).toRed(m)).redPow(new i(c.publicExponent)),t=n.from(t.fromRed().toArray());var b=p<8?1:0;for(l=Math.min(t.length,d.length),t.length!==d.length&&(b=1),y=-1;++y<l;)b|=t[y]^d[y];return 0===b}},function(t,e,r){(function(e){var n=r(73),i=r(264);t.exports=function(t){return new s(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(t,r,n){Array.isArray(t)||(t=t.toArray());var i=new e(t);if(n&&i.length<n){var o=new e(n-i.length);o.fill(0),i=e.concat([o,i])}return r?i.toString(r):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,s.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},s.prototype.computeSecret=function(t,r,n){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),a(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},s.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,t)},s.prototype.getPrivateKey=function(t){return a(this.keys.getPrivate(),t)},s.prototype.setPublicKey=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.keys._importPublic(t),this},s.prototype.setPrivateKey=function(t,r){r=r||"utf8",e.isBuffer(t)||(t=new e(t,r));var n=new i(t);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this,r(3).Buffer)},function(t,e,r){(function(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(t,n){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(265).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,n):(this._parseBase(t,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var f=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);r=0!==(o=a>>>24-n&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?y+r:c[h-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,d=0|s[1],p=8191&d,y=d>>>13,m=0|s[2],b=8191&m,v=m>>>13,g=0|s[3],w=8191&g,_=g>>>13,M=0|s[4],S=8191&M,O=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,k=0|s[6],j=8191&k,$=k>>>13,P=0|s[7],R=8191&P,B=P>>>13,T=0|s[8],I=8191&T,N=T>>>13,D=0|s[9],C=8191&D,L=D>>>13,q=0|a[0],U=8191&q,F=q>>>13,z=0|a[1],V=8191&z,K=z>>>13,H=0|a[2],Z=8191&H,W=H>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,G=0|a[4],X=8191&G,tt=G>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ft=0|a[8],ct=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(y,U)|0,o=Math.imul(y,F);var bt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var vt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,W)|0;var gt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Q)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,F))+Math.imul(O,U)|0,o=Math.imul(O,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,F))+Math.imul($,U)|0,o=Math.imul($,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,F))+Math.imul(B,U)|0,o=Math.imul(B,F),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul($,Z)|0,o=o+Math.imul($,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0;var Ot=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,yt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,X)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,W))+Math.imul(L,Z)|0,o=Math.imul(L,W),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,yt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(L,Y)|0,o=Math.imul(L,Q),n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,X),i=(i=Math.imul(C,tt))+Math.imul(L,X)|0,o=Math.imul(L,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,ut)|0,o=o+Math.imul($,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var jt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul($,ct)|0,o=o+Math.imul($,lt)|0;var $t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var Pt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,pt)|0))<<13)|0;h=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,ut),i=(i=Math.imul(C,ht))+Math.imul(L,ut)|0,o=Math.imul(L,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,lt))+Math.imul(L,ct)|0,o=Math.imul(L,lt);var Bt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,yt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Tt=(h+(n=Math.imul(C,pt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(L,pt)|0))<<13)|0;return h=((o=Math.imul(L,yt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=mt,u[1]=bt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=Ot,u[9]=At,u[10]=Et,u[11]=xt,u[12]=kt,u[13]=jt,u[14]=$t,u[15]=Pt,u[16]=Rt,u[17]=Bt,u[18]=Tt,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(y=p),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,l=h,d=0;d<s;d++){var p=r[f+d],y=n[f+d],m=r[f+d+s],b=n[f+d+s],v=c*m-l*b;b=c*b+l*m,m=v,r[f+d]=p+m,n[f+d]=y+b,r[f+d+s]=p-m,n[f+d+s]=y-b,d!==a&&(v=u*c-h*l,l=u*l+h*c,c=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var u=(0|t.words[n])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(u)):(r.isub(e),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new O(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){O.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},o(w,g),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},o(_,g),o(M,g),o(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},O.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},O.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},O.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},O.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},O.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},O.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},O.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},O.prototype.isqr=function(t){return this.imul(t,t.clone())},O.prototype.sqr=function(t){return this.mul(t,t)},O.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var y=d,m=0;0!==y.cmp(a);m++)y=y.redSqr();i(m<p);var b=this.pow(c,new s(1).iushln(p-m-1));l=l.redMul(b),c=b.redSqr(),d=d.redMul(c),p=m}return l},O.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},O.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],f=u-1;f>=0;f--){var c=h>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}u=26}return i},O.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},O.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},o(A,O),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e){},function(t,e,r){e.publicEncrypt=r(267),e.privateDecrypt=r(269),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},function(t,e,r){var n=r(51),i=r(28),o=r(35),s=r(140),a=r(141),u=r(80),h=r(142),f=r(71),c=r(2).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===l)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,h=o("sha1").update(c.alloc(0)).digest(),f=h.length,l=2*f;if(n>r-l-2)throw new Error("message too long");var d=c.alloc(r-n-l-2),p=r-f-1,y=i(f),m=a(c.concat([h,d,c.alloc(1,1),e],p),s(y,p)),b=a(y,s(m,f));return new u(c.concat([c.alloc(1),b,m],r))}(p,e);else if(1===l)d=function(t,e,r){var n,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=r?c.alloc(s-o-3,255):function(t){var e,r=c.allocUnsafe(t),n=0,o=i(2*t),s=0;for(;n<t;)s===o.length&&(o=i(2*t),s=0),(e=o[s++])&&(r[n++]=e);return r}(s-o-3);return new u(c.concat([c.from([0,r?1:2]),n,c.alloc(1),e],s))}(p,e,r);else{if(3!==l)throw new Error("unknown padding");if((d=new u(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?f(d,p):h(d,p)}},function(t,e){},function(t,e,r){var n=r(51),i=r(140),o=r(141),s=r(80),a=r(71),u=r(35),h=r(142),f=r(2).Buffer;t.exports=function(t,e,r){var c;c=t.padding?t.padding:r?1:4;var l,d=n(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");l=r?h(new s(e),d):a(e,d);var y=f.alloc(p-l.length);if(l=f.concat([y,l],p),4===c)return function(t,e){var r=t.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),s=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),h=e.slice(s+1),c=o(a,i(h,s)),l=o(h,i(c,r-s-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i<n;)r+=t[i]^e[i];return r}(n,l.slice(0,s)))throw new Error("decryption error");var d=s;for(;0===l[d];)d++;if(1!==l[d++])throw new Error("decryption error");return l.slice(d)}(d,l);if(1===c)return function(t,e,r){var n=e.slice(0,2),i=2,o=0;for(;0!==e[i++];)if(i>=e.length){o++;break}var s=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,l,r);if(3===c)return l;throw new Error("unknown padding")}},function(t,e,r){"use strict";(function(t,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(2),s=r(28),a=o.Buffer,u=o.kMaxLength,h=t.crypto||t.msCrypto,f=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function l(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function d(t,e,r,i){if(n.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return h.getRandomValues(a),i?void n.nextTick((function(){i(null,t)})):t}if(!i)return s(r).copy(t,e),t;s(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}h&&h.getRandomValues||!n.browser?(e.randomFill=function(e,r,n,i){if(!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=e.length;else if("function"==typeof n)i=n,n=e.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return c(r,e.length),l(n,r,e.length),d(e,r,n,i)},e.randomFillSync=function(e,r,n){void 0===r&&(r=0);if(!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');c(r,e.length),void 0===n&&(n=e.length-r);return l(n,r,e.length),d(e,r,n)}):(e.randomFill=i,e.randomFillSync=i)}).call(this,r(7),r(5))},function(t,e,r){"use strict";
  1017. /*!
  1018. * ignore
  1019. */t.exports=r(59).Decimal128},function(t,e,r){"use strict";
  1020. /*!
  1021. * [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) ObjectId
  1022. * @constructor NodeMongoDbObjectId
  1023. * @see ObjectId
  1024. */var n=r(59).ObjectID;
  1025. /*!
  1026. * Getter for convenience with populate, see gh-6115
  1027. */Object.defineProperty(n.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}),
  1028. /*!
  1029. * ignore
  1030. */
  1031. t.exports=n},function(t,e,r){"use strict";
  1032. /*!
  1033. * ignore
  1034. */t.exports=function(){}},function(t,e,r){"use strict";
  1035. /*!
  1036. * Module dependencies.
  1037. */var n=r(14),i=r(353),o=!1;t.exports=function(){return o?i:n},
  1038. /*!
  1039. * ignore
  1040. */
  1041. t.exports.setBrowser=function(t){o=t}},function(t,e,r){"use strict";
  1042. /*!
  1043. * Dependencies
  1044. */var n=r(276).ctor("require","modify","init","default","ignore");function i(){this.activePaths=new n,this.strictMode=void 0}t.exports=i,i.prototype.fullPath=void 0,i.prototype.strictMode=void 0,i.prototype.selected=void 0,i.prototype.shardval=void 0,i.prototype.saveError=void 0,i.prototype.validationError=void 0,i.prototype.adhocPaths=void 0,i.prototype.removing=void 0,i.prototype.inserting=void 0,i.prototype.saving=void 0,i.prototype.version=void 0,i.prototype._id=void 0,i.prototype.ownerDocument=void 0,i.prototype.populate=void 0,i.prototype.populated=void 0,i.prototype.wasPopulated=!1,i.prototype.scope=void 0,i.prototype.session=null,i.prototype.pathsToScopes=null,i.prototype.cachedRequired=null},function(t,e,r){"use strict";
  1045. /*!
  1046. * Module dependencies.
  1047. */r(4);
  1048. /*!
  1049. * StateMachine represents a minimal `interface` for the
  1050. * constructors it builds via StateMachine.ctor(...).
  1051. *
  1052. * @api private
  1053. */var n=t.exports=function(){};
  1054. /*!
  1055. * StateMachine.ctor('state1', 'state2', ...)
  1056. * A factory method for subclassing StateMachine.
  1057. * The arguments are a list of states. For each state,
  1058. * the constructor's prototype gets state transition
  1059. * methods named after each state. These transition methods
  1060. * place their path argument into the given state.
  1061. *
  1062. * @param {String} state
  1063. * @param {String} [state]
  1064. * @return {Function} subclass constructor
  1065. * @private
  1066. */
  1067. n.ctor=function(){var t=Array.prototype.slice.call(arguments),e=function(){n.apply(this,arguments),this.paths={},this.states={},this.stateNames=t;for(var e,r=t.length;r--;)e=t[r],this.states[e]={}};return e.prototype=new n,t.forEach((function(t){e.prototype[t]=function(e){this._changeState(e,t)}})),e},
  1068. /*!
  1069. * This function is wrapped by the state change functions:
  1070. *
  1071. * - `require(path)`
  1072. * - `modify(path)`
  1073. * - `init(path)`
  1074. *
  1075. * @api private
  1076. */
  1077. n.prototype._changeState=function(t,e){var r=this.states[this.paths[t]];r&&delete r[t],this.paths[t]=e,this.states[e][t]=!0},
  1078. /*!
  1079. * ignore
  1080. */
  1081. n.prototype.clear=function(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]},
  1082. /*!
  1083. * Checks to see if at least one path is in the states passed in via `arguments`
  1084. * e.g., this.some('required', 'inited')
  1085. *
  1086. * @param {String} state that we want to check for.
  1087. * @private
  1088. */
  1089. n.prototype.some=function(){var t=this,e=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(e,(function(e){return Object.keys(t.states[e]).length}))},
  1090. /*!
  1091. * This function builds the functions that get assigned to `forEach` and `map`,
  1092. * since both of those methods share a lot of the same logic.
  1093. *
  1094. * @param {String} iterMethod is either 'forEach' or 'map'
  1095. * @return {Function}
  1096. * @api private
  1097. */
  1098. n.prototype._iter=function(t){return function(){var e=Array.prototype.slice.call(arguments),r=e.pop();e.length||(e=this.stateNames);var n=this,i=e.reduce((function(t,e){return t.concat(Object.keys(n.states[e]))}),[]);return i[t]((function(t,e,n){return r(t,e,n)}))}},
  1099. /*!
  1100. * Iterates over the paths that belong to one of the parameter states.
  1101. *
  1102. * The function profile can look like:
  1103. * this.forEach(state1, fn); // iterates over all paths in state1
  1104. * this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2
  1105. * this.forEach(fn); // iterates over all paths in all states
  1106. *
  1107. * @param {String} [state]
  1108. * @param {String} [state]
  1109. * @param {Function} callback
  1110. * @private
  1111. */
  1112. n.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)},
  1113. /*!
  1114. * Maps over the paths that belong to one of the parameter states.
  1115. *
  1116. * The function profile can look like:
  1117. * this.forEach(state1, fn); // iterates over all paths in state1
  1118. * this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2
  1119. * this.forEach(fn); // iterates over all paths in all states
  1120. *
  1121. * @param {String} [state]
  1122. * @param {String} [state]
  1123. * @param {Function} callback
  1124. * @return {Array}
  1125. * @private
  1126. */
  1127. n.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)}},function(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 i=r(278),o=["__proto__","constructor","prototype"];
  1128. /*!
  1129. * Returns the value passed to it.
  1130. */
  1131. function s(t){return t}e.get=function(t,r,o,a){var u;"function"==typeof o&&(o.length<2?(a=o,o=void 0):(u=o,o=void 0)),a||(a=s);var h="string"==typeof t?i(t):t;if(!Array.isArray(h))throw new TypeError("Invalid `path`. Must be either string or array");for(var f,c=r,l=0;l<h.length;++l){if(f=h[l],"string"!=typeof h[l]&&"number"!=typeof h[l])throw new TypeError("Each segment of path to `get()` must be a string or number, got "+n(h[l]));if(Array.isArray(c)&&!/^\d+$/.test(f)){var d=h.slice(l);return[].concat(c).map((function(t){return t?e.get(d,t,o||u,a):a(void 0)}))}if(u)c=u(c,f);else{var p=o&&c[o]?c[o]:c;c=p instanceof Map?p.get(f):p[f]}if(!c)return a(c)}return a(c)},e.has=function(t,e){var r="string"==typeof t?i(t):t;if(!Array.isArray(r))throw new TypeError("Invalid `path`. Must be either string or array");for(var o=r.length,s=e,a=0;a<o;++a){if("string"!=typeof r[a]&&"number"!=typeof r[a])throw new TypeError("Each segment of path to `has()` must be a string or number, got "+n(r[a]));if(null==s||"object"!==n(s)||!(r[a]in s))return!1;s=s[r[a]]}return!0},e.unset=function(t,e){var r="string"==typeof t?i(t):t;if(!Array.isArray(r))throw new TypeError("Invalid `path`. Must be either string or array");for(var s=r.length,a=e,u=0;u<s;++u){if(null==a||"object"!==n(a)||!(r[u]in a))return!1;if("string"!=typeof r[u]&&"number"!=typeof r[u])throw new TypeError("Each segment of path to `unset()` must be a string or number, got "+n(r[u]));if(-1!==o.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,h,f){var c;"function"==typeof u&&(u.length<2?(h=u,u=void 0):(c=u,u=void 0)),h||(h=s);var l="string"==typeof t?i(t):t;if(!Array.isArray(l))throw new TypeError("Invalid `path`. Must be either string or array");if(null!=a){for(var d=0;d<l.length;++d){if("string"!=typeof l[d]&&"number"!=typeof l[d])throw new TypeError("Each segment of path to `set()` must be a string or number, got "+n(l[d]));if(-1!==o.indexOf(l[d]))return}for(var p,y=f||/\$/.test(t)&&!1!==f,m=a,b=(d=0,l.length-1);d<b;++d)if("$"!=(p=l[d])){if(Array.isArray(m)&&!/^\d+$/.test(p)){var v=l.slice(d);if(!y&&Array.isArray(r))for(var g=0;g<m.length&&g<r.length;++g)e.set(v,r[g],m[g],u||c,h,y);else for(g=0;g<m.length;++g)e.set(v,r,m[g],u||c,h,y);return}if(c)m=c(m,p);else{var w=u&&m[u]?m[u]:m;m=w instanceof Map?w.get(p):w[p]}if(!m)return}else if(d==b-1)break;if(p=l[b],u&&m[u]&&(m=m[u]),Array.isArray(m)&&!/^\d+$/.test(p))if(!y&&Array.isArray(r))!
  1132. /*!
  1133. * Recursively set nested arrays
  1134. */
  1135. function t(e,r,n,i,o,s){for(var a,u=0;u<e.length&&u<r.length;++u)a=e[u],Array.isArray(a)&&Array.isArray(r[u])?t(a,r[u],n,i,o,s):a&&(i?i(a,n,s(r[u])):(a[o]&&(a=a[o]),a[n]=s(r[u])))}(m,r,p,c,u,h);else for(g=0;g<m.length;++g){var _=m[g];_&&(c?c(_,p,h(r)):(_[u]&&(_=_[u]),_[p]=h(r)))}else c?c(m,p,h(r)):m instanceof Map?m.set(p,h(r)):m[p]=h(r)}}},function(t,e,r){"use strict";t.exports=function(t){for(var e=[],r="",n="DEFAULT",i=0;i<t.length;++i)"IN_SQUARE_BRACKETS"!==n||/\d/.test(t[i])||"]"===t[i]||(n="DEFAULT",r=e[e.length-1]+"["+r,e.splice(e.length-1,1)),"["===t[i]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(e.push(r),r=""),n="IN_SQUARE_BRACKETS"):"]"===t[i]?"IN_SQUARE_BRACKETS"===n?(n="IMMEDIATELY_AFTER_SQUARE_BRACKETS",e.push(r),r=""):(n="DEFAULT",r+=t[i]):"."===t[i]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(e.push(r),r=""),n="DEFAULT"):r+=t[i];return"IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&e.push(r),e}},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var s=r(41),a=o((function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._docs={},this._childDocs=[],null!=e&&(e=s(e),Object.assign(this,e),"object"===n(e.subPopulate)&&(this.populate=e.subPopulate),null!=e.perDocumentLimit&&null!=e.limit))throw new Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+e.path+"`.")}));t.exports=a},function(t,e,r){"use strict";e.isMongooseDocumentArray=function(t){return Array.isArray(t)&&t.isMongooseDocumentArray}},function(t,e,r){"use strict";
  1136. /*
  1137. object-assign
  1138. (c) Sindre Sorhus
  1139. @license MIT
  1140. */var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,u=s(t),h=1;h<arguments.length;h++){for(var f in r=Object(arguments[h]))i.call(r,f)&&(u[f]=r[f]);if(n){a=n(r);for(var c=0;c<a.length;c++)o.call(r,a[c])&&(u[a[c]]=r[a[c]])}}return u}},function(t,e){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)}t.exports=function(t){return t&&"object"===r(t)&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new 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 s=r(43),a=r(9),u=r(285),h=r(286)("mquery");function f(t,e){if(!(this instanceof f))return new f(t,e);var r=this.constructor.prototype;this.op=r.op||void 0,this.options=Object.assign({},r.options),this._conditions=r._conditions?u.clone(r._conditions):{},this._fields=r._fields?u.clone(r._fields):void 0,this._update=r._update?u.clone(r._update):void 0,this._path=r._path||void 0,this._distinct=r._distinct||void 0,this._collection=r._collection||void 0,this._traceFunction=r._traceFunction||void 0,e&&this.setOptions(e),t&&(t.find&&t.remove&&t.update?this.collection(t):this.find(t))}var c="$geoWithin";Object.defineProperty(f,"use$geoWithin",{get:function(){return"$geoWithin"==c},set:function(t){c=!0===t?"$geoWithin":"$within"}}),f.prototype.toConstructor=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);f.call(this,e,r)}u.inherits(t,f);var e=t.prototype;return e.options={},e.setOptions(this.options),e.op=this.op,e._conditions=u.clone(this._conditions),e._fields=u.clone(this._fields),e._update=u.clone(this._update),e._path=this._path,e._distinct=this._distinct,e._collection=this._collection,e._traceFunction=this._traceFunction,t},f.prototype.setOptions=function(t){if(!t||!u.isObject(t))return this;for(var e,r=u.keys(t),n=0;n<r.length;++n)if("function"==typeof this[e=r[n]]){var i=Array.isArray(t[e])?t[e]:[t[e]];this[e].apply(this,i)}else this.options[e]=t[e];return this},f.prototype.collection=function(t){return this._collection=new f.Collection(t),this},f.prototype.collation=function(t){return this.options.collation=t,this},f.prototype.$where=function(t){return this._conditions.$where=t,this},f.prototype.where=function(){if(!arguments.length)return this;this.op||(this.op="find");var t=o(arguments[0]);if("string"==t)return this._path=arguments[0],2===arguments.length&&(this._conditions[this._path]=arguments[1]),this;if("object"==t&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw new TypeError("path must be a string or object")},f.prototype.equals=function(t){this._ensurePath("equals");var e=this._path;return this._conditions[e]=t,this},f.prototype.eq=function(t){this._ensurePath("eq");var e=this._path;return this._conditions[e]=t,this},f.prototype.or=function(t){var e=this._conditions.$or||(this._conditions.$or=[]);return Array.isArray(t)||(t=[t]),e.push.apply(e,t),this},f.prototype.nor=function(t){var e=this._conditions.$nor||(this._conditions.$nor=[]);return Array.isArray(t)||(t=[t]),e.push.apply(e,t),this},f.prototype.and=function(t){var e=this._conditions.$and||(this._conditions.$and=[]);return Array.isArray(t)||(t=[t]),e.push.apply(e,t),this},
  1141. /*!
  1142. * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
  1143. *
  1144. * Thing.where('type').nin(array)
  1145. */
  1146. "gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach((function(t){f.prototype[t]=function(){var e,r;1===arguments.length?(this._ensurePath(t),r=arguments[0],e=this._path):(r=arguments[1],e=arguments[0]);var n=null===this._conditions[e]||"object"===o(this._conditions[e])?this._conditions[e]:this._conditions[e]={};return n["$"+t]=r,this}})),f.prototype.mod=function(){var t,e;1===arguments.length?(this._ensurePath("mod"),t=arguments[0],e=this._path):2!==arguments.length||Array.isArray(arguments[1])?3===arguments.length?(t=[arguments[1],arguments[2]],e=arguments[0]):(t=arguments[1],e=arguments[0]):(this._ensurePath("mod"),t=[arguments[0],arguments[1]],e=this._path);var r=this._conditions[e]||(this._conditions[e]={});return r.$mod=t,this},f.prototype.exists=function(){var t,e;0===arguments.length?(this._ensurePath("exists"),t=this._path,e=!0):1===arguments.length?"boolean"==typeof arguments[0]?(this._ensurePath("exists"),t=this._path,e=arguments[0]):(t=arguments[0],e=!0):2===arguments.length&&(t=arguments[0],e=arguments[1]);var r=this._conditions[t]||(this._conditions[t]={});return r.$exists=e,this},f.prototype.elemMatch=function(){if(null==arguments[0])throw new TypeError("Invalid argument");var t,e,r;if("function"==typeof arguments[0])this._ensurePath("elemMatch"),e=this._path,t=arguments[0];else if(u.isObject(arguments[0]))this._ensurePath("elemMatch"),e=this._path,r=arguments[0];else if("function"==typeof arguments[1])e=arguments[0],t=arguments[1];else{if(!arguments[1]||!u.isObject(arguments[1]))throw new TypeError("Invalid argument");e=arguments[0],r=arguments[1]}t&&(t(r=new f),r=r._conditions);var n=this._conditions[e]||(this._conditions[e]={});return n.$elemMatch=r,this},f.prototype.within=function(){if(this._ensurePath("within"),this._geoComparison=c,0===arguments.length)return this;if(2===arguments.length)return this.box.apply(this,arguments);if(2<arguments.length)return this.polygon.apply(this,arguments);var t=arguments[0];if(!t)throw new TypeError("Invalid argument");if(t.center)return this.circle(t);if(t.box)return this.box.apply(this,t.box);if(t.polygon)return this.polygon.apply(this,t.polygon);if(t.type&&t.coordinates)return this.geometry(t);throw new TypeError("Invalid argument")},f.prototype.box=function(){var t,e;if(3===arguments.length)t=arguments[0],e=[arguments[1],arguments[2]];else{if(2!==arguments.length)throw new TypeError("Invalid argument");this._ensurePath("box"),t=this._path,e=[arguments[0],arguments[1]]}var r=this._conditions[t]||(this._conditions[t]={});return r[this._geoComparison||c]={$box:e},this},f.prototype.polygon=function(){var t,e;"string"==typeof arguments[0]?e=(t=Array.from(arguments)).shift():(this._ensurePath("polygon"),e=this._path,t=Array.from(arguments));var r=this._conditions[e]||(this._conditions[e]={});return r[this._geoComparison||c]={$polygon:t},this},f.prototype.circle=function(){var t,e;if(1===arguments.length)this._ensurePath("circle"),t=this._path,e=arguments[0];else{if(2!==arguments.length)throw new TypeError("Invalid argument");t=arguments[0],e=arguments[1]}if(!("radius"in e)||!e.center)throw new Error("center and radius are required");var r=this._conditions[t]||(this._conditions[t]={}),n=e.spherical?"$centerSphere":"$center",i=this._geoComparison||c;return r[i]={},r[i][n]=[e.center,e.radius],"unique"in e&&(r[i].$uniqueDocs=!!e.unique),this},f.prototype.near=function(){var t,e;if(this._geoComparison="$near",0===arguments.length)return this;if(1===arguments.length)this._ensurePath("near"),t=this._path,e=arguments[0];else{if(2!==arguments.length)throw new TypeError("Invalid argument");t=arguments[0],e=arguments[1]}if(!e.center)throw new Error("center is required");var r=this._conditions[t]||(this._conditions[t]={}),n=e.spherical?"$nearSphere":"$near";if(Array.isArray(e.center)){r[n]=e.center;var i="maxDistance"in e?e.maxDistance:null;null!=i&&(r.$maxDistance=i),null!=e.minDistance&&(r.$minDistance=e.minDistance)}else{if("Point"!=e.center.type||!Array.isArray(e.center.coordinates))throw new Error(a.format("Invalid GeoJSON specified for %s",n));r[n]={$geometry:e.center},"maxDistance"in e&&(r[n].$maxDistance=e.maxDistance),"minDistance"in e&&(r[n].$minDistance=e.minDistance)}return this},f.prototype.intersects=function(){if(this._ensurePath("intersects"),this._geoComparison="$geoIntersects",0===arguments.length)return this;var t=arguments[0];if(null!=t&&t.type&&t.coordinates)return this.geometry(t);throw new TypeError("Invalid argument")},f.prototype.geometry=function(){if("$within"!=this._geoComparison&&"$geoWithin"!=this._geoComparison&&"$near"!=this._geoComparison&&"$geoIntersects"!=this._geoComparison)throw new Error("geometry() must come after `within()`, `intersects()`, or `near()");var t,e;if(1!==arguments.length)throw new TypeError("Invalid argument");if(this._ensurePath("geometry"),e=this._path,!(t=arguments[0]).type||!Array.isArray(t.coordinates))throw new TypeError("Invalid argument");var r=this._conditions[e]||(this._conditions[e]={});return r[this._geoComparison]={$geometry:t},this},f.prototype.select=function(){var t=arguments[0];if(!t)return this;if(1!==arguments.length)throw new Error("Invalid select: select only takes 1 argument");this._validate("select");var e,r,n=this._fields||(this._fields={}),i=o(t);if(("string"==i||u.isArgumentsObject(t))&&"number"==typeof t.length||Array.isArray(t)){for("string"==i&&(t=t.split(/\s+/)),e=0,r=t.length;e<r;++e){var s=t[e];if(s){var a="-"==s[0]?0:1;0===a&&(s=s.substring(1)),n[s]=a}}return this}if(u.isObject(t)){var h=u.keys(t);for(e=0;e<h.length;++e)n[h[e]]=t[h[e]];return this}throw new TypeError("Invalid select() argument. Must be string or object.")},f.prototype.slice=function(){if(0===arguments.length)return this;var t,e;if(this._validate("slice"),1===arguments.length){var r=arguments[0];if("object"===o(r)&&!Array.isArray(r)){for(var n=Object.keys(r),i=n.length,s=0;s<i;++s)this.slice(n[s],r[n[s]]);return this}this._ensurePath("slice"),t=this._path,e=arguments[0]}else 2===arguments.length?"number"==typeof arguments[0]?(this._ensurePath("slice"),t=this._path,e=[arguments[0],arguments[1]]):(t=arguments[0],e=arguments[1]):3===arguments.length&&(t=arguments[0],e=[arguments[1],arguments[2]]);var a=this._fields||(this._fields={});return a[t]={$slice:e},this},f.prototype.sort=function(t){if(!t)return this;var e,r,n;this._validate("sort");var i=o(t);if(Array.isArray(t)){for(r=t.length,e=0;e<t.length;++e){if(!Array.isArray(t[e]))throw new Error("Invalid sort() argument, must be array of arrays");p(this.options,t[e][0],t[e][1])}return this}if(1===arguments.length&&"string"==i){for(r=(t=t.split(/\s+/)).length,e=0;e<r;++e)if(n=t[e]){var s="-"==n[0]?-1:1;-1===s&&(n=n.substring(1)),d(this.options,n,s)}return this}if(u.isObject(t)){var a=u.keys(t);for(e=0;e<a.length;++e)n=a[e],d(this.options,n,t[n]);return this}if("undefined"!=typeof Map&&t instanceof Map)return y(this.options,t),this;throw new TypeError("Invalid sort() argument. Must be a string, object, or array.")};
  1147. /*!
  1148. * @ignore
  1149. */
  1150. var l={1:1,"-1":-1,asc:1,ascending:1,desc:-1,descending:-1};function d(t,e,r){if(Array.isArray(t.sort))throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");var n;if(r&&r.$meta)(n=t.sort||(t.sort={}))[e]={$meta:r.$meta};else{n=t.sort||(t.sort={});var i=String(r||1).toLowerCase();if(!(i=l[i]))throw new TypeError("Invalid sort value: { "+e+": "+r+" }");n[e]=i}}function p(t,e,r){if(t.sort=t.sort||[],!Array.isArray(t.sort))throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");var n=String(r||1).toLowerCase();if(!(n=l[n]))throw new TypeError("Invalid sort value: [ "+e+", "+r+" ]");t.sort.push([e,n])}function y(t,e){if(t.sort=t.sort||new Map,!(t.sort instanceof Map))throw new TypeError("Can't mix sort syntaxes. Use either array or object or map consistently");e.forEach((function(e,r){var n=String(e||1).toLowerCase();if(!(n=l[n]))throw new TypeError("Invalid sort value: < "+r+": "+e+" >");t.sort.set(r,n)}))}
  1151. /*!
  1152. * limit, skip, maxScan, batchSize, comment
  1153. *
  1154. * Sets these associated options.
  1155. *
  1156. * query.comment('feed query');
  1157. */
  1158. /*!
  1159. * Internal helper for update, updateMany, updateOne
  1160. */
  1161. function m(t,e,r,n,i,o,s){return t.op=e,f.canMerge(r)&&t.merge(r),n&&t._mergeUpdate(n),u.isObject(i)&&t.setOptions(i),o||s?!t._update||!t.options.overwrite&&0===u.keys(t._update).length?(s&&u.soon(s.bind(null,null,0)),t):(i=t._optionsForExec(),s||(i.safe=!1),r=t._conditions,n=t._updateForExec(),h("update",t._collection.collectionName,r,n,i),s=t._wrapCallback(e,s,{conditions:r,doc:n,options:i}),t._collection[e](r,n,i,u.tick(s)),t):t}["limit","skip","maxScan","batchSize","comment"].forEach((function(t){f.prototype[t]=function(e){return this._validate(t),this.options[t]=e,this}})),f.prototype.maxTime=f.prototype.maxTimeMS=function(t){return this._validate("maxTime"),this.options.maxTimeMS=t,this},f.prototype.snapshot=function(){return this._validate("snapshot"),this.options.snapshot=!arguments.length||!!arguments[0],this},f.prototype.hint=function(){if(0===arguments.length)return this;this._validate("hint");var t=arguments[0];if(u.isObject(t)){var e=this.options.hint||(this.options.hint={});for(var r in t)e[r]=t[r];return this}if("string"==typeof t)return this.options.hint=t,this;throw new TypeError("Invalid hint. "+t)},f.prototype.j=function(t){return this.options.j=t,this},f.prototype.slaveOk=function(t){return this.options.slaveOk=!arguments.length||!!t,this},f.prototype.read=f.prototype.setReadPreference=function(t){return arguments.length>1&&!f.prototype.read.deprecationWarningIssued&&(console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),f.prototype.read.deprecationWarningIssued=!0),this.options.readPreference=u.readPref(t),this},f.prototype.readConcern=f.prototype.r=function(t){return this.options.readConcern=u.readConcern(t),this},f.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=!arguments.length||!!arguments[0],this},f.prototype.writeConcern=f.prototype.w=function(t){return"object"===o(t)?(void 0!==t.j&&(this.options.j=t.j),void 0!==t.w&&(this.options.w=t.w),void 0!==t.wtimeout&&(this.options.wtimeout=t.wtimeout)):this.options.w="m"===t?"majority":t,this},f.prototype.wtimeout=f.prototype.wTimeout=function(t){return this.options.wtimeout=t,this},f.prototype.merge=function(t){if(!t)return this;if(!f.canMerge(t))throw new TypeError("Invalid argument. Expected instanceof mquery or plain object");return t instanceof f?(t._conditions&&u.merge(this._conditions,t._conditions),t._fields&&(this._fields||(this._fields={}),u.merge(this._fields,t._fields)),t.options&&(this.options||(this.options={}),u.merge(this.options,t.options)),t._update&&(this._update||(this._update={}),u.mergeClone(this._update,t._update)),t._distinct&&(this._distinct=t._distinct),this):(u.merge(this._conditions,t),this)},f.prototype.find=function(t,e){if(this.op="find","function"==typeof t?(e=t,t=void 0):f.canMerge(t)&&this.merge(t),!e)return this;var r=this._conditions,n=this._optionsForExec();return this.$useProjection?n.projection=this._fieldsForExec():n.fields=this._fieldsForExec(),h("find",this._collection.collectionName,r,n),e=this._wrapCallback("find",e,{conditions:r,options:n}),this._collection.find(r,n,u.tick(e)),this},f.prototype.cursor=function(t){if(this.op){if("find"!==this.op)throw new TypeError(".cursor only support .find method")}else this.find(t);var e=this._conditions,r=this._optionsForExec();return this.$useProjection?r.projection=this._fieldsForExec():r.fields=this._fieldsForExec(),h("findCursor",this._collection.collectionName,e,r),this._collection.findCursor(e,r)},f.prototype.findOne=function(t,e){if(this.op="findOne","function"==typeof t?(e=t,t=void 0):f.canMerge(t)&&this.merge(t),!e)return this;var r=this._conditions,n=this._optionsForExec();return this.$useProjection?n.projection=this._fieldsForExec():n.fields=this._fieldsForExec(),h("findOne",this._collection.collectionName,r,n),e=this._wrapCallback("findOne",e,{conditions:r,options:n}),this._collection.findOne(r,n,u.tick(e)),this},f.prototype.count=function(t,e){if(this.op="count",this._validate(),"function"==typeof t?(e=t,t=void 0):f.canMerge(t)&&this.merge(t),!e)return this;var r=this._conditions,n=this._optionsForExec();return h("count",this._collection.collectionName,r,n),e=this._wrapCallback("count",e,{conditions:r,options:n}),this._collection.count(r,n,u.tick(e)),this},f.prototype.distinct=function(t,e,r){if(this.op="distinct",this._validate(),!r){switch(o(e)){case"function":r=e,"string"==typeof t&&(e=t,t=void 0);break;case"undefined":case"string":break;default:throw new TypeError("Invalid `field` argument. Must be string or function")}switch(o(t)){case"function":r=t,t=e=void 0;break;case"string":e=t,t=void 0}}if("string"==typeof e&&(this._distinct=e),f.canMerge(t)&&this.merge(t),!r)return this;if(!this._distinct)throw new Error("No value for `distinct` has been declared");var n=this._conditions,i=this._optionsForExec();return h("distinct",this._collection.collectionName,n,i),r=this._wrapCallback("distinct",r,{conditions:n,options:i}),this._collection.distinct(this._distinct,n,i,u.tick(r)),this},f.prototype.update=function(t,e,r,n){var i;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(o(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":i=t,t=void 0;break;default:e=t,t=r=void 0}}return m(this,"update",t,e,r,i,n)},f.prototype.updateMany=function(t,e,r,n){var i;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(o(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":i=t,t=void 0;break;default:e=t,t=r=void 0}}return m(this,"updateMany",t,e,r,i,n)},f.prototype.updateOne=function(t,e,r,n){var i;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(o(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":i=t,t=void 0;break;default:e=t,t=r=void 0}}return m(this,"updateOne",t,e,r,i,n)},f.prototype.replaceOne=function(t,e,r,n){var i;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(o(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":i=t,t=void 0;break;default:e=t,t=r=void 0}}return this.setOptions({overwrite:!0}),m(this,"replaceOne",t,e,r,i,n)},f.prototype.remove=function(t,e){var r;if(this.op="remove","function"==typeof t?(e=t,t=void 0):f.canMerge(t)?this.merge(t):!0===t&&(r=t,t=void 0),!r&&!e)return this;var n=this._optionsForExec();e||(n.safe=!1);var i=this._conditions;return h("remove",this._collection.collectionName,i,n),e=this._wrapCallback("remove",e,{conditions:i,options:n}),this._collection.remove(i,n,u.tick(e)),this},f.prototype.deleteOne=function(t,e){var r;if(this.op="deleteOne","function"==typeof t?(e=t,t=void 0):f.canMerge(t)?this.merge(t):!0===t&&(r=t,t=void 0),!r&&!e)return this;var n=this._optionsForExec();e||(n.safe=!1),delete n.justOne;var i=this._conditions;return h("deleteOne",this._collection.collectionName,i,n),e=this._wrapCallback("deleteOne",e,{conditions:i,options:n}),this._collection.deleteOne(i,n,u.tick(e)),this},f.prototype.deleteMany=function(t,e){var r;if(this.op="deleteMany","function"==typeof t?(e=t,t=void 0):f.canMerge(t)?this.merge(t):!0===t&&(r=t,t=void 0),!r&&!e)return this;var n=this._optionsForExec();e||(n.safe=!1),delete n.justOne;var i=this._conditions;return h("deleteOne",this._collection.collectionName,i,n),e=this._wrapCallback("deleteOne",e,{conditions:i,options:n}),this._collection.deleteMany(i,n,u.tick(e)),this},f.prototype.findOneAndUpdate=function(t,e,r,n){switch(this.op="findOneAndUpdate",this._validate(),arguments.length){case 3:"function"==typeof r&&(n=r,r={});break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0),r=void 0;break;case 1:"function"==typeof t?(n=t,t=r=e=void 0):(e=t,t=r=void 0)}if(f.canMerge(t)&&this.merge(t),e&&this._mergeUpdate(e),r&&this.setOptions(r),!n)return this;var i=this._conditions,o=this._updateForExec();return r=this._optionsForExec(),this._collection.findOneAndUpdate(i,o,r,u.tick(n))},f.prototype.findOneAndRemove=f.prototype.findOneAndDelete=function(t,e,r){if(this.op="findOneAndRemove",this._validate(),"function"==typeof e?(r=e,e=void 0):"function"==typeof t&&(r=t,t=void 0),f.canMerge(t)&&this.merge(t),e&&this.setOptions(e),!r)return this;e=this._optionsForExec();var n=this._conditions;return this._collection.findOneAndDelete(n,e,u.tick(r))},f.prototype._wrapCallback=function(t,e,r){var n=this._traceFunction||f.traceFunction;if(n){r.collectionName=this._collection.collectionName;var i=n&&n.call(null,t,r,this),o=(new Date).getTime();return function(t,r){if(i){var n=(new Date).getTime()-o;i.call(null,t,r,n)}e&&e.apply(null,arguments)}}return e},f.prototype.setTraceFunction=function(t){return this._traceFunction=t,this},f.prototype.exec=function(t,e){switch(o(t)){case"function":e=t,t=null;break;case"string":this.op=t}s.ok(this.op,"Missing query type: (find, update, etc)"),"update"!=this.op&&"remove"!=this.op||e||(e=!0);var r=this;if("function"!=typeof e)return new f.Promise((function(t,e){r[r.op]((function(r,n){r?e(r):t(n),t=e=null}))}));this[this.op](e)},f.prototype.thunk=function(){var t=this;return function(e){t.exec(e)}},f.prototype.then=function(t,e){var r=this;return new f.Promise((function(t,e){r.exec((function(r,n){r?e(r):t(n),t=e=null}))})).then(t,e)},f.prototype.cursor=function(){if("find"!=this.op)throw new Error("cursor() is only available for find");var t=this._conditions,e=this._optionsForExec();return this.$useProjection?e.projection=this._fieldsForExec():e.fields=this._fieldsForExec(),h("cursor",this._collection.collectionName,t,e),this._collection.findCursor(t,e)},f.prototype.selected=function(){return!!(this._fields&&Object.keys(this._fields).length>0)},f.prototype.selectedInclusively=function(){if(!this._fields)return!1;var t=Object.keys(this._fields);if(0===t.length)return!1;for(var e=0;e<t.length;++e){var r=t[e];if(0===this._fields[r])return!1;if(this._fields[r]&&"object"===o(this._fields[r])&&this._fields[r].$meta)return!1}return!0},f.prototype.selectedExclusively=function(){if(!this._fields)return!1;var t=Object.keys(this._fields);if(0===t.length)return!1;for(var e=0;e<t.length;++e){var r=t[e];if(0===this._fields[r])return!0}return!1},f.prototype._mergeUpdate=function(t){this._update||(this._update={}),t instanceof f?t._update&&u.mergeClone(this._update,t._update):u.mergeClone(this._update,t)},f.prototype._optionsForExec=function(){return u.clone(this.options)},f.prototype._fieldsForExec=function(){return u.clone(this._fields)},f.prototype._updateForExec=function(){var t,e=u.clone(this._update),r=u.keys(e),i={},o=n(r);try{for(o.s();!(t=o.n()).done;){var s=t.value;this.options.overwrite?i[s]=e[s]:"$"!==s[0]?(i.$set||(e.$set?i.$set=e.$set:i.$set={}),i.$set[s]=e[s],~r.indexOf("$set")||r.push("$set")):"$set"===s&&i.$set||(i[s]=e[s])}}catch(t){o.e(t)}finally{o.f()}return this._compiledUpdate=i,i},f.prototype._ensurePath=function(t){if(!this._path)throw new Error(t+"() must be used after where() when called with these arguments")},
  1162. /*!
  1163. * Permissions
  1164. */
  1165. f.permissions=r(288),f._isPermitted=function(t,e){var r=f.permissions[e];return!r||!0!==r[t]},f.prototype._validate=function(t){var e,r;if(void 0===t){if("function"!=typeof(r=f.permissions[this.op]))return!0;e=r(this)}else f._isPermitted(t,this.op)||(e=t);if(e)throw new Error(e+" cannot be used with "+this.op)},f.canMerge=function(t){return t instanceof f||u.isObject(t)},f.setGlobalTraceFunction=function(t){f.traceFunction=t},
  1166. /*!
  1167. * Exports.
  1168. */
  1169. f.utils=u,f.env=r(149),f.Collection=r(289),f.BaseCollection=r(54),f.Promise=Promise,t.exports=f},function(t,e,r){"use strict";(function(t,r,n){
  1170. /*!
  1171. * Module dependencies.
  1172. */
  1173. var i=["__proto__","constructor","prototype"],o=e.clone=function r(n,i){if(null==n)return n;if(Array.isArray(n))return e.cloneArray(n,i);if(n.constructor){if(/ObjectI[dD]$/.test(n.constructor.name))return"function"==typeof n.clone?n.clone():new n.constructor(n.id);if("ReadPreference"===n.constructor.name)return new n.constructor(n.mode,r(n.tags,i));if("Binary"==n._bsontype&&n.buffer&&n.value)return"function"==typeof n.clone?n.clone():new n.constructor(n.value(!0),n.sub_type);if("Date"===n.constructor.name||"Function"===n.constructor.name)return new n.constructor(+n);if("RegExp"===n.constructor.name)return new RegExp(n);if("Buffer"===n.constructor.name)return t.from(n)}return a(n)?e.cloneObject(n,i):n.valueOf?n.valueOf():void 0};
  1174. /*!
  1175. * ignore
  1176. */
  1177. e.cloneObject=function(t,e){var r,n=e&&e.minimize,s={},a=Object.keys(t),u=a.length,h=!1,f="",c=0;for(c=0;c<u;++c)f=a[c],-1===i.indexOf(f)&&(r=o(t[f],e),n&&void 0===r||(h||(h=!0),s[f]=r));return n?h&&s:s},e.cloneArray=function(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push(o(t[i],e));return r},e.tick=function(t){if("function"==typeof t)return function(){var e=arguments;u((function(){t.apply(this,e)}))}},e.merge=function t(r,n){for(var o=0,s=Object.keys(n);o<s.length;o++){var a=s[o];-1===i.indexOf(a)&&(void 0===r[a]?r[a]=n[a]:e.isObject(n[a])?t(r[a],n[a]):r[a]=n[a])}},e.mergeClone=function t(r,n){for(var s=0,a=Object.keys(n);s<a.length;s++){var u=a[s];-1===i.indexOf(u)&&(void 0===r[u]?r[u]=o(n[u]):e.isObject(n[u])?t(r[u],n[u]):r[u]=o(n[u]))}},e.readPref=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},e.readConcern=function(t){if("string"==typeof t){switch(t){case"l":t="local";break;case"a":t="available";break;case"m":t="majority";break;case"lz":t="linearizable";break;case"s":t="snapshot"}t={level:t}}return t};var s=Object.prototype.toString;e.toString=function(t){return s.call(t)};var a=e.isObject=function(t){return"[object Object]"==e.toString(t)};e.keys=Object.keys,e.create="function"==typeof Object.create?Object.create:function(t){if(arguments.length>1)throw new Error("Adding properties is not supported");function e(){}return e.prototype=t,new e},e.inherits=function(t,r){t.prototype=e.create(r.prototype),t.prototype.constructor=t};var u=e.soon="function"==typeof r?r:n.nextTick;e.isArgumentsObject=function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}}).call(this,r(3).Buffer,r(108).setImmediate,r(5))},function(t,e,r){(function(n){var i;e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){var t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(i=!1,function(){i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||function(){},t.exports=r(287)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(5))},function(t,e,r){function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){function e(t){var r,n,o,s=null;function a(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(a.enabled){var o=a,s=Number(new Date),u=s-(r||s);o.diff=u,o.prev=r,o.curr=s,r=s,n[0]=e.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var h=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(t,r){if("%%"===t)return"%";h++;var i=e.formatters[r];if("function"==typeof i){var s=n[h];t=i.call(o,s),n.splice(h,1),h--}return t})),e.formatArgs.call(o,n);var f=o.log||e.log;f.apply(o,n)}}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=i,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==s?s:(n!==e.namespaces&&(n=e.namespaces,o=e.enabled(t)),o)},set:function(t){s=t}}),"function"==typeof e.init&&e.init(a),a}function i(t,r){var n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function o(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){var t=[].concat(n(e.names.map(o)),n(e.skips.map(o).map((function(t){return"-"+t})))).join(",");return e.enable(""),t},e.enable=function(t){var r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];var n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(143),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((function(r){e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},function(t,e,r){"use strict";var n=e;n.distinct=function(t){return t._fields&&Object.keys(t._fields).length>0?"field selection and slice":(Object.keys(n.distinct).every((function(r){return!t.options[r]||(e=r,!1)})),e);var e},n.distinct.select=n.distinct.slice=n.distinct.sort=n.distinct.limit=n.distinct.skip=n.distinct.batchSize=n.distinct.comment=n.distinct.maxScan=n.distinct.snapshot=n.distinct.hint=n.distinct.tailable=!0,n.findOneAndUpdate=n.findOneAndRemove=function(t){var e;return Object.keys(n.findOneAndUpdate).every((function(r){return!t.options[r]||(e=r,!1)})),e},n.findOneAndUpdate.limit=n.findOneAndUpdate.skip=n.findOneAndUpdate.batchSize=n.findOneAndUpdate.maxScan=n.findOneAndUpdate.snapshot=n.findOneAndUpdate.hint=n.findOneAndUpdate.tailable=n.findOneAndUpdate.comment=!0,n.count=function(t){return t._fields&&Object.keys(t._fields).length>0?"field selection and slice":(Object.keys(n.count).every((function(r){return!t.options[r]||(e=r,!1)})),e);var e},n.count.slice=n.count.batchSize=n.count.comment=n.count.maxScan=n.count.snapshot=n.count.tailable=!0},function(t,e,r){"use strict";var n=r(149);if("unknown"==n.type)throw new Error("Unknown environment");t.exports=n.isNode?r(290):(n.isMongo,r(54))},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(e=a.call(this)).collection=t,e.collectionName=t.collectionName,e}return e=u,(r=[{key:"find",value:function(t,e,r){var n=this.collection.find(t,e);try{n.toArray(r)}catch(t){r(t)}}},{key:"findOne",value:function(t,e,r){this.collection.findOne(t,e,r)}},{key:"count",value:function(t,e,r){this.collection.count(t,e,r)}},{key:"distinct",value:function(t,e,r,n){this.collection.distinct(t,e,r,n)}},{key:"update",value:function(t,e,r,n){this.collection.update(t,e,r,n)}},{key:"updateMany",value:function(t,e,r,n){this.collection.updateMany(t,e,r,n)}},{key:"updateOne",value:function(t,e,r,n){this.collection.updateOne(t,e,r,n)}},{key:"replaceOne",value:function(t,e,r,n){this.collection.replaceOne(t,e,r,n)}},{key:"deleteOne",value:function(t,e,r){this.collection.deleteOne(t,e,r)}},{key:"deleteMany",value:function(t,e,r){this.collection.deleteMany(t,e,r)}},{key:"remove",value:function(t,e,r){this.collection.remove(t,e,r)}},{key:"findOneAndDelete",value:function(t,e,r){this.collection.findOneAndDelete(t,e,r)}},{key:"findOneAndUpdate",value:function(t,e,r,n){this.collection.findOneAndUpdate(t,e,r,n)}},{key:"findCursor",value:function(t,e){return this.collection.find(t,e)}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(r(54));t.exports=h},function(t,e,r){"use strict";var n=t.exports={};n.DocumentNotFoundError=null,n.general={},n.general.default="Validator failed for path `{PATH}` with value `{VALUE}`",n.general.required="Path `{PATH}` is required.",n.Number={},n.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).",n.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).",n.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",n.Date={},n.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).",n.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).",n.String={},n.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",n.String.match="Path `{PATH}` is invalid ({VALUE}).",n.String.minlength="Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).",n.String.maxlength="Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH})."},function(t,e,r){"use strict";
  1178. /*!
  1179. * Module dependencies.
  1180. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=r(8),f=r(9),c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);
  1181. /*!
  1182. * OverwriteModel Error constructor.
  1183. */function u(t,e,r,n){var i,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var s=h.messages;return o=null!=s.DocumentNotFoundError?"function"==typeof s.DocumentNotFoundError?s.DocumentNotFoundError(t,e):s.DocumentNotFoundError:'No document found for query "'+f.inspect(t)+'" on model "'+e+'"',(i=a.call(this,o)).result=n,i.numAffected=r,i.filter=t,i.query=t,i}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(h);Object.defineProperty(c.prototype,"name",{value:"DocumentNotFoundError"}),
  1184. /*!
  1185. * exports
  1186. */
  1187. t.exports=c},function(t,e,r){"use strict";
  1188. /*!
  1189. * Module dependencies.
  1190. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var i=r.join(", ");return(n=a.call(this,'No matching document found for id "'+t._id+'" version '+e+' modifiedPaths "'+i+'"')).version=e,n.modifiedPaths=r,n}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"VersionError"}),
  1191. /*!
  1192. * exports
  1193. */
  1194. t.exports=h},function(t,e,r){"use strict";
  1195. /*!
  1196. * Module dependencies.
  1197. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);return a.call(this,"Can't save() the same doc multiple times in parallel. Document: "+t._id)}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"ParallelSaveError"}),
  1198. /*!
  1199. * exports
  1200. */
  1201. t.exports=h},function(t,e,r){"use strict";
  1202. /*!
  1203. * Module dependencies.
  1204. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);
  1205. /*!
  1206. * OverwriteModel Error constructor.
  1207. * @param {String} name
  1208. */function u(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,"Cannot overwrite `"+t+"` model once compiled.")}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"OverwriteModelError"}),
  1209. /*!
  1210. * exports
  1211. */
  1212. t.exports=h},function(t,e,r){"use strict";
  1213. /*!
  1214. * Module dependencies.
  1215. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);
  1216. /*!
  1217. * MissingSchema Error constructor.
  1218. * @param {String} name
  1219. */function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var e="Schema hasn't been registered for model \""+t+'".\nUse mongoose.model(name, schema)';return a.call(this,e)}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"MissingSchemaError"}),
  1220. /*!
  1221. * exports
  1222. */
  1223. t.exports=h},function(t,e,r){"use strict";
  1224. /*!
  1225. * Module dependencies.
  1226. */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 i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=r(19),c=r(298),l=r(299),d=r(300),p=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return i(this,h),u.apply(this,arguments)}return e=h,(r=[{key:"assimilateError",value:function(t){var e=t.reason,r=l(e)&&c(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://docs.atlas.mongodb.com/security-whitelist/":d(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}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),h}(f);Object.defineProperty(p.prototype,"name",{value:"MongooseServerSelectionError"}),t.exports=p},function(t,e,r){"use strict";var n=r(22);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}))}},function(t,e,r){"use strict";var n=r(22);t.exports=function(t){if("TopologyDescription"!==n(t))return!1;var e=Array.from(t.servers.keys());return e.length>0&&e.every((function(t){return t.endsWith(".mongodb.net:27017")}))}},function(t,e,r){"use strict";var n=r(22);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")}))}},function(t,e,r){"use strict";
  1227. /*!
  1228. * Module dependencies.
  1229. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);
  1230. /*!
  1231. * DivergentArrayError constructor.
  1232. * @param {Array<String>} paths
  1233. */function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var e="For your own good, using `document.save()` to update an array which was selected using an $elemMatch projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n "+t.join("\n ")+"\nUse Model.update() to update these arrays instead.";return a.call(this,e)}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"DivergentArrayError"}),
  1234. /*!
  1235. * exports
  1236. */
  1237. t.exports=h},function(t,e,r){"use strict";var n=r(44);
  1238. /*!
  1239. * ignore
  1240. */t.exports=function(t){var e,r;t.$immutable?(t.$immutableSetter=(e=t.path,r=t.options.immutable,function(t){if(null==this||null==this.$__)return t;if(this.isNew)return t;if(!("function"==typeof r?r.call(this,this):r))return t;var i=null!=this.$__.priorDoc?this.$__.priorDoc.$__getValue(e):this.$__getValue(e);if("throw"===this.$__.strictMode&&t!==i)throw new n(e,"Path `"+e+"` is immutable and strict mode is set to throw.",!0);return i}),t.set(t.$immutableSetter)):t.$immutableSetter&&(t.setters=t.setters.filter((function(e){return e!==t.$immutableSetter})),delete t.$immutableSetter)}},function(t,e,r){"use strict";var n=r(9).inspect;t.exports=function(t){if("function"==typeof t)return n(t).startsWith("[AsyncFunction:")}},function(t,e,r){"use strict";
  1241. /*!
  1242. * Module dependencies.
  1243. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t,e,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,'Parameter "'+e+'" to '+r+"() must be an object, got "+t.toString())}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(8));Object.defineProperty(h.prototype,"name",{value:"ObjectParameterError"}),t.exports=h},function(t,e,r){"use strict";
  1244. /*!
  1245. * Module dependencies.
  1246. */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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);return a.call(this,"Can't validate() the same doc multiple times in parallel. Document: "+t._id)}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(19));Object.defineProperty(h.prototype,"name",{value:"ParallelValidateError"}),
  1247. /*!
  1248. * exports
  1249. */
  1250. t.exports=h},function(t,e,r){"use strict";(function(e){function r(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){this._pres=new Map,this._posts=new Map}function s(t,e,r,n,i,o,s){if(o.useErrorHandlers){var a={error:e};return t.execPost(r,n,i,a,(function(t){return"function"==typeof s&&s(t)}))}return"function"==typeof s?s(e):void 0}function a(t,e,r){return t.has(e)?t.get(e):r}function u(t,e,r,n){var i;try{i=t.apply(e,r)}catch(t){return n(t)}h(i)&&i.then((function(){return n()}),(function(t){return n(t)}))}function h(t){return null!=t&&"function"==typeof t.then}function f(t){var r=!1,n=this;return function(){var i=arguments;if(!r)return r=!0,e.nextTick((function(){return t.apply(n,i)}))}}o.prototype.execPre=function(t,r,n,i){3===arguments.length&&(i=n,n=[]);var o=a(this._pres,t,[]),s=o.length,c=o.numAsync||0,l=0,d=c,p=!1,y=n;if(!s)return e.nextTick((function(){i(null)}));var m=function t(){if(!(l>=s)){var n=o[l];if(n.isAsync){var a=[f(b),f((function(t){if(t){if(p)return;return p=!0,i(t)}if(0==--d&&l>=s)return i(null)}))];u(n.fn,r,a,a[0])}else if(n.fn.length>0){a=[f(b)];for(var c=arguments.length>=2?arguments:[null].concat(y),m=1;m<c.length;++m)a.push(c[m]);u(n.fn,r,a,a[0])}else{var v=null;try{v=n.fn.call(r)}catch(t){if(null!=t)return i(t)}if(h(v))v.then((function(){return b()}),(function(t){return b(t)}));else{if(++l>=s)return d>0?void 0:e.nextTick((function(){i(null)}));t()}}}};function b(t){if(t){if(p)return;return p=!0,i(t)}if(++l>=s)return d>0?void 0:i(null);m.apply(r,arguments)}m.apply(null,[null].concat(n))},o.prototype.execPreSync=function(t,e,r){for(var n=a(this._pres,t,[]),i=n.length,o=0;o<i;++o)n[o].fn.apply(e,r||[])},o.prototype.execPost=function(t,r,n,i,o){arguments.length<5&&(o=i,i=null);var s=a(this._posts,t,[]),c=s.length,l=0,d=null;if(i&&i.error&&(d=i.error),!c)return e.nextTick((function(){o.apply(null,[d].concat(n))}));var p=function t(){for(var e=s[l].fn,i=0,a=n.length,p=[],y=0;y<a;++y)i+=n[y]&&n[y]._kareemIgnore?0:1,n[y]&&n[y]._kareemIgnore||p.push(n[y]);if(d)if(e.length===i+2){var m=f((function(e){if(e&&(d=e),++l>=c)return o.call(null,d);t()}));u(e,r,[d].concat(p).concat([m]),m)}else{if(++l>=c)return o.call(null,d);t()}else{var b=f((function(e){return e?(d=e,t()):++l>=c?o.apply(null,[null].concat(n)):void t()}));if(e.length===i+2)return++l>=c?o.apply(null,[null].concat(n)):t();if(e.length===i+1)u(e,r,p.concat([b]),b);else{var v,g;try{g=e.apply(r,p)}catch(t){v=t,d=t}if(h(g))return g.then((function(){return b()}),(function(t){return b(t)}));if(++l>=c)return o.apply(null,[v].concat(n));t()}}};p()},o.prototype.execPostSync=function(t,e,r){for(var n=a(this._posts,t,[]),i=n.length,o=0;o<i;++o)n[o].fn.apply(e,r||[])},o.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]),n}},o.prototype.wrap=function(t,e,r,n,i){var o=n.length>0?n[n.length-1]:null,a=("function"==typeof o&&n.slice(0,n.length-1),this),u=(i=i||{}).checkForPromise;this.execPre(t,r,n,(function(h){if(h){for(var f=i.numCallbackParams||0,c=i.contextParameter?[r]:[],l=c.length;l<f;++l)c.push(null);return s(a,h,t,r,c,i,o)}var d,p="function"==typeof o?n.length-1:n.length,y=e.length;try{d=e.apply(r,n.slice(0,p).concat(m))}catch(t){return m(t)}if(u){if(null!=d&&"function"==typeof d.then)return d.then((function(t){return m(null,t)}),(function(t){return m(t)}));if(y<p+1)return m(null,d)}function m(){var e=Array.prototype.slice.call(arguments,1);if(i.nullResultByDefault&&0===e.length&&e.push(null),arguments[0])return s(a,arguments[0],t,r,e,i,o);a.execPost(t,r,e,(function(){return arguments[0]?"function"==typeof o?o(arguments[0]):void 0:"function"==typeof o?o.apply(r,arguments):void 0}))}}))},o.prototype.filter=function(t){for(var e=this,r=this.clone(),n=Array.from(r._pres.keys()),i=function(){var n=s[o],i=e._pres.get(n).map((function(t){return Object.assign({},t,{name:n})})).filter(t);if(0===i.length)return r._pres.delete(n),"continue";i.numAsync=i.filter((function(t){return t.isAsync})).length,r._pres.set(n,i)},o=0,s=n;o<s.length;o++)i();for(var a=Array.from(r._posts.keys()),u=function(){var n=f[h],i=e._posts.get(n).map((function(t){return Object.assign({},t,{name:n})})).filter(t);if(0===i.length)return r._posts.delete(n),"continue";r._posts.set(n,i)},h=0,f=a;h<f.length;h++)u();return r},o.prototype.hasHooks=function(t){return this._pres.has(t)||this._posts.has(t)},o.prototype.createWrapper=function(t,r,n,i){var o=this;return this.hasHooks(t)?function(){var e=n||this,s=Array.prototype.slice.call(arguments);o.wrap(t,r,e,s,i)}:function(){var t=arguments,n=this;e.nextTick((function(){return r.apply(n,t)}))}},o.prototype.pre=function(t,e,r,n,o){var s={};"object"===i(e)&&null!=e?e=(s=e).isAsync:"boolean"!=typeof arguments[1]&&(n=r,r=e,e=!1);var u=a(this._pres,t,[]);if(this._pres.set(t,u),e&&(u.numAsync=u.numAsync||0,++u.numAsync),"function"!=typeof r)throw new Error('pre() requires a function, got "'+i(r)+'"');return o?u.unshift(Object.assign({},s,{fn:r,isAsync:e})):u.push(Object.assign({},s,{fn:r,isAsync:e})),this},o.prototype.post=function(t,e,r,n){var o=a(this._posts,t,[]);if("function"==typeof e&&(n=!!r,r=e,e={}),"function"!=typeof r)throw new Error('post() requires a function, got "'+i(r)+'"');return n?o.unshift(Object.assign({},e,{fn:r})):o.push(Object.assign({},e,{fn:r})),this._posts.set(t,o),this},o.prototype.clone=function(){var t,e=new o,n=r(this._pres.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value,s=this._pres.get(i).slice();s.numAsync=this._pres.get(i).numAsync,e._pres.set(i,s)}}catch(t){n.e(t)}finally{n.f()}var a,u=r(this._posts.keys());try{for(u.s();!(a=u.n()).done;){var h=a.value;e._posts.set(h,this._posts.get(h).slice())}}catch(t){u.e(t)}finally{u.f()}return e},o.prototype.merge=function(t,e){var n,i=(e=1===arguments.length||e)?this.clone():this,o=r(t._pres.keys());try{var s=function(){var e=n.value,r=a(i._pres,e,[]),o=t._pres.get(e).filter((function(t){return-1===r.map((function(t){return t.fn})).indexOf(t.fn)})),s=r.concat(o);s.numAsync=r.numAsync||0,s.numAsync+=o.filter((function(t){return t.isAsync})).length,i._pres.set(e,s)};for(o.s();!(n=o.n()).done;)s()}catch(t){o.e(t)}finally{o.f()}var u,h=r(t._posts.keys());try{var f=function(){var e=u.value,r=a(i._posts,e,[]),n=t._posts.get(e).filter((function(t){return-1===r.indexOf(t)}));i._posts.set(e,r.concat(n))};for(h.s();!(u=h.n()).done;)f()}catch(t){h.e(t)}finally{h.f()}return i},t.exports=o}).call(this,r(5))},function(t,e,r){"use strict";function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var o=r(16),s=i((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.assign(this,e),null!=e&&null!=e.options&&(this.options=Object.assign({},e.options))}));Object.defineProperty(s.prototype,"ref",o),Object.defineProperty(s.prototype,"refPath",o),Object.defineProperty(s.prototype,"localField",o),Object.defineProperty(s.prototype,"foreignField",o),Object.defineProperty(s.prototype,"justOne",o),Object.defineProperty(s.prototype,"count",o),Object.defineProperty(s.prototype,"match",o),Object.defineProperty(s.prototype,"options",o),Object.defineProperty(s.prototype,"skip",o),Object.defineProperty(s.prototype,"limit",o),Object.defineProperty(s.prototype,"perDocumentLimit",o),t.exports=s},function(t,e,r){"use strict";var n=r(6),i=r(33);
  1251. /*!
  1252. * Gather all indexes defined in the schema, including single nested,
  1253. * document arrays, and embedded discriminators.
  1254. */
  1255. t.exports=function(t){var e=[],r=new WeakMap,o=t.constructor.indexTypes,s=new Map;return function t(a,u,h){if(r.has(a))return;r.set(a,!0),u=u||"";for(var f=Object.keys(a.paths),c=0,l=f;c<l.length;c++){var d=l[c],p=a.paths[d];if(null==h||!h.paths[d]){if(p.$isMongooseDocumentArray||p.$isSingleNested){if(!0!==n(p,"options.excludeIndexes")&&!0!==n(p,"schemaOptions.excludeIndexes")&&!0!==n(p,"schema.options.excludeIndexes")&&t(p.schema,u+d+"."),null!=p.schema.discriminators)for(var y=p.schema.discriminators,m=Object.keys(y),b=0,v=m;b<v.length;b++){var g=v[b];t(y[g],u+d+".",p.schema)}if(p.$isMongooseDocumentArray)continue}var w=p._index||p.caster&&p.caster._index;if(!1!==w&&null!=w){var _={},M=i(w),S=M?w:{},O="string"==typeof w?w:!!M&&w.type;if(O&&-1!==o.indexOf(O))_[u+d]=O;else if(S.text)_[u+d]="text",delete S.text;else{var A=-1===Number(w);_[u+d]=A?-1:1}delete S.type,"background"in S||(S.background=!0),null!=a.options.autoIndex&&(S._autoIndex=a.options.autoIndex);var E=S&&S.name;"string"==typeof E&&s.has(E)?Object.assign(s.get(E),_):(e.push([_,S]),s.set(E,_))}}}r.delete(a),u?
  1256. /*!
  1257. * Checks for indexes added to subdocs using Schema.index().
  1258. * These indexes need their paths prefixed properly.
  1259. *
  1260. * schema._indexes = [ [indexObj, options], [indexObj, options] ..]
  1261. */
  1262. function(t,r){for(var n=t._indexes,i=n.length,o=0;o<i;++o){for(var s=n[o][0],a=n[o][1],u=Object.keys(s),h=u.length,f={},c=0;c<h;++c){var l=u[c];f[r+l]=s[l]}var d=Object.assign({},a);if(null!=a&&null!=a.partialFilterExpression){d.partialFilterExpression={};for(var p=a.partialFilterExpression,y=0,m=Object.keys(p);y<m.length;y++){var b=m[y];d.partialFilterExpression[r+b]=p[b]}}e.push([f,d])}}(a,u):(a._indexes.forEach((function(t){"background"in t[1]||(t[1].background=!0)})),e=e.concat(a._indexes))}(t),e}},function(t,e,r){"use strict";
  1263. /*!
  1264. * ignore
  1265. */
  1266. /*!
  1267. * Returns this documents _id cast to a string.
  1268. */
  1269. function n(){return null!=this._id?String(this._id):null}t.exports=function(t){return!t.paths.id&&t.paths._id&&t.options.id?(t.virtual("id").get(n),t):t}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(311),o=r(313),s=r(6),a=r(156),u=r(55);t.exports=function(t,e){var r=t.childSchemas.find((function(t){return!!t.schema.options.timestamps}));if(e||r){var h,f=a(e,"createdAt"),c=a(e,"updatedAt"),l=null!=e&&e.hasOwnProperty("currentTime")?e.currentTime:null,d={};if(t.$timestamps={createdAt:f,updatedAt:c},c&&!t.paths[c]&&(d[c]=Date),f&&!t.paths[f])d[f]=(n(h={},t.options.typeKey||"type",Date),n(h,"immutable",!0),h);t.add(d),t.pre("save",(function(t){var e=s(this,"$__.saveOptions.timestamps");if(!1===e)return t();var r=null!=e&&!1===e.updatedAt,n=null!=e&&!1===e.createdAt,i=null!=l?l():this.ownerDocument().constructor.base.now();if(!n&&this.isNew&&f&&!this.$__getValue(f)&&this.$__isSelected(f)&&this.$set(f,i),!r&&c&&(this.isNew||this.$isModified())){var o=i;this.isNew&&null!=f&&(o=this.$__getValue(f)),this.$set(c,o)}t()})),t.methods.initializeTimestamps=function(){var t=null!=l?l():this.constructor.base.now();return f&&!this.get(f)&&this.$set(f,t),c&&!this.get(c)&&this.$set(c,t),this},y[u.builtInMiddleware]=!0;var p={query:!0,model:!1};t.pre("findOneAndReplace",p,y),t.pre("findOneAndUpdate",p,y),t.pre("replaceOne",p,y),t.pre("update",p,y),t.pre("updateOne",p,y),t.pre("updateMany",p,y)}function y(t){var e=null!=l?l():this.model.base.now();"findOneAndReplace"===this.op&&null==this.getUpdate()&&this.setUpdate({}),o(e,f,c,this.getUpdate(),this.options,this.schema),i(e,this.getUpdate(),this.model.schema),t()}}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(312),s=r(156);
  1270. /*!
  1271. * ignore
  1272. */
  1273. function a(t,e,r){if(null!=e){if(Object.keys(e).some((function(t){return t.startsWith("$")}))){if(e.$push&&y(e.$push),e.$addToSet&&y(e.$addToSet),null!=e.$set)for(var i=0,o=Object.keys(e.$set);i<o.length;i++){var a=o[i];u(r,a,e.$set,t)}if(null!=e.$setOnInsert)for(var h=0,f=Object.keys(e.$setOnInsert);h<f.length;h++){var c=f[h];u(r,c,e.$setOnInsert,t)}}var l,d=n(Object.keys(e).filter((function(t){return!t.startsWith("$")})));try{for(d.s();!(l=d.n()).done;){var p=l.value;u(r,p,e,t)}}catch(t){d.e(t)}finally{d.f()}}function y(e){for(var n=0,i=Object.keys(e);n<i.length;n++){var o=i[n],a=r.path(o.replace(/\.\$\./i,".").replace(/.\$$/,""));e[o]&&a&&a.$isMongooseDocumentArray&&a.schema.options.timestamps&&function(){var r=a.schema.options.timestamps,n=s(r,"createdAt"),i=s(r,"updatedAt");e[o].$each?e[o].$each.forEach((function(e){null!=i&&(e[i]=t),null!=n&&(e[n]=t)})):(null!=i&&(e[o][i]=t),null!=n&&(e[o][n]=t))}()}}}function u(t,e,r,i){var u=o(e),h=t.path(u);if(h){for(var f=[],c=u.split("."),l=c.length-1;l>0;--l){var d=t.path(c.slice(0,l).join("."));null!=d&&(d.$isMongooseDocumentArray||d.$isSingleNested)&&f.push({parentPath:e.split(".").slice(0,l).join("."),parentSchemaType:d})}if(Array.isArray(r[e])&&h.$isMongooseDocumentArray)!function(t,e,r){var n=e.schema.options.timestamps;if(n)for(var i=t.length,o=s(n,"createdAt"),u=s(n,"updatedAt"),h=0;h<i;++h)null!=u&&(t[h][u]=r),null!=o&&(t[h][o]=r),a(r,t[h],e.schema)}(r[e],h,i);else if(r[e]&&h.$isSingleNested)!function(t,e,r){var n=e.schema.options.timestamps;if(n){var i=s(n,"createdAt"),o=s(n,"updatedAt");null!=o&&(t[o]=r),null!=i&&(t[i]=r),a(r,t,e.schema)}}(r[e],h,i);else if(f.length>0){var p,y=n(f);try{for(y.s();!(p=y.n()).done;){var m=p.value,b=m.parentPath,v=m.parentSchemaType,g=v.schema.options.timestamps,w=s(g,"updatedAt");if(g&&null!=w)if(v.$isSingleNested)r[b+"."+w]=i;else if(v.$isMongooseDocumentArray){var _=e.substring(b.length+1);if(/^\d+$/.test(_)){r[b+"."+_][w]=i;continue}var M=_.indexOf(".");r[b+"."+(_=-1!==M?_.substring(0,M):_)+"."+w]=i}}}catch(t){y.e(t)}finally{y.f()}}else if(null!=h.schema&&h.schema!=t&&r[e]){var S=h.schema.options.timestamps,O=s(S,"createdAt"),A=s(S,"updatedAt");if(!S)return;null!=A&&(r[e][A]=i),null!=O&&(r[e][O]=i)}}}t.exports=a},function(t,e,r){"use strict";t.exports=function(t){return t.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}},function(t,e,r){"use strict";
  1274. /*!
  1275. * ignore
  1276. */var n=r(6);t.exports=
  1277. /*!
  1278. * ignore
  1279. */
  1280. function(t,e,r,i,o){var s=i,a=s,u=n(o,"overwrite",!1),h=n(o,"timestamps",!0);if(!h||null==s)return i;var f=null!=h&&!1===h.createdAt,c=null!=h&&!1===h.updatedAt;if(u)return i&&i.$set&&(i=i.$set,s.$set={},a=s.$set),c||!r||i[r]||(a[r]=t),f||!e||i[e]||(a[e]=t),s;if(i=i||{},Array.isArray(s))return s.push({$set:(l={},d=r,p=t,d in l?Object.defineProperty(l,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[d]=p,l)}),s;var l,d,p;if(s.$set=s.$set||{},!c&&r&&(!i.$currentDate||!i.$currentDate[r])){var y=!1;if(-1!==r.indexOf("."))for(var m=r.split("."),b=1;b<m.length;++b){var v=m.slice(-b).join("."),g=m.slice(0,-b).join(".");if(null!=i[g]){i[g][v]=t,y=!0;break}if(i.$set&&i.$set[g]){i.$set[g][v]=t,y=!0;break}}y||(s.$set[r]=t),s.hasOwnProperty(r)&&delete s[r]}if(!f&&e){i[e]&&delete i[e],i.$set&&i.$set[e]&&delete i.$set[e];var w=!1;if(-1!==e.indexOf("."))for(var _=e.split("."),M=1;M<_.length;++M){var S=_.slice(-M).join("."),O=_.slice(0,-M).join(".");if(null!=i[O]){i[O][S]=t,w=!0;break}if(i.$set&&i.$set[O]){i.$set[O][S]=t,w=!0;break}}w||(s.$setOnInsert=s.$setOnInsert||{},s.$setOnInsert[e]=t)}0===Object.keys(s.$set).length&&delete s.$set;return s}},function(t,e,r){"use strict";var n=r(19),i=r(9);t.exports=function(t,e){if("string"==typeof t)return;if("function"==typeof t)return;throw new n('Invalid ref at path "'+e+'". Got '+i.inspect(t,{depth:0}))}},function(t,e,r){"use strict";
  1281. /*!
  1282. * ignore
  1283. */t.exports=i;var n=r(316);
  1284. /*!
  1285. * ignore
  1286. */
  1287. /*!
  1288. * Apply query middleware
  1289. *
  1290. * @param {Query} query constructor
  1291. * @param {Model} model
  1292. */
  1293. function i(t,e){var r={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0},n=e.hooks.filter((function(t){var e=function(t){var e={};t.hasOwnProperty("query")&&(e.query=t.query);t.hasOwnProperty("document")&&(e.document=t.document);return e}(t);return"updateOne"===t.name?null==e.query||!!e.query:"deleteOne"===t.name?!!e.query||0===Object.keys(e).length:"validate"===t.name||"remove"===t.name?!!e.query:null==t.query&&null==t.document||!!t.query}));t.prototype._execUpdate=n.createWrapper("update",t.prototype._execUpdate,null,r),t.prototype.__distinct=n.createWrapper("distinct",t.prototype.__distinct,null,r),t.prototype.validate=n.createWrapper("validate",t.prototype.validate,null,r),i.middlewareFunctions.filter((function(t){return"update"!==t&&"distinct"!==t&&"validate"!==t})).forEach((function(e){t.prototype["_".concat(e)]=n.createWrapper(e,t.prototype["_".concat(e)],null,r)}))}i.middlewareFunctions=n.concat(["validate"])},function(t,e,r){"use strict";t.exports=Object.freeze(["count","countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","update","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete","findOneAndRemove","remove"])},function(t,e,r){"use strict";
  1294. /*!
  1295. * Module dependencies.
  1296. */function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(10),s=r(8),a=r(318),u=r(158),h=r(4),f=o.CastError;function c(t,e){this.enumValues=[],this.regExp=null,o.call(this,t,e,"String")}
  1297. /*!
  1298. * ignore
  1299. */
  1300. function l(t){return this.castForQuery(t)}c.schemaName="String",c.defaultOptions={},
  1301. /*!
  1302. * Inherits from SchemaType.
  1303. */
  1304. c.prototype=Object.create(o.prototype),c.prototype.constructor=c,Object.defineProperty(c.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:a}),
  1305. /*!
  1306. * ignore
  1307. */
  1308. c._cast=u,c.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},
  1309. /*!
  1310. * ignore
  1311. */
  1312. c._defaultCaster=function(t){if(null!=t&&"string"!=typeof t)throw new Error;return t},c.get=o.get,c.set=o.set,
  1313. /*!
  1314. * ignore
  1315. */
  1316. c._checkRequired=function(t){return(t instanceof String||"string"==typeof t)&&t.length},c.checkRequired=o.checkRequired,c.prototype.enum=function(){if(this.enumValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.enumValidator}),this),this.enumValidator=!1),void 0===arguments[0]||!1===arguments[0])return this;var t,e;h.isObject(arguments[0])?Array.isArray(arguments[0].values)?(t=arguments[0].values,e=arguments[0].message):(t=h.object.vals(arguments[0]),e=s.messages.String.enum):(t=arguments,e=s.messages.String.enum);var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;void 0!==o&&this.enumValues.push(this.cast(o))}}catch(t){i.e(t)}finally{i.f()}var a=this.enumValues;return this.enumValidator=function(t){return void 0===t||~a.indexOf(t)},this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:a}),this},c.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}))},c.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}))},c.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}))},c.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||s.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},c.prototype.minLength=c.prototype.minlength,c.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||s.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},c.prototype.maxLength=c.prototype.maxlength,c.prototype.match=function(t,e){var r=e||s.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},c.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():c.checkRequired())(t)},c.prototype.cast=function(t,e,r){if(o._isRef(this,t,e,r))return"string"==typeof t?t:this._castRef(t,e,r);var n;n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():c.cast();try{return n(t)}catch(e){throw new f("string",t,this.path,null,this)}};var d=h.options(o.prototype.$conditionalHandlers,{$all:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.castForQuery(t)})):[this.castForQuery(t)]},$gt:l,$gte:l,$lt:l,$lte:l,$options:String,$regex:l,$not:l});Object.defineProperty(c.prototype,"$conditionalHandlers",{configurable:!1,enumerable:!1,writable:!1,value:Object.freeze(d)}),c.prototype.castForQuery=function(t,e){var r;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with String.");return r.call(this,e)}return e=t,"[object RegExp]"===Object.prototype.toString.call(e)?e:this._castForQuery(e)},
  1317. /*!
  1318. * Module exports.
  1319. */
  1320. t.exports=c},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"enum",c),Object.defineProperty(f.prototype,"match",c),Object.defineProperty(f.prototype,"lowercase",c),Object.defineProperty(f.prototype,"trim",c),Object.defineProperty(f.prototype,"uppercase",c),Object.defineProperty(f.prototype,"minLength",c),Object.defineProperty(f.prototype,"minlength",c),Object.defineProperty(f.prototype,"maxLength",c),Object.defineProperty(f.prototype,"maxlength",c),Object.defineProperty(f.prototype,"populate",c),
  1321. /*!
  1322. * ignore
  1323. */
  1324. t.exports=f},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"min",c),Object.defineProperty(f.prototype,"max",c),Object.defineProperty(f.prototype,"enum",c),Object.defineProperty(f.prototype,"populate",c),
  1325. /*!
  1326. * ignore
  1327. */
  1328. t.exports=f},function(t,e,r){"use strict";
  1329. /*!
  1330. * Module dependencies.
  1331. */var n=r(20),i=r(10),o=r(84),s=r(4);function a(t,e){i.call(this,t,e,"Boolean")}a.schemaName="Boolean",a.defaultOptions={},
  1332. /*!
  1333. * Inherits from SchemaType.
  1334. */
  1335. a.prototype=Object.create(i.prototype),a.prototype.constructor=a,
  1336. /*!
  1337. * ignore
  1338. */
  1339. a._cast=o,a.set=i.set,a.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},
  1340. /*!
  1341. * ignore
  1342. */
  1343. a._defaultCaster=function(t){if(null!=t&&"boolean"!=typeof t)throw new Error;return t},
  1344. /*!
  1345. * ignore
  1346. */
  1347. a._checkRequired=function(t){return!0===t||!1===t},a.checkRequired=i.checkRequired,a.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},Object.defineProperty(a,"convertToTrue",{get:function(){return o.convertToTrue},set:function(t){o.convertToTrue=t}}),Object.defineProperty(a,"convertToFalse",{get:function(){return o.convertToFalse},set:function(t){o.convertToFalse=t}}),a.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():a.cast();try{return e(t)}catch(e){throw new n("Boolean",t,this.path,e,this)}},a.$conditionalHandlers=s.options(i.prototype.$conditionalHandlers,{}),a.prototype.castForQuery=function(t,e){var r;return 2===arguments.length?(r=a.$conditionalHandlers[t])?r.call(this,e):this._castForQuery(e):this._castForQuery(t)},a.prototype._castNullish=function(t){if(void 0===t)return t;var e="function"==typeof this.constructor.cast?this.constructor.cast():a.cast();return null==e?t:!(e.convertToFalse instanceof Set&&e.convertToFalse.has(t))&&(!!(e.convertToTrue instanceof Set&&e.convertToTrue.has(t))||t)},
  1348. /*!
  1349. * Module exports.
  1350. */
  1351. t.exports=a},function(t,e,r){"use strict";
  1352. /*!
  1353. * Module dependencies.
  1354. */var n,i,o=r(88),s=r(20),a=r(13).EventEmitter,u=r(328),h=r(10),f=r(172),c=r(6),l=r(173),d=r(9),p=r(4),y=r(174),m=r(1).arrayAtomicsSymbol,b=r(1).arrayPathSymbol,v=r(1).documentArrayParent;function g(t,e,r,n){null!=n&&null!=n._id?e=l(e,n):null!=r&&null!=r._id&&(e=l(e,r));var i=w(e,r);i.prototype.$basePath=t,o.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&&void 0===s||this.default((function(){var t=s.call(this);return null==t||Array.isArray(t)||(t=[t]),t}));var a=this;this.$embeddedSchemaType=new h(t+".$",{required:c(this,"schemaOptions.required",!1)}),this.$embeddedSchemaType.cast=function(t,e,r){return a.cast(t,e,r)[0]},this.$embeddedSchemaType.$isMongooseDocumentArrayElement=!0,this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}
  1355. /*!
  1356. * Ignore
  1357. */
  1358. function w(t,e,n){function o(){i.apply(this,arguments),this.$session(this.ownerDocument().$session())}i||(i=r(46)),t._preCompile();var s=null!=n?n.prototype:i.prototype;for(var u in o.prototype=Object.create(s),o.prototype.$__setSchema(t),o.schema=t,o.prototype.constructor=o,o.$isArraySubdocument=!0,o.events=new a,t.methods)o.prototype[u]=t.methods[u];for(var h in t.statics)o[h]=t.statics[h];for(var f in a.prototype)o[f]=a.prototype[f];return o.options=e,o}
  1359. /*!
  1360. * Scopes paths selected in a query to this array.
  1361. * Necessary for proper default application of subdocument values.
  1362. *
  1363. * @param {DocumentArrayPath} array - the array to scope `fields` paths
  1364. * @param {Object|undefined} fields - the root fields selected in the query
  1365. * @param {Boolean|undefined} init - if we are being created part of a query result
  1366. */
  1367. function _(t,e,r){if(r&&e){for(var n,i,o,s=t.path+".",a=Object.keys(e),u=a.length,h={};u--;)if((i=a[u]).startsWith(s)){if("$"===(o=i.substring(s.length)))continue;o.startsWith("$.")&&(o=o.substring(2)),n||(n=!0),h[o]=e[i]}return n&&h||void 0}}g.schemaName="DocumentArray",g.options={castNonArrays:!0},
  1368. /*!
  1369. * Inherits from ArrayType.
  1370. */
  1371. g.prototype=Object.create(o.prototype),g.prototype.constructor=g,g.prototype.OptionsConstructor=u,g.prototype.discriminator=function(t,e,r){"function"==typeof t&&(t=p.getFunctionName(t)),r=r||{};var n=p.isPOJO(r)?r.value:r,i=c(r,"clone",!0);e.instanceOfSchema&&i&&(e=e.clone());var o=w(e=f(this.casterConstructor,t,e,n),null,this.casterConstructor);o.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(o,"name",{value:t})}catch(t){}return this.casterConstructor.discriminators[t]=o,this.casterConstructor.discriminators[t]},g.prototype.doValidate=function(t,e,o,s){n||(n=r(27));var a=this;try{h.prototype.doValidate.call(this,t,(function(r){if(r)return e(r);var u,h=t&&t.length;if(!h)return e();if(s&&s.updateValidator)return e();p.isMongooseDocumentArray(t)||(t=new n(t,a.path,o));function f(t){null!=t&&(u=t),--h||e(u)}for(var c=0,l=h;c<l;++c){var d=t[c];if(null!=d){if(!(d instanceof i)){var m=y(a.casterConstructor,t[c]);d=t[c]=new m(d,t,void 0,void 0,c)}null==s||!s.validateModifiedOnly||d.$isModified()?d.$__validate(f):--h||e(u)}else--h||e(u)}}),o)}catch(t){return e(t)}},g.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,s=null;if(o){for(var a=0,u=o;a<u;++a){var f=t[a];if(f){if(!(f instanceof i)){var c=y(this.casterConstructor,t[a]);f=t[a]=new c(f,t,void 0,void 0,a)}if(null==r||!r.validateModifiedOnly||f.$isModified()){var l=f.validateSync();l&&null==s&&(s=l)}}}return s}},
  1372. /*!
  1373. * ignore
  1374. */
  1375. g.prototype.getDefault=function(t){var e="function"==typeof this.defaultValue?this.defaultValue.call(t):this.defaultValue;if(null==e)return e;n||(n=r(27)),Array.isArray(e)||(e=[e]),e=new n(e,this.path,t);for(var i=0;i<e.length;++i){var o=new(y(this.casterConstructor,e[i]))({},e,void 0,void 0,i);o.$init(e[i]),o.isNew=!0,Object.assign(o.$__.activePaths.default,o.$__.activePaths.init),o.$__.activePaths.init={},e[i]=o}return e},g.prototype.cast=function(t,e,o,a,u){if(n||(n=r(27)),null!=t&&null!=t[b]&&t===a)return t;var h,f,c={transform:!1,virtuals:!1};if(u=u||{},!Array.isArray(t)){if(!o&&!g.options.castNonArrays)throw new s("DocumentArray",d.inspect(t),this.path,null,this);return e&&o&&e.markModified(this.path),this.cast([t],e,o,a,u)}u.skipDocumentArrayCast&&!p.isMongooseDocumentArray(t)||(t=new n(t,this.path,e)),null!=a&&(t[m]=a[m]||{}),null!=u.arrayPathIndex&&(t[b]=this.path+"."+u.arrayPathIndex);for(var l=p.isMongooseDocumentArray(t)?t.__array:t,w=l.length,M={skipId:!0,willInit:!0},S=0;S<w;++S)if(l[S]){var O=y(this.casterConstructor,l[S]);if(!l[S].$__||l[S]instanceof O||(l[S]=l[S].toObject({transform:!1,virtuals:l[S].schema===O.schema})),l[S]instanceof i){if(l[S][v]!==e)if(o){var A=new O(null,t,M,h,S);l[S]=A.$init(l[S])}else{var E=new O(l[S],t,void 0,void 0,S);l[S]=E}null==l[S].__index&&l[S].$setIndex(S)}else if(null!=l[S])if(o)e?h||(h=_(this,e.$__.selected,o)):h=!0,f=new O(null,t,M,h,S),l[S]=f.$init(l[S]);else if(a&&"function"==typeof a.id&&(f=a.id(l[S]._id)),a&&f&&p.deepEqual(f.toObject(c),l[S]))f.set(l[S]),l[S]=f;else try{f=new O(l[S],t,void 0,void 0,S),l[S]=f}catch(e){var x=d.inspect(l[S]);throw new s("embedded",x,t[b],e,this)}}return t},
  1376. /*!
  1377. * ignore
  1378. */
  1379. g.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},
  1380. /*!
  1381. * ignore
  1382. */
  1383. g.prototype.applyGetters=function(t,e){return h.prototype.applyGetters.call(this,t,e)},g.defaultOptions={},g.set=h.set,
  1384. /*!
  1385. * Module exports.
  1386. */
  1387. t.exports=g},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"enum",c),Object.defineProperty(f.prototype,"of",c),
  1388. /*!
  1389. * ignore
  1390. */
  1391. t.exports=f},function(t,e,r){"use strict";t.exports=function t(e){if(!Array.isArray(e))return{min:0,max:0,containsNonArrayItem:!0};if(0===e.length)return{min:1,max:1,containsNonArrayItem:!1};if(1===e.length&&!Array.isArray(e[0]))return{min:1,max:1,containsNonArrayItem:!1};for(var r=t(e[0]),n=1;n<e.length;++n){var i=t(e[n]);i.min<r.min&&(r.min=i.min),i.max>r.max&&(r.max=i.max),r.containsNonArrayItem=r.containsNonArrayItem||i.containsNonArrayItem}return r.min=r.min+1,r.max=r.max+1,r}},function(t,e,r){"use strict";
  1392. /*!
  1393. * Module dependencies.
  1394. */function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new 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 s=r(20),a=r(44),u=r(87),h=r(325),f=r(326),c=r(6),l=r(22),d=r(162),p=r(164),y=r(9),m=r(33),b=r(52),v=["Polygon","MultiPolygon"];function g(t,e,r){if(Array.isArray(t))t.forEach((function(n,i){if(Array.isArray(n)||m(n))return g(n,e,r);t[i]=e.castForQueryWrapper({val:n,context:r})}));else for(var n=Object.keys(t),i=n.length;i--;){var o=n[i],s=t[o];Array.isArray(s)||m(s)?(g(s,e,r),t[o]=s):t[o]=e.castForQuery({val:s,context:r})}}t.exports=function t(e,r,i,w){if(Array.isArray(r))throw new 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=d(e,r[e.options.discriminatorKey])||e);var _,M,S,O,A,E,x=Object.keys(r),k=x.length;for(i=i||{};k--;)if(E=r[O=x[k]],"$or"===O||"$nor"===O||"$and"===O){if(!Array.isArray(E))throw new s("Array",E,O);for(var j=0;j<E.length;++j){if(null==E[j]||"object"!==o(E[j]))throw new s("Object",E[j],O+"."+j);E[j]=t(e,E[j],i,w)}}else{if("$where"===O){if("string"!==(A=o(E))&&"function"!==A)throw new Error("Must have a string or function for $where");"function"===A&&(r[O]=E.toString());continue}if("$expr"===O){E=h(E,e);continue}if("$elemMatch"===O)E=t(e,E,i,w);else if("$text"===O)E=f(E,O);else{if(!e)continue;if(!(M=e.path(O)))for(var $=O.split("."),P=$.length;P--;){var R=$.slice(0,P).join("."),B=$.slice(P).join("."),T=e.path(R),I=c(T,"schema.options.discriminatorKey");if(null!=T&&null!=c(T,"schema.discriminators")&&null!=I&&B!==I){var N=c(r,R+"."+I);null!=N&&(M=T.schema.discriminators[N].path(B))}}if(M){if(null==E)continue;if("Object"===l(E))if(Object.keys(E).some(p))for(var D=Object.keys(E),C=void 0,L=D.length;L--;)if(S=E[C=D[L]],"$not"===C){if(S&&M){if((_=Object.keys(S)).length&&p(_[0]))for(var q in S)S[q]=M.castForQueryWrapper({$conditional:q,val:S[q],context:w});else E[C]=M.castForQueryWrapper({$conditional:C,val:S,context:w});continue}}else E[C]=M.castForQueryWrapper({$conditional:C,val:S,context:w});else r[O]=M.castForQueryWrapper({val:E,context:w});else if(Array.isArray(E)&&-1===["Buffer","Array"].indexOf(M.instance)){var U,F=[],z=n(E);try{for(z.s();!(U=z.n()).done;){var V=U.value;F.push(M.castForQueryWrapper({val:V,context:w}))}}catch(t){z.e(t)}finally{z.f()}r[O]={$in:F}}else r[O]=M.castForQueryWrapper({val:E,context:w})}else{for(var K=O.split("."),H=K.length,Z=void 0,W=void 0,J=void 0;H--&&(Z=K.slice(0,H).join("."),!(M=e.path(Z))););if(M){if(M.caster&&M.caster.schema){(J={})[W=K.slice(H).join(".")]=E;var Y=t(M.caster.schema,J,i,w)[W];void 0===Y?delete r[O]:r[O]=Y}else r[O]=E;continue}if(m(E)){var Q="";if(E.$near?Q="$near":E.$nearSphere?Q="$nearSphere":E.$within?Q="$within":E.$geoIntersects?Q="$geoIntersects":E.$geoWithin&&(Q="$geoWithin"),Q){var G=new u.Number("__QueryCasting__"),X=E[Q];if(null!=E.$maxDistance&&(E.$maxDistance=G.castForQueryWrapper({val:E.$maxDistance,context:w})),null!=E.$minDistance&&(E.$minDistance=G.castForQueryWrapper({val:E.$minDistance,context:w})),"$within"===Q){var tt=X.$center||X.$centerSphere||X.$box||X.$polygon;if(!tt)throw new Error("Bad $within parameter: "+JSON.stringify(E));X=tt}else if("$near"===Q&&"string"==typeof X.type&&Array.isArray(X.coordinates))X=X.coordinates;else if(("$near"===Q||"$nearSphere"===Q||"$geoIntersects"===Q)&&X.$geometry&&"string"==typeof X.$geometry.type&&Array.isArray(X.$geometry.coordinates))null!=X.$maxDistance&&(X.$maxDistance=G.castForQueryWrapper({val:X.$maxDistance,context:w})),null!=X.$minDistance&&(X.$minDistance=G.castForQueryWrapper({val:X.$minDistance,context:w})),b(X.$geometry)&&(X.$geometry=X.$geometry.toObject({transform:!1,virtuals:!1})),X=X.$geometry.coordinates;else if("$geoWithin"===Q)if(X.$geometry){b(X.$geometry)&&(X.$geometry=X.$geometry.toObject({virtuals:!1}));var et=X.$geometry.type;if(-1===v.indexOf(et))throw new Error('Invalid geoJSON type for $geoWithin "'+et+'", must be "Polygon" or "MultiPolygon"');X=X.$geometry.coordinates}else X=X.$box||X.$polygon||X.$center||X.$centerSphere,b(X)&&(X=X.toObject({virtuals:!1}));g(X,G,w);continue}}if(e.nested[O])continue;var rt="strict"in i?i.strict:e.options.strict,nt="strictQuery"in i?i.strictQuery:"strict"in i?i.strict:"strict"in e._userProvidedOptions?e._userProvidedOptions.strict:e.options.strictQuery;if(i.upsert&&rt){if("throw"===rt)throw new a(O);throw new a(O,'Path "'+O+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if("throw"===nt)throw new a(O,'Path "'+O+"\" is not in schema and strictQuery is 'throw'.");nt&&delete r[O]}}}return r}},function(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 i=r(20),o=r(44),s=r(160),a=new Set(["$and","$or","$not"]),u=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),h=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),f=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$round","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),c=new Set(["$arrayElemAt","$first","$last"]),l=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]);function d(t,e,r){if(b(t))return t;null!=t.$cond?Array.isArray(t.$cond)?t.$cond=t.$cond.map((function(t){return d(t,e,r)})):(t.$cond.if=d(t.$cond.if,e,r),t.$cond.then=d(t.$cond.then,e,r),t.$cond.else=d(t.$cond.else,e,r)):null!=t.$ifNull?t.$ifNull.map((function(t){return d(t,e,r)})):null!=t.$switch&&(t.branches.map((function(t){return d(t,e,r)})),t.default=d(t.default,e,r));for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];a.has(s)?t[s]=t[s].map((function(t){return d(t,e,r)})):u.has(s)?t[s]=m(t[s],e,r):h.has(s)?t[s]=y(t[s]):f.has(s)&&(t[s]=p(t[s]))}return t.$in&&(t.$in=function(t,e,r){var n=t[0],i=t[1];if(!b(i))return t;i=i.slice(1);var s=e.path(i);if(null==s){if(!1===r)return t;if("throw"===r)throw new o("$in");return}if(!s.$isMongooseArray)throw new Error("Path must be an array for $in");n=s.$isMongooseDocumentArray?s.$embeddedSchemaType.cast(n):s.caster.cast(n);return[n,t[1]]}(t.$in,e,r)),t.$size&&(t.$size=p(t.$size)),function(t){for(var e=Object.keys(t),r=0,n=e;r<n.length;r++){var i=n[r];void 0===t[i]&&delete t[i]}}(t),t}function p(t){if(!v(t))return t;try{return s(t)}catch(e){throw new i("Number",t)}}function y(t){if(!Array.isArray(t)){if(!v(t))return t;try{return s(t)}catch(e){throw new i("Number",t)}}return t.map((function(t){if(!v(t))return t;try{return s(t)}catch(e){throw new i("Number",t)}}))}function m(t,e,r){if(!Array.isArray(t)||2!==t.length)throw new Error("Comparison operator must be an array of length 2");t[0]=d(t[0],e,r);var a=t[0];if(v(t[1])){var u=null,h=null,f=null;if(b(a))u=a.slice(1),h=e.path(u);else if("object"===n(a)&&null!=a)for(var p=0,y=Object.keys(a);p<y.length;p++){var m=y[p];l.has(m)&&b(a[m])?(u=a[m].slice(1)+"."+m,f=s):c.has(m)&&b(a[m])&&(u=a[m].slice(1)+"."+m,null!=(h=e.path(a[m].slice(1)))&&(h.$isMongooseDocumentArray?h=h.$embeddedSchemaType:h.$isMongooseArray&&(h=h.caster)))}var g="object"===n(t[1])&&null!=t[1]&&null!=t[1].$literal;if(null!=h)t[1]=g?{$literal:h.cast(t[1].$literal)}:h.cast(t[1]);else if(null!=f)if(g)try{t[1]={$literal:f(t[1].$literal)}}catch(e){throw new i(f.name.replace(/^cast/,""),t[1],u+".$literal")}else try{t[1]=f(t[1])}catch(e){throw new i(f.name.replace(/^cast/,""),t[1],u)}else{if(null!=u&&!0===r)return;if(null!=u&&"throw"===r)throw new o(u)}}else t[1]=d(t[1]);return t}function b(t){return"string"==typeof t&&t.startsWith("$")}function v(t){return("string"!=typeof t||!t.startsWith("$"))&&("object"!==n(t)||null==t||!Object.keys(t).find((function(t){return t.startsWith("$")}))||null!=t.$literal)}t.exports=function(t,e,r){if("object"!==n(t)||null==t)throw new Error("`$expr` must be an object");return d(t,e,r)}},function(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 i=r(20),o=r(84),s=r(158);
  1395. /*!
  1396. * Casts val to an object suitable for `$text`. Throws an error if the object
  1397. * can't be casted.
  1398. *
  1399. * @param {Any} val value to cast
  1400. * @param {String} [path] path to associate with any errors that occured
  1401. * @return {Object} casted object
  1402. * @see https://docs.mongodb.com/manual/reference/operator/query/text/
  1403. * @api private
  1404. */
  1405. t.exports=function(t,e){if(null==t||"object"!==n(t))throw new i("$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=o(t.$caseSensitive,e+".$castSensitive")),null!=t.$diacriticSensitive&&(t.$diacriticSensitive=o(t.$diacriticSensitive,e+".$diacriticSensitive")),t}},function(t,e,r){"use strict";(function(e){function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(89),s=r(14),a=r(18),u=r(169),h=r(57),f=r(34).internalToObjectOptions,c=r(4),l=r(1).arrayParentSymbol,d=r(1).arrayPathSymbol,p=r(1).arraySchemaSymbol,y=r(1).documentArrayParent,m={
  1406. /*!
  1407. * ignore
  1408. */
  1409. toBSON:function(){return this.toObject(f)},_cast:function(t,r){if(null==this[p])return t;var n=this[p].casterConstructor;if((n.$isMongooseDocumentArray?c.isMongooseDocumentArray(t):t instanceof n)||t&&t.constructor&&t.constructor.baseCasterConstructor===n)return t[y]&&t.__parentArray||(t[y]=this[l],t.__parentArray=this),t.$setIndex(r),t;if(null==t)return null;if((e.isBuffer(t)||t instanceof a||!c.isObject(t))&&(t={_id:t}),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 i=h(n.discriminators,t[n.schema.options.discriminatorKey]);i&&(n=i)}if(n.$isMongooseDocumentArray)return n.cast(t,this,void 0,void 0,r);var o=new n(t,this,void 0,void 0,r);return o.isNew=!0,o},id:function(t){var e,r,i;try{e=u(t).toString()}catch(t){e=null}var o,h=n(this);try{for(h.s();!(o=h.n()).done;){var f=o.value;if(f&&null!=(i=f.get("_id")))if(i instanceof s){if(r||(r=String(t)),r==i._id)return f}else if(t instanceof a||i instanceof a){if(e==i)return f}else if(t==i||c.deepEqual(t,i))return f}}catch(t){h.e(t)}finally{h.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=o.push.apply(this,arguments);return b(this),t},pull:function(){var t=o.pull.apply(this,arguments);return b(this),t},
  1410. /*!
  1411. * Wraps [`Array#shift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking.
  1412. */
  1413. shift:function(){var t=o.shift.apply(this,arguments);return b(this),t},
  1414. /*!
  1415. * Wraps [`Array#splice`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice) with proper change tracking and casting.
  1416. */
  1417. splice:function(){var t=o.splice.apply(this,arguments);return b(this),t},inspect:function(){return this.toObject()},create:function(t){var e=this[p].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=h(e.discriminators,t[e.schema.options.discriminatorKey]);r&&(e=r)}return new e(t,this)},
  1418. /*!
  1419. * ignore
  1420. */
  1421. notify:function(t){var e=this;return function r(n,i){for(var o=(i=i||e).length;o--;)if(null!=i[o]){switch(t){case"save":n=e[o]}c.isMongooseArray(i[o])?r(n,i[o]):i[o]&&i[o].emit(t,n)}}},set:function(t,e,r){var n=this.__array;if(r)return n[t]=e,this;var i=m._cast.call(this,e,t);return n[t]=i,m._markModified.call(this,t),this},_markModified:function(t,e){var r,n=this[l];if(n){if(r=this[d],arguments.length)if(null!=e){var i=t.__index;r=r+"."+i+"."+e}else r=r+"."+t;if(null!=r&&r.endsWith(".$"))return this;n.markModified(r,0!==arguments.length?t:n)}return this}};
  1422. /*!
  1423. * If this is a document array, each element may contain single
  1424. * populated paths, so we need to modify the top-level document's
  1425. * populated cache. See gh-8247, gh-8265.
  1426. */
  1427. function b(t){var e=t[l];if(e&&null!=e.$__.populated){var r,i=n(Object.keys(e.$__.populated).filter((function(e){return e.startsWith(t[d]+".")})));try{var o=function(){var n=r.value,i=n.slice((t[d]+".").length);if(!Array.isArray(e.$__.populated[n].value))return"continue";e.$__.populated[n].value=t.map((function(t){return t.$populated(i)}))};for(i.s();!(r=i.n()).done;)o()}catch(t){i.e(t)}finally{i.f()}}}t.exports=m}).call(this,r(3).Buffer)},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"excludeIndexes",c),Object.defineProperty(f.prototype,"_id",c),
  1428. /*!
  1429. * ignore
  1430. */
  1431. t.exports=f},function(t,e,r){"use strict";
  1432. /*!
  1433. * Module dependencies.
  1434. */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 i,o=r(20),s=r(13).EventEmitter,a=r(154),u=r(330),h=r(10),f=r(83),c=r(56).castToNumber,l=r(172),d=r(165),p=r(6),y=r(174),m=r(173),b=r(34).internalToObjectOptions,v=r(4);function g(t,e,r){t=m(t,r),this.caster=w(t),this.caster.path=e,this.caster.prototype.$basePath=e,this.schema=t,this.$isSingleNested=!0,h.call(this,e,r,"Embedded")}
  1435. /*!
  1436. * ignore
  1437. */
  1438. /*!
  1439. * ignore
  1440. */
  1441. function w(t,e){i||(i=r(90));var n=function(t,e,r){var n=this;this.$__parent=r,i.apply(this,arguments),this.$session(this.ownerDocument().$session()),r&&(r.$on("save",(function(){n.emit("save",n),n.constructor.emit("save",n)})),r.$on("isNew",(function(t){n.isNew=t,n.emit("isNew",t),n.constructor.emit("isNew",t)})))};t._preCompile();var o=null!=e?e.prototype:i.prototype;for(var a in(n.prototype=Object.create(o)).$__setSchema(t),n.prototype.constructor=n,n.schema=t,n.$isSingleNested=!0,n.events=new s,n.prototype.toBSON=function(){return this.toObject(b)},t.methods)n.prototype[a]=t.methods[a];for(var u in t.statics)n[u]=t.statics[u];for(var h in s.prototype)n[h]=s.prototype[h];return n}
  1442. /*!
  1443. * Special case for when users use a common location schema to represent
  1444. * locations for use with $geoWithin.
  1445. * https://docs.mongodb.org/manual/reference/operator/query/geoWithin/
  1446. *
  1447. * @param {Object} val
  1448. * @api private
  1449. */t.exports=g,g.prototype=Object.create(h.prototype),g.prototype.constructor=g,g.prototype.OptionsConstructor=u,g.prototype.$conditionalHandlers.$geoWithin=function(t){return{$geometry:this.castForQuery(t.$geometry)}},
  1450. /*!
  1451. * ignore
  1452. */
  1453. g.prototype.$conditionalHandlers.$near=g.prototype.$conditionalHandlers.$nearSphere=d.cast$near,g.prototype.$conditionalHandlers.$within=g.prototype.$conditionalHandlers.$geoWithin=d.cast$within,g.prototype.$conditionalHandlers.$geoIntersects=d.cast$geoIntersects,g.prototype.$conditionalHandlers.$minDistance=c,g.prototype.$conditionalHandlers.$maxDistance=c,g.prototype.$conditionalHandlers.$exists=f,g.prototype.cast=function(t,e,r,i,o){if(t&&t.$isSingleNested&&t.parent===e)return t;if(null!=t&&("object"!==n(t)||Array.isArray(t)))throw new a(this.path,t);var s,u=y(this.caster,t),h=p(e,"$__.selected",{}),f=this.path,c=Object.keys(h).reduce((function(t,e){return e.startsWith(f+".")&&(t[e.substring(f.length+1)]=h[e]),t}),{});return o=Object.assign({},o,{priorDoc:i}),r?((s=new u(void 0,c,e)).$init(t),s):0===Object.keys(t).length?new u({},c,e,void 0,o):new u(t,c,e,void 0,o)},g.prototype.castForQuery=function(t,e,r){var n;if(2===arguments.length){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t);return n.call(this,e)}if(null==(e=t))return e;this.options.runSetters&&(e=this._applySetters(e));var i=y(this.caster,e),s=null!=r&&null!=r.strict?r.strict:void 0;try{e=new i(e,s)}catch(t){if(!(t instanceof o))throw new o("Embedded",e,this.path,t,this);throw t}return e},g.prototype.doValidate=function(t,e,r,n){var i=y(this.caster,t);if(!t||t instanceof i||(t=new i(t,null,r)),n&&n.skipSchemaValidators)return t.validate(e);h.prototype.doValidate.call(this,t,(function(r){return r?e(r):t?void t.validate(e):e(null)}),r,n)},g.prototype.doValidateSync=function(t,e,r){if(!r||!r.skipSchemaValidators){var n=h.prototype.doValidateSync.call(this,t,e);if(n)return n}if(t)return t.validateSync()},g.prototype.discriminator=function(t,e,r){r=r||{};var n=v.isPOJO(r)?r.value:r,i=p(r,"clone",!0);return e.instanceOfSchema&&i&&(e=e.clone()),e=l(this.caster,t,e,n),this.caster.discriminators[t]=w(e,this.caster),this.caster.discriminators[t]},g.defaultOptions={},g.set=h.set,
  1454. /*!
  1455. * ignore
  1456. */
  1457. g.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.constructor(this.schema,this.path,t);return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),e.caster.discriminators=Object.assign({},this.caster.discriminators),e}},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"_id",c),t.exports=f},function(t,e,r){"use strict";(function(e){
  1458. /*!
  1459. * Module dependencies.
  1460. */
  1461. 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 i=r(168),o=r(332),s=r(10),a=r(161),u=r(4),h=i.Binary,f=s.CastError;function c(t,e){s.call(this,t,e,"Buffer")}
  1462. /*!
  1463. * ignore
  1464. */
  1465. function l(t){return this.castForQuery(t)}c.schemaName="Buffer",c.defaultOptions={},
  1466. /*!
  1467. * Inherits from SchemaType.
  1468. */
  1469. c.prototype=Object.create(s.prototype),c.prototype.constructor=c,c.prototype.OptionsConstructor=o,
  1470. /*!
  1471. * ignore
  1472. */
  1473. c._checkRequired=function(t){return!(!t||!t.length)},c.set=s.set,c.checkRequired=s.checkRequired,c.prototype.checkRequired=function(t,e){return s._isRef(this,t,e,!0)?!!t:this.constructor._checkRequired(t)},c.prototype.cast=function(t,r,o){var a;if(s._isRef(this,t,r,o)){if(t&&t.isMongooseBuffer)return t;if(e.isBuffer(t))return t&&t.isMongooseBuffer||(t=new i(t,[this.path,r]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof h){if(a=new i(t.value(!0),[this.path,r]),"number"!=typeof t.sub_type)throw new f("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(null==t||u.isNonBuiltinObject(t))return this._castRef(t,r,o)}if(t&&t._id&&(t=t._id),t&&t.isMongooseBuffer)return t;if(e.isBuffer(t))return t&&t.isMongooseBuffer||(t=new i(t,[this.path,r]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof h){if(a=new i(t.value(!0),[this.path,r]),"number"!=typeof t.sub_type)throw new f("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(null===t)return t;var c=n(t);if("string"===c||"number"===c||Array.isArray(t)||"object"===c&&"Buffer"===t.type&&Array.isArray(t.data))return"number"===c&&(t=[t]),a=new i(t,[this.path,r]),null!=this.options.subtype&&(a._subtype=this.options.subtype),a;throw new f("Buffer",t,this.path,null,this)},c.prototype.subtype=function(t){return this.options.subtype=t,this},c.prototype.$conditionalHandlers=u.options(s.prototype.$conditionalHandlers,{$bitsAllClear:a,$bitsAnyClear:a,$bitsAllSet:a,$bitsAnySet:a,$gt:l,$gte:l,$lt:l,$lte:l}),c.prototype.castForQuery=function(t,e){var r;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with Buffer.");return r.call(this,e)}e=t;var n=this._castForQuery(e);return n?n.toObject({transform:!1,virtuals:!1}):n},
  1474. /*!
  1475. * Module exports.
  1476. */
  1477. t.exports=c}).call(this,r(3).Buffer)},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"subtype",c),
  1478. /*!
  1479. * ignore
  1480. */
  1481. t.exports=f},function(t,e,r){"use strict";
  1482. /*!
  1483. * Module requirements.
  1484. */var n=r(8),i=r(334),o=r(10),s=r(335),a=r(22),u=r(4),h=o.CastError;function f(t,e){o.call(this,t,e,"Date")}
  1485. /*!
  1486. * Date Query casting.
  1487. *
  1488. * @api private
  1489. */
  1490. function c(t){return this.cast(t)}f.schemaName="Date",f.defaultOptions={},
  1491. /*!
  1492. * Inherits from SchemaType.
  1493. */
  1494. f.prototype=Object.create(o.prototype),f.prototype.constructor=f,f.prototype.OptionsConstructor=i,
  1495. /*!
  1496. * ignore
  1497. */
  1498. f._cast=s,f.set=o.set,f.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},
  1499. /*!
  1500. * ignore
  1501. */
  1502. f._defaultCaster=function(t){if(null!=t&&!(t instanceof Date))throw new Error;return t},f.prototype.expires=function(t){return"Object"!==a(this._index)&&(this._index={}),this._index.expires=t,u.expires(this._index),this},
  1503. /*!
  1504. * ignore
  1505. */
  1506. f._checkRequired=function(t){return t instanceof Date},f.checkRequired=o.checkRequired,f.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():f.checkRequired())(t)},f.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||n.messages.Date.min;"string"==typeof r&&(r=r.replace(/{MIN}/,t===Date.now?"Date.now()":t.toString()));var i=this;this.validators.push({validator:this.minValidator=function(e){var r=t;"function"==typeof t&&t!==Date.now&&(r=r.call(this));var n=r===Date.now?r():i.cast(r);return null===e||e.valueOf()>=n.valueOf()},message:r,type:"min",min:t})}return this},f.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||n.messages.Date.max;"string"==typeof r&&(r=r.replace(/{MAX}/,t===Date.now?"Date.now()":t.toString()));var i=this;this.validators.push({validator:this.maxValidator=function(e){var r=t;"function"==typeof r&&r!==Date.now&&(r=r.call(this));var n=r===Date.now?r():i.cast(r);return null===e||e.valueOf()<=n.valueOf()},message:r,type:"max",max:t})}return this},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 h("date",t,this.path,e,this)}},f.prototype.$conditionalHandlers=u.options(o.prototype.$conditionalHandlers,{$gt:c,$gte:c,$lt:c,$lte:c}),f.prototype.castForQuery=function(t,e){if(2!==arguments.length)return this._castForQuery(t);var r=this.$conditionalHandlers[t];if(!r)throw new Error("Can't use "+t+" with Date.");return r.call(this,e)},
  1507. /*!
  1508. * Module exports.
  1509. */
  1510. t.exports=f},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"min",c),Object.defineProperty(f.prototype,"max",c),Object.defineProperty(f.prototype,"expires",c),
  1511. /*!
  1512. * ignore
  1513. */
  1514. t.exports=f},function(t,e,r){"use strict";var n=r(43);t.exports=function(t){return null==t||""===t?null:t instanceof Date?(n.ok(!isNaN(t.valueOf())),t):(n.ok("boolean"!=typeof t),e=t instanceof Number||"number"==typeof t?new Date(t):"string"==typeof t&&!isNaN(Number(t))&&(Number(t)>=275761||Number(t)<-271820)?new Date(Number(t)):"function"==typeof t.valueOf?new Date(t.valueOf()):new Date(t),isNaN(e.valueOf())?void n.ok(!1):e);var e}},function(t,e,r){"use strict";
  1515. /*!
  1516. * Module dependencies.
  1517. */var n,i=r(337),o=r(10),s=r(169),a=r(22),u=r(18),h=r(4),f=o.CastError;function c(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||h.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."),o.call(this,t,e,"ObjectID")}
  1518. /*!
  1519. * ignore
  1520. */
  1521. function l(t){return this.cast(t)}
  1522. /*!
  1523. * ignore
  1524. */
  1525. function d(){return new u}function p(t){if(n||(n=r(14)),this instanceof n){if(void 0===t){var e=new u;return this.$__._id=e,e}this.$__._id=t}return t}
  1526. /*!
  1527. * Module exports.
  1528. */c.schemaName="ObjectId",c.defaultOptions={},
  1529. /*!
  1530. * Inherits from SchemaType.
  1531. */
  1532. c.prototype=Object.create(o.prototype),c.prototype.constructor=c,c.prototype.OptionsConstructor=i,c.get=o.get,c.set=o.set,c.prototype.auto=function(t){return t&&(this.default(d),this.set(p)),this},
  1533. /*!
  1534. * ignore
  1535. */
  1536. c._checkRequired=function(t){return t instanceof u},
  1537. /*!
  1538. * ignore
  1539. */
  1540. c._cast=s,c.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},
  1541. /*!
  1542. * ignore
  1543. */
  1544. c._defaultCaster=function(t){if(!(t instanceof u))throw new Error(t+" is not an instance of ObjectId");return t},c.checkRequired=o.checkRequired,c.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():c.checkRequired())(t)},c.prototype.cast=function(t,e,r){if(o._isRef(this,t,e,r)){if(t instanceof u)return t;if("objectid"===(a(t)||"").toLowerCase())return new u(t.toHexString());if(null==t||h.isNonBuiltinObject(t))return this._castRef(t,e,r)}var n;n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():c.cast();try{return n(t)}catch(e){throw new f("ObjectId",t,this.path,e,this)}},c.prototype.$conditionalHandlers=h.options(o.prototype.$conditionalHandlers,{$gt:l,$gte:l,$lt:l,$lte:l}),d.$runBeforeSetters=!0,t.exports=c},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"auto",c),Object.defineProperty(f.prototype,"populate",c),
  1545. /*!
  1546. * ignore
  1547. */
  1548. t.exports=f},function(t,e,r){"use strict";
  1549. /*!
  1550. * Module dependencies.
  1551. */var n=r(10),i=n.CastError,o=r(32),s=r(339),a=r(4);function u(t,e){n.call(this,t,e,"Decimal128")}
  1552. /*!
  1553. * ignore
  1554. */
  1555. function h(t){return this.cast(t)}u.schemaName="Decimal128",u.defaultOptions={},
  1556. /*!
  1557. * Inherits from SchemaType.
  1558. */
  1559. u.prototype=Object.create(n.prototype),u.prototype.constructor=u,
  1560. /*!
  1561. * ignore
  1562. */
  1563. u._cast=s,u.set=n.set,u.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},
  1564. /*!
  1565. * ignore
  1566. */
  1567. u._defaultCaster=function(t){if(null!=t&&!(t instanceof o))throw new Error;return t},
  1568. /*!
  1569. * ignore
  1570. */
  1571. u._checkRequired=function(t){return t instanceof o},u.checkRequired=n.checkRequired,u.prototype.checkRequired=function(t,e){return n._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():u.checkRequired())(t)},u.prototype.cast=function(t,e,r){if(n._isRef(this,t,e,r))return t instanceof o?t:this._castRef(t,e,r);var s;s="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():u.cast();try{return s(t)}catch(e){throw new i("Decimal128",t,this.path,e,this)}},u.prototype.$conditionalHandlers=a.options(n.prototype.$conditionalHandlers,{$gt:h,$gte:h,$lt:h,$lte:h}),
  1572. /*!
  1573. * Module exports.
  1574. */
  1575. t.exports=u},function(t,e,r){"use strict";(function(e){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 i=r(32),o=r(43);t.exports=function(t){return null==t?t:"object"===n(t)&&"string"==typeof t.$numberDecimal?i.fromString(t.$numberDecimal):t instanceof i?t:"string"==typeof t?i.fromString(t):e.isBuffer(t)?new i(t):"number"==typeof t?i.fromString(String(t)):"function"==typeof t.valueOf&&"string"==typeof t.valueOf()?i.fromString(t.valueOf()):void o.ok(!1)}}).call(this,r(3).Buffer)},function(t,e,r){"use strict";(function(e){
  1576. /*!
  1577. * ignore
  1578. */
  1579. 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 i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=u(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function u(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l(t);if(e){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function c(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=r(170),p=r(341),y=r(10),m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(c,t);var r,n,o,u=f(c);function c(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(r=u.call(this,t,e,"Map")).$isSchemaMap=!0,r}return r=c,(n=[{key:"set",value:function(t,e){return y.set(t,e)}},{key:"cast",value:function(t,r,n){if(t instanceof d)return t;var o=this.path;if(n){var s=new d({},o,r,this.$__schemaType);if(t instanceof e.Map){var a,u=i(t.keys());try{for(u.s();!(a=u.n()).done;){var h=a.value,f=t.get(h);f=null==f?s.$__schemaType._castNullish(f):s.$__schemaType.cast(f,r,!0,null,{path:o+"."+h}),s.$init(h,f)}}catch(t){u.e(t)}finally{u.f()}}else for(var c=0,l=Object.keys(t);c<l.length;c++){var p=l[c],y=t[p];y=null==y?s.$__schemaType._castNullish(y):s.$__schemaType.cast(y,r,!0,null,{path:o+"."+p}),s.$init(p,y)}return s}return new d(t,o,r,this.$__schemaType)}},{key:"clone",value:function(){var t=a(l(c.prototype),"clone",this).call(this);return null!=this.$__schemaType&&(t.$__schemaType=this.$__schemaType.clone()),t}}])&&s(r.prototype,n),o&&s(r,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(y);m.prototype.OptionsConstructor=p,m.defaultOptions={},t.exports=m}).call(this,r(7))},function(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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"of",c),t.exports=f},function(t,e,r){"use strict";(function(t){
  1580. /*!
  1581. * Module dependencies.
  1582. */
  1583. 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 i=r(25).get().Binary,o=r(32),s=r(18),a=r(52);
  1584. /*!
  1585. * ignore
  1586. */
  1587. function u(e){return e&&"object"===n(e)&&!(e instanceof Date)&&!(e instanceof s)&&(!Array.isArray(e)||0!==e.length)&&!(e instanceof t)&&!(e instanceof o)&&!(e instanceof i)}e.flatten=
  1588. /*!
  1589. * ignore
  1590. */
  1591. function e(r,n,i,o){var s;s=r&&a(r)&&!t.isBuffer(r)?Object.keys(r.toObject({transform:!1,virtuals:!1})||{}):Object.keys(r||{});var h=s.length,f={};n=n?n+".":"";for(var c=0;c<h;++c){var l=s[c],d=r[l];f[n+l]=d;var p=o&&o.path&&o.path(n+l),y=o&&o.nested&&o.nested[n+l];if(!p||"Mixed"!==p.instance){if(u(d)){if(i&&i.skipArrays&&Array.isArray(d))continue;var m=e(d,n+l,i,o);for(var b in m)f[b]=m[b];Array.isArray(d)&&(f[n+l]=d)}if(y)for(var v=Object.keys(o.paths),g=0,w=v;g<w.length;g++){var _=w[g];_.startsWith(n+l+".")&&!f.hasOwnProperty(_)&&(f[_]=void 0)}}}return f}
  1592. /*!
  1593. * ignore
  1594. */,e.modifiedPaths=function e(r,n,i){var o=Object.keys(r||{}),s=o.length;i=i||{},n=n?n+".":"";for(var h=0;h<s;++h){var f=o[h],c=r[f],l=n+f;if(i[l]=!0,-1!==l.indexOf("."))for(var d=l.split("."),p=d[0],y=1;y<d.length;++y)i[p]=!0,p+="."+d[y];!t.isBuffer(c)&&a(c)&&(c=c.toObject({transform:!1,virtuals:!1})),u(c)&&e(c,n+f,i)}return i}}).call(this,r(3).Buffer)},function(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 i=r(19),o=r(344),s=r(9);t.exports=function t(e){if(null!=e&&"object"===n(e)&&!Array.isArray(e)&&!e.$__)for(var r=0,a=Object.keys(e);r<a.length;r++){var u=a[r],h=e[u];if(-1===u.indexOf("."))t(e[u]);else try{delete e[u],o(e,u,h)}catch(t){if(!(t instanceof TypeError))throw t;throw new i('Conflicting dotted paths when setting document path, key: "'.concat(u,'", value: ').concat(s.inspect(h)))}}}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t,e,r){if(-1!==e.indexOf(".")){var i,o=e.split("."),s=o.pop(),a=t,u=n(o);try{for(u.s();!(i=u.n()).done;){var h=i.value;null==a[h]&&(a[h]={}),a=a[h]}}catch(t){u.e(t)}finally{u.f()}a[s]=r}else t[e]=r}},function(t,e,r){"use strict";var n=r(6),i=r(162);
  1595. /*!
  1596. * Like `schema.path()`, except with a document, because impossible to
  1597. * determine path type without knowing the embedded discriminator key.
  1598. */
  1599. t.exports=function t(e,r,o){for(var s=(o=o||{}).typeOnly,a=-1===r.indexOf(".")?[r]:r.split("."),u=null,h="adhocOrUndefined",f=i(e.schema,e.get(e.schema.options.discriminatorKey))||e.schema,c=0;c<a.length;++c){var l=a.slice(0,c+1).join(".");if(null!=(u=f.path(l))){if("Mixed"===u.instance)return s?"real":u;if(h=f.pathType(l),(u.$isSingleNested||u.$isMongooseDocumentArrayElement)&&null!=u.schema.discriminators){var d=u.schema.discriminators,p=e.get(l+"."+n(u,"schema.options.discriminatorKey"));if(null==p||null==d[p])continue;var y=a.slice(c+1).join(".");return t(e.get(l),y,o)}}else h="adhocOrUndefined"}return s?h:u}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(6);t.exports=function(t,e,r){var i,s=null!=r?Object.keys(o(t.tree,r,{})):Object.keys(t.tree),a=new Set(Object.keys(e));if(a.size>1){i=new Set;var u,h=n(s);try{for(h.s();!(u=h.n()).done;){var f=u.value;a.has(f)&&i.add(f)}}catch(t){h.e(t)}finally{h.f()}var c,l=n(a);try{for(l.s();!(c=l.n()).done;){var d=c.value;i.has(d)||i.add(d)}}catch(t){l.e(t)}finally{l.f()}i=Array.from(i)}else i=Array.from(a);return i}},function(t,e,r){"use strict";var n=r(92);
  1600. /*!
  1601. * ignore
  1602. */t.exports=function(t){if(null==t)return null;var e=Object.keys(t),r=e.length,i=null;if(1===r&&"_id"===e[0])i=!t._id;else for(;r--;)if("_id"!==e[r]&&n(t[e[r]])){i=!t[e[r]];break}return i}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(4);
  1603. /*!
  1604. * If populating a path within a document array, make sure each
  1605. * subdoc within the array knows its subpaths are populated.
  1606. *
  1607. * ####Example:
  1608. * const doc = await Article.findOne().populate('comments.author');
  1609. * doc.comments[0].populated('author'); // Should be set
  1610. */t.exports=function(t,e){if(null!=t._id&&null!=e&&0!==e.length){var r,i=String(t._id),s=n(e);try{for(s.s();!(r=s.n()).done;){var a=r.value;if(!a.isVirtual)for(var u=a.path.split("."),h=0;h<u.length-1;++h){var f=u.slice(0,h+1).join("."),c=u.slice(h+1).join("."),l=t.get(f);if(null!=l&&o.isMongooseDocumentArray(l)){for(var d=0;d<l.length;++d)l[d].populated(c,null==a._docs[i]?void 0:a._docs[i][d],a);break}}}}catch(t){s.e(t)}finally{s.f()}}}},function(t,e,r){"use strict";
  1611. /*!
  1612. * Module dependencies
  1613. */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 i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var s=r(350),a=r(6),u=r(57),h=r(92),f=r(41);
  1614. /*!
  1615. * Set each path query option to lean
  1616. *
  1617. * @param {Object} option
  1618. */
  1619. function c(t){return function(e){e.options||(e.options={}),null!=t&&Array.isArray(t.virtuals)&&((t=Object.assign({},t)).virtuals=t.virtuals.filter((function(t){return"string"==typeof t&&t.startsWith(e.path+".")})).map((function(t){return t.slice(e.path.length+1)}))),e.options.lean=t}}
  1620. /*!
  1621. * Handle the `WriteOpResult` from the server
  1622. */
  1623. /*!
  1624. * Prepare a set of path options for query population.
  1625. *
  1626. * @param {Query} query
  1627. * @param {Object} options
  1628. * @return {Array}
  1629. */
  1630. e.preparePopulationOptions=function(t,e){var r=t.options.populate,n=Object.keys(r).reduce((function(t,e){return t.concat([r[e]])}),[]);return null!=e.lean&&n.filter((function(t){return null==a(t,"options.lean")})).forEach(c(e.lean)),n.forEach((function(e){e._localModel=t.model})),n},
  1631. /*!
  1632. * Prepare a set of path options for query population. This is the MongooseQuery
  1633. * version
  1634. *
  1635. * @param {Query} query
  1636. * @param {Object} options
  1637. * @return {Array}
  1638. */
  1639. e.preparePopulationOptionsMQ=function(t,e){var r=t._mongooseOptions.populate,n=Object.keys(r).reduce((function(t,e){return t.concat([r[e]])}),[]);null!=e.lean&&n.filter((function(t){return null==a(t,"options.lean")})).forEach(c(e.lean));var i=a(t,"options.session",null);null!=i&&n.forEach((function(t){null!=t.options?"session"in t.options||(t.options.session=i):t.options={session:i}}));var o=t._fieldsForExec();return n.forEach((function(t){t._queryProjection=o})),n.forEach((function(e){e._localModel=t.model})),n},
  1640. /*!
  1641. * If the document is a mapped discriminator type, it returns a model instance for that type, otherwise,
  1642. * it returns an instance of the given model.
  1643. *
  1644. * @param {Model} model
  1645. * @param {Object} doc
  1646. * @param {Object} fields
  1647. *
  1648. * @return {Document}
  1649. */
  1650. e.createModel=function(t,r,n,i,o){t.hooks.execPreSync("createModel",r);var s=t.schema?t.schema.discriminatorMapping:null,a=s&&s.isRoot?s.key:null,h=r[a];if(a&&h&&t.discriminators){var c=t.discriminators[h]||u(t.discriminators,h);if(c){var l=f(i);return e.applyPaths(l,c.schema),new c(void 0,l,!0)}}var d={skipId:!0,isNew:!1,willInit:!0};return null!=o&&"defaults"in o&&(d.defaults=o.defaults),new t(void 0,n,d)},
  1651. /*!
  1652. * ignore
  1653. */
  1654. e.applyPaths=function(t,e){var r,o,u;if(t)for(u=(o=Object.keys(t)).length;u--;)if("+"!==o[u][0]){var f=t[o[u]];if(h(f)){r=!f;break}}var c=[],l=[],d=[];switch(function e(n,i){if(i||(i=""),-1!==d.indexOf(n))return[];d.push(n);var o=[];return n.eachPath((function(n,a){i&&(n=i+"."+n);var u=E(n,a);if(null!=u||Array.isArray(a)||!a.$isMongooseArray||a.$isMongooseDocumentArray||(u=E(n,a.caster)),null!=u&&o.push(u),a.schema){var h=e(a.schema,n);!1===r&&s(t,n,a.schema,c,h)}})),d.pop(),o}(e),r){case!0:var p,y=i(l);try{for(y.s();!(p=y.n()).done;){var m=p.value;t[m]=0}}catch(t){y.e(t)}finally{y.f()}break;case!1:e&&e.paths._id&&e.paths._id.options&&!1===e.paths._id.options.select&&(t._id=0);var b,v=i(c);try{for(v.s();!(b=v.n()).done;){var g=b.value;t[g]=t[g]||1}}catch(t){v.e(t)}finally{v.f()}break;case void 0:if(null==t)break;for(var w=0,_=Object.keys(t||{});w<_.length;w++){var M=_[w];M.startsWith("+")&&delete t[M]}var S,O=i(l);try{for(O.s();!(S=O.n()).done;){var A=S.value;t[A]=0}}catch(t){O.e(t)}finally{O.f()}}function E(e,i){var s="+"+e,u=t&&s in t;if(u&&delete t[s],"boolean"==typeof i.selected){if(u)return delete t[s],void(!1===r&&o.length>1&&!~o.indexOf(e)&&(t[e]=1));for(var h=e.split("."),f="",d=0;d<h.length;++d)if(f+=f.length?"."+h[d]:h[d],-1!==l.indexOf(f))return;if(!r&&a(i,"options.$skipDiscriminatorCheck",!1))for(var p="",y=0;y<h.length;++y){p+=(0===p.length?"":".")+h[y];var m=a(t,p,!1)||a(t,p+".$",!1);if(m&&"object"!==n(m))return}return(i.selected?c:l).push(e),e}}},e.handleDeleteWriteOpResult=function(t){return function(e,r){if(e)return t(e);var n=Object.assign({},r.result);return null!=a(r,"result.n",null)&&(n.deletedCount=r.result.n),null!=r.deletedCount&&(n.deletedCount=r.deletedCount),t(null,n)}}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,i){var o=Object.keys(t).reduce((function(t,r){return t||r.startsWith(e+".")}),!1),s=e+"."+r.options.discriminatorKey;o||1!==i.length||i[0]!==s||n.splice(n.indexOf(s),1)}},function(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)}t.exports=function(t){return!!t&&("object"===n(t)||"function"==typeof t)&&"function"==typeof t.then}},function(t,e,r){"use strict";var n=/\./g;t.exports=function(t){if(-1===t.indexOf("."))return[t];for(var e=t.split(n),r=e.length,i=new Array(r),o="",s=0;s<r;++s)o+=0!==o.length?"."+e[s]:e[s],i[s]=o;return i}},function(t,e,r){"use strict";
  1655. /*!
  1656. * Module dependencies.
  1657. */var n=r(14),i=r(13).EventEmitter,o=r(8),s=r(85),a=r(18),u=o.ValidationError,h=r(157),f=r(33);function c(t,e,r,i,u){if(!(this instanceof c))return new c(t,e,r,i,u);if(f(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 o.MissingSchemaError;for(var l in this.$__setSchema(e),n.call(this,t,r,i,u),h(this,e,{decorateDoc:!0}),e.methods)this[l]=e.methods[l];for(var d in e.statics)this[d]=e.statics[d]}
  1658. /*!
  1659. * Inherit from the NodeJS document
  1660. */c.prototype=Object.create(n.prototype),c.prototype.constructor=c,
  1661. /*!
  1662. * ignore
  1663. */
  1664. c.events=new i,
  1665. /*!
  1666. * Browser doc exposes the event emitter API
  1667. */
  1668. c.$emitter=new i,["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"].forEach((function(t){c[t]=function(){return c.$emitter[t].apply(c.$emitter,arguments)}})),
  1669. /*!
  1670. * Module exports.
  1671. */
  1672. c.ValidationError=u,t.exports=c}])}));